From patchwork Mon Mar 31 10:44:49 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tommaso Merciai X-Patchwork-Id: 14033457 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 aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80606C3600B for ; Mon, 31 Mar 2025 10:46:31 +0000 (UTC) Received: from TYVP286CU001.outbound.protection.outlook.com (TYVP286CU001.outbound.protection.outlook.com [52.101.125.63]) by mx.groups.io with SMTP id smtpd.web11.48815.1743417990206988050 for ; Mon, 31 Mar 2025 03:46:30 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@bp.renesas.com header.s=selector1 header.b=fnQkVliS; spf=pass (domain: bp.renesas.com, ip: 52.101.125.63, mailfrom: tommaso.merciai.xr@bp.renesas.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tr/eg6TqRE5pWoClTEIu57ofyIWQreGtc54pRp5V+Ab+YleCU8cG6p68hWd56cB9kuW5RwoMxq6eMrVvjHG6iCzSbrVm/XgGECol7Nt8SwMv/rnX1eIzviXnj3nxYq9FD+oCSTpScclnpObbhSj5o4Q/bUBpYrCSDOcLU3jtmPMz/S56cesmqhLDzSlwg3DDyNswTiyGqDnVon1Ex7Em9LkaR7dSDGX+BX6VGBiBbIMyVlGN3K5fMFeULyNlgQb0zyz/j8fwtfj6tV85f+aeJibP3XV4vSMBNNCgJQQM3zJI/jihMaCtUwP7xVv//Nt/0mhFU/qR2uLdT9F4a0M+Lw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=JWlxXsid7EHI8Qh7l1aCv3e0RK+rMnSjzpAmQ67xAds=; b=o0sSh91WfTfurjO8sMjMncxezM1io9YM45bcAYhx5YC5+/2yyKaQf+jsFPadQigZ7xYQvB47NSk8Gtswy1MwmuWfBNYvp33fCm/ywtLFgoodW38RV827ka6xP420gZlAYlY2SdsGy0xwrlh4nMGMLhvhycFLlVHByDeZFIxZtfgPXyFVjOd4v2A7qZHx0eDbVzhcB/BQpqSGcZ1sCnMTAEcJ94PVWpz0fFvh3S83dMdWwKiY6xUdiFHwokpm109bCE3gVYaum+xpeYEftt+KUYOzHR4hARIRXkakgBAJG3inBwDfCrp1Wdp7PVmPzJqPJdaDlenYCmxVabiqpCRKaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=bp.renesas.com; dmarc=pass action=none header.from=bp.renesas.com; dkim=pass header.d=bp.renesas.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bp.renesas.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JWlxXsid7EHI8Qh7l1aCv3e0RK+rMnSjzpAmQ67xAds=; b=fnQkVliShOn2SPEXVyuFml05OSd+g9eIdYU1PY5rZXOcEUewIBPB1zNxNJCSvYyKVn7v5WXlGRAxroiTtuyBqw4lZ55SyRK8+EPSFsQVycl2mV2pxnvyKHL8NDuWgVMQdTZ9L81FoRvEND926hrxtiAbSy0sW6yJeaY0lNNKiLk= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=bp.renesas.com; Received: from OS9PR01MB13950.jpnprd01.prod.outlook.com (2603:1096:604:35e::5) by TYWPR01MB10032.jpnprd01.prod.outlook.com (2603:1096:400:1e0::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8583.36; Mon, 31 Mar 2025 10:46:25 +0000 Received: from OS9PR01MB13950.jpnprd01.prod.outlook.com ([fe80::244d:8815:7064:a9f3]) by OS9PR01MB13950.jpnprd01.prod.outlook.com ([fe80::244d:8815:7064:a9f3%5]) with mapi id 15.20.8583.036; Mon, 31 Mar 2025 10:46:25 +0000 From: Tommaso Merciai To: cip-dev@lists.cip-project.org, Nobuhiro Iwamatsu , Pavel Machek CC: Biju Das , Lad Prabhakar , tomm.merciai@gmail.com Subject: [PATCH 6.1.y-cip 18/43] pinctrl: renesas: rzg2l: Acquire lock in rzg2l_pinctrl_pm_setup_pfc() Date: Mon, 31 Mar 2025 12:44:49 +0200 Message-ID: <20250331104514.79090-19-tommaso.merciai.xr@bp.renesas.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250331104514.79090-1-tommaso.merciai.xr@bp.renesas.com> References: <20250331104514.79090-1-tommaso.merciai.xr@bp.renesas.com> X-ClientProxiedBy: FR4P281CA0148.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b8::13) To OS9PR01MB13950.jpnprd01.prod.outlook.com (2603:1096:604:35e::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: OS9PR01MB13950:EE_|TYWPR01MB10032:EE_ X-MS-Office365-Filtering-Correlation-Id: 8742ca16-74ab-49b7-2aa8-08dd704148c7 X-LD-Processed: 53d82571-da19-47e4-9cb4-625a166a4a2a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|52116014|376014|38350700014; X-Microsoft-Antispam-Message-Info: FgB7GhoWDKVPUTsxLFA/C78r+xlj57AFYVRpNFdNCa8JVKwwv6qwbWcYZBp9hKIsw8K+Bwxipfvi1IyvDfUXSBXQEnuVSKf+uOOcUmGyOv1lp2kaFBCpEe6odj4y+DwdQhdY1AXc7/qBV0ooyDHY/a/sMQ0KWY1Kp7FIhN9u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Wz+S82+AjevdaNYdsrUSe0HhmS5Qtqv1auaLpj/Kd2V0B5pvq7RmZzKloFczo1qrfV0Rw++RoaCJVe5oDOYGJG+2JFGk41fBHSmFZHNDK0QX4voyRSt9zfgDc0yr8GO62kDZ2hdhCBywDSj3k5qQJ1qlGx6F8j7JoiMK/ekVsYr4gNS5LNGT88umssSSSg2mVko8MbTn6G8gmK2aZCQd0oiZuVjTDWQV9MbrRQshB2JRr9GrWLAp8ft4Ug8r+KZCJnAF3DgM= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:OS9PR01MB13950.jpnprd01.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(52116014)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: fIkDtHMtcoy8s5JIsQbjXQbwounjROpU9kK8EqyMikYFtbUz7q2EjHMoH8F7LSBOn360vKjYHqU2tKSmL6MbYCjIzAuRTpgH6YBcA376dLKDql7TeYWJlPN4RfuKdFuytYNtPizyYXh7K8tThcsl9K9STJgVfZ3h/gpyn6CKufE8IctwfRWNjiASt6ZSq6R0a3GQz44u/AoG8tscKp6Xd3syjMohv2yJg4PGhff6m9Q6VgVPDq3sHZ59Q0Yawq1u7q1/1TyyRHfgIkQMNekF5N1tbew4TGaV89abZORaWHHf5JVOAfdq6/PwOn3j5IC/dyiCWsAvrxytUgwYDUYFT1Bw7jBRkpabb2IFTCAdFBLuklfTD0+z3W83U3RJbhxMAqLHRKvHr12SC1pw9o6afGlFZLZR1k8C0jjIgdy2tmwBCV1Uv8aJ1Mf8ukUmbtpw+ARlKUXX+Uulu7eyv9h/NUSz33DOLouIJg1so48ZRBsyA5gBZ12l4efuDvyTpv8AuMSrbIZEc5fsfQzvMgZ8P1/r+URxLbGNKBn9UoLReWr5GEsK9mf73EPRP1zoWbKjBUws05nUO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.renesas.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8742ca16-74ab-49b7-2aa8-08dd704148c7 X-MS-Exchange-CrossTenant-AuthSource: OS9PR01MB13950.jpnprd01.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2025 10:46:25.3698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: L/OXl7NzyM9bqRWukBUldeIg6O4l00f+6p61dA5tqmTtnvJA2gZyhakNveGTP/KtlkzleaD9F4wFkWfwMHzCHzNgqenC60+m9v4ATlslZJmk/k9OAtYAgyKvOw+48jaU X-MS-Exchange-Transport-CrossTenantHeadersStamped: TYWPR01MB10032 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 31 Mar 2025 10:46:31 -0000 X-Groupsio-URL: https://lists.cip-project.org/g/cip-dev/message/18406 From: Lad Prabhakar commit 951eaac107631b26649b00cf5f5d9d7d83d8bca4 upstream. To keep consistency with rzg2l_pinctrl_set_pfc_mode(), acquire the lock in rzg2l_pinctrl_pm_setup_pfc() during PFC setup. Signed-off-by: Lad Prabhakar Reviewed-by: Geert Uytterhoeven Tested-by: Claudiu Beznea # on RZ/G3S Link: https://lore.kernel.org/r/20240530173857.164073-15-prabhakar.mahadev-lad.rj@bp.renesas.com Signed-off-by: Geert Uytterhoeven Signed-off-by: Tommaso Merciai --- drivers/pinctrl/renesas/pinctrl-rzg2l.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/renesas/pinctrl-rzg2l.c b/drivers/pinctrl/renesas/pinctrl-rzg2l.c index 538959643cde7..d42ce90af83ac 100644 --- a/drivers/pinctrl/renesas/pinctrl-rzg2l.c +++ b/drivers/pinctrl/renesas/pinctrl-rzg2l.c @@ -2541,7 +2541,9 @@ static void rzg2l_pinctrl_pm_setup_dedicated_regs(struct rzg2l_pinctrl *pctrl, b static void rzg2l_pinctrl_pm_setup_pfc(struct rzg2l_pinctrl *pctrl) { u32 nports = pctrl->data->n_port_pins / RZG2L_PINS_PER_PORT; + unsigned long flags; + spin_lock_irqsave(&pctrl->lock, flags); pctrl->data->pwpr_pfc_lock_unlock(pctrl, false); /* Restore port registers. */ @@ -2586,6 +2588,7 @@ static void rzg2l_pinctrl_pm_setup_pfc(struct rzg2l_pinctrl *pctrl) } pctrl->data->pwpr_pfc_lock_unlock(pctrl, true); + spin_unlock_irqrestore(&pctrl->lock, flags); } static int rzg2l_pinctrl_suspend_noirq(struct device *dev)