Commit 20f9cb26 authored by Horst Hummel's avatar Horst Hummel Committed by Linus Torvalds

[PATCH] s390: dasd driver debug log

dasd driver changes:
 - Fix debug feature usage. The sprinf event/exception functions write a
   pointer to a format string (%s) to the log. These strings must be valid
   at the time the DBF-log is read.
 - Some coding style reformatting.
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent f172f421
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
* *
* $Revision: 1.151 $ * $Revision: 1.154 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -179,7 +179,7 @@ dasd_state_known_to_basic(struct dasd_device * device) ...@@ -179,7 +179,7 @@ dasd_state_known_to_basic(struct dasd_device * device)
device->debug_area = debug_register(device->cdev->dev.bus_id, 0, 2, device->debug_area = debug_register(device->cdev->dev.bus_id, 0, 2,
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_ERR); debug_set_level(device->debug_area, DBF_DEBUG);
DBF_DEV_EVENT(DBF_EMERG, device, "%s", "debug area created"); DBF_DEV_EVENT(DBF_EMERG, device, "%s", "debug area created");
device->state = DASD_STATE_BASIC; device->state = DASD_STATE_BASIC;
...@@ -520,10 +520,6 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize, ...@@ -520,10 +520,6 @@ dasd_kmalloc_request(char *magic, int cplength, int datasize,
if ( magic == NULL || datasize > PAGE_SIZE || if ( magic == NULL || datasize > PAGE_SIZE ||
(cplength*sizeof(struct ccw1)) > PAGE_SIZE) (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
BUG(); BUG();
debug_text_event ( dasd_debug_area, 1, "ALLC");
debug_text_event ( dasd_debug_area, 1, magic);
debug_int_event ( dasd_debug_area, 1, cplength);
debug_int_event ( dasd_debug_area, 1, datasize);
cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC); cqr = kmalloc(sizeof(struct dasd_ccw_req), GFP_ATOMIC);
if (cqr == NULL) if (cqr == NULL)
...@@ -570,10 +566,6 @@ dasd_smalloc_request(char *magic, int cplength, int datasize, ...@@ -570,10 +566,6 @@ dasd_smalloc_request(char *magic, int cplength, int datasize,
if ( magic == NULL || datasize > PAGE_SIZE || if ( magic == NULL || datasize > PAGE_SIZE ||
(cplength*sizeof(struct ccw1)) > PAGE_SIZE) (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
BUG(); BUG();
debug_text_event ( dasd_debug_area, 1, "ALLC");
debug_text_event ( dasd_debug_area, 1, magic);
debug_int_event ( dasd_debug_area, 1, cplength);
debug_int_event ( dasd_debug_area, 1, datasize);
size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
if (cplength > 0) if (cplength > 0)
...@@ -623,8 +615,6 @@ dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device) ...@@ -623,8 +615,6 @@ dasd_kfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
clear_normalized_cda(ccw); clear_normalized_cda(ccw);
} while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC)); } while (ccw++->flags & (CCW_FLAG_CC | CCW_FLAG_DC));
#endif #endif
debug_text_event ( dasd_debug_area, 1, "FREE");
debug_int_event ( dasd_debug_area, 1, (long) cqr);
if (cqr->cpaddr != NULL) if (cqr->cpaddr != NULL)
kfree(cqr->cpaddr); kfree(cqr->cpaddr);
if (cqr->data != NULL) if (cqr->data != NULL)
...@@ -638,8 +628,6 @@ dasd_sfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device) ...@@ -638,8 +628,6 @@ dasd_sfree_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
{ {
unsigned long flags; unsigned long flags;
debug_text_event(dasd_debug_area, 1, "FREE");
debug_int_event(dasd_debug_area, 1, (long) cqr);
spin_lock_irqsave(&device->mem_lock, flags); spin_lock_irqsave(&device->mem_lock, flags);
dasd_free_chunk(&device->ccw_chunks, cqr); dasd_free_chunk(&device->ccw_chunks, cqr);
spin_unlock_irqrestore(&device->mem_lock, flags); spin_unlock_irqrestore(&device->mem_lock, flags);
...@@ -696,6 +684,9 @@ dasd_term_IO(struct dasd_ccw_req * cqr) ...@@ -696,6 +684,9 @@ dasd_term_IO(struct dasd_ccw_req * cqr)
} else } else
cqr->status = DASD_CQR_FAILED; cqr->status = DASD_CQR_FAILED;
cqr->stopclk = get_clock(); cqr->stopclk = get_clock();
DBF_DEV_EVENT(DBF_DEBUG, device,
"terminate cqr %p successful",
cqr);
break; break;
case -ENODEV: case -ENODEV:
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_ERR, device, "%s",
...@@ -754,6 +745,8 @@ dasd_start_IO(struct dasd_ccw_req * cqr) ...@@ -754,6 +745,8 @@ dasd_start_IO(struct dasd_ccw_req * cqr)
switch (rc) { switch (rc) {
case 0: case 0:
cqr->status = DASD_CQR_IN_IO; cqr->status = DASD_CQR_IN_IO;
DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
"start_IO: request %p started successful");
break; break;
case -EBUSY: case -EBUSY:
DBF_DEV_EVENT(DBF_ERR, device, "%s", DBF_DEV_EVENT(DBF_ERR, device, "%s",
...@@ -964,8 +957,8 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm, ...@@ -964,8 +957,8 @@ dasd_int_handler(struct ccw_device *cdev, unsigned long intparm,
cdev->dev.bus_id, cqr->status); cdev->dev.bus_id, cqr->status);
return; return;
} }
DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x", DBF_DEV_EVENT(DBF_DEBUG, device, "Int: CS/DS 0x%04x for cqr %p",
((irb->scsw.cstat << 8) | irb->scsw.dstat)); ((irb->scsw.cstat << 8) | irb->scsw.dstat), cqr);
/* Find out the appropriate era_action. */ /* Find out the appropriate era_action. */
if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC) if (irb->scsw.fctl & SCSW_FCTL_HALT_FUNC)
...@@ -1080,7 +1073,8 @@ __dasd_process_ccw_queue(struct dasd_device * device, ...@@ -1080,7 +1073,8 @@ __dasd_process_ccw_queue(struct dasd_device * device,
cqr->stopclk = get_clock(); cqr->stopclk = get_clock();
} else { } else {
if (cqr->irb.esw.esw0.erw.cons) { if (cqr->irb.esw.esw0.erw.cons) {
erp_fn = device->discipline->erp_action(cqr); erp_fn = device->discipline->
erp_action(cqr);
erp_fn(cqr); erp_fn(cqr);
} else } else
dasd_default_erp_action(cqr); dasd_default_erp_action(cqr);
...@@ -1153,9 +1147,8 @@ __dasd_process_blk_queue(struct dasd_device * device) ...@@ -1153,9 +1147,8 @@ __dasd_process_blk_queue(struct dasd_device * device)
req = elv_next_request(queue); req = elv_next_request(queue);
if (test_bit(DASD_FLAG_RO, &device->flags) && if (test_bit(DASD_FLAG_RO, &device->flags) &&
rq_data_dir(req) == WRITE) { rq_data_dir(req) == WRITE) {
DBF_EVENT(DBF_ERR, DBF_DEV_EVENT(DBF_ERR, device,
"(%s) Rejecting write request %p", "Rejecting write request %p",
device->cdev->dev.bus_id,
req); req);
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
dasd_end_request(req, 0); dasd_end_request(req, 0);
...@@ -1170,10 +1163,10 @@ __dasd_process_blk_queue(struct dasd_device * device) ...@@ -1170,10 +1163,10 @@ __dasd_process_blk_queue(struct dasd_device * device)
if (IS_ERR(cqr)) { if (IS_ERR(cqr)) {
if (PTR_ERR(cqr) == -ENOMEM) if (PTR_ERR(cqr) == -ENOMEM)
break; /* terminate request queue loop */ break; /* terminate request queue loop */
DBF_EVENT(DBF_ERR, DBF_DEV_EVENT(DBF_ERR, device,
"(%s) CCW creation failed on request %p", "CCW creation failed (rc=%ld) "
device->cdev->dev.bus_id, "on request %p",
req); PTR_ERR(cqr), req);
blkdev_dequeue_request(req); blkdev_dequeue_request(req);
dasd_end_request(req, 0); dasd_end_request(req, 0);
continue; continue;
...@@ -1678,9 +1671,8 @@ dasd_open(struct inode *inp, struct file *filp) ...@@ -1678,9 +1671,8 @@ dasd_open(struct inode *inp, struct file *filp)
} }
if (dasd_probeonly) { if (dasd_probeonly) {
MESSAGE(KERN_INFO, DEV_MESSAGE(KERN_INFO, device, "%s",
"No access to device %s due to probeonly mode", "No access to device due to probeonly mode");
disk->disk_name);
rc = -EPERM; rc = -EPERM;
goto out; goto out;
} }
...@@ -1970,8 +1962,8 @@ dasd_init(void) ...@@ -1970,8 +1962,8 @@ dasd_init(void)
rc = -ENOMEM; rc = -ENOMEM;
goto failed; goto failed;
} }
debug_register_view(dasd_debug_area, &debug_hex_ascii_view); debug_register_view(dasd_debug_area, &debug_sprintf_view);
debug_set_level(dasd_debug_area, DBF_ERR); debug_set_level(dasd_debug_area, DBF_DEBUG);
DBF_EVENT(DBF_EMERG, "%s", "debug area created"); DBF_EVENT(DBF_EMERG, "%s", "debug area created");
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
* *
* $Revision: 1.34 $ * $Revision: 1.36 $
*/ */
#include <linux/timer.h> #include <linux/timer.h>
...@@ -422,7 +422,8 @@ dasd_3990_erp_action_1(struct dasd_ccw_req * erp) ...@@ -422,7 +422,8 @@ dasd_3990_erp_action_1(struct dasd_ccw_req * erp)
* Setup ERP to do the ERP action 4 (see Reference manual). * Setup ERP to do the ERP action 4 (see Reference manual).
* Set the current request to PENDING to block the CQR queue for that device * Set the current request to PENDING to block the CQR queue for that device
* until the state change interrupt appears. * until the state change interrupt appears.
* Use a timer (20 seconds) to retry the cqr if the interrupt is still missing. * Use a timer (20 seconds) to retry the cqr if the interrupt is still
* missing.
* *
* PARAMETER * PARAMETER
* sense sense data of the actual error * sense sense data of the actual error
...@@ -443,9 +444,8 @@ dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense) ...@@ -443,9 +444,8 @@ 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, DEV_MESSAGE(KERN_INFO, device, "%s",
"dasd_3990_erp_action_4: first time retry" "dasd_3990_erp_action_4: first time retry");
"%s", " ");
erp->retries = 256; erp->retries = 256;
erp->function = dasd_3990_erp_action_4; erp->function = dasd_3990_erp_action_4;
...@@ -2197,8 +2197,8 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) ...@@ -2197,8 +2197,8 @@ dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
/* not possible to handle this situation in Linux */ /* not possible to handle this situation in Linux */
panic panic
("Invalid data - No way to inform appliction about " ("Invalid data - No way to inform application "
"the possibly incorret data"); "about the possibly incorrect data");
break; break;
case 0x1D: /* state-change pending */ case 0x1D: /* state-change pending */
...@@ -2266,8 +2266,7 @@ dasd_3990_erp_inspect(struct dasd_ccw_req * erp) ...@@ -2266,8 +2266,7 @@ dasd_3990_erp_inspect(struct dasd_ccw_req * erp)
} /* end distinguish between 24 and 32 byte sense data */ } /* end distinguish between 24 and 32 byte sense data */
return erp_new; return erp_new;
}
} /* END dasd_3990_erp_inspect */
/* /*
* DASD_3990_ERP_ADD_ERP * DASD_3990_ERP_ADD_ERP
...@@ -2520,7 +2519,8 @@ dasd_3990_erp_further_erp(struct dasd_ccw_req *erp) ...@@ -2520,7 +2519,8 @@ 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 */
/*necessary */
DEV_MESSAGE(KERN_ERR, device, DEV_MESSAGE(KERN_ERR, device,
"no retries left for erp %p - " "no retries left for erp %p - "
"set status to FAILED", erp); "set status to FAILED", erp);
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* functions may not be called from interrupt context. In particular * functions may not be called from interrupt context. In particular
* dasd_get_device is a no-no from interrupt context. * dasd_get_device is a no-no from interrupt context.
* *
* $Revision: 1.35 $ * $Revision: 1.37 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -70,7 +70,6 @@ int dasd_autodetect = 0; /* is true, when autodetection is active */ ...@@ -70,7 +70,6 @@ int dasd_autodetect = 0; /* is true, when autodetection is active */
* strings when running as a module. * strings when running as a module.
*/ */
static char *dasd[256]; static char *dasd[256];
/* /*
* Single spinlock to protect devmap structures and lists. * Single spinlock to protect devmap structures and lists.
*/ */
...@@ -485,7 +484,8 @@ dasd_devmap_from_cdev(struct ccw_device *cdev) ...@@ -485,7 +484,8 @@ dasd_devmap_from_cdev(struct ccw_device *cdev)
devmap = dasd_find_busid(cdev->dev.bus_id); devmap = dasd_find_busid(cdev->dev.bus_id);
if (IS_ERR(devmap)) if (IS_ERR(devmap))
devmap = dasd_add_busid(cdev->dev.bus_id, DASD_FEATURE_DEFAULT); devmap = dasd_add_busid(cdev->dev.bus_id,
DASD_FEATURE_DEFAULT);
return devmap; return devmap;
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.40 $ * $Revision: 1.42 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -138,7 +138,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr) ...@@ -138,7 +138,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
rc = dia250(&private->iob, RW_BIO); rc = dia250(&private->iob, RW_BIO);
if (rc > 8) { if (rc > 8) {
MESSAGE(KERN_WARNING, "dia250 returned CC %d", rc); DEV_MESSAGE(KERN_WARNING, device, "dia250 returned CC %d", rc);
cqr->status = DASD_CQR_ERROR; cqr->status = DASD_CQR_ERROR;
} else if (rc == 0) { } else if (rc == 0) {
cqr->status = DASD_CQR_DONE; cqr->status = DASD_CQR_DONE;
...@@ -201,8 +201,9 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code) ...@@ -201,8 +201,9 @@ dasd_ext_handler(struct pt_regs *regs, __u16 code)
if (dasd_start_diag(next) == 0) if (dasd_start_diag(next) == 0)
expires = next->expires; expires = next->expires;
else else
MESSAGE(KERN_WARNING, "%s", DEV_MESSAGE(KERN_WARNING, device, "%s",
"Interrupt fastpath failed!"); "Interrupt fastpath "
"failed!");
} }
} }
} else } else
...@@ -231,7 +232,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -231,7 +232,7 @@ dasd_diag_check_device(struct dasd_device *device)
if (private == NULL) { if (private == NULL) {
private = kmalloc(sizeof(struct dasd_diag_private),GFP_KERNEL); private = kmalloc(sizeof(struct dasd_diag_private),GFP_KERNEL);
if (private == NULL) { if (private == NULL) {
MESSAGE(KERN_WARNING, "%s", DEV_MESSAGE(KERN_WARNING, device, "%s",
"memory allocation failed for private data"); "memory allocation failed for private data");
return -ENOMEM; return -ENOMEM;
} }
...@@ -258,7 +259,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -258,7 +259,7 @@ dasd_diag_check_device(struct dasd_device *device)
return -ENOTSUPP; return -ENOTSUPP;
} }
DBF_EVENT(DBF_INFO, DBF_DEV_EVENT(DBF_INFO, device,
"%04X: %04X on real %04X/%02X", "%04X: %04X on real %04X/%02X",
rdc_data->dev_nr, rdc_data->dev_nr,
rdc_data->vdev_type, rdc_data->vdev_type,
...@@ -270,7 +271,7 @@ dasd_diag_check_device(struct dasd_device *device) ...@@ -270,7 +271,7 @@ dasd_diag_check_device(struct dasd_device *device)
/* figure out blocksize of device */ /* figure out blocksize of device */
label = (long *) get_zeroed_page(GFP_KERNEL); label = (long *) get_zeroed_page(GFP_KERNEL);
if (label == NULL) { if (label == NULL) {
MESSAGE(KERN_WARNING, "%s", DEV_MESSAGE(KERN_WARNING, device, "%s",
"No memory to allocate initialization request"); "No memory to allocate initialization request");
return -ENOMEM; return -ENOMEM;
} }
...@@ -451,20 +452,8 @@ static void ...@@ -451,20 +452,8 @@ 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)
{ {
char *page; DEV_MESSAGE(KERN_ERR, device, "%s",
"dump sense not available for DIAG data");
page = (char *) get_zeroed_page(GFP_KERNEL);
if (page == NULL) {
MESSAGE(KERN_ERR, "%s", "No memory to dump sense data");
return;
}
sprintf(page, KERN_WARNING PRINTK_HEADER
"device %s: I/O status report:\n",
device->cdev->dev.bus_id);
MESSAGE(KERN_ERR, "Sense data:\n%s", page);
free_page((unsigned long) page);
} }
/* /*
...@@ -500,8 +489,9 @@ static int __init ...@@ -500,8 +489,9 @@ static int __init
dasd_diag_init(void) dasd_diag_init(void)
{ {
if (!MACHINE_IS_VM) { if (!MACHINE_IS_VM) {
MESSAGE(KERN_INFO, MESSAGE_LOG(KERN_INFO,
"Machine is not VM: %s discipline not initializing", "Machine is not VM: %s "
"discipline not initializing",
dasd_diag_discipline.name); dasd_diag_discipline.name);
return -EINVAL; return -EINVAL;
} }
...@@ -517,8 +507,9 @@ static void __exit ...@@ -517,8 +507,9 @@ static void __exit
dasd_diag_cleanup(void) dasd_diag_cleanup(void)
{ {
if (!MACHINE_IS_VM) { if (!MACHINE_IS_VM) {
MESSAGE(KERN_INFO, MESSAGE_LOG(KERN_INFO,
"Machine is not VM: %s discipline not initializing", "Machine is not VM: %s "
"discipline not cleaned",
dasd_diag_discipline.name); dasd_diag_discipline.name);
return; return;
} }
......
This diff is collapsed.
...@@ -5,15 +5,15 @@ ...@@ -5,15 +5,15 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.8 $ * $Revision: 1.9 $
*/ */
#ifndef DASD_ECKD_H #ifndef DASD_ECKD_H
#define DASD_ECKD_H #define DASD_ECKD_H
/******************************************************************************* /*****************************************************************************
* SECTION: CCW Definitions * SECTION: CCW Definitions
******************************************************************************/ ****************************************************************************/
#define DASD_ECKD_CCW_WRITE 0x05 #define DASD_ECKD_CCW_WRITE 0x05
#define DASD_ECKD_CCW_READ 0x06 #define DASD_ECKD_CCW_READ 0x06
#define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09 #define DASD_ECKD_CCW_WRITE_HOME_ADDRESS 0x09
...@@ -45,9 +45,9 @@ ...@@ -45,9 +45,9 @@
*/ */
#define PSF_ORDER_PRSSD 0x18 #define PSF_ORDER_PRSSD 0x18
/******************************************************************************* /*****************************************************************************
* SECTION: Type Definitions * SECTION: Type Definitions
******************************************************************************/ ****************************************************************************/
struct eckd_count { struct eckd_count {
__u16 cyl; __u16 cyl;
...@@ -112,7 +112,7 @@ struct DE_eckd_data { ...@@ -112,7 +112,7 @@ struct DE_eckd_data {
__u8 ga_extended; /* Global Attributes Extended */ __u8 ga_extended; /* Global Attributes Extended */
struct ch_t beg_ext; struct ch_t beg_ext;
struct ch_t end_ext; struct ch_t end_ext;
unsigned long long ep_sys_time; /* Extended Parameter - System Time Stamp */ unsigned long long ep_sys_time; /* Ext Parameter - System Time Stamp */
__u8 ep_format; /* Extended Parameter format byte */ __u8 ep_format; /* Extended Parameter format byte */
__u8 ep_prio; /* Extended Parameter priority I/O byte */ __u8 ep_prio; /* Extended Parameter priority I/O byte */
__u8 ep_reserved[6]; /* Extended Parameter Reserved */ __u8 ep_reserved[6]; /* Extended Parameter Reserved */
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999-2001
* *
* $Revision: 1.12 $ * $Revision: 1.13 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -36,10 +36,6 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize, ...@@ -36,10 +36,6 @@ dasd_alloc_erp_request(char *magic, int cplength, int datasize,
if ( magic == NULL || datasize > PAGE_SIZE || if ( magic == NULL || datasize > PAGE_SIZE ||
(cplength*sizeof(struct ccw1)) > PAGE_SIZE) (cplength*sizeof(struct ccw1)) > PAGE_SIZE)
BUG(); BUG();
debug_text_event ( dasd_debug_area, 1, "ALLC");
debug_text_event ( dasd_debug_area, 1, magic);
debug_int_event ( dasd_debug_area, 1, cplength);
debug_int_event ( dasd_debug_area, 1, datasize);
size = (sizeof(struct dasd_ccw_req) + 7L) & -8L; size = (sizeof(struct dasd_ccw_req) + 7L) & -8L;
if (cplength > 0) if (cplength > 0)
...@@ -77,8 +73,6 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device) ...@@ -77,8 +73,6 @@ dasd_free_erp_request(struct dasd_ccw_req * cqr, struct dasd_device * device)
{ {
unsigned long flags; unsigned long flags;
debug_text_event(dasd_debug_area, 1, "FREE");
debug_int_event(dasd_debug_area, 1, (long) cqr);
spin_lock_irqsave(&device->mem_lock, flags); spin_lock_irqsave(&device->mem_lock, flags);
dasd_free_chunk(&device->erp_chunks, cqr); dasd_free_chunk(&device->erp_chunks, cqr);
spin_unlock_irqrestore(&device->mem_lock, flags); spin_unlock_irqrestore(&device->mem_lock, flags);
...@@ -105,7 +99,6 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr) ...@@ -105,7 +99,6 @@ dasd_default_erp_action(struct dasd_ccw_req * cqr)
} else { } else {
DEV_MESSAGE (KERN_WARNING, device, "%s", DEV_MESSAGE (KERN_WARNING, device, "%s",
"default ERP called (NO retry left)"); "default ERP called (NO retry left)");
cqr->status = DASD_CQR_FAILED; cqr->status = DASD_CQR_FAILED;
cqr->stopclk = get_clock (); cqr->stopclk = get_clock ();
} }
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.37 $ * $Revision: 1.39 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -134,8 +134,9 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -134,8 +134,9 @@ dasd_fba_check_characteristics(struct dasd_device *device)
if (private == NULL) { if (private == NULL) {
private = kmalloc(sizeof(struct dasd_fba_private), GFP_KERNEL); private = kmalloc(sizeof(struct dasd_fba_private), GFP_KERNEL);
if (private == NULL) { if (private == NULL) {
MESSAGE(KERN_WARNING, "%s", DEV_MESSAGE(KERN_WARNING, device, "%s",
"memory allocation failed for private data"); "memory allocation failed for private "
"data");
return -ENOMEM; return -ENOMEM;
} }
device->private = (void *) private; device->private = (void *) private;
...@@ -144,8 +145,9 @@ dasd_fba_check_characteristics(struct dasd_device *device) ...@@ -144,8 +145,9 @@ dasd_fba_check_characteristics(struct dasd_device *device)
rdc_data = (void *) &(private->rdc_data); rdc_data = (void *) &(private->rdc_data);
rc = read_dev_chars(device->cdev, &rdc_data, 32); rc = read_dev_chars(device->cdev, &rdc_data, 32);
if (rc) { if (rc) {
MESSAGE(KERN_WARNING, DEV_MESSAGE(KERN_WARNING, device,
"Read device characteristics returned error %d", rc); "Read device characteristics returned error %d",
rc);
return rc; return rc;
} }
...@@ -227,8 +229,8 @@ dasd_fba_erp_postaction(struct dasd_ccw_req * cqr) ...@@ -227,8 +229,8 @@ 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;
MESSAGE(KERN_WARNING, "unknown ERP action %p", cqr->function); DEV_MESSAGE(KERN_WARNING, cqr->device, "unknown ERP action %p",
cqr->function);
return NULL; return NULL;
} }
...@@ -270,7 +272,8 @@ dasd_fba_build_cp(struct dasd_device * device, struct request *req) ...@@ -270,7 +272,8 @@ dasd_fba_build_cp(struct dasd_device * device, struct request *req)
return ERR_PTR(-EINVAL); return ERR_PTR(-EINVAL);
count += bv->bv_len >> (device->s2b_shift + 9); count += bv->bv_len >> (device->s2b_shift + 9);
#if defined(CONFIG_ARCH_S390X) #if defined(CONFIG_ARCH_S390X)
if (idal_is_needed (page_address(bv->bv_page), bv->bv_len)) if (idal_is_needed (page_address(bv->bv_page),
bv->bv_len))
cidaw += bv->bv_len / blksize; cidaw += bv->bv_len / blksize;
#endif #endif
} }
...@@ -423,18 +426,107 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req, ...@@ -423,18 +426,107 @@ dasd_fba_dump_sense(struct dasd_device *device, struct dasd_ccw_req * req,
struct irb *irb) struct irb *irb)
{ {
char *page; char *page;
struct ccw1 *act, *end, *last;
int len, sl, sct, count;
page = (char *) get_zeroed_page(GFP_KERNEL); page = (char *) get_zeroed_page(GFP_ATOMIC);
if (page == NULL) { if (page == NULL) {
MESSAGE(KERN_ERR, "%s", "No memory to dump sense data"); DEV_MESSAGE(KERN_ERR, device, " %s",
"No memory to dump sense data");
return; return;
} }
sprintf(page, KERN_WARNING PRINTK_HEADER len = sprintf(page, KERN_ERR PRINTK_HEADER
"device %s: I/O status report:\n", " I/O status report for device %s:\n",
device->cdev->dev.bus_id); device->cdev->dev.bus_id);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" in req: %p CS: 0x%02X DS: 0x%02X\n", req,
irb->scsw.cstat, irb->scsw.dstat);
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" device %s: Failing CCW: %p\n",
device->cdev->dev.bus_id,
(void *) (addr_t) irb->scsw.cpa);
if (irb->esw.esw0.erw.cons) {
for (sl = 0; sl < 4; sl++) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" Sense(hex) %2d-%2d:",
(8 * sl), ((8 * sl) + 7));
for (sct = 0; sct < 8; sct++) {
len += sprintf(page + len, " %02x",
irb->ecw[8 * sl + sct]);
}
len += sprintf(page + len, "\n");
}
} else {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" SORRY - NO VALID SENSE AVAILABLE\n");
}
MESSAGE_LOG(KERN_ERR, "%s",
page + sizeof(KERN_ERR PRINTK_HEADER));
/* dump the Channel Program */
/* print first CCWs (maximum 8) */
act = req->cpaddr;
for (last = act; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
end = min(act + 8, last);
len = sprintf(page, KERN_ERR PRINTK_HEADER
" Related CP in req: %p\n", req);
while (act <= end) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count;
count += sizeof(int))
len += sprintf(page + len, " %08X",
((int *) (addr_t) act->cda)
[(count>>2)]);
len += sprintf(page + len, "\n");
act++;
}
MESSAGE_LOG(KERN_ERR, "%s",
page + sizeof(KERN_ERR PRINTK_HEADER));
MESSAGE(KERN_ERR, "Sense data:\n%s", page);
/* print failing CCW area */
len = 0;
if (act < ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2) {
act = ((struct ccw1 *)(addr_t) irb->scsw.cpa) - 2;
len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
}
end = min((struct ccw1 *)(addr_t) irb->scsw.cpa + 2, last);
while (act <= end) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count;
count += sizeof(int))
len += sprintf(page + len, " %08X",
((int *) (addr_t) act->cda)
[(count>>2)]);
len += sprintf(page + len, "\n");
act++;
}
/* print last CCWs */
if (act < last - 2) {
act = last - 2;
len += sprintf(page + len, KERN_ERR PRINTK_HEADER "......\n");
}
while (act <= last) {
len += sprintf(page + len, KERN_ERR PRINTK_HEADER
" CCW %p: %08X %08X DAT:",
act, ((int *) act)[0], ((int *) act)[1]);
for (count = 0; count < 32 && count < act->count;
count += sizeof(int))
len += sprintf(page + len, " %08X",
((int *) (addr_t) act->cda)
[(count>>2)]);
len += sprintf(page + len, "\n");
act++;
}
if (len > 0)
MESSAGE_LOG(KERN_ERR, "%s",
page + sizeof(KERN_ERR PRINTK_HEADER));
free_page((unsigned long) page); free_page((unsigned long) page);
} }
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Bugreports.to..: <Linux390@de.ibm.com> * Bugreports.to..: <Linux390@de.ibm.com>
* (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 1999,2000
* *
* $Revision: 1.61 $ * $Revision: 1.63 $
*/ */
#ifndef DASD_INT_H #ifndef DASD_INT_H
...@@ -150,6 +150,18 @@ do { \ ...@@ -150,6 +150,18 @@ do { \
DBF_EVENT(DBF_ALERT, d_string, d_args); \ DBF_EVENT(DBF_ALERT, d_string, d_args); \
} while(0) } while(0)
/* messages to be written via klogd only */
#define DEV_MESSAGE_LOG(d_loglevel,d_device,d_string,d_args...)\
do { \
printk(d_loglevel PRINTK_HEADER " %s: " d_string "\n", \
d_device->cdev->dev.bus_id, d_args); \
} while(0)
#define MESSAGE_LOG(d_loglevel,d_string,d_args...)\
do { \
printk(d_loglevel PRINTK_HEADER " " d_string "\n", d_args); \
} while(0)
struct dasd_ccw_req { struct dasd_ccw_req {
unsigned int magic; /* Eye catcher */ unsigned int magic; /* Eye catcher */
struct list_head list; /* list_head for request queueing. */ struct list_head list; /* list_head for request queueing. */
...@@ -520,7 +532,8 @@ void dasd_proc_exit(void); ...@@ -520,7 +532,8 @@ void dasd_proc_exit(void);
/* externals in dasd_erp.c */ /* externals in dasd_erp.c */
struct dasd_ccw_req *dasd_default_erp_action(struct dasd_ccw_req *); struct dasd_ccw_req *dasd_default_erp_action(struct dasd_ccw_req *);
struct dasd_ccw_req *dasd_default_erp_postaction(struct dasd_ccw_req *); struct dasd_ccw_req *dasd_default_erp_postaction(struct dasd_ccw_req *);
struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int, struct dasd_device *); struct dasd_ccw_req *dasd_alloc_erp_request(char *, int, int,
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_ccw(struct dasd_ccw_req *, int, __u32); void dasd_log_ccw(struct dasd_ccw_req *, int, __u32);
......
...@@ -257,8 +257,9 @@ dasd_format(struct dasd_device * device, struct format_data_t * fdata) ...@@ -257,8 +257,9 @@ dasd_format(struct dasd_device * device, struct format_data_t * fdata)
fdata->stop_unit, fdata->blksize, fdata->intensity); fdata->stop_unit, fdata->blksize, fdata->intensity);
/* Since dasdfmt keeps the device open after it was disabled, /* Since dasdfmt keeps the device open after it was disabled,
* there still exists an inode for this device. We must update i_blkbits, * there still exists an inode for this device.
* otherwise we might get errors when enabling the device later. * We must update i_blkbits, otherwise we might get errors when
* enabling the device later.
*/ */
if (fdata->start_unit == 0) { if (fdata->start_unit == 0) {
struct block_device *bdev = bdget_disk(device->gdp, 0); struct block_device *bdev = bdget_disk(device->gdp, 0);
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* *
* /proc interface for the dasd driver. * /proc interface for the dasd driver.
* *
* $Revision: 1.29 $ * $Revision: 1.30 $
*/ */
#include <linux/config.h> #include <linux/config.h>
...@@ -250,7 +250,7 @@ dasd_statistics_write(struct file *file, const char __user *user_buf, ...@@ -250,7 +250,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(KERN_INFO, "/proc/dasd/statictics: '%s'", buffer); MESSAGE_LOG(KERN_INFO, "/proc/dasd/statictics: '%s'", buffer);
/* check for valid verbs */ /* check for valid verbs */
for (str = buffer; isspace(*str); str++); for (str = buffer; isspace(*str); str++);
......
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