Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Realtek RTS5209 PCI-E SD Card Reader - Driver problems
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 739

PostPosted: Wed Jan 24, 2018 12:55 pm    Post subject: Realtek RTS5209 PCI-E SD Card Reader - Driver problems Reply with quote

In my notebook i have a SD Card Slot.
If i insert a SD Card, nothing comes into syslog.
I think i need the right driver for it.
lspci shows me this:
Code:
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)

I download from the Realtek homepage the driver
http://www.realtek.com/Downloads/downloadsView.aspx?Langid=1&PNid=15&PFid=25&Level=4&Conn=3&DownTypeID=3&GetDown=false
> PCIE RTS5209 card reader driver for Linux
> http://12244.wpc.azureedge.net/8012244/drivers/rtdrivers/pc/crc/0001-rts_pstor.tar.bz2
If i run "make", than i see this on my screen:
Code:
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/4.9.72-gentoo/build/ SUBDIRS=/tmp/rts_pstor modules
make[1]: Verzeichnis „/usr/src/linux-4.9.72-gentoo“ wird betreten
make[1]: Warnung: Datei „.vmlinux.cmd“ hat hat in der Zukunft liegende Änderungszeit 2370
make[2]: Warnung: Datei „include/config/auto.conf“ hat hat in der Zukunft liegende Änderungszeit 2345
  CC [M]  /tmp/rts_pstor/rtsx.o
/tmp/rts_pstor/rtsx.c:275:2: Fehler: unbekanntes Feld »proc_info« in Initialisierung angegeben
  .proc_info =   proc_info,
  ^
/tmp/rts_pstor/rtsx.c:275:17: Fehler: Initialisierung von inkompatiblem Zeigertyp [-Werror=incompatible-pointer-types]
  .proc_info =   proc_info,
                 ^~~~~~~~~
/tmp/rts_pstor/rtsx.c:275:17: Anmerkung: (nahe der Initialisierung für »rtsx_host_template.proc_dir«)
In file included from ./include/linux/printk.h:6:0,
                 from ./include/linux/kernel.h:13,
                 from ./include/linux/sched.h:17,
                 from ./include/linux/blkdev.h:4,
                 from /tmp/rts_pstor/rtsx.c:23:
/tmp/rts_pstor/rtsx.c: In Funktion »rtsx_control_thread«:
./include/linux/kern_levels.h:4:18: Warnung: Format »%d« erwartet Argumenttyp »int«, aber Argument 3 hat Typ »u64 {aka long long unsigned int}« [-Wformat=]
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
./include/linux/kern_levels.h:10:18: Anmerkung: bei Substitution des Makros »KERN_SOH«
 #define KERN_ERR KERN_SOH "3" /* error conditions */
                  ^~~~~~~~
/tmp/rts_pstor/rtsx.c:530:11: Anmerkung: bei Substitution des Makros »KERN_ERR«
    printk(KERN_ERR "Bad target number (%d:%d)\n",
           ^~~~~~~~
./include/linux/kern_levels.h:4:18: Warnung: Format »%d« erwartet Argumenttyp »int«, aber Argument 3 hat Typ »u64 {aka long long unsigned int}« [-Wformat=]
 #define KERN_SOH "\001"  /* ASCII Start Of Header */
                  ^
./include/linux/kern_levels.h:10:18: Anmerkung: bei Substitution des Makros »KERN_SOH«
 #define KERN_ERR KERN_SOH "3" /* error conditions */
                  ^~~~~~~~
/tmp/rts_pstor/rtsx.c:536:11: Anmerkung: bei Substitution des Makros »KERN_ERR«
    printk(KERN_ERR "Bad LUN (%d:%d)\n",
           ^~~~~~~~
/tmp/rts_pstor/rtsx.c: Auf höchster Ebene:
/tmp/rts_pstor/rtsx.c:916:22: Fehler: expected »=«, »,«, »;«, »asm« or »__attribute__« before »rtsx_probe«
 static int __devinit rtsx_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
                      ^~~~~~~~~~
/tmp/rts_pstor/rtsx.c:1080:23: Fehler: expected »=«, »,«, »;«, »asm« or »__attribute__« before »rtsx_remove«
 static void __devexit rtsx_remove(struct pci_dev *pci)
                       ^~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:1106:11: Fehler: »rtsx_probe« ist hier nicht deklariert (nicht in einer Funktion)
  .probe = rtsx_probe,
           ^~~~~~~~~~
/tmp/rts_pstor/rtsx.c:1107:12: Fehler: Implizite Deklaration der Funktion »__devexit_p« [-Werror=implicit-function-declaration]
  .remove = __devexit_p(rtsx_remove),
            ^~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:1107:24: Fehler: »rtsx_remove« ist hier nicht deklariert (nicht in einer Funktion)
  .remove = __devexit_p(rtsx_remove),
                        ^~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:816:13: Warnung: »rtsx_init_options« defined but not used [-Wunused-function]
 static void rtsx_init_options(struct rtsx_chip *chip)
             ^~~~~~~~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:790:12: Warnung: »rtsx_scan_thread« defined but not used [-Wunused-function]
 static int rtsx_scan_thread(void * __dev)
            ^~~~~~~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:780:13: Warnung: »release_everything« defined but not used [-Wunused-function]
 static void release_everything(struct rtsx_dev *dev)
             ^~~~~~~~~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:745:13: Warnung: »quiesce_and_remove_host« defined but not used [-Wunused-function]
 static void quiesce_and_remove_host(struct rtsx_dev *dev)
             ^~~~~~~~~~~~~~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:596:12: Warnung: »rtsx_polling_thread« defined but not used [-Wunused-function]
 static int rtsx_polling_thread(void * __dev)
            ^~~~~~~~~~~~~~~~~~~
/tmp/rts_pstor/rtsx.c:485:12: Warnung: »rtsx_control_thread« defined but not used [-Wunused-function]
 static int rtsx_control_thread(void * __dev)
            ^~~~~~~~~~~~~~~~~~~
cc1: Einige Warnungen werden als Fehler behandelt
make[2]: *** [scripts/Makefile.build:294: /tmp/rts_pstor/rtsx.o] Fehler 1
make[1]: *** [Makefile:1494: _module_/tmp/rts_pstor] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-4.9.72-gentoo“ wird verlassen
make: *** [Makefile:37: default] Fehler 2


Are any files missing on my machine?
Do i need any special for this driver?

If needed for helping me, here is the ouptput from emerge --info
Code:
emerge --info
Portage 2.3.13 (python 3.5.4-final-0, default/linux/amd64/17.0/desktop/plasma, gcc-6.4.0, glibc-2.25-r9, 4.9.72-gentoo x86_64)
=================================================================
System uname: Linux-4.9.72-gentoo-x86_64-Intel-R-_Core-TM-_i3-2357M_CPU_@_1.30GHz-with-gentoo-2.4.1
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Thu, 18 Jan 2018 01:00:01 +0000
Head commit of repository gentoo: 63861c0d8e631387566113508b80cfc93930ca43
sh bash 4.4_p12
ld GNU ld (Gentoo 2.29.1 p3) 2.29.1
app-shells/bash:          4.4_p12::gentoo
dev-lang/perl:            5.24.3::gentoo
dev-lang/python:          2.7.14-r1::gentoo, 3.5.4-r1::gentoo
dev-util/cmake:           3.9.6::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.4.1-r2::gentoo
sys-apps/openrc:          0.34.11::gentoo
sys-apps/sandbox:         2.10-r4::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:       1.15.1-r1::gentoo
sys-devel/binutils:       2.29.1-r1::gentoo
sys-devel/gcc:            6.4.0-r1::gentoo
sys-devel/gcc-config:     1.8-r1::gentoo
sys-devel/libtool:        2.4.6-r3::gentoo
sys-devel/make:           4.2.1::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.25-r9::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-extra-opts:

x-portage
    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=sandybridge -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=sandybridge -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync multilib-strict news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.mneisen.org/                       http://de-mirror.org/gentoo/                       http://ftp.uni-erlangen.de/pub/mirrors/gentoo"
LANG="de_DE.UTF-8"
LC_ALL="de_DE.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de de_DE"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi activities alsa amd64 berkdb bluetooth bluray branding bzip2 cairo cdda cdr cli consolekit crypt cryptsetup cups cxx dbus declarative dri dts dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif glamor gpm gtk hddtemp iconv ipv6 jpeg kde kipi kwallet lcms ldap libnotify lm_sensors mad matroska mng modules mp3 mp4 mpeg multilib ncurses nls nptl ogg opengl openmp pam pango pcre pdf phonon plasma png policykit ppds qml qt3support qt5 rar readline sdl seccomp semantic-desktop spell spice ssl startup-notification svg tcpd tiff truetype udev udf udisks unicode upower usb vorbis widgets wxwidgets x264 x265 xattr xcb xcomposite xml xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev keyboard mouse synaptics" KERNEL="linux" L10N="de" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-0" POSTGRES_TARGETS="postgres9_5" PYTHON_SINGLE_TARGET="python3_5" PYTHON_TARGETS="python2_7 python3_5" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="ruby22" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 10024
Location: almost Mile High in the USA

PostPosted: Wed Jan 24, 2018 4:59 pm    Post subject: Reply with quote

Just curious, did you try the in-kernel rtsx driver? I believe it's CONFIG_MMC_REALTEK_PCI and/or CONFIG_MFD_RTSX_PCI

The out-of-kernel driver traditionally has problems because of kernel version mismatches...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 739

PostPosted: Wed Jan 24, 2018 6:57 pm    Post subject: Reply with quote

Yes, i try the Kernel-Driver.
Code:
cat /usr/src/linux/.config |grep RTSX
CONFIG_MFD_RTSX_PCI=y
CONFIG_MFD_RTSX_USB=y

I will have build it into the Kernel, next step i will try to build it as a module.

Code:
cat /usr/src/linux/.config |grep REALTEK
# CONFIG_NET_VENDOR_REALTEK is not set
# CONFIG_REALTEK_PHY is not set
CONFIG_WLAN_VENDOR_REALTEK=y
CONFIG_SND_HDA_CODEC_REALTEK=y
CONFIG_USB_STORAGE_REALTEK=y
CONFIG_REALTEK_AUTOPM=y


Code:
CONFIG_PCI_MMCONFIG=y
# Supported MMC/SDIO adapters
# CONFIG_MMC is not set


lspci -v shows me a little bit more, there is a driver in use for the card reader.
Code:
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
        Subsystem: Lenovo RTS5209 PCI Express Card Reader
        Flags: bus master, fast devsel, latency 0, IRQ 25
        Memory at d0d00000 (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-0a-00-4b-e0-00
        Kernel driver in use: rtsx_pci


But why is it listet in lspci as "Unassigned class"?
I have tried 2 SD-Cards, i will try more. Can it be does not all SD-Cards are working?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 10024
Location: almost Mile High in the USA

PostPosted: Wed Jan 24, 2018 7:28 pm    Post subject: Reply with quote

There's a device "class" ID field in the PCI plug and play data that realtek apparently set as "unassigned" as it's nonstandard. Not a big deal that it shows up as unassigned. I think realtek should have set it as mass-storage of some kind.

It should be able to use SD, SDHC, SDXC(conditional?), and MMC cards.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 739

PostPosted: Thu Jan 25, 2018 12:14 am    Post subject: Reply with quote

Now i have it build as module and not into the kernel.
But still the same.

lsmod shows me:
Code:
lsmod
Module                  Size  Used by
iwldvm                156897  0
x86_pkg_temp_thermal     5509  0
iwlwifi               176514  1 iwldvm
rtsx_pci               29269  0
mfd_core                4051  1 rtsx_pci


The ouput from lspci is the same,
Code:
03:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. RTS5209 PCI Express Card Reader (rev 01)
        Subsystem: Lenovo RTS5209 PCI Express Card Reader
        Flags: bus master, fast devsel, latency 0, IRQ 27
        Memory at d0d00000 (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-0a-00-4b-e0-00
        Kernel driver in use: rtsx_pci
        Kernel modules: rtsx_pci


The SD-Cards they i have testet are working in other devices, so i think the SD-Cards are all OK.

But what is the problem that i can not read any SD-Card into my Lenovo x121e Notebook?!?!

Do i need any special programm to access a SD-Card?
In Syslog i see nothing if i insert a SD-Card, i think thats not normal, or is it?

Do i need any PCI-E Mass-Storage-Drivers in the Kernel?!?
Back to top
View user's profile Send private message
SarahS93
l33t
l33t


Joined: 21 Nov 2013
Posts: 739

PostPosted: Thu Jan 25, 2018 12:31 am    Post subject: Reply with quote

Dont know what was wrong, but now ... it is working. I think the SD-Card Slot is not 100% OK.
Sometimes it works by the first try and sometimes are not...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum