From patchwork Tue Aug 13 15:15:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13762225 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011063.outbound.protection.outlook.com [52.101.70.63]) (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 DC3171A0AF0 for ; Tue, 13 Aug 2024 15:15:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723562151; cv=fail; b=Ej/O8n+EzcrWvdjpUnoQQn2hK38dgtAnEt4syu7G+Fwo75OH4hbL6OK388An+5uLCoNjEyGM489YxDe4J7ak79rkO0cRA/agWiiy1h77rKpolO0vkiiZudI9QrXlI6G2LRE6UJOVtMXEATtzcR2YAlrrL+5hAet/bnWcmRF0o3Y= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723562151; c=relaxed/simple; bh=wdMOaxvdED4nYxZmlnJu7BdBDpzKEEzpzk8ZMhb0ahU=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=u/IaVK0nDv7344xKKr6qfQ8rrtTKAjXfXFZJjUZvwVYTqb9nVeYD8l8tDG5BVMbuPR1XYRFCcc55KSCU8nnQiLQvUEyD8FwzquhhA2Wk34rGwd/biCajVUUHvHNpXnmGZ+4dbWTbMfGQyijQ4pYJVMHoIkdFlyZ21Slxid3g638= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b=XM4VfFk8; arc=fail smtp.client-ip=52.101.70.63 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nxp.com header.i=@nxp.com header.b="XM4VfFk8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KxsUMbL5agChusyNig9RMxGSm8btWIIybk73PtjpLq+z3uRIPyqW3akrSB07UuUHE7VrMjiOceWyD3Y3L1Y3SPkQeGG8oOS7iEJsRCMIISDO8cMp8shc15BFdeycloJD45WGLzFJfasvb6PmCdAoN+cOv9PhK1MeuBKGYmQJSZfBEJlRx5p+/0hl/dZTOlr4mwDyFLNMRcwqWFxSHmx6fRDRke+GNp/8WYJ2pZTPfOZZxJF/2jSGdUdNEd/EV90J5Efjs5yXyWsHh2jpdTxNOE42AczrVBFyqHjcgxnktQ8fHUF78LrqDCNXcRpxdI9PiMmwcmC9FXplYqzr63EcKQ== 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=7cmOmx2TRWp/2Uy3nWsX2Ky5UGNNorgOPghwcI1aG9c=; b=vxMARKmhWmk9USpXNG2EpcUFSX/+hfaChyg2cd7koLpM92c4Ia3kxm5A0nCBjOGH8ktUcfPthdSTl26iehVs8pl2QE/ca11XmLrCE6m/uZy+Ckkmr8vcMKmD+0FLSoLlugS6Wz+ZuLLx9SvJXuIFRERsleaVKbHzkrM5DXJxIt14C9QYn4ixUD21UHoZDxWkPIgoEGVh37N+Gb/y6yodC6zoQfEu2HPaon/+LWucwfsQuEgUZ4gcp/c+QiPmvYAZO6T7fjngEXhOrX8Yb/zdMxkiu03bSwufrCYnuVR42+ROVeq7/xU0hq96QNHrjTgjCenkFMAZTZT35aLSceySPQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7cmOmx2TRWp/2Uy3nWsX2Ky5UGNNorgOPghwcI1aG9c=; b=XM4VfFk88cp6IsaHIJQ9kzODEww3st8yf2DOmMUD+8vaLdyVTnTQndrbJB0hLXjjLYwF/bi1Su1oP5U3YKz4gIZVZv6WMqOAMjMxZhyn7vo3ntmAt/BCpInGUeKIjrysP/64t+gqaUw3b2QtGERZglssGVg7pbFWMWEDUwU2j94lyzvXWo0UvfQjI/XVtiQVZ80KFJ3+sX/kRZM+aarIa5v16L07S/8IaiI7M4053mhhR0Z+V5l3NchwUqa7i6U6qwRU7GlXp4mP/OqQvow+1XtxLLCcPc+kLSu3fdokkkDEdI+BGIH42BG7OSL4naryC6Fl5ouBQ7RagGNLyz5tYw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) by AS8PR04MB8404.eurprd04.prod.outlook.com (2603:10a6:20b:3f8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7849.22; Tue, 13 Aug 2024 15:15:42 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%3]) with mapi id 15.20.7849.019; Tue, 13 Aug 2024 15:15:42 +0000 From: Frank Li Date: Tue, 13 Aug 2024 11:15:05 -0400 Subject: [PATCH v2 07/11] i3c: master: svc: manually emit NACK/ACK for hotjoin Message-Id: <20240813-i3c_fix-v2-7-68fe4a050188@nxp.com> References: <20240813-i3c_fix-v2-0-68fe4a050188@nxp.com> In-Reply-To: <20240813-i3c_fix-v2-0-68fe4a050188@nxp.com> To: Alexandre Belloni , Boris Brezillon , Parshuram Thombare , Greg Kroah-Hartman , Boris Brezillon , Arnd Bergmann , Miquel Raynal , Conor Culhane Cc: linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Frank Li X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1723562115; l=1762; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=wdMOaxvdED4nYxZmlnJu7BdBDpzKEEzpzk8ZMhb0ahU=; b=R24unpZV65f6GitW3gBYzE3DRfrhLKsqwD4i6ayIdG6CyoGGtPNBgpuX/FPj4DKC2/d+M7PbF OXNZ5iTyDuwA4YKFnhW1n+G8PRwT3DK2BOW6gmpFfd2IzV7TXEPpmhi X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR05CA0125.namprd05.prod.outlook.com (2603:10b6:a03:33d::10) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS8PR04MB8404:EE_ X-MS-Office365-Filtering-Correlation-Id: 77bac5ff-445c-4825-7537-08dcbbaacc54 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =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wyCIpoDBBoL9KO/kVYLR4GRRWk9wfk8s?= =?utf-8?q?GbWBqkORxtoHwE/ekjRsxf8MKP/lWghAtOrHMQavuwRNoCuWg3zfxkryxLU9oVd6Q?= =?utf-8?q?4rSfWVsQ0WR1T7R1kWlNSsnIRtquvon6j2Ys9fdQByu2OKJcvrHIgYJzcFvYsf4TC?= =?utf-8?q?q3NxsrmAuCWcdoIr1Cnj9ER1CzUlvBfuNwxQPqf5m37lpysRxzhdpSfbuGtl+PFi/?= =?utf-8?q?dKuT7ImE/zZ5w2DoyqUVlGngzmZFMyY0K0UNOHQ4Sc3XJJjyxKYmMUbn/7SBmMP3K?= =?utf-8?q?U5r/vHFvywR8JoEz6PhJ4kY7F6te8OAnF5cFoWw7O2sASStCbPa+E9wOMKraF6qMD?= =?utf-8?q?sUeOrQUjZp7vTwEpTdWqONH/VgK0wuYX3QdEwJW44Py3nh8k/X7oGjKuprLbVK7Qr?= =?utf-8?q?9Rujd6dGUVCFFi10U2Q6JNTjwGl7dZ79Sg6a/t4XOUfbXZswruFU79DNYXc3cysRm?= =?utf-8?q?hqtyYGs4A5GPbpPRBIx+FDbtUOi9c0jXow=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9642.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?O6osl+ZsqzzE0UUkAkEWQzpT1FhE?= =?utf-8?q?zXsffzYvmaJbi5te1F72xWA4fBStTM5LJe0OByonLRhQmJQmFTbL1tyBK3cpcjttT?= =?utf-8?q?U/arQt+SBN2Sdrliirrim6qYYfLVBgTwIVCQncPjJuPtUPT+m6si1/0VNQ4QMvQIj?= =?utf-8?q?S05CvdJKOiF3hX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FljV8ghhzdb89MVfb7ETc0himLaZwMl7o6ox9?= =?utf-8?q?ZeWrZiXY6f3OU0t3vKDSgq+4CddT5a7JnL+HdvNEUbaJaGf7jYGNzS3c/4I3xFh8T?= =?utf-8?q?rDKuty92/49kTzLTkE5oOwECA+bvpkVD21jBSd4Z1BbXq74RgwKfNy91LqwdZB6Ru?= =?utf-8?q?ToPVtBiI61tPEy8mJ0YtBmoKtnrEt7L8ItV3aSJ4BcEfHBhs7fVQojXcHcfnde2y0?= =?utf-8?q?+f6WaYlftG8sJ5BdplAbVQc0i2ReI4QILOKAc+reyR5xyTk4bQjLcO52KCNa11ycQ?= =?utf-8?q?mMFWMK8stYB3+FeMsd7cnfgGhx3r2udfkhcZ/ZLs107FcpbvOQJpwMHV9S8A0UF95?= =?utf-8?q?pqIT0V7aebsQUm0kmRQlFG1F0eDnuJNEIdt/5zhpt6f1k1L17SHkZ9aiNXq1luSAu?= =?utf-8?q?OqEW81dkc9+9YrtQ0j8nYKu+tE3pz7alV0CDOVc8h/ljShhX1s+W83FM=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 77bac5ff-445c-4825-7537-08dcbbaacc54 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2024 15:15:42.7747 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: vcJqCt58PO4OzxexIk3V1hzsELXfyY9cVq4dEwU6MEXUf1Odsko8DDGF+FlJNJndm26l2N1bS1UjpXxFnZBWcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8404 When the address is arbitrated at send address, the hardware can auto-send NACK if it is an IBI. However, manual emission of NACK/ACK is needed for hot join or controller request events. Add help function svc_i3c_master_handle_ibi_won() to check event type and send out NACK if the event is not an IBI. Signed-off-by: Frank Li --- drivers/i3c/master/svc-i3c-master.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 5d19251238ff8..d665639523e3c 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -405,6 +405,24 @@ static void svc_i3c_master_nack_ibi(struct svc_i3c_master *master) master->regs + SVC_I3C_MCTRL); } +static int svc_i3c_master_handle_ibi_won(struct svc_i3c_master *master, u32 mstatus) +{ + u32 ibitype; + + ibitype = SVC_I3C_MSTATUS_IBITYPE(mstatus); + + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + + /* Hardware can't auto emit NACK for hot join and master request */ + switch (ibitype) { + case SVC_I3C_MSTATUS_IBITYPE_HOT_JOIN: + case SVC_I3C_MSTATUS_IBITYPE_MASTER_REQUEST: + svc_i3c_master_nack_ibi(master); + } + + return 0; +} + static void svc_i3c_master_ibi_work(struct work_struct *work) { struct svc_i3c_master *master = container_of(work, struct svc_i3c_master, ibi_work); @@ -1113,7 +1131,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, * start. */ if (SVC_I3C_MSTATUS_IBIWON(reg)) { - writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + svc_i3c_master_handle_ibi_won(master, reg); continue; }