mei: bus: move hw module get/put to probe/release
authorAlexander Usyskin <alexander.usyskin@intel.com>
Mon, 25 Feb 2019 09:09:28 +0000 (11:09 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:09:39 +0000 (20:09 +0100)
commita253d1f3e490068fb017855da481762c53f01ab5
tree955c9b60517df6ef58d4b48cf4e9e8b654e7574b
parent02c0c70fb36e60f4548072803734552e86447b18
mei: bus: move hw module get/put to probe/release

commit b5958faa34e2f99f3475ad89c52d98dfea079d33 upstream.

Fix unbalanced module reference counting during internal reset, which
prevents the drivers unloading.
Tracking mei_me/txe modules on mei client bus via
mei_cldev_enable/disable is error prone due to possible internal
reset flow, where clients are disconnected underneath.
Moving reference counting to probe and release of mei bus client
driver solves this issue in simplest way, as each client provides only
a single connection to a client bus driver.

Cc: <stable@vger.kernel.org>
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>
drivers/misc/mei/bus.c