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 3930FC0015E for ; Mon, 7 Aug 2023 03:13:48 +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=aTOnSq6lXmWsGS6AlCwmCNo5mbvYArAbrDlI41q5eVo=; b=TvfJVK2nfkwWpH vpHpLIy08obeMAck51iHfZbHnMbypCeRs0UDTF/WAkmOAqY6KiAbtCG/YH5KHJB2Lh/t0Bc4/6a7l BOzFU1MuNjNEWhW6soYyJZkEA9sSVG/Zn11Q9dGhXU6OcJl7s86GgjW1J6V+g+Tfg8jQUhpSBfg0v 2qJYYmREvwXd54begKbONNASgMB7ZN4PtsVlId2OOr40lduhoNa5BtkmC6ivRhYlQFolb/UroAUWt j3t2BRjfa6Vhz7Zn64pJmP67z1X2k/Q/7oPFkZIer3AvJwU2F51wt4RxeOuyZ5yrOLD2Op5oQgHKx +txZ+qsnGKuqZsLSPF8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qSqgO-00G3lJ-0B; Mon, 07 Aug 2023 03:13:24 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qSqgL-00G3kw-0i for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 03:13:22 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 835AD60AF3; Mon, 7 Aug 2023 03:13:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82018C433C8; Mon, 7 Aug 2023 03:13:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691377999; bh=uLNSAWYcfGbQ5pT6oMUu2cY9U/9eHT+/NKcyMIBS8lQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PHm6hvnIcpkHGPPepfnJvc//JpoPwfWAu3+Qt0alLMap9Bsi/51KLVttJdx5JjG+j tauj8/uhsWNl36Oxb0GiHYmPSx6kQpAplajKJDxYnri8u1u09/3hFZVT6ymHaOMBey DGX9XugsgdaCUyEGSx5NzkNUlLG8sxHrzsK4A4zUKnfppxceDM0s6ZwV8bl3TP+Buy wxSimnAoNdt5WRxaC88OIiRPXKd6/Hmqiweby7sWoh7x5IdgQDZSPvTiriS2jcEoj/ cmbU974Pqz27W+fMyaN3ap1TNKiU0jfC0qX9rBObBjOC6HmQHyXdgeDt4PWaYC6XmP o0ap3GQQBix4Q== Date: Mon, 7 Aug 2023 11:13:09 +0800 From: Shawn Guo To: "Peng Fan (OSS)" Cc: s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, aisheng.dong@nxp.com, alexander.stein@ew.tq-group.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Robin Gong , Peng Fan Subject: Re: [PATCH V5 6/9] firmware: imx: scu-irq: fix RCU complains after M4 partition reset Message-ID: <20230807031309.GO151430@dragon> References: <20230731090449.2845997-1-peng.fan@oss.nxp.com> <20230731090449.2845997-7-peng.fan@oss.nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230731090449.2845997-7-peng.fan@oss.nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230806_201321_344572_387DEAEF X-CRM114-Status: GOOD ( 19.43 ) 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, Jul 31, 2023 at 05:04:46PM +0800, Peng Fan (OSS) wrote: > From: Robin Gong > > Use blocking_notifier_chain instead of atomic_notifier_chain, otherwise > below RCU complains would come out since unregister/register_virtio_device s/complains/complaint, and in subject too. > () will issue mbox message (mbox_send_message() is blocking) again after The () should be on the same line as register_virtio_device. > received M4 partition reset. Actually, no need atomic for notifier which there is no need of atomic for ...? Shawn > is so tough for user since this notifier is called in worker instead of > interrupt handler directly. > > [ 389.706645] i2c-rpmsg virtio0.rpmsg-i2c-channel.-1.2: i2c rpmsg driver is removed > [ 389.767362] Wait for remote ready timeout, use first_notify. > [ 389.774084] ------------[ cut here ]------------ > [ 389.778729] WARNING: CPU: 0 PID: 397 at kernel/rcu/tree_plugin.h:293 rcu_note_context_switch+0x34/0x338 > [ 389.788131] Modules linked in: > [ 389.791195] CPU: 0 PID: 397 Comm: kworker/0:13 Not tainted 5.4.0-rc5-02977-g08f78722f07b #26 > [ 389.799633] Hardware name: Freescale i.MX8DXL Phantom MEK (DT) > [ 389.805481] Workqueue: events imx_scu_irq_work_handler > > Signed-off-by: Robin Gong > Reviewed-by: Dong Aisheng > Signed-off-by: Peng Fan > --- > drivers/firmware/imx/imx-scu-irq.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/firmware/imx/imx-scu-irq.c b/drivers/firmware/imx/imx-scu-irq.c > index d9dcc20945c6..4408f150b3d5 100644 > --- a/drivers/firmware/imx/imx-scu-irq.c > +++ b/drivers/firmware/imx/imx-scu-irq.c > @@ -42,25 +42,25 @@ struct imx_sc_msg_irq_enable { > > static struct imx_sc_ipc *imx_sc_irq_ipc_handle; > static struct work_struct imx_sc_irq_work; > -static ATOMIC_NOTIFIER_HEAD(imx_scu_irq_notifier_chain); > +static BLOCKING_NOTIFIER_HEAD(imx_scu_irq_notifier_chain); > > int imx_scu_irq_register_notifier(struct notifier_block *nb) > { > - return atomic_notifier_chain_register( > + return blocking_notifier_chain_register( > &imx_scu_irq_notifier_chain, nb); > } > EXPORT_SYMBOL(imx_scu_irq_register_notifier); > > int imx_scu_irq_unregister_notifier(struct notifier_block *nb) > { > - return atomic_notifier_chain_unregister( > + return blocking_notifier_chain_unregister( > &imx_scu_irq_notifier_chain, nb); > } > EXPORT_SYMBOL(imx_scu_irq_unregister_notifier); > > static int imx_scu_irq_notifier_call_chain(unsigned long status, u8 *group) > { > - return atomic_notifier_call_chain(&imx_scu_irq_notifier_chain, > + return blocking_notifier_call_chain(&imx_scu_irq_notifier_chain, > status, (void *)group); > } > > -- > 2.37.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel