Toshiba Satellite P850: RTS5229 SD card reader not working

Posted on October 08, 2012 in foss • 2 min read

It turns out that after thoroughly testing the new laptop I got a few months back for hardware compatibility issues with Linux, there was one thing I forgot to check: the built-in SD card reader slot. And of course, it happens to be the one thing that doesn't work out of the box (aside from Nvidia's Optimus, but I'll save my rant on that topic for another day). However, it turns out that Realtek does distribute source code for their out-of-tree rts5229 kernel module, which is used by my laptop's SD card reader, so luckily enough it didn't take me long before I got my card reader working and could get back to work. Details and a dkms package for Debian/Ubuntu users below...

If you're here, you probably want to know how to get your card reader working as it should be. First, check to make sure that we're talking about the same (or similar enough) hardware:

$ lspci -vnn | grep -A5 RTS5229
04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5229 PCI Express Card Reader [10ec:5229] (rev 01)
Subsystem: Toshiba America Info Systems Device [1179:fb30]
Flags: bus master, fast devsel, latency 0, IRQ 19
Memory at f6800000 (32-bit, non-prefetchable) [size=4K]
Capabilities:
Kernel driver in use: rts5229

(The "kernel driver in use" line won't show up until you've actually installed the driver, of course.)

You can fetch source code for the rts5229 module directly from Realtek (look for "PCIE RTS5229 card reader driver for Linux"; it's at version 1.07 at time of writing). Installation is simple; unzip it, untar it (don't ask me why Realtek put a tarball inside of a zip file...), cd into the source directory, and then:

$ make
# make install
# depmod -a

After which you can either reboot, or manually load the rts5229 module. It'll be automatically loaded on each subsequent reboot, regardless.

# modprobe rts5229

Of course, once you install a new kernel, you'll have to repeat the above steps, which is where dkms comes in: it'll automatically rebuild any out-of-tree modules registered with dkms each time you install/upgrade your kernel, so you don't have to do it manually yourself (if you're using dkms, you can skip all the steps I've outlined above). I've prepared a dkms .deb package for Debian/Ubuntu users, which you can grab here. (source package can be found in one of my Github repos)

Update: It looks like Realtek has submitted their driver into the mainline kernel; patches have been floating in the LKML for a while, at least. When it does get into mainline (3.8?), it'll be called "rtsx_pci" instead of "rts5229".

Update #2: Confirmed working perfectly out of the box in Linux 3.8. I recommend anyone with a RTS5229 card reader upgrade to 3.8, although it should be possible to backport upstream's patches for 3.6/3.7.