Commit 350e9120 authored by Peter Oberparleiter's avatar Peter Oberparleiter Committed by Martin Schwidefsky

[S390] cio: allow setting not-operational devices offline

Accept a request for setting a not-operational device offline.
This way, users can remove devices from Linux which would otherwise
remain unusable until reboot.
Signed-off-by: default avatarPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 9679baaf
...@@ -529,11 +529,10 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, ...@@ -529,11 +529,10 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr,
int force, ret; int force, ret;
unsigned long i; unsigned long i;
if ((cdev->private->state != DEV_STATE_OFFLINE && if (!dev_fsm_final_state(cdev) &&
cdev->private->state != DEV_STATE_ONLINE && cdev->private->state != DEV_STATE_DISCONNECTED)
cdev->private->state != DEV_STATE_BOXED && return -EAGAIN;
cdev->private->state != DEV_STATE_DISCONNECTED) || if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0)
return -EAGAIN; return -EAGAIN;
if (cdev->drv && !try_module_get(cdev->drv->owner)) { if (cdev->drv && !try_module_get(cdev->drv->owner)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment