From patchwork Tue Nov 3 20:05:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roy Pledge X-Patchwork-Id: 11878989 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7154DC2D0A3 for ; Tue, 3 Nov 2020 20:07:01 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0D8D4206DF for ; Tue, 3 Nov 2020 20:07:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="YEVfsi5n"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="ABhoTRzP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0D8D4206DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:Reply-To:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=rgpnoyr4vu2nNCHSgwQvRR3kIZYMkd1axeN18jiLnog=; b=YEVfsi5nFuoKeSpt5NsAavgEhU T7BQpQZWQ3kNx4nEE1I4tCRHVi/0QomRutEgTMHm2XeQj0VSP0sH1xSaQBV8SSdJ9jE0BokCpWMlb sro6K9YyZimVn/ueFMyxS/ivIvZd/UxdBt3zY3hFZBVYZOmOsSJKriQlN2l/SQzvSUR6EyDJk02/f KUl0oNiFfVkNb3rAExlIfP92E2IBt+JmEVVkpo00/lbw7JVkF4BsNyy4a13GBL0myFSi49MjyWd8h YsT0GnG6ecYEmLZMDf237SfWN4em+59TEiZsl6ql9P98XdYtKe9iTNWyev9de2kRABLxpRvn0kEUY 2p+6jbeA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka2ZY-0002DW-4K; Tue, 03 Nov 2020 20:06:28 +0000 Received: from mail-eopbgr140042.outbound.protection.outlook.com ([40.107.14.42] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka2ZS-0002B5-6v for linux-arm-kernel@lists.infradead.org; Tue, 03 Nov 2020 20:06:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MkuRSw3PpUiStVnerRutWXwfVOsXyCzg6NiVI6PPWVqPLvYN2HIWN9yTl8b0tTVmb4ixbtPDqW8icO0q4DlXIaGDAGwzdw+lcgOrsUSVqHrhWdmF6bEko2f0ogylRW2NxXjU0bWX9dU3RZuB6deerKGON1uFnk8CHxy6XaPg7GlEhDIEgCv7zdVE4u758E7ONKFfr3nM2tzgwdZuqTYk7AwdfpoHfV8TK7aILh5KdIRa0MJx09zbQh85W3lhGqlEUImCIK4wt/ofUcM7bXnpTyRpjXN5yj4P2SeIx3qGRFtj/WulPTm9BWQN2ygi+HGL9y5VOnqdakquihTzzw5M4A== 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-SenderADCheck; bh=N9bxA+NGbiWk3kGThVewjcTk/vBDuS1uov2pEP1e6GU=; b=aJfOUXhqrDO7UoxMWonRXwmHkdIrB4sLqgKMWnqVICobtAO3rUocziGcYE5Fs6bHns4UyJfm2yZ8yVYY+/kmHYwOKfzovJZg4RqRbB99N79VX1i2QtkswuKPQibVIg1gNQVOOZQeyJk7N4GD6vFIMWhtQE21OtTKGRhObbz+VfJzA7rJTThbGydmtqwvwsie4NGbzxvWUPr+qujhAxaUZW3Cz1lf0aw9LCpjpSCc90re/s9nVIBRjW+19nTUz6V/N/DgEcs9fa+PjH9c7pRi2ZnZzpsuIdMmM4iN41wrHLooErFn/fDd7dRhgQoNqwhTSlxYbZ01GqlMNuDEXzfEDw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; 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=N9bxA+NGbiWk3kGThVewjcTk/vBDuS1uov2pEP1e6GU=; b=ABhoTRzPJjHJZJkN22BIo8VO6kCo5uFUdkLAFnuh4tXgalJl5tTJc06UmUGHE2nIyZXbnHTeqZ+FbUO+q3u1CQtFiw1FKqMLHufRyb1YVB2AMnoFsElEF6i8GHYLbKSzwfFqjWknfgz3oKdEl0oRZkCLNNmBC/G6XF4+w5aN6K0= Authentication-Results: nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7174.eurprd04.prod.outlook.com (2603:10a6:20b:11a::23) by AM6PR04MB5351.eurprd04.prod.outlook.com (2603:10a6:20b:29::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3499.18; Tue, 3 Nov 2020 20:06:16 +0000 Received: from AM7PR04MB7174.eurprd04.prod.outlook.com ([fe80::1823:513d:1f9e:ee16]) by AM7PR04MB7174.eurprd04.prod.outlook.com ([fe80::1823:513d:1f9e:ee16%8]) with mapi id 15.20.3499.032; Tue, 3 Nov 2020 20:06:16 +0000 From: Roy Pledge To: leoyang.li@nxp.com, madalin.bucur@nxp.com, camelia.groza@nxp.com Subject: [PATCH] soc: fsl: qbman: Ensure device cleanup is run for kexec Date: Tue, 3 Nov 2020 15:05:55 -0500 Message-Id: <1604433955-1260-1-git-send-email-roy.pledge@nxp.com> X-Mailer: git-send-email 2.7.4 X-Originating-IP: [72.142.119.78] X-ClientProxiedBy: SJ0PR13CA0089.namprd13.prod.outlook.com (2603:10b6:a03:2c4::34) To AM7PR04MB7174.eurprd04.prod.outlook.com (2603:10a6:20b:11a::23) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from otc-sw1.am.freescale.net (72.142.119.78) by SJ0PR13CA0089.namprd13.prod.outlook.com (2603:10b6:a03:2c4::34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.20.3541.10 via Frontend Transport; Tue, 3 Nov 2020 20:06:14 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 6ad3127b-c3db-4640-5d1f-08d88033eba4 X-MS-TrafficTypeDiagnostic: AM6PR04MB5351: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:6430; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: V6DwUnEUAq4nRg3OFcpwn644TMqvz+uHVaGU9K9CgzMsooqc2152fZMAX0lUiFokSXLdopyXXvAgHRPsUiLo6wx86Nx954MCiVjx6Bi+LgSTcN5Am7VDoX45wWZjGuiY/XKsxv/RCMGpvlIaEU88BbVULErQuJFVU7PvQqadJ5jjP3O/0bH0tZV3ra5DD2hoXIBHXGpNgojLmbd0ZdM8XuKYxciz6pdlVLUNKP7zByIMfBhUL4tarlQDPucNrvkrtEAdxokqTnspytLWfMumzux2CyuzO1Fz3EBlqNmIHUhM8xmuulXAQZTy/pTUlMYTDWIkYhCY4oiKoG/jNot9MA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR04MB7174.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(396003)(39860400002)(366004)(376002)(136003)(478600001)(6506007)(26005)(66556008)(316002)(3450700001)(6636002)(86362001)(44832011)(8676002)(66476007)(6666004)(66946007)(2906002)(956004)(8936002)(16526019)(2616005)(6486002)(6512007)(5660300002)(83380400001)(4326008)(186003)(36756003)(52116002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: 8Ln5WXpgmpmZmkqRLvB4I4EjQ3aaOHCO1FIh1qDQ5zUu4j8Xw7/N/Cya9IFfP2LuEAvzvx3z6l83YGhQn7b662s+l/z7rO+c7KfEqK7HX3MOpHqhwB/sNoGF5OCvT/v9GTv90QFmqURY94/l6rcJ4YE3aTSNvWHhiM7zHVi3j7QqFDBkyOF6h+0k6j5v4Et2HWDurCuWYZNhrGWOnV4FlaR+v3X9G5vUxUwGuF1WdedCPGVci8Lozo2xlDVhSf2DSC/FeWhJMrFuaw/vRXc3PxdCUE3ROauz/ewECArpRtlRiVABI25ZB/kZBMbv57fnBPrv/N/SXXGGY6LuzGGpQP1tWhBYQpff/fyQvMZmOuG3k2MpqYatxVzLos3cXuqnEhOAdVMEb046sXBG8Lo7u1WtO3QqUBMvQO9k4fZNFeOwNHu/e/cdimXcRW6/5bpjakRcghlZjJkUQUQl9t1O5pcL3A5bpHBmPpomxM9ARi/Eg2iwifn+xHwlA25X8Q+aYHlqWlvMAvziA8U2Y99SadxJ9tooER/Q5YrWt2BUZGsVw1/qtu4wGOI+tMPaIZJZ0Qo7QeNegYVnqJsozmqBBDdKBMspSEUzRyDtaEYeypPbZf+cddMq8w5tuMgtXUdhYnxWakoDXam6I7HwKOpBTw== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6ad3127b-c3db-4640-5d1f-08d88033eba4 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7174.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2020 20:06:16.0190 (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: qzPbA8iW0C+VzzmprHN5Ym8fey189mPiA7TR3m5lyYwN9p0adrb3LFMgvEm5AgWoDWghahGQ5rHOqfojPULpVQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR04MB5351 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201103_150622_337810_E28AD044 X-CRM114-Status: GOOD ( 14.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: roy.pledge@nxp.com Cc: Roy Pledge , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Make sure that the QBMan device cleanup routines are executed when the device was previously initialized. This is needed for kexec since the device will keep it's state from the previous kernel that was executing. Signed-off-by: Roy Pledge --- drivers/soc/fsl/qbman/bman_portal.c | 3 ++- drivers/soc/fsl/qbman/qman_portal.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c index 923c440..acda8a5 100644 --- a/drivers/soc/fsl/qbman/bman_portal.c +++ b/drivers/soc/fsl/qbman/bman_portal.c @@ -160,7 +160,7 @@ static int bman_portal_probe(struct platform_device *pdev) __bman_portals_probed = 1; /* unassigned portal, skip init */ spin_unlock(&bman_lock); - return 0; + goto check_cleanup; } cpumask_set_cpu(cpu, &portal_cpus); @@ -176,6 +176,7 @@ static int bman_portal_probe(struct platform_device *pdev) if (!cpu_online(cpu)) bman_offline_cpu(cpu); +check_cleanup: if (__bman_portals_probed == 1 && bman_requires_cleanup()) { /* * BMan wasn't reset prior to boot (Kexec for example) diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index 5685b67..4274bd1b 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -302,7 +302,7 @@ static int qman_portal_probe(struct platform_device *pdev) __qman_portals_probed = 1; /* unassigned portal, skip init */ spin_unlock(&qman_lock); - return 0; + goto check_cleanup; } cpumask_set_cpu(cpu, &portal_cpus); @@ -323,6 +323,7 @@ static int qman_portal_probe(struct platform_device *pdev) if (!cpu_online(cpu)) qman_offline_cpu(cpu); +check_cleanup: if (__qman_portals_probed == 1 && qman_requires_cleanup()) { /* * QMan wasn't reset prior to boot (Kexec for example)