I have a RTS5209 Realtek SD card reader on my laptop, which was not reading any card inserted. The following instructions are likely to work for other versions like RTS5229 or RTS5289 as well.
Turns out I needed to install the driver.
Realtek offers drivers on its website for Ubuntu/Linux. Download the driver and unpack into a temporary directory.
Open a terminal and cd into the directory you unpacked the file.
Then enter one after the other:
make
sudo make install
sudo depmod
You will have to reboot your computer for the driver to load, or you can enter this command:
sudo modprobe rts_pstor
This is for RTS5209. I believe for RTS5229 it is (hint:read folder name):
sudo modprobe rts5229
However, this only works on older kernels and on 3.9+ you get errors like:
vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$ make
sed "s/RTSX_MK_TIME/`date +%y.%m.%d.%H.%M`/" timestamp.in > timestamp.h
cp -f ./define.release ./define.h
make -C /lib/modules/3.8.0-26-generic/build/ SUBDIRS=/home/vidyut/tmp/rts_pstor modules
make[1]: Entering directory `/usr/src/linux-headers-3.8.0-26-generic'
CC [M] /home/vidyut/tmp/rts_pstor/rtsx.o
/home/vidyut/tmp/rts_pstor/rtsx.c:916:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
/home/vidyut/tmp/rts_pstor/rtsx.c:1080:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
/home/vidyut/tmp/rts_pstor/rtsx.c:1106:11: error: ‘rtsx_probe’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/home/vidyut/tmp/rts_pstor/rtsx.c:1107:24: error: ‘rtsx_remove’ undeclared here (not in a function)
/home/vidyut/tmp/rts_pstor/rtsx.c:485:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:596:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:745:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:780:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:790:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
/home/vidyut/tmp/rts_pstor/rtsx.c:816:13: warning: ‘rtsx_init_options’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/home/vidyut/tmp/rts_pstor/rtsx.o] Error 1
make[1]: *** [_module_/home/vidyut/tmp/rts_pstor] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.8.0-26-generic'
make: *** [default] Error 2
vidyut@vidyut-Compaq-435-Notebook-PC:~/tmp/rts_pstor$
The fix for this is to edit the file rtsx.c (that is throwing the errors) and remove “__devinit” “__devexit” and “__devexit_p” from it, leaving the rest of the code (and the rest of the line they occur in) in tact.
Like so:
static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
Becomes:
static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
static void __devexit rtsx_remove(struct pci_dev *pci)
Becomes:
static void rtsx_remove(struct pci_dev *pci)
.remove = __devexit_p(rtsx_remove),
Becomes:
.remove = rtsx_remove,
Now, when you run make, the process should complete without errors.
If your SD card *still* doesn’t mount, check your dmesg like so:
sudo dmesg
If it shows something like:
[ 694.058432] systemd-hostnamed[2516]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
Try installing the library.
apt-get install libnss-myhostname
If it still doesn’t work, I don’t know what to do. This SHOULD work.
Leave a Reply