Card stuck in wrong state! card_busy_detect status: 0x700

Bug #1917633 reported by Juerg Haefliger
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
linux-raspi (Ubuntu)
New
Undecided
Unassigned
Groovy
Invalid
Undecided
Unassigned

Bug Description

Running sdtool from https://github.com/BertoldVdb/sdtool yields:

$ sudo ./sdtool /dev/mmcblk0 status
[+] Found RCA for /dev/mmcblk0: AAAA.
Error 110
[-] Failed to send command: Connection timed out

[ 43.004983] sdhost-bcm2835 3f202000.mmc: Card stuck in wrong state! card_busy_detect status: 0x700
[ 43.102348] sdhost-bcm2835 3f202000.mmc: sdhost_busy_irq: intmask 00000440
[ 53.224992] sdhost-bcm2835 3f202000.mmc: timeout waiting for hardware interrupt.
[ 53.285006] sdhost-bcm2835 3f202000.mmc: __mmc_blk_ioctl_cmd: cmd error -110
[ 63.465196] sdhost-bcm2835 3f202000.mmc: timeout waiting for hardware interrupt.

Tested both arm64 and armhf on 2B (armhf only), 3B, 3B+ and 4B.

Focal 5.4 seems to be OK.

Groovy 5.8 fails on:
 - 2B armhf
 - 3B+ armhf
 - 4B arm64

Juerg Haefliger (juergh)
Changed in linux-raspi (Ubuntu Groovy):
status: New → Confirmed
Revision history for this message
Juerg Haefliger (juergh) wrote :

The problematic commit seems to be:

commit a0d4c7eb71dd08a89ad631177bb0cbbabd598f84
Author: Chaotian Jing <email address hidden>
Date: Thu Sep 5 15:53:18 2019 +0800

    mmc: block: Add CMD13 polling for MMC IOCTLS with R1B response

    MMC IOCTLS with R1B responses may cause the card to enter the busy state,
    which means it's not ready to receive a new request. To prevent new
    requests from being sent to the card, use a CMD13 polling loop to verify
    that the card returns to the transfer state, before completing the request.

    Signed-off-by: Chaotian Jing <email address hidden>
    Reviewed-by: Avri Altman <email address hidden>
    Cc: <email address hidden>
    Signed-off-by: Ulf Hansson <email address hidden>

Which was introduced in 5.5.

Revision history for this message
Juerg Haefliger (juergh) wrote :

Which was fixed in 5.10 by:

commit 6246d7c9d15aaff0bc3863f67900c6a6e6be921b
Author: Bean Huo <email address hidden>
Date: Wed Dec 2 21:23:20 2020 +0100

    mmc: block: Fixup condition for CMD13 polling for RPMB requests

    The CMD13 polling is needed for commands with R1B responses. In commit
    a0d4c7eb71dd ("mmc: block: Add CMD13 polling for MMC IOCTLS with R1B
    response"), the intent was to introduce this for requests targeted to the
    RPMB partition. However, the condition to trigger the polling loop became
    wrong, leading to unnecessary polling. Let's fix the condition to avoid
    this.

    Fixes: a0d4c7eb71dd ("mmc: block: Add CMD13 polling for MMC IOCTLS with R1B response")
    Cc: <email address hidden>
    Reported-by: Zhan Liu <email address hidden>
    Signed-off-by: Zhan Liu <email address hidden>
    Signed-off-by: Bean Huo <email address hidden>
    Link: https://<email address hidden>
    Signed-off-by: Ulf Hansson <email address hidden>

Which we have in the latest 5.8 raspi kernel. I should always test the latest kernel. Sigh.

Changed in linux-raspi (Ubuntu Groovy):
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.