From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B06B6C00140 for ; Mon, 15 Aug 2022 10:55:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=9Eh2suODyIzrYlAm/G1ZeC1Up5TkRHdNvzuXIqqZ/wM=; b=Hv647EmMYceIyb BOHpGwnRiUMRUz7YzbbAfh+lhLk9uu1hgnN1s8LTbjPfEuuB2aXhNNU50LHe6ur/aUK/eljleXO2C 9tYbu9JTUM2cY8KU+mp5NSaLXynu2W3hhBLUuIKbicDhQvgyYO94/MwGG6RNaVgowvOXxrJLCUWj0 S+zBVPTf8Z/zwnpBfVV8WC+N0DrviXrr020sEu7bbdM8eYNLKWTh6Uzwmkrey5Y7bIi7s4DrMLy4e PI2OGTLHVJCeB86zaY3DcprWnpHpNTE0tCKIM76r/EkbC7MWdOBIg3rJ4h7FfMdqdq+tURXy8qzGK z4aHBBiUOdjKRP7iZCtQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNXgP-00EwEc-A1; Mon, 15 Aug 2022 10:50:57 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNXdN-00EuoQ-JQ for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 10:47:54 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C648B80DDE; Mon, 15 Aug 2022 10:47:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A9FA8C433D6; Mon, 15 Aug 2022 10:47:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660560466; bh=Z+B7ZCuu32c79i/JZjsPK9ikebKrv3lEhiGMQUYzpTU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jUAh7v2a6ThnqbRQRSuRr8JyDUlf45K0SA1/KOCOhjI0SA7biZCxUi+Bva9+SJSjJ MfXTX47nM5/j7/GTYc5zR3WDj38owqfJcGUoc/t7562sW/bfLAYtABTz6BU++Vu6Bf 0+ALC0M4I+Z5YixObAyhG3v0k4nf1PDwqK/PfHEE= Date: Mon, 15 Aug 2022 12:47:43 +0200 From: Greg KH To: Yicong Yang 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 Message-ID: References: <20220815092815.11597-1-yangyicong@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220815092815.11597-1-yangyicong@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220815_034749_829850_8B09E62C X-CRM114-Status: GOOD ( 21.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Aug 15, 2022 at 05:28:15PM +0800, Yicong Yang wrote: > From: Yicong Yang > > 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 > [https://lore.kernel.org/lkml/YuOi3i0XHV++z1YI@kroah.com/] > Signed-off-by: Yicong Yang > --- > 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel