aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/cio/device.c
diff options
context:
space:
mode:
authorPeter Oberparleiter <peter.oberparleiter@de.ibm.com>2009-12-07 06:51:20 -0500
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-12-07 06:51:30 -0500
commita7ae2c02f5ab7080646a4cc6c01065ae9decad54 (patch)
tree3ecc0ff8c46076f2d5080a8cfed5f98c426c7a69 /drivers/s390/cio/device.c
parent37de53bb52908726c18fc84515792a5b2f454532 (diff)
[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: Peter Oberparleiter <peter.oberparleiter@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/cio/device.c')
-rw-r--r--drivers/s390/cio/device.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 167446785d19..ee3450667687 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -7,6 +7,10 @@
7 * Cornelia Huck (cornelia.huck@de.ibm.com) 7 * Cornelia Huck (cornelia.huck@de.ibm.com)
8 * Martin Schwidefsky (schwidefsky@de.ibm.com) 8 * Martin Schwidefsky (schwidefsky@de.ibm.com)
9 */ 9 */
10
11#define KMSG_COMPONENT "cio"
12#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
13
10#include <linux/module.h> 14#include <linux/module.h>
11#include <linux/init.h> 15#include <linux/init.h>
12#include <linux/spinlock.h> 16#include <linux/spinlock.h>
@@ -347,6 +351,14 @@ int ccw_device_set_offline(struct ccw_device *cdev)
347 spin_unlock_irq(cdev->ccwlock); 351 spin_unlock_irq(cdev->ccwlock);
348 wait_event(cdev->private->wait_q, (dev_fsm_final_state(cdev) || 352 wait_event(cdev->private->wait_q, (dev_fsm_final_state(cdev) ||
349 cdev->private->state == DEV_STATE_DISCONNECTED)); 353 cdev->private->state == DEV_STATE_DISCONNECTED));
354 /* Inform the user if set offline failed. */
355 if (cdev->private->state == DEV_STATE_BOXED) {
356 pr_warning("%s: The device entered boxed state while "
357 "being set offline\n", dev_name(&cdev->dev));
358 } else if (cdev->private->state == DEV_STATE_NOT_OPER) {
359 pr_warning("%s: The device stopped operating while "
360 "being set offline\n", dev_name(&cdev->dev));
361 }
350 /* Give up reference from ccw_device_set_online(). */ 362 /* Give up reference from ccw_device_set_online(). */
351 put_device(&cdev->dev); 363 put_device(&cdev->dev);
352 return 0; 364 return 0;
@@ -407,6 +419,16 @@ int ccw_device_set_online(struct ccw_device *cdev)
407 if ((cdev->private->state != DEV_STATE_ONLINE) && 419 if ((cdev->private->state != DEV_STATE_ONLINE) &&
408 (cdev->private->state != DEV_STATE_W4SENSE)) { 420 (cdev->private->state != DEV_STATE_W4SENSE)) {
409 spin_unlock_irq(cdev->ccwlock); 421 spin_unlock_irq(cdev->ccwlock);
422 /* Inform the user that set online failed. */
423 if (cdev->private->state == DEV_STATE_BOXED) {
424 pr_warning("%s: Setting the device online failed "
425 "because it is boxed\n",
426 dev_name(&cdev->dev));
427 } else if (cdev->private->state == DEV_STATE_NOT_OPER) {
428 pr_warning("%s: Setting the device online failed "
429 "because it is not operational\n",
430 dev_name(&cdev->dev));
431 }
410 /* Give up online reference since onlining failed. */ 432 /* Give up online reference since onlining failed. */
411 put_device(&cdev->dev); 433 put_device(&cdev->dev);
412 return -ENODEV; 434 return -ENODEV;