Re: [RFC][PATCH] adding PCI bus information to SCSI layer

Douglas Gilbert (dougg@torque.net)
Mon, 23 Apr 2001 23:32:34 -0400


Matt_Domsch@Dell.com wrote:
>
> [snip]
>
> Doug suggested looking at extending scsimon. This is a fine idea, and I've
> made proposed changes available at http://domsch.com/linux/scsi/. (Doug may
> want to clean this up). However, this, like my earlier changes to
> /proc/scsi/scsi, doesn't actually show the relationship between /dev/sda and
> a particular PCI controller and SCSI channel,bus,lun tuple.

Changes look ok. One suggestion: if a #define SCSI_PCI_INFO
(or some such) is defined in driver/scsi/scsi.h as part of
the patch then code like Matt is suggesting can be safely
added, protected by "#ifdef SCSI_PCI_INFO ... #endif" blocks.
I have used this technique in sg to support the scsi
"reset+reservation" patch which still hasn't made it into
the mid level (but is available in many distros).

The scsimon driver is just a window through to the information
held in the mid level structures. The information printed by
'cat /proc/scsi/scsi' also comes from the mid level. The scsi
minor device numbers (e.g. /dev/sda) are allocated by each upper
level driver (e.g. sd_attach() in the case of sd) and are held
in upper level driver data structures. Hence they are not
visible to the mid-level or to other upper level drivers.

As an example of the latter point, using st and sg on the same
tape device at the same time will most likely confuse st
(since it maintains a state machine). However there is no
simple way for the sg or st drivers to detect (or supply
information flagging) this conflict.

Doug Gilbert

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/