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>
*type = GB_INTERFACE_TYPE_UNKNOWN;
- if (intf->ejected)
+ if (intf->ejected || intf->removed)
return -ENODEV;
ret = gb_interface_vsys_set(intf, true);
bool disconnected;
bool ejected;
+ bool removed;
bool active;
bool enabled;
bool mode_switch;
intf->disconnected = true;
mutex_lock(&intf->mutex);
+ intf->removed = true;
gb_interface_disable(intf);
gb_interface_deactivate(intf);
mutex_unlock(&intf->mutex);