warren wrote:
>
> Hi,
> Our company is developing our product with generic
scsi interface on
> the Linux.
> We have some options to improve the current generic
scsi interface.
>
> (1)
> Generic scsi driver will inquire every device on
every scsi
> bus. If the device replies with device type "1f", it will
consider the
> device is not present. It is not convenient for us to send
a command to
> our adapter to do configuration. Currently we lie to OS.
we reply it
> with device type "3"(processor device type). Maybe it will
cause some
> side effects.
> I hope this limit will be removed.
This seems to be a "mid-level" driver issue (sd, sr, st and sg are
"high-level"). It seems only to accept SCSI device ids: 0, 1, 3, 4,
5, 6 and 7 (see /usr/src/linux/include/scsi/scsi.h TYPE_*). So the
mid-level
reject 31 (ie 0x31) during its scan. Is 31 a registered SCSI device
type id?
> (2)
> Generic scsi driver will not renegotiate with the
device when it
> get a check condition when the device is reset.
> If i send a inquiry command to the device which
was reset
> previously, it cause OS hang and after the time is expire,
the generic
> scsi driver will reset the scsi bus and regotiate with
device.
> About this, i have no option. Maybe the scsi driver
interface
> should provide a method to do this. Or the generic scsi
driver will do
> negotiae again after the device is reset.
Well, I tried this on my driver with my test program "sg_whoami"
and it seemed to work as expected (ie ok):
[root@frig /root]#
[root@frig /root]# ~dougg/scsi/sg_whoami /dev/sgb -rc
scsi1, channel=0, device=1, lun=0, scsi_type=0
SG timeout=6000
SG sg_tablesize=255
number of sectors=1023484, sector size=512
[root@frig /root]#
[root@frig /root]# echo power cycle /dev/sgb
power cycle /dev/sgb <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
[root@frig /root]#
[root@frig /root]# ~dougg/scsi/sg_whoami /dev/sgb -rc
scsi1, channel=0, device=1, lun=0, scsi_type=0
SG timeout=6000
SG sg_tablesize=255
extra data not valid Current error sg15:01: sense key Unit Attention
Additional sense indicates Power on, reset, or bus device reset occurred
after read(rc) result=0, t_stat=1, h_stat=0
sense[16]: 70 00 06 00 00 00 00 0a 00 00 00 00 29 00 00 00
[root@frig /root]#
[root@frig /root]# ~dougg/scsi/sg_whoami /dev/sgb -rc
scsi1, channel=0, device=1, lun=0, scsi_type=0
SG timeout=6000
SG sg_tablesize=255
number of sectors=1023484, sector size=512
The only difference that I can see between my version and the original
is that 't_stat=1' being passed back (target SCSI id of "Check
Condition"). So you know something went wrong. There is also a
"print_sense" in the pseudo-interrupt handler which causes those
2 lines of comments (starting with "extra data ..."). Those 2
lines appeared in my log as well.
For those following this thread, my page at
http://www.netwinder.org/~dougg has been updated and now contains
a useful test program called "sg_dd512" which has "dd"-like
functionality together with some other updates. It is useful
for timing the sequential transfer performance of SCSI disks
amongst other things. Perhaps it should be backported to the
original sg version as well.
------------------------------------------------------------------
Douglas Gilbert [[EMAIL PROTECTED] or [EMAIL PROTECTED]]
48 Windsor Court Road Web: www.interlog.com/~dgilbert
Thornhill, Ontario L3T 4Y5, Canada Tel: +1 905 771 6151
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [EMAIL PROTECTED]