提交 a7ae2c02 编写于 作者: P Peter Oberparleiter 提交者: Martin Schwidefsky

[S390] cio: inform user when online/offline processing fails

Print a warning message in case a ccw device enters boxed or
not operational state during online/offline processing.
Signed-off-by: NPeter Oberparleiter <peter.oberparleiter@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
上级 37de53bb
...@@ -7,6 +7,10 @@ ...@@ -7,6 +7,10 @@
* Cornelia Huck (cornelia.huck@de.ibm.com) * Cornelia Huck (cornelia.huck@de.ibm.com)
* Martin Schwidefsky (schwidefsky@de.ibm.com) * Martin Schwidefsky (schwidefsky@de.ibm.com)
*/ */
#define KMSG_COMPONENT "cio"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
...@@ -347,6 +351,14 @@ int ccw_device_set_offline(struct ccw_device *cdev) ...@@ -347,6 +351,14 @@ int ccw_device_set_offline(struct ccw_device *cdev)
spin_unlock_irq(cdev->ccwlock); spin_unlock_irq(cdev->ccwlock);
wait_event(cdev->private->wait_q, (dev_fsm_final_state(cdev) || wait_event(cdev->private->wait_q, (dev_fsm_final_state(cdev) ||
cdev->private->state == DEV_STATE_DISCONNECTED)); cdev->private->state == DEV_STATE_DISCONNECTED));
/* Inform the user if set offline failed. */
if (cdev->private->state == DEV_STATE_BOXED) {
pr_warning("%s: The device entered boxed state while "
"being set offline\n", dev_name(&cdev->dev));
} else if (cdev->private->state == DEV_STATE_NOT_OPER) {
pr_warning("%s: The device stopped operating while "
"being set offline\n", dev_name(&cdev->dev));
}
/* Give up reference from ccw_device_set_online(). */ /* Give up reference from ccw_device_set_online(). */
put_device(&cdev->dev); put_device(&cdev->dev);
return 0; return 0;
...@@ -407,6 +419,16 @@ int ccw_device_set_online(struct ccw_device *cdev) ...@@ -407,6 +419,16 @@ int ccw_device_set_online(struct ccw_device *cdev)
if ((cdev->private->state != DEV_STATE_ONLINE) && if ((cdev->private->state != DEV_STATE_ONLINE) &&
(cdev->private->state != DEV_STATE_W4SENSE)) { (cdev->private->state != DEV_STATE_W4SENSE)) {
spin_unlock_irq(cdev->ccwlock); spin_unlock_irq(cdev->ccwlock);
/* Inform the user that set online failed. */
if (cdev->private->state == DEV_STATE_BOXED) {
pr_warning("%s: Setting the device online failed "
"because it is boxed\n",
dev_name(&cdev->dev));
} else if (cdev->private->state == DEV_STATE_NOT_OPER) {
pr_warning("%s: Setting the device online failed "
"because it is not operational\n",
dev_name(&cdev->dev));
}
/* Give up online reference since onlining failed. */ /* Give up online reference since onlining failed. */
put_device(&cdev->dev); put_device(&cdev->dev);
return -ENODEV; return -ENODEV;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册