Hang on shutdown (Timeout waiting for hardware cmd interrupt)

I takes forever with this message continuously appearing:

[  116.668007] mmc1: Timeout waiting for hardware cmd interrupt.
[  116.668022] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[  116.668028] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x0000a402
[  116.668037] mmc1: sdhci: Blk size:  0x00000000 | Blk cnt:  0x00000000
[  116.668044] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000000
[  116.668051] mmc1: sdhci: Present:   0x01ff0001 | Host ctl: 0x00000000
[  116.668058] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
[  116.668064] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x00007d07
[  116.668072] mmc1: sdhci: Timeout:   0x00000000 | Int stat: 0x00018000
[  116.668079] mmc1: sdhci: Int enab:  0x00ff0003 | Sig enab: 0x00ff0003
[  116.668087] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000001
[  116.668094] mmc1: sdhci: Caps:      0x67ea64b2 | Caps_1:   0x00000000
[  116.668101] mmc1: sdhci: Cmd:       0x0000371a | Max curr: 0x00000001
[  116.668108] mmc1: sdhci: Resp[0]:   0x00000000 | Resp[1]:  0x00000000
[  116.668117] mmc1: sdhci: Resp[2]:   0x00000000 | Resp[3]:  0x00000000
[  116.668120] mmc1: sdhci: Host ctl2: 0x00000000
[  116.668125] mmc1: sdhci: ADMA Err:  0x00000000 | ADMA Ptr: 0x00000000
[  116.668128] mmc1: sdhci: ============================================

Still get it after updates are applied…

This is related to SD card / MMC card reader.

Is there any card inserted when this problem occurs? Try removing it before shutdown and see if there is any change.

The notebook has a full-sized SD card reader, but it’s empty and I’m pretty sure it was never ever used, I I do not have such a card and cannot remember I could use in at any device.

I found a similar question on AskUbuntu. If you don’t use the SD card reader at all, the suggested solutions are to either disable it in the BIOS/UEFI configuration, or blacklist the sdhci kernel module.

Before doing that, you can unload the module first, to test if it solves the problem:

sudo modprobe -r sdhci

Then, shutdown and see.

If it works, you can blacklist the module (copy and paste the whole block into terminal):

cat << EOF | sudo tee /etc/modprobe.d/blacklist-sdhci.conf
# Disable SD card reader
blacklist sdhci
EOF

If you want to undo this blacklist, just delete /etc/modprobe.d/blacklist-sdhci.conf

If it helps, should I fill a bug with some logs? If yes, then where? It seems not a Fedora issue, so where then?

Tnx!

The first step to help others with the same hardware would be to provide your hardware details.
Adding your system to the Linux Hardware.org database and adding the link here could help users of other distros.

 % modinfo sdhci
filename:       /lib/modules/6.2.12-300.fc38.x86_64/kernel/drivers/mmc/host/sdhci.ko.xz
license:        GPL
description:    Secure Digital Host Controller Interface core driver
author:         Pierre Ossman <pierre@ossman.eu>
depends:        mmc_core
retpoline:      Y
intree:         Y
name:           sdhci
vermagic:       6.2.12-300.fc38.x86_64 SMP preempt mod_unload
sig_id:         PKCS#7
signer:         Fedora kernel signing key
[...]
parm:           debug_quirks:Force certain quirks. (uint)
parm:           debug_quirks2:Force certain other quirks. (uint)

sdhci.h defines dozens of quirks. Normally the driver should query the hardware to determine what is needed. Using sdhci debug quirks may be needed when sdhci logic fails.

Did either solution work?

What is the full name and ID (xxxx:xxxx) of your SD card reader? Check lsusb and lspci -nn.

Search for bugs first in Fedora bug tracker, since you are using Fedora packaged kernel (I assume). I found 1 similar report although it’s old and the symptoms are different, so you should probably file a different report.

Also search kernel bug tracker and mailing lists. Kernel mmc devs don’t use bugzilla, but users still report there (because they don’t read instructions); here are some possibly related reports.

The mailing list for mmc is linux-mmc@vger.kernel.org, you can search an archive of it here, and search the main Linux Kernel Mailing List (LKML) here.

See also:

1 Like

Sorry for the delat, the Linux is not my primary PC.

[fedora ~]$ sudo modprobe -r sdhci
modprobe: FATAL: Module sdhci is in use.

Maybe this is the cause. Actually the bay is empty.

Use lsmod | grep -F sdhci to find modules that use sdhci, make a list, and try to remove everything that uses sdhci. If your reader is a PCI device, you should see sdhci_pci so you would try: sudo modprobe -r sdhci_pci sdhci.

I’m new to Linux (actually trying in for many years)

[@fedora ~]$ lsmod | grep -F sdhci
sdhci_acpi 32768 0
sdhci 94208 1 sdhci_acpi
mmc_core 258048 3 sdhci,rtsx_usb_sdmmc,sdhci_acpi

Could you please help, what should I do next?

BTW It seems, the problem is only when I update the Fedora and it restarts. Normal restart/shutdown goes as expected.

I’m not sure what this means – are you updating using the Gnome Software app or command-line? Using the Gnome Software app they system restarts, updates, and restarts a second time again. Applying updates can take a long time especially if 3rd party modules needs compiling. I always remove “rhgb quiet” from the kernel command-line so I can monitor updating progress (I seldom reboot unless updating).

Updating using standard KDE GUI program. It downloads updates, then restarts, then installs updates (with progress bar, can press Esc and see %%), then it restarts again (at this stage I have the problem).

See this pix: https://disk.yandex.com/i/NPfTIr9oBXeAkw as it tries to restart.

I see a failure to remount / as read-only. There have been reports that systemd remounts can be confused by “non-standard” mount options.