From patchwork Tue Feb 8 14:59:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurentiu Tudor X-Patchwork-Id: 12738844 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 C133BC433FE for ; Tue, 8 Feb 2022 15:03:26 +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:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=h/Xi02cxtZ/yPIKyg025SGz8mHyy/+Pmwl8MWhfo5zY=; b=TCD/Rh5a7HwE6w R9XbCdVdB3+bmBU+iLZjJrZUz725Kiy3IDyeM7G7j7Bn6GatGlqViJyZDmjPvViKE02kmA5430eL4 92yDvzFkL7gNg6QNYhqqRhhpwiqmDozxc0l85xAzm4fnZphYXqHfLJHrIwquauAMRsHAPqk9a97Fw LKv5HJ3ZcOMplYRq5GYG3ZgTxcH2Ss65XRbXL3m/cvecx7BJGbxxHbJkaf2sbvvwBlSQDt5DxHr3W RZzI2IqxdkrNaRml/v12Q4T+4L1tnRm0UNxc0quTf1goouZSzvSAx9fqMKOpup8CpecGaCMAHXuIC ++Aky//2SGtyjZLZTBig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRzi-00EMKE-Vw; Tue, 08 Feb 2022 15:01:27 +0000 Received: from mail-eopbgr30046.outbound.protection.outlook.com ([40.107.3.46] helo=EUR03-AM5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHRyI-00ELgd-41 for linux-arm-kernel@lists.infradead.org; Tue, 08 Feb 2022 14:59:59 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=foGVUmmSDbgAp8bOkccqNb3mzIX1opRbXJIOO2lAGaypBc1IE269UhlvbRPm11JjNQtuxD+WtDM0yV+za8x1/Kzzbk1/mxwpEiS+wZPFc/aD6NpYvlaiVjIj1MLlhkm9D+aCj4FrgHt9yqYZh7vdibQjeMOkV/jarAA8xHpI/ZMj4Wk52LGQXo/nVe7D5P5NRpRIrRSPuoAZJbe9DBYZF/5lHmfd8xrRAUU7KplHj1Me5I1NH4cn02bV+7Rl5OAwNLIwDLyqf/BPnkLWhpoZbM3cO8Qg3l7Ua+DubA9rC5gcSDZrUPgF1sTJj5pX/OUZc2NBufTYXDphvhAA2qzG+w== 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=oWxulmt5pKpIYfZj8l1bKz1fd617C0peC5yCF3jz4VY=; b=cKu49UAJKVduXjRoh9vyDjVeCBNiBOZbyEflohHMgBKmue9Uau+v4TbnENXx67UiKja1p8Ofrd/PWwRNXWZWDySVIIDhn57OD+EJsoOtX6DZMusXaa/5cTUxa5Dn48keesNo8oAhIOOw5TGZ1W1enl0izuYiruBxytfaj1VZR8IR5ifo8SzKcDE29yQKN6q1wovq5F6QK9lHszE+E4JZlX8ZGwNIuL1pWeDGzoepXG5nreOmE1s58fO69R5Bgz1dS8tcQcCjUFOJVfOp7yrPCiqH6L8I/JY5tezsYGr3t2CBudf4rdpnqhldG3T/rjn4osMuLqQM/Zeee+HQ8ILexw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oWxulmt5pKpIYfZj8l1bKz1fd617C0peC5yCF3jz4VY=; b=FnRy0GEQQfy8quL+vK3xj/o3klycUdg3I0H2d0O5bdUaju9zhGgRajWQl06MV1WfVmhOi8uHgh/FNzYJGusiq6LVtLtDTDzGtbvuZ919HfPJyE+i3xOpFJCAs0vKe4FA6qJwjig2OYNq9dnjhQHJv4U2wuxG2QlWW3Etxqw8QoY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) by HE1PR04MB3018.eurprd04.prod.outlook.com (2603:10a6:7:1f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.19; Tue, 8 Feb 2022 14:59:44 +0000 Received: from VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53]) by VI1PR0402MB3405.eurprd04.prod.outlook.com ([fe80::f826:3bf6:b77d:5a53%7]) with mapi id 15.20.4951.019; Tue, 8 Feb 2022 14:59:44 +0000 From: laurentiu.tudor@nxp.com To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: ioana.ciornei@nxp.com, diana.craciun@oss.nxp.com, jon@solid-run.com, Laurentiu Tudor Subject: [PATCH 6/6] bus: fsl-mc: add .shutdown() op for DPRC driver Date: Tue, 8 Feb 2022 16:59:28 +0200 Message-Id: <20220208145928.12468-7-laurentiu.tudor@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220208145928.12468-1-laurentiu.tudor@nxp.com> References: <20220208145928.12468-1-laurentiu.tudor@nxp.com> X-ClientProxiedBy: AM0PR08CA0025.eurprd08.prod.outlook.com (2603:10a6:208:d2::38) To VI1PR0402MB3405.eurprd04.prod.outlook.com (2603:10a6:803:3::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 63b4a48b-8a9b-443e-8fef-08d9eb13a41b X-MS-TrafficTypeDiagnostic: HE1PR04MB3018:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 7p9FBeJabpVRIQJslyEuag/K1QPdQp8jHkZu2vUVPAXkWxOIXvuRoabrDE4ZGpe3GIgAkgiNj87M5Fp/qkXysXwkp5RwGxF3+hwsqaxIu9rz/RneR3dg6xTH63LsE618jk4hQmTmQUlL++6iFtzC+4s1mKW7EXojx/HaDEQn4vnDwO26sydlvcsoN9PzBAsxXHWb0dMutS7ekwPGVrpkpcNJD/i9TczePdx8a7AS32JGk9fRxWzy4I9KM38HplovgbY+JvmQKgBLVKeY6ivI7ysufFpupIh/A6M+3+Ft8J5SMMG/MJTZykpBGWZ5pVbWlUPNpGDlAE61i/icOkKaS6qck3euQFLTCJn/qWZVDC30dkukzdWc8Ihi09xY4SjqU43kdAl2o3RlB8ORZ6/vIBg+Mf4oUesaMQXovGcN/cfUliLI+EAJybusyU1JV4vnOdz09UYS+LNurnYCofVa5fX4MgwLoedEW64fBz4yDEoI0tuHKMPNd84Zxo99h4BoWGFkZIRN+BtmyhtsJq4SgpPjYGVo4bs3+KPArQpl0Ikj5duj5o/mHDmRPtFafcFES6RqWSYIMv8spWe8Wm0lGfqnlZkGGgz9O/vYxMh9CqlzIB4A8bopIrQodDym/pnQcV9e04CaYecO954G779JDwTzO25bMBCE01EYTtFhO/+tv+4GJEjCUTTDsKr8B8589TFujh0xcLWAlurKLyZPo4I00puHjt3yR8zTPwE30Ms= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR0402MB3405.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(2616005)(6666004)(66476007)(316002)(9686003)(66556008)(508600001)(52116002)(186003)(6506007)(2906002)(6512007)(1076003)(26005)(5660300002)(6486002)(8676002)(66946007)(4326008)(86362001)(36756003)(83380400001)(8936002)(38350700002)(38100700002)(142923001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: D7V2S6EemvJLobL8U24ZPeRpXVeEykQrUbzUQa71Axm0iDXAyjolR8ffglcd/ck27xADVKHV3Yb5vyTW1qj1TgOW//Mypw/e4BOiwxv1rDlYbdb/EkK/If9yq2auAb5HZ5mNfzeOJ5J+Od0Al5hGeCoX2uAu9DXc55pwBKs/1mG+n6o0xXY0vBBIgzqZazsXIQKeaMKXCmsFctrm87eb9yQGVFAJqWQECBOZCzAc28x2yDIrux1gpLv5u+o7TOrGzgAQRvhpfdx/DqMqMxl1eIsrI+wsjLtTEdcrtb1yqf3Wg9QPLhnCOaFRpJatY3uMGUDYQMl6F6nSPNULGF0FOKF4dwJaIjK/Dtkl3V4meVeKOprzzIFHqcI6VFUL539XIAtPrDv/U8mNDqbCgfChDJnDeB6j+HjocEAoDfh3XfvZsly9swr8T/pU/yoYl3GonkVyTRg1nYPBmGeuCERS7o+l+WTreVxEtIfQK+emMqyRr+rq1MoYmDkvbvHDbNn1gxSXk++yt3wEDuNEcGVxDAXjdfhGUFKiJbOE4JMEAEvAbkTOC2QaICFWMYCN25or0nJ5Y8c6gMOI0X/k74BlgM2dOVFMPnAlM4VQ4w0CKL8cbTsJLHQH4Og3ysnj2/TOj3CJ/5w5Qq+TvkQFmS1cZ74h3NomaOL8vcdxLVNuPfwHHp1QoI4z92WdBHaRcoPYN7YACynse4iSRXswonBmO3g9O8NWc8AmxItqGwQJKn8Z7umM3q2S40RuxggggHzNntqLA4ez6CLJo3TEgNwfpnSaaUFdWjrFE4BMUND0AauzsSaEeyd25gKOwMsc7p3Hor3wu7fGFjBZhYg5Drq3Li2DxIMONQ4aeAnbxHqbhJ6V0hUHPp3NI82SgfyWslPdVpJERKntupfzkk7uT/yNlaWozGXLAEwiMhEdGmJXmPbafcXEW8PYc7+2naVEoRBnnyM8sNyJAGBI76l15K+yXDUFlgkU8pElXx9qKxIM9bILJnf4aEMrX6VbhSD4zoBzAsR8hEga8KfcYYg12mNfJN38GHcKJvFI+RVq+sWftfe/jge2HC4GaiURVGJwPyLyvf+VOP0fRz3t/Oyu/NhDA+erZdx8NDhJCrAeITgfeTdEspKy0OdGGOf03LwYVAWsTabwkzx3a1T3kfWkHh2V9YkajxZ23Jq7uBTJTvG3E3adsa5d3CF3RZ3k0hTnScWjp9LZbzD20jEmeg14N6gOrMmdL6nYiWMd9dcC5s9i0zOlg2fYsMwNX41ZGA98teW6PnvtPdEOA45oJkiMO2ffk5LMxdTKRmzYD0W6JErVGsfawgFkkRXM7YksWF0D7knyfx3p5g+RyrEvnYRa8kEzfpigLOlEuLuRtH1siHeQAeeSHyQJJXj2/IX9zm4xIUZ9qndijOKvXitZF+Zy+5lOnGjiBapkzQON2MjaeYXmj9v7AD8RmkdLL9w+onchkSYFroUepG0mtbW/gIZElNM/Qvt9m5+fTw6zDYKlSlt0EeVv8BkAulNaKXc2bXXBTsx+MLJJxSxdhQcoUpmPyvVtDmLf+mNlk+srt4MiP/IjGm55KMlIrD7WEmVNLx68DZjfHsD5/qYR0TeEltvmXzBcMQ== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 63b4a48b-8a9b-443e-8fef-08d9eb13a41b X-MS-Exchange-CrossTenant-AuthSource: VI1PR0402MB3405.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Feb 2022 14:59:44.1530 (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: ueabyqt34p5Suf3eGPHZRC5NiivLa11BA6uULrV88a/Al7JIDgEE3cRIOQ+oD449j+pf6H8cZg6fbNKxqhO95Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR04MB3018 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220208_065958_207200_592BB606 X-CRM114-Status: GOOD ( 13.11 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Laurentiu Tudor In order for kexec scenarios to work, implement a .shutdown() op for the DPRC driver. Signed-off-by: Laurentiu Tudor --- drivers/bus/fsl-mc/dprc-driver.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/bus/fsl-mc/dprc-driver.c b/drivers/bus/fsl-mc/dprc-driver.c index 82bf3fe09273..405cd054c2ea 100644 --- a/drivers/bus/fsl-mc/dprc-driver.c +++ b/drivers/bus/fsl-mc/dprc-driver.c @@ -861,6 +861,30 @@ static int dprc_remove(struct fsl_mc_device *mc_dev) return 0; } +/** + * dprc_shutdown - callback invoked when a DPRC should be quiesced + * + * @mc_dev: Pointer to fsl-mc device representing the DPRC + * + * Closes the DPRC device in the MC. + * It tears down the interrupts that were configured for the DPRC device. + * It destroys the interrupt pool associated with this MC bus. + */ +static void dprc_shutdown(struct fsl_mc_device *mc_dev) +{ + struct fsl_mc_bus *mc_bus = to_fsl_mc_bus(mc_dev); + + if (!is_fsl_mc_bus_dprc(mc_dev)) + return; + + if (!mc_bus->irq_resources) + return; + + dprc_cleanup(mc_dev); + + dev_info(&mc_dev->dev, "DPRC device shutdown"); +} + static const struct fsl_mc_device_id match_id_table[] = { { .vendor = FSL_MC_VENDOR_FREESCALE, @@ -877,6 +901,7 @@ static struct fsl_mc_driver dprc_driver = { .match_id_table = match_id_table, .probe = dprc_probe, .remove = dprc_remove, + .shutdown = dprc_shutdown, }; int __init dprc_driver_init(void)