I am developing a custom am335x platform using eMMC for the rootfds that also reads several ADI adc's via the IIO subsystem. Unfortunately, in order to get the device to boot from the eMMC, I had to short the signal for DAT0 to the eMMC to a pin I also use with the gpio-mux driver to select the spi slave adc that I want to talk to. I have no specific requirements to read/write on the eMMC while performing I/O on the spi but I still get sdhci errors errors while using the mux drivers when I want to talk to the adc's. I am hoping there is some kind of software workaround for this problem. I am using an EXT4 filesystem for my rootfs on the eMMC. I have also tried using a read-only rootfs. I also created a patch for the gpio-mux driver that sets the pins to input when the mux is not selected hoping to simulate a tri-state configuration. None of these efforts have solved my problem. Below is the output from the sdhci driver when the error occurs. Any suggestions would be appreciated. root@dsa5000-021:~# [ 1035.360798] mmc1: Timeout waiting for hardware interrupt. [ 1035.360825] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1035.360830] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1035.360844] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000001 [ 1035.360850] mmc1: sdhci: Argument: 0x00000000 | Trn mode: 0x00000013 [ 1035.360856] mmc1: sdhci: Present: 0x01f70a06 | Host ctl: 0x00000000 [ 1035.360862] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1035.360868] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1035.360873] mmc1: sdhci: Timeout: 0x0000000c | Int stat: 0x00000000 [ 1035.360879] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1035.360885] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1035.360890] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1035.360896] mmc1: sdhci: Cmd: 0x0000083a | Max curr: 0x00000000 [ 1035.360901] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x3403032a [ 1035.360907] mmc1: sdhci: Resp[2]: 0x36353730 | Resp[3]: 0x7001004d [ 1035.360913] mmc1: sdhci: Host ctl2: 0x00000000 [ 1035.360918] mmc1: sdhci: ============================================ [ 1035.421369] mmc1: switch to bus width 8 failed root@dsa5000-021:~# [ 1299.680032] mmc1: Timeout waiting for hardware interrupt. [ 1299.680059] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1299.680065] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1299.680077] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000008 [ 1299.680084] mmc1: sdhci: Argument: 0x00041fe8 | Trn mode: 0x00000023 [ 1299.680089] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 1299.680096] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1299.680101] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1299.680107] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 1299.680112] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1299.680118] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1299.680124] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1299.680130] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 1299.680135] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000 [ 1299.680141] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 1299.680146] mmc1: sdhci: Host ctl2: 0x00000000 [ 1299.680151] mmc1: sdhci: ============================================ [ 1309.919983] mmc1: Timeout waiting for hardware interrupt. [ 1309.920010] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1309.920042] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1309.920056] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000008 [ 1309.920062] mmc1: sdhci: Argument: 0x00041fe8 | Trn mode: 0x00000023 [ 1309.920068] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 1309.920074] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1309.920080] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1309.920085] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 1309.920090] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1309.920096] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1309.920102] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1309.920108] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 1309.920114] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x3403032a [ 1309.920120] mmc1: sdhci: Resp[2]: 0x36353730 | Resp[3]: 0x7001004d [ 1309.920126] mmc1: sdhci: Host ctl2: 0x00000000 [ 1309.920130] mmc1: sdhci: ============================================ [ 1310.023058] I/O error, dev mmcblk1, sector 265184 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2 [ 1310.023136] Buffer I/O error on dev mmcblk1p2, logical block 124, lost async page write [ 1319.145773] EXT4-fs error (device mmcblk1p2): ext4_check_bdev_write_error:217: comm systemd-timesyn: Error while async write back metadata [ 1320.159965] mmc1: Timeout waiting for hardware interrupt. [ 1320.159992] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1320.159998] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1320.160011] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000008 [ 1320.160017] mmc1: sdhci: Argument: 0x00041fe8 | Trn mode: 0x00000023 [ 1320.160023] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 1320.160029] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1320.160034] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1320.160068] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 1320.160075] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1320.160080] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1320.160086] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1320.160092] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 1320.160098] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000 [ 1320.160103] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 1320.160108] mmc1: sdhci: Host ctl2: 0x00000000 [ 1320.160113] mmc1: sdhci: ============================================ [ 1320.212742] I/O error, dev mmcblk1, sector 270312 op 0x1:(WRITE) flags 0x103000 phys_seg 1 prio class 2 [ 1320.212775] Buffer I/O error on dev mmcblk1p2, logical block 765, lost async page write [ 1325.421342] mmc1: switch to bus width 8 failed [ 1335.519934] mmc1: Timeout waiting for hardware interrupt. [ 1335.519959] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1335.519965] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1335.519978] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000018 [ 1335.519984] mmc1: sdhci: Argument: 0x000c0ea8 | Trn mode: 0x00000023 [ 1335.519990] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000002 [ 1335.519996] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1335.520002] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1335.520008] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 1335.520014] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1335.520019] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1335.520024] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1335.520030] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 1335.520037] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000 [ 1335.520042] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 1335.520047] mmc1: sdhci: Host ctl2: 0x00000000 [ 1335.520052] mmc1: sdhci: ============================================ [ 1345.759923] mmc1: Timeout waiting for hardware interrupt. [ 1345.759950] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 1345.759955] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 1345.759968] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000018 [ 1345.759975] mmc1: sdhci: Argument: 0x000c0ea8 | Trn mode: 0x00000023 [ 1345.759981] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000002 [ 1345.759987] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 1345.759992] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 1345.759998] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 1345.760004] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 1345.760009] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 1345.760015] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 1345.760021] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 1345.760026] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000 [ 1345.760032] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 1345.760037] mmc1: sdhci: Host ctl2: 0x00000000 [ 1345.760042] mmc1: sdhci: ============================================ [ 1345.812811] I/O error, dev mmcblk1, sector 790184 op 0x1:(WRITE) flags 0x800 phys_seg 3 prio class 2 [ 1345.812919] Aborting journal on device mmcblk1p2-8. root@dsa5000-021:~# [ 1389.145664] EXT4-fs error (device mmcblk1p2): ext4_journal_check_start:83: comm systemd-timesyn: Detected aborted journal [ 1389.278756] EXT4-fs (mmcblk1p2): Remounting filesystem read-only After the filesystem was remounted, there were no more errors. Although it took longer on a different module it eventually failed in the same fashion: root@dsa5000-020:~# [ 2132.303563] mmc1: switch to bus width 8 failed [ 2167.663775] mmc1: switch to bus width 8 failed [ 2352.482705] mmc1: Timeout waiting for hardware interrupt. [ 2352.482732] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 2352.482737] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 2352.482751] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000008 [ 2352.482757] mmc1: sdhci: Argument: 0x00041fe8 | Trn mode: 0x00000023 [ 2352.482762] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 2352.482768] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 2352.482774] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 2352.482780] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 2352.482786] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 2352.482791] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 2352.482796] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 2352.482802] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 2352.482808] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x00000000 [ 2352.482814] mmc1: sdhci: Resp[2]: 0x00000000 | Resp[3]: 0x00000000 [ 2352.482819] mmc1: sdhci: Host ctl2: 0x00000000 [ 2352.482824] mmc1: sdhci: ============================================ [ 2387.682736] mmc1: Timeout waiting for hardware interrupt. [ 2387.682763] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 2387.682768] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 2387.682781] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000010 [ 2387.682787] mmc1: sdhci: Argument: 0x000c0f20 | Trn mode: 0x00000023 [ 2387.682793] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 2387.682799] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 2387.682805] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 2387.682810] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 2387.682816] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 2387.682822] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 2387.682827] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 2387.682833] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 2387.682839] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x340302ab [ 2387.682846] mmc1: sdhci: Resp[2]: 0x36353730 | Resp[3]: 0x7001004d [ 2387.682851] mmc1: sdhci: Host ctl2: 0x00000000 [ 2387.682855] mmc1: sdhci: ============================================ [ 2387.893192] I/O error, dev mmcblk1, sector 790304 op 0x1:(WRITE) flags 0x800 phys_seg 2 prio class 2 [ 2387.893301] Aborting journal on device mmcblk1p2-8. [ 2441.830811] EXT4-fs error (device mmcblk1p2): ext4_journal_check_start:83: comm systemd-timesyn: Detected aborted journal [ 2452.322819] mmc1: Timeout waiting for hardware interrupt. [ 2452.322847] mmc1: sdhci: ============ SDHCI REGISTER DUMP =========== [ 2452.322852] mmc1: sdhci: Sys addr: 0x00000000 | Version: 0x00003101 [ 2452.322866] mmc1: sdhci: Blk size: 0x00000200 | Blk cnt: 0x00000008 [ 2452.322872] mmc1: sdhci: Argument: 0x00040800 | Trn mode: 0x00000023 [ 2452.322878] mmc1: sdhci: Present: 0x01f70506 | Host ctl: 0x00000000 [ 2452.322884] mmc1: sdhci: Power: 0x0000000f | Blk gap: 0x00000000 [ 2452.322889] mmc1: sdhci: Wake-up: 0x00000000 | Clock: 0x00000087 [ 2452.322925] mmc1: sdhci: Timeout: 0x0000000e | Int stat: 0x00000000 [ 2452.322931] mmc1: sdhci: Int enab: 0x027f000b | Sig enab: 0x027f000b [ 2452.322937] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000 [ 2452.322943] mmc1: sdhci: Caps: 0x07e10080 | Caps_1: 0x00000000 [ 2452.322949] mmc1: sdhci: Cmd: 0x0000193a | Max curr: 0x00000000 [ 2452.322955] mmc1: sdhci: Resp[0]: 0x00000900 | Resp[1]: 0x340302ab [ 2452.322961] mmc1: sdhci: Resp[2]: 0x36353730 | Resp[3]: 0x7001004d [ 2452.322966] mmc1: sdhci: Host ctl2: 0x00000000 [ 2452.322971] mmc1: sdhci: ============================================ [ 2452.430066] EXT4-fs (mmcblk1p2): Remounting filesystem read-only