[EMAIL PROTECTED] wrote:
Does this fix the LUN-selection problem Eduard pointed out?


Eduard, does it?
(That is, if you remove your lun assignment patch, so that the driver
does this silly broken lun detection again, but add my "beenhere" hack
to avoid infinite recursion upon scsi error recovery, does the "detect"
then come up with the right lun?)

What is the lun in your case?

The lun detection relies (maybe non-intentional) on the fact that a CF card is inserted. If no CF is inserted no LUN is detected. Furthermore the usb-storage driver (don't know which file) has already reported that my device supports two luns, but only one slot is available in my reader. So I have two "virtual" luns which point to the same "physical" lun. My assumtion is that in the 2.4 kernel the datafab driver was usable "by accident". It seems that in 2.6 a more correct behavior of the scsi drivers is required which datafab.c doesn't provice.


The linux scsi driver is a very complex system. It took me quite a while to understand even a small amount of the code paths. My current feeling is that a driver has to report "I'm not usable now" or otherwise scsi error recovery will try ages to get the scsi device driver running.

Please find attached only the commands which were issued when doing "modprobe sd-mod" with usb-storage already loaded. First I thought the "insmod" whill never return, but after 25 minutes (!) insmod was ready. Multiple layers of retry loops are present, with every command consuming 6 seconds. I assume the 6 seconds due to a soft reset which is issued after every TRANSPORT_ERROR.

I have no clue if the scsi system is behaving errenous due to retrying so much. But the soft reset always reports "ok, soft reset successfully". So the device is never taken offline. This is what I read from scsi_error.c, function scsi_eh_ready_devs.

=== scsi_error.c ===
static void scsi_eh_ready_devs(struct Scsi_Host *shost,
                               struct list_head *work_q,
                               struct list_head *done_q)
{
        if (!scsi_eh_bus_device_reset(shost, work_q, done_q))
                if (!scsi_eh_bus_reset(shost, work_q, done_q))
                        if (!scsi_eh_host_reset(work_q, done_q))
                                scsi_eh_offline_sdevs(work_q, done_q);
}
=== ===

IMHO the only correct solution is to remove the lun detection all together and present all luns reported from the device to the user. Furthermore do not report TRANSPORT_ERROR when no medium is inserted (which is signalled from the datafab device by means of a short transfer) but report a no "medium present".

All IMHO as I'm still a linux USB and SCSI rookie!

greetings,
eduard
Dec  7 02:08:40 boundary kernel: usb-storage: Command INQUIRY (6 bytes)
Dec  7 02:08:40 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:08:46 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:08:52 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:08:58 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:09:04 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:09:10 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:16 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:22 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:28 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:34 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:40 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:46 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:52 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:09:58 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:04 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:10 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:16 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:22 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:28 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:34 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:10:40 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:10:40 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:10:46 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:10:52 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:10:58 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:11:04 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:11:10 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:11:16 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:11:22 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:14:54 boundary kernel: usb-storage: Command INQUIRY (6 bytes)
Dec  7 02:14:54 boundary kernel: usb-storage: Command INQUIRY (6 bytes)
Dec  7 02:15:40 boundary kernel: usb-storage: Command INQUIRY (6 bytes)
Dec  7 02:15:40 boundary kernel: usb-storage: Command INQUIRY (6 bytes)
Dec  7 02:16:14 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:17:33 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:03 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:09 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:15 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:21 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:27 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:21:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:21:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:21:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:21:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:21:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:22:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:23:03 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:23:03 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:09 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:15 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:21 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:27 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:33 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:39 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:45 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:51 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:23:57 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:24:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:24:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:25:33 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:25:33 boundary kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
Dec  7 02:25:33 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:25:39 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:25:45 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:25:51 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:25:57 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:26:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:26:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:27:33 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:27:33 boundary kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
Dec  7 02:27:33 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:27:39 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:27:45 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:27:51 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:27:57 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:28:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:28:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:29:33 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:29:33 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:29:39 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:29:45 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:29:51 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:29:57 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:03 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:09 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:15 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:21 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:27 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:30:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:30:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:30:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:30:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:30:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:31:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:32:03 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:32:03 boundary kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)
Dec  7 02:32:03 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:32:09 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:32:15 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:32:21 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:32:27 boundary kernel: usb-storage: Command TEST_UNIT_READY (6 bytes)
Dec  7 02:32:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:32:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:32:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:32:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:32:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:03 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:09 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:15 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:21 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:27 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:33 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:39 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:45 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:51 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:33:57 boundary kernel: usb-storage: Command READ_CAPACITY (10 bytes)
Dec  7 02:34:03 boundary kernel: usb-storage: Command MODE_SENSE_10 (10 bytes)
Dec  7 02:34:03 boundary kernel: usb-storage: Command ALLOW_MEDIUM_REMOVAL (6 bytes)

Reply via email to