From: Stefan Wahren <stefan.wahren@i2se.com>
To: Jason Wang <wangborong@cdjrlc.com>,
"linus.walleij" <linus.walleij@linaro.org>
Cc: nsaenz <nsaenz@kernel.org>, "f.fainelli" <f.fainelli@gmail.com>,
rjui <rjui@broadcom.com>, sbranden <sbranden@broadcom.com>,
bcm-kernel-feedback-list <bcm-kernel-feedback-list@broadcom.com>,
phil <phil@raspberrypi.com>, iivanov <iivanov@suse.de>,
linux-gpio <linux-gpio@vger.kernel.org>,
linux-rpi-kernel <linux-rpi-kernel@lists.infradead.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] pinctrl: bcm2835: Replace BUG with WARN_ON
Date: Fri, 25 Jun 2021 12:49:56 +0200 [thread overview]
Message-ID: <b0952272-c20d-71d4-911f-86db5f337540@i2se.com> (raw)
In-Reply-To: <20210624235122.24772-1-wangborong@cdjrlc.com>
Hi,
Am 25.06.21 um 01:51 schrieb Jason Wang:
> The if condition followed by BUG can be replaced to WARN_ON which is
> more compact and formal in linux source.
>
> Signed-off-by: Jason Wang <wangborong@cdjrlc.com>
> ---
>
> Changes in v2:
> Accept Florian's advice to replace the BUG_ON() with a WARN_ON().
>
> drivers/pinctrl/bcm/pinctrl-bcm2835.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/pinctrl/bcm/pinctrl-bcm2835.c b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> index 2c87af1180c4..8440c722f6f8 100644
> --- a/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> +++ b/drivers/pinctrl/bcm/pinctrl-bcm2835.c
> @@ -416,8 +416,7 @@ static void bcm2835_gpio_irq_handler(struct irq_desc *desc)
> }
> }
> /* This should not happen, every IRQ has a bank */
> - if (i == BCM2835_NUM_IRQS)
> - BUG();
> + WARN_ON(i == BCM2835_NUM_IRQS);
whenever this should happen, the source of this interrupt cannot be
determined and acked. So it's very likely that we end up in some kind of
interrupt storm. So i suggest to use at least WARN_ON_ONCE().
Even worse the value of variable "group" is uninitialized in this case,
so maybe we better return immediately after that.
Regards
>
> chained_irq_enter(host_chip, desc);
>
prev parent reply other threads:[~2021-06-25 10:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210624235122.24772-1-wangborong@cdjrlc.com>
2021-06-25 2:38 ` [PATCH v2] pinctrl: bcm2835: Replace BUG with WARN_ON Florian Fainelli
2021-06-25 10:49 ` Stefan Wahren [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b0952272-c20d-71d4-911f-86db5f337540@i2se.com \
--to=stefan.wahren@i2se.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=f.fainelli@gmail.com \
--cc=iivanov@suse.de \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=nsaenz@kernel.org \
--cc=phil@raspberrypi.com \
--cc=rjui@broadcom.com \
--cc=sbranden@broadcom.com \
--cc=wangborong@cdjrlc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).