From patchwork Tue Aug 13 15:15:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13762226 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 22FC4433BC for ; Tue, 13 Aug 2024 15:15:52 +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=1723562153; cv=fail; b=uJLS/I/geBdbpQgbBW9wHjuGgPqmqwgMKP8URse2lUQFkTHqpkfZ9wN+Qp/xKT3iXrbe93/UIN4tYE5u+7UMuIx/E2hAMxXrXyGBrExJaMMl7npx/JX+Hyx3Zebg/1kFhQsQ4LGwi+0erqb7OJ86EpkfAT8g458cQDBpyXzDQYY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723562153; c=relaxed/simple; bh=L9feF7xb9MUyRMKZRWW6AUoqHkDTiS9UlH84igh2U64=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=CLn363IGBmrx1w8yvc9+A7uXy96ZfSzrxkFegyyPs0ah+SxLuLUWfb/pgr5NwTJ0Xuv9Y8Rl15FIw+sOjf4+OBd+ILfvp6leHdcozPH4xW60C79VOWze0yxjsCFU29ZqftXq9ix+E9GHQvmIeNkKh4f9H8WMDBBGimSDb1ikS4k= 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=aQ1Q+oH+; 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="aQ1Q+oH+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=zMvWkm3aUNNv8nrot85BYUBxgX7Du5m/tTVOMK8Xspqwh232RmSGTJnu3XXaZmTbb8A+RPbTJnB9XCHCGXAdTpI2tlnEsLR1xv0YLbNTXWkVIE+8u/sA6udwoTUPqiPqXAPXT1HSwjTJrfAxFx1S+L42X2TOCoGjg+eClk8wj6GQ7HH78jyVcqSl326Jhtnsj10JINMQGv9yVHP1oiWT5MGxd7BnnwZuU0z0v89/g5dVayJE0/iXmuTG1ifzmntr1Kb++gsSw84/49Ppfjin11ekj0kjIFghH3/LOxWH42IJMPq/iO17Dfnkrww8WiDJFSqsNDosVKitW8z0sV5cGg== 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=360E7KWnJTn4U5WkC5jXkR+B4Fj8KMcaMAGe2L9lXhU=; b=O9zQQi/7zWtBxTSoI4eFgfYIx1UamGUvB7maujy1PXy0fKAG6He71p+MOJ1/wKjSrgQ8R2S4bLkFMoBKteke1lsXIeTMKnbeEevr+V1ML1KiCvynQyTrImsVPDn71WLs07Y+DMf8dzmUXLSAgNYwoF91fU6QsDzAqLrUZ8vxSrHrLZnQtxeUcM4T5Kz9TlylPGUtF0Hn4wpGR8rpbL0ENdQyU8ukC1Jp1G0lYJ7LjPmNIUPYboo9ftCkI4l048jOBxyP8DEEGy7EWeyRAujAC5q4uejAUhHxt/QtoSMrYRNvD8EegSGNjs/H6h5uFoIiLjVxIwPamPdygo87eia/iQ== 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=360E7KWnJTn4U5WkC5jXkR+B4Fj8KMcaMAGe2L9lXhU=; b=aQ1Q+oH+BvlTO8VsN2Aj4VVU1LAaIJ5+qEG3W6yiMAvAtwxXHoSombc6ltW216eW8MT7mpm7mdszTTWhl/tbleUcRHr8IbMqPMyKfNgSK8HoX0DX/JLWS1zo6Td9OOKKTGZgC379ZbJ90YzeSW5YQ8/rx3+lygzt+u1eQlzdnqcaUTak4oaSak+BmtjvbOL8R51SxeVALo58AZ/+UCp8VYttG+/wQNwvHy7aVuWa5+gctaVHbKXfbXqRK+izRK5AnNwFh9yIQMnq/l2JCvSIskUmG1/scW4CmQsWJt27s0CNYERTKoTEdC+R0bfq6RE+JY4lJHVnRN0Pa/7yrMPGfA== 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:46 +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:46 +0000 From: Frank Li Date: Tue, 13 Aug 2024 11:15:06 -0400 Subject: [PATCH v2 08/11] i3c: master: svc: need check IBIWON for dynamtica address assign Message-Id: <20240813-i3c_fix-v2-8-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=1408; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=L9feF7xb9MUyRMKZRWW6AUoqHkDTiS9UlH84igh2U64=; b=UDwBfzr23I8HaFqu/tax2yXLxmI1iuaYPNObWFXG9XL/3LwtCqLlOYq9VLnBPaSnNOtXjyV4R leLCPzpj2XyAAJBygabreCbe6WCSZZgCMvqZ/NxUuF5cN5rV4uryXia 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: 4d63bab2-049b-4b89-b42b-08dcbbaace70 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-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cEDqWV++AektgPb5sYAWClsHsyP83MIL0w/S028Jzdzs1x6Y+?= =?utf-8?q?nlpzSDC4rGnmC9flHCzeAzOAxtt4vOOpqAYWHqZ7BnXM3NLDkped7tXGVb+fw45qM?= =?utf-8?q?/wsSkgLVjeM/Q4Jrd9bFskD6sNJ5C8YTjp7ec2D8uScUder2f6unkAEUTuJQDM5ip?= =?utf-8?q?6kmVfveGreQEmZ+wu8az4p0lgyKbNH/dn/JsFPigG3UUhBeNNpfDr929KsXB78JfP?= =?utf-8?q?Gbx5lgdgGvM8X0kLPR+Sz/2PpGcn+1wFG1ycDejWGCC3bwzSJxkdOSg5MU19mtX01?= =?utf-8?q?h/mtlc0OoukVt9gNdHBjLYB1eLyB0MS+KzM9XIoTyXUTF6rPk6N8/5uwOGdr7O5wK?= =?utf-8?q?Kslo3PYt+QxoLnbbbsjnQJNE5tS4shx91hKXxvJ/YHDdCSS1v7G3hE7sZkUYl/Px8?= =?utf-8?q?vXpbFvmvlneXNBAFDYBpASw76RQtgNIkYp8TatjrKDl17ubG9M5oirToeBGTdVqaV?= =?utf-8?q?6hmI2zdQGCP3AeL1nsoFj84L17IpwA+VKw=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?OnM6JaTMRVg9eYXSmteOyCVfgab8?= =?utf-8?q?JdpbaUP/BOjcwsjvMeDR5O2qNAVzKqkt0hT7NzzwM9noudWIh5aoHvyIRGoAkB1NW?= =?utf-8?q?wqJKZehN85+ssfUoe1be2bJTSzTkAM4dj5NfXlqKhWsyP62oaE4s6+IuGGCjexH5T?= =?utf-8?q?F+NLQz0iq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mSFWayr31c98QrYzNnoWkq0MCq1QsIzWHKDEQ1e8Z?= =?utf-8?q?4+MVVFoa9yNBN1VaF87IKrOiRhItwmfNLNaxmf/P8+CANtj3M48DgRQcKX/CAResu?= =?utf-8?q?rrQpohctIbhYjJMFHlZzyNecOCUFSRBzGWXymYtfMdpwZ/9a0cZBoR5nqVyQ9JJfA?= =?utf-8?q?jQavf5S9bEffLhtj8Z9yQPFTCs7eS9DrD7BMB4IglfB95dgTQ73d9cl8LTcciGmMy?= =?utf-8?q?HNIrLLHWUMqKQtKkkJKantc13Hotkj5LImg/OACnhE0d51FvrwG0Cn9neeVGnlLqs?= =?utf-8?q?FmCuJB9eS2QHQPrX48dMOxBfEB9yXWrQ11jhJgK0EOn8bnUrunfuOwZbRUqDgVWpV?= =?utf-8?q?ocw5ep0yRB75bKXMffXeMKJPPUCarZpm5oGlWlhPqO10fWEEppXi2ZC2PSet1cXwe?= =?utf-8?q?2cq94cdnnsZAviJsM1CTO3dXyyaSiWPdC7M/D75qCdC9prXFSzbgx0jM=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d63bab2-049b-4b89-b42b-08dcbbaace70 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:46.2917 (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: r5ZozFdg8d/khlv1BdZHCu6wWzaHeeR0N/r6T7PFPBfP3dLi5mM1laBWnJDeJ+no7pFY9VHRqEBhpyMgTKwQkA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB8404 When sending REQUEST_PROC_DAA, emit START and address 7E. Address arbitration may occur at this time if other devices trigger HJ, IBI, or CR events. When IBIWON happen at REQUEST_PROC_DAA, nack IBI request then use repeat start to continue current dynamtica address assign. Signed-off-by: Frank Li --- drivers/i3c/master/svc-i3c-master.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index d665639523e3c..161ccd824443b 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -808,6 +808,9 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, int ret, i; while (true) { + /* clean SVC_I3C_MINT_IBIWON w1c bits */ + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + /* SVC_I3C_MCTRL_REQUEST_PROC_DAA have two mode, ENTER DAA or PROCESS DAA. * * ENTER DAA: @@ -859,6 +862,9 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, ret = svc_i3c_master_readb(master, data, 2); if (ret) break; + } else if (SVC_I3C_MSTATUS_IBIWON(reg)) { + svc_i3c_master_handle_ibi_won(master, reg); + continue; } else if (SVC_I3C_MSTATUS_MCTRLDONE(reg)) { if (SVC_I3C_MSTATUS_STATE_IDLE(reg) && SVC_I3C_MSTATUS_COMPLETE(reg)) {