how to unbind current mmc driver to bind mmc-test driver?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



  ever willing to embarrass myself in public, i'm going to ask how to
load and invoke the mmc_test driver on my ubuntu laptop, which is
currently running my hand-rolled super-recent, 2.6.39+ kernel.

  i'm following along in the script here:

http://www.spinics.net/lists/linux-mmc/msg05835.html

and it seems pretty straightforward -- i interpret all of that as that
one needs first to find the driver that is currently bound to the
device (mmc-block?), unbind it, then bind to the mmc test driver.
that seems easy enough except that this loop in the script:

...
cd "$drv_path"     [this is "/sys/bus/mmc/drivers"]
for d in *;do
    for l in "$d/"*;do
	[ -h "$l" ] || continue
	card="$(basename "$l")"
	driver="$(dirname "$l")"
	break
    done
    [ -n "$card" ] && break
done
...

is clearly looking for the *current* driver but, on my system, there
is none.  on this laptop, the MMC card slot appears to be managed by
the SCSI driver and USB storage, so there is no symlink there; hence,
the script fails in the next check:

...
if [ -z "$card" ];then
    echo "No MMC/SD card found"
    exit 1
fi
...

  the mmc-block driver is built as a module, but it's never loaded
upon insertion of a card.  so to try to track down what's happening, i
fired up "udevadm monitor --kernel" to watch the events upon insertion
of an SD card, and i attached the dozen lines of (abbreviated) output.

  at this point, i'm not sure what to do.  i can certainly load the
mmc_test module, at which point i will get under /sys/bus/mmc/drivers:

$ find
.
./uevent
./unbind
./bind
$

  the rest of the script requires one to perform the MMC tests by
writing to the appropriate entry under debugfs, which i have mounted
but i have no idea what to look for under there.

  thoughts?

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1 (usb)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0 (usb)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15 (scsi)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/scsi_host/host15 (scsi_host)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0 (scsi)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0 (scsi)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/scsi_disk/15:0:0:0 (scsi_disk)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/scsi_device/15:0:0:0 (scsi_device)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/scsi_generic/sg2 (scsi_generic)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/bsg/15:0:0:0 (bsg)
/virtual/bdi/8:16 (bdi)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/block/sdb (block)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/block/sdb/sdb1 (block)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/block/sdb/sdb2 (block)
/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/host15/target15:0:0/15:0:0:0/block/sdb/sdb3 (block)

[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux