Skip to contentSkip to conversation

mei: corner cases bug fixes

PATCH In review Tomas Winkler 2 participants 4 messages Jul 17, 2014 – Jul 20, 2014 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

cover mei: corner cases bug fixes

Set of fixes that covers few corner cases

Alexander Usyskin (5):
mei: reset client connection state on timeout
mei: start disconnect request timer consistently
mei: don't schedule suspend in pm idle
mei: nfc: clean nfc internal struct on host exit
mei: fix return value on disconnect timeout

 drivers/misc/mei/client.c  | 17 +++++++----------
 drivers/misc/mei/nfc.c     |  1 +
 drivers/misc/mei/pci-me.c  |  2 +-
 drivers/misc/mei/pci-txe.c |  2 +-
 4 files changed, 10 insertions(+), 12 deletions(-)
Signature · 1 line
1.9.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw

Re: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit

Quoted 26 lines · Tomas Winkler

From: Alexander Usyskin <[email protected]>

NFC internal structure cleaning was dropped by commit

commit 5ad1550a15cd5b75ed8aa3009e162822f720375e

Author: Tomas Winkler <[email protected]>
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.

---
 drivers/misc/mei/nfc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/misc/mei/nfc.c +0 -0
index 3095fc5..257f01f 100644

drivers/misc/mei/nfc.c void mei_nfc_host_exit(struct mei_device *dev) · line 556

Quoted 4 lines
drivers/misc/mei/nfc.c +1 -0
@@ -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

#3 lore raw

RE: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit

Quoted 10 lines

Review void mei_nfc_host_exit(struct mei_device *dev) · line 556

Quoted 5 lines
(quoted diff) +1 -0
@@ -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

#4 lore raw

Re: [char-misc-next 4/5] mei: nfc: clean nfc internal struct on host exit

Quoted 10 lines · Tomas
Quoted 10 lines

Review void mei_nfc_host_exit(struct mei_device *dev) · line 556

Quoted 5 lines
(quoted diff) +1 -0
@@ -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.

Quoted 3 lines

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