On Wed, 26 Nov 2003, Stefano Barbato wrote:
> Hi Alan,
>
> sorry if I take so long to reply, I couldn't reply until now.
>
> I attached a complete log from the power up to the read failure.
>
> After the prompt I run:
> ----------------------------------------
> # modprobe ehci-hcd
> # modprobe uhci
> # modprobe usb-storage
> # modprobe sd_mod
> [inserted a memory card in sda slot]
> [waited a minute or so, see log timing]
> # fdisk /dev/sda
> Unable to open /dev/sda
> #
> # cp /var/log/syslog failed_read_test.log
> [ tried also fdisk /dev/sd{b,c,d} just to be sure... ]
> ----------------------------------------
>
> Regarding your past reply it's true that I tried a different slot but that's
> because I wanted to try an empty slot not the "full" one.
>
> I own two more different multi-slot readers and both return an I/O error (as
> it should) when no card is inserted but they return almost immediately. Note
> that what I'm doing is not really a read polling but an open-polling (!) I
> mean I test the return of the open() syscall and based of my sd.c
> understanding should be enough to issue a TEST_UNIT_READY command to the
> device (I'm NOT using O_NDELAY open flag). I could try the ioctl() way if you
> want but I used the 'fdisk' command in this test just to be sure that the
> problem is not due to my code.
>
> Please let me know if you want me to try/test something.
>
> thank you.
>
> stefano
Well, your log shows the problem quite clearly, although it doesn't
explain why the problem occurred. During the initial startup it shows
usb-storage and the SCSI driver probing the card reader. (It does that
repeatedly -- the driver doesn't understand that there's no point
retrying a command when a "medium not present" error crops up. Most
annoying; I believe it has been fixed in 2.6.) Anyway, that all worked
correctly.
Then later you insert the card and try running a new command, like fdisk.
The log shows the sd driver probing again with TEST-UNIT-READY, and this
time there's absolutely no response at all. It looks like the act of
inserting the card caused the reader to die. It doesn't respond again
until after a complete bus reset, but by then it's too late, Linux has
already given up on it.
This leads me to wonder if that reader is really in good operating
condition. Or if maybe there's something wrong with the card that causes
the reader to crash. Things you might try: Use the same card with a
different reader. Use a different card with the malfunctioning reader.
Try issuing the fdisk command before inserting the card to see whether the
reader replies, then insert the card and try fdisk again (this may
indicate whether the reader died spontaneously or only when the card was
inserted). Remember, looking at the debugging log is the best way to see
exactly what happens.
Another thing you could try: do the same thing under 2.6.0. It's possible
that changes in the USB drivers will be enough to solve the problem.
Alan Stern
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel