From 9cd67421977a701272820987ff9e6f197b1b97b7 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Thu, 25 Dec 2008 13:39:06 +0100 Subject: [S390] cio: Fix reference counting for online/offline. The current code attempts to get an extra reference count for online devices by doing a get_device() in ccw_device_online() and a put_device() in ccw_device_done(). However, this - incorrectly obtains an extra reference for disconnected devices becoming available again (since they are already online) - needs special checks for css_init_done in order to handle the console device - is not obvious and - may incorretly drop a reference count in ccw_device_done() if that function is called after path verification for a device that just became not operational. So let's just get the reference in ccw_device_set_online() and drop it in ccw_device_set_offline(). (Unfortunately, we still need the special case in io_subchannel_probe().) Signed-off-by: Cornelia Huck Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/device_fsm.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'drivers/s390/cio/device_fsm.c') diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 10bc03940fb3..01330cf5ae5e 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -399,9 +399,6 @@ ccw_device_done(struct ccw_device *cdev, int state) ccw_device_oper_notify(cdev); } wake_up(&cdev->private->wait_q); - - if (css_init_done && state != DEV_STATE_ONLINE) - put_device (&cdev->dev); } static int cmp_pgid(struct pgid *p1, struct pgid *p2) @@ -611,8 +608,6 @@ ccw_device_online(struct ccw_device *cdev) (cdev->private->state != DEV_STATE_BOXED)) return -EINVAL; sch = to_subchannel(cdev->dev.parent); - if (css_init_done && !get_device(&cdev->dev)) - return -ENODEV; ret = cio_enable_subchannel(sch, (u32)(addr_t)sch); if (ret != 0) { /* Couldn't enable the subchannel for i/o. Sick device. */ -- cgit v1.2.3