diff options
author | Horst Hummel <horst.hummel@de.ibm.com> | 2005-09-03 18:57:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@evo.osdl.org> | 2005-09-05 03:06:26 -0400 |
commit | c6eb7b7703ac4b3401b74f411c8c51ded214bf19 (patch) | |
tree | 1cb3563cb83f80347dbc3e4bd30c4635d401e87a /drivers/s390/block/dasd.c | |
parent | 942eaabd5d77522223a311ed9bddaaa3cefde27d (diff) |
[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 <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index d5f53980749b..8fc891a9d47f 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -7,7 +7,7 @@ | |||
7 | * Bugreports.to..: <Linux390@de.ibm.com> | 7 | * Bugreports.to..: <Linux390@de.ibm.com> |
8 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 | 8 | * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 |
9 | * | 9 | * |
10 | * $Revision: 1.165 $ | 10 | * $Revision: 1.167 $ |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/config.h> | 13 | #include <linux/config.h> |
@@ -1131,17 +1131,13 @@ __dasd_process_blk_queue(struct dasd_device * device) | |||
1131 | request_queue_t *queue; | 1131 | request_queue_t *queue; |
1132 | struct request *req; | 1132 | struct request *req; |
1133 | struct dasd_ccw_req *cqr; | 1133 | struct dasd_ccw_req *cqr; |
1134 | int nr_queued, feature_ro; | 1134 | int nr_queued; |
1135 | 1135 | ||
1136 | queue = device->request_queue; | 1136 | queue = device->request_queue; |
1137 | /* No queue ? Then there is nothing to do. */ | 1137 | /* No queue ? Then there is nothing to do. */ |
1138 | if (queue == NULL) | 1138 | if (queue == NULL) |
1139 | return; | 1139 | return; |
1140 | 1140 | ||
1141 | feature_ro = dasd_get_feature(device->cdev, DASD_FEATURE_READONLY); | ||
1142 | if (feature_ro < 0) /* no devmap */ | ||
1143 | return; | ||
1144 | |||
1145 | /* | 1141 | /* |
1146 | * We requeue request from the block device queue to the ccw | 1142 | * We requeue request from the block device queue to the ccw |
1147 | * queue only in two states. In state DASD_STATE_READY the | 1143 | * queue only in two states. In state DASD_STATE_READY the |
@@ -1162,7 +1158,8 @@ __dasd_process_blk_queue(struct dasd_device * device) | |||
1162 | nr_queued < DASD_CHANQ_MAX_SIZE) { | 1158 | nr_queued < DASD_CHANQ_MAX_SIZE) { |
1163 | req = elv_next_request(queue); | 1159 | req = elv_next_request(queue); |
1164 | 1160 | ||
1165 | if (feature_ro && rq_data_dir(req) == WRITE) { | 1161 | if (device->features & DASD_FEATURE_READONLY && |
1162 | rq_data_dir(req) == WRITE) { | ||
1166 | DBF_DEV_EVENT(DBF_ERR, device, | 1163 | DBF_DEV_EVENT(DBF_ERR, device, |
1167 | "Rejecting write request %p", | 1164 | "Rejecting write request %p", |
1168 | req); | 1165 | req); |
@@ -1814,17 +1811,13 @@ dasd_generic_set_online (struct ccw_device *cdev, | |||
1814 | 1811 | ||
1815 | { | 1812 | { |
1816 | struct dasd_device *device; | 1813 | struct dasd_device *device; |
1817 | int feature_diag, rc; | 1814 | int rc; |
1818 | 1815 | ||
1819 | device = dasd_create_device(cdev); | 1816 | device = dasd_create_device(cdev); |
1820 | if (IS_ERR(device)) | 1817 | if (IS_ERR(device)) |
1821 | return PTR_ERR(device); | 1818 | return PTR_ERR(device); |
1822 | 1819 | ||
1823 | feature_diag = dasd_get_feature(cdev, DASD_FEATURE_USEDIAG); | 1820 | if (device->features & DASD_FEATURE_USEDIAG) { |
1824 | if (feature_diag < 0) | ||
1825 | return feature_diag; | ||
1826 | |||
1827 | if (feature_diag) { | ||
1828 | if (!dasd_diag_discipline_pointer) { | 1821 | if (!dasd_diag_discipline_pointer) { |
1829 | printk (KERN_WARNING | 1822 | printk (KERN_WARNING |
1830 | "dasd_generic couldn't online device %s " | 1823 | "dasd_generic couldn't online device %s " |