From nobody Sat Jul 25 00:11:04 2026 Received: from BN8PR05CU002.outbound.protection.outlook.com (mail-eastus2azon11021141.outbound.protection.outlook.com [52.101.57.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 938C746E01C; Tue, 21 Jul 2026 17:53:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.57.141 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656395; cv=fail; b=VNF6arDNCUXJzMpX2+qot+K6qfzO4eWqMfiXC5C38CcxsCZzKXiHq0wE+teALTt9E1a8JOaPG21xlFLla4vCSZqkhQksN5R5+nt1pySNQSd8tB4C+f1tu402lpv7oTrIejJfYaFFYNbVW8SX3OWU9tDn4zPTzUBgrGK9ZeiOZE4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656395; c=relaxed/simple; bh=OPiM7y1qV/6idlvHuk0xk9QyGfCo7pG2I98n8YXvBKQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=LzAlaH3tv5Ev5Xr0eyLqQvjo8GjQiICNKUbWTCUQ/fUYujYkeLIFcnOItfhvXJQclHhMrIw5e8+AqTiOQN8GQV/A0OAYcvfugj/6bMj35g3SviHbqsyy3rQgNDsM9f3dsFcSkF9DcSsXfuLFs5UljZSz0R24MvrEaqSCWW6hMME= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=Y23L1NDa; arc=fail smtp.client-ip=52.101.57.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="Y23L1NDa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rfqfD9oy5ZdNScioAGmuWxxJmA7ELt4CBY5+h1m2s7bqrVVZ8bgb+PSDZkPJTAsn+l3LezkcX8GIauk7wlJ6GiMGJM82EzLjkLIoCrFxHNN/9XoE/wN/SpgrQtoOWzryGHWEKnTkhQKzts5pmmaLM8gg9jQBgVqswtF8qelP9jSvgJs89sMtlC8V4XQdQ8B9YBUnVMesCe1dTSD6jU//jT6+Xd5VBx1aF8g33nLT3pPD9LE0rKmHB/gl29FP29yJLwUDN3i4USuVMOkXstZLgO/AmK5+Ha8JHhcMpEh6fYlvSuC/FzbWTBuBswemlnofgZX1J7ZLYVeJyznR+s8c0g== 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=oww8ouWJyNhL3L2yXh7BuNDeTaoRvuUfDd+TlCdyiLw=; b=aKOsXg/ko4RQglu0CWnqOjAo5mI9Hq4spfcCrn0DihxwzXxhY1DfHR9CHGowlQjBX6X1ClSbrOYspy7JjCN3eQeArzf7/aFiGM/luT+kwD+vM2omX0FfcW3KgqYs4FWVSszS/MIzkXkr10mFEuyg9bJpVozQ+C9pOe2kaXKtn/duN2ntskK2f/qioQ3sgl5rgSso6dnPSazBhtE9zyWQu5TU4Xl6XAe1rvC+LxZzQMrtJtgCK57fMt3gUnr3n5F44t3Rjjzit8ZcKi++TCOn/8Dy5p9A9An++cFidWtzD3EmoJI/iQQs+7arxkaZ6RT88hKZSWrstdKRqHoKrRcBRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oww8ouWJyNhL3L2yXh7BuNDeTaoRvuUfDd+TlCdyiLw=; b=Y23L1NDaVmJZucnZnkK3r2GOgTTY1RvLt/2K/piSAvlcSTL9Bn/LfxwaW8C8+o+LN3XH5Z29qs7gt9RnbCmUTbCBDcM9fQlbB+89ItP4D8gwNgF8hO3ClScR9k2Q88rd6A4rEItu9GKjNFiKQd/D4yxARxlIqWweidDdRdjdX40= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:10 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:08 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar , Huisong Li Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron Subject: [PATCH v45 1/7] mailbox/pcc.c: shmem map/unmap startup/teardown Date: Tue, 21 Jul 2026 13:52:50 -0400 Message-ID: <20260721175258.87600-2-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5P220CA0012.NAMP220.PROD.OUTLOOK.COM (2603:10b6:930:ed::7) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: 08a77e6b-18ea-4eb6-fe65-08dee750ec95 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003|6133799003; X-Microsoft-Antispam-Message-Info: 4I6Kxj0s+nu1/x2CC+5MrMxga/QZjqGb5th2mOM9+YRureeZBs7RDbf+tQ2Odpeq0UMzu5Y+k6USTxCKpJeO7L3m//GRpOIU1M5d5T8hFt7CXvwDDJr7N0iLuyjYu1yojOlPOtgOS5ExPSCu0ALoEHsyIEugmPzisVOXOb84wGeb6wAT8+176CCd4hjhu+hC91KveSu5wFjY0AY4i8s1hmi2QLlVAb8nnrG97esTIjTF3EEviIKSqxyUGDQzqVhU/MkiHDoxw3ZF/3zXRecVaUq5vmTU9GQvWBZGs4VZhSvi+wNN8mQfau74TPMWKw1PszO//Mr0JT291RasCiXX+qIMS+810wm5Lyi1SCik3D/5cHjvP3JoJeVZcQi+BNr4SfOrWBwTgi6JoWhM88j8RMvtZBWN0rsFu8Gu47QTT3JyT6VY091kfe2ySSgpwCdP2XASuxpkMS1A9g0Wc+W8uZePMaORe290OTGPydVY1fobDWrt4MuXmqCOPhukwkLlMyZBcn8iKTrQDOIg0KLsKymZbCy81AbH0kWD0kfz0H41rJ3xu+owlVtxOl3Bm0QZ8zBKyK/mTWVcLbtnlsacbGlYcuZd7U4DNZaHubU1ieSI9osdHEkzZ1o1U+56+frQH6tLvlnF+O+6VooCeNEJBDfLiFb5IB4z1gcQwixRxPU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003)(6133799003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?IgHJuPvZ23Au2L2v/FSMkUWmX4sipdYsmb54yfcukrjmzNahG68oqt5rx5/p?= =?us-ascii?Q?sA9dor1gCMeFaBa7BiuTBDAHX3xY9nmLneFmuBycnXotzaGuBtzIiS3zfT1N?= =?us-ascii?Q?luW7P+PYqwrK7CcXytxO8QPlYtk8RRWqbBsXDmIYF3fKfN2yebxNWgReQpgf?= =?us-ascii?Q?KacmZNSmhSug5Wp0jkubg0Zlj00MwwnAlWVugrq5NDTIj9LTRgPJr0oV0zK3?= =?us-ascii?Q?TYUXeVXaHAH7kltpjwNUjcqrUjXkZo1oQLk9O/6GZrBfnXSO1fpb7ONtduYS?= =?us-ascii?Q?tuAwdZlffXdpXfLQAjp3WLYwrd21z/TxKsH4Kt718TJ9YAwRK5q51I/aK5KF?= =?us-ascii?Q?DNxQ1apVljgf++RckPUiNaIw8jXz7nrw5YJXZRaBY3A50Vjh4rtI+rQX2iUH?= =?us-ascii?Q?kcN8dmjpNWbuFVuLfOcI5r/Is99bF86fe7O6kUbmtNwZvb43CsZhXJDGqvaa?= =?us-ascii?Q?bN1tjwpYgnhTJhPqt8hccLbK97Kb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?us-ascii?Q?FwLJjC9z5LVxGmNSvkTuajThXurGlbPnqp0RWCJFwZCrBvSoe6jzF+cd4Dx3?= =?us-ascii?Q?CrtbfvTCHMlt8+k10bp6ipe85n1/Jbam4AHXI+i2/zthFeDmm4y/MZSmNe7W?= =?us-ascii?Q?qBGeiQK5l+UvNAhvZsmc6DVPGcuMCqCWk4GiCMeSoiudejTw99A1zNimED3f?= =?us-ascii?Q?ySIOHVML/yKhdsa+WQyQd62Bds+n2fHznWmxDNHJNmbI0HwLR5Pt7+UyZDNW?= =?us-ascii?Q?3QY68jNg0YbHJ6L0PzAWuEDhGUPm5RBfEWcdP5agJs5zN6M+LFbCdRV/oDUY?= =?us-ascii?Q?0TpYOfua6gX4Ar4d5ifFtNlObAdBnaXAjoIaPD/aCX402fnyR7GWRPobXihP?= =?us-ascii?Q?VhafY7B/UQFpczjnqB1ddABCW1Nqf+qgC2GcMYp2HH5yGT+MizH9pFJK/2Oy?= X-MS-Exchange-AntiSpam-MessageData-1: rfEMnjnN5WuTrwxS2JSQ6Jlq4zT4guUN+Wfdq77ge3tcllFsIlDKQTvF X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08a77e6b-18ea-4eb6-fe65-08dee750ec95 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:08.7599 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: GgSkHJcopHds12zap1yGpKWP2o1s4wLmSvIdNgZduZQRfxvMJFTajyLW1ogeI4W8L1lwkLUL/qly5MjnbPsV7QuEKXTQkFz/MjRzepCD+w3/q+ikLfDKGP7uX6wh1+oI X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" The mailbox IRQ and shmems are not cleaned up atomically, so there is a race condition. If the shmem is torn down while the IRQ is active, a late interrupt can trigger a write to un-mapped memory. If the shmem is torn down while the IRQ is active, and another thread requests the channel again, we can end up with a channel that has had its shmem unmapped. By moving the map to start up and the unmap to teardown, we can let the mailbox mechanism prevent re-entrance into the startup/teardown functions. Avoid doubly unmapping the region by removing the unmap in the direct error handler for the request. Assisted-by: Codex:gpt-5.4 Fixes: fa362ffafa51 ("mailbox: pcc: Always map the shared memory communicat= ion address") Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 48 +++++++++++++++++++++---------------------- 1 file changed, 23 insertions(+), 25 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 636879ae1db7..da26578a8aab 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -360,7 +360,6 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) struct pcc_mbox_chan * pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id) { - struct pcc_mbox_chan *pcc_mchan; struct pcc_chan_info *pchan; struct mbox_chan *chan; int rc; @@ -375,20 +374,10 @@ pcc_mbox_request_channel(struct mbox_client *cl, int = subspace_id) return ERR_PTR(-EBUSY); } =20 - pcc_mchan =3D &pchan->chan; - pcc_mchan->shmem =3D acpi_os_ioremap(pcc_mchan->shmem_base_addr, - pcc_mchan->shmem_size); - if (!pcc_mchan->shmem) - return ERR_PTR(-ENXIO); - rc =3D mbox_bind_client(chan, cl); - if (rc) { - iounmap(pcc_mchan->shmem); - pcc_mchan->shmem =3D NULL; - return ERR_PTR(rc); - } - - return pcc_mchan; + if (rc) + return ERR_PTR(-ENXIO); + return &pchan->chan; } EXPORT_SYMBOL_GPL(pcc_mbox_request_channel); =20 @@ -400,19 +389,13 @@ EXPORT_SYMBOL_GPL(pcc_mbox_request_channel); */ void pcc_mbox_free_channel(struct pcc_mbox_chan *pchan) { - struct mbox_chan *chan =3D pchan->mchan; - struct pcc_chan_info *pchan_info; - struct pcc_mbox_chan *pcc_mbox_chan; + struct mbox_chan *chan; =20 + if (!pchan) + return; + chan =3D pchan->mchan; if (!chan || !chan->cl) return; - pchan_info =3D chan->con_priv; - pcc_mbox_chan =3D &pchan_info->chan; - if (pcc_mbox_chan->shmem) { - iounmap(pcc_mbox_chan->shmem); - pcc_mbox_chan->shmem =3D NULL; - } - mbox_free_channel(chan); } EXPORT_SYMBOL_GPL(pcc_mbox_free_channel); @@ -462,9 +445,15 @@ static bool pcc_last_tx_done(struct mbox_chan *chan) static int pcc_startup(struct mbox_chan *chan) { struct pcc_chan_info *pchan =3D chan->con_priv; + struct pcc_mbox_chan *pcc_mchan; unsigned long irqflags; int rc; =20 + pcc_mchan =3D &pchan->chan; + pcc_mchan->shmem =3D acpi_os_ioremap(pcc_mchan->shmem_base_addr, + pcc_mchan->shmem_size); + if (pcc_mchan->shmem =3D=3D NULL) + return -ENOMEM; /* * Clear and acknowledge any pending interrupts on responder channel * before enabling the interrupt @@ -479,6 +468,8 @@ static int pcc_startup(struct mbox_chan *chan) if (unlikely(rc)) { dev_err(chan->mbox->dev, "failed to register PCC interrupt %d\n", pchan->plat_irq); + iounmap(pcc_mchan->shmem); + pcc_mchan->shmem =3D NULL; return rc; } } @@ -488,15 +479,22 @@ static int pcc_startup(struct mbox_chan *chan) =20 /** * pcc_shutdown - Called from Mailbox Controller code. Used here - * to free the interrupt. + * to free the interrupt and unmap the shared memory. * @chan: Pointer to Mailbox channel to shutdown. */ static void pcc_shutdown(struct mbox_chan *chan) { struct pcc_chan_info *pchan =3D chan->con_priv; + struct pcc_mbox_chan *pcc_mbox_chan; =20 if (pchan->plat_irq > 0) devm_free_irq(chan->mbox->dev, pchan->plat_irq, chan); + + pcc_mbox_chan =3D &pchan->chan; + if (pcc_mbox_chan->shmem) { + iounmap(pcc_mbox_chan->shmem); + pcc_mbox_chan->shmem =3D NULL; + } } =20 static const struct mbox_chan_ops pcc_chan_ops =3D { --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from BN8PR05CU002.outbound.protection.outlook.com (mail-eastus2azon11021141.outbound.protection.outlook.com [52.101.57.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 63519472F96; Tue, 21 Jul 2026 17:53:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.57.141 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656396; cv=fail; b=jGkgruaBmr5/JPvjU7xkOB+NPP3JFRST2tZbsqdId2fnill/T+iyC6ZPlhS8l9rFOSVoobt0SNZHLkag32mvcj1eZhOktQMZ6EU9XSVE00Gzrv58boZJ9bUa9KYq1d+iJl1rAshF8voMVZAf6xsrI42Y0YpyEHZfElMmGSb29jM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656396; c=relaxed/simple; bh=FPqpHRql3cOzRAXwUAaZ+kklpTnwq7YYld8cjnUk29c=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=QGax5PokYS9FVXDZDHoYF0osIE2quRzNuouRUsVCGCjr5QFFR2RpqtSvMLQ2qwVPmrwQr1+Lv7xQ/tI1FPb8MR6R/lcyHa/7UQouO8Pta02ZwfyrSRtgbE4o2/F5XD6shl/+8wJ7D39XvANGaWvPWPMLfrhiuyD+TB+HhWpRHUE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=S86l+f99; arc=fail smtp.client-ip=52.101.57.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="S86l+f99" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rrwD6T2UebYG+5ps8yHwd4PQJWIlwkhG0CJHjzrwEX7XBnFB4VqIgX1THIAjIRHBuGgtBL+mH99ySlOiPBDNA5rbpwimrIQl5R9CTo328WLrNG2VuxliwGfcRgTn0FGOIftHI/RCq7EhEg0gWqjm62nU2ayAeKG1Cn0jkpBRwH2wHZkL+qwHoOgGS8uwESO5lJB/c2+Wl6NnUKDlpRH1LZec7P+sBXnw4VbGRuwmp9HkV5ybnpNpYXwFs8bNVZ0Ut4wYUpQy7UyU4TdKSkgTCyFJm3yhzBB9PgHqXcmt59P/cpMlSNRNKFjPx1jSsSdyLFVWdTFZclnxdjDB+nHjxw== 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=8Fo2fxte7/1Yjgk2RsUOE3H7mMgOImB57DI9puWXrp0=; b=XGEwOtrwxWphARmI5YA/Umfl2wdEke9VfdeEx+2BZhb/2VuDqTnQmeGA/KCOpBpfbI90usdD04rd150gyhy6ROJ+dARCQB8jola5UndsOv7AXtZ64hfhTnA2CrJPelbJtDLkF+oKrZpsyCaN0/6WavJal/U3RuCis1fxissuNIC5Swvvjs/Vb6TvEYUBru3x2sgrTiR5LChP6TzYxoqQw43m7AHIoxd5/AxUALetlVKDDNy0JoFLfWtlpKEqpoFLbxhZNxk4QlpUlexnEkUyrq4JSozBrPM4lmU9lmcG0cGH9Jwhxj5RVxdbY2mrfWexf0E82l6KJqlJ1/SLNtZ1Bg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Fo2fxte7/1Yjgk2RsUOE3H7mMgOImB57DI9puWXrp0=; b=S86l+f99jVtI8sQhT+RS4edEF75hKy3lNf5ioLfGVzJOa+WuOIBJATq4ym2ljaJv0nr6TwgzTimW11O6Dv4F0hpZIFcKki4qtUltY7l2pgULTHhCTu2N2wK/ci+9IkBNlNUhKKAwkjehowSWwnVU3wUY9Nj/Dn6S4wrKiecRGL8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:12 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:12 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 2/7] mailbox/pcc.c: ignore errors on type 4 channels. Date: Tue, 21 Jul 2026 13:52:51 -0400 Message-ID: <20260721175258.87600-3-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5P220CA0011.NAMP220.PROD.OUTLOOK.COM (2603:10b6:930:ed::14) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: d3e79464-2e6e-462c-da52-08dee750ee83 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: MYqD5+Zj9LrPlFfgmSAniAULIY0ok91W3CgfnI6Us0l3hdq7hgYb8pL9FkqMpSPZ/dusnqQrwXw9GS7pripEt7syrlAnEAjwACOAlqznXCjupzXt0zrBgwkikd69wzEL6F085BbAxGScZNZDUftePmc8YTNIxRDS5+8JgD1xV1dR5Gv5klkjdcBAMavOWVqniGLaJQnBd1ynpwRhELarjGThBb0fyRUTRM5FEFJVmyeKd0zKA8UA6KqOA6GWPruTIZngsMxtZnJUEPm4LoH5/gs9G760MX68JV2s0WGm2P30bVBjRja6DRo19gSlxU+zdT9RRWIlgYTvpdcqf8BGCn6cw45QALvncxhuuSHooyMaok3fu+xs/Vhqgf9Y8bGuSqdlzWagT6xqiWsbCz6rg73jvKxML2qcIpkj0G9ssJiCLKa0It+7HSpRLH/czAQXJRGHDKHo+hduPAJ7L/APbqln1hEvJKqjx/SY2YmD8j7jKFNeHIOFoqBKdBjGqlaBOmrr6oKh0IAt5grjJlHvTogW8IwL6pQKKhzp0tWML4nop1fDt44WqeoUC36vmaopvzKjK78Cw4ZQP21CpNyZt97JhsVLq+PPU8I3C4ZnXLyF64KR+0eY2bLm6iZ+ZX+fOx58MbQzXp+zbPuxt81FYrRZEN8sJFQ4GRM4y2nOSSI= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?8Cn2jJ1qFD/7nnWRpRqUvumjYWoURwgGOiMhR/ftx+C8ixIHCkRpY4pHaDb9?= =?us-ascii?Q?Y//M0N/3mxCz7vkxGvpK0YBZlI5mEjadW8uF8nJvOx7wHJ2V2g8slxNs1UGr?= =?us-ascii?Q?jh6SpocuQTlsuDfMMMpu+vAJIUfTLyfVINHs1ub0D0ZCarMU9BsO4+F876id?= =?us-ascii?Q?c4kvUvJ7LYwE81QLBb5E/BDhScw3h8iAOdXefzxdihSBVdx1C8fuJk/Pmquq?= =?us-ascii?Q?hMRHWcgK27x0p4p7wrBu9LE+5ImbmXN0kIIgeZrgnlp2DyivPULD+U+ztI8z?= =?us-ascii?Q?iwnyLDZiotiICVV2NyzU/3e8vzUglMxapEu0ZLrvoBqOLVdCLfLCjceJnSXq?= =?us-ascii?Q?A2bS65/prZRqICLtFF8t6pn71mQupDECdxyKkfStTP9LizYcAldx4YeYvY+G?= =?us-ascii?Q?4IvOfn/ZryjjBuSBwLFZYOuylqVLxs14YF4bHlA7CD2g5g3L+XDNx+ptfY6L?= =?us-ascii?Q?GFsBG4B5ipWMKE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O/Xc?= =?us-ascii?Q?jyyi7lqYPXF+6jXRAd9VJQB+g2vu9xRNoorKeFy4tAESvLmR+rj56jRTEbPf?= =?us-ascii?Q?jMKoG3XlbEeFvPn5vE5aXURPILH9sVuaNYDSuJnbvW6vAV823hMJsv6Ex1GO?= =?us-ascii?Q?8XIoSFfkbUTI9abHqTZAK87rmHUZzP0augBRlGaX566GNemxzyTtOJSDnA8H?= =?us-ascii?Q?RiBAgV5bxVabNgnpc+T0ijPJMWrtE7EOPaaW5tv9shlN2yxg9xip+po0b0pS?= =?us-ascii?Q?GAOnpnAXq3RJxzRqE22K0XRa2lCuIZGdQyroMVSH+WbMrwYnCmBDX4bxe1Z3?= =?us-ascii?Q?I1z003VodkdCOuLIaJdbIOHFs5pj5pKJAzSv4QqVpbHmSg/hCOTbtV3MFv2/?= =?us-ascii?Q?CvXkIWM1xDM6UD6W9kDqKQwrGj4Q37VTmOKS19XaZjSLpm/0gVZciqo9roc8?= X-MS-Exchange-AntiSpam-MessageData-1: /yzbVYdd8VciZO6FT+OE7ujde1LyW77I1cWxDnar/SSEmI4Cv5xEk/4m X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: d3e79464-2e6e-462c-da52-08dee750ee83 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:11.9296 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: cGQS4GLbZJRyoG3KL2Kfjw5CSruTsyPyVIY2LkV4Utpgj5Fu09RI1Vs7dEBndxH0tMphyREAXRfK40jeNrSvEZf4mujLALdyxPgBTha4HwnIXjkZ/WtWPWUxwXEg+Sp0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" THE ACPI spec states: "[The Error status register] Contains the processor relative address, represented in Generic Address Structure (GAS) format, of the Error status register. This field is ignored by the OSPM on slave channels" Referring to type 4 channels. https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/14_Platform_Communications_Ch= annel/Platform_Comm_Channel.html#hw-registers-based-communications-subspace= -structure-type-5 Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index da26578a8aab..3c059fe87ce4 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -270,6 +270,9 @@ static int pcc_mbox_error_check_and_clear(struct pcc_ch= an_info *pchan) u64 val; int ret; =20 + if (pchan->type =3D=3D ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) + return 0; + ret =3D pcc_chan_reg_read(&pchan->error, &val); if (ret) return ret; --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from BYAPR05CU005.outbound.protection.outlook.com (mail-westusazon11020076.outbound.protection.outlook.com [52.101.85.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93BC347013D; Tue, 21 Jul 2026 17:53:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.85.76 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656399; cv=fail; b=hOoIe8E1u1MuMLd95uYv+QqikY/Ef/aeGKQ7lN3+0yd3PIjCoqVyz06DHDfa6PPGV/1B6dzJe10OagwDOWjdvoNj3cv19rh1UHCUjqdI/ZlZ7I4L8xwliuTJ5hLFTjDHhFpfx0RSfRBlEom8FztSRHjtmPIm5xjBkOUPTz+zXhc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656399; c=relaxed/simple; bh=WfFlR7ab/LEmmPWwSodF9g4iwpOmp6z1MrZGJFLk9m8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=iwqWlyy18pVzsIuB8tFcAbDeAI55D05TRDjwB8//gmnWPpjsPyGRwCX4b9FMmgHj6W3pcf8RLDaKYfehczErSGIF0kdXW2iD8BlyDECoTgH7EVkCA/I1WZaAikQVoWW2O0EraCIZSLD8WiGSaAVITsAqypuAhN3xa6BExWIFSNY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=mhQC7A2i; arc=fail smtp.client-ip=52.101.85.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="mhQC7A2i" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lfSUssNuzSOCd6FWwkgVvfUDqbXt5CUcts/uDsmux1Jrr/7M0tvpNtkMqxWi22dJKo2ah6Hwc26D0Muo9nGYAnV6+HKigTdpvmPOfcDSwuUczImjEiVCWycEmQkZwO01sx9oY4jfa82oUlZ0Yf8ByEn3aD/yGw57ePmLIfVJcNYaHm2SQp/qRb/RmU2J8vKTNzzeIC0JFh/SIyHpLxDDcG1OFzwHyz+iQOzcDb0/LInmDMrrHhnYfPeX+h+po4oTWMdPm3L/6FUwLRYJgVk3isC7nLysmP13vnW13zLf3C35VTh2G7XID1E+GW3WFj+6Bdx7Hcfa8LzDR13WC10VUA== 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=tVPGE+eocrw3P6/Z83N/rqXKLrzqEbuPWDjB3icBqjw=; b=iMcDeT7ATZFyAUY9XYgerG/BTDUqxFAZqqjZbWOVDQTWYm9RNW7XyHNOCK0132sw1jlIMTkp3j5nFwXfX0Jt3HmRZsllUP6pUXi3fsC2hyHUgCqS6z0ZwemcelL2vU7eOdciGeu1uj1GUToeBefbNA+C9TXgixlPcAykYLF1u+Ay1u4X+4sD6J7s5NnSKTVwMVW6EI07YCm0IoBGHUC6tlCkXTdNWTTtuMBFEqQRrW1YPXu8jTrne7YGR0xnoGOJcWYk7btPO197ct9Eaj7sdLjs4nZHszDRPdu/kqwpqa5WXr6aGKVFJ1DSDzw05pLp3k20V1xGViKjdqVoLTkVgw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tVPGE+eocrw3P6/Z83N/rqXKLrzqEbuPWDjB3icBqjw=; b=mhQC7A2ioqhv/BA7p+ugA6OlyAf3ZzZXP1Bqs2gaT8G8QdtmGTvVyqc2WWW9K9Jl7tJlyRBzn0UZjQZ6XFvbmwgr0TdWFi6N3+4J6wXJT/6T4xaPaQFIS2AxvNUb/iVGENjzHDabMdbmKQ+nlwAL34AQSeuNgJrRuE09U7fL0RI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:15 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:15 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 3/7] mailbox/pcc.c: report errors for PCC clients Date: Tue, 21 Jul 2026 13:52:52 -0400 Message-ID: <20260721175258.87600-4-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CYXPR02CA0014.namprd02.prod.outlook.com (2603:10b6:930:cf::20) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: f2e7f587-d1a5-434a-ccea-08dee750f0a6 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003|6133799003; X-Microsoft-Antispam-Message-Info: lWOuia65LUNogSvQ/pNa/RuypSQCKZasOsuDZt0jpZjH2PEkTNuw76Qwtugq50MBTv9kdTnPkREYktaOUgSf18bxDMiMDc9ltCFJSOJAAn9/fBetOk7wDTnrumNO6SAU6nzAp/6I6WaXvGCN9aMqIG0/1/tGrgXWRh+x8m8S4/C9HprdP3DFrOvpuFGyPhn9N5nJIMcG2uXBBDHY4R2mVqIE3DDLJ6E6ga3j4zc4jTm+npaYcWC88KLy2ZInC5iCmNJF+hn7i7vDmeyp47kq6UAyS6LnVYHbpF7OgYjVqBudP++tRmPtrx1eRFkEu/VEyjdV4O1ymkcrhgiGK9GXvXZBYLkJwZDvgaQmF5KcK7ifW6ySePF/LFhPiYgYzYHmX6t4SSllQiy+LSnbbEshyit/HAOlAhiNJWRVIkWCaX+8C0vWb6ZtwakninrykkmR+dZTeznWBBkXo6OQsPCVv3QGYd6mCmKgeWaLOfnLMD6Cir/UsueWdgCKGU6iDgS2oU0hXA1ol70Go+dQlgbgkWgr37Jkim0GYgX3pn+WQAnmINxlZCXwg/JUCJ3UPAI2eLyRAVBveVqyJmWnatjNkifcD3pO7O6kIyOPA0ObNVJuLrqgaSSlk3qgDNwejrJnB7NXOaPdfJDHbG0cxMOffFD/FM6fKskyBjrGaPblw5E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003)(6133799003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?KtWLaM45YUpaejTYToPDo0dNdoE48vE7tzayao9dcSHnceegKzaX3v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-MessageData-1: NpICqRe12l4RZMvOEKvZVxgqCa6nCCu/Tq+rWIWOA+ajsE8+LPsKzpmh X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: f2e7f587-d1a5-434a-ccea-08dee750f0a6 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:15.5281 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: LcFyJQW5Zp78ajay6GLC8jJut+Hp70T6HBFftZ9iDJ9dbr4hPehnqnkKhD7R0z1oNiufggZ/Nr9nt9pug4ptlu/zOkQOZeYrQlGeWXKnCpZ8+tfRU2bIKX2hnRiZCc6B X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" The tx_done callback function has a return code (rc) parameter that the tx_done callback can use to determine how to handle an error. However the IRQ handler was not setting that value if there is an error. The following clients are affected: drivers/acpi/cppc_acpi.c drivers/i2c/busses/i2c-xgene-slimpro.c drivers/hwmon/xgene-hwmon.c drivers/soc/hisilicon/kunpeng_hccs.c drivers/devfreq/hisi_uncore_freq.c All of these only use the error code to report, so they are expecting an error code to come thorugh, but they do not modify behavior based on this code. In the case of an error code in the IRQ, the handler was returning IRQ_NONE which is not correct: the IRQ handler was matched to the IRQ. This mean that multiple error codes returned from a PCC triggered interrupt would end up disabling the device. In addition, if the error code IRQ was coming from a Type4 Device that was expecting an IRQ response, that device would then be hung. Fixes: c45ded7e1135 ("mailbox: pcc: Add support for PCCT extended PCC subsp= aces(type 3/4)") Signed-off-by: Adam Young --- --- drivers/mailbox/pcc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 3c059fe87ce4..b1c7d3e4c5e3 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -317,6 +317,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) { struct pcc_chan_info *pchan; struct mbox_chan *chan =3D p; + int rc; =20 pchan =3D chan->con_priv; =20 @@ -330,8 +331,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) if (!pcc_mbox_cmd_complete_check(pchan)) return IRQ_NONE; =20 - if (pcc_mbox_error_check_and_clear(pchan)) - return IRQ_NONE; + rc =3D pcc_mbox_error_check_and_clear(pchan); =20 /* * Clear this flag after updating interrupt ack register and just @@ -340,8 +340,9 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) * required to avoid any possible race in updatation of this flag. */ pchan->chan_in_use =3D false; - mbox_chan_received_data(chan, NULL); - mbox_chan_txdone(chan, 0); + if (!rc) + mbox_chan_received_data(chan, NULL); + mbox_chan_txdone(chan, rc); =20 pcc_chan_acknowledge(pchan); =20 --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from SN4PR0501CU005.outbound.protection.outlook.com (mail-southcentralusazon11021120.outbound.protection.outlook.com [40.93.194.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90290476065; Tue, 21 Jul 2026 17:53:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.194.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656406; cv=fail; b=JnauMxnINB82PMpaIKHg9NwP045cDbliBgDEBjAtA8VdpKLcdKjYfdJz+pFEtoUS9tWYlQVhZ1YTzziRQ9ks5bWwUd7Z7U1DDxpOdvty8Su1dEDRKmPj+mx6kydGJUUqTPIkCtbOsd8/fi+3W7KY/rZNspro08h5bSflrFDV15M= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656406; c=relaxed/simple; bh=pNV3iQ11UTJVfDL9ofkULsHwKw7DLfLEDOZG579yT84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=AwLY/LI+zFmrxDAKeqzDHhXUdQRfa4yu5lspLkXXac4AtR8bs6RA1ZheGBEen8gw8KExlVFgA7H5zTALhW4mbLya1v0mOvrFegK+4qTp32GwLanMFgekaqIImiIzMkBUm77tQaywz/gUbVjs7TYhXOiN3I7YfZ0yipTydjhUgJQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=cQmat+dt; arc=fail smtp.client-ip=40.93.194.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="cQmat+dt" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y1jyKOc5PBUg2XwRot+dQcBwpFwh3Pt6UFmpYXA9bqM29NdHUtfFGM4FD460bKQbfqpv0BOJGNRFiZyzMnl74naGiyQVcSzifLYEXLObSdldK5g5KMnfhWW+X6vO2GpuqEieYKJ4tbsd7U5fZpPbTghsp7bKd+SBaxL5nW0piZ+aDSQ4RNJLvyrh35NSNW5fgsThlvLTqnDxlyXO93w24PXhkC+b/uW1XGQcDzbnGmDtHczfZ2KI9HZlzSb3QUx0KWkOhHyqsWkdCa8PmMAlXT1bSGuY8SkuWpMIYy87j1Uks8XWsLQQEt9KGhfr8ONib9xAhSKUtUKg5ig+NmbPXQ== 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=Viz+QIKgsg3LljvRmuFtg6CFhwSQYW+nD8K2mJYCe7E=; b=NtCDnC30SaQ0vUkIAVDU988kKx9wRgweWseof0XhpGQlrG5hma9KVA7sWvhkb1Eeu2JJRzu/k0CgfG/WrgegQX8GWiyNl+nOGc5AiNYA3L5KxlRcxS/DanJQL6tlDCYtJTsA23375gbc5XaBr/8/ZpJhSxeLb3vrO8r9Sc7m9JQkBJEexsdjILBWXxrpUBYgDN2rmHiOV6FBVfAUCRvV5LFNirMubdzTjrxOcg/GeoIS92zm0CriZdWwEMfP5CxBr0Zqe9oB2mawd+BGY7m80ALwYZoTv60lT9EB8XeWopt179pZH2W2bcdIFCgK7JLF5sw6b+SLtRAgF+eHd2iI4w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Viz+QIKgsg3LljvRmuFtg6CFhwSQYW+nD8K2mJYCe7E=; b=cQmat+dtajuPTzXugWW2h1lYNz+5JAPP2UP5ChM1mq+WXoahngWjbqWSbxSeaTLplW0OWG4gn65GjXZHuguohmRaUQAEQM7yRwZxhF/4EUSF+KvZmQ/qRqxiFRQUSkc1jv8haPDXVcCedRhB4xfszIpuNYmmCHCglf9+L79+LOo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:19 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:19 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar , "Rafael J. Wysocki" , Saket Dumbre , Len Brown Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 4/7] mailbox/pcc.c: add query channel function Date: Tue, 21 Jul 2026 13:52:53 -0400 Message-ID: <20260721175258.87600-5-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CYZPR02CA0021.namprd02.prod.outlook.com (2603:10b6:930:a1::18) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: 3614fc68-514e-42ac-3af4-08dee750f2d0 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003|6133799003; X-Microsoft-Antispam-Message-Info: sTMSnB1er7JHdCDNvEYUqveFOS7ZDm2t9fLj4AQycWvW3WmAO7xsmQKFx0WZUDeA2r04AW9Cibw5bFbkanHoqTpvAM8AaLtS7X+OmtkM/HbShZTUciWUyJyMsZOdXJ4q/gxnFMNBuA15w/iRkHt4OUJBtw9P3qIcnX7aWENfGnEi9op4Oq2z/R0i0yY0GfDOPky046tfDOt75oSVjttQqD7UbPXCY5ce1orN2V53njydwicWYS1LS9JZHJFuyuRVuwi7yRTIS4YefmlZrlHb+D0SAFZlq46fDHU+KJJag0tQaAh1DTvSk6TFSw2RtDoSUcKrsww6RBiDgmGWNjCqPQKyRTDl5I0uzFIjia5XRUG5lyEACE3XwtjXqBXdESXci9z4E1X4gw2bS5di3LvUdpon5lHtXVJWdJOS3V4MZVGdiZQkKw3DGJkkVgqIctERLDWGQZ8ZlVn/LuGAaRsPYsTishODcw/fpnZpDV3vhzGd96Awr6IzfiAfAbtD2WO5jWNkdDpHi2XII09m1OX8KnA6zZ/GhWitu0LrOd/pz6hP5IPvs7IDiQtRRf4Xs+qeeZQQ85XIBpmVd6EpmKYqBgdzQQytsLUPr/HaMfMrWft3ZPzdDHZAZ4iSpa+Mkb8tZDWiwe+lxFbCI6I1q286LEj5CzMhyaQd6yfiL8Zxb9c= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003)(6133799003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?urIvCjGW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IZOd8IGEkhUGuAy8QZh1pO4alLdjm60mpaKqbqDSR?= X-MS-Exchange-AntiSpam-MessageData-1: /XRLVg+J2ZBM0TI1jstVFX7On1p5FWWGTS5PP+9VNq4mzUbiaNRyf0e9 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3614fc68-514e-42ac-3af4-08dee750f2d0 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:19.2255 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: C1WqxN59qECm1JXWq7lM7lYYyXaDjDuL+evpbX7lTqQoPQjkPYsMJG7bgeiU1+LdE/1/AexVvrLc8lvlaLdbxtwyFAKbgCpPtdpaxW4GxRtE7qBwCHQxQYxSLFEADDDR X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" Drivers need information about a channel prior to creating a channel or they risk triggering message delivery on the remote side of a connection. Add PCC channel type to records and expose PCC channel type to client. Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 45 +++++++++++++++++++++++++++++++++++++++++++ include/acpi/pcc.h | 9 +++++++++ 2 files changed, 54 insertions(+) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index b1c7d3e4c5e3..b9a01bfdc95d 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -349,6 +349,50 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) return IRQ_HANDLED; } =20 +/** + * pcc_mbox_query_channel - returns information about the channel + * without activating the channel. + * + * @q_chan: a pointer to an already allocated struct pcc_mbox_chan + * that will be populated with the channel data. + * @subspace_id: The PCC Subspace index as parsed in the PCC client + * ACPI package. This is used to lookup the array of PCC + * subspaces as parsed by the PCC Mailbox controller. + * + * Return: 0 upon success or non-zero upon error. + */ +int +pcc_mbox_query_channel(struct pcc_mbox_chan *q_chan, int subspace_id) +{ + struct pcc_mbox_chan *pcc_mchan; + struct pcc_chan_info *pchan; + struct mbox_chan *chan; + + if (!q_chan) + return -EINVAL; + + if (subspace_id < 0 || subspace_id >=3D pcc_chan_count) + return -ENOENT; + pchan =3D chan_info + subspace_id; + chan =3D pchan->chan.mchan; + if (IS_ERR(chan)) { + pr_err("Channel not found for idx: %d\n", subspace_id); + return -EBUSY; + } + pcc_mchan =3D &pchan->chan; + + q_chan->shmem_base_addr =3D pcc_mchan->shmem_base_addr; + q_chan->shmem =3D NULL; + q_chan->shmem_size =3D pcc_mchan->shmem_size; + q_chan->latency =3D pcc_mchan->latency; + q_chan->max_access_rate =3D pcc_mchan->max_access_rate; + q_chan->min_turnaround_time =3D pcc_mchan->min_turnaround_time; + q_chan->type =3D pcc_mchan->type; + + return 0; +} +EXPORT_SYMBOL_GPL(pcc_mbox_query_channel); + /** * pcc_mbox_request_channel - PCC clients call this function to * request a pointer to their PCC subspace, from which they @@ -833,6 +877,7 @@ static int pcc_mbox_probe(struct platform_device *pdev) pcc_parse_subspace_shmem(pchan, pcct_entry); =20 pchan->type =3D pcct_entry->type; + pchan->chan.type =3D pcct_entry->type; pcct_entry =3D (struct acpi_subtable_header *) ((unsigned long) pcct_entry + pcct_entry->length); } diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h index 840bfc95bae3..bf97f407683d 100644 --- a/include/acpi/pcc.h +++ b/include/acpi/pcc.h @@ -8,6 +8,7 @@ =20 #include #include +#include =20 struct pcc_mbox_chan { struct mbox_chan *mchan; @@ -17,6 +18,7 @@ struct pcc_mbox_chan { u32 latency; u32 max_access_rate; u16 min_turnaround_time; + enum acpi_pcct_type type; }; =20 /* Generic Communications Channel Shared Memory Region */ @@ -37,6 +39,8 @@ struct pcc_mbox_chan { extern struct pcc_mbox_chan * pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id); extern void pcc_mbox_free_channel(struct pcc_mbox_chan *chan); +extern int +pcc_mbox_query_channel(struct pcc_mbox_chan *q_chan, int subspace_id); #else static inline struct pcc_mbox_chan * pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id) @@ -44,6 +48,11 @@ pcc_mbox_request_channel(struct mbox_client *cl, int sub= space_id) return ERR_PTR(-ENODEV); } static inline void pcc_mbox_free_channel(struct pcc_mbox_chan *chan) { } +static inline int +pcc_mbox_query_channel(struct pcc_mbox_chan *q_chan, int subspace_id) +{ + return -ENODEV; +} #endif =20 #endif /* _PCC_H */ --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from SN4PR0501CU005.outbound.protection.outlook.com (mail-southcentralusazon11021120.outbound.protection.outlook.com [40.93.194.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7F9C1476076; Tue, 21 Jul 2026 17:53:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.194.120 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656408; cv=fail; b=E+7jYveSwgkjXPyC4xfoEJaKKU1qbHdQ8UxW44GGGASf265koWmNfbjDHwE4Td+4VY8ZH8QzOxjA6xruWF0jmO8iwc52eXMCADQUN/4xLZ6Kh1bbmoqC01DJd6lhlf2JvMOHc6fmJwg4XULh7u6yNNWvl2fPxRh3hSVt/Ua8KXo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656408; c=relaxed/simple; bh=3Rx95PcRxqFuYKYZolWU4fN/i4OCNtb76ITqxckWmh4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=EqKvhlvws+iFdM5j3AiW3e1JF7oPPidx1krZsgEqScgM9K8cI3k7JL9T3LqHGjdoXPtdZNy1Pux3NHRlYPHX8c8mZNn1+7zwPu3rTHPouaLHSeYObS5N/I8FTsf+mESvQhPhvsDJEwN6PAwb+/I6CsTGOGyqMX6ZZe3yIzuaITQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=BMZbY7Qd; arc=fail smtp.client-ip=40.93.194.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="BMZbY7Qd" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=w+zoyuN1LotTC2JBYc1+mnnbICPIRrwCIhsK8tSe+nrH3KR3fTJf5QElQu3Ffnhr4fzUXbfjbUONdbInF/UOuJJkrrxtLjp+lGPWspYNvInuMYhmUVI6SKJm9AweN2s4qRp03NQBhasKCZnoK0R6FNN8wNbpF68GlirZIsKPTv8TP1WoRtXBnz7oFioXierisMcKA5H59Q9uWsAVRVZa35Ox7n6WUWXISfrDaA2cIb/aR3CAYg8XqYV75rwYmaIL4pMFWcnxwHSkBcqX3S78WDNb5EN1f4b2uzlrVGSHMS6uNtgHcG/XiMLSUAs/fSawctLyp3PxawSN7zZPRTRzXQ== 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=pf2ZDSc18vjWHfbMNhfc7lOGHRDveyKJ/KgwmBvBgJ4=; b=kMd2lJH292IudmoRQ9+ef7IqqDPx8DtVKxUKcb77g5C65NCKhdIwuD6q26ATUlgKoW1GylIxQhq7j4beRajd4ejhpvY1ygvAfIfuhPfNz4ewP6dpaOScPIyCXQ8hOrCHh7mesxgy18cecU7p0MUsk0U4jIOCXL+G3IPsgqYI9c/1nTyxxAKBz6zEXw80dT+lkVH/u9Wl6bZkEdM3LMjFXZHbbvN+73jo8bVPTppN3/DQiioKGdn//QUzkvUc/ayL+gGv8ilGcB8JRDoB11FrUBjpRjmmzn4QpjGdcjrAFevVNy72fFlNtGm0Aa4V2lr6WuaLZikbH/KXjWnBLfSZRQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=pf2ZDSc18vjWHfbMNhfc7lOGHRDveyKJ/KgwmBvBgJ4=; b=BMZbY7QdTs6U11SZD2GLRs4nUDKiS1azRDxnOalgVgDNScnccwFiElTre3K4GPGtkswn17rMRqTUZG2Sbu8NxHU9ty0vk6/FCO7QMfYg6+aYWPlfvUpwQwD8v/vZsBTLYACoRziDYqU9ripe0IIidHzDMe0F73f9kWfL1pmP9mc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:23 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:23 +0000 From: Adam Young To: Jeremy Kerr , Matt Johnston , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 5/7] mctp pcc: Implement MCTP over PCC Transport Date: Tue, 21 Jul 2026 13:52:54 -0400 Message-ID: <20260721175258.87600-6-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR15CA0136.namprd15.prod.outlook.com (2603:10b6:930:68::24) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: b4441660-c719-4051-230a-08dee750f522 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|13003099007|22082099003|55112099003|18002099003|3023799007|56012099006|11063799006|10067099003|6133799003; X-Microsoft-Antispam-Message-Info: 16/A0TZIjOL14H4PghNKtCLFQHhkP2QmCLNk4uHUfMCsctjybawJlB+AlFZ2AypMrt71kbPa6MkMJ2oHf9YltC3kY1AR3B1ANKg4RwXB855UksHghKY4ScfhCVZL/ARZjc0QZj+E+hF82GoEpSG9zwJulV7oTmN3VNRq+qNcaq44pu87nYzU0A+CNVHf14XaZGTJTXJIs5ZNmQZBEKM9oXMBjWqUDv8J1zMHu8eNh18YXh6Lq/wfmk8LoVOzB87YUb84ssXOExVjk6wZk0H8UMsHx+8GaArj4v1xL0BYm2kVZgLjOTTV2Kn0k0Hco3Z2vkXLxUjRAkgivOWj20Awawv9vU2yY0MWZ86H0T/o5kwfRFrGsxHW1P3xmIANrdFpX20AJAkXYFfWvA/BFPzhjjFqgLTJKZiCcEjY8IE93vf0Qz4f9eophzvKymFmwb0gCEK6lFDGFHQjp67vefp0AHbMHB2mXO9vOhcP3jRBOygx5VHd91F3ryAnkFIbhU1GGUgUmnjnpcpKwyltGvEB3WVqxVrKjUv8PHmEnexNjS7KwlAZZgtyOYc2ABbkifSXl7wqyFrDz+lUHd/PaQdwHoz6hG2wwv2sJGZgI/8BnvB+jXvbASV1cBDdc3t6zVVH X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(13003099007)(22082099003)(55112099003)(18002099003)(3023799007)(56012099006)(11063799006)(10067099003)(6133799003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?iVnd+M2wOsUS4jJ8dWlhaQix8vlJjHGm9ATuUAZsxhkebU29kr3AtlDr9oZz?= =?us-ascii?Q?tmCO2Wtbvp8WUDRv3XgUbC7LOg3/OUeg945YCHDP1esHrBNh7X4E/Z5bIQUy?= =?us-ascii?Q?Ya4yymOcxyjRKR1XVnbH3BfgLmiKVLHYAGtBvX1r3/W6vl3K/fBzWNrOFUaV?= =?us-ascii?Q?M8x8v2EkZyK5iHcv6YRxsjSkwxPb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us-ascii?Q?Fa/3ahGaJgvqDI1ibjUlq3ux/2TC9xZObq+mTJDKpOhvckU4NqcOOH3gEUNA?= =?us-ascii?Q?k4ra3MNhAZb5SCNZ31Nq8l95AgPT5QZ/+eMxo3YB/wdI3veIvtBzhGFDGq+Y?= =?us-ascii?Q?qO5WWXyAdVbskODlslcp04A21W8qRG1TsWPTZDwR1hPoakpqEIQ69RKHMAXK?= =?us-ascii?Q?JcwU+wmHmMDgFf5G+o0q+b8pTthLbfCiBNc+8X8LXTe+MxXCWZNw7wQdP889?= =?us-ascii?Q?kPHYHvZLCia4OzbkWHSFVgyCO/j7zuOzK2M+G4fWWPqOPNxepYFeXm9ymIJb?= =?us-ascii?Q?lQyHTYDkea1k31Pr177nqg3tRfyPCivyvAassf1u+C0Jq4KXevGOAFdMhjPV?= =?us-ascii?Q?QjUm1OoKk8TyTjCV95tbV98IvxJaWfS+yDWYJNRsGH/KACVXvmzo0vfMrYfB?= =?us-ascii?Q?61/ur8WW2FhqAIG7piaulJxMZqXjBpEptarW0rIfIGuBlVG4xZcYwiF1yFiS?= =?us-ascii?Q?XGVk+nkMDnMxoFD2massv8HfEDxwjMvCfsu2LEP9D/O0gm1Qp3TL9kEC+24k?= =?us-ascii?Q?dskqQYyL6uPMivAUTx/NOrfZcWMdywWe+OF4vXYHcMiBufGjDACIkGhqh/rt?= =?us-ascii?Q?g5VvGD54YyHmpVmNY8sMI+OfUlK/MrkkY+qS3YzqQ87env7fXUxaY+EXI1SC?= =?us-ascii?Q?mWg9+hgk6qDC1db9bQ+hWKdnck93ehcwRPcFJmTlyvAEzq2jkAhWipjrsuxy?= X-MS-Exchange-AntiSpam-MessageData-1: gKWlrYmXKQtj5z0jlA3YEvUX9t0YdWCQNMaULviDK78p//F6VQ82OsnE X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: b4441660-c719-4051-230a-08dee750f522 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:23.0885 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Sbw43l9jglWzukYDSrhSF7qLnFWaxfOA0ZRGqoaP9b5Q614rExYTKW+EqQNicXUCOrLDC1JR9o9Cug9UKzowtA5dvz+WPUWacXf90kor4LflevTuP9ZKxjxThOlYphmK X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" Implementation of network driver for Management Component Transport Protocol(MCTP) over Platform Communication Channel(PCC) DMTF DSP:0292 Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0292.= pdf The transport mechanism is called Platform Communication Channels (PCC) is part of the ACPI spec: Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/14_Platform_Communicati= ons_Channel/Platform_Comm_Channel.html The PCC mechanism is managed via a mailbox implemented at drivers/mailbox/pcc.c MCTP devices are specified via ACPI by entries in DSDT/SSDT and reference channels specified in the PCCT. Messages are sent on a type 3 and received on a type 4 channel. Communication with other devices use the PCC based doorbell mechanism; a shared memory segment with a corresponding interrupt and a memory register used to trigger remote interrupts. The shared buffer must be at least 68 bytes long as that is the minimum MTU as defined by the MCTP specification. Unlike the existing PCC Type 2 based drivers, the mssg parameter to mbox_send_msg is actively used. The data section of the struct sk_buff that contains the outgoing packet is sent to the mailbox, already properly formatted as a PCC exctended message. If the mailbox ring buffer is full, the driver stops the incoming packet queues until a message has been sent, freeing space in the ring buffer. When the Type 3 channel outbox receives a txdone response interrupt, it consumes the outgoing sk_buff, allowing it to be freed. Bringing up an interface creates the channel between the network driver and the mailbox driver. This enables communication with the remote endpoint, to include the receipt of new messages. Bringing down an interface removes the channel, and no new messages can be delivered. Stopping the interface will leave any packets that are cached in the mailbox ringbuffer. They cannot safely be freed until the PCC mailbox attempts to deliver them and has removed them from the ring buffer. PCC is based on a shared buffer and a set of I/O mapped memory locations that the Spec calls registers. This mechanism exists regardless of the existence of the driver. If the user has the ability to map these physical location to virtual locations, they have the ability to drive the hardware. Thus, there is a security aspect to this mechanism that extends beyond the responsibilities of the operating system. If the hardware does not expose the PCC in the ACPI table, this device will never be enabled. Thus it is only an issue on hardware that does support PCC. In that case, it is up to the remote controller to sanitize communication; MCTP will be exposed as a socket interface, and userland can send any crafted packet it wants. It would also be incumbent on the hardware manufacturer to allow the end user to disable MCTP over PCC communication if they did not want to expose it. Although the config Allow 32Bit builds, they are untested. Link: https://www.dmtf.org/sites/default/files/standards/documents/DSP0292_= 1.0.0WIP50.pdf Link: https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/14_Platform_Communicati= ons_Channel/Platform_Comm_Channel.html Signed-off-by: Adam Young --- Previous Version: https://lore.kernel.org/lkml/20260522193610.234166-1-admiyo@os.amperecomput= ing.com/ Changes from Previous version - Compares inbox and outbox buffer size to get smallest MTU - uses mctp-pcc query channel information without opening channel. Opening the channel can trigger the sending of a message from the remote side before the driver is ready to read it. Take advantage of the API that allows querying of the channel data without opening the channel. - Sets network queue to default length instead of 0 - Removed reference to MCTP spec - Remove reference to endianess - Rebased on top of PCC mailbox change for atomit startup/teardown Remove reference to endianness remove reference to DSP0256 --- MAINTAINERS | 5 + drivers/net/mctp/Kconfig | 15 ++ drivers/net/mctp/Makefile | 1 + drivers/net/mctp/mctp-pcc.c | 466 ++++++++++++++++++++++++++++++++++++ 4 files changed, 487 insertions(+) create mode 100644 drivers/net/mctp/mctp-pcc.c diff --git a/MAINTAINERS b/MAINTAINERS index 6940aa3d498b..9f48dee0f4c6 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -15582,6 +15582,11 @@ F: include/net/mctpdevice.h F: include/net/netns/mctp.h F: net/mctp/ =20 +MANAGEMENT COMPONENT TRANSPORT PROTOCOL (MCTP) over PCC (MCTP-PCC) Driver +M: Adam Young +S: Maintained +F: drivers/net/mctp/mctp-pcc.c + MAPLE TREE M: Liam R. Howlett R: Alice Ryhl diff --git a/drivers/net/mctp/Kconfig b/drivers/net/mctp/Kconfig index cf325ab0b1ef..c9b8f38ff0fb 100644 --- a/drivers/net/mctp/Kconfig +++ b/drivers/net/mctp/Kconfig @@ -47,6 +47,21 @@ config MCTP_TRANSPORT_I3C A MCTP protocol network device is created for each I3C bus having a "mctp-controller" devicetree property. =20 +config MCTP_TRANSPORT_PCC + tristate "MCTP PCC transport" + depends on ACPI + depends on PCC + depends on CPU_LITTLE_ENDIAN + help + Provides a driver to access MCTP devices over PCC transport, + A MCTP protocol network device is created via ACPI for each + entry in the DSDT/SSDT that matches the identifier. The Platform + communication channels are selected from the corresponding + entries in the PCCT. + + Say y here if you need to connect to MCTP endpoints over PCC. To + compile as a module, use m; the module will be called mctp-pcc. + config MCTP_TRANSPORT_USB tristate "MCTP USB transport" depends on USB diff --git a/drivers/net/mctp/Makefile b/drivers/net/mctp/Makefile index c36006849a1e..0a591299ffa9 100644 --- a/drivers/net/mctp/Makefile +++ b/drivers/net/mctp/Makefile @@ -1,4 +1,5 @@ obj-$(CONFIG_MCTP_SERIAL) +=3D mctp-serial.o obj-$(CONFIG_MCTP_TRANSPORT_I2C) +=3D mctp-i2c.o obj-$(CONFIG_MCTP_TRANSPORT_I3C) +=3D mctp-i3c.o +obj-$(CONFIG_MCTP_TRANSPORT_PCC) +=3D mctp-pcc.o obj-$(CONFIG_MCTP_TRANSPORT_USB) +=3D mctp-usb.o diff --git a/drivers/net/mctp/mctp-pcc.c b/drivers/net/mctp/mctp-pcc.c new file mode 100644 index 000000000000..57c4f3b21513 --- /dev/null +++ b/drivers/net/mctp/mctp-pcc.c @@ -0,0 +1,466 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * mctp-pcc.c - Driver for MCTP over PCC. + * Copyright (c) 2024-2026, Ampere Computing LLC + * + */ + +/* Implementation of + * https://www.dmtf.org/sites/default/files/standards/documents/DSP0292.pdf + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define MCTP_SIGNATURE "MCTP" +#define MCTP_SIGNATURE_LENGTH (sizeof(MCTP_SIGNATURE) - 1) +#define MCTP_MIN_MTU 68 +#define PCC_HEADER_SIZE sizeof(struct acpi_pcct_ext_pcc_shared_mem= ory) +#define MCTP_PCC_MIN_SIZE (PCC_HEADER_SIZE + MCTP_MIN_MTU) +#define PCC_EXTRA_LEN (PCC_HEADER_SIZE - sizeof(pcc_header.comma= nd)) +struct mctp_pcc_mailbox { + u32 index; + struct pcc_mbox_chan *chan; + struct mbox_client client; +}; + +/* The netdev structure. One of these per PCC adapter. */ +struct mctp_pcc_ndev { + struct net_device *ndev; + struct acpi_device *acpi_device; + struct mctp_pcc_mailbox inbox; + struct mctp_pcc_mailbox outbox; +}; + +static void mctp_pcc_client_rx_callback(struct mbox_client *cl, void *mssg) +{ + struct acpi_pcct_ext_pcc_shared_memory pcc_header; + struct mctp_pcc_ndev *mctp_pcc_ndev; + struct mctp_pcc_mailbox *inbox; + struct mctp_skb_cb *cb; + struct sk_buff *skb; + int size; + + mctp_pcc_ndev =3D container_of(cl, struct mctp_pcc_ndev, inbox.client); + inbox =3D &mctp_pcc_ndev->inbox; + memcpy_fromio(&pcc_header, inbox->chan->shmem, sizeof(pcc_header)); + + // The message must at least have the PCC command indicating it is an MCTP + // message followed by the MCTP header, or we have a malformed message. + if (pcc_header.length < sizeof(pcc_header.command) + sizeof(struct mctp_h= dr)) + goto error; + + // If the reported size is larger than the shared memory minus headers, + // something is wrong and treat the buffer as corrupted data. + if (pcc_header.length > inbox->chan->shmem_size - PCC_EXTRA_LEN) + goto error; + + if (memcmp(&pcc_header.command, MCTP_SIGNATURE, MCTP_SIGNATURE_LENGTH) != =3D 0) + goto error; + + size =3D pcc_header.length + PCC_EXTRA_LEN; + skb =3D netdev_alloc_skb(mctp_pcc_ndev->ndev, size); + if (!skb) + goto error; + + skb_put(skb, size); + skb->protocol =3D htons(ETH_P_MCTP); + memcpy_fromio(skb->data, inbox->chan->shmem, size); + dev_dstats_rx_add(mctp_pcc_ndev->ndev, size); + skb_pull(skb, sizeof(pcc_header)); + skb_reset_mac_header(skb); + skb_reset_network_header(skb); + cb =3D __mctp_cb(skb); + cb->halen =3D 0; + netif_rx(skb); + return; + +error: + dev_dstats_rx_dropped(mctp_pcc_ndev->ndev); +} + +static netdev_tx_t mctp_pcc_tx(struct sk_buff *skb, struct net_device *nde= v) +{ + struct acpi_pcct_ext_pcc_shared_memory *pcc_header; + struct mctp_pcc_ndev *mpnd =3D netdev_priv(ndev); + int len =3D skb->len; + + if (skb_cow_head(skb, sizeof(*pcc_header))) + goto error; + + pcc_header =3D skb_push(skb, sizeof(*pcc_header)); + pcc_header->signature =3D PCC_SIGNATURE | mpnd->outbox.index; + pcc_header->flags =3D PCC_CMD_COMPLETION_NOTIFY; + memcpy(&pcc_header->command, MCTP_SIGNATURE, MCTP_SIGNATURE_LENGTH); + pcc_header->length =3D len + MCTP_SIGNATURE_LENGTH; + + if (skb->len > mpnd->outbox.chan->shmem_size) + goto error; + + /* + * There is a possibility that the mailbox can be cleared on + * another thread. If that is the case, and we don't restart + * the queue, it will remain permanently stopped. + * Stopping the queue before attempting to send the message + * allows us to always restart it if mbox_send_message succeeds. + */ + netif_stop_queue(ndev); + if (mbox_send_message(mpnd->outbox.chan->mchan, skb) >=3D 0) { + netif_wake_queue(ndev); + } else { + // Remove the header in case it gets sent again + skb_pull(skb, sizeof(*pcc_header)); + return NETDEV_TX_BUSY; + } + return NETDEV_TX_OK; + +error: + dev_dstats_tx_dropped(ndev); + kfree_skb(skb); + return NETDEV_TX_OK; +} + +static void mctp_pcc_tx_prepare(struct mbox_client *cl, void *mssg) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev; + struct mctp_pcc_mailbox *outbox; + struct sk_buff *skb =3D mssg; + + mctp_pcc_ndev =3D container_of(cl, struct mctp_pcc_ndev, outbox.client); + outbox =3D &mctp_pcc_ndev->outbox; + + /* The PCC Mailbox typically does not make use of the mssg pointer + * The mctp-over pcc driver is the only client that uses it. + * This value should always be non-null; it is possible + * that a change in the Mailbox level will break that assumption. + */ + if (!skb) { + netdev_warn_once(mctp_pcc_ndev->ndev, + "%s called with null message.\n", __func__); + return; + } + memcpy_toio(outbox->chan->shmem, skb->data, skb->len); +} + +static void mctp_pcc_tx_done(struct mbox_client *c, void *mssg, int rc) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev; + struct pcpu_dstats *dstats; + struct sk_buff *skb =3D mssg; + unsigned long flags; + + /* + * If there is a packet in flight during driver cleanup + * It may have been freed already. + */ + if (!mssg) + return; + mctp_pcc_ndev =3D container_of(c, struct mctp_pcc_ndev, outbox.client); + + /* Use an IRQ safe update as this is called from HARD IRQ instead of + * dev_dstats_tx_add(mctp_pcc_ndev->ndev, skb->len); + */ + dstats =3D this_cpu_ptr(mctp_pcc_ndev->ndev->dstats); + flags =3D u64_stats_update_begin_irqsave(&dstats->syncp); + + if (rc) { + u64_stats_inc(&dstats->tx_drops); + } else { + u64_stats_inc(&dstats->tx_packets); + u64_stats_add(&dstats->tx_bytes, skb->len); + } + u64_stats_update_end_irqrestore(&dstats->syncp, flags); + dev_consume_skb_any(skb); + netif_wake_queue(mctp_pcc_ndev->ndev); +} + +static int mctp_pcc_open(struct net_device *ndev) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev =3D netdev_priv(ndev); + struct mctp_pcc_mailbox *outbox, *inbox; + + outbox =3D &mctp_pcc_ndev->outbox; + inbox =3D &mctp_pcc_ndev->inbox; + + outbox->chan =3D pcc_mbox_request_channel(&outbox->client, outbox->index); + if (IS_ERR(outbox->chan)) + return PTR_ERR(outbox->chan); + if (outbox->chan->shmem_size < MCTP_PCC_MIN_SIZE) { + pcc_mbox_free_channel(outbox->chan); + return -EINVAL; + } + + inbox->client.rx_callback =3D mctp_pcc_client_rx_callback; + inbox->chan =3D pcc_mbox_request_channel(&inbox->client, inbox->index); + if (IS_ERR(inbox->chan)) { + pcc_mbox_free_channel(outbox->chan); + return PTR_ERR(inbox->chan); + } + if (inbox->chan->shmem_size < MCTP_PCC_MIN_SIZE) { + pcc_mbox_free_channel(outbox->chan); + pcc_mbox_free_channel(inbox->chan); + return -EINVAL; + } + return 0; +} + +static int mctp_pcc_stop(struct net_device *ndev) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev; + unsigned int count, idx; + struct mbox_chan *chan; + struct sk_buff *skb; + + mctp_pcc_ndev =3D netdev_priv(ndev); + chan =3D mctp_pcc_ndev->outbox.chan->mchan; + pcc_mbox_free_channel(mctp_pcc_ndev->inbox.chan); + mctp_pcc_ndev->inbox.chan =3D NULL; + scoped_guard(spinlock_irqsave, &chan->lock) { + if (chan->active_req !=3D MBOX_NO_MSG) { + skb =3D chan->active_req; + chan->active_req =3D MBOX_NO_MSG; + dev_dstats_tx_dropped(ndev); + dev_consume_skb_any(skb); + } + while (chan->msg_count > 0) { + count =3D chan->msg_count; + idx =3D chan->msg_free; + if (idx >=3D count) + idx -=3D count; + else + idx +=3D MBOX_TX_QUEUE_LEN - count; + skb =3D chan->msg_data[idx]; + dev_dstats_tx_dropped(ndev); + dev_consume_skb_any(skb); + chan->msg_count--; + } + } + pcc_mbox_free_channel(mctp_pcc_ndev->outbox.chan); + mctp_pcc_ndev->outbox.chan =3D NULL; + /* + * If the queue was stopped because the ring buffer was full + * we can restart it here as we now know the ring buffer has + * been emptied and the queue can be used again if the + * netdev is re-opened. + */ + netif_wake_queue(mctp_pcc_ndev->ndev); + return 0; +} + +static const struct net_device_ops mctp_pcc_netdev_ops =3D { + .ndo_open =3D mctp_pcc_open, + .ndo_stop =3D mctp_pcc_stop, + .ndo_start_xmit =3D mctp_pcc_tx, +}; + +static void mctp_pcc_setup(struct net_device *ndev) +{ + ndev->type =3D ARPHRD_MCTP; + ndev->hard_header_len =3D sizeof(struct acpi_pcct_ext_pcc_shared_memory); + ndev->tx_queue_len =3D DEFAULT_TX_QUEUE_LEN; + ndev->flags =3D IFF_NOARP; + ndev->netdev_ops =3D &mctp_pcc_netdev_ops; + ndev->needs_free_netdev =3D true; + ndev->pcpu_stat_type =3D NETDEV_PCPU_STAT_DSTATS; +} + +struct mctp_pcc_lookup_context { + int index; + u32 inbox_index; + u32 outbox_index; +}; + +static acpi_status lookup_pcct_indices(struct acpi_resource *ares, + void *context) +{ + struct mctp_pcc_lookup_context *luc =3D context; + struct acpi_resource_address32 *addr; + + if (ares->type !=3D ACPI_RESOURCE_TYPE_ADDRESS32) + return AE_OK; + + addr =3D ACPI_CAST_PTR(struct acpi_resource_address32, &ares->data); + switch (luc->index) { + case 0: + luc->outbox_index =3D addr[0].address.minimum; + break; + case 1: + luc->inbox_index =3D addr[0].address.minimum; + break; + default: + return AE_ERROR; + } + luc->index++; + return AE_OK; +} + +static void mctp_cleanup_netdev(void *data) +{ + struct net_device *ndev =3D data; + + mctp_unregister_netdev(ndev); +} + +static int check_channel_types(struct mctp_pcc_ndev *mctp_pcc_ndev) +{ + struct mctp_pcc_mailbox *outbox; + struct mctp_pcc_mailbox *inbox; + struct pcc_mbox_chan chan; + int actual_type; + + outbox =3D &mctp_pcc_ndev->outbox; + if (pcc_mbox_query_channel(&chan, outbox->index)) + return -EINVAL; + actual_type =3D chan.type; + if (actual_type !=3D ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE) { + pr_err("MCTP-PCC outbox channel wrong type: %d", actual_type); + return -EINVAL; + } + + inbox =3D &mctp_pcc_ndev->inbox; + if (pcc_mbox_query_channel(&chan, inbox->index)) + return -EINVAL; + actual_type =3D chan.type; + if (actual_type !=3D ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) { + pr_err("MCTP-PCC inbox channel wrong type: %d", actual_type); + return -EINVAL; + } + + return 0; +} + +static int initialize_mtu(struct net_device *ndev) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev; + struct mctp_pcc_mailbox *outbox; + struct mctp_pcc_mailbox *inbox; + struct pcc_mbox_chan out_chan; + struct pcc_mbox_chan in_chan; + int mctp_pcc_max_mtu; + int inbox_max_mtu; + + mctp_pcc_ndev =3D netdev_priv(ndev); + outbox =3D &mctp_pcc_ndev->outbox; + if (pcc_mbox_query_channel(&out_chan, outbox->index)) + return -EINVAL; + if (out_chan.shmem_size < MCTP_MIN_MTU + sizeof(struct acpi_pcct_ext_pcc_= shared_memory)) + return -EINVAL; + mctp_pcc_max_mtu =3D out_chan.shmem_size - sizeof(struct acpi_pcct_ext_pc= c_shared_memory); + inbox =3D &mctp_pcc_ndev->inbox; + if (pcc_mbox_query_channel(&in_chan, inbox->index)) + return -EINVAL; + if (in_chan.shmem_size < MCTP_MIN_MTU + sizeof(struct acpi_pcct_ext_pcc_s= hared_memory)) + return -EINVAL; + inbox_max_mtu =3D in_chan.shmem_size - sizeof(struct acpi_pcct_ext_pcc_sh= ared_memory); + + if (inbox_max_mtu < mctp_pcc_max_mtu) + mctp_pcc_max_mtu =3D inbox_max_mtu; + + ndev->mtu =3D MCTP_MIN_MTU; + ndev->max_mtu =3D mctp_pcc_max_mtu; + ndev->min_mtu =3D MCTP_MIN_MTU; + + return 0; +} + +static int mctp_pcc_driver_add(struct acpi_device *acpi_dev) +{ + struct mctp_pcc_lookup_context context =3D {0}; + struct mctp_pcc_ndev *mctp_pcc_ndev; + struct device *dev =3D &acpi_dev->dev; + struct net_device *ndev; + acpi_handle dev_handle; + acpi_status status; + char name[32]; + int rc; + + dev_dbg(dev, "Adding mctp_pcc device for HID %s\n", + acpi_device_hid(acpi_dev)); + dev_handle =3D acpi_device_handle(acpi_dev); + status =3D acpi_walk_resources(dev_handle, "_CRS", lookup_pcct_indices, + &context); + if (!ACPI_SUCCESS(status)) { + dev_err(dev, "FAILED to lookup PCC indexes from CRS\n"); + return -EINVAL; + } + + /* + * Ensure we have exactly 2 channels: an outbox and an inbox. + */ + if (context.index !=3D 2) + return -EINVAL; + + snprintf(name, sizeof(name), "mctppcc%d", context.inbox_index); + ndev =3D alloc_netdev(sizeof(*mctp_pcc_ndev), name, NET_NAME_PREDICTABLE, + mctp_pcc_setup); + if (!ndev) + return -ENOMEM; + + mctp_pcc_ndev =3D netdev_priv(ndev); + mctp_pcc_ndev->inbox.index =3D context.inbox_index; + mctp_pcc_ndev->inbox.client.dev =3D dev; + mctp_pcc_ndev->outbox.index =3D context.outbox_index; + mctp_pcc_ndev->outbox.client.dev =3D dev; + + mctp_pcc_ndev->outbox.client.tx_prepare =3D mctp_pcc_tx_prepare; + mctp_pcc_ndev->outbox.client.tx_done =3D mctp_pcc_tx_done; + mctp_pcc_ndev->acpi_device =3D acpi_dev; + mctp_pcc_ndev->ndev =3D ndev; + acpi_dev->driver_data =3D mctp_pcc_ndev; + rc =3D check_channel_types(mctp_pcc_ndev); + if (rc !=3D 0) + goto free_netdev; + + rc =3D initialize_mtu(ndev); + if (rc) + goto free_netdev; + + rc =3D mctp_register_netdev(ndev, NULL, MCTP_PHYS_BINDING_PCC); + if (rc) + goto free_netdev; + + return devm_add_action_or_reset(dev, mctp_cleanup_netdev, ndev); +free_netdev: + free_netdev(ndev); + return rc; +} + +static const struct acpi_device_id mctp_pcc_device_ids[] =3D { + { "DMT0001" }, + {} +}; + +static struct acpi_driver mctp_pcc_driver =3D { + .name =3D "mctp_pcc", + .class =3D "Unknown", + .ids =3D mctp_pcc_device_ids, + .ops =3D { + .add =3D mctp_pcc_driver_add, + }, +}; + +module_acpi_driver(mctp_pcc_driver); + +MODULE_DEVICE_TABLE(acpi, mctp_pcc_device_ids); + +MODULE_DESCRIPTION("MCTP PCC ACPI device"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Adam Young "); --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from SN4PR2101CU001.outbound.protection.outlook.com (mail-southcentralusazon11022111.outbound.protection.outlook.com [40.93.195.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DE4EB476CD6; Tue, 21 Jul 2026 17:53:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.195.111 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656411; cv=fail; b=EBwNtSryU2RE+GccWUW+ONtFtFTbkBDD+zc+w+NgXFsHGpOduIhTfJ1bj8USfjVXoRRaL6CYgk8tg1hXt0Z8ZRXRo/+JVhd8Rhz2u85DwtiJjDmY5YGc5GpYSFVx/cM3oXKgUHs0PTTB9Akl7o8z7mSaSGk515FM743oTH/95fQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656411; c=relaxed/simple; bh=jvLoUgXzf4T5CnfPMxR1IExOgtI+4OHDUQwOg2jWI9g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=C1gNTCs/xS7Azp9RRfz+OT67IfoO2RdmlPG4CDwsiHIPP22E4vT/Tl3ONTvlgkFCodsKWfd9IgGx8fzNLX29PzipQxGsYie1mqMr3l3n6MGOWY37WWTF2LZz+MCFBCEQGyN17k/klR9vv+Z99Rf943UZCPeCAMzZth28NwtgC0E= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=hhJM5gVU; arc=fail smtp.client-ip=40.93.195.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="hhJM5gVU" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Gz1OG3dYL9z8F/aG+tVhMqLfBurQ3naO7nIXqkuVeffFXCfqKg2mj5W4Vwv7lzfSwPxIdaepibuLCgQmw0MaX1tzO5pWTHpFVQc7l5eGoMRNEq6omXomdoqWgG7yUqQwc0V9956YLQl4GVSEkRwJrV5SPbM9QLFa4qEf6yeOB8yGmDbZLBnsp9rAnu520+bRz6u29a8H3/hOoRgHxBxBH86lEOqS4GlQxoj/T/pAhWO6qJXgIfIO0eL1gxUhQaFJJ80TUmnXyN86ghZC2LEDK65d1WPMEOtx1yCD0OWTlzVetVUqJZ7eYUjzQyZlUDPoYpQDZVL9F6W5ilYtRPc+Hw== 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=x50b2O+Un2OwzXoeWcjVY1JZTIFrGy5nIfA0YGnKxqk=; b=zG1PUpj6hn9oaP+fTmZlBp5ehiH8ckmIhRV6tZJM0/XeeFOshYJ6QfyIzvsHlD5Wex0CY0UhAoo2Au1oPYGb7yQY+bHazwhC1R6t2hOgcxj0MVu3dkHeIDtU1xfxRN/hOCOPcud5sF/lwPh/SVdsuP/s6/xylhG2mSWXscQOHjac4Kjs+4sXr6uceYDmGrpuyWJpHlUF67EI+BnnzANBwG4SnR9dlaPP0LFmI8MfKJ2NnGshd09I9aXAq7OkjE2T2Z/FtKRW/xHdKwlArS9QyaTuWdMxS8594D7Wn+fB+xdCM2F2kTT+qmsui7oA2bnQczkXZ/5RAGCt47462O8PdQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x50b2O+Un2OwzXoeWcjVY1JZTIFrGy5nIfA0YGnKxqk=; b=hhJM5gVUzv4cnttEkDk+1wmlzmhGlHbrvC4R3QQlUTA3aQVbvTcAnVXBacyKW1pjjNPybG2+j7Rxhf4Gi5u6LXQ//ctAMKrDDHPzQXOPwF+2GVSUQV0Iaf8LoGDUd9Ea+UZ1ifQtyx7PGuPsLvPcjtLU4F+ul6PCsD13RRnJyxA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:26 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:26 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 6/7] synchronize IRQ before releasing shared memory Date: Tue, 21 Jul 2026 13:52:55 -0400 Message-ID: <20260721175258.87600-7-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR18CA0033.namprd18.prod.outlook.com (2603:10b6:930:13::16) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: 33e597b3-4a70-464e-c838-08dee750f74f X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: hLuwSuQgGAZYaKcpjnVuSejpTplnaccXHu/xPpeAsbyJr0snb1JhiriDuM6U4pyeyTDhvRqPNOsAizwUXk5bW/C5wZdk/vwvtVgcZABFmrkZ+SxEXoP21WwagFocCSQa1jDvfnEjo+m0dX5B07/9Yf+eM25zRuFjcdEqOEBjRCSwMRyHwRgdeIaLXl6cCkAkXuCSRTporrixQDd5Mx+cp+/o5Vo3boQ45DZi4gDJFIH8p2+kn1iJ0I6BlYaoibSMCT8lRcaNaF0GPb/bOpeTQ0bdMeT4Ul1/8iTznPCXaJBp+dN9ar5k7R2018qOImOyDV08bBZBGljVU1+HLXaWY5kgJVlZKBdHL0B2EkjKgrcKkF3X7uCTGjresoW9koaUoThmeDOEaR+5qGkw2aQlRkhZIZ7XC7xcwnyxO/2Ui88f+tkBJISpqqeh2SFcC/6YoiJeUo3B52uv457B6IDsEOU2gctmIQZl4wwerTDhRHlWMhhsF+6ow3CKnywrWQu/ir2j/+Q8vSpvOEZh8Z1UpF2Qyy6DsyhdFOqEk7ibZqwYneppF8JuD1kGgGiNJj+rUXg3MTz1V2nXuQvgg7BmLs5bgDPf3/U1Ul+v+6Ng4gAP94Uuf1Nc6q8snQN137LlSGjnBWelx93GCVVJF36/ZgPKcNas6hYMpjuYuDozY3E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?UOTmbJZk/pPGB60cGiXdD29al+AcdzUarG6IpuDITVeCdJVB6V2Z44rqb+kG?= =?us-ascii?Q?bvwLRx/T+xUnUiTtpLKXi95upm1lq4b+A7DRCPkrPR5AzH0uZZXrWX/B0cEm?= =?us-ascii?Q?BMe0bJcqQcIdbQU7TXj6m/1I00GU1HpkeqFyjA7QrpYMI5l8TCpybQpwIyA5?= =?us-ascii?Q?OGVYE1QMxKdspvD4hfSHrsqTh0NVNeWiaVX5XWBHW+FhtnNYcBA3oGPyojbz?= =?us-ascii?Q?DZCMUJH1/+eonXFUYM+UKkaPRsR8NpPQ3bveOrG9+V8Ml3gaUMRK7Nom5Q+s?= =?us-ascii?Q?bAEk3QH8JsprVGT5Z1jTTf6eimrNfaUvOEm4Lz6/bIe3gW9XmRZXOSpXvlA6?= =?us-ascii?Q?l17PL277/hGd7E16kT+xQRSD7gVurtNuZJtumzULUr0AohaSvA162qQ7BJYS?= =?us-ascii?Q?rD+FLyBUZyEdA+zpUKKHH4TTK5C35ml0mduhFU2CQW9+7w5Gg1uq+ccCnQUK?= =?us-ascii?Q?VsnKzdRNTPZAotAe3ExdKhI6xFMkVOa4cgdXW35mtklr+/wbwBktKQWOxnWE?= =?us-ascii?Q?O4fG3nTmA/kFtb8D3yEbBU82GtX3brerZwabW/Fx32goRp26nTRGwlXmPpQk?= =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nR9FA5SYDSylS8N2kQM?= =?us-ascii?Q?hSFgW5Te3Q3Av3fBwmNYb3B38ItVyp1fHKTKTHlyqL8ab85ax3sBGRqdivz4?= =?us-ascii?Q?lZJe6dROz92ODSkqkx5bXTvjmrY7NM2Ot7QVg//BKha5TmilpbVgT67I5jpj?= =?us-ascii?Q?BCjByKCwCudJ0TpAkGZxvfByGICHq9sbwKxOVdGUvbR2Wey7PWejWReRKf6m?= =?us-ascii?Q?q63yj0ekUaZN6fejZ5jioNylndGxOmCunYITgQbPMuPUYoiRJ1uYhQK7wM5m?= =?us-ascii?Q?ItImo3cf4qDl4vmiiukOXWvj9nrnMEKCVzkEgxP5rYb+HocEK2BB2yeeNXrg?= X-MS-Exchange-AntiSpam-MessageData-1: 8/X2hbQLg+FmRrv7BbzYJ7QfIUjrHYA2AL3NO6JROAaVTgfnbRX4A/y8 X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33e597b3-4a70-464e-c838-08dee750f74f X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:26.7144 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8FqhjNHLagaSVQuFperNaTSsApfc36qT0qNueCx5T3N7Si704eqQRYVFLnUH16vi1/mAGqz2HLdpe7fUK3fDz4hHqPE8FzFF2ZCfLh+U0KjblaYWKPXekGrpeyle+Mq9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" Make sure a final interrupt request does not asccess the shared buffer after it has been release. Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index b9a01bfdc95d..2ce2afd255f0 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -537,6 +537,7 @@ static void pcc_shutdown(struct mbox_chan *chan) =20 if (pchan->plat_irq > 0) devm_free_irq(chan->mbox->dev, pchan->plat_irq, chan); + synchronize_irq(pchan->plat_irq); =20 pcc_mbox_chan =3D &pchan->chan; if (pcc_mbox_chan->shmem) { --=20 2.43.0 From nobody Sat Jul 25 00:11:04 2026 Received: from CY3PR05CU001.outbound.protection.outlook.com (mail-westcentralusazon11023141.outbound.protection.outlook.com [40.93.201.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2607046F4B4; Tue, 21 Jul 2026 17:53:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.201.141 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656414; cv=fail; b=ZsvHlll7YWUFyPQDCkk5H/6SwIb+mT6rcw66V+QAevZm+j7Cez81y8CG30fQEhp7gfBknSlH+6SBX8L7cJ8CpTvPtQz8/KngS8Ru/1R06C0AsB+A2iqYanQaaZ8cXRGXaQZph+K1/HxGVsv8qIvjEriNXsWJP7XT5B13roIEaVU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784656414; c=relaxed/simple; bh=ziOjFz059V4aUTxHeiS6u1qrPZ02xF4av+s5L2h0Tc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=ubJfDuEJad+nzegEmrO3iEjTmduKE0YLXe/owOzDpXCKv4QwJ2ko5gSx5ySUYeWAifzxkQ8lSyb+NiJBZWs1INRPTnGJVcvztYWUpRpCQOjwYQP4yynP6g8VPASaNuvybtz5GqIlyV1+4eLxczXgwsinQpB6PtZIB5jUjxzDJnY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com; spf=pass smtp.mailfrom=os.amperecomputing.com; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b=MWuYOl+J; arc=fail smtp.client-ip=40.93.201.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=os.amperecomputing.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=os.amperecomputing.com header.i=@os.amperecomputing.com header.b="MWuYOl+J" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GPP8MJi2lWeV4+dOK+nU89fl2El6fxFrqU7S64aQ7J9NW9sJIehvAmYsokDILQ50hnwWbn7PRKsr6T+QXgRbN4iCRnWqqxr408krsMaCH3nHhSzb6dUz1aq9x+wzpVFIEysPZuyzgmAtFM1j5jLMhVn+waGIMV5PqLGPUWlp1QetGRIxikrxOfHXdo56RJVkLtsWfv8NZ7lMdy/y+yNQSecupx2yokgrhZLNOg37EnginLrOC+KRlhVi4GeaKqzdNfr0udWgSXDyOB6KBn0/a3AHW+bRkKTOcTWRQVvNJBQBYXnQNlo3F+0PGwcvOjlUr944fp22+5tE/ulIJ2GoTQ== 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=nLeOTqZJMPH03HcfYOsjHjUa2NwN3sZBEuIbumWem7A=; b=cSeYG/NbffDFw5gRnEoc6VpUkoAqbsHbyvpLOotEGOG2ZOEVCsMoA2+m63DIGSQRAlWrJbspNZ872Usp1CC5yP3oVQSIioPhpKvpc5N6GkwkRUiH0v5XAYMhzFpVITBIFGTGagSB2d2Ao5Ldq55BdIb9jDcnKqJKUKGOOIbeOpehWt4Emi1KuNkOm/YMVclGNXo23PxfloTvA1RHbo2UO6lXoPyqZADZP0edSi1XKw4v8C7m/cVzYXWdzio5cgX/3LNNAJHZvbw0k7aaBpTTMUl1mpmg/1AGNJQ4LcKb8MLk9Ng53u6yvFdNkNdNt6XJbMP4+rBGPXIotBSP/FIpaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=os.amperecomputing.com; dmarc=pass action=none header.from=os.amperecomputing.com; dkim=pass header.d=os.amperecomputing.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=os.amperecomputing.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nLeOTqZJMPH03HcfYOsjHjUa2NwN3sZBEuIbumWem7A=; b=MWuYOl+Jaq+TDxDvJ2/Emo5iewzpjw4czDP1Iyw0xXOKKuNbkMlWwhuB7WSXP6isrwZD4PKDX7AWTtmMslhP6iHYs6FEoHRsh90uTs4PnnQERAENPV4Q3VkYx0UX7ot0G9s/W2OIsA7Afk1xVbbfCmMkrYEVswMVKJnDB0bswGo= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) by PH0PR01MB7425.prod.exchangelabs.com (2603:10b6:510:4b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.245.10; Tue, 21 Jul 2026 17:53:30 +0000 Received: from BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9]) by BN3PR01MB9212.prod.exchangelabs.com ([fe80::44f3:1050:dce8:1ea9%6]) with mapi id 15.21.0245.009; Tue, 21 Jul 2026 17:53:29 +0000 From: Adam Young To: Sudeep Holla , Jassi Brar Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v45 7/7] wrap pchan->chan_in_use in READ/WRITE_ONCE Date: Tue, 21 Jul 2026 13:52:56 -0400 Message-ID: <20260721175258.87600-8-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260721175258.87600-1-admiyo@os.amperecomputing.com> References: <20260721175258.87600-1-admiyo@os.amperecomputing.com> Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: CY5PR22CA0104.namprd22.prod.outlook.com (2603:10b6:930:65::23) To BN3PR01MB9212.prod.exchangelabs.com (2603:10b6:408:2cb::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN3PR01MB9212:EE_|PH0PR01MB7425:EE_ X-MS-Office365-Filtering-Correlation-Id: 86be89a9-c865-475c-4234-08dee750f939 X-MS-Exchange-AtpMessageProperties: SA X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|23010399003|366016|10070799003|22082099003|55112099003|18002099003|56012099006|11063799006|10067099003; X-Microsoft-Antispam-Message-Info: 3MeTKl5n8XTJ6Uvv/N+vpoKwxcfFbSHnB5sYgMcodVVG9HE0qbrQGgptqaN8PIqrDyMqHNSgp2/gvEoGdfjZHgOzbWEDc77bdmJw1X07iuYF7KcF4bYDfVj8/UhgUTJCrk14yW3ugizKUABoxU3DRD6PhY3ZevSmOG+slqfmFpQ8mDVsVFK3i2Aax94CVZV//uRx7EzmqCnCYppl6bwuXTSXinXP21Q13zNXsyEV9c1jkr8AWnuswFBQtfIzcmidjFTDVTkonf9rTHbVNVIldcXKWjzDRKLlzhYGXvU/cpwpXHE0zWp6bLSG6sAH/mpPRnWg/6P/qOtKtg6QgsW01iJyUrcFTW5GLjdND9pAQx18RlHa9+ZiA8cLO8WlTJkLl7Z/BtlTmO//6M4GnOgODc2RyG4eyLKZcZVUWuAXwHoVN6EE1Infek9pATTWmsFzXWOwdQ0se2yxrLHP300apHWkg1QkecR44SOIWxGRDxNlvLSr7DuWIBfym/LUzgj45EvY+gpiGI47ddEYG3lSHkRrr2Jol+i28fXuuQB/mQXjkSEBxMHxPiwq+wVEnQ/s2yHilrHV805lw7oTwxLA/e+TVVHdE3fYQ5qsxY8QvCnlXM/QCeAEm9cvt6INTMSucsFi3+Cdd5iVdntl8q2zl83QmsUfNCHtdjFhRGMh/Rc= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN3PR01MB9212.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(23010399003)(366016)(10070799003)(22082099003)(55112099003)(18002099003)(56012099006)(11063799006)(10067099003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?bj4Vgyji7pk02n9yRiFNC/cgnTQULkGx97f33PZ7NSZqqf6jacIVyMFTWOPe?= =?us-ascii?Q?/37nXyJOdkgDyixIxBGC3BpFuDg6tOnqKxJ7HSE/XbAH7sZAPrxYCN6F+/Px?= =?us-ascii?Q?atRPMKzG/IMlVIehesL+PXcxv3t+hV3WNVomi3XZpevYEseZAHQkPy2Y5ABm?= =?us-ascii?Q?CbDmAcB3uxz6hk2mV6i3MsJutYvTQmHvG6V2+oSNIliXAYu75+RE7pMVg15z?= =?us-ascii?Q?UMc1k9QeyvWxGTTwfvGfRJMr2rcD4k/GSI9mwBW92R0LVbCS+rTs9bwXfef2?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QIz4tuEx0zFHvWsE9vtACd8+gEM4?= =?us-ascii?Q?Bg8xk/K7c6b+AvNnYLk6JSPXHZq66gR/0Sll1TfuNMfDGB3jetq/dIf1/RR9?= =?us-ascii?Q?9rAggvqmwSIuz7cnTMrKiOhOVMIW4bicY3CsJMGaG7HE4jMGfHBIoPiXj+Wf?= =?us-ascii?Q?SqaAKSL1wLvtJUdigHdSOPkE3TSSafkPRESsJa2P9uZoVJzGx+5fOK8IWAZF?= =?us-ascii?Q?CTFbTjAhDUoYeJ99/HmaQyyjHCcWyx7OatyyeK+V69cy6cU9QmZK08ysqUCj?= =?us-ascii?Q?PwUlPgQE7A07bKLti7A1yL8WY8Q8UZISMwTBwUCrryvL8bQ9VrdXAKpLjArl?= =?us-ascii?Q?Z4U/jTlDIEDFCxFBYQfWJwD0bMMiCccNzsoibSTeEANjWARBZepFhwMOV1uZ?= =?us-ascii?Q?pvaK1HpCue0SjE2XN3OtoH4DrJaYjaJFdiaz/ovAC3d+rLsgdv+iSxSEsbwG?= =?us-ascii?Q?hJG99cg0P3meWdm0rAeL55Sb/yhNdh8LtsirFbL1AG0TdAXJuCV4OMEJo7g8?= =?us-ascii?Q?rCrZowpP9ajFeVrM4U395ADwEJ3hxN8iDMiFK7UBMegPOZmRH7M5i+6jvebQ?= =?us-ascii?Q?yVzujVrHpWKNVKpY1QOY1IWWqbPS3/Ti1kClqDmqRiEJ3WepUMEmddfME6wb?= X-MS-Exchange-AntiSpam-MessageData-1: 2n6EfMKsm+F5OiDdk1fR08ro2rL+PX72aWLfAA7W7dMQdMGyogQX3zdm X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 86be89a9-c865-475c-4234-08dee750f939 X-MS-Exchange-CrossTenant-AuthSource: BN3PR01MB9212.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jul 2026 17:53:29.8825 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3bc2b170-fd94-476d-b0ce-4229bdc904a7 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: qAX9EPnoK+HfJM7CdrYq+8NbRHxCQuvEA+StkKQBLnK8s4U02O/fesLD66JT0Oir1OO2tsBzGxLw5ZqGTvq8HKMZ82zyIC3F74kx679xb5Q3ZaDAjlRkF2p8WTYbva0a X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR01MB7425 Content-Type: text/plain; charset="utf-8" read/write happening from both userspace and Hard IRQ context chan_in_use is used a flag to sychronize access. Volitile semantics ensure we don't have a reordering that accidentally provide dual access. Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 2ce2afd255f0..dbfe8dd92ddd 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -325,7 +325,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) return IRQ_NONE; =20 if (pchan->type =3D=3D ACPI_PCCT_TYPE_EXT_PCC_MASTER_SUBSPACE && - !pchan->chan_in_use) + !READ_ONCE(pchan->chan_in_use)) return IRQ_NONE; =20 if (!pcc_mbox_cmd_complete_check(pchan)) @@ -339,7 +339,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) * where the flag is set again to start new transfer. This is * required to avoid any possible race in updatation of this flag. */ - pchan->chan_in_use =3D false; + WRITE_ONCE(pchan->chan_in_use, false); if (!rc) mbox_chan_received_data(chan, NULL); mbox_chan_txdone(chan, rc); @@ -471,7 +471,7 @@ static int pcc_send_data(struct mbox_chan *chan, void *= data) =20 ret =3D pcc_chan_reg_read_modify_write(&pchan->db); if (!ret && pchan->plat_irq > 0) - pchan->chan_in_use =3D true; + WRITE_ONCE(pchan->chan_in_use, true); =20 return ret; } --=20 2.43.0