[S390] dasd: correct debugfeature sense dump

remove loop, add some debug data and use get_sense function

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Stefan Haberland 2009-07-07 16:37:06 +02:00 committed by Martin Schwidefsky
parent bb8c29caff
commit aeec92ca3a
4 changed files with 27 additions and 48 deletions

View file

@ -1696,8 +1696,7 @@ static void dasd_eckd_handle_unsolicited_interrupt(struct dasd_device *device,
DBF_DEV_EVENT(DBF_ERR, device, "%s",
"unsolicited interrupt received "
"(sense available)");
device->discipline->dump_sense_dbf(device, NULL, irb,
"unsolicited");
device->discipline->dump_sense_dbf(device, irb, "unsolicited");
}
dasd_schedule_device_bh(device);
@ -2941,42 +2940,20 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
}
static void
dasd_eckd_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req,
struct irb *irb, char *reason)
dasd_eckd_dump_sense_dbf(struct dasd_device *device, 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;
}
sense = (u64 *) dasd_get_sense(irb);
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]);
}
DBF_DEV_EVENT(DBF_EMERG, device,
"%s: %s %02x%02x%02x %016llx %016llx %016llx "
"%016llx", reason,
scsw_is_tm(&irb->scsw) ? "t" : "c",
scsw_cc(&irb->scsw), scsw_cstat(&irb->scsw),
scsw_dstat(&irb->scsw), sense[0], sense[1],
sense[2], sense[3]);
} else {
DBF_DEV_EVENT(DBF_EMERG, device, "%s",
"SORRY - NO VALID SENSE AVAILABLE\n");

View file

@ -172,7 +172,7 @@ dasd_log_sense_dbf(struct dasd_ccw_req *cqr, struct irb *irb)
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");
device->discipline->dump_sense_dbf(device, irb, "log");
}
EXPORT_SYMBOL(dasd_log_sense_dbf);

View file

@ -241,7 +241,7 @@ static void dasd_fba_handle_unsolicited_interrupt(struct dasd_device *device,
/* check for unsolicited interrupts */
DBF_DEV_EVENT(DBF_WARNING, device, "%s",
"unsolicited interrupt received");
device->discipline->dump_sense_dbf(device, NULL, irb, "unsolicited");
device->discipline->dump_sense_dbf(device, irb, "unsolicited");
dasd_schedule_device_bh(device);
return;
};
@ -444,17 +444,20 @@ dasd_fba_fill_info(struct dasd_device * device,
}
static void
dasd_fba_dump_sense_dbf(struct dasd_device *device, struct dasd_ccw_req *req,
struct irb *irb, char *reason)
dasd_fba_dump_sense_dbf(struct dasd_device *device, 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]);
}
u64 *sense;
sense = (u64 *) dasd_get_sense(irb);
if (sense) {
DBF_DEV_EVENT(DBF_EMERG, device,
"%s: %s %02x%02x%02x %016llx %016llx %016llx "
"%016llx", reason,
scsw_is_tm(&irb->scsw) ? "t" : "c",
scsw_cc(&irb->scsw), scsw_cstat(&irb->scsw),
scsw_dstat(&irb->scsw), sense[0], sense[1],
sense[2], sense[3]);
} else {
DBF_DEV_EVENT(DBF_EMERG, device, "%s",
"SORRY - NO VALID SENSE AVAILABLE\n");

View file

@ -284,8 +284,7 @@ struct dasd_discipline {
dasd_erp_fn_t(*erp_postaction) (struct dasd_ccw_req *);
void (*dump_sense) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *);
void (*dump_sense_dbf) (struct dasd_device *, struct dasd_ccw_req *,
struct irb *, char *);
void (*dump_sense_dbf) (struct dasd_device *, struct irb *, char *);
void (*handle_unsolicited_interrupt) (struct dasd_device *,
struct irb *);