From patchwork Tue May 28 19:18:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: admiyo@os.amperecomputing.com X-Patchwork-Id: 13677212 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2091.outbound.protection.outlook.com [40.107.223.91]) (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 7DAF8170822; Tue, 28 May 2024 19:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923917; cv=fail; b=Yy3WR42b1MNF0z1Zb5O75LhftIxvEdxh2TmsHLp4oSYijIgWnQhh5jCZ2t4eoPULzP3N28ohygUWpWxLwEh1gyt+wniFiE1uWFBx/7+v9Pr3lHyhK3hP/E+C2kBuqmv7U8RNzw5bDaaApaQwlPza9jAAxJoXVBAtjj4So7/6dAw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923917; c=relaxed/simple; bh=Hmj5Ulvo+nqYAvqEuYtvQDDA0L73DYfZL1cGFTucQ2g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=oG727+ppRsWVp93G/bMVxqRm/1oUz4ZZM5rCB/KS30Fb9Cbs/nw5qxeukp1zpsqcVIIkcF9EEdIERs/bc00bwvIDUu9hFsRT2o9I7YQL9BDuarQRUm1FEnVCWImmWZ8Puqz8u9Yq2iVwwh1fKGcldlh3DKtMgXDSm//5zFdxgvg= 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=dH+acqNF; arc=fail smtp.client-ip=40.107.223.91 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="dH+acqNF" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oEfhEjbd6pOrErwLh5Q4IH6GCWMbjmxwjHFpThEK8/hkwS8eLC0VdRMnV2hrsti8pF6LPqZOYBShvDcA0A9JV664bTw2GnGoC9W5SMBW33ELtZ7wQAUBNz0I4SDHNuwLQd57lQUXLJQiZD2E5CbXi9O30QK2Ts8ofwEqrxv6pCjlT0zwXtZ3bOKm9sp30nqezThRs4/1Pvv1mGSmH+HYtXE5gV0qBBFClj9R1r5pPCD92NlvTZPWLOR1fl7gGPJ6AaftXg6B/fBORWk3e7FQw5UNLhp1GWjxY6QmtuO3ihnyn4m1oquEnDAjO77R5uOzavg8ncJsp6lp1rhEIqPSyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VK5zzcguWsiHz4kYsH0I/UsY5WwKBjTtaszm+g/aWwY=; b=UpNGBdgbcXNtIQKoBwHggneqpHREK8szE/eTnFmIixggwqIwlpeVMIVfXfs7xzq9p++cAALVYDI1Q5Fk3DgFZuaya9tDv3bVo7Rw2IPgphtAHcegi7aerM7fe22m46gLG93wG9bm1IIiNBPhUHkd/eMyQr9PXmIREFfUl4UIQQPy3KBPrYhzlNthHKFoLTKw6hAtMzlaIWSzQiAZWcE4zM/EyHRodusTpk1MQ8A5wzEKRw6LBqBGWqyZUrwARZoX9k4299GVJ1jZBb9NujbtD+Sh4g7iiqn/gOsWhn7PhmXeFKCfvUJXCQYijCGy8xN8RkBmYvJx+Iy6Bx2lHprUoQ== 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=VK5zzcguWsiHz4kYsH0I/UsY5WwKBjTtaszm+g/aWwY=; b=dH+acqNFP1Vv48ynRJAYYsebGGjvo7uyRpqr4kp563ohLN1z2kixuSaVMUrscQTyOBOWa/neCg2D8X/fm67pyBeMHkPjaRLPwqTYQ0XEt+rYl2tv6eyxVLU2Y5fz2bgNDeSmMkgo3U5wJrghL2PcZpoGc2u/yKc05ItldxP2i0o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) by SJ2PR01MB8403.prod.exchangelabs.com (2603:10b6:a03:547::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 19:18:32 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%4]) with mapi id 15.20.7611.016; Tue, 28 May 2024 19:18:32 +0000 From: admiyo@os.amperecomputing.com To: Sudeep Holla , Jassi Brar , Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/3] mctp pcc: Check before sending MCTP PCC response ACK Date: Tue, 28 May 2024 15:18:21 -0400 Message-Id: <20240528191823.17775-2-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528191823.17775-1-admiyo@os.amperecomputing.com> References: <20240513173546.679061-1-admiyo@os.amperecomputing.com> <20240528191823.17775-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: SJ0PR05CA0035.namprd05.prod.outlook.com (2603:10b6:a03:33f::10) To SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA0PR01MB6171:EE_|SJ2PR01MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 0acc3724-55ca-4925-dc85-08dc7f4af6f5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: O4GwgEvaQTwhJht/WH0XZ60iSHbn5mn04diOLnyOvWR5lBt0HyKuTZ/KxizMr4xNDPH8lbt9DUUfRodCZgI1UJFckwwfbKsl8wMOPmila4gTy3QhTkRnMt6XvnFrWaXYCMW7FT9Xj37DKcU/E6CDWfz0GDRk70bhSGvVDnZOx01wXGbryUVnLOMgk9ZTP7LQQpEuvpbAXzkcj0YcpCuvaWjkTju3fe/EWYY9gvOY61KWc8A1I0IWnK1avA/rTKOhj6/PcgXTEP/DmzXQqeOQTHvoo0eun4Ah3aNQgqMOELLRrMRDBnVkjX2ErtwBwKgM80/ln9wgDFr241ZY05uqACy/6qq4sa2N9kcTpLIlRV5GDbW5EumInNRoIGx9krFa/YNcQgg1RT0S2U5IEyFbeog2JuIezXNvIxdy8SEYCOJImwo53FkIPCIWIRyZpB1j6hUfRCIuKmlZXwKzSPnili00iI41jM0bmyWwkZmKF/byHBZxgOWzNdxt+ZBd8BDND8wON+7a/Y9i0me6bYaQUtRhamJfFdNBV9iczvNuLcxk0Fkh9mT1jtvQcA7/alAcjDypmCwzJo3srXx9gye7Po9p/f2tDYJMKvVNRkrvstbZTUUzc9VR3ePoHehy280Aq7s+Y0O3yqEFl4DLqQ2CZG0UNA39hbukEX71TyR6HqGoG+WDOVr/yXqeUWiHQILG3gbsDUSbFxaC66fFGOdaYa4l917y2FH802ITKwzlQYmdCEN/uxmAJTheNb1X0uD+x6L+cxLQbmVzW7ddRoj6kzWxhezF4djC9ziitmocZ+ovgEGeZhC4OB6BlAnL1Da4tVc/2ruXmMSK+jTNn0bwKikkFGCkAb1IfsOecsOz7WG2RCch3o9ORSStRhWYnSeSGDtwnzdExxafFEcGnHSMoqjzDG1RsfcL3uZ3n+g9hHBDRmKiK96sHSyfoJpH3ZUidwlc2OFXNKpWXbaCVNK+JkcZO+1hv11K6bLJe2Uo4vZ0JtifGRMzmN79WWm1xtFL0jS13fiENSoqYTPmv/8TLV+3Ns+EQ1HQ4d0M5N3j0Lgk1vNOJQ3ib/0F3bVq0lhJyLLqFZmPV3PwqrumqpfjERCCtTYBN5TJyG64B02mX7NSUgRUX8zwG/VDCH7gsR2RN5BdI6SecTVFCSk8GyKzwjp9IMZcIcGoLMVZR+/54kKTCy+uu/eCNTGae/zCEsGfAkwTOnAvL8ZbDRoVaLonY2dHwn2PPMNZNCbctWDp9rgoKTwYIyBX8VnQpamUTtkrHzLpEBxGCe3op7wsIZzTzg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR01MB6171.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(366007)(376005)(1800799015);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 5kyw9Dn9L26l4i92b623uWdeTLOYnvYB0E87g1hS3QHGYJV8lBlAfTrQSHtoNmK+E/1EEyfI/a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LZLfDXMQ/ZyKoU+Wp06H4MVTipQz48u7HzJWUgdoUjuzrcPCsEJ8bOyBNIfwK5UGpb/2pMDU96fEpnXXxcZk5715eAZ88dX0lRvbsrfo80W8dyog9gbHGrhbnGztF9QO/vwaclWpOfsBYHT0gIxmo3Hp0/NPUYi9XOpJ3JQkvh1NL6i33AjcpN2fnniWScs7oxZvfrfB20B6G/+p14liUEr6nuGOpsMvHC4C8KlO0HLubceofmJoSHA8lpoYvMzGCxLVdVrk1kIw8QF/JW5aApzevrDgqvVrtjgmBsCtVX2pRj65qZFs8ByQj/aVV5rou87jP/Pd0YiIcQCg7cuTj0/VCGUi0mMe60mL/lzj7IOleEzCngeAu6kQSgKynGEfrW9p0H+MlekcTgcShJfZfhqhQb71sGKESr2tHQy+ybLL63IH7H94bRZL7reKypfLwNS7b4ZN8jKqfzQk+NdeTrEVeBYXW3+Fbm3l4pSRuMVcec31qAsVXRdwxE7pfd2/nXpIaoMKvRZqGPLY9u7etUlP6ucOmBBZ1nnILPbqq5Cnj2z7c= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0acc3724-55ca-4925-dc85-08dc7f4af6f5 X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 19:18:32.8016 (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: zj1at55oUSdLohhICX3mGrI/++RoqZE9T/XKhUeHIlRGx4aM6b555Vz744ZM9lUxAa7tcdmosopKGRLrqV2XaWmiQtyqClOkG2doMu0nqaXkZhpLuStDWpaJ1iBtLiMR X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8403 From: Adam Young Type 4 PCC channels have an option to send back a response to the platform when they are done processing the request. The flag to indicate whether or not to respond is inside the message body, and thus is not available to the pcc mailbox. Since only one message can be processed at once per channel, the value of this flag is checked during message processing and passed back via the channels global structure. Ideally, the mailbox callback function would return a value indicating whether the message requires an ACK, but that would be a change to the mailbox API. That would involve some change to all (about 12) of the mailbox based drivers, and the majority of them would not need to know about the ACK call. Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 5 ++++- include/acpi/pcc.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 94885e411085..774727b89693 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -280,6 +280,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) { struct pcc_chan_info *pchan; struct mbox_chan *chan = p; + struct pcc_mbox_chan *pmchan; u64 val; int ret; @@ -304,6 +305,8 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) if (pcc_chan_reg_read_modify_write(&pchan->plat_irq_ack)) return IRQ_NONE; + pmchan = &pchan->chan; + pmchan->ack_rx = true; //TODO default to False mbox_chan_received_data(chan, NULL); /* @@ -312,7 +315,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) * * The PCC master subspace channel clears chan_in_use to free channel. */ - if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) + if ((pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) && pmchan->ack_rx) pcc_send_data(chan, NULL); pchan->chan_in_use = false; diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h index 9b373d172a77..297913378c2b 100644 --- a/include/acpi/pcc.h +++ b/include/acpi/pcc.h @@ -16,6 +16,7 @@ struct pcc_mbox_chan { u32 latency; u32 max_access_rate; u16 min_turnaround_time; + bool ack_rx; }; /* Generic Communications Channel Shared Memory Region */ From patchwork Tue May 28 19:18:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: admiyo@os.amperecomputing.com X-Patchwork-Id: 13677213 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2091.outbound.protection.outlook.com [40.107.223.91]) (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 459E550285; Tue, 28 May 2024 19:18:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.91 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923918; cv=fail; b=cobRij1CZyWPQmt45AYkt89uj5mTzdZcSrBl9AP0hDQkx/yF4U/Cl8OPZxUW6ZG23TRN9Kj3rEIYrG4CfnS9jBszclFpogxRHK9W0lhRaO+GK4rthrxxttPe9A5J8nRKTfbUu72HYoqpy3chAtlAd8y1/lTZikef4iueklRGN9g= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923918; c=relaxed/simple; bh=yDVybaumJa9PVfk1Pezam8ITVgO2B+pSBKSrYKTzXTc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Ae2nzkwnYCDjfgy+xv/Uim4OzGJjT7PAwqynVdG2v+GQCHLwGZl5fMJal+9ISfEBNXHnK6udcTHMsG7Fzejz+lavFo9ENNqTi3LAsyTzufNCE0wF30SJ+yAcz7ixU6Mqf/SBLIm74conkmVs/eRJKDJODBY0LFnWGUKRaaq3Ahk= 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=pXWpsaMJ; arc=fail smtp.client-ip=40.107.223.91 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="pXWpsaMJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PZdVlC3+aMHJ0rcZW4EuM9eL01s0IITezm9osupf/awGkMa1CLk8UaAbWhMMn3itSDWsuYVNn99QG6dJI9y7OjyTQya9HpfB+IDSDWJKK1LEVH65CS3oqXbiM2tyW0RCqGAS6Q8DBPyOTMLjiFCRnpfFQ1UeT6Q+SjKrTaqDvaAszEp6AJ46b/QUFFKCf9EuEARQqv7E9YbsC/eZ+0nQD5+S2Bs6lyS0wPnNyYbtmLYFtQ6W5kbbdoskIcZI2pq47pfXtFck59OenZW+9j7ahyJ1B5F3Hm6Urc6cZ0yIRrhK/KAJWauiBNnb2Bd5L46vorgdwrOjD00MMHHetpnw0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7s9zx4LhO9JWlaDrRNO7NBlyXoackNaEPwP28wCYR64=; b=PRSeW+wfCnBZLf8qKimukyWD8gqDMu+JbOUeJBo4z8VpuimgQ6MxPrcYnkhfHKQAE5ajPSom+rfND5l72usQBYK/lGp24Hm9tZ93GBQcHmjuKQs77g9t41xzAo2F8MFtcfTc5umrgk5B2TP/cwpP4u6hOTUzcabzsA68Wfur01d3Y0AxbwY7BIju+JaH1b13m17pXl18z9JyJhGo9Wv/+RKq3/UlT+xCiFzk8+FQMFSEiq5hMFoa1wpgEh3//wJZlfzhnB994hXdJlwOVPqZ9Mje0Il4lAqsYFmwdOp9Rw+S6rMEORmRur4f1xbw2UZgvnTSKdpSxDgM1ObQR7C92Q== 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=7s9zx4LhO9JWlaDrRNO7NBlyXoackNaEPwP28wCYR64=; b=pXWpsaMJUPiLXEIQNITD7m6PeXoZYJ56PuozMpWXOENB78ujPhRoaYD4x54yZhUglGdnwVaZu+SjqGYO/p7S1+PHtg+ZY3ouweK+duGekMLIkveWo1FTy5MwN+Z9J/OB+JF3akXn2X4qgtLfVz/+Xw6rK7jDaV1X4i43McaUsgg= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) by SJ2PR01MB8403.prod.exchangelabs.com (2603:10b6:a03:547::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 19:18:36 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%4]) with mapi id 15.20.7611.016; Tue, 28 May 2024 19:18:36 +0000 From: admiyo@os.amperecomputing.com To: Robert Moore , "Rafael J. Wysocki" , Len Brown Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/3] mctp pcc: Allow PCC Data Type in MCTP resource. Date: Tue, 28 May 2024 15:18:22 -0400 Message-Id: <20240528191823.17775-3-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528191823.17775-1-admiyo@os.amperecomputing.com> References: <20240513173546.679061-1-admiyo@os.amperecomputing.com> <20240528191823.17775-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: BYAPR03CA0019.namprd03.prod.outlook.com (2603:10b6:a02:a8::32) To SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA0PR01MB6171:EE_|SJ2PR01MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 92ea64f0-aa52-4e94-43d1-08dc7f4af8d9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: Vr1GqleTtlebGsmhE3tME+EdEGHGR5kCFWbXifX/75ymYEv1F4hLUBaIeY9x5WrAj8+erlKycP5kHOVpx3+qzSEvfWlKyncDnROvcvh5L1gh+ikV/9ugEhAPFI+No1Xz8alZrIBgcJeEmj+PtnHmifUD7Ie8GQxU7se7JPUpdi8KRTIiWSo/oBamjoPhvT9GOIJSt2991fnW3LUOAVmo99bO9Ae49MH5nnit3PzvD6BZVDfh33ZyZvdwY6QW8r3fhJgyOFab6FoZfkc9YTnFSrH6jthhUHNuSXXIMsNkb2lFm8UrwHqtppaVOVwpSM/s9d808TbXslyZTO5yCb3Rp0VjrevugjOT4LANgMP1B56LwqmTgNy7HQMSLsUhV1Q8zwf+xgb4U1PGmYMcjnLZyT/o/wymfYqmgM65l+qSsG8yUPcBtljriRwP/qoLJMSYY0la8Ue6jA+Hg8uB+Q6Bs+SZgHaAfmTnGjKyQi30YwkaNedmemCqtUG0Vg8SCX8KBNker9W6TgmYANiHS13XQWKR7PpvLKo/qqweS/8TnlabjTSLqyrTcJo17u8Rfg/Ff0ifnfhdvxnj5Zi91DMl55Ratlk0NaiKkyiqTb0NNkeAH50EP6YjumYp7UjL4N+UuHmrc1p0vTGiW7uwbNg4aD2ip7sYQw2bP+HwmfDBoTFwRLgrkGdpWfc3f5Q5hG1UcZmnucIdKq5xKjeVZS1HfA8MoWe44SMGbCjPAWIvYMX2JdokLgIYlagvYYPglqM6N0IVpZUdGdFZ+sZMXtRogKmWxSFDMKVXQHynjn/obq3nJ+2hnXftJifgF6xDitoo0yDwlk8qGFtjahkl7uIRuHKvbeTU+9eRyh1wkKB3r6/pP7SQGgvIxbvS0y7uKUtikDnaFYRr27xuT5x2W8ml30q4pxqO8V/pyiKFTsB4IzAgQOLzKfVDOe37TamHyHI0doKDOyzbL7nFgMrBco6bVx5HVP7Zm5XoPuWRB2iJv7J5hQzrgfhegQkZ9hBNgxkepTpfgdy02B+2HCaojWG3HEykv25XmprbyAqCUjoTklquryfZ//pb01pWvdQYPp7ovkYFpnomxXiCvp67efXycghaHiVGyganCuKXC6yqe+XvE7WuKb1QDMU82Mzp2ObYsSkYKUmSOJSCmfvq9oli1+giRJR9qQbqgAKVwj5AepWLk26+iGCPoxbJ03510+J5jiQKHyIoEkc+0xXHo4QcQAu3XWNmNziD87GzgaAE0BJPxytxewsyAV8Kg9zsDbhiHU6uxNSvgMSIhv2OHYj7ZA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR01MB6171.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(366007)(376005)(1800799015);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6tBpMs84mOGRqTGIj9R+B9byjSyUDGVfmHuCbwDyfAXL3ZOAKA02RHiv+FSVF+e12EMvQyFfXy1+36lvZ1oUGKeQtFt3GDNGjVhmRyzKkC0S5XjalArj24KxEDnYIBgnQPEtO4Zx4h8gOax2MFGbciUrAKOpQ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0Hk1+Q3tCRHbKcK73J6MZJckYbd/S+GTgADQXZ5OFGEE/3FVtYn36EfY0L4R6DijQutSCAWYAgFeQE4G/cYQVfAkBO2yaJzYL+SynVsRdSkyYAraodyDdUbxkeLJ73Lg7qte7C+g0mnbdFr3rgZMp28o0fA9C7toeDwzccCgrv+1EYNw9O+3Vxx/kENZFCnqXIakhISQXZSQSIryAPP0zGy9Pc2btdFi1DtneoEU1H4RIH9h5tKNwBu3OQURb4beil9lEirIWJ/LH7DBaZyB79lK54clTlL8w0fJ8i5J/bj9COtFdKw6W1PyFKTjtAMQnNielYPfRtRqVJeUx1qTs3rp0WUs8/FmaYXbVm3mam3ATb1NrcIA6F7hCD70Yxswzw3gMb2XN1U54IMH8/hR62kBgUwe6sDKBUOJKg429iBi5NUBstuLeO31+rDyTULk6UpZGIVJU= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 92ea64f0-aa52-4e94-43d1-08dc7f4af8d9 X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 19:18:35.9589 (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: fcj5yOT9Rcwz6O+x6zmP/+CtoVnXxeeWHQgGSh/sQaAEHmZuq0GfPChWkn7OLZ7NHYD3wxU48Z0W2olT5uXnp5PXxt5MUPS4ebhEwJ1JlmQ8z6DGYng7TMf1oGrSJB2B X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8403 From: Adam Young Note that this patch sfor code that will be merged in via ACPICA changes. The corresponding patch in ACPCA has already merged. Signed-off-by: Adam Young --- drivers/acpi/acpica/rsaddr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/acpi/acpica/rsaddr.c b/drivers/acpi/acpica/rsaddr.c index fff48001d7ef..6bd9704f17b0 100644 --- a/drivers/acpi/acpica/rsaddr.c +++ b/drivers/acpi/acpica/rsaddr.c @@ -282,7 +282,7 @@ acpi_rs_get_address_common(struct acpi_resource *resource, /* Validate the Resource Type */ - if ((address.resource_type > 2) && (address.resource_type < 0xC0)) { + if ((address.resource_type > 2) && (address.resource_type < 0xC0) && (address.resource_type != 10)) { return (FALSE); } From patchwork Tue May 28 19:18:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: admiyo@os.amperecomputing.com X-Patchwork-Id: 13677214 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2103.outbound.protection.outlook.com [40.107.223.103]) (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 F39CB17836C; Tue, 28 May 2024 19:18:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.223.103 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923923; cv=fail; b=Sc/IaT3SaBG3udmtDhNlo5pawZPG5b0sBPq51FQY5GjZ1OsYzg+N/lNbBdBJhdoRsZzqDPIWy8yTomgwM8n3tqFHbebZn0sawV8Pq4M17viTifZuBQo7eMb9GvZmfnd0zsLEwKxN5wVG+xaiENZjLeZyeI6nMjkUvwbrwz6Jxts= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716923923; c=relaxed/simple; bh=WTj/g6dlnqrYkTeb2uct6w7zwReJNVkSTiVF5NbkY6A=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=dpCTl1Txhx9eHNxOF6S1kT4Yrbr6fPRCyXC4rKjqsXfDZx6Q1l0hu8cV1imVUgU21Ls+dwAVeH6az1PQ6YcxLIccJ3aQMtTX42woXELnE1KQ2e5JwavKclY+Kysvv7sJA0zsYmiuoht/XdgJMJLaEOhzggMGVBDUaf6FJosSDJg= 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=SGEKDYGm; arc=fail smtp.client-ip=40.107.223.103 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="SGEKDYGm" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QiTVo+Ux8EsaBVykQOHod38KIHB1qIw97Obs8Mf9ug9fj/G8TMDFNNsD1MNxVb77QGgNzJnFvZqZBGPDYXQo+JAhAflg2LkCHS87DhQ64N/VW+Up5pletQqGBrSrRU9PTky7NHgYgtCcfVRpiVKM95FR9Gs3R7kfMTknguaPJZMU0jbDXqT4XNg0/7xn898W8imORXswmQPBdLnO0jGhU6fOjk1L7jIjycEVouYectrDRzoLOmhcQgNkkStW04m7vPf/1JXwElkCaVC7Srt7UbhUYyaYT0GDpJ9eo0bCjIfWwnXxVQdouwfWR3tIzkk/r83+sH4/ugvn436YavBImA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/dWv2wfVlaq1CYsfunQM+yTD/9mAA69XoFmv5PqgNOU=; b=F2nt4Izkt6S7BHw2iwngG/1JdzqAnSSGfjsx/nvWveQbtttYVPQfeMbJtwSSs5z04qu7WxNQozyz4OkWKZMP7q0bmbiKeRENfFA5ixLbSeoLPu7Y7l/1d4enDEBk+nHDLZQ7gUvSq3eNlZH1ryDLhXxuJJxNgKG/pDWCxOjjXDAiQ0tnq8mN7Bum5vAvwfS8GhSHXDq/mjQuihuX0HuOCzDjQQ2J3m0y8ni9PurIQ3v94OcjuTh4TfzChqgMEdfqA/BxoiPaVha1UAFWtxvvgje8SBioOCWWKUBbO8EyB48ovnytix2jtg1f3LzR26rlZBPZdrbpij6V0EqYqof/7w== 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=/dWv2wfVlaq1CYsfunQM+yTD/9mAA69XoFmv5PqgNOU=; b=SGEKDYGmDYKER5B3ZNL8j1OB2N0DAjwS1G+GpkpqGRhQ3FD7jJ4M9Jd+gD8lB1UmUe1aPo+y7PcBqZsDxhVDXKgG5thBwqYn5kzruV/Zaq6JGsb/QxeIKkZb/FLBYS1X3q8YTPnZDuP1dBHlsa0Hmku4LISB2g7oF0Vz77B2Rq0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=os.amperecomputing.com; Received: from SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) by SJ2PR01MB8403.prod.exchangelabs.com (2603:10b6:a03:547::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 19:18:39 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%4]) with mapi id 15.20.7611.016; Tue, 28 May 2024 19:18:39 +0000 From: admiyo@os.amperecomputing.com To: Jeremy Kerr , Matt Johnston , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] mctp pcc: Implement MCTP over PCC Transport Date: Tue, 28 May 2024 15:18:23 -0400 Message-Id: <20240528191823.17775-4-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240528191823.17775-1-admiyo@os.amperecomputing.com> References: <20240513173546.679061-1-admiyo@os.amperecomputing.com> <20240528191823.17775-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: BYAPR08CA0027.namprd08.prod.outlook.com (2603:10b6:a03:100::40) To SA0PR01MB6171.prod.exchangelabs.com (2603:10b6:806:e5::16) Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA0PR01MB6171:EE_|SJ2PR01MB8403:EE_ X-MS-Office365-Filtering-Correlation-Id: 1ba353c6-46c7-4f34-2ecc-08dc7f4afaaf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|52116005|366007|376005|1800799015; X-Microsoft-Antispam-Message-Info: 7X3MtPzszpvg64U4YarQn504TvYL2PB1FCzbls7MFk4QcJNcOVVuYiSiAecYKUgtth36JB9nhTrjPePR28FYrRlSwPMM09WkXdfDEcmaTmw5xEnMrTb33EkTSfjxgUBIIw852/RgeY/rkiRJ3e2Tv/iFYCno0Vb0mbeIojmzW+o5Ss/awXhnYZNPoqmWBUxQPMx3javzGymR6sx6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ESrDC2wXa8LytUpjW/A== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR01MB6171.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230031)(52116005)(366007)(376005)(1800799015);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: qSMc0gKK1R6rShV0UTxtKq3oruP+cHV93WAwnBnr9/cenYpbeR5sEIsyET08yUKM0ZwgPD9Kgad85BbFVvBSOTEHASyJmn1Ia5EZHhW9OsNUFl5qyR0Qd/NVX+pCz0+hKQU7MQwXydLHkV+apARhUgR5Ax8O61zyuK/APrIG8BVqAYo7Bc9bDdRItVvLjR2CU6j8NK2Y9GKun5cKe6RM88d2f6wyB8PjqUI7vcFT2l9mrydCn2iaaNK1r5pPzaHqRvp2PXCe15CWuTeoWP0TMec1yg7nKytsYn9z1RUFsOuECqb3Caf/GZxeKkZhgIMxnTI8HS59UGPwzcEaCBH7CoBzxX7o5EzMiou7abCww7wxscBqvk2qiyR/9C880fB+bIYGfEnloog6i4OqnGmOb8xR1o34DFR2p1dtMA1NlTuBxHj8UWBBgp3pN8JeCdjYpB4dfO07W6HUVxVzf5SRjaUcOoV5/e/S22zNB3Avs7tzLhvvRcyD0iVukbbxNf3a7SS5hISmkj01LL1LeLoLaor/41bEl6FGAswROkXV4+8pFWtQJLWrL1rOWkvJ7Pn4In0dp0dMHzZcwkefgX19RvDclk7WFettQ/e+55kJwftshEHNfF3Tfgtkb05G9UmsM2/IoEsShwMeDz1di09JJBHmLJ9hgll2UbNjwHv97AGzY2V7s4XnRsqzsWbc4FJpz859qd+zJeIAyQZPHzXNMyG4pWqzEReh/58R1OVODRzWUiU3luMQSVV0ggo2Ge1OqguIBnnYmozKHJpJP19PFpxkxmzkVCX9K2pSKm9pQO7IXwEF5McH5NIWZUhe9NiMCG4l4rCEQvvQZmiPMFPgCc5hPSlg0MkOw7rnJdwIToD30/Hb3Yo1hXJnPkSZt6hK9Q20HbuxwTcSXzYztwJulr1lbnn7LYp1M2CJLBWA/b3iJbK19tGZ9lrSIOmI71VimK6Shc2v5k/TdwnNDIPi9/YL6NqxYAINI9u4VooaxNx++TRWcAyrRzjRKfmy6T2RWvPP61chgSCJX4liEvGAzapMoZXFy0BYqZXCGV2hjlboHBUOPxUGoIjsthW5TsjLGLZP0TLAVbvu2MkK3NtJB8C4oWpLHa6o5ApZ87x/1xZqGjB7nDeR3Zrrt0i1H3l3NhJHL9+62v9j5OQP8Wph652Km7EFD7AqOlT9I15TWlFpzBCMmbepb8ng40jS1ZD5tEohwhZoIcCuaNeGsbZ5PT+lHxYMzXWwOhmRA6EdHvdZv8YLDFhxjApVHhS79YBmNWEgKhDji+Rkn8JRuJwbXxfaumprhUQPM1J1IcDsYNcU47gK0WHgzSfBe5cJ2siR3tAyofzXuN33htPbliyj0PIEWTdHMRhD38LE7IiTRO4pbecLsHWjChDTPZYoZ/SlzZU+PdYVeXSGZK6jr9fXTzN2Zp1RhB+HTT1VzZswqburO2os2sP3l8EH9y4+QhDMSPdm1PD5uVQOIGkPat7QedZAGATmG6H8hJmbEoK+rH98X1S+Q4r57CIhPNbTBWdA5ZhjOC32gHyBiXyPyHwpwzjGnp1OLahpm37Cf6L9YzxKWlECJIY9vY8ogPwGxIZ++wUlvIbuQbW4EI2tETPSmfNh7RzvyEq6WArtJTZh4ug+ZUbys2XFGeSKoe9rthS2sdQmpDA/LkswKIVlP/NPYPvjMgd9rfRPdoOrtebkiGE= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ba353c6-46c7-4f34-2ecc-08dc7f4afaaf X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 19:18:39.1405 (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: pQV0iR+/hyIFMsc0WsVOX5T30qB51uawrji81xnFZj/HbIsHz54lubJsLexPUyd+66PMgQjbN15Wn+vyAPhcdyBW7JV1QZ9jW0DGhWztXmijh30eyzy1XiYdjs2wb5ro X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR01MB8403 X-Patchwork-Delegate: kuba@kernel.org From: Adam Young Implementation of DMTF DSP:0292 Management Control Transport Protocol(MCTP) over Platform Communication Channel(PCC) MCTP devices are specified by entries in DSDT/SDST and reference channels specified in the PCCT. Communication with other devices use the PCC based doorbell mechanism. --- drivers/net/mctp/Kconfig | 13 ++ drivers/net/mctp/Makefile | 1 + drivers/net/mctp/mctp-pcc.c | 361 ++++++++++++++++++++++++++++++++++++ 3 files changed, 375 insertions(+) create mode 100644 drivers/net/mctp/mctp-pcc.c diff --git a/drivers/net/mctp/Kconfig b/drivers/net/mctp/Kconfig index ce9d2d2ccf3b..ff4effd8e99c 100644 --- a/drivers/net/mctp/Kconfig +++ b/drivers/net/mctp/Kconfig @@ -42,6 +42,19 @@ config MCTP_TRANSPORT_I3C A MCTP protocol network device is created for each I3C bus having a "mctp-controller" devicetree property. +config MCTP_TRANSPORT_PCC + tristate "MCTP PCC transport" + select ACPI + 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 DST/SDST that matches the identifier. The Platform + commuinucation 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. + endmenu endif diff --git a/drivers/net/mctp/Makefile b/drivers/net/mctp/Makefile index e1cb99ced54a..492a9e47638f 100644 --- a/drivers/net/mctp/Makefile +++ b/drivers/net/mctp/Makefile @@ -1,3 +1,4 @@ +obj-$(CONFIG_MCTP_TRANSPORT_PCC) += mctp-pcc.o obj-$(CONFIG_MCTP_SERIAL) += mctp-serial.o obj-$(CONFIG_MCTP_TRANSPORT_I2C) += mctp-i2c.o obj-$(CONFIG_MCTP_TRANSPORT_I3C) += mctp-i3c.o diff --git a/drivers/net/mctp/mctp-pcc.c b/drivers/net/mctp/mctp-pcc.c new file mode 100644 index 000000000000..d97f40789fd8 --- /dev/null +++ b/drivers/net/mctp/mctp-pcc.c @@ -0,0 +1,361 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * mctp-pcc.c - Driver for MCTP over PCC. + * Copyright (c) 2024, Ampere Computing LLC + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define SPDM_VERSION_OFFSET 1 +#define SPDM_REQ_RESP_OFFSET 2 +#define MCTP_PAYLOAD_LENGTH 256 +#define MCTP_CMD_LENGTH 4 +#define MCTP_PCC_VERSION 0x1 /* DSP0253 defines a single version: 1 */ +#define MCTP_SIGNATURE "MCTP" +#define SIGNATURE_LENGTH 4 +#define MCTP_HEADER_LENGTH 12 +#define MCTP_MIN_MTU 68 +#define PCC_MAGIC 0x50434300 +#define PCC_DWORD_TYPE 0x0c + +struct mctp_pcc_hdr { + u32 signature; + u32 flags; + u32 length; + char mctp_signature[4]; +}; + +struct mctp_pcc_hw_addr { + u32 inbox_index; + u32 outbox_index; +}; + +/* The netdev structure. One of these per PCC adapter. */ +struct mctp_pcc_ndev { + struct list_head next; + /* spinlock to serialize access to pcc buffer and registers*/ + spinlock_t lock; + struct mctp_dev mdev; + struct acpi_device *acpi_device; + struct pcc_mbox_chan *in_chan; + struct pcc_mbox_chan *out_chan; + struct mbox_client outbox_client; + struct mbox_client inbox_client; + void __iomem *pcc_comm_inbox_addr; + void __iomem *pcc_comm_outbox_addr; + struct mctp_pcc_hw_addr hw_addr; + void (*cleanup_channel)(struct pcc_mbox_chan *in_chan); +}; + +static struct list_head mctp_pcc_ndevs; + +static void mctp_pcc_client_rx_callback(struct mbox_client *c, void *buffer) +{ + struct mctp_pcc_ndev *mctp_pcc_dev; + struct mctp_skb_cb *cb; + struct sk_buff *skb; + u32 length_offset; + u32 flags_offset; + void *skb_buf; + u32 data_len; + u32 flags; + + mctp_pcc_dev = container_of(c, struct mctp_pcc_ndev, inbox_client); + length_offset = offsetof(struct mctp_pcc_hdr, length); + data_len = readl(mctp_pcc_dev->pcc_comm_inbox_addr + length_offset) + + MCTP_HEADER_LENGTH; + + skb = netdev_alloc_skb(mctp_pcc_dev->mdev.dev, data_len); + if (!skb) { + mctp_pcc_dev->mdev.dev->stats.rx_dropped++; + return; + } + mctp_pcc_dev->mdev.dev->stats.rx_packets++; + mctp_pcc_dev->mdev.dev->stats.rx_bytes += data_len; + skb->protocol = htons(ETH_P_MCTP); + skb_buf = skb_put(skb, data_len); + memcpy_fromio(skb_buf, mctp_pcc_dev->pcc_comm_inbox_addr, data_len); + skb_reset_mac_header(skb); + skb_pull(skb, sizeof(struct mctp_pcc_hdr)); + skb_reset_network_header(skb); + cb = __mctp_cb(skb); + cb->halen = 0; + skb->dev = mctp_pcc_dev->mdev.dev; + netif_rx(skb); + + flags_offset = offsetof(struct mctp_pcc_hdr, flags); + flags = readl(mctp_pcc_dev->pcc_comm_inbox_addr + flags_offset); + mctp_pcc_dev->in_chan->ack_rx = (flags & 1) > 0; +} + +static netdev_tx_t mctp_pcc_tx(struct sk_buff *skb, struct net_device *ndev) +{ + struct mctp_pcc_hdr pcc_header; + struct mctp_pcc_ndev *mpnd; + void __iomem *buffer; + unsigned long flags; + int rc; + + netif_stop_queue(ndev); + ndev->stats.tx_bytes += skb->len; + ndev->stats.tx_packets++; + mpnd = (struct mctp_pcc_ndev *)netdev_priv(ndev); + + spin_lock_irqsave(&mpnd->lock, flags); + buffer = mpnd->pcc_comm_outbox_addr; + pcc_header.signature = PCC_MAGIC; + pcc_header.flags = 0x1; + memcpy(pcc_header.mctp_signature, MCTP_SIGNATURE, SIGNATURE_LENGTH); + pcc_header.length = skb->len + SIGNATURE_LENGTH; + memcpy_toio(buffer, &pcc_header, sizeof(struct mctp_pcc_hdr)); + memcpy_toio(buffer + sizeof(struct mctp_pcc_hdr), skb->data, skb->len); + rc = mpnd->out_chan->mchan->mbox->ops->send_data(mpnd->out_chan->mchan, + NULL); + spin_unlock_irqrestore(&mpnd->lock, flags); + + dev_consume_skb_any(skb); + netif_start_queue(ndev); + if (!rc) + return NETDEV_TX_OK; + return NETDEV_TX_BUSY; +} + +static const struct net_device_ops mctp_pcc_netdev_ops = { + .ndo_start_xmit = mctp_pcc_tx, + .ndo_uninit = NULL +}; + +static void mctp_pcc_setup(struct net_device *ndev) +{ + ndev->type = ARPHRD_MCTP; + ndev->hard_header_len = 0; + ndev->addr_len = 0; + ndev->tx_queue_len = DEFAULT_TX_QUEUE_LEN; + ndev->flags = IFF_NOARP; + ndev->netdev_ops = &mctp_pcc_netdev_ops; + ndev->needs_free_netdev = true; +} + +static int create_mctp_pcc_netdev(struct acpi_device *acpi_dev, + struct device *dev, int inbox_index, + int outbox_index) +{ + struct mctp_pcc_ndev *mctp_pcc_dev; + struct net_device *ndev; + int mctp_pcc_mtu; + char name[32]; + int rc; + + snprintf(name, sizeof(name), "mctpipcc%d", inbox_index); + ndev = alloc_netdev(sizeof(struct mctp_pcc_ndev), name, NET_NAME_ENUM, + mctp_pcc_setup); + if (!ndev) + return -ENOMEM; + mctp_pcc_dev = (struct mctp_pcc_ndev *)netdev_priv(ndev); + INIT_LIST_HEAD(&mctp_pcc_dev->next); + spin_lock_init(&mctp_pcc_dev->lock); + + mctp_pcc_dev->hw_addr.inbox_index = inbox_index; + mctp_pcc_dev->hw_addr.outbox_index = outbox_index; + mctp_pcc_dev->inbox_client.rx_callback = mctp_pcc_client_rx_callback; + mctp_pcc_dev->cleanup_channel = pcc_mbox_free_channel; + mctp_pcc_dev->out_chan = + pcc_mbox_request_channel(&mctp_pcc_dev->outbox_client, + outbox_index); + if (IS_ERR(mctp_pcc_dev->out_chan)) { + rc = PTR_ERR(mctp_pcc_dev->out_chan); + goto free_netdev; + } + mctp_pcc_dev->in_chan = + pcc_mbox_request_channel(&mctp_pcc_dev->inbox_client, + inbox_index); + if (IS_ERR(mctp_pcc_dev->in_chan)) { + rc = PTR_ERR(mctp_pcc_dev->in_chan); + goto cleanup_out_channel; + } + mctp_pcc_dev->pcc_comm_inbox_addr = + devm_ioremap(dev, mctp_pcc_dev->in_chan->shmem_base_addr, + mctp_pcc_dev->in_chan->shmem_size); + if (!mctp_pcc_dev->pcc_comm_inbox_addr) { + rc = -EINVAL; + goto cleanup_in_channel; + } + mctp_pcc_dev->pcc_comm_outbox_addr = + devm_ioremap(dev, mctp_pcc_dev->out_chan->shmem_base_addr, + mctp_pcc_dev->out_chan->shmem_size); + if (!mctp_pcc_dev->pcc_comm_outbox_addr) { + rc = -EINVAL; + goto cleanup_in_channel; + } + mctp_pcc_dev->acpi_device = acpi_dev; + mctp_pcc_dev->inbox_client.dev = dev; + mctp_pcc_dev->outbox_client.dev = dev; + mctp_pcc_dev->mdev.dev = ndev; + +/* There is no clean way to pass the MTU to the callback function + * used for registration, so set the values ahead of time. + */ + mctp_pcc_mtu = mctp_pcc_dev->out_chan->shmem_size - + sizeof(struct mctp_pcc_hdr); + ndev->mtu = mctp_pcc_mtu; + ndev->max_mtu = mctp_pcc_mtu; + ndev->min_mtu = MCTP_MIN_MTU; + + rc = register_netdev(ndev); + if (rc) + goto cleanup_in_channel; + list_add_tail(&mctp_pcc_dev->next, &mctp_pcc_ndevs); + return 0; + +cleanup_in_channel: + mctp_pcc_dev->cleanup_channel(mctp_pcc_dev->in_chan); +cleanup_out_channel: + mctp_pcc_dev->cleanup_channel(mctp_pcc_dev->out_chan); +free_netdev: + unregister_netdev(ndev); + free_netdev(ndev); + return rc; +} + +struct lookup_context { + int index; + u32 inbox_index; + u32 outbox_index; +}; + +static acpi_status lookup_pcct_indices(struct acpi_resource *ares, + void *context) +{ + struct acpi_resource_address32 *addr; + struct lookup_context *luc = context; + + switch (ares->type) { + case PCC_DWORD_TYPE: + break; + default: + return AE_OK; + } + + addr = ACPI_CAST_PTR(struct acpi_resource_address32, &ares->data); + switch (luc->index) { + case 0: + luc->outbox_index = addr[0].address.minimum; + break; + case 1: + luc->inbox_index = addr[0].address.minimum; + break; + } + luc->index++; + return AE_OK; +} + +static int mctp_pcc_driver_add(struct acpi_device *adev) +{ + int outbox_index; + int inbox_index; + acpi_handle dev_handle; + acpi_status status; + struct lookup_context context = {0, 0, 0}; + + dev_dbg(&adev->dev, "Adding mctp_pcc device for HID %s\n", + acpi_device_hid(adev)); + dev_handle = acpi_device_handle(adev); + status = acpi_walk_resources(dev_handle, "_CRS", lookup_pcct_indices, + &context); + if (!ACPI_SUCCESS(status)) { + dev_err(&adev->dev, "FAILURE to lookup PCC indexes from CRS"); + return -EINVAL; + } + inbox_index = context.inbox_index; + outbox_index = context.outbox_index; + return create_mctp_pcc_netdev(adev, &adev->dev, inbox_index, + outbox_index); +}; + +/* pass in adev=NULL to remove all devices + */ +static void mctp_pcc_driver_remove(struct acpi_device *adev) +{ + struct mctp_pcc_ndev *mctp_pcc_dev = NULL; + struct list_head *ptr; + struct list_head *tmp; + + list_for_each_safe(ptr, tmp, &mctp_pcc_ndevs) { + struct net_device *ndev; + + mctp_pcc_dev = list_entry(ptr, struct mctp_pcc_ndev, next); + if (adev && mctp_pcc_dev->acpi_device == adev) + continue; + + mctp_pcc_dev->cleanup_channel(mctp_pcc_dev->out_chan); + mctp_pcc_dev->cleanup_channel(mctp_pcc_dev->in_chan); + ndev = mctp_pcc_dev->mdev.dev; + if (ndev) + mctp_unregister_netdev(ndev); + list_del(ptr); + if (adev) + break; + } +}; + +static const struct acpi_device_id mctp_pcc_device_ids[] = { + { "DMT0001", 0}, + { "", 0}, +}; + +static struct acpi_driver mctp_pcc_driver = { + .name = "mctp_pcc", + .class = "Unknown", + .ids = mctp_pcc_device_ids, + .ops = { + .add = mctp_pcc_driver_add, + .remove = mctp_pcc_driver_remove, + .notify = NULL, + }, + .owner = THIS_MODULE, + +}; + +static int __init mctp_pcc_mod_init(void) +{ + int rc; + + pr_debug("Initializing MCTP over PCC transport driver\n"); + INIT_LIST_HEAD(&mctp_pcc_ndevs); + rc = acpi_bus_register_driver(&mctp_pcc_driver); + if (rc < 0) + ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Error registering driver\n")); + return rc; +} + +static __exit void mctp_pcc_mod_exit(void) +{ + pr_debug("Removing MCTP over PCC transport driver\n"); + mctp_pcc_driver_remove(NULL); + acpi_bus_unregister_driver(&mctp_pcc_driver); +} + +module_init(mctp_pcc_mod_init); +module_exit(mctp_pcc_mod_exit); + +MODULE_DEVICE_TABLE(acpi, mctp_pcc_device_ids); + +MODULE_DESCRIPTION("MCTP PCC device"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Adam Young ");