Bug 854762

Summary: rts_bpp: Realtek 5289 SD card reader does not work
Product: [Fedora] Fedora Reporter: Mark Harfouche <mark.harfouche>
Component: kernelAssignee: Kernel Maintainer List <kernel-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: amedeo, cmpahar, gansalmon, itamar, jonathan, jreznik, kernel-maint, madhu.chinakonda, michael.mzik, thunderbirdtr, vylaern
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-27 11:07:33 EST Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Mark Harfouche 2012-09-05 14:53:43 EDT
Description of problem:
I have a laptop with a Realtek 5289 card reader and the kernel module is not installed

Version-Release number of selected component (if applicable):
Linux aaa-bbbb 3.5.3-1.fc17.x86_64 #1 SMP Wed Aug 29 18:46:34 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

How reproducible:
Any fresh install (and possibly kernel update)

Steps to Reproduce:
1. Get a laptop with a Realtek 5289 card reader (HP Envy 4-1030us for example)
2. Install Fedora (also update to the newest version if you want) and reboot
3. Plug in an SD card
Actual results:
Nothing happens

Expected results:
Should detect SD card and automount

Additional info:
Documented by Gentoo here: http://forums.gentoo.org/viewtopic-t-922794-start-0.html

And by Ubuntu community here: https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/971876

Steps to solve on Fedora:

  sudo yum install dkms

Download the package from the launchpad link
  su -
  ar x rts-bpp-dkms_1.1_all.deb; tar xf data.tar.gz
  cd usr/src/rts_bpp-1.1/src
  make install
  echo 'DRIVERS=="rts_bpp", ENV{ID_DRIVE_FLASH_SD}="1"' | sudo tee -a /lib/udev/rules.d/81-udisks-realtek.rules

the last line is to enable automount :D
Comment 1 Mark Harfouche 2012-09-05 14:57:42 EDT
Also need to run
depmod -a

after you make install
Comment 2 Josh Boyer 2012-09-05 20:42:54 EDT
We don't ship DKMS modules, or out-of-tree modules at all.  When this gets into the mainline kernel, we'll enable it.
Comment 3 Richie Rich 2012-10-08 15:51:59 EDT
Unfortunatly for me, rts_bpp is not working with a new kernel 3.6.0 and 3.6.1, sollution provide by Mark Harfouche works with kernel 3.5.4
Comment 4 Onuralp SEZER 2012-10-16 05:32:12 EDT
It's works on Fedora 18 with kernel 3.6.1-1.fc18.x86_64 

I used source and my commands is 
wget https://bugs.launchpad.net/bugs/971876/+attachment/2991730/+files/rts_bpp.tar.bz2
tar jxf rts_bpp.tar.bz2
cd rts_bpp
su -c 'make install ; modprobe rts_bpp ; depmod -a' 

and done...
Comment 5 Mark Harfouche 2012-12-23 13:58:44 EST
your solution works with F17 kernel 3.6.10-2
Comment 6 Onuralp SEZER 2012-12-23 14:02:49 EST
You are welcome
Comment 7 Christos Bacharakis 2013-02-05 13:36:37 EST
Unfotunetely it doesn't work with a 3.7.2-204.fc18.x86_64 kernel :(
Comment 8 Mark Harfouche 2013-02-11 00:27:00 EST
Sorry for a delayed reply Christos.

I wanted to report when I had the chance to test it myself.

Works with me, with kernel 3.7.6-201.fc18.x86_64

make sure your kernel version (uname -a) is the same as the dkms version you installed.

sudo yum update

and reboot.
Comment 9 Christos Bacharakis 2013-02-11 03:27:10 EST
yes, I faced some issues regarding the update process and the the version of the kernel and the dkms but i finally made it.

Works smoothly, thanks :)
Comment 10 amedeo 2013-03-30 05:25:56 EDT
Same issue on Asus K55VD, but unfortunatly when I tried to make rts_bpp from source, seems that it's incompatible to kernel 3.8.x:

$ wget https://bugs.launchpad.net/bugs/971876/+attachment/2991730/+files/rts_bpp.tar.bz2
$ tar -xjvf rts_bpp.tar.bz2
$ cd rts_bpp
$ make 
cp -f ./define.release ./define.h
make -C /lib/modules/3.8.4-202.fc18.x86_64/build/ SUBDIRS=/usr/local/src/rts_bpp modules
make[1]: Entering directory `/usr/src/kernels/3.8.4-202.fc18.x86_64'
  CC [M]  /usr/local/src/rts_bpp/rtsx.o
/usr/local/src/rts_bpp/rtsx.c:893:22: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_probe’
/usr/local/src/rts_bpp/rtsx.c:1048:23: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘rtsx_remove’
/usr/local/src/rts_bpp/rtsx.c:1073:11: error: ‘rtsx_probe’ undeclared here (not in a function)
/usr/local/src/rts_bpp/rtsx.c:1074:2: error: implicit declaration of function ‘__devexit_p’ [-Werror=implicit-function-declaration]
/usr/local/src/rts_bpp/rtsx.c:1074:24: error: ‘rtsx_remove’ undeclared here (not in a function)
/usr/local/src/rts_bpp/rtsx.c:255:34: warning: ‘rtsx_host_template’ defined but not used [-Wunused-variable]
/usr/local/src/rts_bpp/rtsx.c:450:12: warning: ‘rtsx_control_thread’ defined but not used [-Wunused-function]
/usr/local/src/rts_bpp/rtsx.c:559:12: warning: ‘rtsx_polling_thread’ defined but not used [-Wunused-function]
/usr/local/src/rts_bpp/rtsx.c:715:13: warning: ‘quiesce_and_remove_host’ defined but not used [-Wunused-function]
/usr/local/src/rts_bpp/rtsx.c:751:13: warning: ‘release_everything’ defined but not used [-Wunused-function]
/usr/local/src/rts_bpp/rtsx.c:761:12: warning: ‘rtsx_scan_thread’ defined but not used [-Wunused-function]
/usr/local/src/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]: *** [/usr/local/src/rts_bpp/rtsx.o] Error 1
make[1]: *** [_module_/usr/local/src/rts_bpp] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.8.4-202.fc18.x86_64'
make: *** [default] Error 2
Comment 11 Mark Harfouche 2013-03-30 12:41:16 EDT
Comment 12 Mark Harfouche 2013-04-04 16:59:24 EDT
This seems to be associated with new changes in kernel 3.8 

You can try adding the following lines in rtxc.c after the #include statements:

#ifndef __devinit
#define __devinit
#ifndef __devexit
#define __devexit

// I'm not too sure about this one
// uncomment the one you want to try
#ifndef __devexit_p
//#define __devexit_p(x) x
//#define __devexit_p(x) NULL

I already have it installed and it seems like it is still functional, so you'll want to try and see what works. I'm no kernel developer so thsi is the best answer I can give.
Comment 13 amedeo 2013-04-04 18:20:19 EDT
I tried, but without luck, to clarify I've tried either two options  

#define __devexit_p(x) x


#define __devexit_p(x) NULL

and I'm able to compile, install and load module, but until now, this seems won't work!

This is dmesg message when I loaded module:

[ 1328.331621] Initializing Realtek PCIE storage driver...

and this is the dmesg message when I inserted the SD card:

[ 1351.332620] mmc0: error -110 whilst initialising SD card
[ 1352.577725] mmc0: error -110 whilst initialising SD card
[ 1353.822831] mmc0: error -110 whilst initialising SD card
Comment 14 Mark Harfouche 2013-04-04 18:50:53 EDT

Well according to the launchpad bug report, the realtek card works out of the box in Ubuntu 13.04, so hopefully Fedora will follow.

As a temporary fix, maybe try booting up in an earlier version of the kernel and compiling again and installing (removing the "fixes" that I recommended before).

I'm running 3.8.5-201 in F18 and my the drivers I compiled earlier still work :S.

Comment 15 Richie Rich 2013-04-24 05:29:28 EDT
I have the same problem,rtsx_pci doesn't work and can't compile rts_bpp with a kernel > 3.8

Bug 57061 - rtsx_pci doesn't work
Comment 16 Mark Harfouche 2013-06-02 21:43:35 EDT
So, I decided to revisit this:

Can anyone with this not working please try the following (I don't feel like possibly losing my SD card reader because this fix might not work).

Following what is said

You can add the following lines to rtsx.c

Anywhere after the lines starting with #include

#ifndef __devinit
#define __devinit

#ifndef __devexit
#define __devexit

#ifndef __devexit_p
#define __devexit_p(x) (x)

then proceed to trying to make the module and installing as per the instructions above.

Let me know if it works.
Comment 17 Mark Harfouche 2013-06-08 18:26:51 EDT
I installed F19 today, and it seems that the SD card works out of the box.

I think this issue should be closed when F18 becomes obsolete.
Comment 18 Michael 2013-09-15 15:25:51 EDT
I recently upgraded to F19 (using fedup), and the card reader Realtek 5289 is still not working:

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

I never tried to compile/install the rts_bpp before so there can not be any conflicting modules present, or the like..
Comment 19 Mark Harfouche 2013-09-16 00:57:05 EDT
From what I understand, FedUp doesn't necessarily install the new packages that come with F19. Rather it simply updates the packages you already have. I could be wrong though. 

If you have the patience, it might be worth it to simply pop in an F19 live CD and see if it works.
Comment 20 Mark Harfouche 2013-09-16 00:58:10 EDT
For what it is worth, I still have

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

even though my SD card reader seems to be working fine.
Comment 21 Michael 2013-09-16 06:24:27 EDT
I tried the F19 Live CD: I saw that the module 'rtsx_pci_sdmmc' was loaded, however a SD-card was not mounted when plugged in
Comment 22 Michael 2013-09-16 06:37:21 EDT
On my current work system (3.10.11-200.fc19.x86_64) I saw that the module 'rtsx_pci_sdmmc' was loaded, SD-card wont (auto) mount or at least detected.

Strangly that after I installed 'kmod-staging' a SD-card will automount (even after uninstalling kmod-staging).

Can anyone eligthen me what may have caused this?
Comment 23 Mark Harfouche 2013-09-16 09:38:47 EDT
Well it seems like you are right that rtsx_pci_sdmmc is the right module to be loaded. Seems like Realtek open sourced the driver therefore enabling it to be included in the kernel (I am guessing that it is ).


If you could reproduce the bug, I would file it under a different bug report.
Comment 24 Justin M. Forbes 2013-10-18 17:03:12 EDT
*********** MASS BUG UPDATE **************

We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  Due to this, we are doing a mass bug update across all of the Fedora 18 kernel bugs.

Fedora 18 has now been rebased to 3.11.4-101.fc18.  Please test this kernel update (or newer) and let us know if you issue has been resolved or if it is still present with the newer kernel.

If you have moved on to Fedora 19, and are still experiencing this issue, please change the version to Fedora 19.

If you experience different issues, please open a new bug report for those.
Comment 25 Onuralp SEZER 2013-10-18 17:11:30 EDT
I'm using fedora 20 and my kernel is ; 

Kernel :  3.11.5-302.fc20

I don't have any problem with that or driver issue or stuck on using and everything works perfectly. 

lsmod results also ; 

memstick               15993  1 rtsx_pci_ms
mmc_core              112289  1 rtsx_pci_sdmmc
rtsx_pci               38998  2 rtsx_pci_ms,rtsx_pci_sdmmc

Not a single problem with SD-Card reader or driver issue 

Thank you
Comment 26 Justin M. Forbes 2013-11-27 11:07:33 EST
*********** MASS BUG UPDATE **************

We apologize for the inconvenience.  There is a large number of bugs to go through and several of them have gone stale.  

It has been over a month since we asked you to test the 3.11 kernel updates and let us know if your issue has been resolved or is still a problem. When this happened, the bug was set to needinfo.  Because the needinfo is still set, we assume either this is no longer a problem, or you cannot provide additional information to help us resolve the issue.  As a result we are closing with insufficient data. If this is still a problem, we apologize, feel free to reopen the bug and provide more information so that we can work towards a resolution

If you experience different issues, please open a new bug report for those.