Project

General

Profile

Bug #2375

Issues with SD card reader

Anonymous - over 4 years ago - . Updated over 4 years ago.

Status:
unconfirmed
Priority:
bug
Assignee:
-
% Done:

0%


Description

I have some issues with my SD card reader.
It worked on Windows, but it didn't on ANY GNU/Linux distribution, even with non‐free firmware.
When I use fdisk on /dev/sdb (card reader), it says there is I/O error. However, when I disable ehci_pci module, it reports there is no partition table and fails to write it (no error messages).
I have done verbose lsusb as root in both cases.


Files

sd_pci (2.26 KB) sd_pci Anonymous, 2019-07-15 08:05 PM
sd_nopci (2.26 KB) sd_nopci Anonymous, 2019-07-15 08:06 PM

History

#1

Updated by Anonymous over 4 years ago

Issue with server?

#2

Updated by Anonymous over 4 years ago

(there is partition table on it)

#3

Updated by freemor over 4 years ago

OpenRC or systemd?
what are the permissions on /dev/sdbx?
how/where is /dev/sdbx mounted?
What are the perms of the directory that /dev/sdbx is mounted to
What groups does the user doing this belong to?
Are there errors in the system log when the SD is plugged in?
if not, what partitions are detected on the SD when it is plugged in?

/dev/sdbx above refers to /dev/sdb1, /dev/sdb2 /etc

#4

Updated by freemor over 4 years ago

just say your no partition table note

Pretty much only root can write directly to /dev/sdb
are you trying to access it as root?
what are you trying to do to the SD?

#5

Updated by Anonymous over 4 years ago

systemd, standard permissions (as /dev/sda), NOT mountable, no partition table.

-brw-rw----

LC_ALL=C sudo fdisk /dev/sdb:
Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x(random)

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

(the same message next time I use fdisk)
#6

Updated by bill-auger over 4 years ago

are you certain that the disk is actually partitioned?

have you tried reformatting it - with say cfdisk+mkfs or gparted?

#7

Updated by freemor over 4 years ago

re you sure the SD card shows up as /dev/sdb? not /dev/mmcblkx (where x is a number?)
what does the system log say when you plug the device in or pull it out?

#8

Updated by Anonymous over 4 years ago

SD card is partitioned. IIRC it has two partitions (first FAT32, second ext4). It is used in semi‐dead outdated Android device.

cfdisk failed. GParted failed.

mkfs.ext4 said /dev/sdb contains `International EBCDIC text, with very long lines, with no line terminators' data. I didn't proceed.

There is no /dev/mmcblk*

If uhci_hcd is used:
`[ 741.851811] usb 8-1: USB disconnect, device number 3
[ 744.535107] usb 8-1: new full-speed USB device number 4 using uhci_hcd
[ 744.713100] usb 8-1: New USB device found, idVendor=058f, idProduct=6366, bcdDevice= 1.00
[ 744.713104] usb 8-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 744.713106] usb 8-1: Product: Mass Storage Device
[ 744.713108] usb 8-1: Manufacturer: Generic
[ 744.713110] usb 8-1: SerialNumber: 058F63666433
[ 744.717607] usb-storage 8-1:1.0: USB Mass Storage device detected
[ 744.717867] scsi host6: usb-storage 8-1:1.0
[ 745.873153] scsi 6:0:0:0: Direct-Access Multiple Card Reader 1.00 PQ: 0 ANSI: 0
[ 746.579126] sd 6:0:0:0: [sdb] 31078400 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 746.584122] sd 6:0:0:0: [sdb] Write Protect is off
[ 746.584126] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 746.589136] sd 6:0:0:0: [sdb] No Caching mode page found
[ 746.589140] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 746.639143] sd 6:0:0:0: [sdb] Attached SCSI removable disk`
If ehci_pci:
`[ 828.975048] usb 2-5: new high-speed USB device number 3 using ehci-pci
[ 829.122993] usb 2-5: New USB device found, idVendor=058f, idProduct=6366, bcdDevice= 1.00
[ 829.123003] usb 2-5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 829.123009] usb 2-5: Product: Mass Storage Device
[ 829.123015] usb 2-5: Manufacturer: Generic
[ 829.123017] usb 2-5: SerialNumber: 058F63666433
[ 829.123491] usb-storage 2-5:1.0: USB Mass Storage device detected
[ 829.129291] scsi host6: usb-storage 2-5:1.0
[ 830.270650] scsi 6:0:0:0: Direct-Access Multiple Card Reader 1.00 PQ: 0 ANSI: 0
[ 830.989808] sd 6:0:0:0: [sdb] 31078400 512-byte logical blocks: (15.9 GB/14.8 GiB)
[ 830.990270] sd 6:0:0:0: [sdb] Write Protect is off
[ 830.990273] sd 6:0:0:0: [sdb] Mode Sense: 03 00 00 00
[ 830.990884] sd 6:0:0:0: [sdb] No Caching mode page found
[ 830.990887] sd 6:0:0:0: [sdb] Assuming drive cache: write through
[ 830.996287] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 830.996292] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 830.996297] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 830.996302] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 830.996306] print_req_error: I/O error, dev sdb, sector 0 flags 0
[ 830.996314] Buffer I/O error on dev sdb, logical block 0, async page read
[ 830.997767] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 830.997770] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 830.997776] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 830.997779] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 830.997782] print_req_error: I/O error, dev sdb, sector 0 flags 0
[ 830.997787] Buffer I/O error on dev sdb, logical block 0, async page read
[ 830.997808] ldm_validate_partition_table(): Disk read failed.
[ 830.999401] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 830.999404] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 830.999410] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 830.999413] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 830.999417] print_req_error: I/O error, dev sdb, sector 0 flags 0
[ 830.999423] Buffer I/O error on dev sdb, logical block 0, async page read
[ 831.001152] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 831.001156] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 831.001160] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 831.001164] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 831.001167] print_req_error: I/O error, dev sdb, sector 0 flags 0
[ 831.001172] Buffer I/O error on dev sdb, logical block 0, async page read
[ 831.004114] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 831.004119] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 831.004123] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 831.004128] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 00 00 00 00 00 00 08 00
[ 831.004131] print_req_error: I/O error, dev sdb, sector 0 flags 0
[ 831.004138] Buffer I/O error on dev sdb, logical block 0, async page read
[ 831.004165] sdb: unable to read partition table
[ 831.009804] sd 6:0:0:0: [sdb] Attached SCSI removable disk
[ 831.015280] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 831.015284] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 831.015290] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 831.015296] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 01 da 37 80 00 00 08 00
[ 831.015299] print_req_error: I/O error, dev sdb, sector 31078272 flags 80700
[ 831.019785] sd 6:0:0:0: [sdb] tag#0 FAILED Result: hostbyte=DID_OK driverbyte=DRIVER_SENSE
[ 831.019790] sd 6:0:0:0: [sdb] tag#0 Sense Key : Not Ready [current]
[ 831.019795] sd 6:0:0:0: [sdb] tag#0 <<vendor>>ASC=0xff <<vendor>>ASCQ=0xff
[ 831.019798] sd 6:0:0:0: [sdb] tag#0 CDB: Read(10) 28 00 01 da 37 80 00 00 08 00
[ 831.019801] print_req_error: I/O error, dev sdb, sector 31078272 flags 0
[ 831.019808] Buffer I/O error on dev sdb, logical block 3884784, async page read
`

#9

Updated by Anonymous over 4 years ago

*permissions are brw-rw---- actually

#10

Updated by freemor over 4 years ago

I'm assuming that you have indeed tried with other SD cards to rule out the SD card being bad.

Just did some internet grepping and it looks like that model of usb card reader has been non functional in linux for a long time (like always)
Looks like you've got a peice of windows only HW there, Sorry.

if you search oni: 058f:6366 alcor linux error

You'll see lots of people with the same issue going back a long ways.

#11

Updated by Anonymous over 4 years ago

Why did it work on clean Windows 7 SP1 installation (no third‐party drivers)?
Not sure about any other Windows versions/builds.
It looks like I have to reinstall my Parabola because of some issues, I might install some Windows to check SD card reader if it is required.

#12

Updated by Anonymous over 4 years ago

Can this 'International EBCDIC text, with very long lines, with no line terminators' be decoded?

#13

Updated by freemor over 4 years ago

It worked on windows 7 because windows 7 and prior were notorious for allowing things to address USB devices in non-standard ways.
This was tightened up some in 8 and more so in 10, which caused a lot of people to be upset as their stuff that worked before just stopped working.
As for With no drivers. Microsoft stores drivers for pretty much everything on is update servers. when you plug something in it is standard
for windows to check those servers and install the drivers it needs.

If it is actually EBCDIC and not just randomness that is being guessed to be EBCDIC it can be decoded. EBCDIC is a standard tho older method of encoding data

If you are interested in getting this working the thing to do would be hook it back up to a Windows machine, install wireshark, sniff the non standard USB protocol, document it, and then see if you can do the same on Linux (which may be impossible because Linux is a little more strict about that) you'd probably have to bypass the ehci_hcd module and bit bang the interface directly.

I feel your frustration, because I have been there. Holding what seemed like a perfectly good bit of kit, but discovering unless I run windows it's basically a brick.

#14

Updated by freemor over 4 years ago

You could also use Wireshark on linux to try and get a sense of what is going wrong as that way you could see the raw data going back and forth.

But sreiously, unless you have a deep passion for low level hardware tinkering. I'd just spend the $5 or so and get a different reader.

#15

Updated by freemor over 4 years ago

It looks like someone has already done some head banging and cobbled together an alcor card reader driver
It does not list the device Id numbers of your device but it might work if you can get the source and compile it for the current kernel

https://launchpadlibrarian.net/175159219/[PATCH]%20mmc%3A%20add%20new%20au6601%20driver.eml
https://launchpad.net/~iacobs/+archive/ubuntu/au6601/+index

#16

Updated by freemor over 4 years ago

there is work on a "not great" PKGBUILD here (not great because it just pull the deb from the PPA mentioned above and then patches it. Best would be to pull the actula source from a git or tarball)
it is only for a specific kernel.
But if you realllllllly want to get this working this would be the place to start
bearing in mind that you'd probably have retweak the driver for newer kernels

#18

Updated by Anonymous over 4 years ago

Cannot build because the following error:
`cc1: error: incompatible gcc/plugin versions`
Plugins are:
  • ./scripts/gcc-plugins/stackleak_plugin.so
  • ./scripts/gcc-plugins/structleak_plugin.so
  • ./scripts/gcc-plugins/latent_entropy_plugin.so
#19

Updated by Anonymous over 4 years ago

Do I need to install Trisquel?

#20

Updated by freemor over 4 years ago

I said it was a start. Not solution. Also said the PKGBUILD was not great. It's a place to begin if you want to do all the work to get the reader working.
But seriously a $5 (or less) usb card reader would be faster, easier, and more stable.

IMHO this is still a case of Bad hardware.

I suspect the fact that this hasn't been mainlined into the kernel points to some serious flakiness of the hardware.

I doubt Trisquel would have this either. it is for a very specific kernel. it is years out of date. etc

I gave you the links to that information so you could hack on it and get it working if you wanted to.

#21

Updated by Anonymous over 4 years ago

Is GCC broken?
Same issue, GCC 8.3 (I have 9.1).
https://bugs.archlinux.org/task/62420

#22

Updated by Anonymous over 4 years ago

Update: GCC is not broken, but there are issues with linux-libre-xtreme.
On gnu kernel, module installs and modprobe works (however, reader doesn't).
Should I change
`#define PCI_ID_AU6601 0x6601`
to
`#define PCI_ID_AU6601 0x6366`
Will it work?

#23

Updated by freemor over 4 years ago

That looks like the hardware ID so as I stated above this may not be for your alcor card reader but a previous/later model with the same issue.
Changing the ID Might, maybe, work. But probably not as that suggests there may be a different chipset or a different version of the same chipset
in use and to the commands/hardware registers/etc may not match.

#24

Updated by Anonymous over 4 years ago

Didn't worked.

Will it at least work in Windows 7 virtual machine?

Will Windows 7 virtual machine work with no hardware virtualization support?

#25

Updated by Anonymous over 4 years ago

Does NOT work on Windows 10.

Also available in: Atom PDF