From: Zhou Guanghui zhouguanghui1@huawei.com
hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4D63I CVE: NA
-------------------------------------------------
If the SMMU frequently reports a large number of events, the events in the event queue cannot be processed in time. As a result, the while loop cannot exit. So add a cond_resched() to avoid softlockup.
Signed-off-by: Zhou Guanghui zhouguanghui1@huawei.com Signed-off-by: Guo Mengqi guomengqi3@huawei.com Reviewed-by: Weilong Chen chenweilong@huawei.com Signed-off-by: Yang Yingliang yangyingliang@huawei.com --- drivers/iommu/arm-smmu-v3.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c index 292fd9a10c7ff..8b5083c3e0a16 100644 --- a/drivers/iommu/arm-smmu-v3.c +++ b/drivers/iommu/arm-smmu-v3.c @@ -1832,6 +1832,7 @@ static irqreturn_t arm_smmu_evtq_thread(int irq, void *dev) u8 id = FIELD_GET(EVTQ_0_ID, evt[0]);
spin_unlock(&q->wq.lock); + cond_resched(); ret = arm_smmu_handle_evt(smmu, evt); spin_lock(&q->wq.lock);