Sorry for the late reply, but it took me a little bit to recompile the kernel
(my laptop is slow) and I was not able to obtain any meaningful results (please
note I know nothing about kernel internals).
However, i filled scsi_sequential_lun_scan() with printk's but none of them
appeared (yes, I did echo 7 > /proc/sys/kernel/printk).
So I enabled logging for SCSI scan bus (echo 448 >
/proc/sys/dev/scsi/logging_level) and I did not see message "scsi scan:
Sequential scan\n" appearing. So I thought scsi_sequential_lun_scan() was not
being called.
So I recompiled usb_storage with CONFIG_USB_STORAGE_DEBUG=y, and I got this (it
looks like it is obtaining the max lun from some other routine?).
----8<---------------------------------------------------------------
usb 2-2: new high-speed USB device number 4 using ehci-pci
usb 2-2: New USB device found, idVendor=152d, idProduct=1567
usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=5
usb 2-2: Product: JMS56x Series
usb 2-2: Manufacturer: JMicron
usb 2-2: SerialNumber: DB9876543211166
usb 2-2: UAS is blacklisted for this device, using usb-storage instead
usb-storage 2-2:1.0: USB Mass Storage device detected
Vendor: 0x152d, Product: 0x1567, Revision: 0x0101
Interface Subclass: 0x06, Protocol: 0x50
usb-storage 2-2:1.0: Quirks match for vid 152d pid 1567: 800000
Transport: Bulk
Protocol: Transparent SCSI
scsi host7: usb-storage 2-2:1.0
usb-storage 2-2:1.0: waiting for device to settle before scanning
*** thread sleeping
usb-storage 2-2:1.0: starting scan
rq=fe rqtype=a1 value=0000 index=00 len=1
GetMaxLUN command result is 1, data is 0
usb-storage 2-2:1.0: scan complete
scsi host7: scsi_scan_host_selected: <4294967295:4294967295:18446744073709551615>
scsi 7:0:0:0: scsi scan: INQUIRY pass 1 length 36
----8<---------------------------------------------------------------
Does this make any sense for you? I am a bit lost.
Thank you
Giulio
On 24/07/2015 15:36, Alan Stern wrote:
On Fri, 24 Jul 2015, Giulio Bernardi wrote:
This is the trace I got after I used this option:
options usb-storage quirks=152d:1567:u
This trace is pretty clear; the system does not scan for logical units
beyond LUN 0, even though the device contains two logical units.
In older kernels this was controlled by CONFIG_SCSI_MULTI_LUN, but that
setting was removed in the 3.17 kernel. In more recent kernels, LUN
scanning is controlled by a bunch of software rules, but I don't see
any reason why they would prevent LUN 1 from being scanned on your
device.
If you want to see what's going on, read through the
scsi_sequential_lun_scan() routine in drivers/scsi/scsi_scan.c. The
most important thing to check is the value of max_dev_lun for your
device. Also, the BLIST_FORCELUN bit should be set in bflags.
Alan Stern
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html