# sd card reader is Not found

## royalts

Hey,

I know this topic was discussed many times before but I can't find a solution for me.

I updated fro kernel 3.6.11 to 4.1.12. Now pretty much everything works fine, but my integrated SD/MMC card reader.

 *Quote:*   

> 
> 
> lspci:
> 
> 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
> ...

 

So it seems my SD card reader will work. But when I insert a SD card, which I was able to read/write on my old kernel, I didn't get a new device in /dev and dmesg didn't output anything.

I tick on every single entry in my kernel config.

 *Quote:*   

> 
> 
>   │ │                                                               --- MMC/SD/SDIO card support                                                                                                         │ │  
> 
>   │ │                                                               [*]   MMC debugging                                                                                                                  │ │  
> ...

 

But this was not successful. select everything as built in end up the same  :Sad: 

I found something like: CONFIG_SCSI_MULTI_LUN=y in prior post but can't find a similar menu entry in my 4.1.12 kernel.

Thanks 4 your effort

----------

## vose

I don't have a clue, but perhaps something about the following might lead to one...

http://unix.stackexchange.com/questions/134579/realtek-rts5209-pci-e-card-reader-only-work-if-card-is-inserted-before-boot

----------

## Fitzcarraldo

My main laptop also has a Realtek controller for the memory card slot, albeit not a 5209. I had to make some changes in order to get it working. I'm not using a 4.* kernel yet, but perhaps the following description of what I did might be of some help to you:

https://fitzcarraldoblog.wordpress.com/2015/04/28/realtek-5287-pcie-controller-for-memory-card-reader/

----------

## chithanh

I think what you need to enable for this card reader is CONFIG_MFD_RTSX_PCI.

CONFIG_SCSI_MULTI_LUN was necessary on older kernels for USB card readers.

----------

## royalts

hey guys!

I added some Hotplug modules like described here: https://fitzcarraldoblog.wordpress.com/2015/04/28/realtek-5287-pcie-controller-for-memory-card-reader/

 *Quote:*   

> 
> 
> ronny-reiner-rambo linux # cat .config | grep -i hotplug
> 
> CONFIG_MEMORY_HOTPLUG=y
> ...

 

and built

 *Quote:*   

> 
> 
> CONFIG_MFD_RTSX_PCI=m
> 
> 

 

as a module. lspci now looks like that:

 *Quote:*   

> 
> 
> 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
> 
> 	Subsystem: Acer Incorporated [ALI] RTS5209 PCI Express Card Reader
> ...

 

But it's still shown as: "Unassigned class [ff00]" and I got no device-folder in /dev. Thunar didn't recognize the reader either and dmesg did not throw any event.Last edited by royalts on Sun Jan 10, 2016 8:26 pm; edited 1 time in total

----------

## royalts

I'm not sure but do I need ACPI software to get it working?

----------

## chithanh

The "unassigned class" is not a problem of the kernel or driver, it is just that lspci has no database entry for it.

Do you get anything new in dmesg when you plug in a card?

If nothing happens: I am not sure whether the rtsx_pci driver should drive both devices, can you ensure that the rtsx_pci driver loads before the sdhci one at boot?

----------

## Fitzcarraldo

You have CONFIG_HOTPLUG_PCI_PCIE=n:

```
# CONFIG_HOTPLUG_PCI_PCIE is not set 
```

I have set it in my configuration:

```
clevow230ss fitzcarraldo # grep -i hotplug /usr/src/linux/.config

# CONFIG_MEMORY_HOTPLUG is not set

CONFIG_HOTPLUG_CPU=y

# CONFIG_BOOTPARAM_HOTPLUG_CPU0 is not set

# CONFIG_DEBUG_HOTPLUG_CPU0 is not set

CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y

CONFIG_ACPI_HOTPLUG_CPU=y

CONFIG_HOTPLUG_PCI_PCIE=y

CONFIG_HOTPLUG_PCI=y

CONFIG_HOTPLUG_PCI_ACPI=y

# CONFIG_HOTPLUG_PCI_ACPI_IBM is not set

# CONFIG_HOTPLUG_PCI_CPCI is not set

# CONFIG_HOTPLUG_PCI_SHPC is not set

CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug"
```

Is the Realtek memory card controller a PCIE card in your machine? I believe my laptop has a PCIE card:

```
clevow230ss fitzcarraldo # lspci | grep -i realtek

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)

04:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 12)
```

----------

## royalts

@chithanh: dmesg and udevadm monitor did't output anything. So how could I ensure rtsx_pci  loads before sdhci?

@Fitzcarraldo: I added 

 *Quote:*   

> 
> 
> cat /usr/src/linux/.config | grep 'CONFIG_HOTPLUG_PCI_PCIE'
> 
> CONFIG_HOTPLUG_PCI_PCIE=y
> ...

 

but the problem still remains.

----------

## Fitzcarraldo

I have 'sdhci-pci' listed before 'rtsx_pci' in /etc/conf.d/modules:

```
clevow230ss fitzcarraldo # cat /etc/conf.d/modules 

modules="r8169 nvidia agpgart fuse bnep rfcomm hidp uvcvideo cifs mmc_block sdhci-pci rtsx_pci snd-seq-midi vboxdrv vboxnetadp vboxnetflt"
```

but it appears that rtsx_pci loads earlier than sdhci:

```
clevow230ss fitzcarraldo # dmesg | grep rtsx

[    6.656558] rtsx_pci 0000:04:00.0: rtsx_pci_acquire_irq: pcr->msi_en = 0, pci->irq = 16

clevow230ss fitzcarraldo # dmesg | grep sdhci

[   10.643391] sdhci: Secure Digital Host Controller Interface driver

[   10.643393] sdhci: Copyright(c) Pierre Ossman
```

----------

## royalts

ich put my PCI ID in here: http://kmuto.jp/debian/hcl/index.rhtmlx and i got as a result: Driver: rts_pstor.

This is in the package: sys-block/rts_pstor, but not available in the kernel config (which I don't understand :/ )

After install lspci -v lokks like that:

 *Quote:*   

> 
> 
> 04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
> 
> 	Subsystem: Acer Incorporated [ALI] RTS5209 PCI Express Card Reader
> ...

 

and dmesg:

 *Quote:*   

> 
> 
> [ 9130.548105] rts_pstor: module verification failed: signature and/or required key missing - tainting kernel
> 
> [ 9130.549504] Initializing Realtek PCIE storage driver...
> ...

 

By the way: I found this in dmesg, too  (appears very often)

 *Quote:*   

> 
> 
> sdhci: =========== REGISTER DUMP (mmc0)===========
> 
> [ 1130.989656] sdhci: Sys addr: 0x00000000 | Version:  0x00000000
> ...

 

----------

## Fitzcarraldo

What happens if you merge sys-block/rts_pstor and then rmmod rts_pstor && modprobe rts_pstor?

----------

## royalts

That's It!  rmmod rts_pstor && modprobe rts_pstor did it  :Very Happy: 

So could I remove sdhci_pci,... or is this still needed and why are bot listed in my lspci -v (see post above)? Could a deive load/need two kernel modules?

----------

## Fitzcarraldo

Try rmmod sdhci_pci and, if your card reader continues working, you'll know you don't need it as well.

EDIT: BTW, it looks like the rts_pstor driver was removed from 4.* kernels and presumably the rtsx_pci is intended to take its place:

CONFIG_RTS_PSTOR "found in Linux kernels: 2.6.39, 3.0–3.7"

CONFIG_MFD_RTSX_PCI "found in Linux kernels: 3.10–3.19, 4.0–4.2, 4.4"

CONFIG_MMC_SDHCI_PCI "found in Linux kernels: 2.6.27–2.6.39, 3.0–3.19, 4.0–4.2, 4.4"

----------

