Quick kernel questions

Steven Pritchard steve at silug.org
Mon Jan 26 04:27:19 UTC 2004


On Sun, Jan 25, 2004 at 09:42:10PM -0600, Jens Knutson wrote:
> Well, I've discovered that my "6-in-1" CF/MMC/etc card reader, and all
> others like it, require CONFIG_SCSI_MULTI_LUN to be set to Y to work
> properly.

No they don't.  Having CONFIG_SCSI_MULTI_LUN on just means that the
kernel goes actively probing on all LUNs.  This can cause problems, so
it is off by default on vendor kernels.  (I seem to recall that some
devices would claim that all LUNs were active, which ended up causing
kernel crashes when non-existent LUNs were touched.)

Just because the kernel doesn't go off wildly probing does not mean it
can't be made to see other LUNs.  You just have to tell it to look.
One way is to tell it where to look for the device you want access to.
On my system, I was able to do this:

    echo 'scsi add-single-device 1 0 0 1' > /proc/scsi/scsi   

That's host (controller) 1, channel 0, target (id) 0, LUN 1.

At that point, the CF slot on my multi-card reader shows up just fine:

  Vendor: Generic   Model: USB Storage-CFC   Rev: 0180
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sdc at scsi1, channel 0, id 0, lun 1
SCSI device sdc: 250881 512-byte hdwr sectors (128 MB)
sdc: Write Protect is off  
 sdc: sdc1

The other option is to pass the max_scsi_luns option to scsi_mod.  Run
"modinfo scsi_mod" to see what I'm talking about.

There's probably a fairly trivial way to get hotplug to do something
like this every time usb-storage loads:

    lun=1
    while [ $lun -lt 4 ]; do
        echo "scsi add-single-device 0 0 0 $lun" > /proc/scsi/scsi
        (( lun++ ))
    done  

(I love it when I get to dust off old mail to clients...)

Steve
-- 
Steven Pritchard - K&S Pritchard Enterprises, Inc.
Email: steve at kspei.com             http://www.kspei.com/
Phone: (618)398-7360               Mobile: (618)567-7320





More information about the fedora-devel-list mailing list