On 10/21/21 9:41 AM, Bruce Ashfield wrote:
[Please note: This e-mail is from an EXTERNAL e-mail address]

In message: [linux-yocto][v5.10/standard/base][PATCH] iommu/arm-smmu-v3: 
Ratelimit event dump
on 20/10/2021 Yanfei Xu wrote:

From: Jean-Philippe Brucker <[email protected]>

When a device or driver misbehaves, it is possible to receive DMA fault
events much faster than we can print them out, causing a lock up of the
system and inability to cancel the source of the problem. Ratelimit
printing of events to help recovery.

Tested-by: Aaro Koskinen <[email protected]>
Signed-off-by: Jean-Philippe Brucker <[email protected]>
Link: https://lore.kernel.org/r/[email protected]

Has this also been proposed for -stable inclusion ?

This patch is not backported in -stable, just for linux-yocto.

Regards,
Yanfei

I've merged this regardless .. I'm just trying to determine if I
should expect a conflict in the future.

Bruce

Signed-off-by: Will Deacon <[email protected]>

Back ported for 5.10
Signed-off-by: Yanfei Xu <[email protected]>
---
  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 5 +++++
  1 file changed, 5 insertions(+)

diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c 
b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index 7067b7c11626..75ce920c1a30 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -1358,11 +1358,16 @@ static irqreturn_t arm_smmu_evtq_thread(int irq, void 
*dev)
       struct arm_smmu_queue *q = &smmu->evtq.q;
       struct arm_smmu_ll_queue *llq = &q->llq;
       u64 evt[EVTQ_ENT_DWORDS];
+     static DEFINE_RATELIMIT_STATE(rs, DEFAULT_RATELIMIT_INTERVAL,
+                                   DEFAULT_RATELIMIT_BURST);

       do {
               while (!queue_remove_raw(q, evt)) {
                       u8 id = FIELD_GET(EVTQ_0_ID, evt[0]);

+                     if (!__ratelimit(&rs))
+                             continue;
+
                       dev_info(smmu->dev, "event 0x%02x received:\n", id);
                       for (i = 0; i < ARRAY_SIZE(evt); ++i)
                               dev_info(smmu->dev, "\t0x%016llx\n",
--
2.27.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10568): 
https://lists.yoctoproject.org/g/linux-yocto/message/10568
Mute This Topic: https://lists.yoctoproject.org/mt/86460058/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to