When trying to mount an SD Card in JMicron SD Controller with Intel VT-d on I get following error reported in dmesg
[ 3.357428] dmar: DRHD: handling fault status reg 2
[ 3.359923] dmar: DMAR:[DMA Write] Request device [24:00.1] fault addr fffff000
DMAR:[fault reason 02] Present bit in context entry is clear
[ 3.365016] mmc0: unrecognised SCR structure version 3
[ 3.367599] mmc0: error -22 whilst initialising SD card
which makes it probably related to:
I can mount the SD Card normally when the VT-d is turned off in BIOS.
Steps to Reproduce:
1. Compile kernel with IOMMU flags and
(required for JMicron SD Controller)
2. Turn on the Intel VT-d in BIOS
3. Run the system
Error is reported in dmesg, and I can't mount the SD card
The SD card can be mounted normally
Created attachment 367490 [details]
Kernel .config file
Created attachment 367492 [details]
output of lspci -knnv
Created attachment 367494 [details]
output of dmesg
Thank you for reporting. Let's see how the upstream bug goes.
Are you able to test patches for this issue? The patch that is attached to the upstream bug report doesn't contain the correct entry for your device yet and I'd like to add that.
In this case the device causing the fault could be either 24:00.0 or 24:00.2 and it could be using 24:00.1 only, or it could use both (24:00.1 and 24:00.0) or (24:00.1 and 24:00.2). It might take a few attempts to work it out.
Can test it, but:
1. Could you provide me with a patch file? I can see a patch attachment upstream but it's from 31st Jan and in Alex Williamson's comment #45 I can see a reference to patch series sent to LKML in May. So the patches from LKML are probably better. But on the LKML website Alex links to I can't see either a patch file or even a git commit hash I could generate patch files from.
2. Which kernel version should I test the patch with? Latest stable gentoo-sources (3.12.13 as of today)?
(In reply to Kamil Roman from comment #6)
> Can test it, but:
> 1. Could you provide me with a patch file? I can see a patch attachment
> upstream but it's from 31st Jan and in Alex Williamson's comment #45 I can
> see a reference to patch series sent to LKML in May. So the patches from
> LKML are probably better. But on the LKML website Alex links to I can't see
> either a patch file or even a git commit hash I could generate patch files
Click on the link (https://lkml.org/lkml/2014/5/1/290) and then in the first depth you'll find 13 "Alex Williamson" links, you can click on each link and then click on "Get diff 1". Resulting in these links:
You can download each one; eg.
wget https://lkml.org/lkml/diff/2014/5/1/291/1 -O 1.patch
wget https://lkml.org/lkml/diff/2014/5/1/292/1 -O 2.patch
and then apply it like this, eg.
patch -p1 < 1.patch
patch -p1 < 2.patch
Alternatively; if you have Git and want to use that instead, you can
git clone git://github.com/awilliam/linux-vfio.git
and then do
git checkout dma-alias
which might be easier to execute than downloading and applying 13 patches.
Worth noting is that as said in the original comment, you'll want to add your controller to patch 4 if it is not already in there; if you need help with that, feel free to let us know.
> 2. Which kernel version should I test the patch with? Latest stable
> gentoo-sources (3.12.13 as of today)?
I will use the dma-alias branch. Could you just tell me which file and how should I modify it? I would be grateful if you could be detailed as I am not a C, but only a poor Java developer ;). Thanks for your patience :)