From c6eb7b7703ac4b3401b74f411c8c51ded214bf19 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Sat, 3 Sep 2005 15:57:58 -0700 Subject: [PATCH] s390: deadlock in dasd_devmap Reintroduce a read-only copy of the devmap features in the device struct. This is necessary to solve a deadlock on the dasd_devmap_lock which is acquired by dasd_get_features called from the dasd tasklet. The current implementation of devmap doesn't allow to call any devmap function from interrupt or softirq context. Signed-off-by: Horst Hummel Signed-off-by: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd_devmap.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers/s390/block/dasd_devmap.c') diff --git a/drivers/s390/block/dasd_devmap.c b/drivers/s390/block/dasd_devmap.c index d948566bb24..bda896d9d78 100644 --- a/drivers/s390/block/dasd_devmap.c +++ b/drivers/s390/block/dasd_devmap.c @@ -11,7 +11,7 @@ * functions may not be called from interrupt context. In particular * dasd_get_device is a no-no from interrupt context. * - * $Revision: 1.40 $ + * $Revision: 1.43 $ */ #include @@ -513,6 +513,7 @@ dasd_create_device(struct ccw_device *cdev) if (!devmap->device) { devmap->device = device; device->devindex = devmap->devindex; + device->features = devmap->features; get_device(&cdev->dev); device->cdev = cdev; rc = 0; @@ -643,6 +644,8 @@ dasd_ro_store(struct device *dev, struct device_attribute *attr, const char *buf devmap->features |= DASD_FEATURE_READONLY; else devmap->features &= ~DASD_FEATURE_READONLY; + if (devmap->device) + devmap->device->features = devmap->features; if (devmap->device && devmap->device->gdp) set_disk_ro(devmap->device->gdp, ro_flag); spin_unlock(&dasd_devmap_lock); @@ -758,7 +761,8 @@ dasd_set_feature(struct ccw_device *cdev, int feature, int flag) devmap->features |= feature; else devmap->features &= ~feature; - + if (devmap->device) + devmap->device->features = devmap->features; spin_unlock(&dasd_devmap_lock); return 0; } -- cgit v1.2.3