mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [char-misc-next 1/9] mei: bus: cancel and disable callback after release call
@ 2017-01-27 14:32 Tomas Winkler
  2017-01-27 14:32 ` [char-misc-next 2/9] mei: bus: prevent hardware module unload if device on bus is active Tomas Winkler
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Tomas Winkler @ 2017-01-27 14:32 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Alexander Usyskin, linux-kernel, Tomas Winkler

From: Alexander Usyskin <alexander.usyskin@intel.com>

A driver on the mei bus may rely on the availability
of the receive callback during driver remove() call, e.g. mei_wdt.
Move callbacks dismantling after the remove() call to unblock that scenario.

Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
---
 drivers/misc/mei/bus.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
index 2d9c5dd06e42..3bb1f1500f6b 100644
--- a/drivers/misc/mei/bus.c
+++ b/drivers/misc/mei/bus.c
@@ -665,6 +665,10 @@ static int mei_cl_device_remove(struct device *dev)
 	if (!cldev || !dev->driver)
 		return 0;
 
+	cldrv = to_mei_cl_driver(dev->driver);
+	if (cldrv->remove)
+		ret = cldrv->remove(cldev);
+
 	if (cldev->rx_cb) {
 		cancel_work_sync(&cldev->rx_work);
 		cldev->rx_cb = NULL;
@@ -674,10 +678,6 @@ static int mei_cl_device_remove(struct device *dev)
 		cldev->notif_cb = NULL;
 	}
 
-	cldrv = to_mei_cl_driver(dev->driver);
-	if (cldrv->remove)
-		ret = cldrv->remove(cldev);
-
 	module_put(THIS_MODULE);
 	dev->driver = NULL;
 	return ret;
-- 
2.7.4

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-01-27 13:41 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-27 14:32 [char-misc-next 1/9] mei: bus: cancel and disable callback after release call Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 2/9] mei: bus: prevent hardware module unload if device on bus is active Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 3/9] mei: bus: unregister callbacks upon me client disable call Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 4/9] mei: return error on notification request to a disconnected client Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 5/9] mei: abort waiting for notification on unsupported HW Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 6/9] mei: amthif: clean command queue upon disconnection Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 7/9] mei: amthif: allow the read completion after close Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 8/9] mei: replace callback structures used as list head by list_head Tomas Winkler
2017-01-27 14:32 ` [char-misc-next 9/9] mei: revamp io list cleanup function Tomas Winkler

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®