From patchwork Wed Oct 2 14:50:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13819873 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B3201CF6D2E for ; Wed, 2 Oct 2024 14:51:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Cc:To:In-Reply-To: References:Message-Id:Subject:Date:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=B8SEPEluX6i21GcBcLDOFWwi7FQ3I7pcPlaNbULoMBM=; b=DDgB6ZVrrs1jh63f2LWEgL/kRp yOYu2r/Ck3Q2beVQQu7/+r7tV/Vuuu7omJO/y6/YxVrknP7YU/4w1MMLWI/B9PMrwb6HI2e/5zi0F asDNhwnpRg2a2bYx72abbXpdSIpEYB7FaeEFFwjBxW1o2mITE2vRtOrwXERdpl/I4JBemJSZP9gnX OoTGaYV/yWZlqxAohNByglGROh2S1nbNlm5mg+z1o9yYHq1hvgMkS7oUBLjoRd8ydIkFE1bqeueHU Fe1Q9hE+n1NCLzLwG+gMgOiP7IuqgGzqozdObe/FvO+aqqSkJa5altgJIj7tBg5VaTjUlOTWhcj46 lcLPeqiw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sw0hq-00000006SwV-1skZ; Wed, 02 Oct 2024 14:51:58 +0000 Received: from mail-am6eur05on20610.outbound.protection.outlook.com ([2a01:111:f403:2612::610] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sw0h0-00000006Sin-402L for linux-i3c@lists.infradead.org; Wed, 02 Oct 2024 14:51:08 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nR06q5A3kMQGujjCFnBRQuNNXDVXH+ifM1ZnidTMmNMHVWOxLjPNFkUnsLrJqeDqMOZ3ewoMKjT0j3W0m5B0zHP7vCCHJz5Zb7AsAiUbVCtyXc/SHYcrouTpgWvKdxnes8g8Nr3Am4sY/53+I2JfU//R61odn6T/NPESErKQOHALScwhEYSN3VwvhFfFp39SB7x/wz2WXUKUkpc2wwRQnfWMS5YNMEeJOGpSZGiXTU6VbWHoXTHN4Vskw4HVrbd/udHiSctq05/2V/3ww+JP/gG6r/8tRV6uC1rntC0CRs0yFUG12TFKU04CC51J7nIx4jI4HQCEsUfyBxTevw1RvA== 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=tR98+9LS9quTYVdmJkr0U97KPEN31FgGaNrzukbSyTU=; b=ngAQCtXhEKIN2pKvVBPhD6z4BozYzjiKxtZsAk8tpGpBvCSSQF9dkILp1EH+mWfMWnOiEhB//ZRYCd3In7vtEF5OBFt//HbL2JuseggNWLRRg/FmEZAkT2qAPHrPb1o5Htios2ei7acaUVtr9F9r4RAPrhRdhQU7K9u2dZXjo9yylKCcwn7P7CsJRESPTIAsfF5/B1ifJPS4g5wxWscVZquWHVdi7YNuNujyeRlYTcqWOGwo9tdK5TBTqf1rhBPAQ6CF8aGFdvJASHlANxZwmSlgMaigTkde6vIA/WqAFxcVGUb3CkCATZ/zD/2rmsSQHLo8GHx+MvRBEnSw1zywQQ== 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=tR98+9LS9quTYVdmJkr0U97KPEN31FgGaNrzukbSyTU=; b=dX2GyIFrJmkKFj9e+KCMf+dDujzSDQc/g3RH8Z4qIS5FR63PiGoVODS+wMYCqcV3R6MvF6Avyxcpus9W0Gv47EDC7YaYg0qjjQRlssjvQl0BLMV5Ut/KQ6Xn/fw/2IgHgnLaL6J/rO2dIifT2odGO/ve6WJgKo0HbBdDfromPJO4ALBRhezDQ5q9iUp8mDO4pNNUk9KU/ABPFTzdvwB4MCYxmLjYGhiMfV29xez+HPP/f8D70NZBsj0fDK7RBapjiX7oEDuLcMqLnTiQy7IqcrefwRNEXMcXynKFgpJ3ewm+Z9rz5WbnftBrEJnZNdbYbKeyAp0pBt2QpJRTmfTCkA== 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 AS1PR04MB9699.eurprd04.prod.outlook.com (2603:10a6:20b:482::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.27; Wed, 2 Oct 2024 14:50:58 +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; Wed, 2 Oct 2024 14:50:58 +0000 From: Frank Li Date: Wed, 02 Oct 2024 10:50:35 -0400 Subject: [PATCH v6 3/6] i3c: master: svc: need check IBIWON for dynamic address assignment Message-Id: <20241002-svc-i3c-hj-v6-3-7e6e1d3569ae@nxp.com> References: <20241002-svc-i3c-hj-v6-0-7e6e1d3569ae@nxp.com> In-Reply-To: <20241002-svc-i3c-hj-v6-0-7e6e1d3569ae@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=1727880649; l=1618; i=Frank.Li@nxp.com; s=20240130; h=from:subject:message-id; bh=km8jyYKynVS8oCIdOvA4qQ3oLe8hXP9gLirgD+wv2WM=; b=0/6zj+o5ZrjhO8E6paIbmVG6vIWC79f/0qAGiqEpTKUA6UaeH+V+GT8AZLzdrcqDZpy6QO+jK iBpO642BkxUAHGV4zp4/aIdKEWubL/LXeKK8BdWmtfzQStd89qp0tlv X-Developer-Key: i=Frank.Li@nxp.com; a=ed25519; pk=I0L1sDUfPxpAkRvPKy7MdauTuSENRq+DnA+G4qcS94Q= X-ClientProxiedBy: SJ0PR13CA0177.namprd13.prod.outlook.com (2603:10b6:a03:2c7::32) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AS1PR04MB9699:EE_ X-MS-Office365-Filtering-Correlation-Id: 5c6e1e14-3da9-4524-f278-08dce2f1a065 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|52116014|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+h32W4VXZxLe9k0hUWhB+H3XKhDx9c6?= =?utf-8?q?c8fX/V/pd4jU+SAdZdZCBW3a8DYblnRcqBAIc846h5wY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uZI88?= =?utf-8?q?xYe17XtJVcy+a2rQDWZFVg8MK9x8igWSI1AYyR0JFuZVFRxFgcrhiHSMQHAw80ncY?= =?utf-8?q?ShbEPFkD6Jd4lTBZEwDooh9+C5WHyHocK4ymCy2mnzWFkqZsLhKs4QDCpIkXBqDB6?= =?utf-8?q?S1CV6+JuZxL4Kmo0Ho5rTX1Y7PQjca6jP29Ep6dyUeTVDTpReHGFppLN8U6ha4o5P?= =?utf-8?q?dMo4Z319efIahNVC8H09K5Brr5vwNqqojpeI4xWlyoRgELC4HXD2nV+qH1ajlGa40?= =?utf-8?q?0ou+g0sjwkmGnP6PJfxjktiyKaRJF9JqOl/cLVi23eHKbAyS/uEWzvfW3BXSJ92PR?= =?utf-8?q?Ok3wO/cqD4yi2cRugBtGY479IlviZO4343w=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)(366016)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?PtFgac0qfZJzPRu+z9rmPE/pP9nc?= =?utf-8?q?qNeePDRxPfYY2cwp7DqN76kAAREA6q4dGMMIWX46ozu9vc/FBnmxI4mYXM5roo2e+?= =?utf-8?q?jU6R3fHRwZIe8A1+JEXX+VYDraZgOhvdYgjhw0Jt4QgDst9DsOJbX3GwudTuv/kZP?= =?utf-8?q?ormEksmsu8B+OJjguFKK+GOZpeBn97jgvwJeaXjV2UwfzKsC/NVP5rmdkrORi8dqq?= =?utf-8?q?pho8TharTTaV/KXye7pxxjewzmXobW249KBhP2CV2v4NXKAuLdE7OrXvOY1UL1y7X?= =?utf-8?q?jHInndbWRUX4d/ZYzXqCuEZ/DBV/RKTtApM8mh2HIOqvxMxyIyTUP7OwiCfQoo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YuhMcTcyPD?= =?utf-8?q?rfAV4pGmtuvwxIfZ0NSTkHBIG9I17WZLSTKkDIFpuugO0jJ20ioi+jAB9Kj2bDBGI?= =?utf-8?q?rDQOtbY82ONeuN9OFUO1naJPPc0nPH9d/K8PBgUHmkJZ2D0e6opGlqow4O5FXEQUQ?= =?utf-8?q?ewGWco38DZc0oGguMGM6GNWu3scOp4GzCpRit8AwawZ5+TgufmzokYbKvOAm2yJA7?= =?utf-8?q?JRJsOZdGFr7FbQiszXXiQ4AQDV9X6/FTXiHlR9idXdIh4ssi8WbT0mIsikvz7SN79?= =?utf-8?q?WxjowWMqinfozzl69kYZ44wHEmCTZ0GmGmQHJsfimuDcsTqvRjNDmUyTDMmWMSNxb?= =?utf-8?q?WLqs7mfakwN8?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5c6e1e14-3da9-4524-f278-08dce2f1a065 X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Oct 2024 14:50:58.6696 (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: n24dRHriu/wBjuesMWjXukQn0onb3SG7pSsQaUUeLHRT7JEcjLTA+ecB6fGhTn9p2VCqHuit22u+O5OMuXRTiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS1PR04MB9699 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241002_075107_031618_5BEE456A X-CRM114-Status: GOOD ( 10.82 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org 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 dynamic address assignment. Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Change from v5 to v6 - use 'dynamic address assignment' - add Miquel review tag 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)) {