Hi,
On 03.06.2021 18:46, Thierry Reding wrote:
> From: Thierry Reding
>
> Implement a ->probe_finalize() callback that can be used by vendor
> implementations to perform extra programming necessary after devices
> have been attached to the SMMU.
>
> Signed-off-by: Thierry Reding
This patch landed recently in linux-next as commit 0d97174aeadf
("iommu/arm-smmu: Implement ->probe_finalize()"). It causes the
following issue on ARM Juno R1 board:
arm-smmu 2b50.iommu: probing hardware configuration...
arm-smmu 2b50.iommu: SMMUv1 with:
arm-smmu 2b50.iommu: stage 2 translation
arm-smmu 2b50.iommu: coherent table walk
arm-smmu 2b50.iommu: stream matching with 32 register groups
arm-smmu 2b50.iommu: 4 context banks (4 stage-2 only)
arm-smmu 2b50.iommu: Supported page sizes: 0x60211000
arm-smmu 2b50.iommu: Stage-2: 40-bit IPA -> 40-bit PA
arm-smmu 7fb0.iommu: probing hardware configuration...
arm-smmu 7fb0.iommu: SMMUv1 with:
arm-smmu 7fb0.iommu: stage 2 translation
arm-smmu 7fb0.iommu: coherent table walk
arm-smmu 7fb0.iommu: stream matching with 16 register groups
arm-smmu 7fb0.iommu: 4 context banks (4 stage-2 only)
arm-smmu 7fb0.iommu: Supported page sizes: 0x60211000
arm-smmu 7fb0.iommu: Stage-2: 40-bit IPA -> 40-bit PA
arm-smmu 7fb1.iommu: probing hardware configuration...
arm-smmu 7fb1.iommu: SMMUv1 with:
arm-smmu 7fb1.iommu: stage 2 translation
arm-smmu 7fb1.iommu: non-coherent table walk
arm-smmu 7fb1.iommu: (IDR0.CTTW overridden by FW configuration)
arm-smmu 7fb1.iommu: stream matching with 2 register groups
arm-smmu 7fb1.iommu: 1 context banks (1 stage-2 only)
arm-smmu 7fb1.iommu: Supported page sizes: 0x60211000
arm-smmu 7fb1.iommu: Stage-2: 40-bit IPA -> 40-bit PA
arm-smmu 7fb2.iommu: probing hardware configuration...
arm-smmu 7fb2.iommu: SMMUv1 with:
arm-smmu 7fb2.iommu: stage 2 translation
arm-smmu 7fb2.iommu: non-coherent table walk
arm-smmu 7fb2.iommu: (IDR0.CTTW overridden by FW configuration)
arm-smmu 7fb2.iommu: stream matching with 2 register groups
arm-smmu 7fb2.iommu: 1 context banks (1 stage-2 only)
arm-smmu 7fb2.iommu: Supported page sizes: 0x60211000
arm-smmu 7fb2.iommu: Stage-2: 40-bit IPA -> 40-bit PA
arm-smmu 7fb3.iommu: probing hardware configuration...
arm-smmu 7fb3.iommu: SMMUv1 with:
arm-smmu 7fb3.iommu: stage 2 translation
arm-smmu 7fb3.iommu: coherent table walk
arm-smmu 7fb3.iommu: stream matching with 2 register groups
arm-smmu 7fb3.iommu: 1 context banks (1 stage-2 only)
arm-smmu 7fb3.iommu: Supported page sizes: 0x60211000
arm-smmu 7fb3.iommu: Stage-2: 40-bit IPA -> 40-bit PA
tda998x 0-0070: found TDA19988
tda998x 0-0071: found TDA19988
brd: module loaded
loop: module loaded
megasas: 07.714.04.00-rc1
sata_sil24 :03:00.0: Adding to iommu group 0
Unable to handle kernel NULL pointer dereference at virtual address
0070
Mem abort info:
ESR = 0x9604
EC = 0x25: DABT (current EL), IL = 32 bits
SET = 0, FnV = 0
EA = 0, S1PTW = 0
Data abort info:
ISV = 0, ISS = 0x0004
CM = 0, WnR = 0
[0070] user address but active_mm is swapper
Internal error: Oops: 9604 [#1] PREEMPT SMP
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 5.13.0-rc1+ #3466
Hardware name: ARM Juno development board (r1) (DT)
pstate: 2005 (nzCv daif -PAN -UAO -TCO BTYPE=--)
pc : arm_smmu_probe_finalize+0x14/0x48
lr : iommu_probe_device+0x74/0x120
...
Call trace:
arm_smmu_probe_finalize+0x14/0x48
of_iommu_configure+0xe4/0x1b8
of_dma_configure_id+0xf8/0x2d8
pci_dma_configure+0x44/0x88
really_probe+0xc0/0x3c0
driver_probe_device+0x60/0xc0
device_driver_attach+0x6c/0x78
__driver_attach+0xc0/0x100
bus_for_each_dev+0x68/0xc8
driver_attach+0x20/0x28
bus_add_driver+0x168/0x1f8
driver_register+0x60/0x110
__pci_register_driver+0x5c/0x68
sil24_pci_driver_init+0x20/0x28
do_one_initcall+0x84/0x450
kernel_init_freeable+0x2dc/0x334
kernel_init+0x10/0x110
ret_from_fork+0x10/0x18
Code: b40001e1 f9405821 f9400023 f9401461 (f9403822)
---[ end trace 561eda4b855861d1 ]---
Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b
SMP: stopping secondary CPUs
Kernel Offset: disabled
CPU features: 0x00240022,25006086
Memory Limit: none
---[ end Kernel panic - not syncing: Attempted to kill init!
exitcode=0x000b ]---
> ---
> Changes in v2:
> - remove unnecessarily paranoid check
>
> drivers/iommu/arm/arm-smmu/arm-smmu.c | 13 +
> drivers/iommu/arm/arm-smmu/arm-smmu.h | 1 +
> 2 files changed, 14 insertions(+)
>
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c
>