Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9fdf837c authored by duckyduckG's avatar duckyduckG Committed by Harshit Jain
Browse files

msm: ipa: fix smmu mapping by initializing next_addr for IPA HW v4.1

fix smmu mapping by initializing next_addr for ipa_smmu_uc for ipahw 4.1 only,
without it, unmapped address is accessed, which lead to smmu fault.

fixes following smmu fault:
<3>[ 4252.904590] arm-smmu 15000000.apps-smmu: FAR    = 0x0000000020008000
<3>[ 4252.904611] arm-smmu 15000000.apps-smmu: PAR    = 0x0000000000000000
<3>[ 4252.904631] arm-smmu 15000000.apps-smmu: FSR    = 0x40000402 [TF W SS ]
<3>[ 4252.904648] arm-smmu 15000000.apps-smmu: TTBR0  = 0x0000000000000000
<3>[ 4252.904664] arm-smmu 15000000.apps-smmu: TTBR1  = 0x0000000000000000
<3>[ 4252.904681] arm-smmu 15000000.apps-smmu: SCTLR  = 0x00c000e7 ACTLR  = 0x00000003
<3>[ 4252.904740] arm-smmu 15000000.apps-smmu: CBAR  = 0x0001f300
<3>[ 4252.904757] arm-smmu 15000000.apps-smmu: MAIR0   = 0xf404ff44 MAIR1   = 0x00000000
<3>[ 4252.904790] arm-smmu 15000000.apps-smmu: Unhandled context fault: iova=0x20008000, cb=5, fsr=0x40000402, fsynr0=0x7d0013, fsynr1=0x0
<3>[ 4252.904807] arm-smmu 15000000.apps-smmu: Client info: BID=0x0, PID=0x0, MID=0x0
<3>[ 4252.904824] arm-smmu 15000000.apps-smmu: soft iova-to-phys=0x0000000000000000
<3>[ 4252.904842] arm-smmu 15000000.apps-smmu: SOFTWARE TABLE WALK FAILED! Looks like 15000000.apps-smmu accessed an unmapped address!
<3>[ 4252.904857] arm-smmu 15000000.apps-smmu: hard iova-to-phys (ATOS) failed
<3>[ 4252.904872] arm-smmu 15000000.apps-smmu: SID=0x522
<3>[ 4252.904889] arm-smmu 15000000.apps-smmu: Unhandled arm-smmu context fault!
<4>[ 4252.904966] ------------[ cut here ]------------
<2>[ 4252.904980] kernel BUG at drivers/iommu/arm-smmu.c:2137!
<0>[ 4252.905000] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
<4>[ 4252.905017] Modules linked in:
<0>[ 4252.905038] Process irq/213-arm-smm (pid: 113, stack limit = 0x00000000b12669e6)
<4>[ 4252.905063] CPU: 0 PID: 113 Comm: irq/213-arm-smm Tainted: G S      W         4.19.325-cip123-st7-perf-gb3bee9238b56 #2
<4>[ 4252.905076] Hardware name: VAYU (DT)
<4>[ 4252.905093] pstate: 60c00005 (nZCv daif +PAN +UAO)
<4>[ 4252.905126] pc : arm_smmu_context_fault+0x778/0x77c
<4>[ 4252.905144] lr : arm_smmu_context_fault+0x778/0x77c
<4>[ 4252.905155] sp : ffffff8010c73c90
<4>[ 4252.905166] x29: ffffff8010c73d60 x28: fffffffc34711080
<4>[ 4252.905183] x27: 0000000040000402 x26: ffffff8011d85000
<4>[ 4252.905199] x25: 0000000000000000 x24: 0000000000000000
<4>[ 4252.905214] x23: 0000000020008000 x22: 0000000000000000
<4>[ 4252.905229] x21: 0000000000000000 x20: 0000000000000522
<4>[ 4252.905244] x19: 0000000000000000 x18: 00000000000000d8
<4>[ 4252.905259] x17: fffffffc37838008 x16: 00000000000028c2
<4>[ 4252.905275] x15: 0000000000003839 x14: 000000000000dceb
<4>[ 4252.905290] x13: 00000000001749e4 x12: 0000000000000000
<4>[ 4252.905306] x11: 0000000000000000 x10: 0000000000000001
<4>[ 4252.905320] x9 : 6154d17c5d284a00 x8 : 6154d17c5d284a00
<4>[ 4252.905335] x7 : 612064656c646e61 x6 : ffffffa614ea580a
<4>[ 4252.905351] x5 : 0000000000000036 x4 : 0000000000000000
<4>[ 4252.905365] x3 : 0000000000002174 x2 : 0000000000000007
<4>[ 4252.905380] x1 : 0000000000000006 x0 : 000000000000003e
<4>[ 4252.905397] Call trace:
<4>[ 4252.905415]  arm_smmu_context_fault+0x778/0x77c
<4>[ 4252.905437]  irq_thread_fn+0x2c/0x60
<4>[ 4252.905451]  irq_thread+0x1e0/0x240
<4>[ 4252.905471]  kthread+0x138/0x154
<4>[ 4252.905492]  ret_from_fork+0x10/0x18
<0>[ 4252.905513] Code: f9400380 d0010201 9120c821 9402e9e7 (d4210000)
<4>[ 4252.905529] ---[ end trace 69309c0cbbbdb161 ]---
parent aa8225ab
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment