Skip to content

Commit b49e648

Browse files
Stefan Haberlandaxboe
authored andcommitted
s390/dasd: increase printing of debug data payload
32 byte are to less for important data from prefix or other commands. Print up to 128 byte data. This is enough for the largest CCW data we have. Since printk can only print up to 1024 byte at once, print the different parts of the CCW dumps separately. Signed-off-by: Stefan Haberland <[email protected]> Reviewed-by: Jan Hoeppner <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 4ba5f0c commit b49e648

File tree

1 file changed

+19
-18
lines changed

1 file changed

+19
-18
lines changed

drivers/s390/block/dasd_eckd.c

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -5500,7 +5500,7 @@ dasd_eckd_ioctl(struct dasd_block *block, unsigned int cmd, void __user *argp)
55005500
* Dump the range of CCWs into 'page' buffer
55015501
* and return number of printed chars.
55025502
*/
5503-
static int
5503+
static void
55045504
dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
55055505
{
55065506
int len, count;
@@ -5518,16 +5518,21 @@ dasd_eckd_dump_ccw_range(struct ccw1 *from, struct ccw1 *to, char *page)
55185518
else
55195519
datap = (char *) ((addr_t) from->cda);
55205520

5521-
/* dump data (max 32 bytes) */
5522-
for (count = 0; count < from->count && count < 32; count++) {
5523-
if (count % 8 == 0) len += sprintf(page + len, " ");
5524-
if (count % 4 == 0) len += sprintf(page + len, " ");
5521+
/* dump data (max 128 bytes) */
5522+
for (count = 0; count < from->count && count < 128; count++) {
5523+
if (count % 32 == 0)
5524+
len += sprintf(page + len, "\n");
5525+
if (count % 8 == 0)
5526+
len += sprintf(page + len, " ");
5527+
if (count % 4 == 0)
5528+
len += sprintf(page + len, " ");
55255529
len += sprintf(page + len, "%02x", datap[count]);
55265530
}
55275531
len += sprintf(page + len, "\n");
55285532
from++;
55295533
}
5530-
return len;
5534+
if (len > 0)
5535+
printk(KERN_ERR "%s", page);
55315536
}
55325537

55335538
static void
@@ -5619,37 +5624,33 @@ static void dasd_eckd_dump_sense_ccw(struct dasd_device *device,
56195624
if (req) {
56205625
/* req == NULL for unsolicited interrupts */
56215626
/* dump the Channel Program (max 140 Bytes per line) */
5622-
/* Count CCW and print first CCWs (maximum 1024 % 140 = 7) */
5627+
/* Count CCW and print first CCWs (maximum 7) */
56235628
first = req->cpaddr;
56245629
for (last = first; last->flags & (CCW_FLAG_CC | CCW_FLAG_DC); last++);
56255630
to = min(first + 6, last);
5626-
len = sprintf(page, PRINTK_HEADER
5627-
" Related CP in req: %p\n", req);
5628-
dasd_eckd_dump_ccw_range(first, to, page + len);
5629-
printk(KERN_ERR "%s", page);
5631+
printk(KERN_ERR PRINTK_HEADER " Related CP in req: %p\n", req);
5632+
dasd_eckd_dump_ccw_range(first, to, page);
56305633

56315634
/* print failing CCW area (maximum 4) */
56325635
/* scsw->cda is either valid or zero */
5633-
len = 0;
56345636
from = ++to;
56355637
fail = (struct ccw1 *)(addr_t)
56365638
irb->scsw.cmd.cpa; /* failing CCW */
56375639
if (from < fail - 2) {
56385640
from = fail - 2; /* there is a gap - print header */
5639-
len += sprintf(page, PRINTK_HEADER "......\n");
5641+
printk(KERN_ERR PRINTK_HEADER "......\n");
56405642
}
56415643
to = min(fail + 1, last);
5642-
len += dasd_eckd_dump_ccw_range(from, to, page + len);
5644+
dasd_eckd_dump_ccw_range(from, to, page + len);
56435645

56445646
/* print last CCWs (maximum 2) */
5647+
len = 0;
56455648
from = max(from, ++to);
56465649
if (from < last - 1) {
56475650
from = last - 1; /* there is a gap - print header */
5648-
len += sprintf(page + len, PRINTK_HEADER "......\n");
5651+
printk(KERN_ERR PRINTK_HEADER "......\n");
56495652
}
5650-
len += dasd_eckd_dump_ccw_range(from, last, page + len);
5651-
if (len > 0)
5652-
printk(KERN_ERR "%s", page);
5653+
dasd_eckd_dump_ccw_range(from, last, page + len);
56535654
}
56545655
free_page((unsigned long) page);
56555656
}

0 commit comments

Comments
 (0)