11

Can a USB card-reader ever appear as /dev/mmcblk0 and support the MMC ioctl commands?

I see there are some kernel driver modules such as:

rtsx_usb_sdmmc.ko  (rtsx-usb-sdmmc)
rtsx_usb.ko (rtsx-usb)

Can these make a realtek card reader, attached to the USB bus appear as a real MMC device? I notice that all the USB card readers I have access to appear as /dev/sdX. which appear to be an emulated SCSI device. These emulated SCSI devices do not support all the MMC operations (ioctl).

Are there certain USB-attached card-readers (chips) that appear as a /dev/mmcblkX instead of /dev/sdX?

This would allow the card to support blkdiscard, trim or fstrim.

1
  • There are card readers, that see the memory cards as /dev/mmcblk0, /dev/mmcblk1 ... I think those readers are connected via PCI. Card readers connected via USB see the cards as dev/sda, dev/sdb ... I have not seen a USB adapter, that makes linux see it as an MMC device, but maybe there are such adapters. However, the discard (trim) function can be built into the drive itself (I have such a USB pendrive). -- It can also help to 'wipe the whole device' (overwrite with zeros) to make a card or USB pendrive fast again, if it was originally fast, but is slow after a lot of writes, Commented Jun 28, 2020 at 18:41

2 Answers 2

4

Yes, this is how devices based on RTS5129 or RTS5139 work. I do have RTS5129 in my Vostro laptop as a cardreader, and it provides me with /dev/mmcblkc0 device.

Update:

Please, see the update to my answer https://stackoverflow.com/a/62625224/1879547 which is relevant to this question too.

4
  • A couple references unix.stackexchange.com/questions/257033/…. github.com/asymingt/rts5139 Commented Jun 30, 2020 at 23:34
  • 1
    I guess the next question to ask (perhaps not here) is can I find an external USB Card-reader with this chip-set? Commented Jul 4, 2020 at 13:12
  • 1
    I wish I knew some. Commented Jul 5, 2020 at 14:16
  • The closest thing I could find are laptop replacement parts, like the Lenovo 01AJ839. Should be easy to rewire the internal header cable to a external male or female usb connector, and maybe put it inside a 3D printed case. Commented Apr 30, 2021 at 0:36
1

I can confirm that RTS5179 card reader recognize MMC as /dev/mmcblk0. It was a used laptop part from marketplace.

In this mode TRIM functionality is working for MMC cards.

2
  • What laptop model is this part for? Commented Jun 19, 2024 at 16:51
  • I bought it on the ebay. It called Lenovo Ideacentre K450E 10181 Genuine Desktop Single Card Reader Board 11201223 Commented Jun 26, 2024 at 15:46

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.