Message ID | 20230731090449.2845997-7-peng.fan@oss.nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp1900215vqg; Mon, 31 Jul 2023 02:42:23 -0700 (PDT) X-Google-Smtp-Source: APBJJlEQy6KKX0dY3cw9ucLjBH2VIcM5h+BaSmBXEbXqzVON2vm22qHk8kuBPG7mGJuWy8tU4vxT X-Received: by 2002:ac2:4426:0:b0:4fd:fed1:9030 with SMTP id w6-20020ac24426000000b004fdfed19030mr5737740lfl.24.1690796543663; Mon, 31 Jul 2023 02:42:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1690796543; cv=pass; d=google.com; s=arc-20160816; b=aArM506r73DZ7g+65EaETSHWHM9uNSl5jHWS6o3326aGwLaB9bBjmpgbkVcVIfl5BJ pX243mjdLghoMcesTBzSYJyo0qzyVL7uecXi8XLrZf6B8Jl81/CQcNk8oUnhZNUFjeMv GAx7GRhLoZcZpIQXJrOdsO1g1O2jcJIhohloQofZPoFjzDrdFHXohgp0OVL5MWmvFw4R 0ub08CUywv4xnVrF8BzqTACpYLBcOSDourl7bnC+PyxFCBaJUuKNSTPa9pR6SpwrijOK QvMCS0ltUOzl8xZimpMovQmciCWiJa7MidOr8ZnLYz3ccDezF6wjfQqk5vyQs2s9jKT0 phwA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=umI6ZrQ15cKelsFX67lK86cAvVI5zNZJ2V7Gcc2eaAA=; fh=lotafNBR+zTgc4Q4jiSwh5mZA/Zx1bp0fAc65GJXTjY=; b=Aw9lgexyhizMi2BTErXajK9s+pp8ShUB2U19AsJZ7HCkL+J3zxljclpOxTRVDTOIV6 Cpkb4nhlqAhhvICfC5TSXJZxIZiW6ZMNLDs6G4Tbpr3oZis+ZSmWySbpe28wsyVHBO8O 8xlrFUOsyYvhwgzB+WWkk2uTaBkdai2x/d61wRcGp8Ymky37zk2wgiaqacYt3tZgo+3a Ed74PM/Ni2+RXoDfnmzotz1V7/J+yZZ+Ahz463i+2HqUdY+kz9VcmfLMsR5sclJ9CiSY +3ft1VLSUyh/xO0oTPoBM+0wzULBls9B/Z0bIy4zq+EorkpF0z9XDfEX1IDS9flPbpnm wg5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=H0WwN2FL; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s24-20020aa7c558000000b005223bee1f8asi6387181edr.243.2023.07.31.02.41.59; Mon, 31 Jul 2023 02:42:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=H0WwN2FL; arc=pass (i=1 spf=pass spfdomain=oss.nxp.com dkim=pass dkdomain=oss.nxp.com dmarc=pass fromdomain=oss.nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231556AbjGaJBh (ORCPT <rfc822;dengxinlin2429@gmail.com> + 99 others); Mon, 31 Jul 2023 05:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231524AbjGaJBQ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Jul 2023 05:01:16 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2051.outbound.protection.outlook.com [40.107.7.51]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55DBE1BF1 for <linux-kernel@vger.kernel.org>; Mon, 31 Jul 2023 02:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fi/ypUZqeq0hN+lPeeTy+z5Adhz2DPJN9nkuzJ9PMvgzHwg/HlvrJpHAuVdc7O3iR9ugpNkkjiU0bQMhOeKULdA+M9cqmlABo3YDdTLmbteDTHpPMdVWq0c+p9jO6VH2qn9m3tF1DwvrR5aiBGt3DjBuBhuxqmgctm4Y5wtlf/QEYifqZrQlpsZVpPBkI8hEylb4TRV4J3038qYeud2vBTbu+7GtUeGEYWfJb4Okd/mH2UCGRrgB1xKxh1QB605R4/aLFAtwdDpA4sgjBjKNscjJDEm6PSJYmGS0Ukh8+AUEoSBPQDnV9phEAiy+JbTE181Iw7EYCEPWLRB2HgLiug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=umI6ZrQ15cKelsFX67lK86cAvVI5zNZJ2V7Gcc2eaAA=; b=bV84MZoUac0O6HhAk2ccSih4hCzc0FHJkgXPIs+5RiN1zEcy1Tdpx2CPd6pr8MxrRxY3ZSAei1D/F4kEOl/FuycZpH/o+nk/4WP+VzfVf8qI3NW0wGDzfAetcaFIcdsWj5pdspE0z/UjW+qoF/79Fo+jNKkxgmvN/NhOSLSF+hbcAL6ISkpL4CV5YClhzznq1MoKPd2xlDXoCt6KiQLGxCxa0r32y3gEkzqlfTH+7F5s6tIFkOIIAID4ot3mAOC9mWQI6XTfS+poZZxf6ceapDr+aIncTYrwrocCBnbV3XzJuddC6Bn2+7pYZxZ1gAhMRsO6G7HffNibD/dGJncu4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector2-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=umI6ZrQ15cKelsFX67lK86cAvVI5zNZJ2V7Gcc2eaAA=; b=H0WwN2FLrnW7BTQCIYWHY0rVgP2WIJq7BbPjRVLLCfX8+CUhh7SOmIqhYUsif5MjptxGnRiCt8vQEm4cquBJSkNa3skJJe4++R8S4thexW+RceYnzwwhSirkL4JAdkrMyYkuYLEPCCJcY6TJu6neiqe11q5VUmFhLN519HlK0rQ= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) by AS8PR04MB8229.eurprd04.prod.outlook.com (2603:10a6:20b:3b3::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6631.43; Mon, 31 Jul 2023 09:00:25 +0000 Received: from DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97]) by DU0PR04MB9417.eurprd04.prod.outlook.com ([fe80::5d6a:ec53:f2a8:5b97%6]) with mapi id 15.20.6631.042; Mon, 31 Jul 2023 09:00:25 +0000 From: "Peng Fan (OSS)" <peng.fan@oss.nxp.com> To: shawnguo@kernel.org, s.hauer@pengutronix.de Cc: 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 <yibin.gong@nxp.com>, Peng Fan <peng.fan@nxp.com> Subject: [PATCH V5 6/9] firmware: imx: scu-irq: fix RCU complains after M4 partition reset Date: Mon, 31 Jul 2023 17:04:46 +0800 Message-Id: <20230731090449.2845997-7-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230731090449.2845997-1-peng.fan@oss.nxp.com> References: <20230731090449.2845997-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR02CA0128.apcprd02.prod.outlook.com (2603:1096:4:188::20) To DU0PR04MB9417.eurprd04.prod.outlook.com (2603:10a6:10:358::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU0PR04MB9417:EE_|AS8PR04MB8229:EE_ X-MS-Office365-Filtering-Correlation-Id: e960e039-c3ae-4c2c-7af8-08db91a4942d X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3E8w6iaxmEt/85ux4N81q9ozCw0bUhRPTs5uHzjLq/iqY1ZDFYxxjd8gua07gjO38mHAYJ/tWYRYzu/7/YmsrP8SIas6/AVYaXUWQzF98af39K45oZFSBiEPjsyExbq4WNt2pz2Jo8hEsKQhKkW5ef/wF1ueyAWRf5fHAc01NMo0wO3hGkk5tOYQX3nuUnaJm8vUlEmdFRG8XJTpLPzhIFE7P/mU/8ZTIHd9HwBQHe14mAv8NvC43+AnWWTOsAdxZ2m4/+2Po30hxxW+4tWXjxO/E98UBaP9nWHqmYPFW40TXboq6Pvm+f7pmKKBMOIVJ2VFtaA+QFaTOFHGsvo2b9PDUA5WBi8jZ+E1gZxTQRCQegeQVOAeCDpLz3gPbAFDIjY4x74gRS5JBOpH+o0MdUp/4jW3SXNOtP008rR6zUgpkRis0pDjEIregUglNaimQljme2LPoS5Kg5O/wszMAsLALUGocNVeXBol3P/67b/Dl4ZYktzVTHjDxKxouebnlWIKlsjNIZHKBqYpRqg8p9qVzLm7S8VetvXzxLzk/+ShEI76rIZtbh4/lv5CKiHo6Uc5aCkj0WjNr7DVQhq3R40oJbToImbYu2AuAN2R/w2qsDlvs0IuHk1dP0PTJR5e X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU0PR04MB9417.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(346002)(39860400002)(396003)(136003)(376002)(451199021)(6512007)(6486002)(52116002)(2616005)(6506007)(1076003)(26005)(83380400001)(186003)(66946007)(66556008)(54906003)(38350700002)(41300700001)(86362001)(66476007)(316002)(4326008)(5660300002)(8676002)(8936002)(38100700002)(2906002)(6666004)(478600001)(45080400002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZVsSa8cSn5sCJApdqYHtcwgz/dAG7FDAz2tJAsotcFJPb2cji82Wqh4BjWc78kXs5eY49nmZDY9ZJr/ZFKWiuRTTVhtuVJ+9oN1vXxTpB98YqH5zSiTkiw3G2VtR3Bal++yRkL778qVySu0VKECXxwhOXDF9FV8dXFWlhdwUxedJKj0b0DcjygFiTR9RA77m9E1hGX2tKLG808powPszUoXeyGsTJ79Ccbg0tvOtc6F7EWJaPLOr2Wrsgp0aSvuO7d9nw4MIi8XnZPVET/uDFfaN7A+NapY2qXhkI0Okcqvx5EEqvwNijvtS4ffPqoESHze6uSarfA2M4NVWbi6moL2lycZOUcFjEvGqRJUnjgvV18aA0anUyKV2Sy9VyUunh+S2B4B5Vfrhs49irTrA5euzulvae33dgiMfqbqcFNMmoaT476k4enI4GlpcCvETM7xB7ln+Eu0VPOcW93N1QvLvqY9FDtiSL48KaHiaT+mchh6GHSeZUtdT+lMquwiwJtxXBAjTQA85VpxBQiZNtbsBVCBIzsIZEmQyS0u8A8gb6DUqvSHoaa3mRSP1RS44Ej7GchTzLY3RKDxs398ik4MPHxs/4HXSnZjwEP15q4mKrHAKd2a1hu6gBfSUaJCAffE33HsglgZ1htO0vLaOzvh+pzSkISAJdnKbXMvR3SN+lefKjkcPyUThi8qxvc0HpBCrDJnXSl+rkx1y87VWJMV53kdCLucGGte0+JAR9iOFV1OMQOpEWFTntaB6k8y+Ruxhw5da1XX8HQNTuCP4HlvGFO3jLxPqsme2EccIzpVCDqRBUtBjcM6JM72sbL5Gx9o3nL1qir9g1h4myfDlwPh45tIGso2CJGlvvJjeyFRBt8U0q7QYqFUYqAtR95GRYt0e1OVSKrza/XwM751Fp+guybqV/QscTXY78PN5MvnkcihdSqyF0prCUb3i3qmm1WwekitVZMnRJbA2cWWnJAtTXPtkYHuDjL7fg91qqcHBhWNSrKCyeKBRjlijy8Afqz4xXIR3NvYnrELSo5dcXqOlHa0+0kldFm5KmawBaf8tJtT6zy/VrKEsA7eC2mmw2cLQ/c86NkmpoHOn5eKbwc7G9Vud87EW6D2jtk2vxAy+OtsvHhRdeIRSeAYeNQs5vHPeUIGKmpMoZrVO/Q0DWYpujtVgVqnjkAuVyMyrRMpFI/4NoRv6140mx0v/TIO/rjfVYznH5bpKs+tXgwuuhCTRR5DKM/yNExsmiw+wG4+gR8aO9+sDOH8XUCjdhrLsD7fIVl9zFhGKS1M557wgGj0mrb0EpojN6W7+7pEsXThBSR8I2vHe2oG4njZfj0EDA+m8V4KJqfv0klMnahMiD/S9INu4GIXWkg68vyRoXK1AyivoHHR/EU4DuRSAgktdfXVPN+nMTFo5gl/OOgfGpIjIFV5puVdngo4zkNZdE4Sh9sqdACiUVBjzr6enTuJfqDp0MdorxWy4VXqCZDTAGXxtjqoQFuUpURGfHNUX4Ch3F1lL+hkMKNTEqyxToa8VpASd8mFb8sU8auRGC6ktDgeoHfOzyAdwwpT5QNVWI1kUKY4YCyW+eFnc6Gj6g+Yr X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e960e039-c3ae-4c2c-7af8-08db91a4942d X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Jul 2023 09:00:25.3152 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: zqSXfKApVvwvADQ1JB877odIvz8fJcYpYbcSvQg6CtMusEYa3KuDdX+52/0/HglxoImJmYoAWFRZ47qVrYJ+YA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8229 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772928676516283534 X-GMAIL-MSGID: 1772928676516283534 |
Series |
firmware: imx: scu/scu-irq: misc update
|
|
Commit Message
Peng Fan (OSS)
July 31, 2023, 9:04 a.m. UTC
From: Robin Gong <yibin.gong@nxp.com> Use blocking_notifier_chain instead of atomic_notifier_chain, otherwise below RCU complains would come out since unregister/register_virtio_device () will issue mbox message (mbox_send_message() is blocking) again after received M4 partition reset. Actually, no need atomic for notifier which 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 <yibin.gong@nxp.com> Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com> --- drivers/firmware/imx/imx-scu-irq.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Mon, Jul 31, 2023 at 05:04:46PM +0800, Peng Fan (OSS) wrote: > From: Robin Gong <yibin.gong@nxp.com> > > 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 <yibin.gong@nxp.com> > Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> > Signed-off-by: Peng Fan <peng.fan@nxp.com> > --- > 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 >
> Subject: Re: [PATCH V5 6/9] firmware: imx: scu-irq: fix RCU complains after > M4 partition reset > > On Mon, Jul 31, 2023 at 05:04:46PM +0800, Peng Fan (OSS) wrote: > > From: Robin Gong <yibin.gong@nxp.com> > > > > 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 ...? I'll rephase the commit log in v6. There is no need to use atomic notifier for scu irq notification. Thanks, Peng. > > 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 <yibin.gong@nxp.com> > > Reviewed-by: Dong Aisheng <aisheng.dong@nxp.com> > > Signed-off-by: Peng Fan <peng.fan@nxp.com> > > --- > > 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 > >
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); }