From: Sebastian Ott Date: Wed, 5 Sep 2012 12:18:22 +0000 (+0200) Subject: s390/dasd: move wake_up call X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1f08be80bef6f7a3faaa728db836b47ff742f41f;p=linux-beck.git s390/dasd: move wake_up call Ensure that all work is done when the process waiting for a dasd state change is woken up. With this change it is save to assume that after a userspace triggered state change and a udev settle invocation there are no unexpected users of a dasd device. Acked-by: Stefan Weinhuber Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 15370a2c5ff0..6498d15f874f 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -534,11 +534,11 @@ static void dasd_change_state(struct dasd_device *device) if (rc) device->target = device->state; - if (device->state == device->target) - wake_up(&dasd_init_waitq); - /* let user-space know that the device status changed */ kobject_uevent(&device->cdev->dev.kobj, KOBJ_CHANGE); + + if (device->state == device->target) + wake_up(&dasd_init_waitq); } /*