Aw: [PATCH v6 00/11] Clean up "mediatek,larb"

Frank Wunderlich
2021-07-14T09:01:48Z

Hi,

sorry this (or the 2 depency-series) cause a NULL Pointer deref in iommu_group_remove_device on mt7623/bpi-r2

i wonder why on bootup a cleanup is run, but have no hint about this.

since "dts: mtk-mdp: remove mediatek, vpu property from primary MDP device" all is good, i guess problem comes up while removing larb with DT

this is backtrace

[ 6.274465] PC is at iommu_group_remove_device+0x28/0x148
[ 6.279877] LR is at iommu_release_device+0x4c/0x70

[ 6.674347] Backtrace:
[ 6.676797] [<c0c9c37c>] (iommu_group_remove_device) from [<c06bf028>] (iomm)
[ 6.686221] r7:00000000 r6:c06bf04c r5:c0d7a1ac r4:c21fc010
[ 6.691883] [<c06befdc>] (iommu_release_device) from [<c06bf064>] (remove_io)
[ 6.700689] r5:00000000 r4:00000000
[ 6.704265] [<c06bf04c>] (remove_iommu_group) from [<c0733434>] (bus_for_eac)
[ 6.712725] [<c07333ac>] (bus_for_each_dev) from [<c06bf658>] (bus_set_iommu)
[ 6.720753] r6:c331f440 r5:c1406f58 r4:ffffffea
[ 6.725370] [<c06bf5a0>] (bus_set_iommu) from [<c06c1e88>] (mtk_iommu_probe+)
[ 6.733484] r7:c32db0b8 r6:c21f9c00 r5:c331f1c0 r4:00000000
[ 6.739145] [<c06c1bfc>] (mtk_iommu_probe) from [<c0738c14>] (platform_probe)
[ 6.747176] r10:c21f9c10 r9:c2496f54 r8:c14623b8 r7:c14623b8 r6:c1405b90 r50
[ 6.755012] r4:00000000
[ 6.757544] [<c0738ba8>] (platform_probe) from [<c0735968>] (really_probe.pa)
[ 6.766006] r7:c14623b8 r6:c1405b90 r5:00000000 r4:c21f9c10
[ 6.771667] [<c07358a0>] (really_probe.part.0) from [<c0735cec>] (really_pro)
[ 6.779866] r7:c21f9c10 r6:c2549e74 r5:c1405b90 r4:c21f9c10
[ 6.785527] [<c0735ca4>] (really_probe) from [<c0735de0>] (__driver_probe_de)
[ 6.793984] r5:c1405b90 r4:c21f9c10
[ 6.797560] [<c0735d30>] (__driver_probe_device) from [<c0735fa0>] (driver_p)
[ 6.806543] r9:c2496f54 r8:00000008 r7:c21f9c10 r6:c2549e74 r5:c14c6ec8 r4:4
[ 6.814291] [<c0735f5c>] (driver_probe_device) from [<c0736410>] (__device_a)
[ 6.823448] r9:c2496f54 r8:00000000 r7:c21f9c10 r6:c2549e74 r5:c1405b90 r4:1
[ 6.831196] [<c073635c>] (__device_attach_driver) from [<c0733540>] (bus_for)
[ 6.840007] r7:c14623b8 r6:c073635c r5:c2549e74 r4:00000000
[ 6.845669] [<c07334ac>] (bus_for_each_drv) from [<c07357e8>] (__device_atta)
[ 6.854044] r6:00000001 r5:c21f9c54 r4:c21f9c10
[ 6.858662] [<c07356e4>] (__device_attach) from [<c073662c>] (device_initial)
[ 6.867207] r6:c21f9c10 r5:c1406f58 r4:c1406ca0
[ 6.871825] [<c0736610>] (device_initial_probe) from [<c07346dc>] (bus_probe)
[ 6.880454] [<c0734648>] (bus_probe_device) from [<c0734cc8>] (deferred_prob)

bisect shows this commit as breaking:

Author: Yong Wu <yong.wu@mediatek.com>
Date: Wed Jul 14 10:56:17 2021 +0800

iommu/mediatek: Add probe_defer for smi-larb

Prepare for adding device_link.

regards Frank