aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2013-10-17 10:20:22 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-19 22:53:46 -0400
commiteec86b8e85309a2cb0b33bcb361c67d81ebed474 (patch)
tree3991079f6ce61bc45da313fa11993dc4cd54b683 /drivers/misc
parented6f7ac1dcae0b95ef2946067beb4ffaba415119 (diff)
mei: move host_clients_map cleanup to device init
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@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/mei/client.c9
-rw-r--r--drivers/misc/mei/init.c8
2 files changed, 8 insertions, 9 deletions
diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
index a48c0e71e69d..0ccc22ce0904 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)
365 365
366 mutex_lock(&dev->device_lock); 366 mutex_lock(&dev->device_lock);
367 367
368 bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
369 dev->open_handle_count = 0;
370
371 /*
372 * Reserving the first three client IDs
373 * 0: Reserved for MEI Bus Message communications
374 */
375 bitmap_set(dev->host_clients_map, 0, 1);
376
377 for (i = 0; i < dev->me_clients_num; i++) { 368 for (i = 0; i < dev->me_clients_num; i++) {
378 client_props = &dev->me_clients[i].props; 369 client_props = &dev->me_clients[i].props;
379 370
diff --git a/drivers/misc/mei/init.c b/drivers/misc/mei/init.c
index a7d29a7dcab2..c32d45209cc6 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)
68 mei_io_list_init(&dev->amthif_cmd_list); 68 mei_io_list_init(&dev->amthif_cmd_list);
69 mei_io_list_init(&dev->amthif_rd_complete_list); 69 mei_io_list_init(&dev->amthif_rd_complete_list);
70 70
71 bitmap_zero(dev->host_clients_map, MEI_CLIENTS_MAX);
72 dev->open_handle_count = 0;
73
74 /*
75 * Reserving the first client ID
76 * 0: Reserved for MEI Bus Message communications
77 */
78 bitmap_set(dev->host_clients_map, 0, 1);
71} 79}
72EXPORT_SYMBOL_GPL(mei_device_init); 80EXPORT_SYMBOL_GPL(mei_device_init);
73 81