From patchwork Mon Jun 3 15:15:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 13683926 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 83F82C25B75 for ; Mon, 3 Jun 2024 15:30:28 +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=8ynD+gE+IyeWlReDRPsIJtQA2vk9Ehv0wof1Yd3Q0YQ=; b=F3XZiEQC6xvEPK GuG+iRpzkGZD9IGdKHvYrhjr+GvZr6XTy4A+hWXNxKizVkDYqOsRgTcXffKP982H5ZOZhs9LpIGxj 6MwvJEp+MoWjRzmBzJdp+WIyXi+bPPGtEFX9IsTGjxdfc20QpMQqoO9DN2FYJxiJydV6+mMNv5wcz +nvrXoPv0FkaZTLC2OMyZgD/H4QDGQx4VI4eqDuktyo12w10nPTxiK4uAmTD9mkwck4LnzuVxP0d3 Eirb/b0uzBxl0Z5qAHWgbwxwgKV4lYTo02sux6oEHPlce8cIEjVicnGkoMFlsquqMym3AnG8VLUUs I34LTpmH+TlW5yHQeg8g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE9dk-0000000HEdd-15EX; Mon, 03 Jun 2024 15:30:28 +0000 Received: from mail-db3eur04on060b.outbound.protection.outlook.com ([2a01:111:f400:fe0c::60b] helo=EUR04-DB3-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sE9di-0000000HEbk-1tOD for linux-i3c@lists.infradead.org; Mon, 03 Jun 2024 15:30:27 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IwlEvS9542zbUtnpprnYTLnkcMUwPBVmIy+wug58QFPMFpB8W7MicWB70q5Al5Dvr8Ezian4ooDo5IwWcvfJIULFKYcb+3v240umVE60kL+UappFfAMesEdZ2ZaFr4Fsz+kZ4yDgHvUimdQypPfjzSxsXyiyl6/FGxi+ucN9M1ySosC21xWfqUmAGBCnzKBfw7C/lqhgGslMXZKN/zwj8aHh5tYpvlBY2DUlxAT4VAQ1aaHhlSRCu1QkMAvgZjroUpP1t1h0zXLD8CS1eSMrVcaYIsK4suVGoOnNKrbFs8Y7IW3+JTqZiuLJPSB8P+UWSpo5erBeBgCR0Jh760bYSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9wBUPdXHQ6sB8PkOXiw8IMEV06+hIgB2FCJ3VygLSW0=; b=lrYT1MgggAtFnPIKXbSSMLenll0ntWblOKfOoVeQwdAnyaRga4+adgt8XQEtD9S6EAO2t9Gh+zmu9RDbjb/7IFk+1ist6H7ksGRu/A+yzp8SAUypiSYxkkbqzd1+v/RwYPx+K32l7KbuAMiUyQk1zS8O1f+D9PWbSYQeBu7Okln1Z3xcrhkRrn8ThodsqPwMGQ2LYSK/h1tp+H0/fPmeoYymiUBuXEpa/9tpNs/DArydq+WVEmr2Ey84WKDOw5jjmCfsH1ghIrYDEVKs5BCjA4tz4mdiTV+oSQVLUwKUgiCyJheriY9TRJBUmsBgLlb+CxjxsCRKaH02CA4tgzBbqQ== 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=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9wBUPdXHQ6sB8PkOXiw8IMEV06+hIgB2FCJ3VygLSW0=; b=jOLVUtrSneaPXLcYEXyDGCF33zlLnx5ovJgZ8t4eAjR+iJ/aQKSfoF/NyXrv47oZBg6wnxjM0NEAs+uGl/bXyJSezLJ+kOatuV6y/ksl+pP/DV95FTtaDqhxoRRIc6oVCHB2i36B24e4k1JMW3LqCbl5E/dzfGvIK12+j9YzyfI= 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 AS4PR04MB9624.eurprd04.prod.outlook.com (2603:10a6:20b:4ce::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7633.27; Mon, 3 Jun 2024 15:15: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%2]) with mapi id 15.20.7633.021; Mon, 3 Jun 2024 15:15:42 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 1/2] i3c: master: svc: fix IBIWON not set if IBI follow a hot join Date: Mon, 3 Jun 2024 11:15:26 -0400 Message-Id: <20240603151527.52235-1-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 X-ClientProxiedBy: BY3PR04CA0027.namprd04.prod.outlook.com (2603:10b6:a03:217::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_|AS4PR04MB9624:EE_ X-MS-Office365-Filtering-Correlation-Id: 65beb6db-6433-4c17-2530-08dc83e008ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|366007|52116005|1800799015|38350700005; X-Microsoft-Antispam-Message-Info: fGJ3SpU6Fw5n7EL3r0IfJB97kPa/6/X/IQIlQZIKXVeTVh4fdbbtbNtBdxVaz3icv6W/hXNWWl7KDU8wp/CnjrWNvyTuT11QobrN4QJDa7Tj62HtWJmxmdqZUXYYr0Lp2QjjQlkF48ovHR2rbNJpspmqqHPjuTYdWmdmPBC2FTaF7qLEuw2h6zJS5IgpKRF0aAvh2c5KMBcp2lz8kb5gFP1lyZMtVPRpnKb074kwY4tL8421Cd7NI1Q2QWkdzDnrPIRztR+SK1aczXla1DrSbhi5fd3+16eAYuWwD5idA9zDrvs7zrCEFktajwNNWpMq0mRxReDCP4NxrrlXu25L/JS+v8On9i+4lHovMLe1judq5tgOU6y7lm2JoZcubZIv1JVOfgPQ7DiL/jvbkSOXb7ma1Qkl6Qkic94NyRGYcRdmDgg0/OkBKe0YQVD4cI7N8L8mql7SoCvSZMAcrh29lSprfQGbMEztvNVWIvAZ87RzqKoWHbZynBKHDoSkMY1SsxttnbKvWJZ4yAlV1P9XfN6FPxHDNiy+PB7qM6NvTKqGMmv0BQFHUaSVsgA3oJBNOXc3hgxVqEbXioSPtfPkU4mes8Zh3gjLweXnWlLHtC10jfr8TRl22uKeRy3/zn8uzEGL2urpKuHGv+OWBcdVt10AQqQtiUVvDpTpGRwQ8LibXHoO7KEG3YAo0W41Xk7jxMxMwVf/OLmXJlcm68XyGNs5NP1EvdlZ6IHKKleZqAWUx7xlZBNKwbcs+U3+s7AqCy8qJfiaUDPIwNyhDjA9BnoUTEFjPox/XBd9941k2AiAS//C/7UOpuQsmcL7be6J/SoOlwIlhDadF34Q17nL9Qv321iTD1Syyq/qjRmrnpdNSFBvTUnxj4MT5Ngi/D2pXDDVibO68u5xlE+gpsiwNKWPzV3DAlYCqW+55pwOmZ1Ka+RVbfbpz18XNnRsviRHm3g7t4L9w5jhYL5F7+MJrRPTGSkai7MlTxCnEFhDvkQpFhAXerajHfZJkBrTdWlf/RfYKpY/y9Z82vVgQYUPXYP4/GKCObkqLzYVjGr+vYQv+glEAWIj1wlSeH/JrJEKqeOhaRB0e0E5av1sYlt4vw86J3RuH7AEBHmtPwDtyA35kBmGBH1nb6FNc/1ZpJXPpzZ7I+q+Bn9gxK7EPCwIQ6NLdnU6MArE4LiDjMVAG9Dg6sY6EhQKSZvh+hnohTAeA/Iy6DNHkeHrDURbD80awxQwUQrfQUTyI3iBJkdLcR2Jup0GPO0YsLsEhrRt2EDxCSl1G+6rBoFD7EdhEiwYZqKHEJT/OcgJS4omQbGUuecOA7Bra/doJ4G0dAtO9GqYhoq0cqRRRLWrFW1YEXTZZA== 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:(13230031)(376005)(366007)(52116005)(1800799015)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6ht1KAdOVCbZX4ijb2blV0VlxQ4WbketRA1Sn3xAH7jGGKiIHGqfH0binOofdbI/tg3IX6m9Yrnmi/H6POWvP8FSlXRnyIF9/uPAuymq/wejjNts/cqg672r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RaQgD9dB0GSGfRZqBsTJOnvZHszFjLCycNfSCHWZfHfnq4x7VDY6fzKHVC3uvy15AlZ5y9AL7WZLOU6EOSVOoV7e8+W/IFwDi8y/vJI3O0nofeWwNTw+bPlbinbbHdfPhLc/BdGzvVlAbvFgC9f7VJN1N93xh2dv0m89oNsqUxk78zmn+agWw1tGE3PAQ3Yi3f/S+BokCE06+5KkQN7NAaGUyFSEOwnKiHLHA0Z5rv8caqUEInRJChfOiJCvdU+D+Foj3KR0RZH7RIxI7xBlLF90evQvQhmyoZ+AtoO+TEfKCTrkiS0rIcW/GpLrIOTwdlWCEXwN6maQJ4x36cfUyaFbYVvb6/SBFmQgXu97sT++ZLqHh2aZGi523UQ= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 65beb6db-6433-4c17-2530-08dc83e008ea X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9642.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jun 2024 15:15:42.6650 (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: CdgMr5uCYXCTalp4WG/AjxX9fIG8AnUT/IlEcD55AbHMxxivNm/G+8KksOj5ztbO8CALRvc5iKdT5RM6mszhoQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4PR04MB9624 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240603_083026_503463_4C8710AB X-CRM114-Status: GOOD ( 11.50 ) 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 an In-Band Interrupt(IBI) occurs after svc_i3c_master_do_daa_locked(), typically triggered during a Hot Join (HJ) event, the IBIWON flag fails to be set when issuing an auto IBI command. The issue stems from the omission of emitting STOP upon successful execution of svc_i3c_master_do_daa_locked(). Consequently, the controller interprets it as a repeat start when emitting the auto IBI command. Per the I3C specification, an IBI should never occur during a repeat start, thus preventing the IBIWON flag from being set. Emit STOP regardless of the success or failure of svc_i3c_master_do_daa_locked() to match I3C spec requirement. Cc: Fixes: 05b26c31a485 ("i3c: master: svc: add hot join support") Signed-off-by: Frank Li --- Notes: Change from v1 to v2 - update fixes tag drivers/i3c/master/svc-i3c-master.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index bb299ce02cccb..032fe032ec433 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -961,11 +961,11 @@ static int svc_i3c_master_do_daa(struct i3c_master_controller *m) spin_lock_irqsave(&master->xferqueue.lock, flags); ret = svc_i3c_master_do_daa_locked(master, addrs, &dev_nb); spin_unlock_irqrestore(&master->xferqueue.lock, flags); - if (ret) { - svc_i3c_master_emit_stop(master); - svc_i3c_master_clear_merrwarn(master); + + svc_i3c_master_emit_stop(master); + svc_i3c_master_clear_merrwarn(master); + if (ret) goto rpm_out; - } /* Register all devices who participated to the core */ for (i = 0; i < dev_nb; i++) {