From patchwork Tue Oct 1 16:02:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13818331 Received: from DU2PR03CU002.outbound.protection.outlook.com (mail-northeuropeazon11012013.outbound.protection.outlook.com [52.101.66.13]) (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 6A2C31CB529 for ; Tue, 1 Oct 2024 16:03:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.66.13 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727798629; cv=fail; b=NXe2aoboPpbknmgCQOPVNDhvUDJ7HeJlgGuqL0ZS0rsCZlFnZRh2t5/ItnBStnPcJ90e5LQ380IAVkIKRDKNbnZzVMib2CjkBpPV2XDzE4eDGuz3cyyGdYt88leKJ+4hjnUzxAPkYEe6U00hB9aKeoOmbwKgYq+LJrz/dVRKsHU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1727798629; c=relaxed/simple; bh=5hg7uu3KNVcviCnomxqa4vxVoteMSlT4Rrc8jGI+OEE=; h=From:Date:Subject:Content-Type:Message-Id:References:In-Reply-To: To:Cc:MIME-Version; b=oTpicHKHefmdWO2DBwovyM91o/cIzGcN3dxc6DNw/pnzSxpDKH5jQu7O6zriXi74+ysGi3whKjm+oLvur25bElqsvwgPatUcz3KVoQdBoCOUP1aNAE4kLpkKfV4I4z4mnqD40XRuoGw8geNgJpHkkhDGtezyXP//Eh5lVUIICGs= 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=CDNwJYbG; arc=fail smtp.client-ip=52.101.66.13 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="CDNwJYbG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=SxvXFreaBpM3G/CMFh19pulmyk3nacLoVdqqKm125YUpGWJYyFwGaqiS6w+Kn3EqeO+MwJgoErzozcFN3zoGQoxBu4twSqEfRcgLfabp6EkJIdMvvl4xc7034tnwJORB5ya7E7a5qHDDrsgdSbudYRZjJNyOim5+w4eymCYEPgOAwKEgpFrdaE1X1NlHkhdqkTceSFEVMPwRqKt9Q1moLdNloz03O+uaj78DjYdl2eY3hVWv7n1vQoD+ZY5juCPCEinpXeLAWRm4fARscc7pd7RYDnC5u5aAQ7xW6AYJq50+EvVOURrveD0yMVm9x1PNgQaecpAO8LUbIoGlV8KKQA== 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=9oXAbN36WQRhBVwudaXIG+hmQyEgD5nBYHVHoW4R6ZU=; b=zOqb/is/KEKmmuQTK1EY7x9TmOY1xYNtFqoo0TyH6WkovQZPmzIQZNLCSeX69CjNUS0qmKCi+RtNOaI/h8H34Us4ZWz91QISgT1arNJngdc796TXqRkrfEnvI0n9GG78+qYyhDRBZvQRUUhjAyF1RVfiMKGjJuIsagaIsDIQTVScAPJlV/FpfJbHqqr6NYbFvuekaBtDkgjS24i2hp354fUrWWNUpE9u9yaDeaO4+ObxHPq8x8aoJmcWL/M2OcdsGbhnzmUzq3izO28lhPO0vDzQsJpYBAJX+vElzkHhyI2V97X997zE4SOuvOsdWdwuXpA5fMwcIt2kCcVsfwGPMQ== 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=9oXAbN36WQRhBVwudaXIG+hmQyEgD5nBYHVHoW4R6ZU=; b=CDNwJYbGk5I301mgOqUigMccxy8XvMlFvvnT+isNigR0KJ4pc22He4WeUcPfwQW3UM6FSXkbTMt9CvuBNhZI7OV8d/qDxmKg/DlcAPX+/0dm6Gzf4KIuJTBZ2OprkW2OQ3wLJ0/QhKoHg2ikU10c+9Q4QmlMmB2egtz744EDQhVwFztnhv26JLfJiF8Rweiiqg5ihUoPxNIoq1HucYl9lSm/tOtHLAgzWZo+GePcimvWkosaLZMT61WUNoDmahTOo5jLIUcTMBR9keyHABchtyZcQl2i69te8qpqbukZiNK3S4ZjRxPSBJsawnB11QSBSNoaflcD5Q4eHcvXFGAgPQ== 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 AS8PR04MB7879.eurprd04.prod.outlook.com (2603:10a6:20b:2a4::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Tue, 1 Oct 2024 16:03: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%4]) with mapi id 15.20.8005.024; Tue, 1 Oct 2024 16:03:42 +0000 From: Frank Li Date: Tue, 01 Oct 2024 12:02:52 -0400 Subject: [PATCH v5 3/6] i3c: master: svc: need check IBIWON for dynamtica address assign Message-Id: <20241001-svc-i3c-hj-v5-3-480ab8aed849@nxp.com> References: <20241001-svc-i3c-hj-v5-0-480ab8aed849@nxp.com> In-Reply-To: <20241001-svc-i3c-hj-v5-0-480ab8aed849@nxp.com> To: Miquel Raynal , Conor Culhane , Alexandre Belloni 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=1727798616; l=1475; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=5hg7uu3KNVcviCnomxqa4vxVoteMSlT4Rrc8jGI+OEE=; b=RaGDDl3paO5Y3iPR8cn2q9wxLJBhgtjwir4nr0D2bSvHrSDguxriS7fWJcYgeM14dp8mFSeAw Xpm+72YuUc7CABna6aPBKgJEonTi710+PMi9NdOQdbTN8+mCt+s4Yl2 X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SA1P222CA0045.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::22) 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_|AS8PR04MB7879:EE_ X-MS-Office365-Filtering-Correlation-Id: 169f58d9-b9b5-40c7-8ed8-08dce2329f18 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|376014|52116014|1800799024|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?3ucU6SJX9ANTlQZHRXEAjEyTGKpO2lX?= =?utf-8?q?DYWgJC2M3gcjGlBDTTRojNjpJdhcLeH9qffLlbK4ZS74t4Ii77ntgrQ5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GSCW?= =?utf-8?q?PVQFC0IBwUkrVb0zlRzGPRRlppRkoEtg5Qz+9Ek8Z8/sisYC/b1hc0c4S2p7m1QRL?= =?utf-8?q?wo4lOwEep346xXffi/D+zUFC/krsvIFNmncnNWcbgvus1iTc3yGsgKDh4Dd7z8r7w?= =?utf-8?q?B4k/N6E2Lh4w/pmQ5EETHYZGGANVpqBGvgVK+5kDBJBBNxJ1ssrWLEjll1a/dpUAQ?= =?utf-8?q?BxkQI7Dq37dTDJsqo45mrnV9TZfketnTH4a3JswqQ6tCgCRdN+cP1TlIO1F/m5Gfs?= =?utf-8?q?8O3mprkDcocIEHp1ST4KD9ZrQOqSdV6O1yD6ObKGXTQ3D1Tmc75Dd5oSUGHPu2oVV?= =?utf-8?q?kfSOE8jlE6PfVQI3ScPw4/afcunsxDbZ9Vg=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)(376014)(52116014)(1800799024)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?CRLSiPY35aN6cvYnKuOca0SjX++r?= =?utf-8?q?zAN03ndmikUeqyy6gNp3C9eFc4F2DMe8oVcRVs4Rva/Il3Hjl75EIn5B7poIc/BEK?= =?utf-8?q?3YrrFRRZ2MUNEIgpZrHXJP+U2l4rm1jMGPAlPf8ww7n4G3qZ7lFntx+RIGsfT163k?= =?utf-8?q?xZY/mROXaK/5MYuMmgSXAZ/syRMmP61JdaEzd6gQqNr/B9Fqn6n0vSzbdYlMqCSAy?= =?utf-8?q?qhJF/Gj+TGDIyGgnaU4bRPZfkYeb1rmWRNwLhFS6A9erxdyzr0RdbVMXsmD+1grP1?= =?utf-8?q?/Nwr00fFnqXzZ7Os+qCOc2g2ZSO8wAoLV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KjdCKNIXTa+7Gpr4P?= =?utf-8?q?Wr2IKy8EdvxnT/lAwMjcwd9UUj7IxI+SIgEpN+0mWVGFpIe3VkoNGW4i+VKCR7MHL?= =?utf-8?q?q0KoqhUmWCKmwZaExNwkWs8xsIvKK6ACfUKZkmMe8ACEv/aqJhenQkwb715l9QNUK?= =?utf-8?q?X75EA4YDR7SHIPZz5gUzi69DvHWrLD928L0AqlDa1AEYkYAXx4U/Ic3Cwb0AuRD1r?= =?utf-8?q?kZ+vdeKIv/fmewM9DU1PlKSf3QLfgizeTFjspUXV3u7UCdq1iy+ZYPLJYAK2kuawD?= =?utf-8?q?ijY99B5eJ8iWYiz2ecg4jie+CRBDvYuHRC2IdxX7/TrkHjOsgxCLKP5A=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 169f58d9-b9b5-40c7-8ed8-08dce2329f18 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Oct 2024 16:03:42.6151 (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: RXb26tUBbJMkf3/v4WYjv5UPJATZbsSAaiUOFv+WD0oglBzG4vulw50lUTm7B88JzKTxdwpRSY92dX0ZDgJK3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7879 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 Reviewed-by: Miquel Raynal --- 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 c35a228f0c2f4..5df0ec02d73ce 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -872,6 +872,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: @@ -923,6 +926,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)) {