[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1382019622-7768-1-git-send-email-tomas.winkler@intel.com>
Date: Thu, 17 Oct 2013 17:20:22 +0300
From: Tomas Winkler <tomas.winkler@...el.com>
To: gregkh@...uxfoundation.org
Cc: arnd@...db.de, linux-kernel@...r.kernel.org,
stable@...r.kernel.org,
Alexander Usyskin <alexander.usyskin@...el.com>,
Tomas Winkler <tomas.winkler@...el.com>
Subject: [char-misc] mei: move host_clients_map cleanup to device init
From: Alexander Usyskin <alexander.usyskin@...el.com>
Move host_clients_map cleanup from host client init to device init.
This fixes bug where we cleaned up the bitmask that servers as pool for
host client ids while file descriptors are kept open during suspend.
On resume a new connection will be assigned id that is already taken
by opened file descriptor. Consequently read/write will fail due to
mismatched book keeping.
Signed-off-by: Alexander Usyskin <alexander.usyskin@...el.com>
Signed-off-by: Tomas Winkler <tomas.winkler@...el.com>
---
drivers/misc/mei/client.c | 9 ---------
drivers/misc/mei/init.c | 8 ++++++++
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index a48c0e7..0ccc22c 100644
--- a/drivers/misc/mei/client.c
+++ b/drivers/misc/mei/client.c
@@ -365,15 +365,6 @@ void mei_host_client_init(struct work_struct *work)
mutex_lock(&dev->device_lock);
- bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
- dev->open_handle_count = 0;
-
- /*
- * Reserving the first three client IDs
- * 0: Reserved for MEI Bus Message communications
- */
- bitmap_set(dev->host_clients_map, 0, 1);
-
for (i = 0; i < dev->me_clients_num; i++) {
client_props = &dev->me_clients[i].props;
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index bcb4a6b..4c93e3d 100644
--- a/drivers/misc/mei/init.c
+++ b/drivers/misc/mei/init.c
@@ -68,6 +68,14 @@ void mei_device_init(struct mei_device *dev)
mei_io_list_init(&dev->amthif_cmd_list);
mei_io_list_init(&dev->amthif_rd_complete_list);
+ bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
+ dev->open_handle_count = 0;
+
+ /*
+ * Reserving the first client ID
+ * 0: Reserved for MEI Bus Message communications
+ */
+ bitmap_set(dev->host_clients_map, 0, 1);
}
EXPORT_SYMBOL_GPL(mei_device_init);
--
1.8.3.1
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists