From patchwork Wed Jan 29 16:22:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13953925 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 ECD83C0218D for ; Wed, 29 Jan 2025 16:23:16 +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:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Cl51yBKmH9HObX8niUM90kUsqq/xbfxCc7Fp6/4VpI8=; b=gpxCDJ4Vi1BgU8 nT8shWPY9VlnHhHyiCWK4/F4w+7aGpE/W57KRxaEggix8XoO4DMQYHygsdxds07dtetfJX+HA1Sls ee+sahcp4nl/vYMqio5CkxDiZ9TFm4lnhypMWSSFH+KcJMQ/yPYCd1pbK381Hyrc4FWYpoI1YynK2 cmlIxtaCZpJRz1gISaSwiUNcuV2kEcUHvGmUHly7smH3EqnUikyal9nHEhlFiUjNsn99Qslw7j8m5 ONJt761l3ZQiZe0/w96S1ZSnBD4YN8Fp6kP5+D0B0O6XkWvWCfM4EsYNm9rdz1xiLz0RXcUtsANCb iX8I3EWV1ObZgGBCBoGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tdAqS-00000007Na2-2xqq; Wed, 29 Jan 2025 16:23:16 +0000 Received: from mail-db8eur05on20602.outbound.protection.outlook.com ([2a01:111:f403:2614::602] helo=EUR05-DB8-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tdAqQ-00000007NZb-2rR8 for linux-i3c@lists.infradead.org; Wed, 29 Jan 2025 16:23:15 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EbRg2XBIhm9guO4Sse6OMdD6Qs+6v0CfjgesKsf6jcCfumqaKWuzlpKVrkIiiti6S0SyzVr2zT6BNwWH23WAVrkCj9kYDq4qzqFYQOvKkwTBrvjrfZHzlX9ifOLQD4P/7xJMi3fB0x9F7rJwhr9xBlZyxnj33hCrLdSbvdVVN3FoBtCt98GuCE9aTKwpgonsd6bG7tIda3MoT7Yi1EV7MsWDxCaId/Oqh6Oy0jye4mw6mI3k7xAnEgO9CrbrZNAW9GGm8TOhK7debljEWIYPLGk51BZJx+OqNDm0rU7Gv2k3OleRPeHvwM4oL70AnDAymoB+Rn2e7c2iMmF7nzCTAw== 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=SNUDJABgwJEjaT/c8sT9SfpPRB7HaRZkD/U3KLFF/u0=; b=jeTkgEJQOaVR2YljOVCf2DtH3L425oRnO1+2KppJuCVo/fSIXfWhaO8Tlf7oGkSuzpCHi0+vyYgLDEuL4pj964F2gx+4kLwweqdQ8e8nGPva1tOxnSmxX9CM7Lj6eGKHPghwZF+PQeNT1MiJlc8UhWM41zwFSLrDv87fl0uTggce134dKBTgvzqOq2iJt1em2ZQeLzuNMmL2FwWKLrdMWnwyPIkUVcUEPZJQhRi6R0NEe37hZUG5EysGq+Y8qsABCKXO9R6HdSqUHBdg+3Y/ahl2rdExHbyL3LRYripSD1MNO1QEzLrrxqLW+KOO8E6Q8boqi14bH/56cxzgkh2tew== 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=SNUDJABgwJEjaT/c8sT9SfpPRB7HaRZkD/U3KLFF/u0=; b=Vog+gY2yyf/DiqRpCuDrzfLSaN252uOyeP/sRNeuhf3in+P6IVVCuNXqz84EgqpyPHT37MgPiDrK/0uTio5jdmgICjJhevvpdxal1sn28v8q9cCxfMBdzPhe2z5IBLOrROHiOwYEOkCTVd9ZlYrTOvH8piqgntflD0+MxYofL54vhmep7Ilf7dXAGGgtptwCg1Cgey3pwRSPaN+ayXfjdrkxRPPGI5M4ZPtfvZi49A21BY5gV1YAuCEtplsxDC3yMCmckoxPOR4KeHlA7knLJxwNlY/wqxSA83us79yFtL/LuQryfF4Nd8KBLGnnY3vUW9ipfovN+3M9z5DErDlpQw== 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 AM9PR04MB8260.eurprd04.prod.outlook.com (2603:10a6:20b:3e6::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8398.18; Wed, 29 Jan 2025 16:23:06 +0000 Received: from PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06]) by PAXPR04MB9642.eurprd04.prod.outlook.com ([fe80::9126:a61e:341d:4b06%5]) with mapi id 15.20.8377.021; Wed, 29 Jan 2025 16:23:05 +0000 From: Frank Li To: Miquel Raynal , Conor Culhane , Alexandre Belloni , linux-i3c@lists.infradead.org (moderated list:SILVACO I3C DUAL-ROLE MASTER), linux-kernel@vger.kernel.org (open list) Cc: imx@lists.linux.dev Subject: [PATCH 1/1] i3c: master: svc: Flush FIFO before sending Dynamic Address Assignment(DAA) Date: Wed, 29 Jan 2025 11:22:50 -0500 Message-Id: <20250129162250.3629189-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: SJ0PR13CA0171.namprd13.prod.outlook.com (2603:10b6:a03:2c7::26) To PAXPR04MB9642.eurprd04.prod.outlook.com (2603:10a6:102:240::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9642:EE_|AM9PR04MB8260:EE_ X-MS-Office365-Filtering-Correlation-Id: 394c4aa6-efc6-47cd-ed34-08dd408135ec X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|52116014|366016|376014|38350700014; X-Microsoft-Antispam-Message-Info: mU/oAglj5zixSEniPUG60dKB95Kt8pRdEwPXuv1Btam2ZX7IL07dvDhOVAWov7Q860+xMj5ni+QStTQsYfjjODbHzptl/S7b0VJY9OD91ClS7nEiMgXlI0oONYXrGUnmLg8QwPinjczPDyBuUsrzXeLgOCeEmOeEk5btUShlu3ku49FqTHjXUIVOusRnxv3Ppfg/S3xsAfURHJDNRBuYh875hVEJoun/DstYUC3WyCzHIykXfZd2RWp/hNiAWCsKIijvJAqKomffwLy7+IF9D6tnlelUuIN6XqSIqdtN9t7Pku6GNaBwqWecNBNI09r8mFRYe+tXELgruFGxJm9g1BI8Rc/iZIBhwvjqX08qjBVdeh3nq8XyMBd5t2AeAg4dgxnJHv1Ju9sYz5ia8MFudGsAa7p/iYLi8CGHRcH2IdkcW5dHEbIshPd9cT6xjDC1r/1Aoke8uymmq+MwWlkuiygEm5baK9rAFxATjn0TAutTlykVrJ7b5b2PL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13230040)(1800799024)(52116014)(366016)(376014)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ehEhsuKSglcNfQP18nhn5sJVBYlgug4IXL3bBWOf7kP4izhGuYKhFthacy7PwGCDjonBa809ziKBnlWpDAzOQFU11mfuhtZF6cHAUiOsb1hgeV6JA3PPPDghikmOwmtAWygLUD6qtQCpzLV7tr57D8S3YtD3trc9fbPMF12TZCjGqcvNUhgMRBusiBXAb6dHzdsHGhPEOf4GqDntI8BhoO9ttm4UTAtvFIWGcWrOID78P3nXH08hCzEcijVou4X983Yr50t4NtDUzlqMouk8jr4HROdfGW7ZsjKwz9awSroxf+OPndSWoLxSXh/aKn3pjE7+lAxiYnqDomCuCXWez2IYTN6M8nWjVX5FBLOrn4o+YrhzBh9cdLRKAYZMGSGe4m3Z7G9Mc6Hk+U4PgmDdHEz0BxFQJ6GCG08D2xIqnYVn2srGLjgnnUzSXev357Av5V136oOKDYyCRet7ghQK2lTcEODhc81guvUA21t50PPY2QOAi0sSXFoU6PgeRid/T/ZIzx9hIPgiukISo/K+jEqhQ5xKupRi0gC48T8rokefWzPQDn/lAU5zqdcFgXFOsil+qZaHWNsQNRZALQtw7eergnHJWfA18i2H77/CNTTC5JQcWo8KNqXkCtBAxE7YQy7lwLts9Te+lvRij/krzx0spiu3eoAkTvALzKLvx8mxEOUUWW7Q4XUjcR7Khv+OA6B7q8IOPMDp75PvYeY0dOvky4FTdF1O6lvhYHRmZ1SIVo43TPIEPsuuZOIup2epF/zXul1KR6ONRf/7AvcD5zfcuNi0FOIgagve7cYSm7zWyYk20JDcJRXEjukbDErrR/xF9Yf+eGVGONoRP13dNnFM88J28plvRXkW5FXKKxqBMlrhkYOajDgLMaSkazi+4mA3LGXAsj1ANNALalPW/a908/88MdVmbXKlnhOpVrEgJWyC8vY9BkpLHs9FdQg07958eM5+/I4UbPUsZCS8pdPQWETptfGqypV4BQv5mNRbr0yshE35mEkAFbsxnE5+WoQPCe4RwOYtzmkDd4g8U1QKBQSTOgX6FEjHqb2yuQqyxDkpUqVt+rmvtCLD6iZiSG201fjxJltKGAK2E+iO6ftgWwEpM7hqBniFyB8HEM89yR28dXO2bER/n19vhP24W9GpuDiYFT8aib81B/tSQR1toVMnKXAn3vjwypgLygxO3Nl7m2do/yl8IrcPFVzXYeQsLxDIvZQoIxUXEMP0pzT35uAz8HWXNBGtoONRHwP5IGIfc8tuaNJO4NJzVmlOSYkL+JonKSJ8q7AKnNDtwGSjzVrN6Xu9Nu4XQRG0Tqe5YkoVmbu+sPp/509pd7lrn6xgZD1FI8SuJsd4oE5YFcW61ENgRLUWvr40nNZV+VQZhO3u/+CLxzQ7dru8pa/FcKJXI/qby3xkJnmbc1I2NtCIX9gNYbU76gYrW2PeTZ79qa/rVrR4GBrJjTcTzIhzsLUFjYyIUDfi41KvwmiyRLYF9eg5yEoY5yOLSsGEbwGZwK/fsc4V06m0K0UAEQMSSSU6EwK9awZDrCwZrFO2F/8BsAWma28GmENtMEvmTiCxmkwYLxPTyzLSh0yJXYGd X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 394c4aa6-efc6-47cd-ed34-08dd408135ec X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jan 2025 16:23:05.9404 (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: WZsyXIeWdxNA6Y7I1dByfwSWQ+MGQP5+JZk5WU18tKZofpk6yX5cHziv/XZnRCNvfWJPNfGj6PpbBrmPMppX9g== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM9PR04MB8260 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250129_082314_722364_BFFBA988 X-CRM114-Status: UNSURE ( 9.18 ) X-CRM114-Notice: Please train this message. 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 Ensure the FIFO is empty before issuing the DAA command to prevent incorrect command data from being sent. Align with other data transfers, such as svc_i3c_master_start_xfer_locked(), which flushes the FIFO before sending a command. Signed-off-by: Frank Li --- Hotplug stress test find a wrong byte send out, this patch can resolve this issue although have not identify which operation cause a byte left in FIFO. --- drivers/i3c/master/svc-i3c-master.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index c1ee3828e7eec..bb660c4dcce56 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -892,6 +892,8 @@ static int svc_i3c_master_do_daa_locked(struct svc_i3c_master *master, u32 reg; int ret, i; + svc_i3c_master_flush_fifo(master); + while (true) { /* clean SVC_I3C_MINT_IBIWON w1c bits */ writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS);