summaryrefslogtreecommitdiffstats
path: root/drivers/staging/greybus/module.c
diff options
context:
space:
mode:
authorJohan Hovold <johan@hovoldconsulting.com>2016-07-20 16:40:24 +0200
committerGreg Kroah-Hartman <gregkh@google.com>2016-07-20 10:16:54 -0700
commit12169bc9143ed24ad7a5ea12a7c28d1dba891131 (patch)
treec940d71ec18aa1fd6dcf08d48d17d15bcc5242a2 /drivers/staging/greybus/module.c
parent62491622db9c9b6a51630f4c8c653f59c2c834f9 (diff)
downloadlinux-12169bc9143ed24ad7a5ea12a7c28d1dba891131.tar.gz
linux-12169bc9143ed24ad7a5ea12a7c28d1dba891131.tar.bz2
linux-12169bc9143ed24ad7a5ea12a7c28d1dba891131.zip
greybus: interface: prevent reactivation during removal
Make sure to prevent an interface that is going away from being reactivated. This is needed to preemptively close a race between the upcoming feature to reactivate a powered-down interface and physical removal (i.e. module_removed event processing) as well as logical removal (e.g. the current system-suspend hack). Reviewed-by: Sandeep Patil <sspatil@google.com> Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Patrick Titiano <ptitiano@baylibre.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/module.c')
-rw-r--r--drivers/staging/greybus/module.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/staging/greybus/module.c b/drivers/staging/greybus/module.c
index d506fa0b3272..69f67ddbd4a3 100644
--- a/drivers/staging/greybus/module.c
+++ b/drivers/staging/greybus/module.c
@@ -186,6 +186,7 @@ static void gb_module_deregister_interface(struct gb_interface *intf)
intf->disconnected = true;
mutex_lock(&intf->mutex);
+ intf->removed = true;
gb_interface_disable(intf);
gb_interface_deactivate(intf);
mutex_unlock(&intf->mutex);