Internal SD card reader not detected HP realtek RTS5227

I recently installed Ubuntu 14.04 on my HP Envy m7-j020dx. The only problem I am currently having is that the internal SD card reader does not seem to be detected at all. I have tried to find a solution using Google, but there was little to find on how to solve this problem, and the solutions I've tried did not work. There is no external problem because everything works fine in Windows 8.

Fun fact: SD card is detected on the 14.04 Live CD, but not otherwise.

With and without the SD card in, df -h gives me the following result:

Filesystem             Size  Used Avail Use% Mounted on
/dev/sda5              154G   35G  112G  24% /
none                   4,0K     0  4,0K   0% /sys/fs/cgroup
udev                   3,9G  4,0K  3,9G   1% /dev
tmpfs                  792M  1,4M  791M   1% /run
none                   5,0M     0  5,0M   0% /run/lock
none                   3,9G   28M  3,9G   1% /run/shm
none                   100M   32K  100M   1% /run/user
/dev/sda2              256M  102M  155M  40% /boot/efi
/home/ramzes/.Private  154G   35G  112G  24% /home/ramzes

What didn't work:

  • Rebooting with the SD card in the reader
  • sudo modprobe rts5139
  • sudo modprobe rts5229 (FATAL: Module not found)
  • this
  • this which left me fixing my partition types for the next 4 hours
  • anything front page google discussing this topic

Some info

  • Kernel: Linux envy 3.13.0-30-generic #55-Ubuntu SMP Fri Jul 4 21:40:53 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
  • lspci -v output with card in: http://pastebin.com/VEHik10j - relevant bit (possibly):

    03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
        Subsystem: Hewlett-Packard Company Device 1965
        Flags: fast devsel, IRQ 19
        Memory at b1000000 (32-bit, non-prefetchable) [size=4K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Device Serial Number 00-00-00-01-00-4c-e0-00
        Capabilities: [150] Latency Tolerance Reporting
        Capabilities: [158] L1 PM Substates
    
  • dmesg output: http://pastebin.com/daVuzg2g


Solution 1:

Holy crap, I finally got it to work.

Okay, so here's what I did.

From the last line of lspci it was clear that I needed the RTS5227 driver. However, I really couldn't find this anywhere online.

Instead, I took the RTS5229 driver from the Realtek website and did the following.

I uploaded these files to use as the RTS5227 driver for anyone else in need.

Download

The download link has since expired so the source has been put into a GitHub repo with these changes as well as some additional ones to get it to work on 20.04 kernel 5.4.0.

Source

Here's what I did for those who don't trust the link or want to do it manually:

Go into rtsx.c and remove the following pieces of code from the file:

  • __devinit
  • __devexit
  • __devexit_p
  • comment out .proc_info = proc_info on line 266 by adding // in front of the line.

Then, in rtsx.h, change
#define CR_DRIVER_NAME "rts5229" to
#define CR_DRIVER_NAME "rts5227".

Then, in Makefile, change TARGET_MODULE := rts5229 to TARGET_MODULE := rts5227.

After all this, you should be able to normally install the driver like so:

  1. make
  2. sudo make install
  3. sudo depmod
  4. sudo modprobe rts5227

You should now see the SD slot in nautilus and in the launcher (on Ubuntu).

Hope it helped, and thank you to everyone for the support!!!

Solution 2:

As I reported today on Ubuntu 14.04 Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader isn't working :

# modprobe -r rtsx_pci
# modprobe rtsx_pci

with a kernel starting from 3.9 will do. One need to investigate why it gets disable.