From 3049e6f03e3a401b32aef289dadb238765509054 Mon Sep 17 00:00:00 2001 From: Sivakanth vaka Date: Tue, 22 Sep 2020 13:05:14 +0530 Subject: [PATCH] msm: ipa3: Rate limit excessive logging Rate limiting excessive logs when modem is in limited service. Signed-off-by: sivakanth vaka --- drivers/platform/msm/ipa/ipa_v3/teth_bridge.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c b/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c index fed8c18ed520..24f24c908667 100644 --- a/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c +++ b/drivers/platform/msm/ipa/ipa_v3/teth_bridge.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2013-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2020, The Linux Foundation. All rights reserved. */ #include @@ -30,6 +30,9 @@ pr_debug(TETH_BRIDGE_DRV_NAME " %s:%d EXIT\n", __func__, __LINE__) #define TETH_ERR(fmt, args...) \ pr_err(TETH_BRIDGE_DRV_NAME " %s:%d " fmt, __func__, __LINE__, ## args) +#define TETH_ERR_RL(fmt, args...) \ + pr_err_ratelimited_ipa(TETH_BRIDGE_DRV_NAME " %s:%d " fmt, __func__, \ + __LINE__, ## args); /** * struct ipa3_teth_bridge_ctx - Tethering bridge driver context information @@ -65,12 +68,12 @@ static void teth_bridge_ipa_cb(void *priv, enum ipa_dp_evt_type evt, TETH_DBG_FUNC_ENTRY(); if (evt != IPA_RECEIVE) { - TETH_ERR("unexpected event %d\n", evt); + TETH_ERR_RL("unexpected event %d\n", evt); WARN_ON(1); return; } - TETH_ERR("Unexpected exception packet from USB, dropping packet\n"); + TETH_ERR_RL("Unexpected exception packet from USB, dropping packet\n"); dev_kfree_skb_any(skb); TETH_DBG_FUNC_EXIT(); }