Problems using AMD eMMC with AMD IOMMU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tip of Tree (47cf1b422e60) I'm seeing the following IOMMU error
when enumerating my eMMC device:

[   13.097314] mmc0: SDHCI controller on PCI [0000:02:00.0] using ADMA 64-bit
[   13.104550] mmc1: SDHCI controller on ACPI [AMDI0040:00] using ADMA 64-bit
[   13.136359] mmc1: Allocated DMA: align_addr: 0x000000041ab55000,
adma_addr: 0x000000041ab55200, dma_size: e0c. <- I added this to
sdhci_setup_host
[   13.340852] mmc1: ADMA error: 0x02000000
[   13.344780] mmc1: sdhci: ============ SDHCI REGISTER DUMP ===========
[   13.351222] mmc1: sdhci: Sys addr:  0x00000000 | Version:  0x00001002
[   13.357669] mmc1: sdhci: Blk size:  0x00007200 | Blk cnt:  0x00000001
[   13.364118] mmc1: sdhci: Argument:  0x00000000 | Trn mode: 0x00000013
[   13.370567] mmc1: sdhci: Present:   0xf1ff0000 | Host ctl: 0x00000019
[   13.377014] mmc1: sdhci: Power:     0x0000000f | Blk gap:  0x00000000
[   13.383463] mmc1: sdhci: Wake-up:   0x00000000 | Clock:    0x0000fa07
[   13.389911] mmc1: sdhci: Timeout:   0x0000000a | Int stat: 0x00000000
[   13.396360] mmc1: sdhci: Int enab:  0x03ff000b | Sig enab: 0x03ff000b
[   13.402808] mmc1: sdhci: ACmd stat: 0x00000000 | Slot int: 0x00000000
[   13.409257] mmc1: sdhci: Caps:      0x71fec8b2 | Caps_1:   0x00000577
[   13.415706] mmc1: sdhci: Cmd:       0x0000083a | Max curr: 0x00c80064
[   13.422154] mmc1: sdhci: Resp[0]:   0x00000700 | Resp[1]:  0xffffffff
[   13.428603] mmc1: sdhci: Resp[2]:   0x328f5903 | Resp[3]:  0x00d00f00
[   13.435048] mmc1: sdhci: Host ctl2: 0x00000000
[   13.439506] mmc1: sdhci: ADMA Err:  0x00000001 | ADMA Ptr: 0x000000041ab55200
[   13.446641] mmc1: sdhci: ============================================
[   13.453077] mmc1: sdhci: 41ab55200: DMA 0x000000041a462400, LEN
0x0200, Attr=0x21
[   13.460551] mmc1: sdhci: 41ab5520c: DMA 0x0000000000000000, LEN
0x0000, Attr=0x03
[   13.468070] AMD-Vi: Event logged [IO_PAGE_FAULT device=00:13.1
domain=0x0000 address=0x41ab55200 flags=0x0050]
[   13.478109] mmc1: error -5 whilst initialising MMC card

If I read the error correctly (not sure), it looks like the ADMA
descriptor was at 0x41ab55200. The fault was also for 0x41ab55200.

Decoding the flags:
2.5.3 IO_PAGE_FAULT Event
* PE (peripheral did not have the permissions required to perform the
transaction)
* PR (transaction was to a page marked as present (including V=1b in
DTE) or interrupt marked as remapped (RemapEn=1)).

So it looks like the eMMC controller had a page fault trying to read
the DMA descriptor. Is this a known issue? Does anyone have any
suggestions?

I little background:
We recently cherry-picked `be62dbf554c5 iommu/amd: Convert AMD iommu
driver to the dma-iommu api` into the chromiumos 5.4 tree:
https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2169153
This caused the eMMC page faults to start happening on boot. When we
reverted the patch from our tree the problems went away.

When I tried on ToT, I saw the same errors. So I reverted be62dbf554c5
from my ToT branch expecting the errors to go away, but they remained.
So this makes me wonder if we are missing an mmc patch or the iommu
wasn't working correctly on 5.4 before we landed be62dbf554c5. I
looked through the recent mmc patches, but didn't see anything that
stood out.

This is the driver we are using:
https://source.chromium.org/chromiumos/chromiumos/codesearch/+/master:src/third_party/kernel/v5.4/drivers/mmc/host/sdhci-acpi.c;l=607

Any suggestions would be appreciated.



[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux