From patchwork Tue Jul 2 22:58:43 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: 13720465 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2117.outbound.protection.outlook.com [40.107.102.117]) (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 B3C16156F46; Tue, 2 Jul 2024 22:58:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.117 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961140; cv=fail; b=Zq2c541XWVc8wfm6NJdKjZxsG07rd/ZqenVJ95ANX0YGtE7HZvDFJ4SZSGQR1KwXZv0G9xgxajPXI/ik/Mfb+UgdX6Ger7nIROgOYDPhNjcMTw3O7vLACQHUBiPkgbNHacAnviHAQkCOKyYn8RJRED67X5tiiMmsQwPxvkc/rig= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961140; c=relaxed/simple; bh=t8cwQiGlu3LV7udPIIEYwmA5Bih0MHXeTzPiFdLrKaI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=fznCK5SFkVTA20r3b5+f54EIJIe1xotJ+dv2iPT1vwhHcczQxaPU9iK1Av38oVtPxe7KtHoQnvrUvrXKo/LK4PfbYetLYgKCettodH/FR4dtFfPi/9qaqzSySOtVyTGxTe9Q7fxM/oLjmpottc/eioKBXQTr7L5tw6o+G9yo1tg= 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=M7cto0CD; arc=fail smtp.client-ip=40.107.102.117 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="M7cto0CD" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=J8zyle1ZHp6zym4uPWS1cesvOSmFnRSVjZfDaRyBJzukfUg9V102pSz7vQ0+2e+SScn6dA7/lvXNHwD1xq61t2FsAv2mrxgmK3Fff4WLxltOC+CEkrK5w6SQQhVUXHsZeNaQEhKX6V3+x9G+l1/IFPg56KEYtLwzwfKaE7D2NP70wO13SHSWVAf2c6+KaveMEP6XrassAbJZ0DjkKqoK4i/9k0kHjOnfw7xib48LggvJcU/Fo/C2b96oni5kqJU6cAjuvkDn3dmR7zFUJSvoZpjiClwloQsAakbAgP48vRXVsWIYkTSagNkOLDiXa+Cazm8SklXnzEw9UD+Elizzyw== 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=maZd4uPe+FGvO0CYNqqAqiANTFso0QKd0yJj6CXMSyE=; b=VEvvdyPEFwuwiJmnrUb1gFuRxQcuQLSasS2E1h3qqaXwjhhi+O5YtSaBBl5p9/WiRU4sQvRfM3p/oY38iQHxA1yzXrDp5nSKZN8kEdeZG8g98DnKEfIsTL88IkWtS6Jx9m5v3so1i8G4vIJbu+AX8zFE4GPw7ecXJ4z4uNKrffRNEhR+dE1xrEc+fMbmQ5V7zyNK+lBBxB6XWkiYYVb1CMBMzeWl9pvq0/uHL8/I0tK6fWo04mdGz80NFPmY5HDwoPfowG2gus9KS9N/3d1I6qs93nwx2uXLkJ87sD0rK02BUeOIebQcC2pRSibvAP63VV/pwa/u1yPam74nJF7oyA== 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=maZd4uPe+FGvO0CYNqqAqiANTFso0QKd0yJj6CXMSyE=; b=M7cto0CD3zFJjk5dTqIuXh18J2LeDdWcs5f6PtuO4vpnxM6ZGR3NOWp+BhKmb+OwdmSpmpEVnbFiC66aEoT3b9QAIMx2bKCk8cPsjCwDGtcLiaMSRnLlX2Dq+ilbYFk/eS3FuXj4gurgQSwrXt+P9YDGw/vc4pou3+JvsnUirwU= 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 SJ0PR01MB6509.prod.exchangelabs.com (2603:10b6:a03:294::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Tue, 2 Jul 2024 22:58:57 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%7]) with mapi id 15.20.7741.017; Tue, 2 Jul 2024 22:58:57 +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, Jeremy Kerr , Matt Johnston , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Cameron , Huisong Li Subject: [PATCH v4 1/3] mctp pcc: Check before sending MCTP PCC response ACK Date: Tue, 2 Jul 2024 18:58:43 -0400 Message-Id: <20240702225845.322234-2-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240702225845.322234-1-admiyo@os.amperecomputing.com> References: <20240702225845.322234-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: SJ0PR03CA0006.namprd03.prod.outlook.com (2603:10b6:a03:33a::11) 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_|SJ0PR01MB6509:EE_ X-MS-Office365-Filtering-Correlation-Id: 3a01eff5-13e9-4025-76f5-08dc9aea8d98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: yYcGoyRUEXnrvRRJPY7gQUEXqB0PNhs+Kimy0riwhzCoTGoYoZosIeBan+ohQcp8oFuuIoQHWtkpED+4qO5Nq9i9ip/d4zRa25Jr7vyNpy2GvaGIqNYrEZBL4v583lY9kcQUM4QdAFWCg5nQeoGUgpXd+RAvR/FG1AomRo6HrsJew5UAeZXVZQIKijr/70cX9beci0KZM3XgoBCnqBRE+IFrHvvMBv+r0VLq9Zy1OAKjn7Vxu1/oY6j2IQLlEDfyaJagOcMIy7qsFq9w+bYEZKFvDMVmpp3r0rtnwiW3BeS+TZsp8eVczmOG6+4KvSV1hapYU37pRg731X5StPTQGI1zX5aSFyw72K//KYkBlnzPocbYRpB/1rkG0+9hJSp5DKAKpbekWLB/sF3AllHigNj2nL+p5LUiQYfB7SuudTo5jhM3DPz+1CV2T0K7Cjrsi+/rLx4VElJU+zoNe5ouFykk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0FrKBM9qJ8hyJb2diXflTT0oLWWsXJamHBETxjKlp7diaVYXWzhDMtolcTkuHTERx8QLOSf2EFJh5AjA+sq8C5Z6nJ3rVFWkR0c8Pgj5xDpQQCoP97snJwXCeodAeviLsVwVPaNPXsed3tGQVtclrRLZ4u0bS7LZayq+/3V1C4WVHgFLQ5iD9T7ZTctzYFubl4RtO9mXt8pZiz3+505pUCI9VyTYCD4wsDdzZejx5MXrVTUG5FPbroshYictjdjgLeQmNsWab6dGDJxmdNY3MUpJal/a+CBAGPnjjzykbj2CXK4VXBM4+pM7Mr3Irv8GGDD4+eIAzQUqPMCyzQSTUJQj73sc7aIduUUvPgjLWU5mp6lf59IujxgeuhxPi9c4DS6cBUqAcGSlczI969F0Td5AFZuOTuTDU/8V5DHbVN8IKgQlYZUVnojmsG/JgRd5ZBf2V3N3VctpLafrvS25OPoJl+7+d9UOLHfKRTzlgqVTQJ7LwaEygPIRS8twONnDjlpyQY4GCKej2Bf5ICDTlqcbLscRaMmLHq2Y3ISwtiuuo56dClVkB/rEkIDyvZNuqrYz6EK1ANUuAQ8L5AZSNgK89YNP9zyTh2JkQL94mDFYpfN5SYePJWxjli6MQQFdQvJj5P7Rm89rhXyJGePuXAu+BjInrBrf62X9Mc9V/k4HU8ao= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a01eff5-13e9-4025-76f5-08dc9aea8d98 X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 22:58:57.0032 (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: 3V8chWT8vm+vnsSDA0YM0+5ddZ7+0ZGGN5AHvlTZVlW/7jKYajkWauASXY4YiBNE9i9YFnlSMJwMZ2hJOS0gc5Mjupl/5NFy0F91aiCnyi5ys+KEhZdsKet2WezfW/Rl X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6509 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. In order to read the flag, this patch maps the shared buffer to virtual memory. Signed-off-by: Adam Young --- drivers/mailbox/pcc.c | 31 +++++++++++++++++++++++-------- include/acpi/pcc.h | 8 ++++++++ 2 files changed, 31 insertions(+), 8 deletions(-) diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 94885e411085..cad6b5bc4b04 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -107,6 +107,7 @@ struct pcc_chan_info { struct pcc_chan_reg cmd_complete; struct pcc_chan_reg cmd_update; struct pcc_chan_reg error; + void __iomem *shmem_base_addr; int plat_irq; u8 type; unsigned int plat_irq_flags; @@ -269,6 +270,24 @@ static bool pcc_mbox_cmd_complete_check(struct pcc_chan_info *pchan) return !!val; } +static void check_and_ack(struct pcc_chan_info *pchan, struct mbox_chan *chan) +{ + struct pcc_extended_type_hdr pcc_hdr; + + if (pchan->type != ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) + return; + memcpy_fromio(&pcc_hdr, pchan->shmem_base_addr, + sizeof(struct pcc_extended_type_hdr)); + /* + * The PCC slave subspace channel needs to set the command complete bit + * and ring doorbell after processing message. + * + * The PCC master subspace channel clears chan_in_use to free channel. + */ + if (!!le32_to_cpup(&pcc_hdr.flags) & PCC_ACK_FLAG_MASK) + pcc_send_data(chan, NULL); +} + /** * pcc_mbox_irq - PCC mailbox interrupt handler * @irq: interrupt number @@ -306,14 +325,7 @@ static irqreturn_t pcc_mbox_irq(int irq, void *p) mbox_chan_received_data(chan, NULL); - /* - * The PCC slave subspace channel needs to set the command complete bit - * and ring doorbell after processing message. - * - * The PCC master subspace channel clears chan_in_use to free channel. - */ - if (pchan->type == ACPI_PCCT_TYPE_EXT_PCC_SLAVE_SUBSPACE) - pcc_send_data(chan, NULL); + check_and_ack(pchan, chan); pchan->chan_in_use = false; return IRQ_HANDLED; @@ -352,6 +364,9 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id) if (rc) return ERR_PTR(rc); + pchan->shmem_base_addr = devm_ioremap(chan->mbox->dev, + pchan->chan.shmem_base_addr, + pchan->chan.shmem_size); return &pchan->chan; } EXPORT_SYMBOL_GPL(pcc_mbox_request_channel); diff --git a/include/acpi/pcc.h b/include/acpi/pcc.h index 9b373d172a77..6cb21f29d343 100644 --- a/include/acpi/pcc.h +++ b/include/acpi/pcc.h @@ -18,6 +18,13 @@ struct pcc_mbox_chan { u16 min_turnaround_time; }; +struct pcc_extended_type_hdr { + __le32 signature; + __le32 flags; + __le32 length; + char command[4]; +}; + /* Generic Communications Channel Shared Memory Region */ #define PCC_SIGNATURE 0x50434300 /* Generic Communications Channel Command Field */ @@ -31,6 +38,7 @@ struct pcc_mbox_chan { #define PCC_CMD_COMPLETION_NOTIFY BIT(0) #define MAX_PCC_SUBSPACES 256 +#define PCC_ACK_FLAG_MASK 0x1 #ifdef CONFIG_PCC extern struct pcc_mbox_chan * From patchwork Tue Jul 2 22:58:44 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: 13720466 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on2134.outbound.protection.outlook.com [40.107.96.134]) (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 AB81A17A5B5; Tue, 2 Jul 2024 22:59:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.96.134 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961143; cv=fail; b=ZkQO+tNeADC8wlHjr1XBzoyWRQtCBOL6QsaYCnYPeR8J9409Z0g7BdGzN9HUkFMaDMDu6krci3Y0RLPR4+lzyxXjH8jSac2AaezTkpBRlb7x+6cOMPkTHWAuVIALz26SpJZmdckLaY9GsnfCrNRAlvaveKj1dmKoRVaAW7kFJ2Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961143; c=relaxed/simple; bh=Prc3nTiN6hPUlJ83ouhK/B8iS122jeVWIy5nma8R69I=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=Sln+wotjGq9Wxlj6/YqM0PdoI7qSz94uSI2mzP5xn5Nt7lT5xfc6RjgVFgyE1zYwHbh7x7/I4kFaOwKJEOVkxKKj6wgIuJvGYR5kS4tZm8+q01CUr6zkwMaWPGQWuBYFEQJ1Boyo3YRjsa4sH4PWfC03MH8Fzjw4B1cmo/igw84= 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=W9Y01a4O; arc=fail smtp.client-ip=40.107.96.134 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="W9Y01a4O" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oTYTytgwXuuE41CFdUuxGHoiAQxSoPnF2fwJi+LdYxbC/OpK4TTwyF6MNDAIaR8rRHzvlNzXnYmlU8TEkfBlAIpTJfxM1ARqrIH6rdM4FmlcuXzKu6+I0+dus9GHoN0kW7wOYMTzv9q8Wp3dXtRKHKLOmpXyc5hJ2xGGAoZijwUvya3o73tmGHeTEkvYCK0g1jhLmxJv5+Lw9DHRZlYFxMbT8tOVE3Js4/g5eAR+MuMqkLyPChx5grGi6Tkg0dde626V9oDWr3tQEmgLCZGuZkB9RhotAGW+nsFAzTuDTj4vtvjKUNfpkYOb8ET74AmDFbsYZyhDmNnqvPzBPHaNtw== 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=F9ozymf2A9g/ABaeFwuYTMsR6Wc3N+gGkjAu0uL6FsQ=; b=BmNpuRxn8NnU03bbfGpMoLk98/EQgDPrrIThbzsqhB4WXXuWTKgp1gDXDZhWpWRTvf9kMTTHozQE9HqGRSjg3Y9k/O0BnROSJ9Yai0pDddYZnW6osQ9JE+/EAtV+d23fLmYYNrMGoTObBwPyCJ3K7VLyI9SXZLBB1irXkz7f8O9LcxPfX78qxR7CMVMKYriwFlXKsrjDM02K6jEOW9A1LdG1TIFJz11onH8unYwFr+IpPfDMwMrsV2ZHWoZDEDBBdVXOD/Wtxm6pKI54jS5RrYLE4zLmuAoXx8hLWUEFyQhtuoq5U+K6jWbAQk0r5ibPjO1OzG6L9fLSPkyI7AfcrQ== 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=F9ozymf2A9g/ABaeFwuYTMsR6Wc3N+gGkjAu0uL6FsQ=; b=W9Y01a4OLQqIixXdS/jiq6ZBpWhPzyks53cG6e2aZs3mX9g4vxmgLV2xvBWumkFP1Ths0K16zMSR+/FUICqmxaANEskECEsPXOq/6wICACUiOsXXbSt9ayDctEVOvIE6Lae93HI9qawjIFDPicH/XVcmD7Ev1RTKcpuc8qG380s= 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 SJ0PR01MB6509.prod.exchangelabs.com (2603:10b6:a03:294::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Tue, 2 Jul 2024 22:58:59 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%7]) with mapi id 15.20.7741.017; Tue, 2 Jul 2024 22:58:59 +0000 From: admiyo@os.amperecomputing.com To: Robert Moore , "Rafael J. Wysocki" , 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 v4 2/3] mctp pcc: Allow PCC Data Type in MCTP resource. Date: Tue, 2 Jul 2024 18:58:44 -0400 Message-Id: <20240702225845.322234-3-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240702225845.322234-1-admiyo@os.amperecomputing.com> References: <20240702225845.322234-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: SJ0PR03CA0005.namprd03.prod.outlook.com (2603:10b6:a03:33a::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_|SJ0PR01MB6509:EE_ X-MS-Office365-Filtering-Correlation-Id: 9541bf73-2014-4746-8955-08dc9aea8f46 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: 8g9VAGSjX8YmPkn8RsQJ6r9SU5UsA9Ujn+7papoNahtZbKAVIcejsUEUlmCfh4tmkgmn6Q+qcqlVJCzfwY90FAxrO5Bn4iIAeKLUx7j7kDoCrYk/OVBnPNI5Rpqn7CS8ssgRrA7NCc5iSnvBGQ8YnyYBRuboyFDOkanDALte8WO5idMfniiXwKhhU4S/s7E8Wy5IhLkqIyIG9SiI2r/JDynKmnzYBumiNQJmTiBacxRYdyGIxA23zqOXTX9Pmvm9tfnUZn3SQdbIXpD5/aCVXbsry+8y+Ux6P5JIRy78m8gZWAjcs18xtzVuZgA6H5UyD5r2peXd8xpjI1+h2+26LoYF8/Y5QWaxKEh/HYi5iZvfhWKaHZoF6xsjdMlQdj/Mnf5ukJQvvgAA+6EmxxjcRaxvS/4lMgLo1wobRSJCS3VzTUAdUN3FGdoWP3IbiRwSJAyTYvTAJqj9Xm0Jdy+IiB1ZfojR+J0fePkNd5vO+WjFS8bKLhP1n1QKDr6E0iESBeapjUmwaNUjtbk2FmiKeDobl85l2SrcORGpsSzU3qnimZDRwFy3EalTKyOnr+VanOeP4x3vtn0Ym1pVYyqic8kWp98iPjhVzhW5I4LXlzlZ7Yi9pLzhtBACQaa3BkpXbHWtmr7HocWaEIA553ZqUp6Wy+KMqDiOP3R5QCP6tVQiyvLQ7tG2CoJgPxMD2HsplyGAeplgTbuv+Xvgz5rT/qSyGk9hZbNiZj0lPEbEMIf7/G/RwB6IUtZmkkBI+jnES/IodM+l1bDcZHgAhVGcqaDEPCeIfGrKaKHIBb803HINo9PcoLWlTZjU9eoIru4Yts8LcU8ydX21aQ4iTSgRowWKNp3HGzeQmKoxoRZw5/nCteg8LcmqPKOWTz3FxQujzn/ZjwSFfSXkNG97QFli8mhw6Ab9dufed8060/lvKMK8up3m8mq3jsV80LNONXy6MyrbWGXFOF50xshRBEaDmT0vP1RkrBo9FhNZ8nSxU7N5wdoWhTT395WUSUPvsP/8i9SOGDryMVenw4/Wq7zJkHSkHBkg5qu/spBhEHuZdp5F2uE2VHYr+lDAkCXdw+qDNXlgeBPNLeKsb8hhwnSyFWQCmlOGmTzvCuL65CohueoBXJMNxrIMVvBzy7N1o0/inYx2FmLFeljreFyZZmLkRD4H82eKeu5QBriJiJisUTuGuTggUNSwtDZasgAU2zmowpGF6LU0KZFQ6E3q1y3qFJFqmutMQvdfBYVVv3SpyVD/DMuSmtSgNa1m8dU1FyieF+kcvUp2u2gTK1PmXPmK/kdFS8QANjQKtJCM+KN6o5/cGI3PaoKMlighCwPGo6N/sFyxk5nxERVt21Pl7eLakQ== 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:(13230040)(52116014)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: EoV1jnOrzhYCdNNMGp6QjETWB7FKkOSWltwgdd8H/sbuysC8cWGAHoubTuqsJ1BLfzctOmG3dlEbLIVLohmhBr7RjQd/IwHmrYbASKY/gbZU1r2tcUSgBH0SP4Tr8g360aGXFTULQpLDR2yNoh1X9hr3InFHFeEqd8RPsdPjzUots2iTV+Z3zODX3vnMXpCojgL8zYLnvDBSZosjQPxlTA11TH8cckjmLA7uoqREdV1DcICARG0SP/PlpFo3+01wTF/K7xKNbzcO6IENWGr8fUORhz8mIPXglRqNMIe1q2oFUY5DuaEqgz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1PvQ5j5V3hP82SCy4sPzTgbhcrWWcg+PZRHPUN6cjaYIbt8EhUUyx2Dp7rBzAiBYbyxKq72HyrbG6fw5ozGwnxKIqFMxIOus9VChSt2NYClrsoSewvHQjdQ2z0LbLOCDWN1MKjvNhrY/qbEn+aK+ark0UZyg8DRIuwqTwETPx9XnEtK6XV/p+Ry2eEb1I8z9koV12NYlulGN9ebiGmiysewnmFz+EY26bpe4pLQ5AZkDCSsRETH30pZfIBKVpp+rukXco/3eAbt3TNzQQBw55OPhXaHWxJrBN1M2Or+hZZCHk5H13P7kFxWNcwRsr0F1vPK89gikvl8WI8= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9541bf73-2014-4746-8955-08dc9aea8f46 X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 22:58:59.7333 (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: 0vPnSGl2pxixiMt0Qfgnr4raWx+JLnUFT/GjMd14kwZEjBwYFlHn6cMqgKFyGScb0RvYFzUdRusWIoZSVpa8T8uRGxJeNPmG/GaVgyNrwrrzxg0iO+mNkrNGD1Z7EH0h X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6509 From: Adam Young Note that this patch is for code that will be merged in via ACPICA changes. The corresponding patch in ACPCA has already merged. Thus, no changes can be made to this patch. 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..7932c2a6ddde 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 != 0x0A)) { return (FALSE); } From patchwork Tue Jul 2 22:58:45 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: 13720467 X-Patchwork-Delegate: kuba@kernel.org Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2090.outbound.protection.outlook.com [40.107.102.90]) (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 9FB5117DA2D; Tue, 2 Jul 2024 22:59:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.102.90 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961147; cv=fail; b=Cd1gzTkleds4qHrgn6tpsagLwIq61NHk4d2seY7L6rka4aq/W6qVSlMg0H1qDkWyVVE76m6fGk2YEEYBpox9XQNwfabP1QOYwWUH2xe0Vw6ODB2gypkudSPhk/KBj7dM+UgUkYA/CKSYdA0OoGESy6ROQrA+Dx1EUxcxXqCxiqo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1719961147; c=relaxed/simple; bh=VqaO+3aNLcEk4ZlTAa/+H7UK4o2RsG5pvo03inRVaqo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: Content-Type:MIME-Version; b=AlTC8yqsVnyAPOUX3aCBEQeXu/BT9FaF/9BIb/2wUQHs+4l/UvJTlbeoKWWJ57SAQ/mlJAdJklMa7rLuXFB6/Wu60oiSuO4xTGVP2IJYSXx9qAMS2MO7gyAuSSo8te4WA7sEmjtpUASL5sH2tpKsNFFABSsDqr51YAcq2ZCfBSQ= 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=GOS0nROS; arc=fail smtp.client-ip=40.107.102.90 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="GOS0nROS" ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=boOD27vObTx/SJDcC1m0X3aHsnosgosbYuZA0eFsmhdxoI20w7T6ab4y1Rd0jTIk8cOykL8T5RKgamls7xaDr0LBe6ipQoIfCb2m4i0FklvzN+nBRVLDwwwgFqP4zP+ZliwLyNlnLU0ifm/vHUoXk4DFSlWQrSVrT9ia4GRZEfMbrfi1tsV2DuVvs77vyXywc3c1eRFip73unPNKhiLDSQuu60uxyvOc901T+ICjpMDYnATQR9I9kgbVposdlITY0y/p8XOxfKPQGlIHYgiB2N4SEb+l2QmkiVfgiX0nIQjJgXty717L7/11xcwCF5oG/aFD5HABQuHbE8XMoIzD8Q== 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=mFjFvxtcylTGxrcIDwmpKI/Yg0okP5bgpD3IZ+cqFao=; b=l0vpqd8hk7YMhXiGygrzwGd2kOu3/9el5tMRH9U89lW4x+4EIO4SOjO1ShrDl+2IVdMhMK7knDSqYHyuNNbUdCoUy22ZqlaDaz447upiamOhxmulobd2JgDnZ1kbkNpXQ2PlTaXmK4gq2liyuzIZCkBcRvIDnYhZRtmIFnuSR5rxPWZ3CfSpNaKHRhSEnO/BKfBNZ2EhY6HuG5btPgOuHaJeVG1D0s8bBzLlNJyRaH1M1w2H+yasj6FI2aQ5QYU/PFeTya9apcSnlbJwHj1fnPUNzcn97euB3VZFfbLWvoTMnGh64cZDnR/9J/zxwGsi6qzSGHQpD20rof80vbF+WA== 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=mFjFvxtcylTGxrcIDwmpKI/Yg0okP5bgpD3IZ+cqFao=; b=GOS0nROSdQqmsep6W/HOAdvU4NpwuwvK1Tr8MpuWuPC5jyqExTa0QyjCs0ZJIrweQMeEsjSdcho8gE+JJj5a0i6F57q6kPIFOoqZx96HrN93DCpBVMzLoNpvdc3RbPGrxPbnBPThuuTy/hNJRZsXDddTcmx95J/awxG3PYcv67E= 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 SJ0PR01MB6509.prod.exchangelabs.com (2603:10b6:a03:294::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7719.32; Tue, 2 Jul 2024 22:59:03 +0000 Received: from SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d]) by SA0PR01MB6171.prod.exchangelabs.com ([fe80::b0e5:c494:81a3:5e1d%7]) with mapi id 15.20.7741.017; Tue, 2 Jul 2024 22:59:03 +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, Sudeep Holla , Jonathan Cameron , Huisong Li Subject: [PATCH v4 3/3] mctp pcc: Implement MCTP over PCC Transport Date: Tue, 2 Jul 2024 18:58:45 -0400 Message-Id: <20240702225845.322234-4-admiyo@os.amperecomputing.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240702225845.322234-1-admiyo@os.amperecomputing.com> References: <20240702225845.322234-1-admiyo@os.amperecomputing.com> X-ClientProxiedBy: BYAPR02CA0010.namprd02.prod.outlook.com (2603:10b6:a02:ee::23) 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_|SJ0PR01MB6509:EE_ X-MS-Office365-Filtering-Correlation-Id: bedc5686-c2ce-4a24-bf33-08dc9aea9143 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|366016|1800799024|376014|7416014; X-Microsoft-Antispam-Message-Info: TfZ+7vt7Rh2kw9Eysuz6yvDmL5WyPM8SsG2H68koj0RdIjh3ArtAqoA9I2sZydUUsFCj1QbndUNhqewOYcxOsqDjllRNcz5hEg9v4KgXnKfkJt+egXJzhKzowJo0P1KfvvHx4a4on/8wsEg+W+Yj3EnO4iOZ0OCzGvyhqnr4YGQ39ISUQERxM3cZDGVZg9ZY0+wdu1Nihd2nWWhAq7Ofed38PXF65Ihxdr3RPy93eA0a675+i4qCU9BlT6QwlrWI8oGgaB5xn7r/zoqsQOGyCGyGMtsMP+nneGCnGdTJn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.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR01MB6171.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(366016)(1800799024)(376014)(7416014);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: sjr15zLw8nLV4llJ41ssUE5NXzphdPdSCmsBzpLLfCJyuVvTQD7jlj05NbjAHcBF0Olqw5Xj46VdxUC3Zvgv644xpMdQGRE4O/+VPWsOf5uE+TBrohI5g7QpCX4VqpQr7gOdxz0FP9eKdHi9hW7bswlQsxFySeS32J5jTY/wwioe3FTSE6usLx3TeBTISm6cvGUGEknueJoLTUM7qlX49EGH42qAtQb6PfZYbTsBnXf/hv9bvBytNcz+O3JHzlS7UgAQrCEodUiiumGsYJt3tOB6jO7851mDr0qzl7zPK2OODz79EnmRpgYs1SbkBAyc0q8Pha7Z+mShoKok9iO8pGjgwdXyHlJ+G31/cn+H4ci8e+nn5eJMhBM+Z3OYgMgMQYIM+pQcgE2rv5kT0p0H+nGu8OGARnLlNEkvgxgQc4FxpjquwZgvDpb7pn42RTYjz3AWZm9qvYXa9zIH5OnM5NkrKzb7/yCnl8v/fsOPCx72IH/Bj+tUQiEfJaWGta4jTQva3B63MjtPRYxc8eyyk/ssU69nOU8I87aBn7DlXCtjmMkf71TDOm8iRPn3jpVIGozSQFqMK+TpB98j4FbRH54+WNK+EKEHLOXVSdDRhXARrTWjnPeLiMtLhdj4+y5mCkebOU1iUnLN8zA5PI9+M1ta3W1o4ujWgAvs5yLA4ZUC00i4HsqP3jB7Zj/LL/qvCt+4LwMCzQTBsxK3DUM8f6XwElWWXrQgpzxNow6uifhdK2tYomEUlUC7/k4yVlhTtjfJKqpNvm0cxPHKSQT3G0miyn3HKUyoCONXWAeHMSqLRrgFc8WqWscKc8pJ7XErOvKqjtDPJWbK0+7SZ//gSIayDSBFgC8hWFAq7kwMIc+K6S6Lp+KA5uyONCTL6zam0zkWSt0ZbPHLSH9EYIAIa4tNooqpHsaqWQzAkdmqPXlxDUIGi1m4Kj0IqmJSCqcVngyOVG354uyPLPjTUUva42uWsnvzBYb+oQRCNexFlXZL8RYd3csZnC3m8ZX8zmnyc4YgNz3OWDOytMUTNQI9ddK8G+7O1QUaU+ZbBMywQ5Qyg2lkNLXXD/7xP6a9tZkSnOfl+EGocGmAj3pcv+EsqoDjH9IeA21kN3zcwb15oZif1Nh9MK1HBGC2dC3oIZh7DYUdvjZMNTtn6VlauWGdh03Sw4mxy7qcRFv/Q6Ukrfe1DQtJalfwzgLvPruGtmU/FHvuJHhP6byJwJVtMCZCu7DMp1FNPIQ2T0xTWadwwfDSUbsGWKfDegsCTLVrQ3Egz7Yt/smmi6aUdtsZqjT8TtbObM3ISoaLPsmY2Ht4hV35MvrFUHUaKJhfv3AxvUlu+gJBvDKpYFCjCzI7Xjd3H5G5a6sJorlZUZmgKkEqHmDJ0AYGQT9Te4o5c96uWCSQMlY6Xrn/xgDnFfCGebC1cnNm0/VqMmsp+gkqe/2IWVB/xaYruihtTtwDFJAYqNzshMvfPyRx0ZGvgp6V15yNarxiRefKqsSwU/zjcCF/MWu+77m9oe3402oa7s80nJCWl/XVpRHZa1MwJgTYmVEx9HmDcJgB088YkuOvuck3a0OgYidiUn7dljOE7ijQ5UWB+kVhTUIsQVNS7fY/RlERcregIgZ5VOxe7AEZpERjd/lmDY6k5bpGs0a1Aodmx9MH4qWgQtgTKcs2SHbfvj5tR766YztLc1zq3+V+NKGOsGo= X-OriginatorOrg: os.amperecomputing.com X-MS-Exchange-CrossTenant-Network-Message-Id: bedc5686-c2ce-4a24-bf33-08dc9aea9143 X-MS-Exchange-CrossTenant-AuthSource: SA0PR01MB6171.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2024 22:59:03.1501 (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: zpXnMkmSLGqhFaDXN/GysiVh1Oqq6UYEsXHdfLGG5RxOM4NKjB9CtXyIzysCPuvPHIuI3z1Yh4CgDJyUk3xEnsF3YgAXLGKxnfg88JDGrT0XGIlwX1dZsMPApbqx7jF7 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR01MB6509 X-Patchwork-Delegate: kuba@kernel.org From: Adam Young Implementation of network driver for Management Control Transport Protocol(MCTP) over Platform Communication Channel(PCC) DMTF DSP:0292 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. Signed-off-by: Adam Young --- drivers/net/mctp/Kconfig | 13 ++ drivers/net/mctp/Makefile | 1 + drivers/net/mctp/mctp-pcc.c | 322 ++++++++++++++++++++++++++++++++++++ 3 files changed, 336 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..50ebad0e0cbe --- /dev/null +++ b/drivers/net/mctp/mctp-pcc.c @@ -0,0 +1,322 @@ +// 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 + +#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_HEADER_FLAG_REQ_INT 0x1 +#define PCC_HEADER_FLAGS PCC_HEADER_FLAG_REQ_INT +#define PCC_DWORD_TYPE 0x0c +#define PCC_ACK_FLAG_MASK 0x1 + +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; +}; + +static void mctp_pcc_client_rx_callback(struct mbox_client *c, void *buffer) +{ + struct mctp_pcc_ndev *mctp_pcc_dev; + struct mctp_pcc_hdr mctp_pcc_hdr; + struct mctp_skb_cb *cb; + struct sk_buff *skb; + void *skb_buf; + u32 data_len; + + mctp_pcc_dev = container_of(c, struct mctp_pcc_ndev, inbox_client); + memcpy_fromio(&mctp_pcc_hdr, mctp_pcc_dev->pcc_comm_inbox_addr, + sizeof(struct mctp_pcc_hdr)); + data_len = mctp_pcc_hdr.length + MCTP_HEADER_LENGTH; + + if (data_len > mctp_pcc_dev->mdev.dev->max_mtu) { + mctp_pcc_dev->mdev.dev->stats.rx_dropped++; + return; + } + + 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; + netif_rx(skb); +} + +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; + + ndev->stats.tx_bytes += skb->len; + ndev->stats.tx_packets++; + mpnd = netdev_priv(ndev); + + spin_lock_irqsave(&mpnd->lock, flags); + buffer = mpnd->pcc_comm_outbox_addr; + pcc_header.signature = PCC_MAGIC | mpnd->hw_addr.outbox_index; + pcc_header.flags = PCC_HEADER_FLAGS; + 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); + mpnd->out_chan->mchan->mbox->ops->send_data(mpnd->out_chan->mchan, + NULL); + spin_unlock_irqrestore(&mpnd->lock, flags); + + dev_consume_skb_any(skb); + return NETDEV_TX_OK; +} + +static void +mctp_pcc_net_stats(struct net_device *net_dev, + struct rtnl_link_stats64 *stats) +{ + struct mctp_pcc_ndev *mpnd; + + mpnd = netdev_priv(net_dev); + stats->rx_errors = 0; + stats->rx_packets = mpnd->mdev.dev->stats.rx_packets; + stats->tx_packets = mpnd->mdev.dev->stats.tx_packets; + stats->rx_dropped = 0; + stats->tx_bytes = mpnd->mdev.dev->stats.tx_bytes; + stats->rx_bytes = mpnd->mdev.dev->stats.rx_bytes; +} + +static const struct net_device_ops mctp_pcc_netdev_ops = { + .ndo_start_xmit = mctp_pcc_tx, + .ndo_get_stats64 = mctp_pcc_net_stats, +}; + +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 = 0; + ndev->flags = IFF_NOARP; + ndev->netdev_ops = &mctp_pcc_netdev_ops; + ndev->needs_free_netdev = true; +} + +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 *acpi_dev) +{ + struct lookup_context context = {0, 0, 0}; + struct mctp_pcc_ndev *mctp_pcc_dev; + struct net_device *ndev; + acpi_handle dev_handle; + acpi_status status; + struct device *dev; + int mctp_pcc_mtu; + int outbox_index; + int inbox_index; + char name[32]; + int rc; + + dev_dbg(&acpi_dev->dev, "Adding mctp_pcc device for HID %s\n", + acpi_device_hid(acpi_dev)); + dev_handle = acpi_device_handle(acpi_dev); + status = acpi_walk_resources(dev_handle, "_CRS", lookup_pcct_indices, + &context); + if (!ACPI_SUCCESS(status)) { + dev_err(&acpi_dev->dev, "FAILURE to lookup PCC indexes from CRS"); + return -EINVAL; + } + inbox_index = context.inbox_index; + outbox_index = context.outbox_index; + dev = &acpi_dev->dev; + + 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 = 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->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; + acpi_dev->driver_data = mctp_pcc_dev; + + /* 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_MIN_MTU; + ndev->max_mtu = mctp_pcc_mtu; + ndev->min_mtu = MCTP_MIN_MTU; + + rc = register_netdev(ndev); + if (rc) + goto cleanup_in_channel; + return 0; + +cleanup_in_channel: + pcc_mbox_free_channel(mctp_pcc_dev->in_chan); +cleanup_out_channel: + pcc_mbox_free_channel(mctp_pcc_dev->out_chan); +free_netdev: + unregister_netdev(ndev); + free_netdev(ndev); + return rc; +} + +static void mctp_pcc_driver_remove(struct acpi_device *adev) +{ + struct mctp_pcc_ndev *mctp_pcc_ndev = acpi_driver_data(adev); + + pcc_mbox_free_channel(mctp_pcc_ndev->out_chan); + pcc_mbox_free_channel(mctp_pcc_ndev->in_chan); + mctp_unregister_netdev(mctp_pcc_ndev->mdev.dev); +} + +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, + }, + .owner = THIS_MODULE, +}; + +module_acpi_driver(mctp_pcc_driver); + +MODULE_DEVICE_TABLE(acpi, mctp_pcc_device_ids); + +MODULE_DESCRIPTION("MCTP PCC device"); +MODULE_LICENSE("GPL"); +MODULE_AUTHOR("Adam Young ");