From: Greg KH <gregkh@linuxfoundation.org>
To: Yicong Yang <yangyicong@huawei.com>
Cc: will@kernel.org, mark.rutland@arm.com, Frank.li@nxp.com,
shawnguo@kernel.org, s.hauer@pengutronix.de,
kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com,
zhangshaokun@hisilicon.com, agross@kernel.org,
bjorn.andersson@linaro.org, konrad.dybcio@somainline.org,
khuong@os.amperecomputing.com, john.garry@huawei.com,
jonathan.cameron@huawei.com, yangyicong@hisilicon.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH] drivers/perf: Change WARN_ON() to dev_err() on irq_set_affinity() failure
Date: Mon, 15 Aug 2022 12:47:43 +0200 [thread overview]
Message-ID: <YvokT+ZQQMlEAga8@kroah.com> (raw)
In-Reply-To: <20220815092815.11597-1-yangyicong@huawei.com>
On Mon, Aug 15, 2022 at 05:28:15PM +0800, Yicong Yang wrote:
> From: Yicong Yang <yangyicong@hisilicon.com>
>
> The WARN_ON() on irq_set_affinity() failure is misused according to the [1]
> and may crash people's box unintentionally. This may also be redundant since
> in the failure case we may also trigger the WARN and dump the stack in the
> perf core[2] for a second time.
>
> So change the WARN_ON() to dev_err() to just print the failure message.
>
> [1] https://github.com/torvalds/linux/blob/master/include/asm-generic/bug.h#L74
> [2] https://github.com/torvalds/linux/blob/master/kernel/events/core.c#L313
Please point to git.kernel.org links, we do not control github.com and
it's random mirrors.
>
> Suggested-by: Greg KH <gregkh@linuxfoundation.org>
> [https://lore.kernel.org/lkml/YuOi3i0XHV++z1YI@kroah.com/]
> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com>
> ---
> drivers/perf/arm-ccn.c | 5 +++--
> drivers/perf/arm_dmc620_pmu.c | 3 ++-
> drivers/perf/arm_smmuv3_pmu.c | 6 ++++--
> drivers/perf/fsl_imx8_ddr_perf.c | 3 ++-
> drivers/perf/hisilicon/hisi_pcie_pmu.c | 6 ++++--
> drivers/perf/hisilicon/hisi_uncore_pmu.c | 6 ++++--
> drivers/perf/qcom_l2_pmu.c | 8 ++++++--
> drivers/perf/xgene_pmu.c | 6 ++++--
> 8 files changed, 29 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/perf/arm-ccn.c b/drivers/perf/arm-ccn.c
> index 728d13d8e98a..83abd909ba49 100644
> --- a/drivers/perf/arm-ccn.c
> +++ b/drivers/perf/arm-ccn.c
> @@ -1210,8 +1210,9 @@ static int arm_ccn_pmu_offline_cpu(unsigned int cpu, struct hlist_node *node)
> return 0;
> perf_pmu_migrate_context(&dt->pmu, cpu, target);
> dt->cpu = target;
> - if (ccn->irq)
> - WARN_ON(irq_set_affinity(ccn->irq, cpumask_of(dt->cpu)));
> + if (ccn->irq && irq_set_affinity(ccn->irq, cpumask_of(dt->cpu)))
> + dev_err(ccn->dev, "Failed to set interrupt affinity\n");
> +
> return 0;
Why are you returning with no error, if an error happened?
Same everywhere else, you need to explain this in your changelog text.
thanks,
greg k-h
next prev parent reply other threads:[~2022-08-15 10:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 9:28 Yicong Yang
2022-08-15 9:39 ` Jonathan Cameron
2022-08-16 6:22 ` Yicong Yang
2022-08-15 10:47 ` Greg KH [this message]
2022-08-16 6:26 ` Yicong Yang
2022-08-15 11:25 ` Mark Rutland
2022-08-15 12:25 ` Barry Song
2022-08-16 7:37 ` Yicong Yang
2022-08-16 10:26 ` Mark Rutland
2022-08-16 15:20 ` Yicong Yang
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=YvokT+ZQQMlEAga8@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=Frank.li@nxp.com \
--cc=agross@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=festevam@gmail.com \
--cc=john.garry@huawei.com \
--cc=jonathan.cameron@huawei.com \
--cc=kernel@pengutronix.de \
--cc=khuong@os.amperecomputing.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-imx@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
--cc=will@kernel.org \
--cc=yangyicong@hisilicon.com \
--cc=yangyicong@huawei.com \
--cc=zhangshaokun@hisilicon.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
all inboxes | Powered by JetHome®