Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2965148rwb; Mon, 7 Aug 2023 06:22:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5hwxkAqesl9NwQu6Q0xOpLUZq/E1DC54DwuUVgi4pL/7lxoA9G28B8cZ9B6ApHV5MgC60 X-Received: by 2002:a17:90a:d792:b0:268:abc:83e4 with SMTP id z18-20020a17090ad79200b002680abc83e4mr7191500pju.26.1691414567508; Mon, 07 Aug 2023 06:22:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1691414567; cv=pass; d=google.com; s=arc-20160816; b=DhIn/8xH7aQacA6ey4+eX2yplAYqiW4UQa6kYR+rQyC+DKxx4vMmxWpD3DYJMpC/eV QitqGJKHUFkS0Xq/+gAM9zaFSr0+/gCc67u7KlBhT2Qxd2pukMHd0HKMDmNVe4PusVip ndAvBIHqSBl/ueNlf/MfqnO0b0dPbCbsK+MW3PJ110daUvdX5k6z/xZZpxHpwMURCjUP qk+r/2YY4Cs66JUoj1PGwghgW9QensKtCPt+2J7YVDbLIm69OgUao4RitHQZYM8sIqbi 3UebT5Q7A3q2hF8gETjW6ZcNHP2mUljtUWygMCxKAkZ3FHzHUK6r610sc2oEGtFJqKGh zqjA== 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=eJJqcTom4DUPHiuLbywdxILIeSIa+VbUbkHM9Dddgcg=; fh=lotafNBR+zTgc4Q4jiSwh5mZA/Zx1bp0fAc65GJXTjY=; b=qg8c6KlUlTT/Nrv+hCpXjt3QSMwQR2kzntQIGL9UKGfwxgQxlT8fpPySfebrsX0S+/ R+gwr/7mtX1pH/ImYed8e1jq7UUw+9xDaw9H9z6r3VG3I3S7WXk2AoS+opWNByX38nDT ulkdM3WqyxGvimatQMDkeP+BHudCrmAgReS3kUsNMAPs0Qkq9OmhYcYRxByaOz0vruks SjTHq3mP0IaUM/4ED9EAwvYKlWd03hpkb3sUyOsQeJpKHfVwEkMgNJDjel8wapg3Yhlx ZGS8UGdFlsVKakq1+13iT8h/dkZ6So+G0SsujUW3SewRBo+U2flIXhPxyC3kY+Ig2JzC 0sWQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@NXP1.onmicrosoft.com header.s=selector2-NXP1-onmicrosoft-com header.b=TLKrMr9r; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu12-20020a17090b388c00b00268137c2f12si9434386pjb.2.2023.08.07.06.22.35; Mon, 07 Aug 2023 06:22:47 -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=TLKrMr9r; 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 S233279AbjHGMKb (ORCPT + 99 others); Mon, 7 Aug 2023 08:10:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44318 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233286AbjHGMKU (ORCPT ); Mon, 7 Aug 2023 08:10:20 -0400 Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on2085.outbound.protection.outlook.com [40.107.13.85]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 20CBC10F6 for ; Mon, 7 Aug 2023 05:10:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qtet9YP1FExt4xExgYwIyVh2SHfbIXfJPB1nof0xrJf/xPpCB4DupeXxdJyS00EfXzSGtLZOPNJvvim9CyA+bvm7XGubVfaPH6F5ah1UQX/5l/X8aUUeeRszf1ncU0jzsdV5+ZbvEjPfvZUrFk3ki7nI7ebfuellbiBfv+nF1rxSJuasaCyLpl6ZkRwMQWdsWDUTcS0bwZI5AlB3rJA53ndhpxhky24HH/f5c375s+Ct1HBAnhhYWQDyoYZSzadKsVkwjSNp+rf5FtkYcYZ8PDlEQ2B8ZxNliEvLe3mkjSb3ZLAGTWgJKka1GWBeE8g2c6byMChkqajXRcNckcvv6w== 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=eJJqcTom4DUPHiuLbywdxILIeSIa+VbUbkHM9Dddgcg=; b=F4th6Rci5Tvdl2SYazr71E9xhiyMZV3xioVZifZnCNhzw9oqYfr6hv25HB11H3foBQg5QIQzCDd0z+qUKr2H0FRVEoJpSrf56Iq5qTL1NzyGq8mGc/zBX3pwOs0tz0nzU6TnVTmeQj/y5e8JPoiauFHAGgqsyDuc09X/M1Kz8aXjvRRkJ9taKmUgGD2WLE8WVfXRDGyzMK27Zm3NbH+PvoOn+CnAP37aPWiqD35CYkgoqh8lOCnkoJRv1L5h0/jyNxEsNGAQ/CRLv7WevsmwzWD26c00lJIlFVV1LPGESRxv83gBzHAvGLhgHjGFtFlJzrBDw2ED/fybcdtnDehjcA== 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=eJJqcTom4DUPHiuLbywdxILIeSIa+VbUbkHM9Dddgcg=; b=TLKrMr9rZvQNVRHKIVDUPOZGsnKL/dmqNf9/oKIe5qh+sP+690aCWMuFm8xi1/2cs5cZHAWXG1H2N6tXUBkvmaM30BH2iqnNU+whf1qU8hk3CqMku4acRDz4k7HglnGT6Gryn5FuKB1SB4ES1r0wErjffYkBxQ4C1DsR17t0QJc= 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 VE1PR04MB7261.eurprd04.prod.outlook.com (2603:10a6:800:1a3::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.26; Mon, 7 Aug 2023 12:10:12 +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.6652.025; Mon, 7 Aug 2023 12:10:11 +0000 From: "Peng Fan (OSS)" 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 , Peng Fan Subject: [PATCH V6 5/8] firmware: imx: scu-irq: fix RCU complaint after M4 partition reset Date: Mon, 7 Aug 2023 20:14:29 +0800 Message-Id: <20230807121432.3970610-6-peng.fan@oss.nxp.com> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230807121432.3970610-1-peng.fan@oss.nxp.com> References: <20230807121432.3970610-1-peng.fan@oss.nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SG2PR01CA0158.apcprd01.prod.exchangelabs.com (2603:1096:4:28::14) 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_|VE1PR04MB7261:EE_ X-MS-Office365-Filtering-Correlation-Id: 2c4bdb32-d316-475e-3595-08db973f4020 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: syunkNQF79nDMbYwR2I4Sks8ZFUWvmXRqGJobkliPM4YdeCZpEefCxFKVcqZh9UZ8sY+6C+Uile2MNblSiqNwa8o2wNBwdtiFox8JB6HUNSREk3lSebQDYMMdDt5R18mVBX6p/+dFSXjABEWLAJBCAD6+YT6ZP8W6rY79l1Pgu+kO8ew+5hiY88v5EYfeQB2gHc5V229Qsm/24KMAhRI85Dqpx5WoXqt4z5MK3dvQb+0AclUX2SIHAIjehMAFD3/eePb/ySgAwNnncxjAdK9uX3dlzV85DyVEb1GQ+VZPPEBON38Q+lHsfx3bKBpKXzzC/cOILetJeZdFUkv9oSNrF1VA+i0tWOVlrkMa5nej5E6WhLZMqB89emUgg5d7TE644IEQwU0WMt7ElSuOlruzGq8ObO6Tj3aAUX1IAClf5S787gcmW4ax2rPO49zIFuzMZOOJllaoPYsEI/FxFtMeV+z9ayGDmAt3k2ES/+HvP0VKM363DB4A6yd+z05EoGEOIHQaQW/jRY1PSGwDNDZlj0n2cwDiBzEr6+CLGLeh6iANyboCRoW7X6yI7kUCfCWf/VThOPsqJkBIueNyNu/GFd3MMT/i2sKU8UNGDIb0aqlTqGjRCQhJEGAyE1lisPD 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)(396003)(346002)(366004)(39860400002)(376002)(136003)(451199021)(1800799003)(186006)(6512007)(26005)(6506007)(1076003)(54906003)(38350700002)(38100700002)(5660300002)(86362001)(4326008)(2906002)(66476007)(66556008)(66946007)(41300700001)(316002)(8936002)(8676002)(6666004)(52116002)(478600001)(45080400002)(2616005)(83380400001)(6486002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?B22SRe8aCrkOJxc7Gi9K4bqsDAfVlmIXmyIc6h6Hm9mEQr3b6rj6UpoTyAtz?= =?us-ascii?Q?iSZQCYZBjiRIb37C5E4x9MrATwO2addy3T4Gm9stfMtSJnW5urf/EjcL2VF5?= =?us-ascii?Q?ljgrkka1052uGoG9fGSLiA0vOnpGozK6nwD6JGPZIxbRzD2eHgH1k1/JIBkq?= =?us-ascii?Q?xUbzqTNUm6EEqEXrK4zdw3Set7whcmVL//VAQx0QvJikhqhvHC7TJy4yGn2X?= =?us-ascii?Q?HLQdfXqyC6pie1pJCwgfG4i5zLK00EEJWHtV1S/nq5IbzxUn5hpHGjCjEW3w?= =?us-ascii?Q?kP3Q64HxlK8pnPXLdcFvElnW6Sp93AIZ238RYryqss076IKazM7reY+Zu5O2?= =?us-ascii?Q?V/vRqPX1XgUnOoThS4VZRFqHGmKS4KOS5IaqOFkl9UJSJ1Vio3Fg5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zsFaseKATeFHn8THeWpCcvOeIy+eEWzgRO?= =?us-ascii?Q?j9sqlZmf/QNkhhDULBCP1Fkkjs7OXP1Pyr1bGwX2bKJn2BImLVcN5ikaAIUD?= =?us-ascii?Q?+c4TKqLBtbiroHHzDFyLS/1Fz4LKBjJAZtn51hO++WSL6/o6lT7AJO7DwXlj?= =?us-ascii?Q?BxLb6KsPMDGF4Yr12fh2oEXbMbXpIDmXBNoJWsAQInOfAbz+7rCprg4FGfYh?= =?us-ascii?Q?wU0DU1JdvXwLg1Zak763D1+pQkj+obORtcxoHGQkwIIjBGyvDJUNenk73/ej?= =?us-ascii?Q?cv7dcVYer02KwFoq1hedCqmhACrvalk5uCuokWvi?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2c4bdb32-d316-475e-3595-08db973f4020 X-MS-Exchange-CrossTenant-AuthSource: DU0PR04MB9417.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2023 12:10:11.9235 (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: Ni46P3XkEhxjozonI6YXOSXfYmLL2H0r0SA4+G0GAhbpMjLe+xJUWkS40B87cd0qbhWG48C1tDs5bDhk4TmVfw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7261 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 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: X-Mailing-List: linux-kernel@vger.kernel.org From: Robin Gong Use blocking_notifier_chain instead of atomic_notifier_chain, otherwise there will be RCU complaint, because unregister/register_virtio_device() will issue mbox message. mbox_send_message() is blocking again after received M4 partition reset. Actually, no need atomic notifier for scu irq notification since this notifier is called in worker instead of interrupt handler. [ 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 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