aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd_diag.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd_diag.c')
-rw-r--r--drivers/s390/block/dasd_diag.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index 4e49b4a6c88..f64d0db881b 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -24,7 +24,6 @@
24#include <asm/ebcdic.h> 24#include <asm/ebcdic.h>
25#include <asm/io.h> 25#include <asm/io.h>
26#include <asm/s390_ext.h> 26#include <asm/s390_ext.h>
27#include <asm/todclk.h>
28#include <asm/vtoc.h> 27#include <asm/vtoc.h>
29#include <asm/diag.h> 28#include <asm/diag.h>
30 29
@@ -145,6 +144,15 @@ dasd_diag_erp(struct dasd_device *device)
145 144
146 mdsk_term_io(device); 145 mdsk_term_io(device);
147 rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); 146 rc = mdsk_init_io(device, device->block->bp_block, 0, NULL);
147 if (rc == 4) {
148 if (!(device->features & DASD_FEATURE_READONLY)) {
149 dev_warn(&device->cdev->dev,
150 "The access mode of a DIAG device changed"
151 " to read-only");
152 device->features |= DASD_FEATURE_READONLY;
153 }
154 rc = 0;
155 }
148 if (rc) 156 if (rc)
149 dev_warn(&device->cdev->dev, "DIAG ERP failed with " 157 dev_warn(&device->cdev->dev, "DIAG ERP failed with "
150 "rc=%d\n", rc); 158 "rc=%d\n", rc);
@@ -433,16 +441,20 @@ dasd_diag_check_device(struct dasd_device *device)
433 for (sb = 512; sb < bsize; sb = sb << 1) 441 for (sb = 512; sb < bsize; sb = sb << 1)
434 block->s2b_shift++; 442 block->s2b_shift++;
435 rc = mdsk_init_io(device, block->bp_block, 0, NULL); 443 rc = mdsk_init_io(device, block->bp_block, 0, NULL);
436 if (rc) { 444 if (rc && (rc != 4)) {
437 dev_warn(&device->cdev->dev, "DIAG initialization " 445 dev_warn(&device->cdev->dev, "DIAG initialization "
438 "failed with rc=%d\n", rc); 446 "failed with rc=%d\n", rc);
439 rc = -EIO; 447 rc = -EIO;
440 } else { 448 } else {
449 if (rc == 4)
450 device->features |= DASD_FEATURE_READONLY;
441 dev_info(&device->cdev->dev, 451 dev_info(&device->cdev->dev,
442 "New DASD with %ld byte/block, total size %ld KB\n", 452 "New DASD with %ld byte/block, total size %ld KB%s\n",
443 (unsigned long) block->bp_block, 453 (unsigned long) block->bp_block,
444 (unsigned long) (block->blocks << 454 (unsigned long) (block->blocks <<
445 block->s2b_shift) >> 1); 455 block->s2b_shift) >> 1,
456 (rc == 4) ? ", read-only device" : "");
457 rc = 0;
446 } 458 }
447out_label: 459out_label:
448 free_page((long) label); 460 free_page((long) label);