Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1055057 - SD card reader does not work after hibernate (kernel_module: sdhci_pci)
Summary: SD card reader does not work after hibernate (kernel_module: sdhci_pci)
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kernel
Version: 22
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Kernel Maintainer List
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1015800 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-01-18 12:50 UTC by poinck
Modified: 2016-05-08 21:15 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1015800
Environment:
Last Closed: 2015-11-23 17:13:01 UTC


Attachments (Terms of Use)
systemlog provided by journalctl (deleted)
2014-01-18 12:50 UTC, poinck
no flags Details
systemd service to reload driver after resume from hibernate (workaround) (deleted)
2015-02-01 11:27 UTC, poinck
no flags Details

Description poinck 2014-01-18 12:50:03 UTC
Created attachment 851989 [details]
systemlog provided by journalctl

Description of problem:
SD card reader does not work after resuming from hibernate; the insertion of the SD card is not detected after a suspend-to-disk/resume cycle. The kernel used is "3.12.7-300.fc20.x86_64" in Fedora 20. Reloading the module "sdhci_pci" is a workarround to use the SD card reader. After a suspend-to-RAM/resume cycle the problem does not occur. See attachment (output from journalctl).

Version-Release number of selected component (if applicable):
3.12.7-300.fc20.x86_64

How reproducible:
1. Boot computer
2. insert Sd card
   a. SD card will be detected and automounted like expected
3. remove SD card
4. Hibernate computer (suspend to disk)
5. Resume computer from hibernate
6. insert SD card
   b. SD card does not automount; no hints in journalctl (syslog)
7. reload "sdhci_pci": sudo modprobe -r sdhci_pci ; sudo modprobe sdhci_pci # maybe reloading "mmc_block" module is neccassary as well, still.
   c. SD card will be detected and automounted (even without removing and inserting the SD card)

Actual results:
Nothing happens without workarround as described above.


+++ This bug was initially created as a clone of Bug #1015800 +++

Description of problem:
After update to kernel-3.10.13-101.fc18, the insertion of the SD card is not detected after a suspend/resume cycle. The card does not get mounted. Things work fine after a fresh boot and also when running kernel-3.10.12-100.fc18
(which appears to be the most stable fedora-18 kernel to date).

Version-Release number of selected component (if applicable):
kernel-3.10.13-101.fc18

How reproducible:
See below

Steps to Reproduce:
1. Boot the computer
2. suspend to disk
3. resume
4. Insert SD card

Actual results:
Nothing happens

Expected results:
An event shows up in /var/log messages like 
mmc0: new high speed SD card at address 6f4a
The card is automounted by the gnome desktop.

Additional info:

--- Additional comment from Rutger Noot on 2013-10-10 16:07:13 EDT ---

updated kernel to 3.10.14-100.fc18.x86_64 and the bug persists

--- Additional comment from Justin M. Forbes on 2013-10-18 17:09:34 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.

--- Additional comment from Rutger Noot on 2013-10-19 07:53:01 EDT ---

The issue is still present in kernel 3.11.4-101.fc18.x86_64. 

A possible workaround is to unload and reload the appropriate kernel modules. 

modprobe -r mmc_block b43 ssb  sdhci_pci sdhci mmc_core

etc

--- Additional comment from Rutger Noot on 2013-11-14 02:32:23 EST ---

No improvement after update to kernel 3.11.7-100.fc18.x86_64

--- Additional comment from Rutger Noot on 2013-11-30 15:57:23 EST ---

Just updates to kernel-3.11.9-100.fc18.x86_64 and the bug persists

--- Additional comment from aaronsloman on 2013-11-30 17:51:14 EST ---

(In reply to Rutger Noot from comment #3)
> A possible workaround is to unload and reload the appropriate kernel modules. 
> modprobe -r mmc_block b43 ssb  sdhci_pci sdhci mmc_core
> etc

I had a variant of this bug: I leave my sd card in its slot in my laptop
Dell Latitude E5410

I found that after the first thaw after hibernate (though not after first boot) there were always messages in /var/log/messages about waiting for mmc0

They continue for about 2 minutes, and after that the sd drive becomes available and pm-hibernate works. An attempt to hibernate earlier causes the machine to freeze until the drive becomes available (as indicated in the messages file) and then hibernation starts.

This can give the impression that hibernation does not work if it is attempted less than two minutes after thaw.

> The issue is still present in kernel 3.11.4-101.fc18.x86_64. 

and in 3.11.9-100.fc18.x86_64

The suggested workaround works.

I tried doing this via a script /etc/pm/sleep.d/99-sdcard
(There's nothing else in the directory. I am not sure whether the prefix should be 99 or 00, but it works as 99.)

I am not an expert bash programmer. This is my script

#!/bin/bash

if [ "$1" == "hibernate" ] ; then

    echo "umount /sdlinux"

    umount /sdlinux

    echo "modprobe -r sdhci_pci"

    modprobe -r sdhci_pci

elif [ "$1" == "thaw" ] ; then

   echo "modprobe sdhci_pci"

   modprobe sdhci_pci

   sleep 1

   echo "mount /sdlinux"

   mount /sdlinux

fi

(I presume a 'case' format would be more compact.)

/sdlinux is where I mount my SD card.

The 'echo' commands produce trace printing in /var/log/pm-suspend.log

The first time I tried this withoug the 'sleep 1' command during thaw, and the mount failed.

This workaround also solves Bug #1034457
(Changed) Delay in accepting SDHC card (mmc0: Timeouts) interferes with hibernation

Presumably there should be a default script doing this for suspend and hibernate?

(I don't normally use 'suspend', but I had the same problem when I tried it.)

--- Additional comment from aaronsloman on 2013-11-30 18:27:53 EST ---

A modified version of the above script, to cope with suspend as well as hibernate is now in Bug #1034457

It also unmounts and mounts the device rather than the mount point, but that assumes that the mount point is specified in /etc/fstab

Because this bug is very obscure for users, there should be a script that prevents the most common cases, included in pm-utils.

--- Additional comment from Fedora End Of Life on 2013-12-21 09:38:38 EST ---

This message is a reminder that Fedora 18 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 18. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '18'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 18's end of life.

Thank you for reporting this issue and we are sorry that we may not be 
able to fix it before Fedora 18 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior to Fedora 18's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 1 Robert Story 2014-02-23 22:19:35 UTC
I still have this problem on F19 (kernel 3.12.9-201.fc19.x86_64). I use the following script to reload after hibernation:

#!/bin/bash

unload="sdhci_pci sdhci mmc_block mmc_core"
load="mmc_block sdhci_pci"
   
[ $UID -ne 0 ] && echo "$0 must be run as root" && exit 127

# unload modules
echo "* unloading modules"
for m in $unload
do
   lsmod | grep -q $m
   [ ${PIPESTATUS[1]} -ne 0 ] && continue
   echo "unloading $m"
   rmmod $m
done


echo "* loading modules"
for m in $load
do
   lsmod | grep -q $m
   [ ${PIPESTATUS[1]} -eq 0 ] && continue
   echo "loading $m"
   modprobe $m
done

Comment 2 Justin M. Forbes 2014-05-21 19:38:07 UTC
*********** 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 20 kernel bugs.

Fedora 20 has now been rebased to 3.14.4-200.fc20.  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 experience different issues, please open a new bug report for those.

Comment 3 Jeroen Lankheet 2014-05-25 09:41:43 UTC
The issue still exists for kernel 3.14.4-200.fc20.x86_64

Comment 4 aaronsloman 2014-06-09 21:42:32 UTC
I have just upgraded my Dec E6410 from Fedora 18 to Fedora 20, and confirm that this bug persists: with SD card in slot thaw from hibernate is delayed by about 2 minutes. The previously reported fix using script in /etc/pm/sleep.d/ still works. I am  using kernel
3.14.5-200.fc20.x86_64 #1 SMP Mon Jun 2 14:26:34 UTC 2014

Several people have been reporting this problem for some time. If the problem cannot cannot be fixed in the kernel could pm-utils be shipped with a suitable script in the /etc/pm directory to prevent users being annoyed and wasting much time waiting for a thaw to work, for no apparent reason?

Comment 5 poinck 2014-06-10 14:30:59 UTC
This issue seems not specific to the kernel-configuration made by the Fedora-team; it still exists for kernel "3.15.0-gentoo .. x86_64".

Comment 6 Justin M. Forbes 2014-11-13 15:57:24 UTC
*********** 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 20 kernel bugs.

Fedora 20 has now been rebased to 3.17.2-200.fc20.  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 21, and are still experiencing this issue, please change the version to Fedora 21.

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

Comment 7 aaronsloman 2014-11-13 21:31:15 UTC
Using:

3.17.2-200.fc20.x86_64 #1 SMP Tue Nov 4 18:04:56 UTC 2014

Bug still present in this version, and same workaround in /etc/pm/sleep.d/ works.:

Comment 8 Ionut Radu 2014-12-18 19:33:23 UTC
I have the same problem like forever. Now I'm using 3.17.6-300.fc21.x86_64 and I see the issue is still present.

Comment 9 Ionut Radu 2014-12-28 18:58:00 UTC
Same issue with kernel 3.17.7-300.fc21.x86_64

Comment 10 poinck 2015-02-01 11:27:33 UTC
Created attachment 986712 [details]
systemd service to reload driver after resume from hibernate (workaround)

Howto use workaround:

(as root):
cp cardreader-driver-reset-after-hibernate.service /etc/systemd/system
systemctl enable cardreader-driver-reset-after-hibernate.service
systemctl status cardreader-driver-reset-after-hibernate.service

And maybe of interest: wacom- and hid_multitouch-users are suffering from the same problem, see https://gist.github.com/poinck/331c8930ff1845a2de8d

Comment 11 Fedora Kernel Team 2015-02-24 15:53:33 UTC
*** Bug 1015800 has been marked as a duplicate of this bug. ***

Comment 12 Fedora Kernel Team 2015-02-24 16:23:09 UTC
*********** 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 20 kernel bugs.

Fedora 20 has now been rebased to 3.18.7-100.fc20.  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 21, and are still experiencing this issue, please change the version to Fedora 21.

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

Comment 13 aaronsloman 2015-02-25 01:42:47 UTC
(In reply to Fedora Kernel Team from comment #12)
> *********** MASS BUG UPDATE **************
> ....
> Fedora 20 has now been rebased to 3.18.7-100.fc20.  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.

On my Dell Latitude E 6410 I am running the following kernel:

   3.18.7-100.fc20.x86_64 #1 SMP Wed Feb 11 19:01:50 UTC 2015

I still have the bug reported here (and in other reports). If I remove my file:

   /etc/pm/sleep.d/99-sdcard

then with SD card in slot, thaw from hibernate is delayed for some time.

/var/log/messages includes:

 Feb 25 01:16:38 lape kernel: [29511.453944] mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:16:38 lape kernel: mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:16:48 lape kernel: [29521.464298] mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:16:48 lape kernel: mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:16:58 lape kernel: [29531.474602] mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:16:58 lape kernel: mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:17:08 lape kernel: [29541.485018] mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:17:08 lape kernel: mmc0: Timeout waiting for hardware interrupt.
 Feb 25 01:17:08 lape kernel: [29541.487186] mmc0: card 0001 removed
 Feb 25 01:17:08 lape kernel: mmc0: card 0001 removed
 Feb 25 01:17:08 lape kernel: [29541.590717] mmc0: new high speed SDHC card at address 0001
 Feb 25 01:17:08 lape kernel: [29541.590955] mmcblk0: mmc0:0001 00000 7.46 GiB
 Feb 25 01:17:08 lape kernel: mmc0: new high speed SDHC card at address 0001
 Feb 25 01:17:08 lape kernel: mmcblk0: mmc0:0001 00000 7.46 GiB
 Feb 25 01:17:08 lape kernel: [29541.593046]  mmcblk0: p1
 Feb 25 01:17:08 lape kernel: mmcblk0: p1

It seems that after a while the card is automatically removed and reinstalled and the machine then becomes usable.

If I reinstate the 99-sdcard file, the thaw is immediate and the above lines are not found in /var/log/messages after thaw.

I don't need to use systemctl

Comment 14 Fedora Kernel Team 2015-04-28 18:31:55 UTC
*********** 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 20 kernel bugs.

Fedora 20 has now been rebased to 3.19.5-100.fc20.  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 21, and are still experiencing this issue, please change the version to Fedora 21.

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

Comment 15 aaronsloman 2015-04-28 23:48:16 UTC
(In reply to Fedora Kernel Team from comment #14)
> *********** MASS BUG UPDATE **************
> 
> Fedora 20 has now been rebased to 3.19.5-100.fc20.  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.

I have just upgraded my Dell E6410 to 
3.19.5-100.fc20.x86_64 #1 SMP Mon Apr 20 19:51:16 UTC 2015

The bug is still present, as described in Comment#13

Comment 16 Fedora End Of Life 2015-05-29 10:34:01 UTC
This message is a reminder that Fedora 20 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 20. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '20'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 20 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 17 Vladis Dronov 2015-06-02 08:13:15 UTC
just hit exactly this bug on Fedora21, rmmod/modprobe workaround has worked, but it would be great to have a solution (not the hack like writing systemd unit)

Linux ololo 3.19.2-201.fc21.x86_64 #1 SMP Tue Mar 24 03:08:23 UTC 2015 x86_64

Lenovo T530

02:00.0 System peripheral: Ricoh Co Ltd PCIe SDXC/MMC Host Controller (rev 07)
02:00.0 0880: 1180:e823 (rev 07) (prog-if 01)
	Subsystem: 17aa:21f6
	Kernel driver in use: sdhci-pci
	Kernel modules: sdhci_pci

Comment 18 Fedora End Of Life 2015-06-29 14:33:46 UTC
Fedora 20 changed to end-of-life (EOL) status on 2015-06-23. Fedora 20 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 19 aaronsloman 2015-06-29 16:07:11 UTC
Bug Still present in FC22

Running pm-hibernate causes a delay (about 2 minutes) after thaw from hibernate appears to be complete:
....
 Jun 29 16:31:16 lape kernel: mmc0: Timeout waiting for hardware interrupt.
....

then eventually:

 Jun 29 16:31:46 lape kernel: mmc0: card 0001 removed
 Jun 29 16:31:47 lape kernel: mmc0: new high speed SDHC card at address 0001
 Jun 29 16:31:47 lape kernel: mmcblk0: mmc0:0001 00000 7.46 GiB

WORKAROUND as mentioned in previous reports, e.g.:

    https://bugzilla.redhat.com/show_bug.cgi?id=1034457#c6

I.e. put shell script in /etc/pm/sleep.d/99-sdcard to remove SD card before hibernate and restore it after hibernate.

STILL NEEDED AND STILL WORKS

Can't something like this be added to pm-hibernate, so that users don't have to do it? It doesn't look as if the underlying bug is going to be fixed.

Comment 20 aaronsloman 2015-06-29 21:57:50 UTC
(In reply to Fedora End Of Life from comment #18)
> If you can reproduce this bug against a currently maintained version of
> Fedora please feel free to reopen this bug against that version. If you
> are unable to reopen this bug, please file a new report against the
> current release. If you experience problems, please add a comment to this
> bug.

I tried to reopen this as a F22 bug, but could not find a mechanism to do that.

Perhaps that's because I was not the original bug-owner?

Can someone else do it?

Comment 21 poinck 2015-06-30 12:58:00 UTC
I am using Gentoo now, but I have still the same issue, but I did'nt try with a newer kernel (4.0.5). I am still using the workarround I mentioned months ago.

Originally I cloned this bug from a bug that was opened in 2013.

Comment 22 aaronsloman 2015-06-30 20:08:36 UTC
The kernel version of F22 in which the fault still exists is  
   4.0.6-300.fc22.x86_64

Comment 23 Justin M. Forbes 2015-10-20 19:23:30 UTC
*********** 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 22 kernel bugs.

Fedora 22 has now been rebased to 4.2.3-200.fc22.  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 23, and are still experiencing this issue, please change the version to Fedora 23.

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

Comment 24 Fedora Kernel Team 2015-11-23 17:13:01 UTC
*********** MASS BUG UPDATE **************
This bug is being closed with INSUFFICIENT_DATA as there has not been a response in over 4 weeks. If you are still experiencing this issue, please reopen and attach the relevant data from the latest kernel you are running and any data that might have been requested previously.

Comment 25 aaronsloman 2015-11-28 21:00:00 UTC
Re-opened as bug 1286377

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


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