From patchwork Mon Oct 9 10:05:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Gupta X-Patchwork-Id: 149921 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1759048vqo; Mon, 9 Oct 2023 03:06:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFdTKs6S4IWoIZFm9FMQRtd5T1uxGHGcApXk/RS2VaM/a0ibE7Wok8riLWFIL5RapNZVZZ2 X-Received: by 2002:a05:6a20:1611:b0:15a:13f3:49ca with SMTP id l17-20020a056a20161100b0015a13f349camr20707799pzj.9.1696846005261; Mon, 09 Oct 2023 03:06:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696846005; cv=pass; d=google.com; s=arc-20160816; b=d0dch72ungm8s80Lh31X+45ZLUtSb4YspdoDmxirAcePoyyTDD1kIUhxd/0qknaKCN A7F1YV8Bvkk949FhB9RpD/+7Ea/u/hMOq9lEsRyYkBmk/MaXeVYo6EtCVxfFR6iWv/m1 X2RRE2WkwjdqGgHZAAljuYTxnwt8EZZ+ZMW9ba46NKH0pgMDBEx44yLssY96ChGDfDgC QBEN8UDtlzKVsxnv4NNAM7VHEnNWw5jr26ySkawwF8rM9jmgmvZq806ZJod4UDutQMu6 Gdxjq4Ve/6Mh1lDpiA82wRz1q/EclKAnDIAu/qVOGDxftViB+IdqPBGItrpDKrzYUhrr 535A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=3bOSTM+yEk4wMHZfxyFrjgvwUwfOEgcd9FAeju5IZTk=; fh=GTOTMXDy+VCvZcUtE228lBPtDzGkyirl/S1BKf59DSI=; b=BIUJiweED7N7qsIPSqf+24uDlJjrtHJzn0IwMSOvTYOrsdSrBUcbjfoOjtnoSs0CIJ ji1/aPmClQSS0h52ev+4isD1lsjkOMwhe2wOtorwnsBmuYfnOvAsREqtiW6jmTks2rmg ENHFFpRKfBzB4pvwhCBo9Y7j3KHkVgNthF8HjLAWfPp1waLU6hoSkim3hI1CtuPhxFij Us2bg+gOKHJcTx+HDeLnunIHZrOn7RsjqfmPCdfix9Jz+syvUOaNQu25fyMp+sBNF4Ja QTylId7DpAk2SUgfMADYbn3be3EvPnPwHUHd8H+qJUbHomLphrlMb+sbIX0WJuVFgQMh pUXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=POX5C6Vd; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id w9-20020a170902e88900b001c753d6b95fsi9842561plg.315.2023.10.09.03.06.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 03:06:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=POX5C6Vd; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 0F9E38042850; Mon, 9 Oct 2023 03:06:42 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346056AbjJIKGV (ORCPT + 18 others); Mon, 9 Oct 2023 06:06:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346057AbjJIKGS (ORCPT ); Mon, 9 Oct 2023 06:06:18 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9BBEAC6; Mon, 9 Oct 2023 03:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gVvDO2gwdTq8TfvnJz2cVzWMWGi0OtukPcUmCei3JrOS36Un1oohFvWQdXCsJW8jccZwTf9T0twnfXwujMo5id3sf5WP+IRcP2leQgcZEdQhshryN4tBOH3ZkKbyqrzs+yhzWnXUITZFgf3H8TEdTdzmqYp4IGDVngxQAZ1ZUZX0fKa9AKR1tNnuPFS8foOeXJ70pXqGArBHSm+4k77vgoU6uGLHKr66t8iqkk3tJaPloXTAH+QHqoCUDkNAlm9Bt1TOlmb1x6iOYYYiXlwxOoyse4ndFWVyqoAHNKHRzsHQzwcpL2yD9AMh480nLDqi/LxEX2CdiKN7IDXyX/+52w== 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=3bOSTM+yEk4wMHZfxyFrjgvwUwfOEgcd9FAeju5IZTk=; b=f3OVGgfl0cUTfuBD1flwy52bPuS1WUcGoFrZoPKjoeh3w9R0ZK51QEQnybq2vmPlQW59WzbJa+maYKMnbcHoH+ptdeNOylzyNPap/nCgbBnjcehSWeeaap8V4eibkSUXhsZheaj3hWOAZwokqmsCST3MasfAfpPH2keguNP1J7wFQtgoBCSEbydcm4MVsWesIUINn56z1jpafoLj/YIqyinMnT1d0aBeDYbOnqd/eVoo4P+X2F9HTLvKOczmlGXCGQWzw01xJuZM7KiGK1/6Kg5I/7dJ+DSqb9LrP/J1vkvgh4rqVqJE712S+r7nTIUvv2NEY8C6FH4NFSBMIrW9VA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.233) smtp.rcpttodomain=linaro.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=3bOSTM+yEk4wMHZfxyFrjgvwUwfOEgcd9FAeju5IZTk=; b=POX5C6VdHAERC0bzoYg/Bfanom6f1DzdZMwyvMGO+jjyb0RAQQwX9dQvVXwTdtW5BprBjJOSQVIUre9YjyXB3gs2o+k1FY1eNvQ70nhgiG0tf8bwqYmt1vvATfSHPhzEpI2xFXcaGrs958Ypo0/qDC/judSaF2OTYLrtFG3evbB2zgDBLO9eWKcEscu9Hqz07mwQnHRn1bfMENTQSy5QRsvNiPqooSeaNqhAGdFgOv6/00ycXlu9+4HqFItoaYQxoGXQT8NUORsXb8+A1vW2Tod9falI9Qn6WN2PtapNj6IJbrcpTYluPN6mzIRu84cglNDNQegCDMpvJW+suPI3tQ== Received: from DM6PR13CA0032.namprd13.prod.outlook.com (2603:10b6:5:bc::45) by SJ0PR12MB5422.namprd12.prod.outlook.com (2603:10b6:a03:3ac::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 10:06:13 +0000 Received: from DS1PEPF0001709C.namprd05.prod.outlook.com (2603:10b6:5:bc:cafe::21) by DM6PR13CA0032.outlook.office365.com (2603:10b6:5:bc::45) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.21 via Frontend Transport; Mon, 9 Oct 2023 10:06:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.233) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.233 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.233; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.233) by DS1PEPF0001709C.mail.protection.outlook.com (10.167.18.106) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6838.14 via Frontend Transport; Mon, 9 Oct 2023 10:06:12 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 9 Oct 2023 03:06:07 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 9 Oct 2023 03:06:07 -0700 Received: from sumitg-l4t.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 9 Oct 2023 03:06:04 -0700 From: Sumit Gupta To: , , , , CC: , Subject: [Patch v2 1/2] firmware: tegra: add suspend hook and reset BPMP IPC early on resume Date: Mon, 9 Oct 2023 15:35:56 +0530 Message-ID: <20231009100557.18224-2-sumitg@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231009100557.18224-1-sumitg@nvidia.com> References: <20231009100557.18224-1-sumitg@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS1PEPF0001709C:EE_|SJ0PR12MB5422:EE_ X-MS-Office365-Filtering-Correlation-Id: 40b61d2f-d19d-4340-0e25-08dbc8af5e43 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VdEhdBXnaaeek/PnrxsH00nrjbRbPdTp02/gQaXlVSa+NPZdz6wNj5IbYiQ4wrHfX3g8cNG6J2HricGrdc9VxJaSXK1TxFbTZ+VQYqXo8JHVtv8DyluKI+4GiknIhXU6x0k2JoGjsKAtFv/I467k543eK/4Hcshsj0ysZdW8YX0HA3PYixZIujNeteJKpbalTLQZasmCojuj38B6/8KQwDEtBbX65zKCyuCA6TR9gZOEYOSJolYIjcAn4DVWoc39Ex9kcatfUq0NNPk4ZBCWCbSdJdyVkne5myq61vOhSUe/xh37WrlauPN/oCz21T68jgQWw1OzFPohxhwfEg34iBqLitJzXu7404Il10A/ietHmnvVRRpYYfaAmdWLVRXMy3OCOtvevKhmCUyhXiWXCmmHcPQdgk2cs24pp+jEfskAeIcRAV+jbcVf2jONPY28yXZkxdRhGuqGimii5s2OLYyFlAq18MCAViGePBBFr54Kyt1cJE6AUd/IXwVuQjnCz0mI2n4Lwm+7enEE48SLCnwSP9csDyXSOrnZv1Bh9V7JDcK8zn+vpUgQuVLL5wn5n8A5ZoJUuSWDR2atM5u92oZANDzZyI3tyMTq103wzWDkijxdF7i0x1N98C9/QzkPkRlFDLkWoYtWt2vhJGeY74IjtjOWOM0FXshOTom7BF4OSi6SgI3Mn2zfHrw5CCczhwQqkSGH4AU8KVKeKNwmMYWA9iLmYy34VvWPficY89JkRWhI7HplR/OmdHAPU56a X-Forefront-Antispam-Report: CIP:216.228.118.233;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge2.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(376002)(136003)(346002)(39860400002)(396003)(230922051799003)(451199024)(82310400011)(186009)(1800799009)(64100799003)(40470700004)(36840700001)(46966006)(40480700001)(426003)(40460700003)(83380400001)(107886003)(1076003)(2616005)(336012)(26005)(47076005)(36860700001)(110136005)(70206006)(70586007)(54906003)(316002)(8676002)(8936002)(5660300002)(4326008)(41300700001)(7696005)(6666004)(2906002)(15650500001)(82740400003)(478600001)(36756003)(356005)(7636003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 10:06:12.8091 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 40b61d2f-d19d-4340-0e25-08dbc8af5e43 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.233];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: DS1PEPF0001709C.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB5422 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Mon, 09 Oct 2023 03:06:42 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779271996404248610 X-GMAIL-MSGID: 1779271996404248610 Add suspend hook and a 'suspended' field in the 'struct tegra_bpmp' to mark if BPMP is suspended. Also, add a 'flags' field in the 'struct tegra_bpmp_message' whose 'TEGRA_BPMP_MESSAGE_RESET' bit can be set from the Tegra MC driver to signal that the reset of BPMP IPC channels is required before sending MRQ to the BPMP FW. Together both the fields allow us to handle any requests that might be sent too soon as they can cause hang during system resume. One case where we see BPMP requests being sent before the BPMP driver has resumed is the memory bandwidth requests which are triggered by onlining the CPUs during system resume. The CPUs are onlined before the BPMP has resumed and we need to reset the BPMP IPC channels to handle these requests. The additional check for 'flags' is done to avoid any un-intended BPMP IPC reset if the tegra_bpmp_transfer*() API gets called during suspend sequence after the BPMP driver is suspended. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Co-developed-by: Thierry Reding Signed-off-by: Thierry Reding Signed-off-by: Sumit Gupta Acked-by: Thierry Reding --- drivers/firmware/tegra/bpmp.c | 30 ++++++++++++++++++++++++++++++ include/soc/tegra/bpmp.h | 6 ++++++ 2 files changed, 36 insertions(+) diff --git a/drivers/firmware/tegra/bpmp.c b/drivers/firmware/tegra/bpmp.c index 51d062e0c3f1..c1590d3aa9cb 100644 --- a/drivers/firmware/tegra/bpmp.c +++ b/drivers/firmware/tegra/bpmp.c @@ -313,6 +313,8 @@ static ssize_t tegra_bpmp_channel_write(struct tegra_bpmp_channel *channel, return __tegra_bpmp_channel_write(channel, mrq, flags, data, size); } +static int __maybe_unused tegra_bpmp_resume(struct device *dev); + int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp, struct tegra_bpmp_message *msg) { @@ -325,6 +327,14 @@ int tegra_bpmp_transfer_atomic(struct tegra_bpmp *bpmp, if (!tegra_bpmp_message_valid(msg)) return -EINVAL; + if (bpmp->suspended) { + /* Reset BPMP IPC channels during resume based on flags passed */ + if (msg->flags & TEGRA_BPMP_MESSAGE_RESET) + tegra_bpmp_resume(bpmp->dev); + else + return -EAGAIN; + } + channel = bpmp->tx_channel; spin_lock(&bpmp->atomic_tx_lock); @@ -364,6 +374,14 @@ int tegra_bpmp_transfer(struct tegra_bpmp *bpmp, if (!tegra_bpmp_message_valid(msg)) return -EINVAL; + if (bpmp->suspended) { + /* Reset BPMP IPC channels during resume based on flags passed */ + if (msg->flags & TEGRA_BPMP_MESSAGE_RESET) + tegra_bpmp_resume(bpmp->dev); + else + return -EAGAIN; + } + channel = tegra_bpmp_write_threaded(bpmp, msg->mrq, msg->tx.data, msg->tx.size); if (IS_ERR(channel)) @@ -796,10 +814,21 @@ static int tegra_bpmp_probe(struct platform_device *pdev) return err; } +static int __maybe_unused tegra_bpmp_suspend(struct device *dev) +{ + struct tegra_bpmp *bpmp = dev_get_drvdata(dev); + + bpmp->suspended = true; + + return 0; +} + static int __maybe_unused tegra_bpmp_resume(struct device *dev) { struct tegra_bpmp *bpmp = dev_get_drvdata(dev); + bpmp->suspended = false; + if (bpmp->soc->ops->resume) return bpmp->soc->ops->resume(bpmp); else @@ -807,6 +836,7 @@ static int __maybe_unused tegra_bpmp_resume(struct device *dev) } static const struct dev_pm_ops tegra_bpmp_pm_ops = { + .suspend_noirq = tegra_bpmp_suspend, .resume_noirq = tegra_bpmp_resume, }; diff --git a/include/soc/tegra/bpmp.h b/include/soc/tegra/bpmp.h index 5842e38bb288..f5e4ac5b8cce 100644 --- a/include/soc/tegra/bpmp.h +++ b/include/soc/tegra/bpmp.h @@ -102,8 +102,12 @@ struct tegra_bpmp { #ifdef CONFIG_DEBUG_FS struct dentry *debugfs_mirror; #endif + + bool suspended; }; +#define TEGRA_BPMP_MESSAGE_RESET BIT(0) + struct tegra_bpmp_message { unsigned int mrq; @@ -117,6 +121,8 @@ struct tegra_bpmp_message { size_t size; int ret; } rx; + + unsigned long flags; }; #if IS_ENABLED(CONFIG_TEGRA_BPMP) From patchwork Mon Oct 9 10:05:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sumit Gupta X-Patchwork-Id: 149922 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1759099vqo; Mon, 9 Oct 2023 03:06:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE1SzyagHQnYtOnn3EJL3oeRL8u+4SSdWhEG9nhLSpgJkPJH/22XypKn/hRN2/Rb5LS5jdl X-Received: by 2002:a05:6a00:a92:b0:690:422f:4f17 with SMTP id b18-20020a056a000a9200b00690422f4f17mr15500157pfl.4.1696846011574; Mon, 09 Oct 2023 03:06:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1696846011; cv=pass; d=google.com; s=arc-20160816; b=lZz8cmUQFf2qbBMSigsq324dZBNR7yUB12HmJpSz1BKtREzpRec4PgHOXw3Ylb93Y0 HWUqc2dFBalFuZT1Pa450lS8g+KU3WTKPrgibSLn9TP48yrlRMPeo0/fbNT+QD9/Oly2 LNzZ6hCmFNlzP7A6UBcPhHhcJoxDAKOpdpGYg9RRCBAGauA5b+yFhzT2vEMHSbklQJsC xD5KF4FbvuzLhlvui8BJKQ6MQXobsrHhGj+eA38R44PUmCW/iGCKC7p0sp7DgsKG+7W4 7QtP3xo/ocltciyW+dbPIdmr9ye0F4vwdQIq7I5GOoYgPyIBYYN2GCR0xO2fxh24+ck2 /w6g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=cAyZrQ+jo6RyAs6uhaLZoFpVuY2bEE01tn17f33UPTA=; fh=GTOTMXDy+VCvZcUtE228lBPtDzGkyirl/S1BKf59DSI=; b=Ktcjr/BZqE+sM9QwAmQtqYHmFDUpkymBkfN7zUJVlLhhtF08S6lTKiHZH2k/P7D/E8 tnFvVtzSzI0V98xtGf64YP7cqnTy3MrUl6hgp2t0S6pk69AR420L5ht47sf8OSa+92d5 UnMk5g88EhrTvZsbz9+sbtypyCNu/W6KVRZhhGpUz7AoSYYo9Yf+DYC5O46v/0kVylkD EZCMuLguRgubpNRCOn5g7oHH4YbKWi8gTm98LtPsbGtlKlrpQroFH2MS0r1Q6j7KIGS6 OB6lVsAzbZKP8izn+HeTCB+YszXZxFnUXJvumgSce6Kvqj4DmBLsjAbpQ66Iq4Df5NLq kW2Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=fwfh0OGV; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id bq9-20020a056a000e0900b0068e26ca7f00si6905037pfb.39.2023.10.09.03.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Oct 2023 03:06:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=fwfh0OGV; arc=pass (i=1 spf=pass spfdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 0B26A8021DA0; Mon, 9 Oct 2023 03:06:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346053AbjJIKGk (ORCPT + 18 others); Mon, 9 Oct 2023 06:06:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346067AbjJIKGe (ORCPT ); Mon, 9 Oct 2023 06:06:34 -0400 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C869100; Mon, 9 Oct 2023 03:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hpmYJ2yCNRo/a6zkS68ehf+Outn4LWowxP7Dx6/Ilm8katjOJubgcVL4u9ylDP5Ia1cZ1CsZB3XolzuQl+Vw1dlNsZJEh93mgfa18VQx+I6fx90Ctd1wxG/6Ojs6wsH1ktLl3F7Af4l76lBFnvYLu/yDumN6lxaETajTFE5BtgbL7xZV7HxjaLy7/Vpd24sj3iZ1OCG2eN79Nz/FqY7bUqyCAQKNb7LrKa+k8oeH8F2RUlL0aYdbFioMgxgsLZTExIfQhyyjsESlYRMM6dYTOX1Aie+v5OfXRgtjUEpeXQPaFiLUzyIVCJ87sWH+7X0dO2F152VQlCZviqAwC3/oXg== 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=cAyZrQ+jo6RyAs6uhaLZoFpVuY2bEE01tn17f33UPTA=; b=c72DjYY9wjG1HirW5/QvdtwExbuYK6vW8GMiqFk7OfLxlqnzG9hqfTnH4vJ9pQOPJm3JqqAV9Xkv0PrpX+qI0XEWe1VNt1Z0vMy3MegCwnfSpLgSrXbhRttxtsDFdX8vn8t/vVnJmTahYnF3Xi00nWun+XzleuvAC5H2WHNEMyJXDP3bJVQ9X+u6rUfvmm0OSKPHo233OQqoJSrDvHQsuLh7Ln487dEqcIkKC1RVM8lPgoaeqcwnpNaCQp7liCurFaIXq7tAlhAEsIVTtrwK558699JrFEM9vG1QUL5GjdcpvTyRmmqstQlEPsx8L58frtDaZrGDbnE9v1mu8K+TtA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.118.232) smtp.rcpttodomain=linaro.org smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cAyZrQ+jo6RyAs6uhaLZoFpVuY2bEE01tn17f33UPTA=; b=fwfh0OGVrFvWyAs460G2fUq+CRSp4cYBTyPSjInQ2jZZqi81Y+mu5Z6GRJR23kY8BN67npqoCXl4FHJ8qXJp76g8EGPfYVsV5KrRxQfo3ciIuzvFIDA0bNdWyY5FsIAP5JOOaAFiJTEMesdDsq1p1poD8D9NWW2k+4HC66GI//BqMz2C/uyBBoa1q3UNsQbVcKN/9tq+ipIAPP8Wlm1tOhR3AaH7oupDrXWvqJBpIww6JHIc0amzM6xyuNVYy8kzk1GaknIh8YPdRYfqki0BWoEh/S82HguvUq3N1wTt2yOB8gZ8ads8nGDbA6dwXFN+gghf4jnHp/YMQDUmLI46Nw== Received: from MW4PR03CA0300.namprd03.prod.outlook.com (2603:10b6:303:b5::35) by MN0PR12MB5929.namprd12.prod.outlook.com (2603:10b6:208:37c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37; Mon, 9 Oct 2023 10:06:27 +0000 Received: from CO1PEPF000044F7.namprd21.prod.outlook.com (2603:10b6:303:b5:cafe::72) by MW4PR03CA0300.outlook.office365.com (2603:10b6:303:b5::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.37 via Frontend Transport; Mon, 9 Oct 2023 10:06:25 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.118.232) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.118.232 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.118.232; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.118.232) by CO1PEPF000044F7.mail.protection.outlook.com (10.167.241.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6907.2 via Frontend Transport; Mon, 9 Oct 2023 10:06:25 +0000 Received: from drhqmail202.nvidia.com (10.126.190.181) by mail.nvidia.com (10.127.129.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 9 Oct 2023 03:06:16 -0700 Received: from drhqmail203.nvidia.com (10.126.190.182) by drhqmail202.nvidia.com (10.126.190.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Mon, 9 Oct 2023 03:06:15 -0700 Received: from sumitg-l4t.nvidia.com (10.127.8.10) by mail.nvidia.com (10.126.190.182) with Microsoft SMTP Server id 15.2.986.41 via Frontend Transport; Mon, 9 Oct 2023 03:06:13 -0700 From: Sumit Gupta To: , , , , CC: , Subject: [Patch v2 2/2] memory: tegra: set BPMP msg flags to reset IPC channels Date: Mon, 9 Oct 2023 15:35:57 +0530 Message-ID: <20231009100557.18224-3-sumitg@nvidia.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231009100557.18224-1-sumitg@nvidia.com> References: <20231009100557.18224-1-sumitg@nvidia.com> X-NVConfidentiality: public MIME-Version: 1.0 X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000044F7:EE_|MN0PR12MB5929:EE_ X-MS-Office365-Filtering-Correlation-Id: 84942fa8-638c-448b-6dcd-08dbc8af65c5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ynyQB67M/lQi3wNOZKkVNfoqNFUaSZsDgfFm64/yxObyqzOSUcHH3EEcIQ+He/m03UIitM5opb5l3Rais2zxkAvjVVAR4Ft1DgCBeW6J9RAqEGmOJMz+NR9tZKxKUTdGGwgvVO1Wh2eLe77MIC0sLQlf72ax2W3GNcRJJbsfkO7UDe72NnORm56q41lwAa1AMvplCgUT1DNY9mNaTMfepuyw08G2tkZs6VpzlGMzAyxgYEpKg/ryMpfLDYEDc+sds1LpH+ciVMS+cJZjHZjhlWXyvLSvV2mo0NMgiGY6oj8mXz4eTlalkFuddIZVpq5L++WsesNTLoo7DQND5iirzLCu8NFrOq7mPIlU0F8Vm+KBEVae99tD/VXzyF7Vzxv4Mxo6UysKIws1eipvaSQXPaUwNqXSU+hSPSPa7NDQMfrQR0OGrZgMvfncRE/lxiQU597TW60HG9Ty5Dd1BpfdlgIcnKh0h2Yazj7i7sBhUki+Ymp3Hg9hT7paF5lfauHaEhvorC8AAs3FjAY6dS9GsxScRAk6OdDzPZFZxIWEty/s1EK80GvujNjhywBmKuM8J1PN2mGW6UVv9wdl7FKwikoq3SWQy2/uNaI/fIuljULT3GUsZHx9kOmPsJDFHZdNDxk24RtRwMPoAYc+4FkgmlrLXhmcWP28jTzk0DX7AQtCrXCsUnVsB+X9bVjNcFPGyP01WKXUMXPptTw6FdMQZREQuCpRSiij8OMmM289In/UuWTS/vIdnNQevbKO8nbH X-Forefront-Antispam-Report: CIP:216.228.118.232;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:dc7edge1.nvidia.com;CAT:NONE;SFS:(13230031)(4636009)(39860400002)(376002)(396003)(136003)(346002)(230922051799003)(451199024)(186009)(64100799003)(1800799009)(82310400011)(46966006)(36840700001)(40470700004)(40480700001)(40460700003)(83380400001)(1076003)(107886003)(2616005)(336012)(426003)(26005)(47076005)(316002)(36860700001)(110136005)(54906003)(70206006)(70586007)(8936002)(8676002)(4326008)(5660300002)(41300700001)(7696005)(6666004)(2906002)(82740400003)(478600001)(36756003)(356005)(7636003)(86362001);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Oct 2023 10:06:25.4389 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 84942fa8-638c-448b-6dcd-08dbc8af65c5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.118.232];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000044F7.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR12MB5929 X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 09 Oct 2023 03:06:49 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779272003737044202 X-GMAIL-MSGID: 1779272003737044202 From: Thierry Reding Set the 'TEGRA_BPMP_MESSAGE_RESET' bit in newly added 'flags' field of 'struct tegra_bpmp_message' to request for the reset of BPMP IPC channels. This is used along with the 'suspended' check in BPMP driver for handling early bandwidth requests due to the hotplug of CPU's during system resume before the driver gets resumed. Fixes: f41e1442ac5b ("cpufreq: tegra194: add OPP support and set bandwidth") Signed-off-by: Thierry Reding Co-developed-by: Sumit Gupta Signed-off-by: Sumit Gupta Acked-by: Thierry Reding Acked-by: Krzysztof Kozlowski --- drivers/memory/tegra/tegra234.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/memory/tegra/tegra234.c b/drivers/memory/tegra/tegra234.c index 9e5b5dbd9c8d..2845041f32d6 100644 --- a/drivers/memory/tegra/tegra234.c +++ b/drivers/memory/tegra/tegra234.c @@ -986,6 +986,10 @@ static int tegra234_mc_icc_set(struct icc_node *src, struct icc_node *dst) msg.rx.data = &bwmgr_resp; msg.rx.size = sizeof(bwmgr_resp); + if (pclient->bpmp_id >= TEGRA_ICC_BPMP_CPU_CLUSTER0 && + pclient->bpmp_id <= TEGRA_ICC_BPMP_CPU_CLUSTER2) + msg.flags = TEGRA_BPMP_MESSAGE_RESET; + ret = tegra_bpmp_transfer(mc->bpmp, &msg); if (ret < 0) { dev_err(mc->dev, "BPMP transfer failed: %d\n", ret);