Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 508898 - kernel >=3.13 - 'mmc0: error -22' on realtek pcie card reader (rtsx_pci)
Summary: kernel >=3.13 - 'mmc0: error -22' on realtek pcie card reader (rtsx_pci)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-27 19:01 UTC by disperato
Modified: 2014-05-20 17:38 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
debug messages for 3.14.1 (rtsx_pci) (debug_messages_rtsx_pci_sdmmc_kernel_3.13_and_upper,131.43 KB, text/plain)
2014-04-27 19:04 UTC, disperato
Details
normal boot messages for 3.12.12 (dmesg_3.12.12,74.22 KB, text/plain)
2014-04-27 19:05 UTC, disperato
Details
config for 3.12.12 (config-3.12.12,87.60 KB, text/plain)
2014-04-27 19:05 UTC, disperato
Details
config for 3.14.1 (config-3.14.1,89.71 KB, text/plain)
2014-04-27 19:06 UTC, disperato
Details

Note You need to log in before you can comment on or make changes to this bug.
Description disperato 2014-04-27 19:01:07 UTC
inserting an mmc card  sized >=1GB while running kernel 3.13.5 or 3.14.1:
 kernel: mmc0: error -22 whilst initialising MMC card
 kernel: mmc0: error -22 whilst initialising MMC card
 kernel: mmc0: error -22 whilst initialising MMC card

but detailed messages logged with MMC Debug on, refer of error -110 before error -22 occurs

tried kernels from:
 gentoo-sources-3.12.12  in use from months now: ok with 64MB
 gentoo-sources-3.13.5  KO
 gentoo-sources-3.14.1  KO

Attached are detailed .config for 3.12.12 and 3.14.1 and the relevant part from /var/log/messages (1683 lines of retries) they are generated with MMC Debugging turned on in kernel config;
Attached is a normal /var/log/messages from boot by kernel 3.12.12, in order to let you know the underlying hardware

Reproducible: Always

Steps to Reproduce:
1. run a kernel from >=gentoo-sources-3.13 on a laptop with realtek card reader onboard (pcie, not usb)
2. insert an sd card >=1GB  (13 pins, while 7 pins cards sized 64MB work); in kernel 3.12.12 all cards work
3. driver affected: rtsx_pci
Actual Results:  
 kernel: mmc0: error -22 whilst initialising MMC card
 kernel: mmc0: error -22 whilst initialising MMC card
 kernel: mmc0: error -22 whilst initialising MMC card 

Expected Results:  
 kernel: mmc0: new MMC card at address 0001
 kernel: mmcblk0: mmc0:0001 000000 61.2 MiB
 kernel: mmcblk0: p1


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

from lshw:
lshw |grep rtsx  -B 10
           *-generic      
                description: Unassigned class
                product: Realtek Semiconductor Co., Ltd.
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:05:00.0
                version: 01
                width: 32 bitslshw |grep rtsx  -B 10
           *-generic      
                description: Unassigned class
                product: Realtek Semiconductor Co., Ltd.
                vendor: Realtek Semiconductor Co., Ltd.
                physical id: 0
                bus info: pci@0000:05:00.0
                version: 01
                width: 32 bits
                clock: 33MHz
                capabilities: pm msi pciexpress msix vpd bus_master cap_list
                configuration: driver=rtsx_pci latency=0

                clock: 33MHz
                capabilities: pm msi pciexpress msix vpd bus_master cap_list
                configuration: driver=rtsx_pci latency=0

driver affected: rtsx_pci

Attached files:
.config for 3.12.12: config-3.12.12
.config for 3.14.1: config-3.14.1
debug messages with 3.14.1: debug_messages_rtsx_pci_sdmmc_kernel_3.13_and_upper
normal boot with 3.12.12:  dmesg_3.12.12
Comment 1 disperato 2014-04-27 19:04:11 UTC
Created attachment 375880 [details]
debug messages for 3.14.1 (rtsx_pci)
Comment 2 disperato 2014-04-27 19:05:00 UTC
Created attachment 375882 [details]
normal boot messages for 3.12.12
Comment 3 disperato 2014-04-27 19:05:38 UTC
Created attachment 375884 [details]
config for 3.12.12
Comment 4 disperato 2014-04-27 19:06:07 UTC
Created attachment 375886 [details]
config for 3.14.1
Comment 5 disperato 2014-04-27 19:07:21 UTC
Portage 2.2.8-r1 (default/linux/amd64/13.0, gcc-4.8.2, glibc-2.17, 3.12.12-gentoo x86_64)
=================================================================
System uname: Linux-3.12.12-gentoo-x86_64-Intel-R-_Core-TM-_i7-4702MQ_CPU_@_2.20GHz-with-gentoo-2.2
KiB Mem:    16356512 total,  14420596 free
KiB Swap:    2418684 total,   2418684 free
Timestamp of tree: Sun, 27 Apr 2014 09:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.2
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.2.0
dev-lang/python:          2.7.5-r3, 3.3.3
dev-util/ccache:          3.1.9-r3
dev-util/cmake:           2.8.12.2
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.12.4
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.10.3, 1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.23.2
sys-devel/gcc:            4.7.3-r1, 4.8.2
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.9 (virtual/os-headers)
sys-libs/glibc:           2.17
Repositories: gentoo java science
Installed sets: @system
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=core-avx2 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.5/ext-active/ /etc/php/cgi-php5.5/ext-active/ /etc/php/cli-php5.5/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=core-avx2 -O2 -pipe"
DISTDIR="/sync/gentoo/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news noclean parallel-fetch preserve-libs protect-owned sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://156.56.247.195 http://distfiles.gentoo.org http://152.46.7.80/pub/Linux/distributions/gentoo http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,now -Wl,--hash-style=gnu"
MAKEOPTS="-j9"
PKGDIR="/sync/gentoo/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync_excludes --timeout=23"
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"
PORTAGE_TMPDIR="/hugetmp/portage"
PORTDIR="/sync/portage"
PORTDIR_OVERLAY="/var/lib/layman/java /var/lib/layman/science"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac aalib abm acl acpi aes alsa amd64 apache2 apm aspell audiofile avi avx avx2 bash-completion bcmath berkdb bitmap-fonts bmi bmi2 bmp bzip2 bzip2cairo cairo caps cdparanoia cdr cli clibpdf consolekit cracklib crypt cscope ctype cuda cups cx16 cxx dbus dbx diet dillo dio directfb divx4linux dri dv dvb dvd dvdr dvdread emul-linux-86 encode examples exif expat f16c f90 f95 fam fbcon ffmpeg fftw flac flash fma foomaticdb fortran fortran90 fortran95 fsgsbase g95 gcj gd gdbm geforce gfortran ggi gif ginac glut glx gmp gnutls gphoto2 gpl gpm gsl gstreamer gtk gtkhtml guile hal handbook hardened hardenedphp hdf5 hdtemp headphones html2ps iconv ieee1394 imlib inifile innodb ipv6 itls jabber jack jikes jpeg junit ladcca lcms ldap libcaca libnotify libwww lm_sensors lzcnt m17n-lib mad man mhash mikmod mime ming mjpeg mmx mng modules motif movbe mp3 mpeg mplayer msession multilib mysql mysqli ncurses netcdf nforce nls no-fma4 no-lwp no-tbm no-xop nptl nsplugin nvidia nvidia-glx objc ofx ogg openal opengl openmp osc pam pango pclmul pcre pdflib perl php plotutils png policykit popcnt portaudio ppds pthreads python qdbm qt qt3support qt4 quicktime radius rdrnd readline ruby sahf samba scanner sdl session sharedext shorten simplexml slp smp smu sndfile speex spell spl sse sse2 sse3 sse4_1 sse4_2 ssl ssse3 svg szip tcltk tcp tcpd tetex theora threads tidy tiff tokenizer truetype truetype-fonts type1-fonts udev unicode usb vcd videos vim-syntax vorbis wddx wifi win32codecs wireless wmf xfce xfce4 xft xine xml xmlrpc xmms xosd xpm xscreensaver xsl xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="hda-intel" APACHE2_MODULES="access auth auth_dbm auth_anon authn_core auth_digest authz_core authz_host alias file-cache echo charset-lite cache disk-cache mem-cache ext-filter case_filter case-filter-in deflate filter mime-magic cern-meta expires headers usertrack unique_id proxy proxy-connect proxy-ftp proxy-http info include cgi dav dav-fs vhost-alias speling rewrite log_config logio env setenvif mime status autoindex asis negotiation dir imap actions unixd userdir so socache_shmcb" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" SANE_BACKENDS="epson epson2 canon canon630u canon_dr canon_pp" USERLAND="GNU" VIDEO_CARDS="intel nvidia i915 vesa modesetting" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, USE_PYTHON
Comment 6 disperato 2014-05-20 17:38:56 UTC
found the right patch (hence the problem existed, not only for me), with explanation,  here:

http://www.gossamer-threads.com/lists/linux/kernel/1893821

applied it to drivers/mmc/host/rtsx_pci_sdmmc.c

slightly modified as follows, for kernel 3.14.4 (gentoo-sources-3.14.4):

----------------------------------------------------------------------------------------------

--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -246,6 +246,9 @@
        case MMC_RSP_R1:
                rsp_type = SD_RSP_TYPE_R1;
                break;
+       case MMC_RSP_R1 & ~MMC_RSP_CRC:
+               rsp_type = SD_RSP_TYPE_R1 | SD_NO_CHECK_CRC7;
+               break;
        case MMC_RSP_R1B:
                rsp_type = SD_RSP_TYPE_R1b;
                break;

----------------------------------------------------------------------------------------------

Tested it and works well! Without the patch it was not working, just like 3.14.3, 3.13.x, etc.
Those lines should be added to the kernel source, or if it's gentoo that doesn't update that part, it should be applied to our gentoo-sources.