All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: Daniel Stekloff <dsteklof@us.ibm.com>
Cc: linux-scsi@vger.kernel.org, Larry Kessler <lkessler@us.ibm.com>,
	James Keniston <kenistoj@us.ibm.com>
Subject: Re: [RFC] scsi_device printk helper macro - sdev_printk -> with patch
Date: Tue, 30 Sep 2003 22:16:12 +1000	[thread overview]
Message-ID: <3F79740C.5020007@torque.net> (raw)
In-Reply-To: <200309291413.51987.dsteklof@us.ibm.com>

Daniel Stekloff wrote:
> The purpose of the sdev_printk macro, which is intended for the scsi mid-layer 
> and LLDs, is to help with the following:
> 
> - Adding consistency to printk messages in mid-layer and LLDs where 
> scsi_device is concerned. Scsi_device information will be printed in the same 
> consistent format. A consistent format will help readability and provide a 
> means to automate responding to log messages.
> 
> - Identifing a printk with a specific scsi_device. 
> 
> - Providing one point for changing what identification information is printed. 
> Instead of having to edit every single printk, one could simply change the 
> macro. 
> 
> The patch below does a couple things:
> 
> 1) Moves setting scsi_device's sdev_gendev struct device bus_id from 
> scsi_sysfs.c to scsi_scan.c.
> 
> 2) Adds sdev_printk definition to scsi_device.h
> 
> 3) Replaces many printks in the mid-layer with sdev_printk.
> 
> Please take a look, all comments and suggestions are welcome.

Dan,
Looks great.
We have a fair amount of scsi command and sense decode logic **
laying idle in drivers/scsi/constants.[hc] that might enhance
the output further.

Perhaps while we are at it, we could make a more useful logging
mechanism in the scsi subsystem (rather than, or in addition to,
'echo "scsi log ..." > /proc/scsi/scsi'). Putting a
read/write "log" variable in the /sys/class/scsi_device/*/device
directory would allow per device logging. [Obviously struct
scsi_device would get a new "log" member, initialized to 0.]

This does not cover the debugging or logging of a device
scan. In this case scsi_device::log could be inherited from
somewhere. Since the device might be the first one seen by the
first host, that "somewhere" would need to be be the scsi mid
level. Currently the scsi mid level doesn't have a sysfs
presence. It is obviously a module and also has a pseudo
device at /proc/scsi/scsi. Any suggestions where a scsi
mid level device/driver directory could go in sysfs? Such
a directory could contain scan, timeout and retry parameters
as well as a "next_device_log" type entry.


** Sense buffer decoding should be centralized, especially
since SPC3 has a new (more sane) "descriptor sense data
format" [SPC-3 rev 15 section 4.5.2 at www.t10.org].

Doug Gilbert







  reply	other threads:[~2003-09-30 12:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-29 14:13 [RFC] scsi_device printk helper macro - sdev_printk -> with patch Daniel Stekloff
2003-09-30 12:16 ` Douglas Gilbert [this message]
2003-09-30 12:27   ` Daniel Stekloff
2003-09-30 16:50   ` Patrick Mansfield

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F79740C.5020007@torque.net \
    --to=dougg@torque.net \
    --cc=dsteklof@us.ibm.com \
    --cc=kenistoj@us.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkessler@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.