From patchwork Thu Aug 29 21:14: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: 13783899 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012066.outbound.protection.outlook.com [52.101.66.66]) (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 622431BBBD3 for ; Thu, 29 Aug 2024 21:15:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.66 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724966117; cv=fail; b=ofO0U2mqtmR+BfEyqO0FEeDyMr0sZVjf5FvEuwxDQ52TRhRyylSMLUmIV9yFn8zBsDqfD+7MjrKtjl8r2ZuXEi26hMfM2dIMJAS2d95QGMtPZVcFEAU1wm7jmfZMu4GcNHEJNT6kS3s5ZCi5X0o6CbhBvMiMxmJXDL075xPxefc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724966117; c=relaxed/simple; bh=/DYmw0y95BWfjnH0G+TXGaKcqfu2vSxvTBSnYz26UNQ=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=Y5nKcsxtVZQN7jfiv/JjSQgmuCx6sSK6yL8tTB1kG9RIMukSubKAGBmhlw40qRdvdZyYPgG9eY0z+mH2uDACD4AjO1IWqB0SQGvA2s1YsQuVTqflDnURMhzDiDFX+YF+L9Jbbw7MXVSAxqtpYFHExFk+YTkmDYrwdDEzSHDC6LU= 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=Fj34TkAu; arc=fail smtp.client-ip=52.101.66.66 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="Fj34TkAu" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BsX2kW48RS5AAJY71YG94c/dcZIHX/GM4kUys+iSE3tmXiHrVeV7TgNql0eSVVUziRAB/Zcf+B6nWWUnTwH4oGNISMVlJXacLlymDXWLTDuRzj4MNLbkB8vVjsK/sQxrAZSBCGM5WQoP3nfev8HjunuCg0yVwIpeHLnp2RinCgN209+kbQNgx49xZ8xpSOm1LfC+e/3YCmNdvjxa+U8/VNKNgOuFrvvFCDqhfJDK9SDMxKk4cBLpN95NibBgIm5ZPsa8H0rB9AXU2fe1iYtNpMaRRR1xd0/W6SqBDSjxn2cnd5r7zNLOLr4oNin2l+1nY+8RRrGGGL9Fo1AT0Js22Q== 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=qtHOgUkiY+OlaDnc5CH8FSP37gdSlVXFHj8VUptrrcA=; b=KaRByRs+lwaCQsVAm5QGw92/PfZr9dxZp16iEfzF+9BRwP9oXMRUGDWhESSaFo/P8lO5C5C4yYFxZWoQPmYniowYDXmoYesSgVTydi0bv7l8qmGksEIihjSUFdZISwP4SKwrsx2877JZtGxQ1TZ9hP8AKd365Bccx/I/UgB3uRxCBw1cFbD6Tx/tPw8FLVFYhn2nNuOJiXsWDCzWLtLqbVy/9fBMU70LxdxbGqhGGWtu0GkyIm+J9B/dUoavknZqYsThg/7meIpvgvKtfDzESd/8+tdGmbKPpGlrBNq6saZLO7K8YM8cfWDurWKsfnJQzdAQiy7Z1VrlbE+pOkbcmA== 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=qtHOgUkiY+OlaDnc5CH8FSP37gdSlVXFHj8VUptrrcA=; b=Fj34TkAuMiEy+/1H9E/3wjvGcTx+YaOm2TTqzx0bzoPLlWrZB4emM47NQ90LkZASua001Dt7DVcg7J5nftOalCxoEMtSE7yTTYlhKiWDCuXPkXCQ7Two40JiLH1zUpTY8ajmdOe5Z5vGB2BxBqci2BIRFQxIeIH8+L7XJ+jfs6poIg2yZbdguBAWiPeEC4aOKUgpnuQoP2SMKiNsFcELhuJvoVvL6lubn5QW4ISmex2LQD45gHeGLHKokqv/fBxQYFCtNhy+3GdXyjfTyXni/4yluwaPYVfd+wrRBP7nhJr3E6ZZtMbqQdcFvZqQHLqwhoKEXC7dPsGKbxbwvxnpZg== 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 AM9PR04MB8971.eurprd04.prod.outlook.com (2603:10a6:20b:40a::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.20; Thu, 29 Aug 2024 21:15:12 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%4]) with mapi id 15.20.7897.027; Thu, 29 Aug 2024 21:15:12 +0000 From: Frank Li Date: Thu, 29 Aug 2024 17:14:05 -0400 Subject: [PATCH v4 08/11] i3c: master: svc: need check IBIWON for dynamtica address assign Message-Id: <20240829-i3c_fix-v4-8-ebcbd5efceba@nxp.com> References: <20240829-i3c_fix-v4-0-ebcbd5efceba@nxp.com> In-Reply-To: <20240829-i3c_fix-v4-0-ebcbd5efceba@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=1724966083; l=1475; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=/DYmw0y95BWfjnH0G+TXGaKcqfu2vSxvTBSnYz26UNQ=; b=5Vj82rVaWs+0HccR5NC8hXRF9i00KOg3u/zGyBPBYlnxkU8IRVYGeT9bO3Hio0KImW7VoY9Hc rWE7ZOzWSnBB+M2njS4l7EHbfy2C7dSeRzFfb34Lfk3f+oVDwlDdJWm X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0219.namprd13.prod.outlook.com (2603:10b6:a03:2c1::14) 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_|AM9PR04MB8971:EE_ X-MS-Office365-Filtering-Correlation-Id: a5af9033-94a6-4a7e-7ca7-08dcc86fab38 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|376014|1800799024|52116014|7416014|366016|38350700014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KtJv0byxL5fubGxlXVSoYhJ8rnHD7Xk5WFW7/deOuYFmiCM6BMah4b?= =?utf-8?q?zGii1Lkh+Eu38AsUY/om8Jbjg+38PLb1cb4ktiduZD9lRMYEQ7SmIag/Y1JS/xNzs?= =?utf-8?q?+9VL0mgUlcsaGqZ10AauaMKU1Kki+6DGhC3TudEJFE4h8YtGIZFe3yQQ4rJIxOe5x?= =?utf-8?q?4bZxN31tSDjxN/f+UkM2KlydXDv6b5pL+apH4AeaqoKG5QrhxQnSHtaNYFDPZeYgf?= =?utf-8?q?Tn2kjCoUtWaL+fz1LHe+tXD7HSVUmjbvG2GSy8y9EbCb7SaLx1FEPhlD/eAUZRcs/?= =?utf-8?q?Y3yxYJjAZi6MP6luDkQ7LKmqrv73RgraWqZcQFg7BDi9EcTNAkSiADzqls/ymExpL?= =?utf-8?q?2NW1eBY97auRZfu0odBmkQwnn3kcgN/Z+4rV4OXxNezlwyTK3wOKJyvZRnZCnItv9?= =?utf-8?q?BKqb3FE/v8wiFonXlwqi5UL46UDeW+aR+Yk5aZNuQLwexw8a1d9D+WZpf7pz89RY5?= =?utf-8?q?Xm0y8TP3YwUdMbIWOXSjsSaPVTaXVaeTOw=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)(376014)(1800799024)(52116014)(7416014)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?BVxxR2CI2KI0M3J3b3nKHe2VzpSv?= =?utf-8?q?mewWXq9m0gvkiY9lcKr7kpAu8t38/0S0ZJculko7h/cDXE7UdbLwssSHTHxn3L7Xn?= =?utf-8?q?rbOhX5NsoaPcc6ecgGRawDYeuHCaAQ2hIDHZ/sAn4tIMzxnyMrGXrtTEffsU1bP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sSQNJTJPF?= =?utf-8?q?Y2EFq57USJ2ELfbEHgf1dLBFV23c6uaT2sVD0hs7PKvVS8CVxagjWGyBRwQigqLqz?= =?utf-8?q?R1PfHgepQtG3nQ8AIra6e3doB5mmZm31rtQMGOzC2Tk/KzkclmgqWHzB6FG//+dyl?= =?utf-8?q?MG4etV2uMh8NWeCHA8WyRvu0HIOHDz1xqXYNzZDzgy3PP0hXDuNWmVZDQPnl+q4zi?= =?utf-8?q?msFSn3J5i4uT/a8JcWa/Nfo89YhEL7cabchfZcSZ9bZNZgz86kMqme9lf+NlR79W3?= =?utf-8?q?katAkezNNIrQqfzsobt87sp8TmWRI+J5zyfuJ1o+zx3mO7ze9rtBFBjtY0ONNlzS1?= =?utf-8?q?3z0ike23me1p8os4Ow5p8PNKwTbBwFmZzni9FK5eEkM70DkO0RFulRJzDAhn/VdiL?= =?utf-8?q?NnVpHACu614KwsktU4RvNR9bIhe6Ko+L4zOgK1zzAc8f/6X9Zry/piVNgikt3/C+M?= =?utf-8?q?zsrML33EI9nQls/OHAFEIJDKv+fu3l7ePHfA754gZM4ylspKX/TZm3VXYYcB2SveI?= =?utf-8?q?rbjIxdMKfkXE?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: a5af9033-94a6-4a7e-7ca7-08dcc86fab38 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2024 21:15:12.0556 (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: eaNbW2YBOo3bWdwZKQF59/4BtGMaFHbox81GAr/2TGZ5buDaBV8pKeN45KNshDDkPMNQlKH8PibRskVAsBNIlA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8971 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 during a REQUEST_PROC_DAA, NACK the IBI request then send a repeated start to continue current dynamtica address assign. Signed-off-by: Frank Li --- change from v3 to v4 - rework commit message --- 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 122778b51c720..9f456639d1aad 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)) {