lk 2.4 SG driver question
I am working on C app that uses the SG driver (SCSI Generic) to access some scsi drives on a QLogic QLA2100 Fiber Channel card. Everything seems to work just fine, I can access the devices and send your standard set of SCSI commands to the devices but I am running in to an issue with FORMAT UNIT and TEST UNIT READY.
Here is the deal, I have issued a FORMAT UNIT command with the IMMED bit set, the command returns immediately and the format begins. Technically I should be able to issue any number of TEST UNIT READY commands to the device and it will return sense data indicating progress, the problem is the the TEST UNIT READY gets stuck in an infinite loop. Not my code but the SG driver itself. I have watched it on a bus analyzer and it never returns form the ioctl() it just loops issues TUR over and over. Even with a timeout of 1000 milliseconds set in the struct it never returns.
Just to make sure I wasn't crazy I used another utility that I found
(or actually a collection) and they got the same result the sg driver hung just issuing the TUR over and over.
I am wondering if there is a bug in the sg driver or if this is by design (if so, its a bad one!).
just a little background, the file descriptor I am opening is "/dev/sg0" and the open flags are O_RDWR | O_NONBLOCK the TUR command issues on its own when the drive is not formatting so I know that what I am doing is *correct* but there is no logical reason that this is behaving this way!
|