Bug 57061 - rtsx_pci doesn't work
Summary: rtsx_pci doesn't work
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: MMC/SD (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_mmc-sd
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-04-24 09:14 UTC by Richie Rich
Modified: 2022-11-03 16:24 UTC (History)
14 users (show)

See Also:
Kernel Version: linux-3.8.8-gentoo
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Richie Rich 2013-04-24 09:14:29 UTC
Hi,

On my system (Gentoo) I was using rts_bpp (kernel < 3.8). As someone said, with kernels 3.8 and newer there is a new driver - rtsx_pci.

I was trying both (compiled in kernel and as a module) but the card reader doesn't work. On the paper everything is OK (have a look bellow), lspci and lsmod shows it should work, but it doesn't. I know for many users in Gentoo this works, but not for me. 
# lsmod 
Module                  Size  Used by
nvidia               9119147  0 
rtsx_pci               17588  0 
iwldvm                125862  0 
r8168                 235989  0 
mfd_core                2905  1 rtsx_pci
iwlwifi                67931  1 iwldvm


****

# lspci -v 

  06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01) 
          Subsystem: Realtek Semiconductor Co., Ltd. Device 5289 
          Flags: bus master, fast devsel, latency 0, IRQ 55 
          Memory at f7800000 (32-bit, non-prefetchable) [size=64K] 
          Capabilities: [40] Power Management version 3 
          Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+ 
          Capabilities: [70] Express Endpoint, MSI 00 
          Capabilities: [b0] MSI-X: Enable- Count=1 Masked- 
          Capabilities: [d0] Vital Product Data 
          Capabilities: [100] Advanced Error Reporting 
          Capabilities: [140] Virtual Channel 
          Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00 
          Kernel driver in use: rtsx_pci 
          Kernel modules: rtsx_pci

It looks similar problem like mine have some eg. Arch or Fedora users:

https://aur.archlinux.org/packages/dkms-rts_bpp/?setlang=pt_BR

https://bugzilla.redhat.com/show_bug.cgi?id=854762

With a new kernel (>3.8) I can't compile rts_bpp driver in the old way (make, make install) - similair errors have Fedora and Arch users above:

# make
cp -f ./define.release ./define.h
make -C /lib/modules/3.8.8-gentoo/build/ SUBDIRS=/mnt/twardy/system/rts_bpp modules
make[1]: Entering directory `/usr/src/linux-3.8.8-gentoo'
  CC [M]  /mnt/twardy/system/rts_bpp/rtsx.o
/mnt/twardy/system/rts_bpp/rtsx.c:893:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
/mnt/twardy/system/rts_bpp/rtsx.c:1048:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
/mnt/twardy/system/rts_bpp/rtsx.c:1073:11: error: ‘rtsx_probe’ undeclared here (not in a function)
/mnt/twardy/system/rts_bpp/rtsx.c:1074:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/mnt/twardy/system/rts_bpp/rtsx.c:1074:24: error: ‘rtsx_remove’ undeclared here (not in a function)
/mnt/twardy/system/rts_bpp/rtsx.c:255:34: warning: ‘rtsx_host_template’ defined but not used [-Wunused-variable]
/mnt/twardy/system/rts_bpp/rtsx.c:450:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
/mnt/twardy/system/rts_bpp/rtsx.c:559:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
/mnt/twardy/system/rts_bpp/rtsx.c:715:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
/mnt/twardy/system/rts_bpp/rtsx.c:751:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
/mnt/twardy/system/rts_bpp/rtsx.c:761:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
/mnt/twardy/system/rts_bpp/rtsx.c:786:13: warning: ‘rtsx_init_options’ defined but not used [-Wunused-function]
cc1: some warnings being treated as errors
make[2]: *** [/mnt/twardy/system/rts_bpp/rtsx.o] Error 1
make[1]: *** [_module_/mnt/twardy/system/rts_bpp] Error 2
make[1]: Leaving directory `/usr/src/linux-3.8.8-gentoo'
make: *** [default] Error 2
Comment 1 Richie Rich 2013-04-29 09:05:39 UTC
The same situation with kernel 3.8.10 :(

$ modinfo rtsx_pci
filename:       /lib/modules/3.8.10-gentoo/kernel/drivers/mfd/rtsx_pci.ko
description:    Realtek PCI-E Card Reader Driver
author:         Wei WANG <wei_wang@realsil.com.cn>
license:        GPL
alias:          pci:v000010ECd00005289sv*sd*bcFFsc*i*
alias:          pci:v000010ECd00005229sv*sd*bcFFsc*i*
alias:          pci:v000010ECd00005209sv*sd*bcFFsc*i*
depends:        mfd-core
intree:         Y
vermagic:       3.8.10-gentoo SMP mod_unload 
parm:           msi_en:Enable MSI (bool)


# dmesg
[  309.668605] rtsx_pci 0000:06:00.0: irq 55 for MSI/MSI-X
[  309.668643] rtsx_pci 0000:06:00.0: rtsx_pci_acquire_irq: pcr->msi_en = 1, pci->irq = 55
Comment 2 Alex Giouzenis 2013-05-02 10:57:56 UTC
Same problem here. With previous kernels the DKMS module provided here https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/971876?comments=all did the trick, but it will not work with 3.8 kernels.

If there is any debug info that might help, I'd be happy to provide it.
Comment 3 Richie Rich 2013-05-16 06:16:40 UTC
Kernel 3.9.2 and still the same :(

Someone says this patch could help, but I did not triy it. Could any developer test it, please?

--- rtsx.c~     2011-12-05 04:41:04.000000000 +0100 
 +++ rtsx.c      2013-04-29 13:24:41.794429549 +0200 
 @@ -890,7 +890,7 @@ static void rtsx_init_options(struct rts 
         chip->handshake_en = 1; 
  } 
   
 -static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 
 +static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) 
  { 
         struct Scsi_Host *host; 
         struct rtsx_dev *dev; 
 @@ -1045,7 +1045,7 @@ errout: 
  } 
   
   
 -static void __devexit rtsx_remove(struct pci_dev *pci) 
 +static void rtsx_remove(struct pci_dev *pci) 
  { 
         struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci); 
   
 @@ -1071,7 +1071,7 @@ static struct pci_driver driver = { 
         .name = CR_DRIVER_NAME, 
         .id_table = rts_bpp_ids, 
         .probe = rtsx_probe, 
 -       .remove = __devexit_p(rtsx_remove), 
 +       .remove = rtsx_remove, 
  #ifdef CONFIG_PM 
         .suspend = rtsx_suspend, 
         .resume = rtsx_resume,
Comment 4 aFagylaltos 2013-05-25 18:54:59 UTC
It is works:

$ ▶ uname -r
3.8.0-22-generic

$ ▶ wget https://bugs.launchpad.net/bugs/971876/+attachment/2991730/+files/rts_bpp.tar.bz2

$ ▶ tar jxf rts_bpp.tar.bz2
$ ▶ cd rts_bpp

And you need edit the rtsx.c file!
example:
$ ▶ sudo kwrite rtsx.c

--- rtsx.c~     2011-12-05 04:41:04.000000000 +0100 
 +++ rtsx.c      2013-05-25 20:47:43.854346556 +0200 
 @@ -890,7 +890,7 @@ static void rtsx_init_options(struct rts 
         chip->handshake_en = 1; 
  } 

 -static int __devinit rtsx_probe(struct pci_dev *pci, const struct
pci_device_id *pci_id) 
 +static int rtsx_probe(struct pci_dev *pci, const struct pci_device_id
*pci_id) 
  { 
         struct Scsi_Host *host; 
         struct rtsx_dev *dev; 
 @@ -1045,7 +1045,7 @@ errout: 
  } 


 -static void __devexit rtsx_remove(struct pci_dev *pci) 
 +static void rtsx_remove(struct pci_dev *pci) 
  { 
         struct rtsx_dev *dev = (struct rtsx_dev *)pci_get_drvdata(pci); 

 @@ -1071,7 +1071,7 @@ static struct pci_driver driver = { 
         .name = CR_DRIVER_NAME, 
         .id_table = rts_bpp_ids, 
         .probe = rtsx_probe, 
 -       .remove = __devexit_p(rtsx_remove), 
 +       .remove = rtsx_remove, 
  #ifdef CONFIG_PM 
         .suspend = rtsx_suspend, 
         .resume = rtsx_resume,

Save the file.

$ ▶ make
$ ▶ sudo make install
$ ▶ sudo depmod
$ ▶ sudo reboot

My distro is:

▶ uname -a
Linux XMG-linux 3.8.0-22-generic #33-Ubuntu SMP Thu May 16 15:17:14 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

-----------------------------
XMG P502 / Clevo P150EM
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
Comment 5 Richie Rich 2013-05-27 06:23:26 UTC
Many thanks aFagylaltos, as rtsx_pci doesn't work also for kernel 3.9.4 and I desperately need a card reader. 

What should I do exactly in this file rtsx.c? Should I add those part of code? At the beginning or at the middle?
Comment 6 aFagylaltos 2013-05-27 08:09:51 UTC
/////////////////
edit the rtsx.c
/////////////////

A method) 

1. open the rtsx.c file with any text editor
2. search this word: "__devinit" you found it the 893 number line
   and you remove this word.

BEFORE editing:  static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 
AFTER editing:   static int rtsx_probe(struct pci_dev *pci, const 
struct pci_device_id *pci_id) 

3. search "__devexit" ( line number: 1048 ) and remove the "__devexit"

BEFORE editing: static void __devexit rtsx_remove(struct pci_dev *pci) 
AFTER editing:  static void rtsx_remove(struct pci_dev *pci) 

4. and finally you need remove "__devexit_p"

BEFORE editing: .remove = __devexit_p(rtsx_remove), 
AFTER editing:  .remove = rtsx_remove, 


or B method)

1.
You need adding this lines after the #define DRIVER_VERSION "v1.10"

//-WARNING*********************
//--modified-------------------
#ifndef __devinit
#define __devinit
#endif

#ifndef __devexit
#define __devexit
#endif

#ifndef __devexit_p
#define __devexit_p(x) (x)
#endif
//------------------------------


I'm not sure that this is the best answer, but it is works for me.

///////////////////////////////////////
And than you finishd the editing file:
///////////////////////////////////////

$ ▶ make
$ ▶ sudo make install
$ ▶ sudo depmod -a
$ ▶ sudo reboot

> Many thanks aFagylaltos, as rtsx_pci doesn't work also for kernel 3.9.4 and I
> desperately need a card reader. 
> 
> What should I do exactly in this file rtsx.c? Should I add those part of
> code?
> At the beginning or at the middle?
Comment 7 aFagylaltos 2013-05-27 08:29:17 UTC
I tested only A method!
Comment 8 Richie Rich 2013-06-08 12:25:36 UTC
Anyway, the new driver rtsx_pci still dosen't work - now with kernel 3.9.5
Comment 9 qbanin 2013-06-19 09:41:23 UTC
Seems to be fixed in 3.9.6
Comment 10 Richie Rich 2013-06-22 06:41:07 UTC
Unfortunately,

I use kernel 3.9.7 now and is not fixed yet.
Must be very difficult bug to fix it for developers. Last working kernel was 3.7.10 so far, so it was time ago.

If anyone can fix it, I can offer money support.
Comment 11 Richie Rich 2013-06-28 07:25:10 UTC
Kernel 3.9.8 tested - rtsx_pci still dosen't work
Comment 12 Karol Herbst 2013-07-01 13:49:45 UTC
Hi, I have a Schenker XMG P503 Laptop with the same SD card reader.

I am running 3.10-rc7 and the driver doesn't work for me. In dmesg there is a message about a registered device named "mmc0", but udev isn't populating this in /dev and udisks won't give me the option to mount the card in userspace.
Comment 13 Richie Rich 2013-07-05 06:07:33 UTC
I can confirm the bug still exist in kernel 3.10.0 and rtsx_pci doesn't work.

:(
Comment 14 Richie Rich 2013-07-05 06:59:56 UTC
Spot the diference:

This is last workable configuration (independent rts_bpp driver) with kernel 3.7.10. This driver dosen't work for kernels 3.8.0 and higher.

lspci -v

06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
        Subsystem: Realtek Semiconductor Co., Ltd. Device 5289
        Flags: bus master, fast devsel, latency 0, IRQ 16
        Memory at f7800000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
        Kernel driver in use: rts_bpp
        Kernel modules: rts_bpp

This is broken driven rtsx_pci form kernel 3.10.0

06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
        Subsystem: Realtek Semiconductor Co., Ltd. Device 5289
        Flags: bus master, fast devsel, latency 0, IRQ 55
        Memory at f7800000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
        Kernel driver in use: rtsx_pci
        Kernel modules: rtsx_pci
Comment 15 Richie Rich 2013-08-18 19:59:02 UTC
This is a 4th month when my card reader doesn't work and I published a 1st post on kernel bug-list.

So far we have kernel 3.10.7 and rtsx_pci still DOESN'T work.

:(

06:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
        Subsystem: Realtek Semiconductor Co., Ltd. Device 5289
        Flags: bus master, fast devsel, latency 0, IRQ 55
        Memory at f7800000 (32-bit, non-prefetchable) [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable+ Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
        Kernel driver in use: rtsx_pci
        Kernel modules: rtsx_pci
Comment 16 Richie Rich 2013-08-21 11:45:37 UTC
I just tested a new kernel 3.10.9 - still the same :(
Comment 17 Michael Tokarev 2013-12-11 04:43:47 UTC
What exactly does not work?

Here's (parts from) my dmesg:

[ 2360.334700] rtsx_pci 0000:04:00.0: irq 44 for MSI/MSI-X
[ 2360.334720] rtsx_pci 0000:04:00.0: rtsx_pci_acquire_irq: pcr->msi_en = 1, pci->irq = 44
[28413.838229] mmc0: new high speed SD card at address 0002
[28413.855675] mmcblk0: mmc0:0002 00000 1.86 GiB 
[28413.859586]  mmcblk0: p1
[28414.894193] mmc0: card 0002 removed
[28422.718676] mmc0: new high speed SD card at address 0002
[28422.720917] mmcblk0: mmc0:0002 00000 1.86 GiB 
[28422.724798]  mmcblk0: p1

(I inserted the card 2 times in a row).

This is 3.10.0 kernel.

/dev/mmcblk0 (and ..p1) device gets created, I can use it just like
any other block device on the system.

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader [10ec:5209] (rev 01)
	Subsystem: Lenovo Device [17aa:5008]
	Flags: bus master, fast devsel, latency 0, IRQ 44
	Memory at f0e00000 (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
	Kernel driver in use: rtsx_pci


Maybe my device is different from others's?

Just a data point...

/mjt
Comment 18 Michael Tokarev 2013-12-11 04:49:30 UTC
Oh. My device is indeed different: RTS5209 vs 5289.

Please retitle the bug.  rtsx_pci does work - with rts5209 for sure.  It apparently has issues with 5289 (drivers/mfd/rtl8411.c).

/mjt
Comment 19 Nazar Mokrynskyi 2014-01-22 00:20:49 UTC
Kernel 3.13, laptop Clevo P150SM:
05:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5289 (rev 01)
	Subsystem: CLEVO/KAPOK Computer Device 5106
	Kernel driver in use: rtsx_pci

Card reader doesn't work.
Ubuntu 13.10
Comment 20 Nazar Mokrynskyi 2014-03-31 20:20:32 UTC
Still doesn't work on Ubuntu 14.04 with kernel 3.14
Comment 21 Henry Yei 2014-06-16 23:20:57 UTC
Realtek 5249 SD Card reader not working on Ubuntu 14.04, Kernel 3.13

07:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5249 (rev 01)
	Subsystem: Dell Device 060d
	Flags: fast devsel, IRQ 19
	Memory at f7800000 (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: [148] Device Serial Number 00-00-00-01-00-4c-e0-00
	Capabilities: [158] Latency Tolerance Reporting
	Capabilities: [160] L1 PM Substates
Comment 22 demonust 2014-07-14 11:53:40 UTC
I have same bug on my laptop HP 250.
Comment 23 J.Schlick 2014-07-21 19:42:15 UTC
I have the same bug with my new Schenker laptop which has obviously a 5287  :-(

04:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)
        Subsystem: CLEVO/KAPOK Computer Device 3501
        Flags: fast devsel, IRQ 16
        Memory at f7815000 (32-bit, non-prefetchable) [size=4K]
        Expansion ROM at f7800000 [disabled] [size=64K]
        Capabilities: [40] Power Management version 3
        Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
        Capabilities: [70] Express Endpoint, MSI 00
        Capabilities: [b0] MSI-X: Enable- Count=1 Masked-
        Capabilities: [d0] Vital Product Data
        Capabilities: [100] Advanced Error Reporting
        Capabilities: [140] Virtual Channel
        Capabilities: [160] Device Serial Number 00-00-00-00-00-00-00-00
        Capabilities: [170] Latency Tolerance Reporting
        Capabilities: [178] L1 PM Substates
        Kernel modules: rtsx_pci
Comment 24 Richie Rich 2015-01-18 07:45:14 UTC
Hi,

It is nearly 2 years from 2013-04-24 09:14:29 UTC - and is still not fixed.
I use 3.17.7 abd 3.18.2 kernels.

Is it possible that this bug will be fixed in nearly future?

In Comment 3 from 2013-05-16 06:16:40 UTC - there is a patch for rts_bpp, so it can works with kernels >3.9, so maybe will be easier put this driver into kernel - so we can use our devices with kernel 3.9?
Comment 25 Nazar Mokrynskyi 2015-01-18 08:35:58 UTC
Moreover, it works with stock Ubuntu kernels, even latest 3.18 in Ubuntu 15.04.
I have no idea why it is not fixed yet.
Comment 26 Nils Philippsen 2015-02-16 11:01:50 UTC
Hi,

I had the same problem on a Lenovo T540p. I found this in dmesg when the module was loaded:

[    0.999903] rtsx_pci 0000:03:00.0: irq 26 for MSI/MSI-X
[    0.999935] rtsx_pci 0000:03:00.0: rtsx_pci_acquire_irq: pcr->msi_en = 1, pci->irq = 26
[    1.100179] rtsx_pci: probe of 0000:03:00.0 failed with error -110

This error doesn't show up, and I could access an SD card after I disabled the msi_en module parameter, either on the modprobe command line or by adding a file /etc/modprobe.d/rtsx_pci.conf with these contents:

options rtsx_pci msi_en=0

This is the PCI information for the device:

03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5227 PCI Express Card Reader (rev 01)
	Subsystem: Lenovo Device 2210
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 16
	Region 0: Memory at f1500000 (32-bit, non-prefetchable) [size=4K]
	Capabilities: [40] Power Management version 3
		Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=375mA PME(D0-,D1+,D2+,D3hot+,D3cold+)
		Status: D0 NoSoftRst- PME-Enable+ DSel=0 DScale=0 PME-
	Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
		Address: 00000000feeff00c  Data: 4148
	Capabilities: [70] Express (v2) Endpoint, MSI 00
		DevCap:	MaxPayload 128 bytes, PhantFunc 0, Latency L0s unlimited, L1 unlimited
			ExtTag- AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
		DevCtl:	Report errors: Correctable- Non-Fatal- Fatal- Unsupported-
			RlxdOrd+ ExtTag- PhantFunc- AuxPwr- NoSnoop-
			MaxPayload 128 bytes, MaxReadReq 512 bytes
		DevSta:	CorrErr+ UncorrErr- FatalErr- UnsuppReq+ AuxPwr+ TransPend-
		LnkCap:	Port #0, Speed 2.5GT/s, Width x1, ASPM L0s L1, Exit Latency L0s unlimited, L1 <64us
			ClockPM+ Surprise- LLActRep- BwNot- ASPMOptComp+
		LnkCtl:	ASPM L1 Enabled; RCB 64 bytes Disabled- CommClk-
			ExtSynch- ClockPM+ AutWidDis- BWInt- AutBWInt-
		LnkSta:	Speed 2.5GT/s, Width x1, TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
		DevCap2: Completion Timeout: Not Supported, TimeoutDis+, LTR+, OBFF Via message/WAKE#
		DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR+, OBFF Disabled
		LnkCtl2: Target Link Speed: 2.5GT/s, EnterCompliance- SpeedDis-
			 Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
			 Compliance De-emphasis: -6dB
		LnkSta2: Current De-emphasis Level: -3.5dB, EqualizationComplete-, EqualizationPhase1-
			 EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
	Capabilities: [100 v2] Advanced Error Reporting
		UESta:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UEMsk:	DLP- SDES- TLP- FCP- CmpltTO- CmpltAbrt- UnxCmplt- RxOF- MalfTLP- ECRC- UnsupReq- ACSViol-
		UESvrt:	DLP+ SDES+ TLP- FCP+ CmpltTO- CmpltAbrt- UnxCmplt- RxOF+ MalfTLP+ ECRC- UnsupReq- ACSViol-
		CESta:	RxErr+ BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		CEMsk:	RxErr- BadTLP- BadDLLP- Rollover- Timeout- NonFatalErr+
		AERCap:	First Error Pointer: 00, GenCap+ CGenEn- ChkCap+ ChkEn-
	Capabilities: [140 v1] Device Serial Number 00-00-00-01-00-4c-e0-00
	Capabilities: [150 v1] Latency Tolerance Reporting
		Max snoop latency: 3145728ns
		Max no snoop latency: 3145728ns
	Capabilities: [158 v1] L1 PM Substates
		L1SubCap: PCI-PM_L1.2+ PCI-PM_L1.1+ ASPM_L1.2+ ASPM_L1.1+ L1_PM_Substates+
			  PortCommonModeRestoreTime=60us PortTPowerOnTime=60us
	Kernel driver in use: rtsx_pci
	Kernel modules: rtsx_pci
Comment 27 Thomas Coquelin 2015-04-19 14:33:10 UTC
I was facing the same issue.
After reading some related cases, I found that MMC_REALTEK_PCI also needs to be enabled.
This fixed my issue.
Comment 28 alikasundara 2016-08-07 16:30:18 UTC
@Thomas Coquelin
thanks, this worked for me. I had to manually `modprobe rtsx_pci_sdmmc` though.
Comment 29 Marc Cousin 2016-08-16 09:07:23 UTC
Hi, Clevo with 5287 too here.

As far as I'm concerned, it works with some cards and not others. I don't have so many of them to test, but it seems faster (UHS-1…) cards are the problem. To sum up, here is the detail (this occurs on 3 identical machines, one archlinux, one  gentoo, one fedora).

SDHC, unspecified class (old), 2GB (Agfa Photo): OK
SDHC, class 4 15MB/s, 8GB (Sandisk Ultra): OK
SDHC, class 10, 32GB (Transcend): OK
SDHC, class 2, 16GB (Lexar): OK

SDHC, Bus: UHS-1, U1 class 95MB/s (Sandisk Extreme Pro): Fails
SDHC, Bus: UHS-1, U3 class 95MB/s (Sandisk Extreme Pro): Fails

Here are dmesg (4.7.0 kernel) when it succeeds:

[ 3798.395279] mmc0: new high speed SDHC card at address aaaa
[ 3798.396049] mmcblk0: mmc0:aaaa SD08G 7.40 GiB 
[ 3798.399174]  mmcblk0: p1

And when it fails (error varies, these are two consecutive tries):

First try:
[ 3834.065091] mmc0: cannot verify signal voltage switch
[ 3842.750196] mmc0: tuning execution failed: -22
[ 3842.750208] mmc0: error -22 whilst initialising SD card

Second try:
[ 3954.673648] mmc0: cannot verify signal voltage switch
[ 3961.595554] mmc0: new ultra high speed SDR104 SDHC card at address e624
[ 3961.597031] mmcblk0: mmc0:e624 SU16G 14.8 GiB 
[ 3961.805177] mmcblk0: error -110 sending status command, retrying
[ 3961.905109] mmcblk0: error -110 sending status command, retrying
[ 3962.005173] mmcblk0: error -110 sending status command, aborting
[ 3962.276928] mmc0: cannot verify signal voltage switch
[ 3970.082123] mmc0: tuning execution failed: -22
[ 3970.082142] mmc0: tried to reset card, got error -22
[ 3970.082154] blk_update_request: I/O error, dev mmcblk0, sector 0
[ 3970.082163] Buffer I/O error on dev mmcblk0, logical block 0, async page read
[ 3980.182363] mmcblk0: timed out sending r/w cmd command, card status 0x400900
[ 3980.182375] mmcblk0: command error, retrying timeout
[ 3990.382184] mmcblk0: error -110 sending status command, retrying
[ 3990.482250] mmcblk0: error -110 sending status command, retrying
[ 3990.582203] mmcblk0: error -110 sending status command, aborting
[ 3990.582226] blk_update_request: I/O error, dev mmcblk0, sector 0
[ 3990.582236] Buffer I/O error on dev mmcblk0, logical block 0, async page read
[ 3990.582276] ldm_validate_partition_table(): Disk read failed.

rts_bpp works with these cards though.

Please tell me if I can add some information.
Comment 30 Marc Cousin 2016-11-17 12:51:00 UTC
Hi,

Is there something I could provide to have UHS cards working ? I continued tests, this SD card readers fails with all UHS-1 cards.

This is where it dies:
<pre>
	if (signal_voltage == MMC_SIGNAL_VOLTAGE_330)
		return __mmc_set_signal_voltage(host, signal_voltage);

	/*
	 * If we cannot switch voltages, return failure so the caller
	 * can continue without UHS mode
	 */
	if (!host->ops->start_signal_voltage_switch)
		return -EPERM;
	if (!host->ops->card_busy)
		pr_warn("%s: cannot verify signal voltage switch\n",
			mmc_hostname(host));
</pre>
Comment 31 Adarion from userland 2020-09-09 09:36:47 UTC
>  I found that MMC_REALTEK_PCI also needs to be enabled.
> This fixed my issue.

Thanks a bunch! That also worked for me on my HP/Compaq 635.
lcpsci still says "unassigned class" but after several years that thing finally works.

This should be noted in the kernel config's help function! (Or automatically selected?)
Comment 32 Bjorn Helgaas 2022-11-03 16:24:52 UTC
It looks like this issue should be closed?

Does anybody know the commit that fixed it?

Note You need to log in before you can comment on or make changes to this bug.