Mailing List Archive

Re: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit
On Thu, Jul 17, 2014 at 10:53:37AM +0300, Tomas Winkler wrote:
> From: Alexander Usyskin <alexander.usyskin@intel.com>
>
> NFC internal structure cleaning was dropped by commit
>
> commit 5ad1550a15cd5b75ed8aa3009e162822f720375e
> Author: Tomas Winkler <tomas.winkler@intel.com>
> Date: Sun Jan 26 11:53:06 2014 +0200
>
> mei: Remove all bus devices from the mei_dev list when stopping the MEI
>
> Bring back cleaning of structure only, because it broke
> host init after host exit scenario (like after S3):
> mei_nfc_host_init checks ndev->cl_info and does nothing if it's dirty.
>
> Cc: stable@vger.kernel.org # 3.15+
> Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
> ---
> drivers/misc/mei/nfc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/misc/mei/nfc.c b/drivers/misc/mei/nfc.c
> index 3095fc5..257f01f 100644
> --- a/drivers/misc/mei/nfc.c
> +++ b/drivers/misc/mei/nfc.c
> @@ -553,6 +553,7 @@ void mei_nfc_host_exit(struct mei_device *dev)
> {
> struct mei_nfc_dev *ndev = &nfc_dev;
> cancel_work_sync(&ndev->init_work);
> + memset(ndev, 0, sizeof(struct mei_nfc_dev));

This implies that something is using a "static" device structure, which
isn't allowed by the driver core. So please fix the root cause here,
don't paper over the bug.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
RE: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit [ In reply to ]
> > @@ -553,6 +553,7 @@ void mei_nfc_host_exit(struct mei_device *dev)
> > {
> > struct mei_nfc_dev *ndev = &nfc_dev;
> > cancel_work_sync(&ndev->init_work);
> > + memset(ndev, 0, sizeof(struct mei_nfc_dev));
>
> This implies that something is using a "static" device structure, which
> isn't allowed by the driver core. So please fix the root cause here,
> don't paper over the bug.
>
You are partially correct as this is not the 'struct device' it just a nfc singleton in any case it is not really nice
and we have the fix in queue but it is rather extensive rework and I guess it won't be suitable for stable
so hence this one liner fix.

Thanks
Tomas


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Re: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit [ In reply to ]
On Sun, Jul 20, 2014 at 06:30:16AM +0000, Winkler, Tomas wrote:
> > > @@ -553,6 +553,7 @@ void mei_nfc_host_exit(struct mei_device *dev)
> > > {
> > > struct mei_nfc_dev *ndev = &nfc_dev;
> > > cancel_work_sync(&ndev->init_work);
> > > + memset(ndev, 0, sizeof(struct mei_nfc_dev));
> >
> > This implies that something is using a "static" device structure, which
> > isn't allowed by the driver core. So please fix the root cause here,
> > don't paper over the bug.
> >
> You are partially correct as this is not the 'struct device' it just a nfc singleton in any case it is not really nice
> and we have the fix in queue but it is rather extensive rework and I guess it won't be suitable for stable
> so hence this one liner fix.

It shouldn't be a huge rework to make a static variable dynamic, right?
Please do it correctly.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/