From patchwork Thu Oct 19 22:27:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155721 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688037vqb; Thu, 19 Oct 2023 15:28:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGA2B2Tx6u8JMs7w6K4M1C4O3JC/aR6qKx94wlyZg2UTK4g+AzZuIaXYNqfMmqDa+q18RS/ X-Received: by 2002:a17:902:ed13:b0:1ca:ab2b:6a03 with SMTP id b19-20020a170902ed1300b001caab2b6a03mr165390pld.67.1697754494163; Thu, 19 Oct 2023 15:28:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754494; cv=pass; d=google.com; s=arc-20160816; b=bQJstxkhK2E82LmeVYRTHC0zbQ/Z7yII+HfkhjYDGija+HIkaH/A1Z5nOTh/4Jz4Xp ovZNlL4LxGEzet3GEYrGiIqmF+zlwOFsgH1wLb7zG0QPsJWNw4tIbavPef2sbUtspwh/ V/Q/0Ie16sTxLtg5we3aO6x0f8YqPFV3GHrU5HM5PNhE4C1g2ZvPLbEwH/t8yzLNniUt rmNsVO8PzM8b10L6L0KM9365jBgV8ogLDTRI1Wr6WXzV76j/Sc5tNXl9kiZRXvGxbgUH FEYiR9PLUfkrQcxdYBXSn+dtMjcZDu8n4U9TedMqzY6Kfs/Z5/OygzJkzrwP3WLKh0Mk ZqXg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=D6/0l63ENa1rCG9AOCfTVMMHkxQaSAkgSO/Y9e4768s=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=wRYnsG0vz6nl46imDzmmZLaLKade3SgcCtF1Okoib9F/1bgHCLyXmW/yaSUUjEJTX9 2GfPAckttko2iJr4lrHrBMry6LxTYWDcUod+lInxQNa2fpVdRUs4mttXdvhwmGfOkaRq GGcagxMT4zuM1V39dQvo09SqQp01DgQVj2AIeyWABX/NbEZBL/cZw5MVbwPmzlbSQQjl wIjsao9hALLSLvFYsOo0wt9oWcIImWByepOd/+sWT3BHXZNSu3ci7eTlViI5NGvtNk0v pEPDyaoFyPLU19c5U0qcKyTkOoAznp/2fWvhh51QsKjBz0MWDZRXHyMpQNd+P2YCoto2 VZAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bn24Mqv5; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id u11-20020a170902e80b00b001c60c552a66si453120plg.302.2023.10.19.15.28.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=bn24Mqv5; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id EA341836CE43; Thu, 19 Oct 2023 15:28:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346639AbjJSW1v (ORCPT + 26 others); Thu, 19 Oct 2023 18:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232269AbjJSW1s (ORCPT ); Thu, 19 Oct 2023 18:27:48 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F3D3FA for ; Thu, 19 Oct 2023 15:27:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=WjbmLZ4O7YAtvnmhYT/FWwec1B98qrgyNkleF+v0ilcJvx7H6qITTuxtmwuF23qwApSZV9IMFPpVYE/RQJNQNzkeORVIqEfB6lF5IGAHi9EUNDf25xOtgnTEhkerXF1QIujYJBfUsoPd7GNs6hFmu1ZzvNjQYWl8RJ0VyZvF0pmzlHu/Uiz0M8OGdABy/VdjXv7LmD0Lr2F/G3mWD005NEc2mN6NhPTO5vFDtsCmAlcCI+tzhcN3kwtRa3Iec2JMgQw3iRsEUJaIGgYfqQ9nnvgux6p5VPnOyhFiSdkjmx3nE2S7cn3krBcn6orFGov46zk8IX5iA5A8SvxAuYiK2w== 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=D6/0l63ENa1rCG9AOCfTVMMHkxQaSAkgSO/Y9e4768s=; b=APcOd4aL3ucrDzk10wuO3ccAOpl0HFmrTgoUaQGzsph7Fc26X9o7CXmz6MYh2vaYXp/yLhq1xjzgY8JJmslaTssSALIc8XTaGqMx3I9/WOLZf4y/MPF4pq1OFHKoSYmefRxA/hSKq0WFVa3cFQc8UbsN9lB4rfGuyb7pir6/KyP8oN7LIvIvtZ61q7eGTbzgBfHs4DTdyPw0z5H0oOVdWBtojLctsC2d8xTtYQwyuRZK03azlONFAPRDH1urLWMi+RZmtepWAIlMtB+7V6TCPsFLQZbSEzLFs7StiXJdUVwBsWgkTnIubBK/ZAyfm/+tgxbYND7mWvyqATyd/8DoWQ== 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=D6/0l63ENa1rCG9AOCfTVMMHkxQaSAkgSO/Y9e4768s=; b=bn24Mqv5WxV0x6P3+PZDEvu/SyRpBQ1BozyntBWpwvjs2vFVFQzd2cULETiyjmNfgEQO2C19FylJNqxtnkZd49d0nOQ0DJXoMTReKdGzyxB0tKbMMQXzVJAl09RKFLtBcTkPPZ/myxbGlc8tayfOJA1Avo+mGe4sXAHPxoqZC+o= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:44 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:44 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/6] i3c: master: svc: fix race condition in ibi work thread Date: Thu, 19 Oct 2023 18:27:20 -0400 Message-Id: <20231019222725.3598022-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: 3e42faf6-f3a8-4881-0108-08dbd0f29d53 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: J0mW8jbWK7e0Xw225stXJn7vAJGg3bOBJXfxm0RgJcA9/p8yNSaVSwHlnHHHK/D/S1zRkDlO2oz+a+V+eV4hYhki28CxLcNjw0BI0n3NfLdUAzoHIKkqh15cLrcA2kJN6F0/hRr50cQjzkeBiraDPxK07QlOA/Ii5fxRe11nuFkKO2uSHaeD46i5SesQQSzuBxzR8j3jnYTfN5LA10DWShmqC80YNVP3CVn2e9FEirLzKG770bgxRcb5ksANI/lT62Fkqbfn/3wNxdAX0U6jCxRv46GXdNAFHYkFdnWk1OPiiRCQTs14PzAJuQ1cXs+/Gx17ZMvVqJ3EItUrxMVk9JnYDUpo5P0VgbCTdNulFAuE7lion0nzr1RHB8MNJd4saCKEQ1v/c2MbbbPGVSEOydFSKnU7oiHfy1G6LQjQrqOrtF5Dq6YRSeDi8njRFuP271+1Hh75BBC2VjXnabdWWDi8SIKUMApJfmFDqIIR3K6cd7IMCwsjrO+4484ItDFweCANUkHJj4VJfs6J+MPPyeLKqgbxrWvCCcRLjCBubfi+IOZscSxSHcVqkat9H0LoRRAUDED+fWw+Y6pLzfUYgQkQtiG48S4glFuV5z8i6pJkt+jMBgvPIIqZKHejBeqgMmcvoGc2FXib1HZD8x2rqrZiIedWvtFUnQRbxwk+SGo= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: pu9mvWOXUgdVCGcWk0gOOKgSmKtdLUjQMW+xfHXzIJgYd70B7Z0sGumaLv8AaouWsVFwwmEUA4JZbgOeRJCcadOrPN5hwxv23FnpjYhJjHa9rQpbh2BBDc2xV7UY6eUta1ZieYpRyhexd8zCKMyCE+etOcDiorIPdGiaVqt10kvVUCI0AZrPv01qV8Hla1i/tQYz0AAckuRtk8A7FpYffTtHTlL0c/2oGhL8/6ibXZ82naBRUkpv8KAS2W41SjDz5OKA3X3pE617A7KPHcg9eBYMr3X1fLWXYGQRWTrF411sl18hf2hp5EXYsZ4IMC5eKQP5tntxFS6o21Ng0R1C2jdqP1xuxD10I5EyA8+xLFZMh1cWsIhnHiOaSjT7yrcg/I4q0hYS7JcITTgj0znPd+pIKBqYRtuduSZW14Rx7/GYKC8oC43gWTQkuFc2gz/sw7sJntl82Rk2hZMiUNPMKi6UnaKEri1iDHnIvxjmN3h93PuKYaIl9PCdZaTGkwBbnL5bjDNvCGnGdEK5/Xd3dM7vpUjXKFHr22tKHgvN7cjpyKEGgpYQqY9oc2EHWKgvyg3hyoOqElJLXZiJDxrH2f5O+bVm/gpN+ekTKFKG9VUFimGVv2En3AGOcpQO8CtHC821xN+wliX9LN6logVmSNv1TwOOcVtyz84In5Ya7Cl2bwuKTkKDl6lwRejIIAORwO0L55fXVUK1rvqN5DzvwDTAYCFN0NwGbc4w6qw0/dGS7gzsYWeGIfTAEHOys+fGrj5DaYv7/1f5Yx44XuT+rayd8QRYXEpT5n3889ruU9SRGIrrvyCB2cO81yh59NR7kBOA4aGo3oy1Hm/2fXeWjB4rUaFUcokV0MbUlRYx3amBYIgT2cAL/Ga24ODmCPMxGmaevXE28GZc74jnKqAjAN9553922nOUGVUGNZYaFE1bys9MgbjOBklHzUtmIWmsq5DQb0fYn83o0oydKg+4nrlVb0Ra2/g2wfQKJDbcraEOWDn9W2yD2P1nn/B113OBC6DqlNHkOftybF3NC3jkr3l1SCLk03gqpib6Nl09l4tQC37fQIjNrGUNyxaFknzVSO9eLPJ4sNv2iHjOLWXkAq3Ze2Ks50js1zMWDxV9RjwFSI0H1RIFvZgDb5GeeJS3U3IkQUkpmM4EBhgMO/gFH/9MK3mjhSGadsFrFrN9eTzUGYmXU4qqeEVnh/ha36aYzAMZIfNwv3G2egX5hgPC/wxZRSzYiS8ZTVQL733lZFeq1Q+yODFzfmMhdW8CVvhqfY9t7AG17OFvfPavjid6oss/4EWSg1sm9XjseMaAli225Aef98dJlDXjFpnWWHw5kE2xQBldsDkCP/LObXaPni606HQWaDqysT/Yo1ru7yNmqjgazwRmfsmUaMQCEl8wnLEsT9fwReToLoodDeHEHOtqZCGDL3JSLxOXSwH0zmM9kGStCU/hTuR57z/c/C/vHjPu8ZNRFHMT6/9NODrBGBG4u21UuyjFcdpXqJoVbRViuhBAZV4KuwVynGixRJGFJ0GoiLQDcLnDFxZUtKRS/xwgk9blfWG8heDO7V2uxGE= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3e42faf6-f3a8-4881-0108-08dbd0f29d53 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:44.4908 (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: zvE2pkCCJER1Gd8hajOv23G3+cV1h0Lc6WNBXCZFNyoStWnuZLfo5ZeA94J/j/cub1YgY7el7BlQziKBGyIBhA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:03 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224616503172749 X-GMAIL-MSGID: 1780224616503172749 The ibi work thread operates asynchronously with other transfers, such as svc_i3c_master_priv_xfers(). Introduce mutex protection to ensure the completion of the entire i3c/i2c transaction. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Notes: Change from v1 to v2 - update commit message - Add Reviewed-by: Miquel Raynal drivers/i3c/master/svc-i3c-master.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index d29de5fe533e6..8cd708c965085 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -174,6 +174,7 @@ struct svc_i3c_regs_save { * @ibi.slots: Available IBI slots * @ibi.tbq_slot: To be queued IBI slot * @ibi.lock: IBI lock + * @lock: Transfer lock, protect between IBI work thread and callbacks from master */ struct svc_i3c_master { struct i3c_master_controller base; @@ -202,6 +203,7 @@ struct svc_i3c_master { /* Prevent races within IBI handlers */ spinlock_t lock; } ibi; + struct mutex lock; }; /** @@ -383,6 +385,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) u32 status, val; int ret; + mutex_lock(&master->lock); /* Acknowledge the incoming interrupt with the AUTOIBI mechanism */ writel(SVC_I3C_MCTRL_REQUEST_AUTO_IBI | SVC_I3C_MCTRL_IBIRESP_AUTO, @@ -459,6 +462,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) reenable_ibis: svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART); + mutex_unlock(&master->lock); } static irqreturn_t svc_i3c_master_irq_handler(int irq, void *dev_id) @@ -1203,9 +1207,11 @@ static int svc_i3c_master_send_bdcast_ccc_cmd(struct svc_i3c_master *master, cmd->read_len = 0; cmd->continued = false; + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; kfree(buf); @@ -1249,9 +1255,11 @@ static int svc_i3c_master_send_direct_ccc_cmd(struct svc_i3c_master *master, cmd->read_len = read_len; cmd->continued = false; + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); if (cmd->read_len != xfer_len) ccc->dests[0].payload.len = cmd->read_len; @@ -1308,9 +1316,11 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev, cmd->continued = (i + 1) < nxfers; } + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; svc_i3c_master_free_xfer(xfer); @@ -1346,9 +1356,11 @@ static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev, cmd->continued = (i + 1 < nxfers); } + mutex_lock(&master->lock); svc_i3c_master_enqueue_xfer(master, xfer); if (!wait_for_completion_timeout(&xfer->comp, msecs_to_jiffies(1000))) svc_i3c_master_dequeue_xfer(master, xfer); + mutex_unlock(&master->lock); ret = xfer->ret; svc_i3c_master_free_xfer(xfer); @@ -1539,6 +1551,8 @@ static int svc_i3c_master_probe(struct platform_device *pdev) INIT_WORK(&master->hj_work, svc_i3c_master_hj_work); INIT_WORK(&master->ibi_work, svc_i3c_master_ibi_work); + mutex_init(&master->lock); + ret = devm_request_irq(dev, master->irq, svc_i3c_master_irq_handler, IRQF_NO_SUSPEND, "svc-i3c-irq", master); if (ret) From patchwork Thu Oct 19 22:27:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155725 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688262vqb; Thu, 19 Oct 2023 15:28:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEwFIhhQR+z2ki+fKlmUYJhq9MkJ4FoN4ZpLJaeQVWoTHHL/z/OLO50IMutETJDVPykV4a/ X-Received: by 2002:a05:6a20:da87:b0:157:609f:6057 with SMTP id iy7-20020a056a20da8700b00157609f6057mr151528pzb.27.1697754525434; Thu, 19 Oct 2023 15:28:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754525; cv=pass; d=google.com; s=arc-20160816; b=leUC8CSYUpBstVrwLWL7gP35xl1xit9wXiPGDz0Z7pV0bB7FnkqBycEmWx7wG/q/kX BgZ5uFlXFZa/Mgj765bRtWD9+CwcOMiRT5xsfPGTi+Jjr+RCfDgpvVV7SVLgDtBVbalf HGPOHc7owOEc1abU8n1jfpDxMGmjB1x2qxsRHMbb7iPp1/JAvBNCQrSu0FQk/S4l7kE1 tV90bJnLRQwaMMYPJVLiCHQ0JcjJ9TphpvDyEFB6ARecmL0ZQIMi75MXGjV0hrGRrtUu WQ6KbrknVBFJ6udMR1eJLU3NHSxcGV1bdfxaHE55Ndp3aSwd5UJSrO8X8uVVwVexUvdL fTDA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nayoLnZA6AxlXnKCCet/C/KGKXlH5vBlf4Xff954ehM=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=yW+weJIpBdrdkhVd6zX1FerAeparB2mVU4jRYiSWRLDzlGHO64fBXRIG+dDOCcMtK1 bYZy1dj0nSZULvksfMp5H6+O0/RfofFZ/IXA/Cbl8eh4xknKuDKEUdGpY8g4xKR4W78G JFqKfSQIQm+aK6ofXqh9lzQIDTgFNZFv/uYYrhOdW9PdqWx5EqZbsrYrPmVriC8k8pKA /ogF4ticJZyugFOq+kdeG18prsZmla1ZwqNYqh2E7DvAd7FsIit0XCCGJmPcYoZOkMn7 p5Io9FiEurD9hJgv0nppzvTXunZ3z4yh+HzlGrl6v2n3/SoSOodDGiT7h3aduuqW/VKp KnAQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Qron0qZv; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id 10-20020a170902c20a00b001bbcddd6e82si424508pll.91.2023.10.19.15.28.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Qron0qZv; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id A226281E5559; Thu, 19 Oct 2023 15:28:18 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346648AbjJSW1x (ORCPT + 26 others); Thu, 19 Oct 2023 18:27:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346636AbjJSW1u (ORCPT ); Thu, 19 Oct 2023 18:27:50 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2080.outbound.protection.outlook.com [40.107.22.80]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 538EBCA for ; Thu, 19 Oct 2023 15:27:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lv4cDGShXeR/1JmdmgHJ4dEt2oaDEIGFOfPICkkgr2HiiW2jswV25ppOZ4+9ReqfGmJYH4Y0SyXrfecOLWXqJbXnKLbV4qVu+CLfgS5HZWc1NmAki5dyO5AnBIOTr/qTj0t6AV8jCOfFZ3jpq8i6kSBYAvnqBIsZp6i03NUtyv20178b7l4IYA/wsl1ElhOMA5YDlwhKX1SmBzBMRLIJs5xsxijhxabLHlyrTzRatbVqZkSQhuiMFoPMZi7tMK1LBSHwXOAp03nadExsVU+UJEBJbC8CbftNfaekoxCeR20JwiKCUflgQB01rNgitA6C5/OQHGQbDca1y+l/tyNg0g== 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=nayoLnZA6AxlXnKCCet/C/KGKXlH5vBlf4Xff954ehM=; b=iz6226LEgDWXs93yzs8TRrEvKZ1ZQv900LHlhjGL3vSmtEI5MqcR4O0fQUjL6OdOf0E5JsP7TmtyiWOYYURsT9Wry4gckc2iGcp5NiY7W1keBE/QKigLQAesfBSSm3L5eRzuVRExL+gQNqYUVJ8GxHfpf7EHthEqYddoI3iqhCohOO1IfGsteA5sz5LzF+RnHdU4SCCJ64k6aMmolkPhzxTKNut3XpUpOlaK0/zHwXUPBGlinNExx1H21mdKiD3fYLyRTYuv3OiHbV9gIQ4AOoyCS70hSs4A3pXPwojqxBIeSUSB9zQRDtxhMWCUykyvll+u4+8Ka8Mm5+KcTD43sA== 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=nayoLnZA6AxlXnKCCet/C/KGKXlH5vBlf4Xff954ehM=; b=Qron0qZvzh9R9lQ10mbL+NcL3ASOLaXPFXhCutOdPb6Yi5743Jbtwab82SgotNmL5IzjauCxs87mZmSR719v0LWAWsl7BjlPn4rFtKXhybwZvgHb6+f1i6Yk3D7XonKLgK/vm3e+Ou7h7GSpDddKSpcQhRMw2QMZecNkY1vGSU4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:46 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:46 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 2/6] i3c: master: svc: fix wrong data return when IBI happen during start frame Date: Thu, 19 Oct 2023 18:27:21 -0400 Message-Id: <20231019222725.3598022-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: e3b0df36-cc2d-477f-8eca-08dbd0f29ea5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /rHP0is51NSlclkO3cW50Eri7HQoNqkzrrZJEKFKRrtuocnt9IAFlaLzerTFFAV/al+vs9PNyFKIhILf7DIYBhPbgyMlLKeGbXzmajNF88DJXkjyYR9riej1tQqPfnt2kcPYmX7hg7wOqrk2G10iEF7IjfFJ9yI8z7KptK8F9w6aoj1bMyu3mE8D/v5R/XACkpjqnhO2Al9JyPWr8DeSwEVSNpTIhsrMujddeXMlx7gPdaPKi0OlK7tbRMfYSuOCEwCwmo1sCiShKva5UEzlTySeVWV0G2IdxasjFIOWaRUWdVHnFkHh3f6NvlLZhEVys9EBQKizMulXzKbVQwL1TqRGH3/BFfFOMWQbQ79n9vZ6TwbTLKj9vZBmUjUdSti1CMecQY4xQz0VJlpYb8XyKtYtFBfF86Yk8Q409LcGgj3p/lLZ9XZ0eep1/J1rOMv1POntr8fWTNE4fYB3d71lEiWdDpGMUuukDNdzTM/DAygZDJZJBZbWGklxSHxmZXi5p65AqJuAbny/f2uXQi6NZPXblGlKFvvOZwamTjDnAQPVeDQd2O8hYqEnOwu1qHuK1AQt6MuulawyYIvxDfOxd6g8CbICnJ8e9Ft+aFDIOMF33EydA//57oFxFKl610YoyO49gXiaZC7lYuGmz8iWIjzDGZWutQmvXIMj8Vwkv80= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?nuyAePY4bROJEIXmXJI95TjWS8jq?= =?utf-8?q?NW/Bf95x3H8vdz/kW0Bt3Ye1+HNZAdkFG5PiFUKZ01JrIDLElUWS8MlRCQe0ErUUF?= =?utf-8?q?TSVcAkelhJbUzdDvVQ3XkVK6UWCH/SeUOzD1DH/8jRI6XMAnEGh2JOMvys8vb1qR1?= =?utf-8?q?27H5j50z1XuBRNjI+m/Nbq09/rdaIgi/KydT7kbNdMZwrRNJChjzjkoK3MwJ3inMC?= =?utf-8?q?py+j5rEo2QE036Yhgp+2ZRybc/tfokatk9arBhPLfNvzWFJL1QNNKsSSpu9+ICvHn?= =?utf-8?q?cw2Va3objUing2noenFITDOB87R4QIC7acY3qjOmsRticGbipMRbr/NP06C88MMCO?= =?utf-8?q?c/CP9oPRVprvltbmtWA6tQZeKRcskAkY+b+7mVCmKdbBWyrwUIVrPb0Fbmhh/qBsQ?= =?utf-8?q?4r7M++q8TDUVDMTnqCauwkNZoeuNg9YnKWtDWMRSYUjfdeXVGD3MuuYNwoklymMpU?= =?utf-8?q?LGUgYdmI9fE/MwdFzRW8u0xBeXBXEUlCs+Dv6F2ZLzEfMa7Glc8C3bRP1/jIDmVp6?= =?utf-8?q?wQR3nS02vb+AUGGkFUO3b17pwiiLqwRKhFNgZNEbMoJSyGykY4NRfSAhrzRlewxcO?= =?utf-8?q?LiYvaiQ1pq5oMcVPwcwHDHAWgpVKiifm2tKqC1Rov6PvACPOn9twhEpweVsi5Q+8S?= =?utf-8?q?OtxLMIs/HDlb+CzyktsM8y+IPylNHh1/Nd41/0IT50oNTQyRZpbQn/gyAa9Uy5VUn?= =?utf-8?q?3tHMjvzqvk+BHSFvFDYZBXAm7IJdyLzt/RNXZQCI9s5taDAYGBnXBkqkyOJbOEQNm?= =?utf-8?q?cFQGPHDcasMNj3V2QXX7cu6qP0fla3UN+GOnDt96xH7/qO1S8+ZAec6DOR65pSis/?= =?utf-8?q?7D1ByyRmYkpLGJY8OMcKP1W9xIh3HAXcFiqTTB9PkZXJc9mVtwYkoAeq9fIRl2F0K?= =?utf-8?q?o9Ai4r9PenN3NXsIkfHQy/ZADnasCZl7AyuG0RRTnHRxcMf7vqV8uxlsDPKu0cAHA?= =?utf-8?q?DMlyZ+/MyKAK+IK94N+/CLXgElroaR3lbR3IIwr6drSvLxCGQc/9NsOfiOYmRni6z?= =?utf-8?q?YZamRwoDkQxIjT7SzmcIiyKSQIv68RqDC4LxwnTI8igct5QNeWt69yOI/c9jJ+NYc?= =?utf-8?q?X2Kl0QZX+hGCGXbeuPE4rsy9FuR0965meL0AW3TDNw+Lupaj2I2As6l2qyURjmxCY?= =?utf-8?q?9HNqaqc+JgIidmEvw6iIGKyqA3/PXnHH6a/oPW5Q0yXDZRt3sUMIhfmCh2Xy988gq?= =?utf-8?q?e6To2NaErj7M05bKcqLgcMG8jR1IZ/A9eI5rEr2PXroA6mnZnnXt9ExjT6boIl5C7?= =?utf-8?q?op+5lIEAdqs7WG1rYkGH8xajXllHdz9NyzEY2g78WeTgj9+fzsofSmtS5YE2TV0+M?= =?utf-8?q?SoS5DAigWi4wEWKsHeRgTfmK7zlP9faBFtdSpL8STItbZV58aJX3BlqHp5Xas89cn?= =?utf-8?q?lF3JrZup35UqcLKh1Bo9rpejEMu1blxDTZ2YgyCzg/ZXJ1xBJ6HGKi0ijgrJJ69a+?= =?utf-8?q?dvOFr+f9Y+b4+wMYdLY6UHHKOrTdND/y/KAW1x/CBMLY1ReTmPOXwu8k=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: e3b0df36-cc2d-477f-8eca-08dbd0f29ea5 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:46.6967 (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: UjWOuI190NzS7D4LU06fTE+PcM4B2/M2KE1OyCW32WX+PrrxRmTAWWf65gJJeTK8T0vROiMQ2PRVDkh4cTEw5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224649324381909 X-GMAIL-MSGID: 1780224649324381909 ┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌───── SCL: ┘ └─────┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┘ ───┐ ┌─────┐ ┌─────┐ ┌───────────┐ SDA: └───────────────────────┘ └─────┘ └─────┘ └───── xxx╱ ╲╱ ╲╱ ╲╱ ╲╱ ╲ : xxx╲IBI ╱╲ Addr(0x0a) ╱╲ RW ╱╲NACK╱╲ S ╱ If an In-Band Interrupt (IBI) occurs and IBI work thread is not immediately scheduled, When svc_i3c_master_priv_xfers() initiates the I3C transfer and attempts to send address 0x7e, the target interprets it as an IBI handler and returns the target address 0x0a. However, svc_i3c_master_priv_xfers() does not handle this case and proceeds with other transfers, resulting in incorrect data being returned. Add IBIWON check in svc_i3c_master_xfer(). In case this situation occurs, return a failure to the driver. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Notes: Change from v1 to v2 - update commit message - fix typo yeild and falure drivers/i3c/master/svc-i3c-master.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 8cd708c965085..abebef666b2bb 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1010,6 +1010,9 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, u32 reg; int ret; + /* clean SVC_I3C_MINT_IBIWON w1c bits */ + writel(SVC_I3C_MINT_IBIWON, master->regs + SVC_I3C_MSTATUS); + writel(SVC_I3C_MCTRL_REQUEST_START_ADDR | xfer_type | SVC_I3C_MCTRL_IBIRESP_NACK | @@ -1028,6 +1031,23 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, goto emit_stop; } + /* + * According to I3C spec ver 1.1.1, 5.1.2.2.3 Consequence of Controller Starting a Frame + * with I3C Target Address. + * + * The I3C Controller normally should start a Frame, the Address may be arbitrated, and so + * the Controller shall monitor to see whether an In-Band Interrupt request, a Controller + * Role Request (i.e., Secondary Controller requests to become the Active Controller), or + * a Hot-Join Request has been made. + * + * If missed IBIWON check, the wrong data will be return. When IBIWON happen, return failure + * and yield the above events handler. + */ + if (SVC_I3C_MSTATUS_IBIWON(reg)) { + ret = -ENXIO; + goto emit_stop; + } + if (rnw) ret = svc_i3c_master_read(master, in, xfer_len); else From patchwork Thu Oct 19 22:27:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155723 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688195vqb; Thu, 19 Oct 2023 15:28:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHBUralON7nzjsr3rsBSMF//500ViMzVuVq3EegnSzr+Ktd1tUubQxCxgscZ6q9w7/U5KxW X-Received: by 2002:a17:90a:31c:b0:27d:68e1:c3d6 with SMTP id 28-20020a17090a031c00b0027d68e1c3d6mr196900pje.28.1697754513772; Thu, 19 Oct 2023 15:28:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754513; cv=pass; d=google.com; s=arc-20160816; b=C0BswmZ/twiWangGmEBIK4Gn+kJmXZiPoeykII8+bOz3Ks5/sS4a3ZGnNBtQ21JtjK MpLul76ivbuLahIogi0vaJpmH1iAolHyLa72Dd9RvrhBxn5h5VD4mnfla0/UJTdYaBER nWgN6TcVt8sP3cAkXakLWN5M8ddiwaV9bLcUIJh7ZwRKndqdnjTP+d88gFULbvfAuum+ jeFwkxDUxecZH3o6XNMBX+zHzhu4w9NjHK+fk3PAqQ6QIdDA3sMtCQMJnzj4wxpoZHrA ksYL6W3h9ur5xjz1bbU15LpDwY+FZ3KKsoubBKwdqva3ahR7rNF9gaDRp3j/qCrOEWZN xZQQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gaaZQlXiW7kkseAwbfTJKJ8ZOrlWG/SQe5iwfmixt5k=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=orpjOVqTGRIeDCLF8vPi7EabELPxqiRxhRr/iF9463Vo7CJsm/KhEXN6hCgope9LQ8 kZr5ekls9ooP1xoqDxOUPmUdPSHw90dcips+TkYcdqxJX9L5Bla6XRNHipGiv9UEbzSe UeIH918nNfWZtOG+VU1Tb+lxPmnj9z+ARpSF71J8DZKEBiBLdbAJgTSsKJsrOsax32Rv Q83buC+9tvGwUZl+1iYKoczIbYgCCN1Zo5W2utyRSz3gnwl9fE37wxwvuMG5sNV449xc ThKuwtqSA2CqNs8mCfV8QolKpYtCTRMAQ/d1q1BmG5SAOe48olG6pZSnHWfHWPLmbCw0 pPiA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=jmzsJVZw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id 6-20020a17090a030600b00274d3f62044si551428pje.111.2023.10.19.15.28.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=jmzsJVZw; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id D23218274AF0; Thu, 19 Oct 2023 15:28:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346658AbjJSW14 (ORCPT + 26 others); Thu, 19 Oct 2023 18:27:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346644AbjJSW1x (ORCPT ); Thu, 19 Oct 2023 18:27:53 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E947CA for ; Thu, 19 Oct 2023 15:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=P4nPIyTpL6vRNo2Y8YKMwXTmAuODuCsK1o9fzmDLscEEZ7/2jReIcZjlSlWy9eOiE0HZwRDLkqeZveH3jwgh0kD8fCM2/4mrlBDWiCE7gizJjEaF41h3A0+CLwUdlJP7216CQlmVc6RMYOffF0mmP1O568NCuSZSJafsGJYlExiLZ/Dqyxn3u6ap1HJ2D3RNAXbPubUKQzgb99lE+HU9Vg1nPXr7pMhlrWTbIQ34W4Vvh5P87DVGpX+cPKVVm9UrpfK3uNYt8weiA96U1cLl7Hkgiui+SgKwGoDtpOCAzDFiBuWK+CYntXdrMkOO5X+gd+adXzBiV9cDinL+ik3ugQ== 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=gaaZQlXiW7kkseAwbfTJKJ8ZOrlWG/SQe5iwfmixt5k=; b=mwg600T4Kj/zxFtOijBoxOv9kNcHd63xsJJDKYm9q5+Igfh05w6ntcjt59WpSZXWtdWOYJPldn67NCR/XbrSZp9wwiDFqC8i/s8AaB82oDQSy/Uq2ZGKNs964fspXoJrXn2dlyIMJqOrzcM92BbTsIQyGEjGWRSwTgX12DZKe1QrRuvTqYIiUcHqEy5xsgbIONEHUCKmESnuw879cnGViO6Wadz6VqW5Tu68De0SChB00Ab81aVqKFDkoalBJvaPa9kLlf8sgfXARV59GBV0E0XQTA6LuzQaabbbdA8PgRHmQXs2iRRMHoicTrrbafUDUTbpYwu8fP2k2s7IMzgntg== 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=gaaZQlXiW7kkseAwbfTJKJ8ZOrlWG/SQe5iwfmixt5k=; b=jmzsJVZwcY0ck00JSHY8yKuue9tROLhTp/8KbuGIwI1xOw0kF/aTMDo4ALVRUFsXVFsZtmRueJPsCJIGCAFkqbdGxn0pmljVb3ae6hl51vzbfBENkuB4wqRENYKivE4u2C34TVS8U4JbZmYNytNachgruIhlB/2gM2SnS4kR9e0= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:48 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:48 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 3/6] i3c: master: svc: fix ibi may not return mandatory data byte Date: Thu, 19 Oct 2023 18:27:22 -0400 Message-Id: <20231019222725.3598022-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: 115c6ed1-1266-4c36-9333-08dbd0f29fee X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M2cYcjdrFfsAj4hiBkXqd3HO5ayqP2CdB9/CAbOwZmfdT1R0N7SveyF75QY5Rfedmll6aJArFhjSYyUNBWiuHspUIBsKJSfIht5NhtEU6okbQbsSzAbcud31hRZ9mboK6YU1a815quzYSFu4TW7qzPhrarpMtpoKcOpJsJEAu+PFutJSN/uAg+lNCbDqaJaMHZtbZ9VO45f79lqZaYyXBAMBi6LaWC74erTNX3iEe9IWUyLoJZKiJCPMycUwGBxINN526SsH73w3ZIsidHKAlpKbjQsN9Th9SRBuiqI1se7pLtwaPNN3HmofKmJvPRgdH2slVdGLJD5ZRG2tQZXPILCA2PJiZ37mUc9nxMQVWgGrrePKxsehfYxBeTrXCdIHYZ/WUo9GkWJ++lEhfKy4cBJ/A9v1p6+3yn/0EDBLzSj335nVxz36KxbHVqSghIq039DdLf074spbXulHDEQP0xJxZXrGKnUoBfQqeMQUbZoOQevv2y4H1nL82EcCWYMT65PJVzl0rYRzj4ZforAmEhoQRV5eqnRKBwJ9Mhb9OQeKcSC7IzDvnnThKgLT/46kdgLFObsRNLCosH6+xmDLGAHLSJGeahbSMUnLi7OZIr2BJWC6acUEnciyPWJxsr737WP7OJNvLVe5PW/S6VxSF+T0a/EEG1fk20z0HAk051U= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: DLR0ZEAy7inq/tfBOC13tKchDd4vxokzqAdbfDuOrVdusaWrNzlWWjyLdaksc7kivxlKDktE7FqlLb1kPUKLnJasi2TeVSmO8/i2IayGKdirL/ZpPRDiR+7vxAWC57mOOPvp5V1//9vEVvTtERhQi0FqFvrBKxvr2Im1XDGtjoa0UcxdxTbLXAWEULsVizRaiH6dFa4d8jCYdDz5EO+3MacTyuJvTmn5eAE+488lDmVaJdlnRIfcmibec5MNPFnRqUTOahkEgOUK2u0CEazjWi1B6pfHChpMTRGWLWlCRLbE2SjCfC1M5L4hkcGVfDuPkQYsEsj/HkoTVudYvF61Z2hGcUigdzoNcbwBIAKbCGgA5llMyjSRKk+wln86Gxfq9oml0c8TMNIprZmjXEhqbIVhjeygTDZBIJ+uRxOEQiMEY7CEFC+gCVnqQ60k/PU4G4A6SoS4TSEc1UnNcF8EsIe9eWgS/bIo3NmUyGXVrKZSL8KzSpPJMhp2haAoeVrVl+Z3ubJ0vdYHLAgK8/4fhdhSfRtZaK1HwRTqsnFj2fdzEx/wq99/rJNnKkwTQcxjnGJfF6FSpP6PRsw7uQAucOekvMuA4HFgMZoMxrrMpiLAjcTtB2HPbQTUZM7AVwW22I8qWTtTXc2o+udZtpZ0XBD1fGgXv+uZ/WwhO65Ny8/qs3Dwk8HpABE32dXwjhtCP/N8FPBp2kH8lXW/K1M2r5MYu8WaPJjt5BtOiqCVqrU9any2/FIXi3/DrBoIj/TC/D83c1617CqIp2N+A6KX9IY8g24KLPEgq2M2XxXAuQjDYVkaAyxAsNgZbLUGOt57Iy/SL6/U5tl1Yh3sAJJhNmogQKx+m/r3GmNQ/WoLH39pq2+s2lnj23fCfHqk8BFxfxacSOZl6Ixy1jiH6Qmf4/Ee6Ow7FfNQnZ56jOhPCrtp9AQApDV8WZvOCRzlQtreXVqEkCp7zaN+A4T3tP8oRvaHPirANLJ9485Yatf67g3TbD91qTGtGJZRt7KPBhsd83zG55Z3NaLLLYDEV6iaJnkLZMlGXCGp2DWM5wAtO32WjCLrnJWf7xnieMLrqQCaw7ORKz8E1rBisEAGuIcIABc7R9hk9qFRT3xXB35lfT4Ji8mlwjiZloLNVUFZiZuHTFORUcj5oCxefyxcyskQpTUxG/RfN+yXYzSD7Jo+pTt34XqRaSIDscfOLXUmlUuXCXmeurSMGmaPB447NkFnr4nEueAHKMi64y/BRr/o2TFk/Zbw+3OcdsYMenCNLkicadDzU4j/TktYk9btBqVTpHyGIdvOGRgoBYHcgcq8TZVghxel0YaasJBeOG5TnH/KF5qllxMO6HI7x/bG42O5AbMrT5cebFUBXaqqf/M5lHpBeA5mlBwecdRm9ZHUuGr7/CtNUlKLbOcqGRC2BAQSzb/XtL+4OGk0qTWaaUrLtBQO7HraYoilElq5+qshBLs4KJkof7SSvhLTLSSAK+guVT3XEMRrg8YW0xTPy6gP3DISxK5F2okJunHQKRlsaVXInEPS7BNMQSXIk9CKZAv8XMvtwN7HdkcOdlZooih75mw= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 115c6ed1-1266-4c36-9333-08dbd0f29fee X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:48.8230 (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: 7d0qLjDjdqwt1obCtePu8p7W17LBtjxdvZFxvQgo23yrMvC/iGNiJsaT8e+5PMpnhtF32UvIp4n/pyvZBNWUvQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:07 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224637087274750 X-GMAIL-MSGID: 1780224637087274750 MSTATUS[RXPEND] is only updated after the data transfer cycle started. This creates an issue when the I3C clock is slow, and the CPU is running fast enough that MSTATUS[RXPEND] may not be updated when the code reaches checking point. As a result, mandatory data can be missed. Add a wait for MSTATUS[COMPLETE] to ensure that all mandatory data is already in FIFO. It also works without mandatory data. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- Notes: Change from v2 to v3 - update commit message and add no mandatory data in commits message Change from v1 to v2 - update commit message it also works without mandatory bytes Change from v1 to v2 - update commit message it also works without mandatory bytes drivers/i3c/master/svc-i3c-master.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index abebef666b2bb..dd06b7c9333f1 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -332,6 +332,7 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, struct i3c_ibi_slot *slot; unsigned int count; u32 mdatactrl; + int ret, val; u8 *buf; slot = i3c_generic_ibi_get_free_slot(data->ibi_pool); @@ -341,6 +342,13 @@ static int svc_i3c_master_handle_ibi(struct svc_i3c_master *master, slot->len = 0; buf = slot->data; + ret = readl_relaxed_poll_timeout(master->regs + SVC_I3C_MSTATUS, val, + SVC_I3C_MSTATUS_COMPLETE(val), 0, 1000); + if (ret) { + dev_err(master->dev, "Timeout when polling for COMPLETE\n"); + return ret; + } + while (SVC_I3C_MSTATUS_RXPEND(readl(master->regs + SVC_I3C_MSTATUS)) && slot->len < SVC_I3C_FIFO_SIZE) { mdatactrl = readl(master->regs + SVC_I3C_MDATACTRL); From patchwork Thu Oct 19 22:27:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155726 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688283vqb; Thu, 19 Oct 2023 15:28:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFzZPOFCuI3DO+wEyKpnQ5FaDXLkpUQ8+/Q/qQ9OJPnJA9jBVff4C/Buf+uZYdt3Bz2nrLb X-Received: by 2002:a17:903:1246:b0:1c5:b855:38f with SMTP id u6-20020a170903124600b001c5b855038fmr233944plh.24.1697754527395; Thu, 19 Oct 2023 15:28:47 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754527; cv=pass; d=google.com; s=arc-20160816; b=HAugJYWUkfD0ei9ctESBTEYNnpqWh2Rr3/sSplgC+0dy4Y6ftz0JvJo55JpbcHGvWc 4P3FCol9JmcAfHUtwtyhCr+vAQKabYW1HWh6RfysyrLSZxzx7olNZkSnSiaN2s9AofEA 0VVkC3OkrniN2GEAoIT8vRccPoOcRHW7q1yk0elrfkGyDKjPsWgzMtW3lMjZo/IpX2wp K0qfozLSQYuAzgbDPosghQ9D3H4OjqC7IW7FAg9KiV5/L9Axe5K7/q7yiWJP2nWKwOEC 8xBpT6ppOk9mLqJZDFQKmFiHhwC1pn+NvCQjKETSNPD84vwSa9kJQP2EIFdaY+9mnkG6 y++g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ghMi/AjqmeuflsZPjowu1AoqUyQlM4/JO+IAd05K8m8=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=ziswejnfN6L51DOl5qu/qY7r0EXFdiKrT/nTocecPHHjfhkCL4iXQvS/wbPTZwq51M TwqmuPol651Wqo+G4x7eYtNLPefotv893C0zWZRmqweLAyUW3Sj1X1+9rRUMP4FmRtMQ C7etUzfyqe35RLc75OO5riL8kWhujLG89f/eB6FMuET3aEU+u8HvTXFTCCAxev8fI8Tp kJ1fpHeHeHtBjTN9BqCMz+8PhaNrMTGSO8ww4LE+h2hrNKd2n6fj6kkw4Aw6Ogyvl8Ii 16M1iItvFIj9OYPMqiHPCnjQmcrGt9uByiMQ858JV9kHzlC805VpAkKA4u48DuSrLyHN nXJw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Tdiaah2y; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id d12-20020a170902cecc00b001b9ffda162csi450356plg.441.2023.10.19.15.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Tdiaah2y; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 7BB39836CE46; Thu, 19 Oct 2023 15:28:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346653AbjJSW15 (ORCPT + 26 others); Thu, 19 Oct 2023 18:27:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346636AbjJSW1y (ORCPT ); Thu, 19 Oct 2023 18:27:54 -0400 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2071.outbound.protection.outlook.com [40.107.22.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 810B9112 for ; Thu, 19 Oct 2023 15:27:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iKbOHy+o3VwCdz6G4CPqj3/ZEtGhNBkThMsBR+FKR0du7EAlHuy5O4GpUVujI3wXVYxDmrasfWD415z2SJvDFJAqN9yjdz8l3OSQExOVT7jcHxdI5QLEZQfSjsusszAnFVsYqSDYxqkswcVlxqglLj9cQw/+EXXirZnfyHVlNV6vzauSbMs3yAaYyQok0NntIyVmrCqawASPa7lTCOkqD17vzVwzuhfHrA7X05Uve58j8F/lLci33zos8C5/iZIc/IbVFwZyYHkXY9PUavYrot5moCl/3yjF+XdOc+iAqfbwVw5iFYTtBPDF+CP1/o/iuevPWJoVtnTvnYVdhnhj1g== 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=ghMi/AjqmeuflsZPjowu1AoqUyQlM4/JO+IAd05K8m8=; b=LKa+Q+cIBBI4VOo8n+jXBuDCCEvgPX1ZxIym0ZI5GnpDKGn1FnhOoD9K2GFX4gvmjdOref1UVOM73i9owLZM84Qi5N/oxyWYre+Uu5qD0CoZXZwfbBtIy/Gmq280/kX9+UsboVOdAM1XFAg7hqnJac9IyH1OI2qGZuckG2ycEvwLC+uJ8PI2yittoxIxxNIDok6dAkq5Z7UPLupjRjVap0IhAYwX2J4SlPs/6PyOd4eD8NVPcvg4eRwPPrPScF13fzrRxSx6O/UNhLLAFVa4pffAdcod5AcfVClkN0iz4+VmXSYMo6iXr1Yg7VDxmZVHSXn5YQSrJ9vLib7Sx/TOCg== 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=ghMi/AjqmeuflsZPjowu1AoqUyQlM4/JO+IAd05K8m8=; b=Tdiaah2yXz74YD/N5Cqwi/OB+DLbE472SGwRW8G4DBK5bCdefMFZNIzyq6ClRpeRbrsbYkoy9w9wWSVxbYsSCRUc4Ouzxk0enJTQ6BnzXEl1PxJB0dCmI+tdFCP1AxhoQoYp62LiJ4A6CewYl/GNMQkq98/gLOac+GaYtI/atKA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:51 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:51 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 4/6] i3c: master: svc: fix check wrong status register in irq handler Date: Thu, 19 Oct 2023 18:27:23 -0400 Message-Id: <20231019222725.3598022-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: b8d65c76-b00d-4f54-353f-08dbd0f2a135 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTZ6lEItdrFHmEZu+5m6mBF8BlYcmFPwlP3p9xc+cyzpL3T6Dnr7OcS2BGB30+fB+LExQ02+iSHqcSSCD9BgVjZqH/yZ3qfP0tHLtG/wkj1SqkkAzV97ih5gTlTPQsNVJ0KO2dZNeX4f3yl+5jBx3jErA8IOzjJdgYTdtVkrJtTVC87DL11gnriEiFECQqPW7MxpCf/ZsiCefFvdYFbpBP40lpV6X9g96+vGgfOl9NeJCCIIIPkP/FW4MAJUfRlfCSOqnXvof6PFMCSIMnKatYJRcl/luSZEZnhPAyVmkZ4LpMRSaWTlCCsS078135h80CMohdKzrUVTa234fr/R6rX2N3yT0mGFOTKY4xDKPTn5pXDU8RGqnuAO8OlJ44xQktw1rGWywIgLzL80EyhqgJs2opOI1rCvS6n7RAqqYCgF4n/DD3JrUH5CPnvOc/3zspqv8wjOEesZED6wyFK9mbnryrHoqamrO96RP6mmBczE34Wrfg9AIJeR83rLCzGvSKA5WP8AuFtSleYGyCPKH9tn8D4HkKM5r5mWcf7xgRl7n17yHynNd6evseq86e2pi8iCbAXTCLouzL6YkQ846tRBDmicQsBNFKqVJRkRzdWP/xYGijMqyF4lbsQwCFSxemSdm//+I5/8mrVElfc/EhB3Ms+x1MYnCkUtqXxHWR0= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: g3RXzKyWyGbdomcsJaPgK+NIvibljavZG3h0HhdHuMb8YN4Hk9tSpuLmPin3e1Vycs+dW/ZHC2AmX+/yTHTJw5m/hmt+SejgDn4Xb5CKqi9XZrlhw3jyYTJkmfUJdnq7fsPP1kVK10AbC1/+iwWr/Gl8npp8I+skjWwFA33UBf4THLaGkb8pdADWZqWtdwJm7pQYVgqaQD867FdW8KaMWHa54r+n3VmLZYG2Q1/gMRQw9O93hGi4LBL0n4hUPOhZip4LX1n+ywEBxvjaON3805aZVUBsR5zYmCnT6JlYxxXBegSICZl6NzKjow+du83dAy04FS0HNq217KJ3+7sVe1VI9koO9zFo4ZZGtp1XkdTMCzPftgG/LQ+2j1ILq7F4gCr8G2rtLUiiWden4Y48gi4KRHItAJ+7kqBDwk14oiNsh8rNJ5rXGKuYLC/F8bD1wpovzs0YnlcErm47/UeOgeWjcH2C8cNc8u88n9h4YZW8sY38Sm/kWAwkRzkvIzMkkZS8CpVgAjPSYHx+IwLc2Ok+two3+/CcgsEdQyoY4B+tJQVJhdw2TxXjnPWwvWQZZ7AcCVfSjxGnbuMDNCgn0dXobwhq15fB2XreTwwj+1mURTwGqtuI2nw6nLKZiMkyoJMz9jCH677BNv5c3T3MNIXpIz6xhY6SovRtSGD9QQk5mApHrnkvyeJgoTZoIWNwTHudZeQwu+X4CcEYah4kOlWSOPqEXmf6OLU2bk3ofrnumCm+UEjb2pp2Vsw52BCpQV4OmbYQI6wnIIlZTKduTUTczhcqoBIWVNYBuPbnvFYGDXZIKL+l0oeS1zEtVd/TlrISzLog0o0seXlGvkb+tSgqJmM/wBspXyShBDRjUOt6VuLlLMJOa4VcTfVmd0BE4YBjmdehs9A8pHWbHblHzxpPtjLPXjyDmqTcNfu3pRfGAxvbcv/6/7S3viOgD3qLm/7vrDYPQlax4zuacfSFM+2XxYUUrogaWso8gAUXFtNxBP9tsCd7wdjMRqZROrJ4K9m/gNJFLDYyI/2/4HHsHm6hLCd/26jC1IHYgtruzEJxm3ZjLEhA5P/epNdMtXeIjICQooyVU3y2y/oaJfLfvPdIo8tZ4DsUjJ6qFq5+RP2huaVr7xTX3V01rZ7OqY8qNsCNp0wVFS3N0DUFaa7th3o1wAxxWNzjV+re0HSz6k3UcI7d3LcKAVKRLeLCJKC6qmOvkKwEHGiXB+b8Nl4cTp41S7riB0kLBIlFuCH6ECeAcc0P8Wuz5NGiCyxC2hh0Gzz/mhbHRjBRQWIAKSEVSZLFRdKC9ogSE7u9ZjNS9axdLkEdBBtLDUrTDwUkkCM8Iac5mw6RaOsU1Py7ztaMhO53MQQ6m5+19h8J9BDH8h7kLFjI6tLFjpj/mrXYXJ23DtcH3G+Gb5hOuu01f4e0ZjAbbzgWTqNbvSdgIdu9AbiZ+8GyruCu4+dwZEGaafyAeiy1zunB8J/9aJTBjuzaxogN4pmd2sAhWQmgvi7MPUzqv7FUsmtsU3w915e8uGVdM/WFe55BG2ePHFl7BhSp0c5dCtdyz75lZ8JgKq6cFRTWZbzFnSIMOJu6uBUnzDBi X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8d65c76-b00d-4f54-353f-08dbd0f2a135 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:51.1204 (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: AA2YbLLQv4FwuwezwivnpX1Hl7M34lta86SY/+4Au/KRK4VYkBikaVI0PZdqg6lhjUAtsol6+PaXOiyB9zKDxw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:22 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224651676645588 X-GMAIL-MSGID: 1780224651676645588 svc_i3c_master_irq_handler() wrong check register SVC_I3C_MINTMASKED. It should be SVC_I3C_MSTATUS. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Notes: Change from v1 to v2 - Add Reviewed-by: Miquel Raynal drivers/i3c/master/svc-i3c-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index dd06b7c9333f1..b113460f059c3 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -476,7 +476,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) static irqreturn_t svc_i3c_master_irq_handler(int irq, void *dev_id) { struct svc_i3c_master *master = (struct svc_i3c_master *)dev_id; - u32 active = readl(master->regs + SVC_I3C_MINTMASKED); + u32 active = readl(master->regs + SVC_I3C_MSTATUS); if (!SVC_I3C_MSTATUS_SLVSTART(active)) return IRQ_NONE; From patchwork Thu Oct 19 22:27:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155722 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688198vqb; Thu, 19 Oct 2023 15:28:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG/CjiCoWc577L5Zdrfxa2JC5828QHarlF5jjO1w1jxkk6Tn2V80O9cXsdAkg6VXxEB6mpq X-Received: by 2002:a17:902:facb:b0:1ca:85ae:3b59 with SMTP id ld11-20020a170902facb00b001ca85ae3b59mr289222plb.9.1697754513950; Thu, 19 Oct 2023 15:28:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754513; cv=pass; d=google.com; s=arc-20160816; b=EO92y02ktCnxR/Lis0+EzCwhVu19GxIQUNper43r2GP0eDQZYTwiW5mr2Su8LRsSEn bVJEsDLB+pelzMWcYogXvl8P8qBykl9B6VDxaRU+yH9hnWeQ5OJbeMZ7zOjV7WV48+HH 3/ykbJdetES5c44f6vvRwE2GGIyz1NodxKGRSIQGgjjzmR/OYmI8E8Tkalei0Y4QwB2A UlAPOO85HJN6WxHXy8F8oV7GUCynI4lvYhducofSfPwndsQssBNHnBgmOldggpT4tTmx X76ZV3QpfU5FBb9AKl1RwlMxdr29DuCGI8LqG5xczpF/FdjBwrb7bV6g83is9MCDJFPc vtjw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=B1zxEdHosjsiGCuea9j4jS7nMFZLaSVEQbKLdH8s5qY=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=J5bQa8kBc5ICk9W7/3i6woXCzLofdcRHzw27y8jelSApiF9PQdhcJfL8td9E/NTYpH 98+yTcgWmeaULxfB4w5c1GUGxlvjOerjgkVhVf+5g/W6K2LIUawy9MZyi6OdX+qUyJTx GoxVdm1j/DD+RdykJ59N+IUApE/3s5AoMmuZQyrAhEXJa3w6g97S+Zv3smHk2BJpJQVc DyDTZ9vN51sLUPpGEm97CGZiGT6RRB0dMMBUjaX6PJpb6d6u9y6lJE+ZOk7BYce5lB3O h0cH09ugfaNnh2qrcIlSlhICq7mZKt5s0lj2fjbsLVpDFWS02lH3UbfSowzh2Z2Nzrac 5LNQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rW9ekDCU; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id w2-20020a1709029a8200b001c3e98a0d79si394870plp.401.2023.10.19.15.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rW9ekDCU; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 5FB088274AD9; Thu, 19 Oct 2023 15:28:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346672AbjJSW2I (ORCPT + 26 others); Thu, 19 Oct 2023 18:28:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235549AbjJSW2E (ORCPT ); Thu, 19 Oct 2023 18:28:04 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2089.outbound.protection.outlook.com [40.107.7.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53C0ACA for ; Thu, 19 Oct 2023 15:27:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hi5eWBuv64A0+TjRYvqrpy0xsMI1Fl/Y2L7kAS0scTyLQsCVmJxo0bKAWgoyCUmLAk/DfgrLrrHMVZGaTp5h1goiAV9j0Ww2ylFbjzlwuJnoPnhUs6F8tme8ZC459pVyEcPdswa6YIDsCPa2oD1OVJQzZMbPNjOfkxjZVcxAXbBzZ4hPsDizqcvjKKP9kdFG1T9+E7GtZSsIt2KTKkpdMWsh6tioyIIjxFaqLmETMbe/l7S82aYBDmv1oN+Jyk45M3PN7ChKCi9TDWJMiyYInvG+sY1A9zK8npT1+A5EFNCbfny0WYgvJh3E2nngLjIbK+XBrtVdbHVgEZdK1ifmMA== 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=B1zxEdHosjsiGCuea9j4jS7nMFZLaSVEQbKLdH8s5qY=; b=k0FgBOwIp9recCF7kFOPhS4DlhXVqNo8qZNtPSrRzw1bcT3fhhisuD1niEnu/HD7sKfQO3aJkfFIXpxcU1su4srSjwOTBfRUnkvuX6a/rW0sV9b7cNRbTc5LvsQlIUHv0mvU8eMtapzh3t3S+cvUAaxi47EJhoA/uzHQr/Pg1QUb8Y+CsX/ydHJDOEcfT82Q2a8EsbLGQIvPV3TM1ZTegqV78Y3LKcIvfjjsuZl1sCnmhBciTTKGDW0/8fpEz0/DEHgtHDSsE50Se8Cm+HehEor7wZ99Ivhsld/HJiiNcN81DnH9KzVl8SJjDqMZQ7wFWPKgwIuDJ9LRvEQKt6XpaA== 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=B1zxEdHosjsiGCuea9j4jS7nMFZLaSVEQbKLdH8s5qY=; b=rW9ekDCUyXCpjsr5wK/zMNAyBNMChnKeEvNqTE+DNacDjyOG89Yu9rwys9R2q7RyYpEFxJKh2xBTCVbpCEyFm5I6LEPJF6lfxwioDGcwg1a80q55JkACeQa6PldGxLNkd2UK+pKyFPRQjv0V0ts9btjKeGcJV6MmpvZI6/AT9hY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:53 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:53 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 5/6] i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen Date: Thu, 19 Oct 2023 18:27:24 -0400 Message-Id: <20231019222725.3598022-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: 27d4e91a-a88c-4151-87ea-08dbd0f2a28c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ikldhn+JIeVUfEJ0BAnRb+HZpVdnCvHN32GGqmTdBelBXJVAfNlFEzbrgG6/P9OSUMtpvH9KwcUaXwny+8mVQ1vYKWCNYujg6BxhBHBsLhS90x3jUM1XUNIXpLsNcC7bT3hc11hS/0i5XjT4jRS+ILTavARC4KjtIiyN+qAa868gYI0AXpFKM8IILHm5wEygLEk7c+N3vWRLJmTlSFcGuQnFHlh0057oAfr9hNdEDHgqRnjPy0toWvdOwMpwIoMZ9Aw+jowb6n9HB63YmdusnoNOayVA2Vj6x2aOVJWuocjj8U8d7aubRTQjf0xZF6dN7hmK50+IhYQIf0zv0XdLOOfJTyKILoUHqqb/UglfxypjCnSbeOK4QHnvkfys5wpCB2WHLCPI7VJiObn4zYMXTY+Lmx6/Hrv2Y3Gz5+CuIlpWKyT6i4i/p1jd/CP3X/MBk/ggA+2b0S82yiSKzeeLk0a4uRQ/wFGRerZeRt16hVKGLMV/SgjrG8fqiB9lPaOVkUufgXDlDJOZEni7osRFrFJpEvWwnxZetKsUIZ/PT/QARPzo/7OWJ6OcDs8TKirQj1HrVStAN4x0wsO/sv8fbLv1MzELFX4LXnlEthPGIczRcx1+xmLe6jRQhji5jbKYccKKu3ptdLZC1jMabQZ0kWGMc+KFfCghWS3Mex6G2rs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ErqE0XaMBw9cFm5QSlr5lTfj3RxFJrAIFQT0kIFac7XnUFOa0caLuQQzaHEpaSqHD3hTs8Q5BCCmPsbStpWGMPelR/mC1Dlh3I1mlOxGXiIGeiM7unWMHJrfWeDGmNSor/f7CVHmWhWGliMSzLnXDP0UegEZDRkojDohb33QI3SgO7IjdhEs73qAPBwXw5KzOXKqUIY/r+1WRvtm7vh94r2nge815V8YDz7s4Wf5HwDFCmYJuz7nuEJTSLbZRHav+DFgVXKwUXNcbIc4ZG759Dsr2HQkmp+6/uniUqhheVlFr533mq3jOiwzwBNfzHS2slRUk3XJtqj3ahUEXvY5i+yXW55L0wA/wwI4pjgLjNfzrECRqjqgoJe7nCEjxT6ONi7srEpjHWmfsuhe8oIjpLhm0e86gIsfqsdpqJnVmodvwn8d1TVddFpXnhsOLGQ7gPa35M2sh5tx0YEb/g9DiUXExpllB5cuWRThgRk3e/Ws5pfLSZBroRGpeGfcYww/4e5APaBCeNa5YpmsVxLtXtVUc6jvpxKSRfd/Eb39JgEZYwKiKot767kk0g2D1LV6S3YjHMRkygNe4LWI3OWBVuZniwnDKAXoxYqOqC+Gi5uWt0OE0sCfJBfKuCHb6bYXfor3QAY34Fx7m7xfDGLEs41s2nB+afNH+ofHUs8YPtwxlUMG/5cQdc5+L/v/03wPyKakzQjFJnt/x2R49FwZ/YAUedTwzrg75osJYcEWGl6r8Es9ZQWKmP+df/50qllfk2MBw+J3knm7F5c81GtIJrKIh+QzLNOmGaHABGirWqGX1LDzirTjjBzz6vh+rCiLGBEXbjTW6kncgqceonbLWYaZYmcQLwHabw4NkL1GokxGsFbAiaOUv+UPtpE9wb7WAdfjPePMNVcwdtXmbBWsCNLtwhaoo9zIDCbSUNAAH1Jjg+S52RucAXucCpG6Dn1O96sF/iNKobXzUW8AzbE3Ptnp+0bhZ+jP3deix6DWRoSoqsPcdNJVNxSh2fCakXIB6gPgDeccADtUT8588vhXFm9K8OowT1U+Plxb0LlWjOUl+MMf3r2spuVvVcx+V4fh0NBg2deaC5BIiKjbB46Flsyw9PksGy7kfnYCfVavpzVOsn7dDhKWc9urSpvPrP9y4DnZtVE7eq5SlOnlb/joJW/RU5rTu52eQxWh/43uzEMfAMwDSK6Iq3EGLL/lpNHCGWujai39O8MIOMVbSqtSw+qHD/2ITgjYxtj3vwY9EGmZ00zCmBXR/mkfUq4nd1r6ZvA1/zSdYYezMw9eTupscrziY6mzlLkfaYqMWY01k3yyLAVFRr+jk5qWT81/ygDwY192N6j7PAMwnUCwk7hV2v+lW8CM5zrwkvwQvd1fpRvImwE3qyXaX0TRYLrF8xLhb75N2fKGqp+mDg7w0Z/EhUUL7/8q/4GKMI3LbafKf22OR0GAvFs0I6inHcnSxHl+w/uBp3iybWWseenOZZnT210+hRAD9PuOckmVPIIMPnYi0+5Cn/JAVxSq8EjzwG+42wTrJ0sDfCB9tt0ikjUMgCSPB40fLFEOxw/JhkeqkLA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 27d4e91a-a88c-4151-87ea-08dbd0f2a28c X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:53.3572 (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: l4I7Vcp/zs56ZyYrMamEaLGlwx/hv6sxlTJXeX7a7LW0jfvmpsrHknwltANfH4iv4E7GwhiyvD82RMAlQwgchg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224637336815983 X-GMAIL-MSGID: 1780224637336815983 Upon IBIWON timeout, the SDA line will always be kept low if we don't emit a stop. Calling svc_i3c_master_emit_stop() there will let the bus return to idle state. Call svc_i3c_master_emit_stop() to let i3c bus come back to idle statue when IBIWON timeout happen. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Reviewed-by: Miquel Raynal Signed-off-by: Frank Li --- Notes: Change from v2 to v3 - Update commit message and add review tag Change from v1 to v2 - Update commite message Change from v1 to v2 - Update commite message drivers/i3c/master/svc-i3c-master.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index b113460f059c3..1a57fdebaa26d 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -404,6 +404,7 @@ static void svc_i3c_master_ibi_work(struct work_struct *work) SVC_I3C_MSTATUS_IBIWON(val), 0, 1000); if (ret) { dev_err(master->dev, "Timeout when polling for IBIWON\n"); + svc_i3c_master_emit_stop(master); goto reenable_ibis; } From patchwork Thu Oct 19 22:27:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 155724 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp688201vqb; Thu, 19 Oct 2023 15:28:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFtojIckDRe0jVMyS/Gvors/TF9oCWS8JXrsG6isR6fmt/iwoSCHYXUccUI8vRSrQGGpge1 X-Received: by 2002:a92:cb41:0:b0:357:a3fb:1a81 with SMTP id f1-20020a92cb41000000b00357a3fb1a81mr313644ilq.21.1697754514844; Thu, 19 Oct 2023 15:28:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697754514; cv=pass; d=google.com; s=arc-20160816; b=CIg6wa6kkfC9t/t0K32G34szPRGLLGOZHj/sMBG/RnWjOLZ7Z3cgZA4kdqUpSI637v o0luNAtC/IvO528ao0/LJe7tfSUrLZbml0usn2FD+eUc+St/r9/bpmu0/sMOTSO+JI72 I1XOIMRf8n2FiPUNl2ii08/m1n0WK07Ir4Usq1ZdXXnS8vSk59f6RemhW87SRRcfJUOv d5tHf0HkDAaT0/NPaOiC7NRPrn3WLcXUVZdYv64AZIotxVIOTPUr9axudIH5SPryBTcu 9IyDpJcgiC+A+nA3Jxv2id0PpWKM51LN6k8VDDMC86MUeQTt5YmgA9+nqCelCKm5SUvA ddIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uT9W7TotJARq6zP26cWXT9hzaMtE+nmkARINED70m3A=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=rNiCnGug9jKVQGAASn0AoyoT9ru4Rtimo7oUMrcZVjyBa+K1rXTSXE5JDz4vjaxUvL i6hQgvuYoZvImf57XX9yMgTPDN7ywEyjtBpZEIwssRQPcMt0qsYmngo18DDEurKZnLoQ VGMAaPlswjRQ7lpmmcjJrUn2/h+UZpJIecZgN6V08U3inbYXzHLVWAht1Cjp+cczhsd4 JUZo7hZBgo4Cz+Xm3vA1nFpNNawgB4Srhx/UL5aB2UllOOZ524DNIB4veTcDfj/L1E3e jOw3oT3Mz4tGYL5r5U8OAsKrRPVEFPvaYUkh4Qe3TFCOlhPdAcol+KhNOyAAYi/MnJzO +YZw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Bxe7DJXq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id fd14-20020a056a002e8e00b0068a557febfcsi609549pfb.111.2023.10.19.15.28.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 15:28:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Bxe7DJXq; arc=pass (i=1 spf=pass spfdomain=nxp.com dkim=pass dkdomain=nxp.com dmarc=pass fromdomain=nxp.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id B33BD81C36F3; Thu, 19 Oct 2023 15:28:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235548AbjJSW2U (ORCPT + 26 others); Thu, 19 Oct 2023 18:28:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235564AbjJSW2P (ORCPT ); Thu, 19 Oct 2023 18:28:15 -0400 Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2089.outbound.protection.outlook.com [40.107.7.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 085B812D for ; Thu, 19 Oct 2023 15:28:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KcbD2ozq4i8G+fGAfMs1vLIY252PQOclsdB30QEhhIunLIvbOKJKdCNQ+K5E7UkOTVeg/wN0fOQPUQH7sAdPG7AR+bhqBfixhQCyEFv/X6cak1yNFFP+H6kxVpSgYnTETNDx69rdTx1hZOaLSk366W3C+G1OOwyXx/bUUosdCGecXHEKJcVsq1AvgSLFIxeoXiVLVfNukk1tVJGy0wC9MvXRkubD2HJyxhKBuSFQDW86SiuUeIDRsjAqzPziFOSVW0ovvhOAprfUD04m7wMu26SELosMetv/LOk9+qCwnpXT/uuUeXam6yNvmuYh23b+3vUg/3cwz3g/jUikdvV9WA== 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=uT9W7TotJARq6zP26cWXT9hzaMtE+nmkARINED70m3A=; b=b/63V16GXMNFxiv9Uqm0LNnA4U2X9GQ95PI1FP3qpddxqv4kkvGj27MOSPgB1g0elbSAhHMEEGgwSU6T0GKN7y9uSnmasySRz+YbOG7pIbXpUMvpnym51YtYoVO/pnPApPIbuQ+CSw1uWQsushOKloZiMSpYWDOQkNG2pGuKdnAtM04k+FYQ7DfZhdbc5od5jPO81BcWn2Mbz0kstO0LdQjQTQ/1NzoBcSh7aUOTreqVWmoGtCp9wRVzxOUnANBMTZ35Q/bZLX6OKq8B7UwBemTQXsBZ7mQwdm2WUZyKl5P4rDeoTS2qWcKF0PWxXbWYDe7RNnuU1pcU5EeY0FI6aw== 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=uT9W7TotJARq6zP26cWXT9hzaMtE+nmkARINED70m3A=; b=Bxe7DJXquFtCHIFa5O6xGiLL9FQVC9EUqOEYYh7Q1/U3UYDTbFmLrFnv3faAmDIQj/VvDWG3rQYBdN3Ne73sRi3gVY3C8qnaDhVFfEhytc8PX6wglp8EQA92K65rF+7IiKvrQj4D68rJYMzcheb0ibZ56HMTWlzui+NG5n0lUZ8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) by DBBPR04MB7708.eurprd04.prod.outlook.com (2603:10a6:10:20d::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.10; Thu, 19 Oct 2023 22:27:55 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6907.022; Thu, 19 Oct 2023 22:27:55 +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, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 6/6] i3c: master: svc: fix random hot join failure since timeout error Date: Thu, 19 Oct 2023 18:27:25 -0400 Message-Id: <20231019222725.3598022-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231019222725.3598022-1-Frank.Li@nxp.com> References: <20231019222725.3598022-1-Frank.Li@nxp.com> X-ClientProxiedBy: PH7PR17CA0042.namprd17.prod.outlook.com (2603:10b6:510:323::21) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DBBPR04MB7708:EE_ X-MS-Office365-Filtering-Correlation-Id: 08c9f151-8689-4abb-da63-08dbd0f2a3e3 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j54wbIYDBBUwajZxBlc7TZPNR/NkabsA6+yGcUvJh8WgWIapp9hEuRsj8WyQveStHEO64jNHFjlq0LqEX1tvbHi5mYFzPeZ4YgC0pQ4EE5EV3a7t8lD/tj/8/dRCi4GqeZy6yYhy3jVTHofiYXfCKP3NsuFTnM9gyPwnrHtuy6nqPZeAX3UtQiKQWLIDinFKaQkmRetvq/SlDnSn975Rm2GkDtjCyF/FNN/46/OsM0/MJPkpEocsClkpkiQWMzQ29E0b4J+L1JaooZTetHYE+xhHhvxk2H1aJerGj/3EsTpq4yiMUMEp4y35oLCDj/Ay7WLlzZQuAkUxWpBMwSNWmnUtQqtv/iDrVYxcyDBXJzXVi6q/NzPXMuv9zXCvHo4M3lZlrp8rqyym7lXnnvApyRmZWe9plPNdOvWhdBHXTAq8WkU2yi35uuqnlR0Obherz0pffWub4caFNtqkGQ6wOVPT/0M9ZOLwol3/+z3hMQBjdBHFl7cJ+5Qdmyll1Ef9QaecwJZXfqFE2WpapirFECk3ZMkqrfNZ77DoephhoKvb+POuSru5+402BJFMUK8rIcIPGeN5myXxxUFE124o3Y+m31gusgVoXgb/MFH1tlBfW4NMWJC9XqJ+avdaYiPnatCf5cQOlP+Fr5F9OrIJ1uQsVvo87iHF9kJSSM6UU7w= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM6PR04MB4838.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(396003)(136003)(366004)(346002)(39860400002)(376002)(230922051799003)(451199024)(1800799009)(186009)(64100799003)(6506007)(83380400001)(6512007)(38100700002)(478600001)(36756003)(66476007)(66556008)(66946007)(316002)(6916009)(86362001)(6486002)(52116002)(2616005)(1076003)(26005)(6666004)(5660300002)(2906002)(41300700001)(8676002)(8936002)(4326008)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Bfpwxf4s+yhj4f02oxvRVRksvIGV?= =?utf-8?q?Y4by3Xg+hQXO7KcVrhim+/LCsbM9dUL2lCkes4/sHktsQelOIuV834KW2uys57Bft?= =?utf-8?q?DEd0kGGB1/wiWlMsAjdlcufnab6QPtpr8guReOibiMDYjXcC9tDNcVdsLuLMrHWIS?= =?utf-8?q?W0YScmj9PefWT4IwKup/rKm9b9o3ReGfDMCwtiF3+X8SwIvrCceXm+ViPXpUIvAtI?= =?utf-8?q?eRt7qMCq1rxhiNG/N0V5ilWHMz8HcCnhYOMnN3wRWQAZ5aoRiyFz6QwGNM/bsSyoV?= =?utf-8?q?F9KwYP7p3ie3R2LBs8Z5wExAUBBzux+7K3pyLiMsGj1eaYd1aJNo9rVoChJYje31u?= =?utf-8?q?kWB5EtSoggvmSz057mDyScI6r+z2RIz7Jgp2pJCLEQ3CJw2JpVNoFL0BV53680fVS?= =?utf-8?q?+pPqiH7UKvEx5//r7S80FrhRkY+GWS74mpckCHeB8XA2jwTqB83qkINrXUbbRgmSh?= =?utf-8?q?496WYk2S5pzDn4NWv1T/e6gvTLVO+OceHSfDjqG2iDjanUTO34FCNlahiis29jpHj?= =?utf-8?q?6NF+9r5QbBrvMvirHj1TRI81rwA6PO0zdoYW5YASACbznmCwjGNFFx4d0U0bk9/MN?= =?utf-8?q?L0NRgTw2NOuPskfAsciMeHFTW5dkzMttzTUvkw9Kc0UHYUKJynKCJiekUUFIepKO6?= =?utf-8?q?VS8yJVGUwkqKBXME6NTTUw3y1Y2qwRqZmMlgq2Coui4jj650Xjv29kxH9lxztfmEM?= =?utf-8?q?27zU0LkbIDWXza1K1aTrPjlXeCAF+Mx9xpKKpUWY+1IJuC64K7IkosY89sabE9TrD?= =?utf-8?q?5hD7NUb6NvZmDoIbczovIBh5CzBYM5ExSRRZ7xl9I7qnI1+7C/9PQWHAoR3/PIfFb?= =?utf-8?q?LxjCCMu+9uJWm82pBDZ6BXIZ41trQ3tWMRQP48BFpoHMJ8IjBjiMW9/9ZMA1AfoWq?= =?utf-8?q?rEMl9XCLR0WLbtazV5btOb/XAW8eYBQrWl0STkHaJVKaGYWEjLuJFYNLwFY2I5z6C?= =?utf-8?q?twxh46sOL2mJtQNDf8BDWrwIRytfSVDZ6BbRYzdDfNzfQDsalk9k/btkecy/s9fJZ?= =?utf-8?q?9qkV3eqMAQdflwYBSQlP1Pg3NXvBwVCzGBTrPtkT66GrgVsOjHmoBDZw5WIXtz7rm?= =?utf-8?q?bF3uTjMTGoVIFWHkD3VRbWtpaFntuJJ3NCEXmMM8AgR46gs1FTvQRnxjlBoZmQuw3?= =?utf-8?q?mUa/SUtC8Ls4KKQVSrzC4MIKnU5WtSJ7dyH58M6SIRFtiBX3qsWi1cNaEkgvGkkkM?= =?utf-8?q?STIAFilUvphOA2eOkzxZsDsKlga+bo/Y4kle7qJlJE15dza+SngNcDcrMCRaDIlRz?= =?utf-8?q?YxRtylPAH0ODiq+SxYxuLsZVSdVYb6IcT9SLFO5Yfn38h85S7RGAOnbFiTYaUBRsj?= =?utf-8?q?yF8N8TM8qOhjEqrxmUY1nfIZSenzvYZSf+O9j2aMmQRCfkGV+2qoItWOEUSLDhoxA?= =?utf-8?q?We0ATR6hNmsFzJ17ynsqLSYSGi1Z6s89Vm6QNPhrI+Rc3jd1KrTmrmB6n6UsnPEIx?= =?utf-8?q?Pnnj8j0Gb9MBEPTYObs7I8U4RgZRXM3fU8/OUn5tL25LrQF8+TT9P/cg=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 08c9f151-8689-4abb-da63-08dbd0f2a3e3 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2023 22:27:55.4675 (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: fLGqUoBvhIWqRM8s0+wE1zLPocOa4pJGZs/YivxpM6xXt4QlKjV9KvRhPbUS8y8Xp46ObiGKqdrg4gOw/zRbQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7708 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 19 Oct 2023 15:28:32 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780224637851771871 X-GMAIL-MSGID: 1780224637851771871 master side report: silvaco-i3c-master 44330000.i3c-master: Error condition: MSTATUS 0x020090c7, MERRWARN 0x00100000 BIT 20: TIMEOUT error The module has stalled too long in a frame. This happens when: - The TX FIFO or RX FIFO is not handled and the bus is stuck in the middle of a message, - No STOP was issued and between messages, - IBI manual is used and no decision was made. The maximum stall period is 100 μs. This is a just warning. System irq thread schedule latency is possible bigger than 100us. Just omit this waring. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li --- Notes: Change from v2 to v3 - remove 10k at commit message Change from v1 to v2 -none Change from v1 to v2 -none 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 1a57fdebaa26d..fedb31e0076c4 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -93,6 +93,7 @@ #define SVC_I3C_MINTMASKED 0x098 #define SVC_I3C_MERRWARN 0x09C #define SVC_I3C_MERRWARN_NACK BIT(2) +#define SVC_I3C_MERRWARN_TIMEOUT BIT(20) #define SVC_I3C_MDMACTRL 0x0A0 #define SVC_I3C_MDATACTRL 0x0AC #define SVC_I3C_MDATACTRL_FLUSHTB BIT(0) @@ -226,6 +227,11 @@ static bool svc_i3c_master_error(struct svc_i3c_master *master) if (SVC_I3C_MSTATUS_ERRWARN(mstatus)) { merrwarn = readl(master->regs + SVC_I3C_MERRWARN); writel(merrwarn, master->regs + SVC_I3C_MERRWARN); + + /* ignore timeout error */ + if (merrwarn & SVC_I3C_MERRWARN_TIMEOUT) + return false; + dev_err(master->dev, "Error condition: MSTATUS 0x%08x, MERRWARN 0x%08x\n", mstatus, merrwarn);