From patchwork Tue Aug 13 15:14:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13762218 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012048.outbound.protection.outlook.com [52.101.66.48]) (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 E03521EA6F for ; Tue, 13 Aug 2024 15:15:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723562125; cv=fail; b=oojZsGiA7cahiLJQ2XCK9R8uU2VjLmFTt7KUiNxYGKlWdegqsMYgkaZSulYQ2/7C0g1/lo1y4gBnxlzKRHr2ygNwlIQTnH8b9zlwp24b6EAHt/CZ+RJgyTzruBc+hloRJt8K0ngKbHOXWJa4IL5Ig6kuVjr2aRTzQQIwP96fiXI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723562125; c=relaxed/simple; bh=qULKNECKl29j0mMuFirqULF4KYmewWg63Q4mY6fvZL4=; h=From:Subject:Date:Message-Id:Content-Type:To:Cc:MIME-Version; b=GpFV/rBDyZuBscFQfJnBJerMszS99PtVnkakbxaqJLaKUkK1QnUDCYMyJmEKNxAPRFRFXVqX030cHkW1yghKFFweC3icHtM7QIrGgBgKJJZ0H3ir+sUexiSmLX+K+LOjQ6GibqAfCSsRZ92TMRc+JNMSCfpmjTXOy66Swlv5TDo= 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=FUgvOE3p; arc=fail smtp.client-ip=52.101.66.48 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="FUgvOE3p" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=m7yjp0bM57yxsEo28pN8pN304sRQv9ixfgV89mew/Wdd6kAHVEYTB9gx2MYGlKrFHWTNBsB01wUxvL5qFMmktodD/r6jjKiSaThD2UV6DtqXhX0CDL1gz73rJ6BUJU8CRO9r535ZK4EtlTJwW1SfWr41KeoHKBRqGEQIaFRBj8x2WtyESu8rt6632GKz6gW8GYj7ie7XHabfA6hgiRptnvOraSW/fA5EgXdjk5n84Wm0eDQXfGSyAq/90w2xeQTZaqmes9Sl2xTPwYTL8M4FkiNPnBZPv/rIYTKUSu4jROwn9VtYfb8vNQBi4mfrvz1xZrUnnipKwaCZxFT/JR1CIg== 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=Ik505uxrcoOAZoq0M5fToVBuqg+6ZfC2DDgaDAx2Kd0=; b=KHrFccrmcNxOn6AzkqgGP/phm01bkqBS+pSjmW5LoNKlNw2omwI1Vl99Z+mfTtqs6JK80SQD3X6hfXKYtAw7Qd8T2BMTayTKlcKmTvg03w/ctXzSs1k5c8REji4MTXDiRRriIzPIQ+Igf+r3HwH7CJDnKzhiyiiUtm074uOapx8XPksCvNvoGMjMTy/h/8hnOOLBAwu3prKLEZWOYp+PqOpVu80rOh20s9tmKZfEkR3iYO4igKaNFMgW94lVIK3nAaowVPLBmnMaSrXdB8Yz7r1PskU1udXVH29M9PAnqxTxsJgL3TiO9UqEHu+g7odmnCbVgrbTWvGDyy67BU05KQ== 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=Ik505uxrcoOAZoq0M5fToVBuqg+6ZfC2DDgaDAx2Kd0=; b=FUgvOE3p0u3Dq53Vw0IywaeGlfIKi9NY7ppMMl1uVXyUiKiwT/A1cuVlm8dSeaN5KO994ipFP7zrg0p6sw2Rdy4Nfoe+jGOxxLSSUIEBvzR/Y1CVneJC5lfdFvfBSTVr7aCjpIrsSdGCpMMQLSGktctcN40TEe4fStOxAgfxh5WPk6dRfA+YeWc59PKMucM6WIJimDaGpBdS7Dywsnfgza1tZdcFhXBb9y5xlAsffrx4TdRz180R4d9ITe0Qt+gqgDgeOio/dIp4xL5mmeErALvFMaTIm1dD46NHSlBTf5AQEKIL34O8wjohEf6fnHYALnTj/5kqtRAZTywmZ3dpRw== 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:19 +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:19 +0000 From: Frank Li Subject: [PATCH v2 00/11] i3c: master: some fix and improvemnt for hotjoin Date: Tue, 13 Aug 2024 11:14:58 -0400 Message-Id: <20240813-i3c_fix-v2-0-68fe4a050188@nxp.com> X-B4-Tracking: v=1; b=H4sIAHJ4u2YC/2WMQQ7CIBAAv9LsWcxCq9We/IdpDNDF7kFowJCah r+LvXqcyWQ2SBSZEgzNBpEyJw6+gjo0YGftnyR4qgwKVYe96gS39uF4FW0vjbs4fSVEqPUSqer 9dB8rz5zeIX72cZY/+//IUqAwTp8QDap2Ot/8uhxteMFYSvkCoZjLX5wAAAA= 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 , stable@kernel.org X-Mailer: b4 0.13-dev-e586c X-Developer-Signature: v=1; a=ed25519-sha256; t=1723562115; l=1779; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=qULKNECKl29j0mMuFirqULF4KYmewWg63Q4mY6fvZL4=; b=PJ3YpGvyfQCWEUiDBw1ivFyqRde6qzLyYi0wxPRyRgySIv2YAWHCty+5wi6p4PicqeDV1Z6pX hWYVBRBvHMcAy+Mwa5P7j+Kec1qjINWdN8hmu2icgfr42TuPPWvBWz9 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: 6d8b6841-2b5d-46ff-c946-08dcbbaabe86 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: =?utf-8?q?Nh5lmXvIaSAOgoxLZaauCsuY/sRBR55?= =?utf-8?q?r0+qdEVR4sQpa67UbOOMTJMBByxyQ/kGw7TEehwtZNXF7DmqbxU6slP5QxOeyPN8y?= =?utf-8?q?IrdatdhSfsK+kjf/wQrYdx1IeSy3y4a5pKi7ZGuLl2BoVSZfM1w2LzuRDrx5GcNW6?= =?utf-8?q?7WknYHxTLaQbqOTd07y9QgwwF70oQtugv4F55zwj22WKpL7prxUU3qf/ioUewrJIU?= =?utf-8?q?1w0vCgJFS8junNw7S8HSY4VgH+89LEJejgIc+EkzbGEbuL/PsIsDWCQYyRFhMYrSx?= =?utf-8?q?8ezg8cfFLlkD0tF4Rq1rpTpQ81qjyO6nMhQtSBwxCMlGmMfzRKCTu7mE4RUxaEwlk?= =?utf-8?q?I4pOmvmxyKgZj61+0UsrNZ2gLlTj/+mtUc1SL4f+eFUEeot+Ox4dUJiB2czXAt8uA?= =?utf-8?q?lCQfqjBEs5fhr1b220KaIIscU+H9bVkhUU8Wii3mqpTQ74kyli7TH8J1jcQmqczOb?= =?utf-8?q?mM6XFFHfHvPP8la4GWs+lx7h9on2m5xFsyCUizVH/NogS2A25BYjOsuYvdFyTftLR?= =?utf-8?q?uYUHLBPg13atAQwlcxek7EIcPoJzNeNONyMV1KisubZ8XUQO8gQxE7JfmQMidTN08?= =?utf-8?q?jKm+3DiDKkQ/SuDMFbqeQbwnB8BNFxp2euN/spT4NX6dGgwxtKMOaptfc6EJqPNdL?= =?utf-8?q?HeLjm4GJ0CNe2QdSJ0RjfbgI94xonPi0ge3EDc2qjumxx2YmhoNMSywQlTWd3ePAC?= =?utf-8?q?BbmP8EN5fnxiXzV2KLo28Zawb8H2mEXAhzR31yNluXAhpNSqf7d7wEuIyRKSN95ab?= =?utf-8?q?KPu2vEsfMJHMyVBeYUMhjROGYYI2mpeX4bCjEZ23JJJ0C117Cf2kOE4QDZ/PtLbPU?= =?utf-8?q?9AF2sPNkOhoK/TzIfcus9WWOg0qPDgmpj2vt9H83rOBkquowrCjwNr5yNJocf/8Ff?= =?utf-8?q?mLf72Q9KTyao8d0VDrgL/VzV9/p2ycjmJpE0MzP6UmNGSCsFRxQJv0u3b3q44ALRl?= =?utf-8?q?sHfMTipKwEuGvGa/kym6ofx9K/QdKX3vn5Yk7MOT3XmNlUKI5FzraZledUXCQ0ds9?= =?utf-8?q?r1qkQJT0BAeqSVn9J89cGQDtT4rJGiWjfVe3d8azihwTl4EnMOmovfOOubUdfdEiK?= =?utf-8?q?GAOlrEdnjzkfXi/TKFobvBU8cKo/Qx4vJ7Cx41LCOe/czbu4+mjX2nchiIwrds597?= =?utf-8?q?3kwmb4iYntxyX5K0p67IpRRvirXBrLn3kpCIxy2Hh1CCbukfbO29mdTJMZjjYWriN?= =?utf-8?q?0HPATKHcn1KhqoeRW01BX4LHsko/TtOKG00IVMXh2BjVE4fwiOP6uXwce7lscgJYA?= =?utf-8?q?T/JuZpQMkD7eZDSaLdOoCbDK35ll57urB5q5Rssbcv4X5mIi77mAR7+w=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?/Gzn8t2tK7vlpt2MnJlBf/SzP+s6?= =?utf-8?q?hlSoAx33osnqGTG1uCeVrnU/Sy8IMl3mQC502noQ8shJ+JRWJ4NLa2ByF5epR5+1S?= =?utf-8?q?jik6G23/dZ2CCRYvTfr9x0I53PEHB7lG8dTLsUEXREH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xD5fHCtNBtLYYrmYI13zwB08d?= =?utf-8?q?yfPf0xCsM0LssMrBXKCcphKDeYaEu9Knxzs3d2gAIBabJPUs0K32wykV05hvbNOTo?= =?utf-8?q?4o3Op30W5ljNiQkLkzGy4CRfQzE01pJqxN/X+U/qsRPr/ZOFTAsPf//JetvhxsihW?= =?utf-8?q?TEawc844B/wguOcH+efmnXxUVKvlR+oCQkNGPNRKkw9NpSa91XhzVVXe9cNJE8PTo?= =?utf-8?q?4F3nJ2R0C+3ULC5zhpvA1NWjNk84tHxJrJveW+DMS7ZiyXQ/cHJZQOcwiB6ILkfsL?= =?utf-8?q?d8HfaF3q8YStWZKX5n7n1/pzw2neKacofwhIj2Mv8YGXwgOn8Te4J6pFox2Oqj9c+?= =?utf-8?q?jxIqz3XJ14jVsQtf+ybSXhjSzS+Mj8lJ4mXu1WK2hZfIFqqJ8Nk7m4g9VVU94kOZH?= =?utf-8?q?VMLWVGSK4mSXg6JycInebdk/zfxlIXE2SmiK+lEDJ1SpO7g0kIzIjJn0xQYben+ye?= =?utf-8?q?6N+nI/UdX4PMuDQJwGyOViDFnuPfVmMRum2evZxNhQagZ9wHL7SuIL4A=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6d8b6841-2b5d-46ff-c946-08dcbbaabe86 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:19.6030 (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: bQRtX296zzx8NXo+dmZcqDyngoGRb+IbyujtQwyNUBNpYNZ7VfvUbPqTkfhZTLSAZ0YZXbJsOc4OqRii74ClMg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8404 Signed-off-by: Frank Li --- Changes in v2: - add help function at i3c: master: svc: manually emit NACK/ACK for hotjoin F Add below new fix patch i3c: master: svc: fix possible assignment of the same address to two devices i3c: master: svc: wait for Manual ACK/NACK Done before next step i3c: master: svc: use spinlock_saveirq at svc_i3c_master_ibi_work() i3c: master: svc: need check IBIWON for dynamtica address assign - Link to v1: https://lore.kernel.org/r/20240724-i3c_fix-v1-0-bfa500b023d6@nxp.com --- Frank Li (11): i3c: master: Remove i3c_dev_disable_ibi_locked(olddev) on device hotjoin i3c: master: Replace hard code 2 with macro I3C_ADDR_SLOT_BITS i3c: master: Extend address status bit to 4 and add I3C_ADDR_SLOT_EXT_INIT i3c: master: Fix dynamic address leak when 'assigned-address' is present i3c: master: Fix miss free init_dyn_addr at i3c_master_put_i3c_addrs() i3c: master: svc: use repeat start when IBI WIN happens i3c: master: svc: manually emit NACK/ACK for hotjoin i3c: master: svc: need check IBIWON for dynamtica address assign i3c: master: svc: use spinlock_saveirq at svc_i3c_master_ibi_work() i3c: master: svc: wait for Manual ACK/NACK Done before next step i3c: master: svc: fix possible assignment of the same address to two devices drivers/i3c/master.c | 66 ++++++++++++++--------- drivers/i3c/master/svc-i3c-master.c | 102 ++++++++++++++++++++++++++---------- include/linux/i3c/master.h | 8 ++- 3 files changed, 123 insertions(+), 53 deletions(-) --- base-commit: 41c196e567fb1ea97f68a2ffb7faab451cd90854 change-id: 20240724-i3c_fix-371bf8fa9e00 Best regards, --- Frank Li