Skip to content

SCSI: Printing cleanups

Martin K. Petersen linux-scsi 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4SCSI: constants.c cleanup, verbose result printingdrivers/scsi/constants.c include/scsi/scsi_dbg.h+151 -1260 replies
2/4SCSI: Make error printing more verbosedrivers/scsi/scsi.c drivers/scsi/scsi_lib.c include/scsi/scsi_device.h+24 -350 replies
3/4SCSI: Make sd printing use a common prefixdrivers/scsi/sd.c include/scsi/sd.h+165 -1580 replies
4/4SCSI: Convert sd logging to new printk helpersdrivers/scsi/sd.c+29 -210 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] SCSI: Printing cleanups

This patch series is the first batch of cleanups in an attempt to make the SCSI printing more consistent and suitable for human consumption.

Previously a typical error looked like this:

sd 0:0:0:0: SCSI error: return code = 0x08000002
sda: Current: sense key: Aborted Command
Additional sense: Logical block reference tag check failed

You had to have the magic return value decoder ring handy to figure out what had really happened. And you had to do the mapping between sd 0:0:0:0 and sda yourself.

The following patches clean up various bits so that the same information can be presented in a more readable form:

sd 0:0:0:0: [sda] Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE,SUGGEST_OK sd 0:0:0:0: [sda] Sense Key : Aborted Command [current]
sd 0:0:0:0: [sda] Add. Sense: Logical block reference tag check failed

All printk's from sd.c now have the same prefix. If logging is turned on, for instance, we also get:

    sd 0:0:0:0: [sda] Send: 0x0fb89180 
    sd 0:0:0:0: [sda] CDB: Read(16): 88 20 00 00 00 00 00 00 00 20 00 00 00 08 00 00
    sd 0:0:0:0: [sda] Done: 0x0fb89180 SUCCESS

The patches need to be applied in order.

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering