Commit fc19f381 authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

[S390] dasd: message cleanup

Moved some Messages into s390 debug feature and changed remaining
messages to use the dev_xxx and pr_xxx macros.
Signed-off-by: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent f3eb5384
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
#include <linux/kmod.h> #include <linux/kmod.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -222,7 +225,7 @@ static int dasd_state_known_to_basic(struct dasd_device *device) ...@@ -222,7 +225,7 @@ static int dasd_state_known_to_basic(struct dasd_device *device)
return rc; return rc;
} }
/* register 'device' debug area, used for all DBF_DEV_XXX calls */ /* register 'device' debug area, used for all DBF_DEV_XXX calls */
device->debug_area = debug_register(dev_name(&device->cdev->dev), 1, 1, device->debug_area = debug_register(dev_name(&device->cdev->dev), 4, 1,
8 * sizeof(long)); 8 * sizeof(long));
debug_register_view(device->debug_area, &debug_sprintf_view); debug_register_view(device->debug_area, &debug_sprintf_view);
debug_set_level(device->debug_area, DBF_WARNING); debug_set_level(device->debug_area, DBF_WARNING);
...@@ -763,7 +766,7 @@ static inline int dasd_check_cqr(struct dasd_ccw_req *cqr) ...@@ -763,7 +766,7 @@ static inline int dasd_check_cqr(struct dasd_ccw_req *cqr)
return -EINVAL; return -EINVAL;
device = cqr->startdev; device = cqr->startdev;
if (strncmp((char *) &cqr->magic, device->discipline->ebcname, 4)) { if (strncmp((char *) &cqr->magic, device->discipline->ebcname, 4)) {
DEV_MESSAGE(KERN_WARNING, device, DBF_DEV_EVENT(DBF_WARNING, device,
" dasd_ccw_req 0x%08x magic doesn't match" " dasd_ccw_req 0x%08x magic doesn't match"
" discipline 0x%08x", " discipline 0x%08x",
cqr->magic, cqr->magic,
...@@ -783,6 +786,7 @@ int dasd_term_IO(struct dasd_ccw_req *cqr) ...@@ -783,6 +786,7 @@ int dasd_term_IO(struct dasd_ccw_req *cqr)
{ {
struct dasd_device *device; struct dasd_device *device;
int retries, rc; int retries, rc;
char errorstring[ERRORLENGTH];
/* Check the cqr */ /* Check the cqr */
rc = dasd_check_cqr(cqr); rc = dasd_check_cqr(cqr);
...@@ -816,10 +820,10 @@ int dasd_term_IO(struct dasd_ccw_req *cqr) ...@@ -816,10 +820,10 @@ int dasd_term_IO(struct dasd_ccw_req *cqr)
"device busy, retry later"); "device busy, retry later");
break; break;
default: default:
DEV_MESSAGE(KERN_ERR, device, /* internal error 10 - unknown rc*/
"line %d unknown RC=%d, please " snprintf(errorstring, ERRORLENGTH, "10 %d", rc);
"report to linux390@de.ibm.com", dev_err(&device->cdev->dev, "An error occurred in the "
__LINE__, rc); "DASD device driver, reason=%s\n", errorstring);
BUG(); BUG();
break; break;
} }
...@@ -837,6 +841,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) ...@@ -837,6 +841,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
{ {
struct dasd_device *device; struct dasd_device *device;
int rc; int rc;
char errorstring[ERRORLENGTH];
/* Check the cqr */ /* Check the cqr */
rc = dasd_check_cqr(cqr); rc = dasd_check_cqr(cqr);
...@@ -844,9 +849,10 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) ...@@ -844,9 +849,10 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
return rc; return rc;
device = (struct dasd_device *) cqr->startdev; device = (struct dasd_device *) cqr->startdev;
if (cqr->retries < 0) { if (cqr->retries < 0) {
DEV_MESSAGE(KERN_DEBUG, device, /* internal error 14 - start_IO run out of retries */
"start_IO: request %p (%02x/%i) - no retry left.", sprintf(errorstring, "14 %p", cqr);
cqr, cqr->status, cqr->retries); dev_err(&device->cdev->dev, "An error occurred in the DASD "
"device driver, reason=%s\n", errorstring);
cqr->status = DASD_CQR_ERROR; cqr->status = DASD_CQR_ERROR;
return -EIO; return -EIO;
} }
...@@ -868,11 +874,11 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) ...@@ -868,11 +874,11 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
cqr); cqr);
break; break;
case -EBUSY: case -EBUSY:
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"start_IO: device busy, retry later"); "start_IO: device busy, retry later");
break; break;
case -ETIMEDOUT: case -ETIMEDOUT:
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"start_IO: request timeout, retry later"); "start_IO: request timeout, retry later");
break; break;
case -EACCES: case -EACCES:
...@@ -882,7 +888,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) ...@@ -882,7 +888,7 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
* Do a retry with all available pathes. * Do a retry with all available pathes.
*/ */
cqr->lpm = LPM_ANYPATH; cqr->lpm = LPM_ANYPATH;
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"start_IO: selected pathes gone," "start_IO: selected pathes gone,"
" retry on all pathes"); " retry on all pathes");
break; break;
...@@ -891,13 +897,15 @@ int dasd_start_IO(struct dasd_ccw_req *cqr) ...@@ -891,13 +897,15 @@ int dasd_start_IO(struct dasd_ccw_req *cqr)
"start_IO: -ENODEV device gone, retry"); "start_IO: -ENODEV device gone, retry");
break; break;
case -EIO: case -EIO:
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"start_IO: -EIO device gone, retry"); "start_IO: -EIO device gone, retry");
break; break;
default: default:
DEV_MESSAGE(KERN_ERR, device, /* internal error 11 - unknown rc */
"line %d unknown RC=%d, please report" snprintf(errorstring, ERRORLENGTH, "11 %d", rc);
" to linux390@de.ibm.com", __LINE__, rc); dev_err(&device->cdev->dev,
"An error occurred in the DASD device driver, "
"reason=%s\n", errorstring);
BUG(); BUG();
break; break;
} }
...@@ -954,7 +962,7 @@ static void dasd_handle_killed_request(struct ccw_device *cdev, ...@@ -954,7 +962,7 @@ static void dasd_handle_killed_request(struct ccw_device *cdev,
return; return;
cqr = (struct dasd_ccw_req *) intparm; cqr = (struct dasd_ccw_req *) intparm;
if (cqr->status != DASD_CQR_IN_IO) { if (cqr->status != DASD_CQR_IN_IO) {
MESSAGE(KERN_DEBUG, DBF_EVENT(DBF_DEBUG,
"invalid status in handle_killed_request: " "invalid status in handle_killed_request: "
"bus_id %s, status %02x", "bus_id %s, status %02x",
dev_name(&cdev->dev), cqr->status); dev_name(&cdev->dev), cqr->status);
...@@ -965,8 +973,8 @@ static void dasd_handle_killed_request(struct ccw_device *cdev, ...@@ -965,8 +973,8 @@ static void dasd_handle_killed_request(struct ccw_device *cdev,
if (device == NULL || if (device == NULL ||
device != dasd_device_from_cdev_locked(cdev) || device != dasd_device_from_cdev_locked(cdev) ||
strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
MESSAGE(KERN_DEBUG, "invalid device in request: bus_id %s", DBF_DEV_EVENT(DBF_DEBUG, device, "invalid device in request: "
dev_name(&cdev->dev)); "bus_id %s", dev_name(&cdev->dev));
return; return;
} }
...@@ -1005,11 +1013,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1005,11 +1013,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
case -EIO: case -EIO:
break; break;
case -ETIMEDOUT: case -ETIMEDOUT:
printk(KERN_WARNING"%s(%s): request timed out\n", DBF_EVENT(DBF_WARNING, "%s(%s): request timed out\n",
__func__, dev_name(&cdev->dev)); __func__, dev_name(&cdev->dev));
break; break;
default: default:
printk(KERN_WARNING"%s(%s): unknown error %ld\n", DBF_EVENT(DBF_WARNING, "%s(%s): unknown error %ld\n",
__func__, dev_name(&cdev->dev), PTR_ERR(irb)); __func__, dev_name(&cdev->dev), PTR_ERR(irb));
} }
dasd_handle_killed_request(cdev, intparm); dasd_handle_killed_request(cdev, intparm);
...@@ -1018,10 +1026,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1018,10 +1026,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
now = get_clock(); now = get_clock();
DBF_EVENT(DBF_ERR, "Interrupt: bus_id %s CS/DS %04x ip %08x",
dev_name(&cdev->dev), ((irb->scsw.cmd.cstat << 8) |
irb->scsw.cmd.dstat), (unsigned int) intparm);
/* check for unsolicited interrupts */ /* check for unsolicited interrupts */
cqr = (struct dasd_ccw_req *) intparm; cqr = (struct dasd_ccw_req *) intparm;
if (!cqr || ((scsw_cc(&irb->scsw) == 1) && if (!cqr || ((scsw_cc(&irb->scsw) == 1) &&
...@@ -1042,8 +1046,8 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1042,8 +1046,8 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
device = (struct dasd_device *) cqr->startdev; device = (struct dasd_device *) cqr->startdev;
if (!device || if (!device ||
strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
MESSAGE(KERN_DEBUG, "invalid device in request: bus_id %s", DBF_DEV_EVENT(DBF_DEBUG, device, "invalid device in request: "
dev_name(&cdev->dev)); "bus_id %s", dev_name(&cdev->dev));
return; return;
} }
...@@ -1059,13 +1063,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1059,13 +1063,11 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
/* check status - the request might have been killed by dyn detach */ /* check status - the request might have been killed by dyn detach */
if (cqr->status != DASD_CQR_IN_IO) { if (cqr->status != DASD_CQR_IN_IO) {
MESSAGE(KERN_DEBUG, DBF_DEV_EVENT(DBF_DEBUG, device, "invalid status: bus_id %s, "
"invalid status: bus_id %s, status %02x", "status %02x", dev_name(&cdev->dev), cqr->status);
dev_name(&cdev->dev), cqr->status);
return; return;
} }
DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x for cqr %p",
((irb->scsw.cmd.cstat << 8) | irb->scsw.cmd.dstat), cqr);
next = NULL; next = NULL;
expires = 0; expires = 0;
if (scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) && if (scsw_dstat(&irb->scsw) == (DEV_STAT_CHN_END | DEV_STAT_DEV_END) &&
...@@ -1080,18 +1082,23 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1080,18 +1082,23 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
} }
} else { /* error */ } else { /* error */
memcpy(&cqr->irb, irb, sizeof(struct irb)); memcpy(&cqr->irb, irb, sizeof(struct irb));
/* log sense for every failed I/O to s390 debugfeature */
dasd_log_sense_dbf(cqr, irb);
if (device->features & DASD_FEATURE_ERPLOG) { if (device->features & DASD_FEATURE_ERPLOG) {
dasd_log_sense(cqr, irb); dasd_log_sense(cqr, irb);
} }
/* /*
* If we don't want complex ERP for this request, then just * If we don't want complex ERP for this request, then just
* reset this and retry it in the fastpath * reset this and retry it in the fastpath
*/ */
if (!test_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags) && if (!test_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags) &&
cqr->retries > 0) { cqr->retries > 0) {
DEV_MESSAGE(KERN_DEBUG, device, if (cqr->lpm == LPM_ANYPATH)
"default ERP in fastpath (%i retries left)", DBF_DEV_EVENT(DBF_DEBUG, device,
cqr->retries); "default ERP in fastpath "
"(%i retries left)",
cqr->retries);
cqr->lpm = LPM_ANYPATH; cqr->lpm = LPM_ANYPATH;
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
next = cqr; next = cqr;
...@@ -1102,10 +1109,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -1102,10 +1109,6 @@ void dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
(!device->stopped)) { (!device->stopped)) {
if (device->discipline->start_IO(next) == 0) if (device->discipline->start_IO(next) == 0)
expires = next->expires; expires = next->expires;
else
DEV_MESSAGE(KERN_DEBUG, device, "%s",
"Interrupt fastpath "
"failed!");
} }
if (expires != 0) if (expires != 0)
dasd_device_set_timer(device, expires); dasd_device_set_timer(device, expires);
...@@ -1178,6 +1181,7 @@ static void __dasd_device_process_final_queue(struct dasd_device *device, ...@@ -1178,6 +1181,7 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
struct dasd_block *block; struct dasd_block *block;
void (*callback)(struct dasd_ccw_req *, void *data); void (*callback)(struct dasd_ccw_req *, void *data);
void *callback_data; void *callback_data;
char errorstring[ERRORLENGTH];
list_for_each_safe(l, n, final_queue) { list_for_each_safe(l, n, final_queue) {
cqr = list_entry(l, struct dasd_ccw_req, devlist); cqr = list_entry(l, struct dasd_ccw_req, devlist);
...@@ -1198,10 +1202,11 @@ static void __dasd_device_process_final_queue(struct dasd_device *device, ...@@ -1198,10 +1202,11 @@ static void __dasd_device_process_final_queue(struct dasd_device *device,
cqr->status = DASD_CQR_TERMINATED; cqr->status = DASD_CQR_TERMINATED;
break; break;
default: default:
DEV_MESSAGE(KERN_ERR, device, /* internal error 12 - wrong cqr status*/
"wrong cqr status in __dasd_process_final_queue " snprintf(errorstring, ERRORLENGTH, "12 %p %x02", cqr, cqr->status);
"for cqr %p, status %x", dev_err(&device->cdev->dev,
cqr, cqr->status); "An error occurred in the DASD device driver, "
"reason=%s\n", errorstring);
BUG(); BUG();
} }
if (cqr->callback != NULL) if (cqr->callback != NULL)
...@@ -1226,18 +1231,17 @@ static void __dasd_device_check_expire(struct dasd_device *device) ...@@ -1226,18 +1231,17 @@ static void __dasd_device_check_expire(struct dasd_device *device)
(time_after_eq(jiffies, cqr->expires + cqr->starttime))) { (time_after_eq(jiffies, cqr->expires + cqr->starttime))) {
if (device->discipline->term_IO(cqr) != 0) { if (device->discipline->term_IO(cqr) != 0) {
/* Hmpf, try again in 5 sec */ /* Hmpf, try again in 5 sec */
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
"internal error - timeout (%is) expired " "cqr %p timed out (%is) but cannot be "
"for cqr %p, termination failed, " "ended, retrying in 5 s\n",
"retrying in 5s", cqr, (cqr->expires/HZ));
(cqr->expires/HZ), cqr);
cqr->expires += 5*HZ; cqr->expires += 5*HZ;
dasd_device_set_timer(device, 5*HZ); dasd_device_set_timer(device, 5*HZ);
} else { } else {
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
"internal error - timeout (%is) expired " "cqr %p timed out (%is), %i retries "
"for cqr %p (%i retries left)", "remaining\n", cqr, (cqr->expires/HZ),
(cqr->expires/HZ), cqr, cqr->retries); cqr->retries);
} }
} }
} }
...@@ -1299,10 +1303,9 @@ int dasd_flush_device_queue(struct dasd_device *device) ...@@ -1299,10 +1303,9 @@ int dasd_flush_device_queue(struct dasd_device *device)
rc = device->discipline->term_IO(cqr); rc = device->discipline->term_IO(cqr);
if (rc) { if (rc) {
/* unable to terminate requeust */ /* unable to terminate requeust */
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
"dasd flush ccw_queue is unable " "Flushing the DASD request queue "
" to terminate request %p", "failed for request %p\n", cqr);
cqr);
/* stop flush processing */ /* stop flush processing */
goto finished; goto finished;
} }
...@@ -1546,10 +1549,9 @@ int dasd_cancel_req(struct dasd_ccw_req *cqr) ...@@ -1546,10 +1549,9 @@ int dasd_cancel_req(struct dasd_ccw_req *cqr)
/* request in IO - terminate IO and release again */ /* request in IO - terminate IO and release again */
rc = device->discipline->term_IO(cqr); rc = device->discipline->term_IO(cqr);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
"dasd_cancel_req is unable " "Cancelling request %p failed with rc=%d\n",
" to terminate request %p, rc = %d", cqr, rc);
cqr, rc);
} else { } else {
cqr->stopclk = get_clock(); cqr->stopclk = get_clock();
rc = 1; rc = 1;
...@@ -1626,7 +1628,7 @@ static inline void __dasd_block_process_erp(struct dasd_block *block, ...@@ -1626,7 +1628,7 @@ static inline void __dasd_block_process_erp(struct dasd_block *block,
if (cqr->status == DASD_CQR_DONE) if (cqr->status == DASD_CQR_DONE)
DBF_DEV_EVENT(DBF_NOTICE, device, "%s", "ERP successful"); DBF_DEV_EVENT(DBF_NOTICE, device, "%s", "ERP successful");
else else
DEV_MESSAGE(KERN_ERR, device, "%s", "ERP unsuccessful"); dev_err(&device->cdev->dev, "ERP failed for the DASD\n");
erp_fn = device->discipline->erp_postaction(cqr); erp_fn = device->discipline->erp_postaction(cqr);
erp_fn(cqr); erp_fn(cqr);
} }
...@@ -2055,8 +2057,9 @@ static int dasd_open(struct block_device *bdev, fmode_t mode) ...@@ -2055,8 +2057,9 @@ static int dasd_open(struct block_device *bdev, fmode_t mode)
} }
if (dasd_probeonly) { if (dasd_probeonly) {
DEV_MESSAGE(KERN_INFO, base, "%s", dev_info(&base->cdev->dev,
"No access to device due to probeonly mode"); "Accessing the DASD failed because it is in "
"probeonly mode\n");
rc = -EPERM; rc = -EPERM;
goto out; goto out;
} }
...@@ -2156,14 +2159,14 @@ int dasd_generic_probe(struct ccw_device *cdev, ...@@ -2156,14 +2159,14 @@ int dasd_generic_probe(struct ccw_device *cdev,
ret = ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP); ret = ccw_device_set_options(cdev, CCWDEV_DO_PATHGROUP);
if (ret) { if (ret) {
printk(KERN_WARNING DBF_EVENT(DBF_WARNING,
"dasd_generic_probe: could not set ccw-device options " "dasd_generic_probe: could not set ccw-device options "
"for %s\n", dev_name(&cdev->dev)); "for %s\n", dev_name(&cdev->dev));
return ret; return ret;
} }
ret = dasd_add_sysfs_files(cdev); ret = dasd_add_sysfs_files(cdev);
if (ret) { if (ret) {
printk(KERN_WARNING DBF_EVENT(DBF_WARNING,
"dasd_generic_probe: could not add sysfs entries " "dasd_generic_probe: could not add sysfs entries "
"for %s\n", dev_name(&cdev->dev)); "for %s\n", dev_name(&cdev->dev));
return ret; return ret;
...@@ -2179,9 +2182,7 @@ int dasd_generic_probe(struct ccw_device *cdev, ...@@ -2179,9 +2182,7 @@ int dasd_generic_probe(struct ccw_device *cdev,
(dasd_autodetect && dasd_busid_known(dev_name(&cdev->dev)) != 0)) (dasd_autodetect && dasd_busid_known(dev_name(&cdev->dev)) != 0))
ret = ccw_device_set_online(cdev); ret = ccw_device_set_online(cdev);
if (ret) if (ret)
printk(KERN_WARNING pr_warning("%s: Setting the DASD online failed with rc=%d\n",
"dasd_generic_probe: could not initially "
"online ccw-device %s; return code: %d\n",
dev_name(&cdev->dev), ret); dev_name(&cdev->dev), ret);
return 0; return 0;
} }
...@@ -2245,10 +2246,9 @@ int dasd_generic_set_online(struct ccw_device *cdev, ...@@ -2245,10 +2246,9 @@ int dasd_generic_set_online(struct ccw_device *cdev,
discipline = base_discipline; discipline = base_discipline;
if (device->features & DASD_FEATURE_USEDIAG) { if (device->features & DASD_FEATURE_USEDIAG) {
if (!dasd_diag_discipline_pointer) { if (!dasd_diag_discipline_pointer) {
printk (KERN_WARNING pr_warning("%s Setting the DASD online failed because "
"dasd_generic couldn't online device %s " "of missing DIAG discipline\n",
"- discipline DIAG not available\n", dev_name(&cdev->dev));
dev_name(&cdev->dev));
dasd_delete_device(device); dasd_delete_device(device);
return -ENODEV; return -ENODEV;
} }
...@@ -2269,10 +2269,9 @@ int dasd_generic_set_online(struct ccw_device *cdev, ...@@ -2269,10 +2269,9 @@ int dasd_generic_set_online(struct ccw_device *cdev,
/* check_device will allocate block device if necessary */ /* check_device will allocate block device if necessary */
rc = discipline->check_device(device); rc = discipline->check_device(device);
if (rc) { if (rc) {
printk (KERN_WARNING pr_warning("%s Setting the DASD online with discipline %s "
"dasd_generic couldn't online device %s " "failed with rc=%i\n",
"with discipline %s rc=%i\n", dev_name(&cdev->dev), discipline->name, rc);
dev_name(&cdev->dev), discipline->name, rc);
module_put(discipline->owner); module_put(discipline->owner);
module_put(base_discipline->owner); module_put(base_discipline->owner);
dasd_delete_device(device); dasd_delete_device(device);
...@@ -2281,9 +2280,8 @@ int dasd_generic_set_online(struct ccw_device *cdev, ...@@ -2281,9 +2280,8 @@ int dasd_generic_set_online(struct ccw_device *cdev,
dasd_set_target_state(device, DASD_STATE_ONLINE); dasd_set_target_state(device, DASD_STATE_ONLINE);
if (device->state <= DASD_STATE_KNOWN) { if (device->state <= DASD_STATE_KNOWN) {
printk (KERN_WARNING pr_warning("%s Setting the DASD online failed because of a "
"dasd_generic discipline not found for %s\n", "missing discipline\n", dev_name(&cdev->dev));
dev_name(&cdev->dev));
rc = -ENODEV; rc = -ENODEV;
dasd_set_target_state(device, DASD_STATE_NEW); dasd_set_target_state(device, DASD_STATE_NEW);
if (device->block) if (device->block)
...@@ -2327,13 +2325,13 @@ int dasd_generic_set_offline(struct ccw_device *cdev) ...@@ -2327,13 +2325,13 @@ int dasd_generic_set_offline(struct ccw_device *cdev)
open_count = atomic_read(&device->block->open_count); open_count = atomic_read(&device->block->open_count);
if (open_count > max_count) { if (open_count > max_count) {
if (open_count > 0) if (open_count > 0)
printk(KERN_WARNING "Can't offline dasd " pr_warning("%s: The DASD cannot be set offline "
"device with open count = %i.\n", "with open count %i\n",
open_count); dev_name(&cdev->dev), open_count);
else else
printk(KERN_WARNING "%s", pr_warning("%s: The DASD cannot be set offline "
"Can't offline dasd device due " "while it is in use\n",
"to internal use\n"); dev_name(&cdev->dev));
clear_bit(DASD_FLAG_OFFLINE, &device->flags); clear_bit(DASD_FLAG_OFFLINE, &device->flags);
dasd_put_device(device); dasd_put_device(device);
return -EBUSY; return -EBUSY;
...@@ -2406,8 +2404,10 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device, ...@@ -2406,8 +2404,10 @@ static struct dasd_ccw_req *dasd_generic_build_rdc(struct dasd_device *device,
cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device); cqr = dasd_smalloc_request(magic, 1 /* RDC */, rdc_buffer_size, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", /* internal error 13 - Allocating the RDC request failed*/
"Could not allocate RDC request"); dev_err(&device->cdev->dev,
"An error occurred in the DASD device driver, "
"reason=%s\n", "13");
return cqr; return cqr;
} }
...@@ -2519,7 +2519,7 @@ static int __init dasd_init(void) ...@@ -2519,7 +2519,7 @@ static int __init dasd_init(void)
return 0; return 0;
failed: failed:
MESSAGE(KERN_INFO, "%s", "initialization not performed due to errors"); pr_info("The DASD device driver could not be initialized\n");
dasd_exit(); dasd_exit();
return rc; return rc;
} }
......
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/idals.h> #include <asm/idals.h>
...@@ -75,7 +77,7 @@ dasd_3990_erp_block_queue(struct dasd_ccw_req * erp, int expires) ...@@ -75,7 +77,7 @@ dasd_3990_erp_block_queue(struct dasd_ccw_req * erp, int expires)
struct dasd_device *device = erp->startdev; struct dasd_device *device = erp->startdev;
unsigned long flags; unsigned long flags;
DEV_MESSAGE(KERN_INFO, device, DBF_DEV_EVENT(DBF_INFO, device,
"blocking request queue for %is", expires/HZ); "blocking request queue for %is", expires/HZ);
spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
...@@ -114,9 +116,9 @@ dasd_3990_erp_int_req(struct dasd_ccw_req * erp) ...@@ -114,9 +116,9 @@ dasd_3990_erp_int_req(struct dasd_ccw_req * erp)
} else { } else {
/* issue a message and wait for 'device ready' interrupt */ /* issue a message and wait for 'device ready' interrupt */
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"is offline or not installed - " "is offline or not installed - "
"INTERVENTION REQUIRED!!"); "INTERVENTION REQUIRED!!\n");
dasd_3990_erp_block_queue(erp, 60*HZ); dasd_3990_erp_block_queue(erp, 60*HZ);
} }
...@@ -158,7 +160,7 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp) ...@@ -158,7 +160,7 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
if ((erp->lpm & opm) != 0x00) { if ((erp->lpm & opm) != 0x00) {
DEV_MESSAGE(KERN_DEBUG, device, DBF_DEV_EVENT(DBF_WARNING, device,
"try alternate lpm=%x (lpum=%x / opm=%x)", "try alternate lpm=%x (lpum=%x / opm=%x)",
erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm); erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm);
...@@ -166,10 +168,9 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp) ...@@ -166,10 +168,9 @@ dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
erp->status = DASD_CQR_FILLED; erp->status = DASD_CQR_FILLED;
erp->retries = 10; erp->retries = 10;
} else { } else {
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
"No alternate channel path left (lpum=%x / " "The DASD cannot be reached on any path (lpum=%x"
"opm=%x) -> permanent error", "/opm=%x)\n", erp->irb.esw.esw0.sublog.lpum, opm);
erp->irb.esw.esw0.sublog.lpum, opm);
/* post request with permanent error */ /* post request with permanent error */
erp->status = DASD_CQR_FAILED; erp->status = DASD_CQR_FAILED;
...@@ -204,8 +205,8 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier) ...@@ -204,8 +205,8 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
sizeof(struct DCTL_data), sizeof(struct DCTL_data),
device); device);
if (IS_ERR(dctl_cqr)) { if (IS_ERR(dctl_cqr)) {
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"Unable to allocate DCTL-CQR"); "Unable to allocate DCTL-CQR\n");
erp->status = DASD_CQR_FAILED; erp->status = DASD_CQR_FAILED;
return erp; return erp;
} }
...@@ -294,7 +295,7 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense) ...@@ -294,7 +295,7 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
/* interrupt (this enables easier enqueing of the cqr) */ /* interrupt (this enables easier enqueing of the cqr) */
if (erp->function != dasd_3990_erp_action_4) { if (erp->function != dasd_3990_erp_action_4) {
DEV_MESSAGE(KERN_INFO, device, "%s", DBF_DEV_EVENT(DBF_INFO, device, "%s",
"dasd_3990_erp_action_4: first time retry"); "dasd_3990_erp_action_4: first time retry");
erp->retries = 256; erp->retries = 256;
...@@ -303,7 +304,7 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense) ...@@ -303,7 +304,7 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
} else { } else {
if (sense && (sense[25] == 0x1D)) { /* state change pending */ if (sense && (sense[25] == 0x1D)) { /* state change pending */
DEV_MESSAGE(KERN_INFO, device, DBF_DEV_EVENT(DBF_INFO, device,
"waiting for state change pending " "waiting for state change pending "
"interrupt, %d retries left", "interrupt, %d retries left",
erp->retries); erp->retries);
...@@ -311,15 +312,14 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense) ...@@ -311,15 +312,14 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
dasd_3990_erp_block_queue(erp, 30*HZ); dasd_3990_erp_block_queue(erp, 30*HZ);
} else if (sense && (sense[25] == 0x1E)) { /* busy */ } else if (sense && (sense[25] == 0x1E)) { /* busy */
DEV_MESSAGE(KERN_INFO, device, DBF_DEV_EVENT(DBF_INFO, device,
"busy - redriving request later, " "busy - redriving request later, "
"%d retries left", "%d retries left",
erp->retries); erp->retries);
dasd_3990_erp_block_queue(erp, HZ); dasd_3990_erp_block_queue(erp, HZ);
} else { } else {
/* no state change pending - retry */ /* no state change pending - retry */
DEV_MESSAGE (KERN_INFO, device, DBF_DEV_EVENT(DBF_INFO, device,
"redriving request immediately, " "redriving request immediately, "
"%d retries left", "%d retries left",
erp->retries); erp->retries);
...@@ -384,6 +384,7 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -384,6 +384,7 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
struct dasd_device *device = erp->startdev; struct dasd_device *device = erp->startdev;
char msg_format = (sense[7] & 0xF0); char msg_format = (sense[7] & 0xF0);
char msg_no = (sense[7] & 0x0F); char msg_no = (sense[7] & 0x0F);
char errorstring[ERRORLENGTH];
switch (msg_format) { switch (msg_format) {
case 0x00: /* Format 0 - Program or System Checks */ case 0x00: /* Format 0 - Program or System Checks */
...@@ -394,95 +395,97 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -394,95 +395,97 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
case 0x00: /* No Message */ case 0x00: /* No Message */
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Invalid Command"); "FORMAT 0 - Invalid Command\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Invalid Command " "FORMAT 0 - Invalid Command "
"Sequence"); "Sequence\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - CCW Count less than " "FORMAT 0 - CCW Count less than "
"required"); "required\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Invalid Parameter"); "FORMAT 0 - Invalid Parameter\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Diagnostic of Sepecial" "FORMAT 0 - Diagnostic of Special"
" Command Violates File Mask"); " Command Violates File Mask\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Channel Returned with " "FORMAT 0 - Channel Returned with "
"Incorrect retry CCW"); "Incorrect retry CCW\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Reset Notification"); "FORMAT 0 - Reset Notification\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Storage Path Restart"); "FORMAT 0 - Storage Path Restart\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, dev_warn(&device->cdev->dev,
"FORMAT 0 - Channel requested " "FORMAT 0 - Channel requested "
"... %02x", sense[8]); "... %02x\n", sense[8]);
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Invalid Defective/" "FORMAT 0 - Invalid Defective/"
"Alternate Track Pointer"); "Alternate Track Pointer\n");
break; break;
case 0x0C: case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - DPS Installation " "FORMAT 0 - DPS Installation "
"Check"); "Check\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Command Invalid on " "FORMAT 0 - Command Invalid on "
"Secondary Address"); "Secondary Address\n");
break; break;
case 0x0F: case 0x0F:
DEV_MESSAGE(KERN_WARNING, device, dev_warn(&device->cdev->dev,
"FORMAT 0 - Status Not As " "FORMAT 0 - Status Not As "
"Required: reason %02x", sense[8]); "Required: reason %02x\n",
sense[8]);
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Reseved"); "FORMAT 0 - Reserved\n");
} }
} else { } else {
switch (msg_no) { switch (msg_no) {
case 0x00: /* No Message */ case 0x00: /* No Message */
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Device Error Source"); "FORMAT 0 - Device Error "
"Source\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Reserved"); "FORMAT 0 - Reserved\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, dev_warn(&device->cdev->dev,
"FORMAT 0 - Device Fenced - " "FORMAT 0 - Device Fenced - "
"device = %02x", sense[4]); "device = %02x\n", sense[4]);
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Data Pinned for " "FORMAT 0 - Data Pinned for "
"Device"); "Device\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 0 - Reserved"); "FORMAT 0 - Reserved\n");
} }
} }
break; break;
...@@ -492,348 +495,352 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -492,348 +495,352 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
case 0x00: /* No Message */ case 0x00: /* No Message */
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Device Status 1 not as " "FORMAT 1 - Device Status 1 not as "
"expected"); "expected\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Index missing"); "FORMAT 1 - Index missing\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Interruption cannot be reset"); "FORMAT 1 - Interruption cannot be "
"reset\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Device did not respond to " "FORMAT 1 - Device did not respond to "
"selection"); "selection\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Device check-2 error or Set " "FORMAT 1 - Device check-2 error or Set "
"Sector is not complete"); "Sector is not complete\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Head address does not " "FORMAT 1 - Head address does not "
"compare"); "compare\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Device status 1 not valid"); "FORMAT 1 - Device status 1 not valid\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Device not ready"); "FORMAT 1 - Device not ready\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Track physical address did " "FORMAT 1 - Track physical address did "
"not compare"); "not compare\n");
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Missing device address bit"); "FORMAT 1 - Missing device address bit\n");
break; break;
case 0x0C: case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Drive motor switch is off"); "FORMAT 1 - Drive motor switch is off\n");
break; break;
case 0x0D: case 0x0D:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Seek incomplete"); "FORMAT 1 - Seek incomplete\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Cylinder address did not " "FORMAT 1 - Cylinder address did not "
"compare"); "compare\n");
break; break;
case 0x0F: case 0x0F:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Offset active cannot be " "FORMAT 1 - Offset active cannot be "
"reset"); "reset\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 1 - Reserved"); "FORMAT 1 - Reserved\n");
} }
break; break;
case 0x20: /* Format 2 - 3990 Equipment Checks */ case 0x20: /* Format 2 - 3990 Equipment Checks */
switch (msg_no) { switch (msg_no) {
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 2 - 3990 check-2 error"); "FORMAT 2 - 3990 check-2 error\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 2 - Support facility errors"); "FORMAT 2 - Support facility errors\n");
break; break;
case 0x0F: case 0x0F:
DEV_MESSAGE(KERN_WARNING, device, dev_warn(&device->cdev->dev,
"FORMAT 2 - Microcode detected error %02x", "FORMAT 2 - Microcode detected error "
sense[8]); "%02x\n",
sense[8]);
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 2 - Reserved"); "FORMAT 2 - Reserved\n");
} }
break; break;
case 0x30: /* Format 3 - 3990 Control Checks */ case 0x30: /* Format 3 - 3990 Control Checks */
switch (msg_no) { switch (msg_no) {
case 0x0F: case 0x0F:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 3 - Allegiance terminated"); "FORMAT 3 - Allegiance terminated\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 3 - Reserved"); "FORMAT 3 - Reserved\n");
} }
break; break;
case 0x40: /* Format 4 - Data Checks */ case 0x40: /* Format 4 - Data Checks */
switch (msg_no) { switch (msg_no) {
case 0x00: case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Home address area error"); "FORMAT 4 - Home address area error\n");
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Count area error"); "FORMAT 4 - Count area error\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Key area error"); "FORMAT 4 - Key area error\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Data area error"); "FORMAT 4 - Data area error\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in home address " "FORMAT 4 - No sync byte in home address "
"area"); "area\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in count address " "FORMAT 4 - No sync byte in count address "
"area"); "area\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in key area"); "FORMAT 4 - No sync byte in key area\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in data area"); "FORMAT 4 - No sync byte in data area\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Home address area error; " "FORMAT 4 - Home address area error; "
"offset active"); "offset active\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Count area error; offset " "FORMAT 4 - Count area error; offset "
"active"); "active\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Key area error; offset " "FORMAT 4 - Key area error; offset "
"active"); "active\n");
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Data area error; " "FORMAT 4 - Data area error; "
"offset active"); "offset active\n");
break; break;
case 0x0C: case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in home " "FORMAT 4 - No sync byte in home "
"address area; offset active"); "address area; offset active\n");
break; break;
case 0x0D: case 0x0D:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No syn byte in count " "FORMAT 4 - No syn byte in count "
"address area; offset active"); "address area; offset active\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No sync byte in key area; " "FORMAT 4 - No sync byte in key area; "
"offset active"); "offset active\n");
break; break;
case 0x0F: case 0x0F:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - No syn byte in data area; " "FORMAT 4 - No syn byte in data area; "
"offset active"); "offset active\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 4 - Reserved"); "FORMAT 4 - Reserved\n");
} }
break; break;
case 0x50: /* Format 5 - Data Check with displacement information */ case 0x50: /* Format 5 - Data Check with displacement information */
switch (msg_no) { switch (msg_no) {
case 0x00: case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the " "FORMAT 5 - Data Check in the "
"home address area"); "home address area\n");
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the count area"); "FORMAT 5 - Data Check in the count "
"area\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the key area"); "FORMAT 5 - Data Check in the key area\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the data area"); "FORMAT 5 - Data Check in the data "
"area\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the " "FORMAT 5 - Data Check in the "
"home address area; offset active"); "home address area; offset active\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the count area; " "FORMAT 5 - Data Check in the count area; "
"offset active"); "offset active\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the key area; " "FORMAT 5 - Data Check in the key area; "
"offset active"); "offset active\n");
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Data Check in the data area; " "FORMAT 5 - Data Check in the data area; "
"offset active"); "offset active\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 5 - Reserved"); "FORMAT 5 - Reserved\n");
} }
break; break;
case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */ case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */
switch (msg_no) { switch (msg_no) {
case 0x00: case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel A"); "FORMAT 6 - Overrun on channel A\n");
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel B"); "FORMAT 6 - Overrun on channel B\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel C"); "FORMAT 6 - Overrun on channel C\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel D"); "FORMAT 6 - Overrun on channel D\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel E"); "FORMAT 6 - Overrun on channel E\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel F"); "FORMAT 6 - Overrun on channel F\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel G"); "FORMAT 6 - Overrun on channel G\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Overrun on channel H"); "FORMAT 6 - Overrun on channel H\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 6 - Reserved"); "FORMAT 6 - Reserved\n");
} }
break; break;
case 0x70: /* Format 7 - Device Connection Control Checks */ case 0x70: /* Format 7 - Device Connection Control Checks */
switch (msg_no) { switch (msg_no) {
case 0x00: case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - RCC initiated by a connection " "FORMAT 7 - RCC initiated by a connection "
"check alert"); "check alert\n");
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - RCC 1 sequence not " "FORMAT 7 - RCC 1 sequence not "
"successful"); "successful\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - RCC 1 and RCC 2 sequences not " "FORMAT 7 - RCC 1 and RCC 2 sequences not "
"successful"); "successful\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Invalid tag-in during " "FORMAT 7 - Invalid tag-in during "
"selection sequence"); "selection sequence\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - extra RCC required"); "FORMAT 7 - extra RCC required\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Invalid DCC selection " "FORMAT 7 - Invalid DCC selection "
"response or timeout"); "response or timeout\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Missing end operation; device " "FORMAT 7 - Missing end operation; device "
"transfer complete"); "transfer complete\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Missing end operation; device " "FORMAT 7 - Missing end operation; device "
"transfer incomplete"); "transfer incomplete\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Invalid tag-in for an " "FORMAT 7 - Invalid tag-in for an "
"immediate command sequence"); "immediate command sequence\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Invalid tag-in for an " "FORMAT 7 - Invalid tag-in for an "
"extended command sequence"); "extended command sequence\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - 3990 microcode time out when " "FORMAT 7 - 3990 microcode time out when "
"stopping selection"); "stopping selection\n");
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - No response to selection " "FORMAT 7 - No response to selection "
"after a poll interruption"); "after a poll interruption\n");
break; break;
case 0x0C: case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Permanent path error (DASD " "FORMAT 7 - Permanent path error (DASD "
"controller not available)"); "controller not available)\n");
break; break;
case 0x0D: case 0x0D:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - DASD controller not available" "FORMAT 7 - DASD controller not available"
" on disconnected command chain"); " on disconnected command chain\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 7 - Reserved"); "FORMAT 7 - Reserved\n");
} }
break; break;
...@@ -841,52 +848,52 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -841,52 +848,52 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
switch (msg_no) { switch (msg_no) {
case 0x00: /* No Message */ case 0x00: /* No Message */
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - Error correction code " "FORMAT 8 - Error correction code "
"hardware fault"); "hardware fault\n");
break; break;
case 0x03: case 0x03:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - Unexpected end operation " "FORMAT 8 - Unexpected end operation "
"response code"); "response code\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - End operation with transfer " "FORMAT 8 - End operation with transfer "
"count not zero"); "count not zero\n");
break; break;
case 0x05: case 0x05:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - End operation with transfer " "FORMAT 8 - End operation with transfer "
"count zero"); "count zero\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - DPS checks after a system " "FORMAT 8 - DPS checks after a system "
"reset or selective reset"); "reset or selective reset\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - DPS cannot be filled"); "FORMAT 8 - DPS cannot be filled\n");
break; break;
case 0x08: case 0x08:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - Short busy time-out during " "FORMAT 8 - Short busy time-out during "
"device selection"); "device selection\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - DASD controller failed to " "FORMAT 8 - DASD controller failed to "
"set or reset the long busy latch"); "set or reset the long busy latch\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - No interruption from device " "FORMAT 8 - No interruption from device "
"during a command chain"); "during a command chain\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 8 - Reserved"); "FORMAT 8 - Reserved\n");
} }
break; break;
...@@ -895,97 +902,100 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -895,97 +902,100 @@ dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
case 0x00: case 0x00:
break; /* No Message */ break; /* No Message */
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 9 - Device check-2 error"); "FORMAT 9 - Device check-2 error\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 9 - Head address did not compare"); "FORMAT 9 - Head address did not "
"compare\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 9 - Track physical address did " "FORMAT 9 - Track physical address did "
"not compare while oriented"); "not compare while oriented\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 9 - Cylinder address did not " "FORMAT 9 - Cylinder address did not "
"compare"); "compare\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT 9 - Reserved"); "FORMAT 9 - Reserved\n");
} }
break; break;
case 0xF0: /* Format F - Cache Storage Checks */ case 0xF0: /* Format F - Cache Storage Checks */
switch (msg_no) { switch (msg_no) {
case 0x00: case 0x00:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Operation Terminated"); "FORMAT F - Operation Terminated\n");
break; break;
case 0x01: case 0x01:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Subsystem Processing Error"); "FORMAT F - Subsystem Processing Error\n");
break; break;
case 0x02: case 0x02:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Cache or nonvolatile storage " "FORMAT F - Cache or nonvolatile storage "
"equipment failure"); "equipment failure\n");
break; break;
case 0x04: case 0x04:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Caching terminated"); "FORMAT F - Caching terminated\n");
break; break;
case 0x06: case 0x06:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Cache fast write access not " "FORMAT F - Cache fast write access not "
"authorized"); "authorized\n");
break; break;
case 0x07: case 0x07:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Track format incorrect"); "FORMAT F - Track format incorrect\n");
break; break;
case 0x09: case 0x09:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Caching reinitiated"); "FORMAT F - Caching reinitiated\n");
break; break;
case 0x0A: case 0x0A:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Nonvolatile storage " "FORMAT F - Nonvolatile storage "
"terminated"); "terminated\n");
break; break;
case 0x0B: case 0x0B:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Volume is suspended duplex"); "FORMAT F - Volume is suspended duplex\n");
/* call extended error reporting (EER) */ /* call extended error reporting (EER) */
dasd_eer_write(device, erp->refers, dasd_eer_write(device, erp->refers,
DASD_EER_PPRCSUSPEND); DASD_EER_PPRCSUSPEND);
break; break;
case 0x0C: case 0x0C:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Subsystem status connot be " "FORMAT F - Subsystem status cannot be "
"determined"); "determined\n");
break; break;
case 0x0D: case 0x0D:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - Caching status reset to " "FORMAT F - Caching status reset to "
"default"); "default\n");
break; break;
case 0x0E: case 0x0E:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT F - DASD Fast Write inhibited"); "FORMAT F - DASD Fast Write inhibited\n");
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"FORMAT D - Reserved"); "FORMAT D - Reserved\n");
} }
break; break;
default: /* unknown message format - should not happen */ default: /* unknown message format - should not happen
DEV_MESSAGE (KERN_WARNING, device, internal error 03 - unknown message format */
"unknown message format %02x", snprintf(errorstring, ERRORLENGTH, "03 %x02", msg_format);
msg_format); dev_err(&device->cdev->dev,
"An error occurred in the DASD device driver, "
"reason=%s\n", errorstring);
break; break;
} /* end switch message format */ } /* end switch message format */
...@@ -1015,7 +1025,7 @@ dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense) ...@@ -1015,7 +1025,7 @@ dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense)
/* env data present (ACTION 10 - retry should work) */ /* env data present (ACTION 10 - retry should work) */
if (sense[2] & SNS2_ENV_DATA_PRESENT) { if (sense[2] & SNS2_ENV_DATA_PRESENT) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Command Reject - environmental data present"); "Command Reject - environmental data present");
dasd_3990_handle_env_data(erp, sense); dasd_3990_handle_env_data(erp, sense);
...@@ -1023,9 +1033,10 @@ dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense) ...@@ -1023,9 +1033,10 @@ dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense)
erp->retries = 5; erp->retries = 5;
} else { } else {
/* fatal error - set status to FAILED */ /* fatal error - set status to FAILED
DEV_MESSAGE(KERN_ERR, device, "%s", internal error 09 - Command Reject */
"Command Reject - Fatal error"); dev_err(&device->cdev->dev, "An error occurred in the DASD "
"device driver, reason=%s\n", "09");
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
} }
...@@ -1061,7 +1072,7 @@ dasd_3990_erp_bus_out(struct dasd_ccw_req * erp) ...@@ -1061,7 +1072,7 @@ dasd_3990_erp_bus_out(struct dasd_ccw_req * erp)
} else { } else {
/* issue a message and wait for 'device ready' interrupt */ /* issue a message and wait for 'device ready' interrupt */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"bus out parity error or BOPC requested by " "bus out parity error or BOPC requested by "
"channel"); "channel");
...@@ -1093,21 +1104,19 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1093,21 +1104,19 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
erp->function = dasd_3990_erp_equip_check; erp->function = dasd_3990_erp_equip_check;
if (sense[1] & SNS1_WRITE_INHIBITED) { if (sense[1] & SNS1_WRITE_INHIBITED) {
dev_info(&device->cdev->dev,
"Write inhibited path encountered\n");
DEV_MESSAGE(KERN_DEBUG, device, "%s", /* vary path offline
"Write inhibited path encountered"); internal error 04 - Path should be varied off-line.*/
dev_err(&device->cdev->dev, "An error occurred in the DASD "
/* vary path offline */ "device driver, reason=%s\n", "04");
DEV_MESSAGE(KERN_ERR, device, "%s",
"Path should be varied off-line. "
"This is not implemented yet \n - please report "
"to linux390@de.ibm.com");
erp = dasd_3990_erp_action_1(erp); erp = dasd_3990_erp_action_1(erp);
} else if (sense[2] & SNS2_ENV_DATA_PRESENT) { } else if (sense[2] & SNS2_ENV_DATA_PRESENT) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Equipment Check - " "environmental data present"); "Equipment Check - " "environmental data present");
dasd_3990_handle_env_data(erp, sense); dasd_3990_handle_env_data(erp, sense);
...@@ -1116,7 +1125,7 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1116,7 +1125,7 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
} else if (sense[1] & SNS1_PERM_ERR) { } else if (sense[1] & SNS1_PERM_ERR) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Equipment Check - retry exhausted or " "Equipment Check - retry exhausted or "
"undesirable"); "undesirable");
...@@ -1125,7 +1134,7 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1125,7 +1134,7 @@ dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
} else { } else {
/* all other equipment checks - Action 5 */ /* all other equipment checks - Action 5 */
/* rest is done when retries == 0 */ /* rest is done when retries == 0 */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Equipment check or processing error"); "Equipment check or processing error");
erp = dasd_3990_erp_action_5(erp); erp = dasd_3990_erp_action_5(erp);
...@@ -1156,9 +1165,9 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1156,9 +1165,9 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
if (sense[2] & SNS2_CORRECTABLE) { /* correctable data check */ if (sense[2] & SNS2_CORRECTABLE) { /* correctable data check */
/* issue message that the data has been corrected */ /* issue message that the data has been corrected */
DEV_MESSAGE(KERN_EMERG, device, "%s", dev_emerg(&device->cdev->dev,
"Data recovered during retry with PCI " "Data recovered during retry with PCI "
"fetch mode active"); "fetch mode active\n");
/* not possible to handle this situation in Linux */ /* not possible to handle this situation in Linux */
panic("No way to inform application about the possibly " panic("No way to inform application about the possibly "
...@@ -1166,7 +1175,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1166,7 +1175,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
} else if (sense[2] & SNS2_ENV_DATA_PRESENT) { } else if (sense[2] & SNS2_ENV_DATA_PRESENT) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Uncorrectable data check recovered secondary " "Uncorrectable data check recovered secondary "
"addr of duplex pair"); "addr of duplex pair");
...@@ -1174,7 +1183,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1174,7 +1183,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
} else if (sense[1] & SNS1_PERM_ERR) { } else if (sense[1] & SNS1_PERM_ERR) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Uncorrectable data check with internal " "Uncorrectable data check with internal "
"retry exhausted"); "retry exhausted");
...@@ -1182,7 +1191,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense) ...@@ -1182,7 +1191,7 @@ dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
} else { } else {
/* all other data checks */ /* all other data checks */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Uncorrectable data check with retry count " "Uncorrectable data check with retry count "
"exhausted..."); "exhausted...");
...@@ -1212,7 +1221,7 @@ dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense) ...@@ -1212,7 +1221,7 @@ dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense)
erp->function = dasd_3990_erp_overrun; erp->function = dasd_3990_erp_overrun;
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Overrun - service overrun or overrun" "Overrun - service overrun or overrun"
" error requested by channel"); " error requested by channel");
...@@ -1243,7 +1252,7 @@ dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense) ...@@ -1243,7 +1252,7 @@ dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense)
if (sense[2] & SNS2_ENV_DATA_PRESENT) { if (sense[2] & SNS2_ENV_DATA_PRESENT) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Track format error when destaging or " "Track format error when destaging or "
"staging data"); "staging data");
...@@ -1252,8 +1261,10 @@ dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense) ...@@ -1252,8 +1261,10 @@ dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense)
erp = dasd_3990_erp_action_4(erp, sense); erp = dasd_3990_erp_action_4(erp, sense);
} else { } else {
DEV_MESSAGE(KERN_ERR, device, "%s", /* internal error 06 - The track format is not valid*/
"Invalid Track Format - Fatal error"); dev_err(&device->cdev->dev,
"An error occurred in the DASD device driver, "
"reason=%s\n", "06");
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
} }
...@@ -1279,8 +1290,8 @@ dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1279,8 +1290,8 @@ dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense)
struct dasd_device *device = default_erp->startdev; struct dasd_device *device = default_erp->startdev;
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"End-of-Cylinder - must never happen"); "The cylinder data for accessing the DASD is inconsistent\n");
/* implement action 7 - BUG */ /* implement action 7 - BUG */
return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED); return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
...@@ -1306,7 +1317,7 @@ dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense) ...@@ -1306,7 +1317,7 @@ dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense)
erp->function = dasd_3990_erp_env_data; erp->function = dasd_3990_erp_env_data;
DEV_MESSAGE(KERN_DEBUG, device, "%s", "Environmental data present"); DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Environmental data present");
dasd_3990_handle_env_data(erp, sense); dasd_3990_handle_env_data(erp, sense);
...@@ -1339,8 +1350,8 @@ dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1339,8 +1350,8 @@ dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense)
struct dasd_device *device = default_erp->startdev; struct dasd_device *device = default_erp->startdev;
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"No Record Found - Fatal error "); "The specified record was not found\n");
return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED); return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
...@@ -1365,7 +1376,8 @@ dasd_3990_erp_file_prot(struct dasd_ccw_req * erp) ...@@ -1365,7 +1376,8 @@ dasd_3990_erp_file_prot(struct dasd_ccw_req * erp)
struct dasd_device *device = erp->startdev; struct dasd_device *device = erp->startdev;
DEV_MESSAGE(KERN_ERR, device, "%s", "File Protected"); dev_err(&device->cdev->dev, "Accessing the DASD failed because of "
"a hardware error\n");
return dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); return dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
...@@ -1394,7 +1406,7 @@ static struct dasd_ccw_req *dasd_3990_erp_inspect_alias( ...@@ -1394,7 +1406,7 @@ static struct dasd_ccw_req *dasd_3990_erp_inspect_alias(
if (cqr->block && if (cqr->block &&
(cqr->block->base != cqr->startdev)) { (cqr->block->base != cqr->startdev)) {
if (cqr->startdev->features & DASD_FEATURE_ERPLOG) { if (cqr->startdev->features & DASD_FEATURE_ERPLOG) {
DEV_MESSAGE(KERN_ERR, cqr->startdev, DBF_DEV_EVENT(DBF_ERR, cqr->startdev,
"ERP on alias device for request %p," "ERP on alias device for request %p,"
" recover on base device %s", cqr, " recover on base device %s", cqr,
dev_name(&cqr->block->base->cdev->dev)); dev_name(&cqr->block->base->cdev->dev));
...@@ -1511,7 +1523,7 @@ dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense) ...@@ -1511,7 +1523,7 @@ dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense)
erp->retries = 256; erp->retries = 256;
erp->function = dasd_3990_erp_action_10_32; erp->function = dasd_3990_erp_action_10_32;
DEV_MESSAGE(KERN_DEBUG, device, "%s", "Perform logging requested"); DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Perform logging requested");
return erp; return erp;
...@@ -1549,7 +1561,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1549,7 +1561,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
char *LO_data; /* LO_eckd_data_t */ char *LO_data; /* LO_eckd_data_t */
struct ccw1 *ccw, *oldccw; struct ccw1 *ccw, *oldccw;
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Write not finished because of unexpected condition"); "Write not finished because of unexpected condition");
default_erp->function = dasd_3990_erp_action_1B_32; default_erp->function = dasd_3990_erp_action_1B_32;
...@@ -1570,8 +1582,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1570,8 +1582,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
/* for imprecise ending just do default erp */ /* for imprecise ending just do default erp */
if (sense[1] & 0x01) { if (sense[1] & 0x01) {
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
DEV_MESSAGE(KERN_DEBUG, device, "%s",
"Imprecise ending is set - just retry"); "Imprecise ending is set - just retry");
return default_erp; return default_erp;
...@@ -1582,8 +1593,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1582,8 +1593,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
cpa = default_erp->refers->irb.scsw.cmd.cpa; cpa = default_erp->refers->irb.scsw.cmd.cpa;
if (cpa == 0) { if (cpa == 0) {
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
DEV_MESSAGE(KERN_DEBUG, device, "%s",
"Unable to determine address of the CCW " "Unable to determine address of the CCW "
"to be restarted"); "to be restarted");
...@@ -1597,7 +1607,9 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1597,7 +1607,9 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
sizeof(struct LO_eckd_data), device); sizeof(struct LO_eckd_data), device);
if (IS_ERR(erp)) { if (IS_ERR(erp)) {
DEV_MESSAGE(KERN_ERR, device, "%s", "Unable to allocate ERP"); /* internal error 01 - Unable to allocate ERP */
dev_err(&device->cdev->dev, "An error occurred in the DASD "
"device driver, reason=%s\n", "01");
return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED); return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
} }
...@@ -1615,10 +1627,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) ...@@ -1615,10 +1627,7 @@ dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
LO_data = erp->data + sizeof(struct DE_eckd_data); LO_data = erp->data + sizeof(struct DE_eckd_data);
if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
/* should not */
DEV_MESSAGE(KERN_ERR, device, "%s",
"BUG - this should not happen");
return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED); return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
} }
...@@ -1708,7 +1717,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) ...@@ -1708,7 +1717,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
char *LO_data; /* struct LO_eckd_data */ char *LO_data; /* struct LO_eckd_data */
struct ccw1 *ccw; struct ccw1 *ccw;
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Write not finished because of unexpected condition" "Write not finished because of unexpected condition"
" - follow on"); " - follow on");
...@@ -1728,8 +1737,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) ...@@ -1728,8 +1737,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
/* for imprecise ending just do default erp */ /* for imprecise ending just do default erp */
if (sense[1] & 0x01) { if (sense[1] & 0x01) {
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
DEV_MESSAGE(KERN_DEBUG, device, "%s",
"Imprecise ending is set - just retry"); "Imprecise ending is set - just retry");
previous_erp->status = DASD_CQR_FILLED; previous_erp->status = DASD_CQR_FILLED;
...@@ -1742,10 +1750,10 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) ...@@ -1742,10 +1750,10 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
cpa = previous_erp->irb.scsw.cmd.cpa; cpa = previous_erp->irb.scsw.cmd.cpa;
if (cpa == 0) { if (cpa == 0) {
/* internal error 02 -
DEV_MESSAGE(KERN_DEBUG, device, "%s", Unable to determine address of the CCW to be restarted */
"Unable to determine address of the CCW " dev_err(&device->cdev->dev, "An error occurred in the DASD "
"to be restarted"); "device driver, reason=%s\n", "02");
previous_erp->status = DASD_CQR_FAILED; previous_erp->status = DASD_CQR_FAILED;
...@@ -1758,10 +1766,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) ...@@ -1758,10 +1766,7 @@ dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
LO_data = erp->data + sizeof(struct DE_eckd_data); LO_data = erp->data + sizeof(struct DE_eckd_data);
if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
/* should not happen */
DEV_MESSAGE(KERN_ERR, device, "%s",
"BUG - this should not happen");
previous_erp->status = DASD_CQR_FAILED; previous_erp->status = DASD_CQR_FAILED;
return previous_erp; return previous_erp;
...@@ -1949,14 +1954,13 @@ dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense) ...@@ -1949,14 +1954,13 @@ dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense)
if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) { if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) {
/* set to suspended duplex state then restart */ /* set to suspended duplex state then restart
internal error 05 - Set device to suspended duplex state
should be done */
struct dasd_device *device = erp->startdev; struct dasd_device *device = erp->startdev;
dev_err(&device->cdev->dev,
DEV_MESSAGE(KERN_ERR, device, "%s", "An error occurred in the DASD device driver, "
"Set device to suspended duplex state should be " "reason=%s\n", "05");
"done!\n"
"This is not implemented yet (for compound ERP)"
" - please report to linux390@de.ibm.com");
} }
...@@ -2026,15 +2030,14 @@ dasd_3990_erp_handle_sim(struct dasd_device *device, char *sense) ...@@ -2026,15 +2030,14 @@ dasd_3990_erp_handle_sim(struct dasd_device *device, char *sense)
{ {
/* print message according to log or message to operator mode */ /* print message according to log or message to operator mode */
if ((sense[24] & DASD_SIM_MSG_TO_OP) || (sense[1] & 0x10)) { if ((sense[24] & DASD_SIM_MSG_TO_OP) || (sense[1] & 0x10)) {
/* print SIM SRC from RefCode */ /* print SIM SRC from RefCode */
DEV_MESSAGE(KERN_ERR, device, "SIM - SRC: " dev_err(&device->cdev->dev, "SIM - SRC: "
"%02x%02x%02x%02x", sense[22], "%02x%02x%02x%02x\n", sense[22],
sense[23], sense[11], sense[12]); sense[23], sense[11], sense[12]);
} else if (sense[24] & DASD_SIM_LOG) { } else if (sense[24] & DASD_SIM_LOG) {
/* print SIM SRC Refcode */ /* print SIM SRC Refcode */
DEV_MESSAGE(KERN_WARNING, device, "SIM - SRC: " dev_warn(&device->cdev->dev, "log SIM - SRC: "
"%02x%02x%02x%02x", sense[22], "%02x%02x%02x%02x\n", sense[22],
sense[23], sense[11], sense[12]); sense[23], sense[11], sense[12]);
} }
} }
...@@ -2077,14 +2080,14 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2077,14 +2080,14 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
switch (sense[25]) { switch (sense[25]) {
case 0x00: /* success - use default ERP for retries */ case 0x00: /* success - use default ERP for retries */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"ERP called for successful request" "ERP called for successful request"
" - just retry"); " - just retry");
break; break;
case 0x01: /* fatal error */ case 0x01: /* fatal error */
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"Retry not recommended - Fatal error"); "ERP failed for the DASD\n");
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
break; break;
...@@ -2094,13 +2097,10 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2094,13 +2097,10 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
erp = dasd_3990_erp_int_req(erp); erp = dasd_3990_erp_int_req(erp);
break; break;
case 0x0F: /* length mismatch during update write command */ case 0x0F: /* length mismatch during update write command
DEV_MESSAGE(KERN_ERR, device, "%s", internal error 08 - update write command error*/
"update write command error - should not " dev_err(&device->cdev->dev, "An error occurred in the "
"happen;\n" "DASD device driver, reason=%s\n", "08");
"Please send this message together with "
"the above sense data to linux390@de."
"ibm.com");
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
break; break;
...@@ -2109,13 +2109,12 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2109,13 +2109,12 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
erp = dasd_3990_erp_action_10_32(erp, sense); erp = dasd_3990_erp_action_10_32(erp, sense);
break; break;
case 0x15: /* next track outside defined extend */ case 0x15: /* next track outside defined extend
DEV_MESSAGE(KERN_ERR, device, "%s", internal error 07 - The next track is not
"next track outside defined extend - " within the defined storage extent */
"should not happen;\n" dev_err(&device->cdev->dev,
"Please send this message together with " "An error occurred in the DASD device driver, "
"the above sense data to linux390@de." "reason=%s\n", "07");
"ibm.com");
erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED); erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
break; break;
...@@ -2126,9 +2125,9 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2126,9 +2125,9 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
break; break;
case 0x1C: /* invalid data */ case 0x1C: /* invalid data */
DEV_MESSAGE(KERN_EMERG, device, "%s", dev_emerg(&device->cdev->dev,
"Data recovered during retry with PCI " "Data recovered during retry with PCI "
"fetch mode active"); "fetch mode active\n");
/* not possible to handle this situation in Linux */ /* not possible to handle this situation in Linux */
panic panic
...@@ -2137,7 +2136,7 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2137,7 +2136,7 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
break; break;
case 0x1D: /* state-change pending */ case 0x1D: /* state-change pending */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"A State change pending condition exists " "A State change pending condition exists "
"for the subsystem or device"); "for the subsystem or device");
...@@ -2145,7 +2144,7 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2145,7 +2144,7 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
break; break;
case 0x1E: /* busy */ case 0x1E: /* busy */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Busy condition exists " "Busy condition exists "
"for the subsystem or device"); "for the subsystem or device");
erp = dasd_3990_erp_action_4(erp, sense); erp = dasd_3990_erp_action_4(erp, sense);
...@@ -2187,7 +2186,7 @@ dasd_3990_erp_control_check(struct dasd_ccw_req *erp) ...@@ -2187,7 +2186,7 @@ dasd_3990_erp_control_check(struct dasd_ccw_req *erp)
if (scsw_cstat(&erp->refers->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK if (scsw_cstat(&erp->refers->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK
| SCHN_STAT_CHN_CTRL_CHK)) { | SCHN_STAT_CHN_CTRL_CHK)) {
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"channel or interface control check"); "channel or interface control check");
erp = dasd_3990_erp_action_4(erp, NULL); erp = dasd_3990_erp_action_4(erp, NULL);
} }
...@@ -2282,12 +2281,12 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) ...@@ -2282,12 +2281,12 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
cplength, datasize, device); cplength, datasize, device);
if (IS_ERR(erp)) { if (IS_ERR(erp)) {
if (cqr->retries <= 0) { if (cqr->retries <= 0) {
DEV_MESSAGE(KERN_ERR, device, "%s", DBF_DEV_EVENT(DBF_ERR, device, "%s",
"Unable to allocate ERP request"); "Unable to allocate ERP request");
cqr->status = DASD_CQR_FAILED; cqr->status = DASD_CQR_FAILED;
cqr->stopclk = get_clock (); cqr->stopclk = get_clock ();
} else { } else {
DEV_MESSAGE (KERN_ERR, device, DBF_DEV_EVENT(DBF_ERR, device,
"Unable to allocate ERP request " "Unable to allocate ERP request "
"(%i retries left)", "(%i retries left)",
cqr->retries); cqr->retries);
...@@ -2516,7 +2515,7 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp) ...@@ -2516,7 +2515,7 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
break; break;
} }
default: default:
DEV_MESSAGE(KERN_DEBUG, device, DBF_DEV_EVENT(DBF_WARNING, device,
"invalid subcommand modifier 0x%x " "invalid subcommand modifier 0x%x "
"for Diagnostic Control Command", "for Diagnostic Control Command",
sense[25]); sense[25]);
...@@ -2533,11 +2532,12 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp) ...@@ -2533,11 +2532,12 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
erp = dasd_3990_erp_compound(erp, sense); erp = dasd_3990_erp_compound(erp, sense);
} else { } else {
/* No retry left and no additional special handling */ /*
/*necessary */ * No retry left and no additional special handling
DEV_MESSAGE(KERN_ERR, device, * necessary
"no retries left for erp %p - " */
"set status to FAILED", erp); dev_err(&device->cdev->dev,
"ERP %p has run out of retries and failed\n", erp);
erp->status = DASD_CQR_FAILED; erp->status = DASD_CQR_FAILED;
} }
...@@ -2612,7 +2612,7 @@ dasd_3990_erp_handle_match_erp(struct dasd_ccw_req *erp_head, ...@@ -2612,7 +2612,7 @@ dasd_3990_erp_handle_match_erp(struct dasd_ccw_req *erp_head,
} else { } else {
/* simple retry */ /* simple retry */
DEV_MESSAGE(KERN_DEBUG, device, DBF_DEV_EVENT(DBF_DEBUG, device,
"%i retries left for erp %p", "%i retries left for erp %p",
erp->retries, erp); erp->retries, erp);
...@@ -2656,13 +2656,13 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) ...@@ -2656,13 +2656,13 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
if (device->features & DASD_FEATURE_ERPLOG) { if (device->features & DASD_FEATURE_ERPLOG) {
/* print current erp_chain */ /* print current erp_chain */
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"ERP chain at BEGINNING of ERP-ACTION"); "ERP chain at BEGINNING of ERP-ACTION\n");
for (temp_erp = cqr; for (temp_erp = cqr;
temp_erp != NULL; temp_erp = temp_erp->refers) { temp_erp != NULL; temp_erp = temp_erp->refers) {
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
" erp %p (%02x) refers to %p", "ERP %p (%02x) refers to %p\n",
temp_erp, temp_erp->status, temp_erp, temp_erp->status,
temp_erp->refers); temp_erp->refers);
} }
...@@ -2673,7 +2673,7 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) ...@@ -2673,7 +2673,7 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
(scsw_dstat(&cqr->irb.scsw) == (scsw_dstat(&cqr->irb.scsw) ==
(DEV_STAT_CHN_END | DEV_STAT_DEV_END))) { (DEV_STAT_CHN_END | DEV_STAT_DEV_END))) {
DEV_MESSAGE(KERN_DEBUG, device, DBF_DEV_EVENT(DBF_DEBUG, device,
"ERP called for successful request %p" "ERP called for successful request %p"
" - NO ERP necessary", cqr); " - NO ERP necessary", cqr);
...@@ -2695,13 +2695,13 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) ...@@ -2695,13 +2695,13 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
if (device->features & DASD_FEATURE_ERPLOG) { if (device->features & DASD_FEATURE_ERPLOG) {
/* print current erp_chain */ /* print current erp_chain */
DEV_MESSAGE(KERN_ERR, device, "%s", dev_err(&device->cdev->dev,
"ERP chain at END of ERP-ACTION"); "ERP chain at END of ERP-ACTION\n");
for (temp_erp = erp; for (temp_erp = erp;
temp_erp != NULL; temp_erp = temp_erp->refers) { temp_erp != NULL; temp_erp = temp_erp->refers) {
DEV_MESSAGE(KERN_ERR, device, dev_err(&device->cdev->dev,
" erp %p (%02x) refers to %p", "ERP %p (%02x) refers to %p\n",
temp_erp, temp_erp->status, temp_erp, temp_erp->status,
temp_erp->refers); temp_erp->refers);
} }
...@@ -2714,6 +2714,8 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) ...@@ -2714,6 +2714,8 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
list_add_tail(&erp->blocklist, &cqr->blocklist); list_add_tail(&erp->blocklist, &cqr->blocklist);
} }
return erp; return erp;
} /* end dasd_3990_erp_action */ } /* end dasd_3990_erp_action */
...@@ -5,6 +5,8 @@ ...@@ -5,6 +5,8 @@
* Author(s): Stefan Weinhuber <wein@de.ibm.com> * Author(s): Stefan Weinhuber <wein@de.ibm.com>
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/list.h> #include <linux/list.h>
#include <asm/ebcdic.h> #include <asm/ebcdic.h>
#include "dasd_int.h" #include "dasd_int.h"
...@@ -503,7 +505,7 @@ static void lcu_update_work(struct work_struct *work) ...@@ -503,7 +505,7 @@ static void lcu_update_work(struct work_struct *work)
*/ */
spin_lock_irqsave(&lcu->lock, flags); spin_lock_irqsave(&lcu->lock, flags);
if (rc || (lcu->flags & NEED_UAC_UPDATE)) { if (rc || (lcu->flags & NEED_UAC_UPDATE)) {
DEV_MESSAGE(KERN_WARNING, device, "could not update" DBF_DEV_EVENT(DBF_WARNING, device, "could not update"
" alias data in lcu (rc = %d), retry later", rc); " alias data in lcu (rc = %d), retry later", rc);
schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ); schedule_delayed_work(&lcu->ruac_data.dwork, 30*HZ);
} else { } else {
...@@ -875,7 +877,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -875,7 +877,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
lcu = private->lcu; lcu = private->lcu;
if (!lcu) { if (!lcu) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device not ready to handle summary" "device not ready to handle summary"
" unit check (no lcu structure)"); " unit check (no lcu structure)");
return; return;
...@@ -888,7 +890,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -888,7 +890,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
* the next interrupt on a different device * the next interrupt on a different device
*/ */
if (list_empty(&device->alias_list)) { if (list_empty(&device->alias_list)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"device is in offline processing," "device is in offline processing,"
" don't do summary unit check handling"); " don't do summary unit check handling");
spin_unlock(&lcu->lock); spin_unlock(&lcu->lock);
...@@ -896,7 +898,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device, ...@@ -896,7 +898,7 @@ void dasd_alias_handle_summary_unit_check(struct dasd_device *device,
} }
if (lcu->suc_data.device) { if (lcu->suc_data.device) {
/* already scheduled or running */ /* already scheduled or running */
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"previous instance of summary unit check worker" "previous instance of summary unit check worker"
" still pending"); " still pending");
spin_unlock(&lcu->lock); spin_unlock(&lcu->lock);
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -127,6 +129,7 @@ __setup ("dasd=", dasd_call_setup); ...@@ -127,6 +129,7 @@ __setup ("dasd=", dasd_call_setup);
* Read a device busid/devno from a string. * Read a device busid/devno from a string.
*/ */
static int static int
dasd_busid(char **str, int *id0, int *id1, int *devno) dasd_busid(char **str, int *id0, int *id1, int *devno)
{ {
int val, old_style; int val, old_style;
...@@ -134,8 +137,7 @@ dasd_busid(char **str, int *id0, int *id1, int *devno) ...@@ -134,8 +137,7 @@ dasd_busid(char **str, int *id0, int *id1, int *devno)
/* Interpret ipldev busid */ /* Interpret ipldev busid */
if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) { if (strncmp(DASD_IPLDEV, *str, strlen(DASD_IPLDEV)) == 0) {
if (ipl_info.type != IPL_TYPE_CCW) { if (ipl_info.type != IPL_TYPE_CCW) {
MESSAGE(KERN_ERR, "%s", "ipl device is not a ccw " pr_err("The IPL device is not a CCW device\n");
"device");
return -EINVAL; return -EINVAL;
} }
*id0 = 0; *id0 = 0;
...@@ -211,9 +213,8 @@ dasd_feature_list(char *str, char **endp) ...@@ -211,9 +213,8 @@ dasd_feature_list(char *str, char **endp)
else if (len == 8 && !strncmp(str, "failfast", 8)) else if (len == 8 && !strncmp(str, "failfast", 8))
features |= DASD_FEATURE_FAILFAST; features |= DASD_FEATURE_FAILFAST;
else { else {
MESSAGE(KERN_WARNING, pr_warning("%*s is not a supported device option\n",
"unsupported feature: %*s, " len, str);
"ignoring setting", len, str);
rc = -EINVAL; rc = -EINVAL;
} }
str += len; str += len;
...@@ -222,8 +223,8 @@ dasd_feature_list(char *str, char **endp) ...@@ -222,8 +223,8 @@ dasd_feature_list(char *str, char **endp)
str++; str++;
} }
if (*str != ')') { if (*str != ')') {
MESSAGE(KERN_WARNING, "%s", pr_warning("A closing parenthesis ')' is missing in the "
"missing ')' in dasd parameter string\n"); "dasd= parameter\n");
rc = -EINVAL; rc = -EINVAL;
} else } else
str++; str++;
...@@ -255,28 +256,27 @@ dasd_parse_keyword( char *parsestring ) { ...@@ -255,28 +256,27 @@ dasd_parse_keyword( char *parsestring ) {
} }
if (strncmp("autodetect", parsestring, length) == 0) { if (strncmp("autodetect", parsestring, length) == 0) {
dasd_autodetect = 1; dasd_autodetect = 1;
MESSAGE (KERN_INFO, "%s", pr_info("The autodetection mode has been activated\n");
"turning to autodetection mode");
return residual_str; return residual_str;
} }
if (strncmp("probeonly", parsestring, length) == 0) { if (strncmp("probeonly", parsestring, length) == 0) {
dasd_probeonly = 1; dasd_probeonly = 1;
MESSAGE(KERN_INFO, "%s", pr_info("The probeonly mode has been activated\n");
"turning to probeonly mode");
return residual_str; return residual_str;
} }
if (strncmp("nopav", parsestring, length) == 0) { if (strncmp("nopav", parsestring, length) == 0) {
if (MACHINE_IS_VM) if (MACHINE_IS_VM)
MESSAGE(KERN_INFO, "%s", "'nopav' not supported on VM"); pr_info("'nopav' is not supported on z/VM\n");
else { else {
dasd_nopav = 1; dasd_nopav = 1;
MESSAGE(KERN_INFO, "%s", "disable PAV mode"); pr_info("PAV support has be deactivated\n");
} }
return residual_str; return residual_str;
} }
if (strncmp("nofcx", parsestring, length) == 0) { if (strncmp("nofcx", parsestring, length) == 0) {
dasd_nofcx = 1; dasd_nofcx = 1;
MESSAGE(KERN_INFO, "%s", "disable High Performance Ficon"); pr_info("High Performance FICON support has been "
"deactivated\n");
return residual_str; return residual_str;
} }
if (strncmp("fixedbuffers", parsestring, length) == 0) { if (strncmp("fixedbuffers", parsestring, length) == 0) {
...@@ -287,10 +287,10 @@ dasd_parse_keyword( char *parsestring ) { ...@@ -287,10 +287,10 @@ dasd_parse_keyword( char *parsestring ) {
PAGE_SIZE, SLAB_CACHE_DMA, PAGE_SIZE, SLAB_CACHE_DMA,
NULL); NULL);
if (!dasd_page_cache) if (!dasd_page_cache)
MESSAGE(KERN_WARNING, "%s", "Failed to create slab, " DBF_EVENT(DBF_WARNING, "%s", "Failed to create slab, "
"fixed buffer mode disabled."); "fixed buffer mode disabled.");
else else
MESSAGE (KERN_INFO, "%s", DBF_EVENT(DBF_INFO, "%s",
"turning on fixed buffer mode"); "turning on fixed buffer mode");
return residual_str; return residual_str;
} }
...@@ -328,7 +328,7 @@ dasd_parse_range( char *parsestring ) { ...@@ -328,7 +328,7 @@ dasd_parse_range( char *parsestring ) {
(from_id0 != to_id0 || from_id1 != to_id1 || from > to)) (from_id0 != to_id0 || from_id1 != to_id1 || from > to))
rc = -EINVAL; rc = -EINVAL;
if (rc) { if (rc) {
MESSAGE(KERN_ERR, "Invalid device range %s", parsestring); pr_err("%s is not a valid device range\n", parsestring);
return ERR_PTR(rc); return ERR_PTR(rc);
} }
features = dasd_feature_list(str, &str); features = dasd_feature_list(str, &str);
...@@ -347,8 +347,8 @@ dasd_parse_range( char *parsestring ) { ...@@ -347,8 +347,8 @@ dasd_parse_range( char *parsestring ) {
return str + 1; return str + 1;
if (*str == '\0') if (*str == '\0')
return str; return str;
MESSAGE(KERN_WARNING, pr_warning("The dasd= parameter value %s has an invalid ending\n",
"junk at end of dasd parameter string: %s\n", str); str);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
......
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device) ...@@ -144,8 +146,8 @@ dasd_diag_erp(struct dasd_device *device)
mdsk_term_io(device); mdsk_term_io(device);
rc = mdsk_init_io(device, device->block->bp_block, 0, NULL); rc = mdsk_init_io(device, device->block->bp_block, 0, NULL);
if (rc) if (rc)
DEV_MESSAGE(KERN_WARNING, device, "DIAG ERP unsuccessful, " dev_warn(&device->cdev->dev, "DIAG ERP failed with "
"rc=%d", rc); "rc=%d\n", rc);
} }
/* Start a given request at the device. Return zero on success, non-zero /* Start a given request at the device. Return zero on success, non-zero
...@@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) ...@@ -160,7 +162,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
device = cqr->startdev; device = cqr->startdev;
if (cqr->retries < 0) { if (cqr->retries < 0) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG start_IO: request %p " DBF_DEV_EVENT(DBF_ERR, device, "DIAG start_IO: request %p "
"- no retry left)", cqr); "- no retry left)", cqr);
cqr->status = DASD_CQR_ERROR; cqr->status = DASD_CQR_ERROR;
return -EIO; return -EIO;
...@@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) ...@@ -195,7 +197,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
break; break;
default: /* Error condition */ default: /* Error condition */
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
DEV_MESSAGE(KERN_WARNING, device, "dia250 returned rc=%d", rc); DBF_DEV_EVENT(DBF_WARNING, device, "dia250 returned rc=%d", rc);
dasd_diag_erp(device); dasd_diag_erp(device);
rc = -EIO; rc = -EIO;
break; break;
...@@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code) ...@@ -243,13 +245,14 @@ dasd_ext_handler(__u16 code)
return; return;
} }
if (!ip) { /* no intparm: unsolicited interrupt */ if (!ip) { /* no intparm: unsolicited interrupt */
MESSAGE(KERN_DEBUG, "%s", "caught unsolicited interrupt"); DBF_EVENT(DBF_NOTICE, "%s", "caught unsolicited "
"interrupt");
return; return;
} }
cqr = (struct dasd_ccw_req *) ip; cqr = (struct dasd_ccw_req *) ip;
device = (struct dasd_device *) cqr->startdev; device = (struct dasd_device *) cqr->startdev;
if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) { if (strncmp(device->discipline->ebcname, (char *) &cqr->magic, 4)) {
DEV_MESSAGE(KERN_WARNING, device, DBF_DEV_EVENT(DBF_WARNING, device,
" magic number of dasd_ccw_req 0x%08X doesn't" " magic number of dasd_ccw_req 0x%08X doesn't"
" match discipline 0x%08X", " match discipline 0x%08X",
cqr->magic, *(int *) (&device->discipline->name)); cqr->magic, *(int *) (&device->discipline->name));
...@@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code) ...@@ -281,15 +284,11 @@ dasd_ext_handler(__u16 code)
rc = dasd_start_diag(next); rc = dasd_start_diag(next);
if (rc == 0) if (rc == 0)
expires = next->expires; expires = next->expires;
else if (rc != -EACCES)
DEV_MESSAGE(KERN_WARNING, device, "%s",
"Interrupt fastpath "
"failed!");
} }
} }
} else { } else {
cqr->status = DASD_CQR_QUEUED; cqr->status = DASD_CQR_QUEUED;
DEV_MESSAGE(KERN_WARNING, device, "interrupt status for " DBF_DEV_EVENT(DBF_DEBUG, device, "interrupt status for "
"request %p was %d (%d retries left)", cqr, status, "request %p was %d (%d retries left)", cqr, status,
cqr->retries); cqr->retries);
dasd_diag_erp(device); dasd_diag_erp(device);
...@@ -322,8 +321,9 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -322,8 +321,9 @@ dasd_diag_check_device(struct dasd_device *device)
if (private == NULL) { if (private == NULL) {
private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); private = kzalloc(sizeof(struct dasd_diag_private),GFP_KERNEL);
if (private == NULL) { if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"memory allocation failed for private data"); "Allocating memory for private DASD data "
"failed\n");
return -ENOMEM; return -ENOMEM;
} }
ccw_device_get_id(device->cdev, &private->dev_id); ccw_device_get_id(device->cdev, &private->dev_id);
...@@ -331,7 +331,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -331,7 +331,7 @@ dasd_diag_check_device(struct dasd_device *device)
} }
block = dasd_alloc_block(); block = dasd_alloc_block();
if (IS_ERR(block)) { if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"could not allocate dasd block structure"); "could not allocate dasd block structure");
device->private = NULL; device->private = NULL;
kfree(private); kfree(private);
...@@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -347,7 +347,7 @@ dasd_diag_check_device(struct dasd_device *device)
rc = diag210((struct diag210 *) rdc_data); rc = diag210((struct diag210 *) rdc_data);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "failed to retrieve device " DBF_DEV_EVENT(DBF_WARNING, device, "failed to retrieve device "
"information (rc=%d)", rc); "information (rc=%d)", rc);
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out; goto out;
...@@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -362,8 +362,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->pt_block = 2; private->pt_block = 2;
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "unsupported device class " dev_warn(&device->cdev->dev, "Device type %d is not supported "
"(class=%d)", private->rdc_data.vdev_class); "in DIAG mode\n", private->rdc_data.vdev_class);
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out; goto out;
} }
...@@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -380,7 +380,7 @@ dasd_diag_check_device(struct dasd_device *device)
/* figure out blocksize of device */ /* figure out blocksize of device */
label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL); label = (struct vtoc_cms_label *) get_zeroed_page(GFP_KERNEL);
if (label == NULL) { if (label == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to allocate initialization request"); "No memory to allocate initialization request");
rc = -ENOMEM; rc = -ENOMEM;
goto out; goto out;
...@@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -404,8 +404,8 @@ dasd_diag_check_device(struct dasd_device *device)
private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT; private->iob.flaga = DASD_DIAG_FLAGA_DEFAULT;
rc = dia250(&private->iob, RW_BIO); rc = dia250(&private->iob, RW_BIO);
if (rc == 3) { if (rc == 3) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"DIAG call failed"); "A 64-bit DIAG call failed\n");
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
goto out_label; goto out_label;
} }
...@@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -414,8 +414,8 @@ dasd_diag_check_device(struct dasd_device *device)
break; break;
} }
if (bsize > PAGE_SIZE) { if (bsize > PAGE_SIZE) {
DEV_MESSAGE(KERN_WARNING, device, "device access failed " dev_warn(&device->cdev->dev, "Accessing the DASD failed because"
"(rc=%d)", rc); " of an incorrect format (rc=%d)\n", rc);
rc = -EIO; rc = -EIO;
goto out_label; goto out_label;
} }
...@@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -433,15 +433,15 @@ dasd_diag_check_device(struct dasd_device *device)
block->s2b_shift++; block->s2b_shift++;
rc = mdsk_init_io(device, block->bp_block, 0, NULL); rc = mdsk_init_io(device, block->bp_block, 0, NULL);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, "DIAG initialization " dev_warn(&device->cdev->dev, "DIAG initialization "
"failed (rc=%d)", rc); "failed with rc=%d\n", rc);
rc = -EIO; rc = -EIO;
} else { } else {
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"(%ld B/blk): %ldkB", "New DASD with %ld byte/block, total size %ld KB\n",
(unsigned long) block->bp_block, (unsigned long) block->bp_block,
(unsigned long) (block->blocks << (unsigned long) (block->blocks <<
block->s2b_shift) >> 1); block->s2b_shift) >> 1);
} }
out_label: out_label:
free_page((long) label); free_page((long) label);
...@@ -595,7 +595,7 @@ static void ...@@ -595,7 +595,7 @@ static void
dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, dasd_diag_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *stat) struct irb *stat)
{ {
DEV_MESSAGE(KERN_ERR, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"dump sense not available for DIAG data"); "dump sense not available for DIAG data");
} }
...@@ -621,10 +621,8 @@ static int __init ...@@ -621,10 +621,8 @@ static int __init
dasd_diag_init(void) dasd_diag_init(void)
{ {
if (!MACHINE_IS_VM) { if (!MACHINE_IS_VM) {
MESSAGE_LOG(KERN_INFO, pr_info("Discipline %s cannot be used without z/VM\n",
"Machine is not VM: %s " dasd_diag_discipline.name);
"discipline not initializing",
dasd_diag_discipline.name);
return -ENODEV; return -ENODEV;
} }
ASCEBC(dasd_diag_discipline.ebcname, 4); ASCEBC(dasd_diag_discipline.ebcname, 4);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -87,7 +89,7 @@ dasd_eckd_probe (struct ccw_device *cdev) ...@@ -87,7 +89,7 @@ dasd_eckd_probe (struct ccw_device *cdev)
/* set ECKD specific ccw-device options */ /* set ECKD specific ccw-device options */
ret = ccw_device_set_options(cdev, CCWDEV_ALLOW_FORCE); ret = ccw_device_set_options(cdev, CCWDEV_ALLOW_FORCE);
if (ret) { if (ret) {
printk(KERN_WARNING DBF_EVENT(DBF_WARNING,
"dasd_eckd_probe: could not set ccw-device options " "dasd_eckd_probe: could not set ccw-device options "
"for %s\n", dev_name(&cdev->dev)); "for %s\n", dev_name(&cdev->dev));
return ret; return ret;
...@@ -248,8 +250,8 @@ define_extent(struct ccw1 *ccw, struct DE_eckd_data *data, unsigned int trk, ...@@ -248,8 +250,8 @@ define_extent(struct ccw1 *ccw, struct DE_eckd_data *data, unsigned int trk,
rc = check_XRC (ccw, data, device); rc = check_XRC (ccw, data, device);
break; break;
default: default:
DBF_DEV_EVENT(DBF_ERR, device, dev_err(&device->cdev->dev,
"PFX LRE unknown opcode 0x%x", cmd); "0x%x is not a known command\n", cmd);
break; break;
} }
...@@ -647,7 +649,8 @@ locate_record(struct ccw1 *ccw, struct LO_eckd_data *data, unsigned int trk, ...@@ -647,7 +649,8 @@ locate_record(struct ccw1 *ccw, struct LO_eckd_data *data, unsigned int trk,
data->operation.operation = 0x0b; data->operation.operation = 0x0b;
break; break;
default: default:
DEV_MESSAGE(KERN_ERR, device, "unknown opcode 0x%x", cmd); DBF_DEV_EVENT(DBF_ERR, device, "unknown locate record "
"opcode 0x%x", cmd);
} }
set_ch_t(&data->seek_addr, set_ch_t(&data->seek_addr,
trk / private->rdc_data.trk_per_cyl, trk / private->rdc_data.trk_per_cyl,
...@@ -742,8 +745,8 @@ static struct dasd_ccw_req *dasd_eckd_build_rcd_lpm(struct dasd_device *device, ...@@ -742,8 +745,8 @@ static struct dasd_ccw_req *dasd_eckd_build_rcd_lpm(struct dasd_device *device,
cqr = dasd_smalloc_request("ECKD", 1 /* RCD */, ciw->count, device); cqr = dasd_smalloc_request("ECKD", 1 /* RCD */, ciw->count, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate RCD request"); "Could not allocate RCD request");
return cqr; return cqr;
} }
...@@ -893,14 +896,16 @@ static int dasd_eckd_read_conf(struct dasd_device *device) ...@@ -893,14 +896,16 @@ static int dasd_eckd_read_conf(struct dasd_device *device)
rc = dasd_eckd_read_conf_lpm(device, &conf_data, rc = dasd_eckd_read_conf_lpm(device, &conf_data,
&conf_len, lpm); &conf_len, lpm);
if (rc && rc != -EOPNOTSUPP) { /* -EOPNOTSUPP is ok */ if (rc && rc != -EOPNOTSUPP) { /* -EOPNOTSUPP is ok */
MESSAGE(KERN_WARNING, DBF_EVENT(DBF_WARNING,
"Read configuration data returned " "Read configuration data returned "
"error %d", rc); "error %d for device: %s", rc,
dev_name(&device->cdev->dev));
return rc; return rc;
} }
if (conf_data == NULL) { if (conf_data == NULL) {
MESSAGE(KERN_WARNING, "%s", "No configuration " DBF_EVENT(DBF_WARNING, "No configuration "
"data retrieved"); "data retrieved for device: %s",
dev_name(&device->cdev->dev));
continue; /* no error */ continue; /* no error */
} }
/* save first valid configuration data */ /* save first valid configuration data */
...@@ -947,8 +952,9 @@ static int dasd_eckd_read_features(struct dasd_device *device) ...@@ -947,8 +952,9 @@ static int dasd_eckd_read_features(struct dasd_device *device)
sizeof(struct dasd_rssd_features)), sizeof(struct dasd_rssd_features)),
device); device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_EVENT(DBF_WARNING, "Could not allocate initialization "
"Could not allocate initialization request"); "request for device: %s",
dev_name(&device->cdev->dev));
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
cqr->startdev = device; cqr->startdev = device;
...@@ -1009,7 +1015,7 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device, ...@@ -1009,7 +1015,7 @@ static struct dasd_ccw_req *dasd_eckd_build_psf_ssc(struct dasd_device *device,
device); device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate PSF-SSC request"); "Could not allocate PSF-SSC request");
return cqr; return cqr;
} }
...@@ -1074,10 +1080,10 @@ static int dasd_eckd_validate_server(struct dasd_device *device) ...@@ -1074,10 +1080,10 @@ static int dasd_eckd_validate_server(struct dasd_device *device)
/* may be requested feature is not available on server, /* may be requested feature is not available on server,
* therefore just report error and go ahead */ * therefore just report error and go ahead */
private = (struct dasd_eckd_private *) device->private; private = (struct dasd_eckd_private *) device->private;
DEV_MESSAGE(KERN_INFO, device, DBF_EVENT(DBF_WARNING, "PSF-SSC on storage subsystem %s.%s.%04x "
"PSF-SSC on storage subsystem %s.%s.%04x returned rc=%d", "returned rc=%d for device: %s",
private->uid.vendor, private->uid.serial, private->uid.vendor, private->uid.serial,
private->uid.ssid, rc); private->uid.ssid, rc, dev_name(&device->cdev->dev));
/* RE-Read Configuration Data */ /* RE-Read Configuration Data */
return dasd_eckd_read_conf(device); return dasd_eckd_read_conf(device);
} }
...@@ -1099,9 +1105,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device) ...@@ -1099,9 +1105,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
private = kzalloc(sizeof(struct dasd_eckd_private), private = kzalloc(sizeof(struct dasd_eckd_private),
GFP_KERNEL | GFP_DMA); GFP_KERNEL | GFP_DMA);
if (private == NULL) { if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"memory allocation failed for private " "Allocating memory for private DASD data "
"data"); "failed\n");
return -ENOMEM; return -ENOMEM;
} }
device->private = (void *) private; device->private = (void *) private;
...@@ -1126,8 +1132,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device) ...@@ -1126,8 +1132,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
if (private->uid.type == UA_BASE_DEVICE) { if (private->uid.type == UA_BASE_DEVICE) {
block = dasd_alloc_block(); block = dasd_alloc_block();
if (IS_ERR(block)) { if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_EVENT(DBF_WARNING, "could not allocate dasd "
"could not allocate dasd block structure"); "block structure for device: %s",
dev_name(&device->cdev->dev));
rc = PTR_ERR(block); rc = PTR_ERR(block);
goto out_err1; goto out_err1;
} }
...@@ -1158,9 +1165,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device) ...@@ -1158,9 +1165,9 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
memset(rdc_data, 0, sizeof(rdc_data)); memset(rdc_data, 0, sizeof(rdc_data));
rc = dasd_generic_read_dev_chars(device, "ECKD", &rdc_data, 64); rc = dasd_generic_read_dev_chars(device, "ECKD", &rdc_data, 64);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, DBF_EVENT(DBF_WARNING,
"Read device characteristics returned " "Read device characteristics failed, rc=%d for "
"rc=%d", rc); "device: %s", rc, dev_name(&device->cdev->dev));
goto out_err3; goto out_err3;
} }
/* find the vaild cylinder size */ /* find the vaild cylinder size */
...@@ -1170,15 +1177,15 @@ dasd_eckd_check_characteristics(struct dasd_device *device) ...@@ -1170,15 +1177,15 @@ dasd_eckd_check_characteristics(struct dasd_device *device)
else else
private->real_cyl = private->rdc_data.no_cyl; private->real_cyl = private->rdc_data.no_cyl;
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev, "New DASD %04X/%02X (CU %04X/%02X) "
"%04X/%02X(CU:%04X/%02X) Cyl:%d Head:%d Sec:%d", "with %d cylinders, %d heads, %d sectors\n",
private->rdc_data.dev_type, private->rdc_data.dev_type,
private->rdc_data.dev_model, private->rdc_data.dev_model,
private->rdc_data.cu_type, private->rdc_data.cu_type,
private->rdc_data.cu_model.model, private->rdc_data.cu_model.model,
private->real_cyl, private->real_cyl,
private->rdc_data.trk_per_cyl, private->rdc_data.trk_per_cyl,
private->rdc_data.sec_per_trk); private->rdc_data.sec_per_trk);
return 0; return 0;
out_err3: out_err3:
...@@ -1319,8 +1326,8 @@ dasd_eckd_end_analysis(struct dasd_block *block) ...@@ -1319,8 +1326,8 @@ dasd_eckd_end_analysis(struct dasd_block *block)
status = private->init_cqr_status; status = private->init_cqr_status;
private->init_cqr_status = -1; private->init_cqr_status = -1;
if (status != DASD_CQR_DONE) { if (status != DASD_CQR_DONE) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"volume analysis returned unformatted disk"); "The DASD is not formatted\n");
return -EMEDIUMTYPE; return -EMEDIUMTYPE;
} }
...@@ -1348,8 +1355,8 @@ dasd_eckd_end_analysis(struct dasd_block *block) ...@@ -1348,8 +1355,8 @@ dasd_eckd_end_analysis(struct dasd_block *block)
count_area = &private->count_area[0]; count_area = &private->count_area[0];
} else { } else {
if (private->count_area[3].record == 1) if (private->count_area[3].record == 1)
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"Trk 0: no records after VTOC!"); "Track 0 has no records following the VTOC\n");
} }
if (count_area != NULL && count_area->kl == 0) { if (count_area != NULL && count_area->kl == 0) {
/* we found notthing violating our disk layout */ /* we found notthing violating our disk layout */
...@@ -1357,8 +1364,8 @@ dasd_eckd_end_analysis(struct dasd_block *block) ...@@ -1357,8 +1364,8 @@ dasd_eckd_end_analysis(struct dasd_block *block)
block->bp_block = count_area->dl; block->bp_block = count_area->dl;
} }
if (block->bp_block == 0) { if (block->bp_block == 0) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"Volume has incompatible disk layout"); "The disk layout of the DASD is not supported\n");
return -EMEDIUMTYPE; return -EMEDIUMTYPE;
} }
block->s2b_shift = 0; /* bits to shift 512 to get a block */ block->s2b_shift = 0; /* bits to shift 512 to get a block */
...@@ -1370,15 +1377,15 @@ dasd_eckd_end_analysis(struct dasd_block *block) ...@@ -1370,15 +1377,15 @@ dasd_eckd_end_analysis(struct dasd_block *block)
private->rdc_data.trk_per_cyl * private->rdc_data.trk_per_cyl *
blk_per_trk); blk_per_trk);
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"(%dkB blks): %dkB at %dkB/trk %s", "DASD with %d KB/block, %d KB total size, %d KB/track, "
(block->bp_block >> 10), "%s\n", (block->bp_block >> 10),
((private->real_cyl * ((private->real_cyl *
private->rdc_data.trk_per_cyl * private->rdc_data.trk_per_cyl *
blk_per_trk * (block->bp_block >> 9)) >> 1), blk_per_trk * (block->bp_block >> 9)) >> 1),
((blk_per_trk * block->bp_block) >> 10), ((blk_per_trk * block->bp_block) >> 10),
private->uses_cdl ? private->uses_cdl ?
"compatible disk layout" : "linux disk layout"); "compatible disk layout" : "linux disk layout");
return 0; return 0;
} }
...@@ -1444,19 +1451,19 @@ dasd_eckd_format_device(struct dasd_device * device, ...@@ -1444,19 +1451,19 @@ dasd_eckd_format_device(struct dasd_device * device,
/* Sanity checks. */ /* Sanity checks. */
if (fdata->start_unit >= if (fdata->start_unit >=
(private->real_cyl * private->rdc_data.trk_per_cyl)) { (private->real_cyl * private->rdc_data.trk_per_cyl)) {
DEV_MESSAGE(KERN_INFO, device, "Track no %u too big!", dev_warn(&device->cdev->dev, "Start track number %d used in "
fdata->start_unit); "formatting is too big\n", fdata->start_unit);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
if (fdata->start_unit > fdata->stop_unit) { if (fdata->start_unit > fdata->stop_unit) {
DEV_MESSAGE(KERN_INFO, device, "Track %u reached! ending.", dev_warn(&device->cdev->dev, "Start track %d used in "
fdata->start_unit); "formatting exceeds end track\n", fdata->start_unit);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
if (dasd_check_blocksize(fdata->blksize) != 0) { if (dasd_check_blocksize(fdata->blksize) != 0) {
DEV_MESSAGE(KERN_WARNING, device, dev_warn(&device->cdev->dev,
"Invalid blocksize %u...terminating!", "The DASD cannot be formatted with block size %d\n",
fdata->blksize); fdata->blksize);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
...@@ -1500,8 +1507,8 @@ dasd_eckd_format_device(struct dasd_device * device, ...@@ -1500,8 +1507,8 @@ dasd_eckd_format_device(struct dasd_device * device,
sizeof(struct eckd_count); sizeof(struct eckd_count);
break; break;
default: default:
DEV_MESSAGE(KERN_WARNING, device, "Invalid flags 0x%x.", dev_warn(&device->cdev->dev, "An I/O control call used "
fdata->intensity); "incorrect flags 0x%x\n", fdata->intensity);
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
} }
/* Allocate the format ccw request. */ /* Allocate the format ccw request. */
...@@ -1696,13 +1703,14 @@ static void dasd_eckd_handle_unsolicited_interrupt(struct dasd_device *device, ...@@ -1696,13 +1703,14 @@ static void dasd_eckd_handle_unsolicited_interrupt(struct dasd_device *device,
if (!sense) { if (!sense) {
/* just report other unsolicited interrupts */ /* just report other unsolicited interrupts */
DEV_MESSAGE(KERN_ERR, device, "%s", DBF_DEV_EVENT(DBF_ERR, device, "%s",
"unsolicited interrupt received"); "unsolicited interrupt received");
} else { } else {
DEV_MESSAGE(KERN_ERR, device, "%s", DBF_DEV_EVENT(DBF_ERR, device, "%s",
"unsolicited interrupt received " "unsolicited interrupt received "
"(sense available)"); "(sense available)");
device->discipline->dump_sense(device, NULL, irb); device->discipline->dump_sense_dbf(device, NULL, irb,
"unsolicited");
} }
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
...@@ -2553,7 +2561,7 @@ dasd_eckd_release(struct dasd_device *device) ...@@ -2553,7 +2561,7 @@ dasd_eckd_release(struct dasd_device *device)
cqr = dasd_smalloc_request(dasd_eckd_discipline.name, cqr = dasd_smalloc_request(dasd_eckd_discipline.name,
1, 32, device); 1, 32, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate initialization request"); "Could not allocate initialization request");
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
...@@ -2596,7 +2604,7 @@ dasd_eckd_reserve(struct dasd_device *device) ...@@ -2596,7 +2604,7 @@ dasd_eckd_reserve(struct dasd_device *device)
cqr = dasd_smalloc_request(dasd_eckd_discipline.name, cqr = dasd_smalloc_request(dasd_eckd_discipline.name,
1, 32, device); 1, 32, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate initialization request"); "Could not allocate initialization request");
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
...@@ -2638,7 +2646,7 @@ dasd_eckd_steal_lock(struct dasd_device *device) ...@@ -2638,7 +2646,7 @@ dasd_eckd_steal_lock(struct dasd_device *device)
cqr = dasd_smalloc_request(dasd_eckd_discipline.name, cqr = dasd_smalloc_request(dasd_eckd_discipline.name,
1, 32, device); 1, 32, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate initialization request"); "Could not allocate initialization request");
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
...@@ -2680,7 +2688,7 @@ dasd_eckd_performance(struct dasd_device *device, void __user *argp) ...@@ -2680,7 +2688,7 @@ dasd_eckd_performance(struct dasd_device *device, void __user *argp)
sizeof(struct dasd_rssd_perf_stats_t)), sizeof(struct dasd_rssd_perf_stats_t)),
device); device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate initialization request"); "Could not allocate initialization request");
return PTR_ERR(cqr); return PTR_ERR(cqr);
} }
...@@ -2770,9 +2778,9 @@ dasd_eckd_set_attrib(struct dasd_device *device, void __user *argp) ...@@ -2770,9 +2778,9 @@ dasd_eckd_set_attrib(struct dasd_device *device, void __user *argp)
return -EFAULT; return -EFAULT;
private->attrib = attrib; private->attrib = attrib;
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"cache operation mode set to %x (%i cylinder prestage)", "The DASD cache mode was set to %x (%i cylinder prestage)\n",
private->attrib.operation, private->attrib.nr_cyl); private->attrib.operation, private->attrib.nr_cyl);
return 0; return 0;
} }
...@@ -2823,7 +2831,7 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp) ...@@ -2823,7 +2831,7 @@ static int dasd_symm_io(struct dasd_device *device, void __user *argp)
/* setup CCWs for PSF + RSSD */ /* setup CCWs for PSF + RSSD */
cqr = dasd_smalloc_request("ECKD", 2 , 0, device); cqr = dasd_smalloc_request("ECKD", 2 , 0, device);
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"Could not allocate initialization request"); "Could not allocate initialization request");
rc = PTR_ERR(cqr); rc = PTR_ERR(cqr);
goto out_free; goto out_free;
...@@ -2932,6 +2940,49 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page) ...@@ -2932,6 +2940,49 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
return len; return len;
} }
static void
dasd_eckd_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req,
struct irb *irb, char *reason)
{
u64 *sense;
int sl;
struct tsb *tsb;
sense = NULL;
tsb = NULL;
if (req && scsw_is_tm(&req->irb.scsw)) {
if (irb->scsw.tm.tcw)
tsb = tcw_get_tsb(
(struct tcw *)(unsigned long)irb->scsw.tm.tcw);
if (tsb && (irb->scsw.tm.fcxs == 0x01)) {
switch (tsb->flags & 0x07) {
case 1: /* tsa_iostat */
sense = (u64 *)tsb->tsa.iostat.sense;
break;
case 2: /* ts_ddpc */
sense = (u64 *)tsb->tsa.ddpc.sense;
break;
case 3: /* tsa_intrg */
break;
}
}
} else {
if (irb->esw.esw0.erw.cons)
sense = (u64 *)irb->ecw;
}
if (sense) {
for (sl = 0; sl < 4; sl++) {
DBF_DEV_EVENT(DBF_EMERG, device,
"%s: %016llx %016llx %016llx %016llx",
reason, sense[0], sense[1], sense[2],
sense[3]);
}
} else {
DBF_DEV_EVENT(DBF_EMERG, device, "%s",
"SORRY - NO VALID SENSE AVAILABLE\n");
}
}
/* /*
* Print sense data and related channel program. * Print sense data and related channel program.
* Parts are printed because printk buffer is only 1024 bytes. * Parts are printed because printk buffer is only 1024 bytes.
...@@ -2945,8 +2996,8 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device, ...@@ -2945,8 +2996,8 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
page = (char *) get_zeroed_page(GFP_ATOMIC); page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) { if (page == NULL) {
DEV_MESSAGE(KERN_ERR, device, " %s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to dump sense data"); "No memory to dump sense data\n");
return; return;
} }
/* dump the sense data */ /* dump the sense data */
...@@ -3047,7 +3098,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, ...@@ -3047,7 +3098,7 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device,
page = (char *) get_zeroed_page(GFP_ATOMIC); page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) { if (page == NULL) {
DEV_MESSAGE(KERN_ERR, device, " %s", DBF_DEV_EVENT(DBF_WARNING, device, " %s",
"No memory to dump sense data"); "No memory to dump sense data");
return; return;
} }
...@@ -3206,6 +3257,7 @@ static struct dasd_discipline dasd_eckd_discipline = { ...@@ -3206,6 +3257,7 @@ static struct dasd_discipline dasd_eckd_discipline = {
.build_cp = dasd_eckd_build_alias_cp, .build_cp = dasd_eckd_build_alias_cp,
.free_cp = dasd_eckd_free_alias_cp, .free_cp = dasd_eckd_free_alias_cp,
.dump_sense = dasd_eckd_dump_sense, .dump_sense = dasd_eckd_dump_sense,
.dump_sense_dbf = dasd_eckd_dump_sense_dbf,
.fill_info = dasd_eckd_fill_info, .fill_info = dasd_eckd_fill_info,
.ioctl = dasd_eckd_ioctl, .ioctl = dasd_eckd_ioctl,
}; };
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* Author(s): Stefan Weinhuber <wein@de.ibm.com> * Author(s): Stefan Weinhuber <wein@de.ibm.com>
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/init.h> #include <linux/init.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/kernel.h> #include <linux/kernel.h>
...@@ -539,7 +541,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp) ...@@ -539,7 +541,7 @@ static int dasd_eer_open(struct inode *inp, struct file *filp)
if (eerb->buffer_page_count < 1 || if (eerb->buffer_page_count < 1 ||
eerb->buffer_page_count > INT_MAX / PAGE_SIZE) { eerb->buffer_page_count > INT_MAX / PAGE_SIZE) {
kfree(eerb); kfree(eerb);
MESSAGE(KERN_WARNING, "can't open device since module " DBF_EVENT(DBF_WARNING, "can't open device since module "
"parameter eer_pages is smaller than 1 or" "parameter eer_pages is smaller than 1 or"
" bigger than %d", (int)(INT_MAX / PAGE_SIZE)); " bigger than %d", (int)(INT_MAX / PAGE_SIZE));
unlock_kernel(); unlock_kernel();
...@@ -692,7 +694,7 @@ int __init dasd_eer_init(void) ...@@ -692,7 +694,7 @@ int __init dasd_eer_init(void)
if (rc) { if (rc) {
kfree(dasd_eer_dev); kfree(dasd_eer_dev);
dasd_eer_dev = NULL; dasd_eer_dev = NULL;
MESSAGE(KERN_ERR, "%s", "dasd_eer_init could not " DBF_EVENT(DBF_ERR, "%s", "dasd_eer_init could not "
"register misc device"); "register misc device");
return rc; return rc;
} }
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/init.h> #include <linux/init.h>
...@@ -91,14 +93,14 @@ dasd_default_erp_action(struct dasd_ccw_req *cqr) ...@@ -91,14 +93,14 @@ dasd_default_erp_action(struct dasd_ccw_req *cqr)
/* just retry - there is nothing to save ... I got no sense data.... */ /* just retry - there is nothing to save ... I got no sense data.... */
if (cqr->retries > 0) { if (cqr->retries > 0) {
DEV_MESSAGE (KERN_DEBUG, device, DBF_DEV_EVENT(DBF_DEBUG, device,
"default ERP called (%i retries left)", "default ERP called (%i retries left)",
cqr->retries); cqr->retries);
cqr->lpm = LPM_ANYPATH; cqr->lpm = LPM_ANYPATH;
cqr->status = DASD_CQR_FILLED; cqr->status = DASD_CQR_FILLED;
} else { } else {
DEV_MESSAGE (KERN_WARNING, device, "%s", dev_err(&device->cdev->dev,
"default ERP called (NO retry left)"); "default ERP has run out of retries and failed\n");
cqr->status = DASD_CQR_FAILED; cqr->status = DASD_CQR_FAILED;
cqr->stopclk = get_clock(); cqr->stopclk = get_clock();
} }
...@@ -162,8 +164,21 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb) ...@@ -162,8 +164,21 @@ dasd_log_sense(struct dasd_ccw_req *cqr, struct irb *irb)
device->discipline->dump_sense(device, cqr, irb); device->discipline->dump_sense(device, cqr, irb);
} }
void
dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb)
{
struct dasd_device *device;
device = cqr->startdev;
/* dump sense data to s390 debugfeature*/
if (device->discipline && device->discipline->dump_sense_dbf)
device->discipline->dump_sense_dbf(device, cqr, irb, "log");
}
EXPORT_SYMBOL(dasd_log_sense_dbf);
EXPORT_SYMBOL(dasd_default_erp_action); EXPORT_SYMBOL(dasd_default_erp_action);
EXPORT_SYMBOL(dasd_default_erp_postaction); EXPORT_SYMBOL(dasd_default_erp_postaction);
EXPORT_SYMBOL(dasd_alloc_erp_request); EXPORT_SYMBOL(dasd_alloc_erp_request);
EXPORT_SYMBOL(dasd_free_erp_request); EXPORT_SYMBOL(dasd_free_erp_request);
EXPORT_SYMBOL(dasd_log_sense); EXPORT_SYMBOL(dasd_log_sense);
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/stddef.h> #include <linux/stddef.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <asm/debug.h> #include <asm/debug.h>
...@@ -128,17 +130,18 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -128,17 +130,18 @@ dasd_fba_check_characteristics(struct dasd_device *device)
private = kzalloc(sizeof(struct dasd_fba_private), private = kzalloc(sizeof(struct dasd_fba_private),
GFP_KERNEL | GFP_DMA); GFP_KERNEL | GFP_DMA);
if (private == NULL) { if (private == NULL) {
DEV_MESSAGE(KERN_WARNING, device, "%s", dev_warn(&device->cdev->dev,
"memory allocation failed for private " "Allocating memory for private DASD "
"data"); "data failed\n");
return -ENOMEM; return -ENOMEM;
} }
device->private = (void *) private; device->private = (void *) private;
} }
block = dasd_alloc_block(); block = dasd_alloc_block();
if (IS_ERR(block)) { if (IS_ERR(block)) {
DEV_MESSAGE(KERN_WARNING, device, "%s", DBF_EVENT(DBF_WARNING, "could not allocate dasd block "
"could not allocate dasd block structure"); "structure for device: %s",
dev_name(&device->cdev->dev));
device->private = NULL; device->private = NULL;
kfree(private); kfree(private);
return PTR_ERR(block); return PTR_ERR(block);
...@@ -150,9 +153,9 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -150,9 +153,9 @@ dasd_fba_check_characteristics(struct dasd_device *device)
rdc_data = (void *) &(private->rdc_data); rdc_data = (void *) &(private->rdc_data);
rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32); rc = dasd_generic_read_dev_chars(device, "FBA ", &rdc_data, 32);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_WARNING, device, DBF_EVENT(DBF_WARNING, "Read device characteristics returned "
"Read device characteristics returned error %d", "error %d for device: %s",
rc); rc, dev_name(&device->cdev->dev));
device->block = NULL; device->block = NULL;
dasd_free_block(block); dasd_free_block(block);
device->private = NULL; device->private = NULL;
...@@ -160,15 +163,16 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -160,15 +163,16 @@ dasd_fba_check_characteristics(struct dasd_device *device)
return rc; return rc;
} }
DEV_MESSAGE(KERN_INFO, device, dev_info(&device->cdev->dev,
"%04X/%02X(CU:%04X/%02X) %dMB at(%d B/blk)", "New FBA DASD %04X/%02X (CU %04X/%02X) with %d MB "
cdev->id.dev_type, "and %d B/blk\n",
cdev->id.dev_model, cdev->id.dev_type,
cdev->id.cu_type, cdev->id.dev_model,
cdev->id.cu_model, cdev->id.cu_type,
((private->rdc_data.blk_bdsa * cdev->id.cu_model,
(private->rdc_data.blk_size >> 9)) >> 11), ((private->rdc_data.blk_bdsa *
private->rdc_data.blk_size); (private->rdc_data.blk_size >> 9)) >> 11),
private->rdc_data.blk_size);
return 0; return 0;
} }
...@@ -180,7 +184,7 @@ static int dasd_fba_do_analysis(struct dasd_block *block) ...@@ -180,7 +184,7 @@ static int dasd_fba_do_analysis(struct dasd_block *block)
private = (struct dasd_fba_private *) block->base->private; private = (struct dasd_fba_private *) block->base->private;
rc = dasd_check_blocksize(private->rdc_data.blk_size); rc = dasd_check_blocksize(private->rdc_data.blk_size);
if (rc) { if (rc) {
DEV_MESSAGE(KERN_INFO, block->base, "unknown blocksize %d", DBF_DEV_EVENT(DBF_WARNING, block->base, "unknown blocksize %d",
private->rdc_data.blk_size); private->rdc_data.blk_size);
return rc; return rc;
} }
...@@ -215,7 +219,7 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr) ...@@ -215,7 +219,7 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr)
if (cqr->function == dasd_default_erp_action) if (cqr->function == dasd_default_erp_action)
return dasd_default_erp_postaction; return dasd_default_erp_postaction;
DEV_MESSAGE(KERN_WARNING, cqr->startdev, "unknown ERP action %p", DBF_DEV_EVENT(DBF_WARNING, cqr->startdev, "unknown ERP action %p",
cqr->function); cqr->function);
return NULL; return NULL;
} }
...@@ -233,9 +237,9 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device, ...@@ -233,9 +237,9 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device,
} }
/* check for unsolicited interrupts */ /* check for unsolicited interrupts */
DEV_MESSAGE(KERN_DEBUG, device, "%s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"unsolicited interrupt received"); "unsolicited interrupt received");
device->discipline->dump_sense(device, NULL, irb); device->discipline->dump_sense_dbf(device, NULL, irb, "unsolicited");
dasd_schedule_device_bh(device); dasd_schedule_device_bh(device);
return; return;
}; };
...@@ -436,6 +440,25 @@ dasd_fba_fill_info(struct dasd_device * device, ...@@ -436,6 +440,25 @@ dasd_fba_fill_info(struct dasd_device * device,
return 0; return 0;
} }
static void
dasd_fba_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req,
struct irb *irb, char *reason)
{
int sl;
if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) {
DBF_DEV_EVENT(DBF_EMERG, device,
"%s: %08x %08x %08x %08x",
reason, irb->ecw[8 * 0], irb->ecw[8 * 1],
irb->ecw[8 * 2], irb->ecw[8 * 3]);
}
} else {
DBF_DEV_EVENT(DBF_EMERG, device, "%s",
"SORRY - NO VALID SENSE AVAILABLE\n");
}
}
static void static void
dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *irb) struct irb *irb)
...@@ -446,7 +469,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -446,7 +469,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
page = (char *) get_zeroed_page(GFP_ATOMIC); page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) { if (page == NULL) {
DEV_MESSAGE(KERN_ERR, device, " %s", DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"No memory to dump sense data"); "No memory to dump sense data");
return; return;
} }
...@@ -476,8 +499,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -476,8 +499,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, KERN_ERR PRINTK_HEADER len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n"); " SORRY - NO VALID SENSE AVAILABLE\n");
} }
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
/* dump the Channel Program */ /* dump the Channel Program */
/* print first CCWs (maximum 8) */ /* print first CCWs (maximum 8) */
...@@ -498,8 +520,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -498,8 +520,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
len += sprintf(page + len, "\n"); len += sprintf(page + len, "\n");
act++; act++;
} }
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
/* print failing CCW area */ /* print failing CCW area */
...@@ -540,8 +561,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -540,8 +561,7 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
act++; act++;
} }
if (len > 0) if (len > 0)
MESSAGE_LOG(KERN_ERR, "%s", printk(KERN_ERR "%s", page);
page + sizeof(KERN_ERR PRINTK_HEADER));
free_page((unsigned long) page); free_page((unsigned long) page);
} }
...@@ -576,6 +596,7 @@ static struct dasd_discipline dasd_fba_discipline = { ...@@ -576,6 +596,7 @@ static struct dasd_discipline dasd_fba_discipline = {
.build_cp = dasd_fba_build_cp, .build_cp = dasd_fba_build_cp,
.free_cp = dasd_fba_free_cp, .free_cp = dasd_fba_free_cp,
.dump_sense = dasd_fba_dump_sense, .dump_sense = dasd_fba_dump_sense,
.dump_sense_dbf = dasd_fba_dump_sense_dbf,
.fill_info = dasd_fba_fill_info, .fill_info = dasd_fba_fill_info,
}; };
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/blkpg.h> #include <linux/blkpg.h>
...@@ -163,9 +165,8 @@ int dasd_gendisk_init(void) ...@@ -163,9 +165,8 @@ int dasd_gendisk_init(void)
/* Register to static dasd major 94 */ /* Register to static dasd major 94 */
rc = register_blkdev(DASD_MAJOR, "dasd"); rc = register_blkdev(DASD_MAJOR, "dasd");
if (rc != 0) { if (rc != 0) {
MESSAGE(KERN_WARNING, pr_warning("Registering the device driver with major number "
"Couldn't register successfully to " "%d failed\n", DASD_MAJOR);
"major no %d", DASD_MAJOR);
return rc; return rc;
} }
return 0; return 0;
......
...@@ -112,6 +112,9 @@ do { \ ...@@ -112,6 +112,9 @@ do { \
d_data); \ d_data); \
} while(0) } while(0)
/* limit size for an errorstring */
#define ERRORLENGTH 30
/* definition of dbf debug levels */ /* definition of dbf debug levels */
#define DBF_EMERG 0 /* system is unusable */ #define DBF_EMERG 0 /* system is unusable */
#define DBF_ALERT 1 /* action must be taken immediately */ #define DBF_ALERT 1 /* action must be taken immediately */
...@@ -281,6 +284,8 @@ struct dasd_discipline { ...@@ -281,6 +284,8 @@ struct dasd_discipline {
dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *); dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *);
void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *, void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *); struct irb *);
void (*dump_sense_dbf) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *, char *);
void (*handle_unsolicited_interrupt) (struct dasd_device *, void (*handle_unsolicited_interrupt) (struct dasd_device *,
struct irb *); struct irb *);
...@@ -626,6 +631,7 @@ struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int, ...@@ -626,6 +631,7 @@ struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int,
struct dasd_device *); struct dasd_device *);
void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *); void dasd_free_erp_request(struct dasd_ccw_req *, struct dasd_device *);
void dasd_log_sense(struct dasd_ccw_req *, struct irb *); void dasd_log_sense(struct dasd_ccw_req *, struct irb *);
void dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb);
/* externals in dasd_3990_erp.c */ /* externals in dasd_3990_erp.c */
struct dasd_ccw_req *dasd_3990_erp_action(struct dasd_ccw_req *); struct dasd_ccw_req *dasd_3990_erp_action(struct dasd_ccw_req *);
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
* *
* i/o controls for the dasd driver. * i/o controls for the dasd driver.
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/fs.h> #include <linux/fs.h>
...@@ -94,7 +97,8 @@ static int dasd_ioctl_quiesce(struct dasd_block *block) ...@@ -94,7 +97,8 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
if (!capable (CAP_SYS_ADMIN)) if (!capable (CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
DEV_MESSAGE(KERN_DEBUG, base, "%s", "Quiesce IO on device"); dev_info(&base->cdev->dev, "The DASD has been put in the quiesce "
"state\n");
spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
base->stopped |= DASD_STOPPED_QUIESCE; base->stopped |= DASD_STOPPED_QUIESCE;
spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
...@@ -103,7 +107,7 @@ static int dasd_ioctl_quiesce(struct dasd_block *block) ...@@ -103,7 +107,7 @@ static int dasd_ioctl_quiesce(struct dasd_block *block)
/* /*
* Quiesce device. * Resume device.
*/ */
static int dasd_ioctl_resume(struct dasd_block *block) static int dasd_ioctl_resume(struct dasd_block *block)
{ {
...@@ -114,7 +118,8 @@ static int dasd_ioctl_resume(struct dasd_block *block) ...@@ -114,7 +118,8 @@ static int dasd_ioctl_resume(struct dasd_block *block)
if (!capable (CAP_SYS_ADMIN)) if (!capable (CAP_SYS_ADMIN))
return -EACCES; return -EACCES;
DEV_MESSAGE(KERN_DEBUG, base, "%s", "resume IO on device"); dev_info(&base->cdev->dev, "I/O operations have been resumed "
"on the DASD\n");
spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags); spin_lock_irqsave(get_ccwdev_lock(base->cdev), flags);
base->stopped &= ~DASD_STOPPED_QUIESCE; base->stopped &= ~DASD_STOPPED_QUIESCE;
spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags); spin_unlock_irqrestore(get_ccwdev_lock(base->cdev), flags);
...@@ -140,8 +145,8 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) ...@@ -140,8 +145,8 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
return -EPERM; return -EPERM;
if (base->state != DASD_STATE_BASIC) { if (base->state != DASD_STATE_BASIC) {
DEV_MESSAGE(KERN_WARNING, base, "%s", dev_warn(&base->cdev->dev,
"dasd_format: device is not disabled! "); "The DASD cannot be formatted while it is enabled\n");
return -EBUSY; return -EBUSY;
} }
...@@ -169,10 +174,9 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata) ...@@ -169,10 +174,9 @@ static int dasd_format(struct dasd_block *block, struct format_data_t *fdata)
dasd_sfree_request(cqr, cqr->memdev); dasd_sfree_request(cqr, cqr->memdev);
if (rc) { if (rc) {
if (rc != -ERESTARTSYS) if (rc != -ERESTARTSYS)
DEV_MESSAGE(KERN_ERR, base, dev_err(&base->cdev->dev,
" Formatting of unit %u failed " "Formatting unit %d failed with "
"with rc = %d", "rc=%d\n", fdata->start_unit, rc);
fdata->start_unit, rc);
return rc; return rc;
} }
fdata->start_unit++; fdata->start_unit++;
...@@ -199,8 +203,9 @@ dasd_ioctl_format(struct block_device *bdev, void __user *argp) ...@@ -199,8 +203,9 @@ dasd_ioctl_format(struct block_device *bdev, void __user *argp)
if (copy_from_user(&fdata, argp, sizeof(struct format_data_t))) if (copy_from_user(&fdata, argp, sizeof(struct format_data_t)))
return -EFAULT; return -EFAULT;
if (bdev != bdev->bd_contains) { if (bdev != bdev->bd_contains) {
DEV_MESSAGE(KERN_WARNING, block->base, "%s", dev_warn(&block->base->cdev->dev,
"Cannot low-level format a partition"); "The specified DASD is a partition and cannot be "
"formatted\n");
return -EINVAL; return -EINVAL;
} }
return dasd_format(block, &fdata); return dasd_format(block, &fdata);
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
* *
*/ */
#define KMSG_COMPONENT "dasd"
#include <linux/ctype.h> #include <linux/ctype.h>
#include <linux/seq_file.h> #include <linux/seq_file.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
...@@ -267,7 +269,7 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, ...@@ -267,7 +269,7 @@ dasd_statistics_write(struct file *file, const char __user *user_buf,
buffer = dasd_get_user_string(user_buf, user_len); buffer = dasd_get_user_string(user_buf, user_len);
if (IS_ERR(buffer)) if (IS_ERR(buffer))
return PTR_ERR(buffer); return PTR_ERR(buffer);
MESSAGE_LOG(KERN_INFO, "/proc/dasd/statictics: '%s'", buffer); DBF_EVENT(DBF_DEBUG, "/proc/dasd/statictics: '%s'\n", buffer);
/* check for valid verbs */ /* check for valid verbs */
for (str = buffer; isspace(*str); str++); for (str = buffer; isspace(*str); str++);
...@@ -277,33 +279,33 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, ...@@ -277,33 +279,33 @@ dasd_statistics_write(struct file *file, const char __user *user_buf,
if (strcmp(str, "on") == 0) { if (strcmp(str, "on") == 0) {
/* switch on statistics profiling */ /* switch on statistics profiling */
dasd_profile_level = DASD_PROFILE_ON; dasd_profile_level = DASD_PROFILE_ON;
MESSAGE(KERN_INFO, "%s", "Statistics switched on"); pr_info("The statistics feature has been switched "
"on\n");
} else if (strcmp(str, "off") == 0) { } else if (strcmp(str, "off") == 0) {
/* switch off and reset statistics profiling */ /* switch off and reset statistics profiling */
memset(&dasd_global_profile, memset(&dasd_global_profile,
0, sizeof (struct dasd_profile_info_t)); 0, sizeof (struct dasd_profile_info_t));
dasd_profile_level = DASD_PROFILE_OFF; dasd_profile_level = DASD_PROFILE_OFF;
MESSAGE(KERN_INFO, "%s", "Statistics switched off"); pr_info("The statistics feature has been switched "
"off\n");
} else } else
goto out_error; goto out_error;
} else if (strncmp(str, "reset", 5) == 0) { } else if (strncmp(str, "reset", 5) == 0) {
/* reset the statistics */ /* reset the statistics */
memset(&dasd_global_profile, 0, memset(&dasd_global_profile, 0,
sizeof (struct dasd_profile_info_t)); sizeof (struct dasd_profile_info_t));
MESSAGE(KERN_INFO, "%s", "Statistics reset"); pr_info("The statistics have been reset\n");
} else } else
goto out_error; goto out_error;
kfree(buffer); kfree(buffer);
return user_len; return user_len;
out_error: out_error:
MESSAGE(KERN_WARNING, "%s", pr_warning("%s is not a supported value for /proc/dasd/statistics\n",
"/proc/dasd/statistics: only 'set on', 'set off' " str);
"and 'reset' are supported verbs");
kfree(buffer); kfree(buffer);
return -EINVAL; return -EINVAL;
#else #else
MESSAGE(KERN_WARNING, "%s", pr_warning("/proc/dasd/statistics: is not activated in this kernel\n");
"/proc/dasd/statistics: is not activated in this kernel");
return user_len; return user_len;
#endif /* CONFIG_DASD_PROFILE */ #endif /* CONFIG_DASD_PROFILE */
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment