From patchwork Mon Oct 16 15:32:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153504 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3543767vqb; Mon, 16 Oct 2023 08:33:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE2NmnpINXk9ePhWLN6zidffelQQZYyAQ0m8zpI1XeEXNZoCdO81iJSH/tDh6lhLzY+A8cF X-Received: by 2002:a05:6a21:a587:b0:163:c167:964a with SMTP id gd7-20020a056a21a58700b00163c167964amr42630122pzc.1.1697470401792; Mon, 16 Oct 2023 08:33:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470401; cv=pass; d=google.com; s=arc-20160816; b=HVet67J95/JhuEBjc2Vxrbk8DabOEvquj3rKSzGl1THQDCBpzU7cL0mN6nrKS6kSx0 clLcq9omw+wHjQZyX0QRTxihlOMJBnC83HDqQr6u7TeoBh7wxBsHy+TyY7gPTdMP/L23 qJ5vgP0f/1v1+OxpvKqJJiLeFJv45nDUZo+dAQSWobcBpbiRpS11r637na/rZYIIAHeA IDmyZombBHpeOTnQCuXC7ArhH19PAP9BvxfuS0cB0v31KL4rBTbJrigxhybv3ggcH2dp HlEJCcEsRc7D/m50his9sXx4Cg4TOIVRQdyVf35xs33Cz/cJe4zyOKKbulOP5DsCqsFX 8Akg== 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:to:from :dkim-signature; bh=Xn4mPAvhPGdHiiCr3YwVziVD/SfIEV3x+7h8xcqcUzA=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=0+LJuXaBpJgyYKEyw9JH0cAWbGMRN+oO8o3eSjtsWW/3B/DJ0m/rl3tao5RBnDvVGJ qjf4kmsoJeVinUc3sqDoRXDD64QPVkIo2EhB4CHIJXTLgvAb+4/pW8bZpdAtnL9kI++x p4dLmsa2TlHZEpJbZxTXnuiE8kZowilsDx6iYWIsLY1YNpBqFmyf61fybr1V/3I8VQ2Z e+7op0GBraAJtFNtv2Kn6K5cHK9rTLh7T64DjROIxuj6k0TwqvFS/SBRXRHFrZVQcVHX yaY1kzxoNsXZxqG2JRKEH4F5k0Ef6H+fqyWuiC22n6RqRyBLxHDZ/q+ZDDrd3MHaHr5C uofw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=p1NSuLfZ; 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 be3-20020a656e43000000b0057c7341d568si10845205pgb.645.2023.10.16.08.33.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:21 -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=p1NSuLfZ; 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 36C478021B30; Mon, 16 Oct 2023 08:33:15 -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 S233592AbjJPPcy (ORCPT + 18 others); Mon, 16 Oct 2023 11:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37410 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233425AbjJPPcv (ORCPT ); Mon, 16 Oct 2023 11:32:51 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2073.outbound.protection.outlook.com [40.107.104.73]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4941ED9 for ; Mon, 16 Oct 2023 08:32:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mN4dSZsYVnxL3yEn+1Kji+In1KAgNTJsvRx+MMC5xBxx+wn4esucUjpSmlRqd72uDWtf2JsuWZESxFVYqnbdifKjIL0Ov77sM7zC1SqeruP/814FbwE+x3t2YhEfccTy1u99gJZJqjXwt3R3lWMR2ArJVWjWlWM2R3pmWn799B/F5xxDSZlAmrmsuG2KHcXa2iUSBlXqq3xdPgnZ/Ag9eY5EvGsAEQepYrWFGsl1NX/wYSSNewpDfZPvk6Y+49aBGpWHgm9CZCleFTJeIwY7bLHBlTGezDVXXsFYac4ydV1/xCriFSqUpsjMUewhlYTX8moONXST5sXNRFrdA5BZ6g== 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=Xn4mPAvhPGdHiiCr3YwVziVD/SfIEV3x+7h8xcqcUzA=; b=QOyDe1gCVqTaCwcsFgHJNVKH1/gNWX3SdhWoOzzJg24DodPKd1EcPSKn1eXqw1TqkZAa/D1oChXav7RyXSu0Cq0P28KkkRDoOmGiAWa4oFBjPjf3neEEiVeHsdEmw2JIR3voBNZCdAk3tBxEboDcUclxiJEF7MLpfeNuV4LP03rQwM/UPsYR/EVhhe83UE5L5pzbFQ0GmicwcHMJBGrxgYZDY75PCPO9IvTF7cV/9Frjlay6RHE1W31Vjho8VlLZfJS3GjuT/x9RYj0ntdI0THBaneC11n5nUVWxDfJB/n3gPbFZd4Tvo0GC2ormHANTK13h2e3GUaBQT5B67H+/cQ== 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=Xn4mPAvhPGdHiiCr3YwVziVD/SfIEV3x+7h8xcqcUzA=; b=p1NSuLfZ6oQTyKP3Z5Fm/Hv+mRMq1tb4vLUeksDExBeNen66yxM/v7Qx+dz7YiBMUb93WeNiVGuk+ZABBpe8Yw/LCF0DDzkOPVqE0m5kBomFdePjIvMEM3bStJcs9pcxJ/EpIi/ozRQptEGT/nwx+/hWy+QpF5bJ0ubQ4ZuWiyo= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:32: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.6886.034; Mon, 16 Oct 2023 15:32:48 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 1/6] i3c: master: svc: fix race condition in ibi work thread Date: Mon, 16 Oct 2023 11:32:27 -0400 Message-Id: <20231016153232.2851095-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 26d73f0e-e4e4-4fa2-cd0e-08dbce5d26b8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AABSY/doIXSuIx+laH/eQ1V61vf/gnpQIoxEa/IbMyvRDq+iu/X9s+BwH1Un+PGxXii0CYzdZRSAq62jIjfWGvSbupgD1gx+SKmeC4tZTWaGS/wkSZlcR/Rcpqpl9Kd+25J+Vq48dnupXMV4UB1PqjBzoI7nb8tbbSPK7wRCIW2GVvW9imBGMgt6dBwTEQGZ6ZMVcADTqSz2bBPBbZpD38tsF4X2HBTrT5T1RMbrTFX6MBWxXNlwgnKKYhWHiCCIqgHvPcxHhTYBSWEac4aMipcVwavtYQ4pT1B5CqN4oZwSYVQvABKpz33cRXGRA3vvpgqPsOsRc4DMtT79td0t5l5UExLhC4tkFOeRCvgP4Rkc12Kjq6Io5U0ZwH4bs9hUhwq3bUwFOxsc94tWPiM/GxFNxMU2b6zvEwLE+jiW5xf3SSn6Y1ssgoH7TnVsbUyCtlxDBsaYC/+1rjmUP52qJqKWJxgKoCQHjdFkOODmPqBb5ObDVdsimjbGRiYRkpfQEWWN59vY6vWVhFUtWDs4Sfl5acmb0CrLjFZ7QzY6n/rvuYvp9rAcb0MLZxmRZJ155qu0QY3hrbnGszfQnLoWQjQoUpRVsvcpQq8MM45ULb8tZIhw+GNqNDakLOjz4jQd 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(83380400001)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6Hb7fQ/bCrQpNyRFy3eS7Ipvehe6iM90xZtvB2BiY6/nnLDfLd4E245GcMLA0qxmkuPZHSQ66klwvF6IWLUOfvpzLz1wXLD6zla5mrK+kCpYi1VglYK7ZHbRN8i1kCVS+mxk/dOdKb3Su1sKr9EZWzkEYaDl4SlyBIKjn86fYj7kjMzJvxdvhzc0xHqrB1+8jhFl3s47ObAGHvu5gscfiisTmzNix6q96OmfvmvPlCGKMWK8Xa1J9qqTU3nPrvw4vkvV2LfZKY6px14U6LI7Zf+M/u9vlhp+0RaRFn9P2KIo+BrnBKVdkSObqLkqIQaa5miJLLTkuJdDHTvzngdwnePlS789AM776lYRR5r9/zZ3RwUtiwJlHyA0QicHKj2H0891uM96lC6IFT3lUy4rafCJ4+a0MR+qSF8OIiNcgEnIwNysdRjYXs7Z9+jbpc4RABo2AqJSmpD/Qa+9mJZ143nijTkKugIj2QidszjHeAhmgJn3OkAyyKFxHhFxN30N/nhA7eC/YCXRXOuy9cc1HzcmD8dzPcjAHRDuCIxmvJV+qjAgP9WLDxu8yIrTdv807Au49xYMPd24HJWwnd9PbUHMJUYmZxV1nbDaxPVy1gKwLBmTCDwCuYmpH5aosIC2lQtg4uwLwggTYR134cIZuvTiS0xWT0yfC7H97fd3h5xFIZzUn08VHhBlPXYvudIHmlWae4ffZGWRFfInUHSjDy6Hmjgc1FvI14x+jEwGjtyx6rv79X21u3BK7mS66BgD1hzvdKwf5dN73txuJtaLjyjtyQazWGgZ+XDyUsHzJ0b3B5EvvF66YqRdAh+5dQ35iDrk/Ozzd8rPUxhy6U8ghHFO94atS5EPIbZ8KKqZOaUMAngBObrpZFrlPhLsxOap9qqTKdyc52o+vbE+LEBNdqsR7xs3+YHEbxji0WIMUjF4MOe2tknZ3DXzW77G7g9NoIF1EMQrOj6Wp89OUCDgiWPN0aiPa1hxcPi1JG1RiYi0jNWYFs8byfsWhhS45O6UH4D0ICyhuCDBPwwMgqqP3O0o3l76oZUkv7U3m4boJnPb2Jka6n+PMKcLW+8H9mPFkLGbr54NTvASElJb4aSCaguKbJZNmcBuLVPZuDj2Xy9+niXGHNRCHB90Wj3TzlLjhNF6RVeU/q9sM4Q5jdd3CpRfOhbwL5mBxEBOi3I5xmx8H9eNS/uAMLlxYNDxqAxYtko668ET2KzOUwgJdFotByGmzEK8PErABN3K5vyOhoQhYbPMhTd63wSesnW7SVvg+onGzAdhQRnbJUbhPFoNiLWWuOWMaK4e1491HQHDVc90JskRm3iKLNpTBnIjAUSUaFyuUqgpEK5LBCKIzuCrxieHLqxmzUNWix6uBW/cspn+C0sh0NEljmh5UOcm7afY/hwv05NJmYbg2TeSOVb6rLkKYOZYYnWNQYXPy0OVXqpmhJuwJ0SMqMCisWfXhCwYBbXPlEAWZRDe/t/8ElftDQoeKrW2tjf/TPMCeqqIfQifbRPCL7FHYe1rKSpaE9vIFfB0wBUoTdARF1SeMK9B1rAP90h2EY+uHb3g18IQ9BI= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 26d73f0e-e4e4-4fa2-cd0e-08dbce5d26b8 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:32:48.1604 (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: q3XSOQmhczwsxHwqXMiJuWtIEs8HCTFdcCACjloCZHpkxHGjXMzkX/x9Ltzt2bUySyIzJPRJe/hun17mjCEgEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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]); Mon, 16 Oct 2023 08:33:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926723820234751 X-GMAIL-MSGID: 1779926723820234751 The ibi work thread operates asynchronously with other transfers, such as svc_i3c_master_priv_xfers(). Introduces 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 Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- drivers/i3c/master/svc-i3c-master.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index c308e22f0ac5..ebdb3ea1af9d 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -202,6 +202,7 @@ struct svc_i3c_master { /* Prevent races within IBI handlers */ spinlock_t lock; } ibi; + struct mutex lock; }; /** @@ -383,6 +384,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 +461,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 +1206,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 +1254,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 +1315,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 +1355,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 +1550,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 Mon Oct 16 15:32:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153505 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3543960vqb; Mon, 16 Oct 2023 08:33:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFEtAL9oAuYFKgQP4IBVdFj2DzbgVj2sCQYCugZvUs6EdQ7XcrW9lrbzp/m9OwvUvdbp0jr X-Received: by 2002:a17:90a:4ca4:b0:274:99ed:a80c with SMTP id k33-20020a17090a4ca400b0027499eda80cmr31799371pjh.3.1697470420362; Mon, 16 Oct 2023 08:33:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470420; cv=pass; d=google.com; s=arc-20160816; b=C+HjsfrUwYR///+X/wPuvEGkm48OIMov96sYnDMmhMhMWaBpAsMs7u3z0a7RdWY/3s pB1PkdU/GufTkWh2ctSNcviQbQtApHk55dcn20E0gFKvecKi5dZwp5YwIzYttpyFUgn+ axkfKYmlw/LA4neyqdE7ZYMVJwmmzWGhSsYDdHG8DNmApguCRfvTLAQ/oA04DSya+/lK p6sS5F+iHg5K7qD4Rtv+NumTpQuBwy6LT3Chlh7XLJboD4H8qFU1kdXfhLA/iaKDzQW0 sJBFlnmVTzKBDnIN8XQ2ZD0BeNQVNaf9XMSZ4pUkg7lg2Z19pL5xguZaUcPibCX07VDB 5/BQ== 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:to:from :dkim-signature; bh=PvIe54O5QCnNX7y3AwVwXO/OJ5Uma3/csUrgUguDejw=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=LODK4symG7kphAL7Bh0GTscl22W6d6M8T1CuhDjupKizxV0YbZzh/ONBlJUmUErlBR 5ci69VM5Y80AiqtW3CIoLQBDWjkCorRL5X1lKm9UPLLDk5FAN8IRwqPOqEX71CZEqMbp B7N90d+UrWtXYB3rn2KTueHf21NGFs8m9NTJ5cR/eEg1dGuK9CQfy0cL5rux3Ddr8YxZ fFo2mBQ8z1MLjpqDYhPFTCIx/J0XGggfeQrGrevyANHxYwXbkRFQi6KovTnqtTvuNP+b 7tme+RM4J5tPj/e6nrFppfM/7jB/2QtF6+tOqd+derZc6TMxtnQ0NYezq391E2e2G8Ve Ivgw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AKApbAND; 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.31 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. [23.128.96.31]) by mx.google.com with ESMTPS id y193-20020a638aca000000b005af4cc9e22fsi6221201pgd.840.2023.10.16.08.33.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=AKApbAND; 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.31 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 3721C80219C1; Mon, 16 Oct 2023 08:33:37 -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 S233652AbjJPPdA (ORCPT + 18 others); Mon, 16 Oct 2023 11:33:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233616AbjJPPcz (ORCPT ); Mon, 16 Oct 2023 11:32:55 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2078.outbound.protection.outlook.com [40.107.104.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E5CBFB4 for ; Mon, 16 Oct 2023 08:32:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eVkXKgA1+LpgBKJxpjyFd/bVugKjzVctsj3qK7B2kqE4GbY3rHdSw36nQYzu2+0wwbW6pMcnpcQF/Hgwc8Un++7SDSlUeak2hy7jcFmbZi3GofDeWdiebOWXkUJT2/UqFIG4Np+YIURQB3qjwvimmEG8G/Ny2BeFndW3/rVc4Dxt4iq9jh/vQycd2GLuv0nJ0z1hmKECymLEahE8Pw96R7Sc5MkVfjCaFjn9tp2tpvn+qYmGwh8GZNiq8aIvWt6tCa1GdeDEumS0O6PE13hAqEPP9//4E5tPf/+3eoCmoTmSqi07h9DggO9e/37epF30/n8Y9+vQhGcZDXnkk+uiNA== 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=PvIe54O5QCnNX7y3AwVwXO/OJ5Uma3/csUrgUguDejw=; b=IUS65wvn5eLDwJZ3br1/UW3zgvgVXBI39tw9TNPtFs8K4adLicWHfC6JKVWaL05opnW3DzbduKiAvq8Mobh62uuAH7Lw4fvmj5M8svEtz9gEVZAFmoSImClng2ePpe7rnhwe2awpGR3QY5pTdMgVYrJRTZf6EIUuYGIQQ2AkPvxZCINlgpAu5lers+jNSH4xFCTJou820pa4Q5lxvI9kmlu5up4uMgoJU4e6YIWlU3pMcqUjQEGHO4LmmiM/EhuDZd7KPkclZn/SgBTPx9SRz/8AAqUf55zswI3hEEy1OPwXqYUuZxMBYAvcwPLJfZNZi7K4roHXIO4nzpL0Ykv3Iw== 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=PvIe54O5QCnNX7y3AwVwXO/OJ5Uma3/csUrgUguDejw=; b=AKApbANDLCdTH72KxQAaf5/ykh5DjBg8ZE7TyhA0Bc3H/h4ey0T9ytt0F6XAgs3S0MxxNU4MMzcrSymTtYWwyHOavV5AdWU5kjwz6okdB6XaytQCKUf1QNlFyhDC5NYTU70FPEcXkdWNtgBsdlM/cY8A4vTB9Fk6zNgUyCjymV4= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:32:50 +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.6886.034; Mon, 16 Oct 2023 15:32:50 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 2/6] i3c: master: svc: fix wrong data return when IBI happen during start frame Date: Mon, 16 Oct 2023 11:32:28 -0400 Message-Id: <20231016153232.2851095-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 2bba315f-0fe9-4cbd-5aa3-08dbce5d280b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TfD4F+UQUfCfQWT1KV3mgpduE+31+aM+gYyYgpwFlKHkL8HVnQM5XSoQuFmO8grJdRmXUFsagROQrIFyxuM5axm0Q4wDWSavbp9T47D+kNR37FzpLk15zcNt/119gM3qeCYExJb0K+GF/K5tdFp29J5FiXWjzUNuVM/UD5pEJXsVdZLW+iyL5RZeStx4uffpcjPljohq8tp1pg6xLWM3ytd0jNuxpWpSmkHf6rjU9T/3ri2Yyx658YCZL+MIbuHPB0CWIwO8zihdnDzugE8JgZ7ZJctZPCdrKI4Au3UcYa2gXPXjqB870l91KQkhE8HIN3cWZN3Uy/c4wZK+yQHnXoTGeEHIp8Pu1xuWojyE1y/MdtSKEffn8KGpYB+LuRmEmLVisWMDY4MDsWR1EsnuzZERCPsO7CiXsEXXxQdOWRVa/MNrhkLlsuGtLjnaDNIY0/qJxVAxoRffRw34l7Uhnx4f3HwNUvkLS/JH9c0A9kfpjsBATy1/rRJebp2IoU5zadqn51WuTXCdQg/NVPUopnipD475qbbrig8XsB1sJ19RFVEin9HVPCRa3QFxCKYlbZ4DWOEi+RD5GF1ksE73DeDtm0CEQ+TYobSQGxAKy39iww53Lg3qFKF/dKeSt8+r 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(83380400001)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Uik+YhnbRqZfHOTGsnj9wVS94eZs?= =?utf-8?q?xZaD3mPKWgq6XcNQINovSgHWbkRCDveZPBPKV1yXKMuQND4RzWys5+3lHas/mvqtT?= =?utf-8?q?BJr2q0piHhceaSIkf+bSSN45xxsUaqsBCuWXR48xVpN9EC5A9+u9oMsg/mEgZPxhD?= =?utf-8?q?tzxQCZ4OOcWice2dRo4yiONzBBUOELOtK/B9tealNb4ljj45GqTsM8XYoPfAz/5ON?= =?utf-8?q?jcudBvJO33aJHFVWyVdS3Nz7Klqe3HpIVqLdWQZXTYtPsWeHXspnkNc9+BRYe5U6C?= =?utf-8?q?bly3SZsB9mT0OD8DddMFEAlOAVn/wwgTWyBEYp+gQqXRb1hUA6Xtmgw6XyKpzReuT?= =?utf-8?q?kWT4m9QrKeJUrUStAVRWT1k4H5L+jhKYH0FOokWRoBxfoGAWKF6KuSbGYzX8GpJWJ?= =?utf-8?q?3PFtbgARdi9HqHrCvg5tLCoYgwwFrddfNX4ManJ1d0oHHKTH0CFW2oAIaA9kMgRBI?= =?utf-8?q?p5ujl3WRluyCiBolXHBrMh9CIzILNQ/vwexQ+zPt7teqpfq0pICKsE9Ims0mAyuH2?= =?utf-8?q?52sePRSIth8CRlIbbsRjWVCRG92GhmrOGbQ5upWfrEASUEMMQaOiQUjdGvqb4kRQc?= =?utf-8?q?9b+mqCZRfM2T9MNHWDD/Jyj1LxyglfrwSBvb/BGuQngAmEh8FwD1mq4XJVN8EXTGC?= =?utf-8?q?2WwnjoFkmf5jbML7AX8kgsvomNb13t5DjQHtLkz8mcrRhrqHC5Plsl34aQUpgRKzg?= =?utf-8?q?DnBxJnuVVxqQIEgvT1526gkW7w9D2oz3KK6XPU0pkDRdPe0+D3xxP8qbcmjcuolZQ?= =?utf-8?q?VRZUvx30YOF/BdY2VHgvoVKQbaQE9gd/5tVPuHUbuHPzGFt52xoF9wg6JUVXnvPqX?= =?utf-8?q?ulCaMCB58RvntgKZGrGPwzFZUq4RhIjiA13T34FcSoulcMHb3s9APvIctwFmlvhdP?= =?utf-8?q?UqXISCiJBMLF2V3D8i9cULnGinf6vrxFe8I4BcwMzUeZ4baHp9VtU8IvhBVSFXiLf?= =?utf-8?q?YIWnC7PQ5hL3zuI0B5SpJ+Zn4v2dswbBjeLND4Zz1XBQNwAFO0ESr6n/8DlPvHP/G?= =?utf-8?q?KEzM1GAKYCR5fv7urE4Gvf3meUvIVQRXLlTjrW7RKQCE0JVQ2MEdBcv+POXv9pZiO?= =?utf-8?q?zA5Jy8BIT7vYGkaOD4fDaweBnaKhiuhMdHhaKPHkkNPux2p3d6AFNFQkmuqiCaq5e?= =?utf-8?q?d88Iif9KNP3lPJP/ZRYh9ftpID+DOWXZySe7WcOtQSO7dEBCnIKsMHEMmGjuziiZb?= =?utf-8?q?wGQEmIbxjgCphHsyFwVawb8MdnV/jrzVecLvyI4XoNyTHBOieroZbxV434P5P1rhm?= =?utf-8?q?HB2K5Wvhb8Uen5EkMFrP0V1ZV3sN3s5hhqD0EcQ1omeqij093sqCa21lkAoRUFjuR?= =?utf-8?q?w8oq4cvfCfSu+7fG8lUFdwiceRZuD/uRgZIk7Ry0dI6gpzgpc31zBA/RfTDdnmFS3?= =?utf-8?q?WY46tj5PDyWN10j11g6yiotKcu5UH6nqyMpF2q1/6outiHsRiv+KxJc10w2NebDjS?= =?utf-8?q?Xo3L9DlHV+cPII+M93/v7NU9oo8UqRCIps4qI2dwOzcd6wLpzuws0oA0=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2bba315f-0fe9-4cbd-5aa3-08dbce5d280b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:32:50.3807 (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: ULMIngN0t84bbebWLfXv0QzBaEJuC2xkOy/Txofu01yrltD6TSf0nnYFIieoQ4adtEcl4ZDDYKYqrBOTa3IrOw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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]); Mon, 16 Oct 2023 08:33:37 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926743338112093 X-GMAIL-MSGID: 1779926743338112093 ┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌───── SCL: ┘ └─────┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┘ ───┐ ┌─────┐ ┌─────┐ ┌───────────┐ SDA: └───────────────────────┘ └─────┘ └─────┘ └───── xxx╱ ╲╱ ╲╱ ╲╱ ╲╱ ╲ : xxx╲IBI ╱╲ Addr(0x0a) ╱╲ RW ╱╲NACK╱╲ S ╱ In-Band Interrupt (IBI) occurred and IBI work thread may not to be scheduled. When svc_i3c_master_priv_xfers() initiates the I3C transfer frame 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. IBIWON check has been added in svc_i3c_master_xfer(). In case this situation occurs, a failure is now returned to the driver. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- 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 ebdb3ea1af9d..0f57a5f75e39 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -1009,6 +1009,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 | @@ -1027,6 +1030,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 falure + * and yeild 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 Mon Oct 16 15:32:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153506 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3543995vqb; Mon, 16 Oct 2023 08:33:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHQLrKcwVlHXdvxCjXIaXDPHkgmHGdtbF3rNUqB0HOjHLDVwH7/0g3j3S8qEhm1FfsbPR/p X-Received: by 2002:a05:6870:450b:b0:1ea:6883:99ff with SMTP id e11-20020a056870450b00b001ea688399ffmr1521309oao.5.1697470421731; Mon, 16 Oct 2023 08:33:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470421; cv=pass; d=google.com; s=arc-20160816; b=PJvQBLmTJx9L58/x5f4xp0anI7ltk7PMOAq4LzQbcgko1VbOyqms4JXu/TOFbcm/d2 uG9c0Trpy3WEdowFq5gLXIZRsqLqagjCOAWZfuQ2zPELnDL/Ft5T/yv0ql/AWFbBzGaD kVkD22G62qLqrIZyrte1fSQXrqTksM5uDl59Zj3yMlmnlHG5MovoorD/T+4bvIOq7q6x x3I36bJrMVyVRx3TbXpdNcvXrDJCyEHr3poWzGmrecsmp7tf+xDXfstYWmVunamI30M1 +hhWYe3LzQrynxemDKcKqaNOr/LAGgLMij+ra2DtOzT+E8k08m3poJlsCd68DYbzOodG 7aXg== 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:to:from :dkim-signature; bh=+nlpPOSgD82lCFohI2OxZVAzkZFLmByfJ5q7/Un/BtU=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=w53BfL9iM3kXsC6GAdJDIl28AGzJbn+mfuaLEcO3xbY6NLkIMuGbeQFuDKSq0549uE npWF3PVjt4bpsHJtI+MsBv8pZtTzO2htZIV1VBCKeHSMMjr2U3MOtNXlRgFfTRcSWBAF J/NZIhz2OXHv7lKlT8VczOv7T9icGob46IJz3HO0FWMzVe4X9W5lQ5eswNMaBTYrYE23 VVUrH/5TQFRT/DVgZoCyM5P/E7qGM60aVdH/fPVe3bVjPLuUH8bHwITL3hhkjOyMhQld s3f2AEIpzUgkwEowv8ud8eicD0c93KFFICHkU1k9trgyR92T22kgs8u3DsuC0/Ppn7JH O2Uw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QVgiMOnZ; 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.31 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. [23.128.96.31]) by mx.google.com with ESMTPS id 26-20020a63195a000000b00565e386ff44si10716725pgz.702.2023.10.16.08.33.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=QVgiMOnZ; 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.31 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 AA46B80219C9; Mon, 16 Oct 2023 08:33:39 -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 S233722AbjJPPdE (ORCPT + 18 others); Mon, 16 Oct 2023 11:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233643AbjJPPc4 (ORCPT ); Mon, 16 Oct 2023 11:32:56 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2078.outbound.protection.outlook.com [40.107.104.78]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89997E6 for ; Mon, 16 Oct 2023 08:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RBBxVUMQcPDWdqR3rhatFPJo32IP2xUTo+VKeqBERk019x75VsuAMvbOxI49k2IMJXA43YLbk+tnNxCG7rbMkKteCpQs7Fd3HI05R8MtzaQ+pFiCMY7iN6Z9Ub6FTXgZbA2nt/x4DuDYLZ0lD7cbfxjgWyb2GcErRTTekWeA5ObsHYgTWV5dszwH9w/keWni7h9xRG3waQW6BVP0ODRk14XdXNPm4r8skVq9eizLkhwFqd+dao3wzTl2bgHOCU4UeIH7JLShGdMDyuOiyxudXxu/Ihc2pqEqKR9Mxh1G9rl6cNRRIDeJdMLvlXyLk9tnIQWhY5sO6L8F6Y6qmYjLfQ== 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=+nlpPOSgD82lCFohI2OxZVAzkZFLmByfJ5q7/Un/BtU=; b=jYYc0yN/fggC1AM3E8EBeGYa5w0uMjMks63rvv/OOQ78ZQl2OSudoPyFr5QG+cgpCnG39ZQmPZLSnbUKUq9ZpYXFUHlwgyLph6xpCeJipYnTJkBNf9fT2dgSPDEppAbxLZmBQUgeP7zPY2xqDxTPP2pB4xlOyh/ddOXus+9IYXHs4xt8HMd49uGlus7/bE6w/7BqDSmuVbwVHtJQUKjOHT0CjrQKnd7UD2JhuFc9DF/R8AETkoy00ws+0fxG29PQ7Stpnx6Vjd11fqHrAJt6SDT8Qc+QvygHqwD1nb//tFBco7HgpachLWUvTG7o4VYJk2/pryTRXSR/0rYgwO1iJQ== 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=+nlpPOSgD82lCFohI2OxZVAzkZFLmByfJ5q7/Un/BtU=; b=QVgiMOnZ6e31r5UB8NQNNvxRd59Mw737pHPAFE3sD8ExIMJlYvrH0N0/OdbnOOixXXY/690iPSNsDBCMmGfkA5umxybyq9M5wAELCRNNof7ypLmFzHkCMUWb37StIdFWlKaYppr+z5oNPXniV6bxlspo70VGanO5m6FveNEnquI= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:32:52 +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.6886.034; Mon, 16 Oct 2023 15:32:52 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 3/6] i3c: master: svc: fix ibi may not return mandatory data byte Date: Mon, 16 Oct 2023 11:32:29 -0400 Message-Id: <20231016153232.2851095-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 228fb6ec-eb36-4ae8-85e1-08dbce5d295b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r5DQA8AAe9uCLCPw/yNtnHF/BtLLZ69MhREwJTvSOIez5aXdTkCF1A6/c8xUnWGcrxtBpzo7dhhfRinvgLyIZEcF3BlrLeg2Q2nLP7iCKrQLvsIkIO95YYU0j1zy373/aEkdGL5gafcDyu4yf+gnoh7JLPdh/0d/nOnvcUAAzGy0JSZRHUhm6iyDjitb/hWuLml8pLQmdk30f+F9Az9W2W+z0afAoCfuuO33f3AIpb2Uz8WkaDWTa7EpqvkDfVIyqRGljipGellu4mqw5wjUEmwa77qO6r3dNntVO2Z9usPT9mFkrAA8p1glwNVgCEF9NyTHfV01U3hdMCU2Y/mBOYYJjVyK7QwibjgwXYLgpqQVALrqqwKlGi6Me3JNJe1CDxIn6a1sJEY+b1e48Q43cTDYAxYaHmknn06YhiHxKXuGw+LyP9KVNC+rdixvHH6P0QoiDUZHdH0+W2V3P+6+6Hj4mv81du7s3a3vAlDs2FFdp9KkoFHfoD3TCyqcWKLV86vdoYjQkjgzapsHsgWlmAgMn7kG821cuZM5QvkNnS6aI/hCbpVStc8mSVIx8dWJHdVJg6Q9w9wE2NQ/8m10Y2KMRhRXPqOaiIvjMLxcuW4DVfyMb/cy/A7LN+x9yGaP 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(83380400001)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IoBqb4FNPokrL02kKzDsKh0FN2+tQuLyUOPGzgEtYslwTLUdJ2I2mvRkzfctUnsVX2jeEiViDKjY7ttXGPaLlr9A8LgSYIdnEJKtTgMuzXsuRr4PZX4v9KcgBAp/foqajeWElzOBPq34eNaRsRuUFZTYlNSR73QoRnOgkGIw0ruSZjc0uFt96Rc3/VztkYZdKF/7ie2ySBM7xTbOmyllIhclZF6uUkpf9zw6tNo3X2SiUsY8TPHKpX2nAEG3wS4YeYMSj9yDsgJLMV3Xphs9Gc4Zh4B/L7Wo2ZuQ58swDCSOw60nF1iw0I+2ycqw1d7uZW+NnLF83oUpdEEww88uh/FpWiaMiIFscjiQ5O43x+U0mcplVplUxWW2qOgbFhvNlZKWG9T78QaGvVUkvR9tBMsq1wzIroQLVjAw1v5rXExt5Q68gTNxekBdrYIhw/0LnEAtnthlY39JX4L0UE0ldfG8CKTLGEIdxMG6T7Fqe9s2lN7nCcbyHIgqjqmUEotv8QQZSvaroUNUKfXrEBbdQEt9DLWH44boC3YFakrXyb+MGvohu6HBEjumpa+2VsnVPZCkzoRyiakd8Nu2TOc72/lTpZrbIwHUli2P2DLmfKy2OOd39rqGZmTT5l7VNoLkD656wohOFmJUCU5L2Nr2FOi42weOMyVlAGSSzbl4ok20AH5WIX6F40wNm24RaK480J0DcjPSS5oMdUDnWra8XhAr9XrIBj074AmqmamD1TlGVx0gHoD5iBOJl90FM03ByOFaYxGDuH1LYXXYUsE1kyAYRBcYVDKnDwBhc6f8Lc5M5ujBqAfhfG9JixbrNuZufUtFWSTrix2fkJwOLQgBgMt9nzqU8nEkopjaYTrIYRqjsSWUPLNi0oaPSol/EIfNPD0mq82+1gJFiWFJriYR2+g55fkGj6q++DTgc3X1VdqugGYXN+UDEFsWBwkMNcfP6XckpfnGXtWnkN0faxRvDKLAFBElF3qAPXAExQgSdr2OLDCc//F1/cy8XnfvulkZg3NXsu0lmtii+lUYXKeRnvPOY8ibyBGfPtK8oGBUK3/DoNQVse4VhSH1pwLfIwaPT7g3bHJsSUaLGmH7q9E4RnI4lqkvv/Cavq9QTlPKne5Qsi+thE4Ey9UMpxXW7eD/OId+iqJ5a3CEIrvXEsOwTc2Dl5GlQdyiGYWnUaYFr9eAbDZTpIe6nfD0ur+H+rRsQXL6fBWpOwa+v8QKMfhU31nBn8OjabMkw7bmLHlXVRcTPkOXUbFEAhTUyeZc5jnTUZB7dnOTrs8f1CoX55P7dlX4qjp6gHOs0VQYn5J91nJkrUvTa/vpoPmaGM2WsYaeNMUh8Ries0lVyYiqntvyvBhg0KrE+wHQu/uXXwMga5SSBpoxgmvIVS9oRIiD5S/CWSqoIxNeWkVABWRbLul8iPYp4vLxppnRGXqsSRwmuTLUw6+kQpzuVUr/LhBPReSfZriA3bcce8pJS0MwuIuLpAQPTNO3Qxp36vIuh4Zf0kyM/FsykEE1aggt1HBiQVRskrCfqHVC+3u67HsoUtIey9Wmte5NrHaxIa6Mxd5/0y8= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 228fb6ec-eb36-4ae8-85e1-08dbce5d295b X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:32:52.5814 (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: s8TH6LOoBvCXB3j3NM3BetkRqfwiIOaRbtjPpHw3s4Jy+SI1PqPDcN0o33A8+Jk6JvnF9NFGvckCHXGJfkIEEg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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]); Mon, 16 Oct 2023 08:33:39 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926745087001613 X-GMAIL-MSGID: 1779926745087001613 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 reach checking point. As a result, mandatory data are being missed. Add a wait for MSTATUS[COMPLETE] to ensure that all mandatory data already in FIFO. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li --- 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 0f57a5f75e39..c252446b2bc5 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -331,6 +331,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); @@ -340,6 +341,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 Mon Oct 16 15:32:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153502 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3543621vqb; Mon, 16 Oct 2023 08:33:11 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFLRahCxj9YuiJ17iD3r8IdQHeForC4qTsvVuMlIvcfwVGx5dYaZVXooQUvQvai8/gk0kNz X-Received: by 2002:a17:90a:3da1:b0:274:60c7:e15a with SMTP id i30-20020a17090a3da100b0027460c7e15amr31754832pjc.4.1697470391476; Mon, 16 Oct 2023 08:33:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470391; cv=pass; d=google.com; s=arc-20160816; b=Xt3qW51GsXAfj8nA9NY6xETIcAQHY10kCGvPQVfs3M6nltHRN9jY8/mTBOug6ugtwB utmK+DQrqXgFKGoo9lxj7Ao4+qp0JpkxeEZdX/k51GV6xcavUfNHIQ7QHCoSSUSfQBAs rIhHaQSXZ4aysHL4RtANMpmVgizFFhAaEXuQ+QMFDIVm98UriVXqlR3Hzai2SQQT5Tqc SJDF7rHw8B4khuHVlUJRAoR4zfvm//HfG8QL/L175OryUzlZ9HzzkBtSsFApTFyrC0l1 mIr0MQILe/CHZ2l3NJ290Xkd/caZoUlW/W4I0Ymn8Cwivfc1XDdogA/z4jbhKEVlroQp 3k3Q== 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:to:from :dkim-signature; bh=Pkwx0UMNI50CmR+xgaVcJ28Fsm+ChWROSyDoeW267Xs=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=fQqHjK0n7Jv4knAwO8IZlqQDkQiZn65aSYEzjUXliSSTBa/+LzGP5t2U6IDOZtk9Jn ZoHTcF79LJOBLruZLjl3a/ZDoZ2XoTwGUwEKZy/IW2q6Xw3qRbxrAXeo6pfBNzm6rweq S+YpXExIHx3xrWyEmYyBj2ARbTauOnW9VyJCT7H2ppDxLXijTU3bvhELffV9cvEHnp+9 l+upFmr5Py+ha3Y5eCM6SlNMATqBYkOWOpOAgEVdW9E+u6kWQZT/yOkpS9A+CZ2ob6xR hC+KCUlhxuFCTlKaGWFqK6UhL6xlKp73nKHQj8gHFwRifWIuEVQUmajwb0WrkByZtITw SkNg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=S19mgDaQ; 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 nv11-20020a17090b1b4b00b0026b365096e5si1202268pjb.53.2023.10.16.08.33.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:11 -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=S19mgDaQ; 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 C9449802FD02; Mon, 16 Oct 2023 08:33: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 S233738AbjJPPdG (ORCPT + 18 others); Mon, 16 Oct 2023 11:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233725AbjJPPc7 (ORCPT ); Mon, 16 Oct 2023 11:32:59 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062.outbound.protection.outlook.com [40.107.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70CD3FF for ; Mon, 16 Oct 2023 08:32:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QmC7We94+7hL4bCAfvFTxmKhDQjf597L1h2l7xaIz96qN8zbSbn5DhXaovLwBgj+7BfC5bDv+Dk1BQL4iSIFqyfG3CZaeMhiI8U4TkIsdj1qI1JZge5YCr5x7+CgYuIUadW4LrGedDy5Lb66dVN/2BgRHeH00FEDQzIbNqUi9n15PX6qqfiNVjJmzPjEobl0SdzUUzGc5Mq11UFaGJCeYcCX3gtiORm8DNOjcNCNpGf/gDNN4Gj4XfHPOg5W5LiQQdd4pTQZyHv3WodhjvlxqRoQbhRjdyJfMPfKHsBntcq1ZR09JRGPjUjWA7JM6qdIYWOBwx17GZ2a8vUb+UYxTw== 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=Pkwx0UMNI50CmR+xgaVcJ28Fsm+ChWROSyDoeW267Xs=; b=mWAKQJCSfP2rL0HC9WYZ0dOlhNVbG/G/G8E3fN14Rh+ZE8xTPQ4fMK6bVlvsRpCzINKmrRp/c3fZG06/BenZg85FbIjxELnD6RM6OmPVe9sLKg1yvymN6p5PRuEO1itGNCkIYZCh+O+AV85fkL5wulOKwKfaed+m9+r7H6HN/VCpkMACVwDcvekFvdLPFqlxSIT+cRaid/8m+efq1we7EaTMvu+6OsvC/7Jxc1wOZGgXhYNV/hwH5u60exKirKMMi6q9E0bxvKfKk2xJoJI+Bkmdwvp5FC0jtl/hWIO7nn6O2EnUptHuWV1KdgCN0YcMYI6qpEk+aycx9/qs5pQj3Q== 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=Pkwx0UMNI50CmR+xgaVcJ28Fsm+ChWROSyDoeW267Xs=; b=S19mgDaQjfosE1u4yCHEYBHim0Lk8UVm+DNfqJGKImpYY06pW24UaN5CLRVkMSe+G0sOMTkfaDbajlwUjrc4Hm4nlRo8C6q/tQKu2Iti5B07g6D7lYtkdvfHYjrBsUXbOYKveotgW4TsayYR9kEVXZMisM79fFW05ZjVm/WNvTE= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:32: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.6886.034; Mon, 16 Oct 2023 15:32:55 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 4/6] i3c: master: svc: fix check wrong status register in irq handler Date: Mon, 16 Oct 2023 11:32:30 -0400 Message-Id: <20231016153232.2851095-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 958d9ac9-255c-4b13-75bb-08dbce5d2ab0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: AklonxF0IOuaSK2EjHqFsyVkmMVH8hR0oPnavOguDnuEPcqXborvhO+eyJiu0p9JOxfs+0vT2wcBNSbQpo6LTkGGHPQxg58SIE7BErt4Qdy6GpJScW4bji/zJotVhQ8hsM/yhlpGClF5f8nHX3w+nFLV4P+vRupDxH2tTGZbnlfWMpq5jGGBpkDQMDcqGqwn3RdcQmoO6AJ6lVr0d1QKln5WITxNMOxHeLdCrEuvrP1xYg63r6HR+0Q4UpCVfcNIOL/Y3BklMv3CS4lAoWznlrP+l0Zz7AsKvE4DzK/JPJ56kGB6ZnnzDuRKjS+rf+m/fr3r6q9L9xdxOC+w+HsWD2zX9kCnFfhE8ENTAX26Eup67UTZo9N952Sk769fW0CBR6slQ8hfxPuXI5/39hljd4Y39FtxFGA1XeufEYpCkDgAON4NocaTZFWsYpTiedRGUroigBhtxXdiyGLigcgZ8Q/76SqbKw+dbCYvuUmnG234L28dv2ggryd5hpbb5Cf8uK+kYJeXr1yaOi+YNE2HTMD2vRbrcUBNYFfDSdKGZyn+q+Yk502ubKtgI4xPUH99BWfW7CBIuHVkeDqJJ2ajq8J/4nT+Js0Gd+lOuzaS0PM= 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(83380400001)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(4744005)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lL9nJCaNBMiAiZmDrLSExmgDbVk5kNZIGKh+DReo98rM3GhTegQ2pxcll6UlwtcKVmpEr8aq2muDMSzl1uPdrYLIsKiyQ20J21gduummISRSAuW4WS0FamTs8J+xE8s3r5q15F0WnbylMctO8CVbmY8+2o5CH0iyOD5FIgtdQg/1KlWpzuCpGdrqgMPK5EStsu2KUOdpawwBQha5MmQ8taEdYBA0ijcAJGJQfgVnLH6zaYn3QScVbfRSQp+IKagRidRktf9KG94crRikgqOQFe4Fh8xKUMmMERfJpG5AqhmB0lEJfhB/vZXtxhj03jWt/y42lb3bUhB77HhWFDl1AmCF6tCvfONCahUVJE0AL/19Sw5UYJLzO3ouMDVaVLL7SaNbm/2t4SEhA8pAsf2zp/oQFQmi9evQ5UQOYZfKDGnVp2Wb9GRe2lamdRRJEJm2HnAsm840C9H/VYAHWo5u858TSPYcHc2G8BZHnTEF7WADgDUmAE0RWBJF/qxUczF+/hgjyOcJ8UZYOSHtxucnBVNFiS32trQmoQUyr4t3pKAK/Jlp/ObWGu+v0Nq5cF4MxdhpIUrFEaoLGi58rw2ifcTN+kR1y/GXiENjFPeQk9ZlcRDa7h0gXJPOJOBE35rqYxItlqoJ6TFKdjmd3gjTHergQmLRgmanlErxfjAqyE5b34F5fhNylVRsNIEmXKSLO6thrXaixYqqsMIATcDofUa4Of+6UUINxv3vDfUyu2zHt75CQm1J1tKOwwsU8I1WuWzNaOdfb7Mrvw/7Oa8en/wMN3VYEDIfVcGP6Zj9QbxP7kgHiaRCepsiUSr6LwyFsUVHFg+RuC570XGtxZ5u8GoFba/pOQNchLM/4FoZ70rfP11iaQSjcQ+woZDQDsDrlIqja3RZCs6ojSo6eBgDJ5JUqpcn3w3e2QwmEP2Abt0LbJ60mrKdx/oe4bxwER9+OEdjX58hFgW/Lcvz4PirgTVlvsc95e08fEV8EcKDJt4C67aATV+WXNuIgPctW5BNVNugIyZaQPktgtMSTVF8QZKCcYAL1khjDnCLVENnU/48hGPPBKY69uiFDlahmamXM0CeyPQnAHpFYqzYRkqPAvNF1irr0j36zf63lC148wIPWoyJOB6QwpbuJKAkYAAIHvBRItsB9OpKIW8Tx9F6VhJLbBZ6rS8MVdVOxCnm7A+3+ReEuEGvzUUK8PpgexMSwSiAMrrcBCZUmUyoGOmHpWjCFLQ08bxQ7KYMRN9aePG6BWAI6+Zki7i49vkHRMLsWy5KJJu9E/fiWsQrUnA5gxb1R7aaSENSfaG0MYKbPDnLM7UONEHh8N2LKqumndM4nEqd6P0keTIh2FybWKKks/4JKl3mEroSFYDhxVqjB1XkEecZnWWk1SriSXresQxhVRwL9I8PoseXAJWUN8xf9RS4KRYekJFF08ss/dJWveQJgnnuxRVxPEUjoTIUOzGJZ5fQev3/0UfD/KYQtmFShk+svPsPfUv6IaNK9Swc7rxEhwhuELOM6etBmufCTkm+ZmGsvLvjMX3RTi9rGdmQfBjJ6UyIxK0ieNnETYUBVS0= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 958d9ac9-255c-4b13-75bb-08dbce5d2ab0 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:32:54.9788 (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: 7BOtF7WycGyecc2Dfcew75vgAOWUtH/EnHsxEo0uhrCqGi4+kSv/Ye/59Sz5srvnI0PNtTVm8VMPCRmumKbPTw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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_NONE,SPF_PASS 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]); Mon, 16 Oct 2023 08:33:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926713429900350 X-GMAIL-MSGID: 1779926713429900350 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 Signed-off-by: Frank Li 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 c252446b2bc5..5ab68d6e439d 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -475,7 +475,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 Mon Oct 16 15:32:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153503 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3543674vqb; Mon, 16 Oct 2023 08:33:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHKE2wtB8RcTaLvdKPdPu6BeoJ+5Rqg1Ilp2E7s1/JU211camtODmBaKfmOVCuV8kKTDL6x X-Received: by 2002:a05:6a20:7d85:b0:163:57ba:2ad4 with SMTP id v5-20020a056a207d8500b0016357ba2ad4mr40711102pzj.2.1697470395303; Mon, 16 Oct 2023 08:33:15 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470395; cv=pass; d=google.com; s=arc-20160816; b=cDOEYAK7J9/8uBLPHGm61efyAH/T89cCdMURStNOhJ9egYL2uFXEqvZoti87YfCrRg 5l1FbfcDk3iCbA6J6Su3p9T/KssYV6btX1p/gDERsy9TG5VcO+Kq90v4g2OLCJ0STDxO Ek37NRUS0hKJuicWEhSC5Z5VSYh2bPeHOAklZL2q+6izAXWznBErQGMSgb4WiZ0pug0d r3c3IR0V0kb7MUcB5clN4q12Fh0+HAI8JliL8GbVhmxjUPz96LyPhzGKYYduL53kBEf3 z7x1yBis3ukjfRtOX+qTm+QdO7jmuvb9msWXiu1Gb/NC12gCbTav6Nf/r1nPIaf9Qyw7 JKaA== 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:to:from :dkim-signature; bh=svPLmeygmo1OLpXLFU3spLAsG1jWt+ncndklexvqqX0=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=Fh+VzuNokHI93hze7YCWY3yGBICGZP21Y0LXY0qOZ2wsyieLvtNxba2TXt+g8HIeYi Znn7I5BXRfceg/U3njUMilWhK/pmV1JESi/un731DDdEwZDj2/biOMqK3PMtTsAzcype UY2nK/bEc6rFyCufyMw/xgQ11m1QX6lU5Ff9ImgJZWYNu79+j4P3Tvnz1DW4/Py5bDEY zPm+qLbARyEIUeBdpp01JlV7Ev9ET6JwO1Z7j93HMZj2QhA30i56Il3Lf/ybFYwGLS0B 5B83mvtOnJMufeHmmk1ga8dfTSx2YxUWBpPruE3GVbS1bVbwFYqN2kTgJmSsH1oH5FYF hxzw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=OUX0Kp8x; 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 r145-20020a632b97000000b00578b37ad24bsi10504402pgr.619.2023.10.16.08.33.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:15 -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=OUX0Kp8x; 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 8354A802FD04; Mon, 16 Oct 2023 08:33:14 -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 S233793AbjJPPdI (ORCPT + 18 others); Mon, 16 Oct 2023 11:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233425AbjJPPdB (ORCPT ); Mon, 16 Oct 2023 11:33:01 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2062.outbound.protection.outlook.com [40.107.104.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 47CE9107 for ; Mon, 16 Oct 2023 08:32:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UZ2bdahQ2GbI2sH9R6/h3dYO9x5BxVgcX4uA3AIB2P5+w9iFDZolcLp7ctDbD/DWsEY44Q5o3MDEHjEYibSsyU4RUKhoqvIg64aNvHimxfRhydoM/LIZ/WEI8oyYJfiXh0L+Nb87SQpz7DSUQhvHn2w8bBI5PEAHDvLiLpZsiphR8OKf9ZO+A9hDISuW1EBKwdpo+wd6WAGGgFIWmY+9AHEZ+CUL+1bB0yQh3UDt92YsDBwXxIrJKhlYtB088umbaZiR1oE5jIH2D7hHfJurDIzHZk7YdQK+qcr9sCia6EpUJxUC+sez9AIit4m/RqJcwFrxUALVTzl1qPyBh/NoDQ== 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=svPLmeygmo1OLpXLFU3spLAsG1jWt+ncndklexvqqX0=; b=Z3F/6phuuM6k+hRgdNSiBHjnfYJ3InB3dtLk2qsoIfGDHypwjXswBmL85d4TUZ+Rk4n99ZSkTVHrPW2sQG39ONd5nVGiwqH3LyXSfWGrPq3V/HgXf77J6ikvy3ZuR0TBPqfSabmCEhTp3iABQQfxKvL6eF2mt29UKRKdngv3cCyknUlPkhdrpL4A2HbzYdQAOsTlHoxss2lKVNswp/v9LT0TEndf7/rR77Xc3IIJ8Ik6AOln38kVtm8+wMWrZBwKSriaHu0R2f4I8ThCp0Qi+mORV1XpS+Zgl9cAnMGi7OwNAG1EiuXZ9JRAdkFVHV1LdXm4NgoP7Wc2Rc5mPVMKOQ== 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=svPLmeygmo1OLpXLFU3spLAsG1jWt+ncndklexvqqX0=; b=OUX0Kp8xqvuISFgcW1UVssKNzuf1wVVU8FvGEHsNJRTLxClkkjieM1fdOFeQLXd4ZOvL2eFv0EhzMsSXCykj/jIGDJk/FEdSA7TQFYyDxq1n7OMmH3GuDrD+iNyQaaJJ0P+OGh6ZNqU8D07v2/7U3rkmOU1/llDltD9c6ioSX3Q= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:32:57 +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.6886.034; Mon, 16 Oct 2023 15:32:57 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 5/6] i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen Date: Mon, 16 Oct 2023 11:32:31 -0400 Message-Id: <20231016153232.2851095-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 464e0d18-8fe8-4836-fecb-08dbce5d2c5f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 6QJeyyzmuZngP6gKTxj1zFp92WRrkPGCj4lpf02I7a54XfIGalYNrhwCtBe+TnOsCeKBXvJPRNz2IRCLfSLLMQmJESws8cx3haxgBfMPLLmrpk3WpDnYpGtSJWyd8p1VVzg8ys9bv8J9KW7dtJg6kpUU7UllnWwYP+UTIkCMAPAXnFVaquMlg46foCM8h0+dV4bD3MP/ARqgZLMMCc67Rnyx9JXtHVQpgx04S7I/eadkuiwvipsm2biY6xkPRH2XXzSzD0TDNJ3mCCN7RsIC45yCQTRwGu/XuDiiY/mk9gHIAGDqbdZ+ptl2vTzmaP3TUJfNfALgWFPv8BGYSMR21UpofXelwymaKaI1qzySa6/EQ3B+H/9PB3rE4+q1hKyNSlazoySBfdSOPc2AFu2LqPbkFkCiIxma7QZHUiepI66e6YdPqfWWydiHIKlUd8LAvg0geuJFo+8KVp2vHjhjRZg1jXhq0XRkB38Att+95C/0f7c8hs7i14/kcA/dejzxqjNp5iG9gdJCuF3/q5UNTScoUyFSYEUsRXnsHGt2gyTf56kSOS7ekrSBS/+dWxCkDWffcR2pZsaKl2kxVQLrDmsU2hZV0gd+qpZ2mlcPaV9F8t/ByPfreIqPYJBN9V6O 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(4744005)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: iVMOCfBqIgTPFY+kplyiKwf9lfS3BopNOSlqXaX7itXKUNLsgWHawI7LNYiI7lYxkdd1PH+Ta0v1fpXYQVxG2HacfxQe9+/BrVDodwM5jENRogJ9/tbjUJkRd1Qa0xnVb1MWAynjQc/Uv2njqipWad7z/CqfVraRSh/eNd73Butm6UaFQeWxQ7KJV191D+C9I0T7ZEt8Oy9XQQhcpgV8rOZqS57JD7P3FSQ1JetbkwvfRdXKR/6zjviG5meCVaVkGslTS/qFoeyreM1PNMVClmW/MW1sMrbGUm/E07fUTA22VKmnZ+2Uo2BiS2XVTmYC49MCeL0T2f16iga56AkBVElratGJe2Qs5Zw/EVVjEjFKCyiuFcQrZwoXx2ocjgP5isHEobwecX4bTdemH7gTIyk7+yglG8IpGlkZRnMtzY4c4z1KOe3a8G0A1+mSI1Ngh4MfOTNVvZDbGWk87ZNc9rLRB9R7B90VlOrFYnfQTifepoDmLs/uEnNfNjwxDSEue58PBb/N49oxTqy9Tw9MiI3K3cAp2Q0AGXEzhoepg2CRIEEOgJ0tq1hjt3chznyz5r/OSu4QfUX22vM86iJc+Taa51UaUtDjRGL7nSxJNfqdoUTUl1puIKwnxZjXZMsaOHqnYh/SRtj9hx9i8MsWi3wDyKmbIiNnUi5kFCUhI+E5AmAi1FgNh6kmp0HyO2Xbo4tlivDXvwOMIM+MuDqfstnc0QPKW3ikIpWuyvaCUm/dnR30u+xFGiY2RFF6sx4bVBv3hq93rTCC+WhgJ9I1nFxcUa1KUxKABFhhtNuD9R3tgBn8fzOOyO1E8mP00cehdyo3B410RtDRV3oMAAexC/CEXHvY/wI6D1rYNxUNIRkM2PznCBK+3RY/UEYsQdBR2vG0UT2TgzRikscp/HEMwiJefY+3CvbaNcLTKaEQrqd0+/4U27TjdhYxzvnmcp5wyfnYcW5vFfzWG/2MoOuTs+sCPkfpzkU+XtOzZpCgLTDpWPUW1kvaIOaJdZv6fSvFnVrtOW9cHsIgqkJlKdD6VzZV9meseBNxK1q/dzpFIFjNsS0p3ZknfDAICR3XQQsSRGGJ6NDUg+UUCa1Az+EAQDLvqD7KZLtfOmZNnxUtMa6Nnegfkt7S7yAFx2rS7ONsQktYPGDBcG9AtaLas1orBYuOpiNlfO2Le17nSXzN2hO9XOFR2Zq3GRxxvfuvjaZhnm5NcGt1ZZVOArQq+WaVHKViGcS9+kBIRUy4VkShiXdaa3u018GxTsA4Lx4tw/zP4THM4h92Ck7iKr9FO4kVg9xoPBzcm4xjopsxCBl/D6qubfWNjSKyL6DiwfnBpqjBX4cG+qU7SakoeUISiiKTEZ9MYQjSH/FJA1zMfwwwlxXPMWCuSy4g3c3hWhA7SvlcSJjD39MIpyULe6fdmC+q4LCCisviLdQHwcGfNJUelqCjcLzKPXua4MHBFUT/4msZZudE5r2mQjL+wJ5IffjG1JQbNut8TiovAQGGolp87bANLyCaThGVHrk6iLijv8diHYUf/XKMyusr0xc26mg5qYW5hWKaPpzycZwmRQwiGxA= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 464e0d18-8fe8-4836-fecb-08dbce5d2c5f X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:32:57.7975 (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: M21CludxDsazxwvfhFlclz32ywvU4G/QQi753Gu1SQzsXMIuNtHRbAcykadlrg2IPPIgjRoUiG0pMU/LcmUrQA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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_NONE,SPF_PASS 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]); Mon, 16 Oct 2023 08:33:14 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926717129144450 X-GMAIL-MSGID: 1779926717129144450 Need call svc_i3c_master_emit_stop() release bus. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li --- 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 5ab68d6e439d..5bca369d6912 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -403,6 +403,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 Mon Oct 16 15:32:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153507 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3544026vqb; Mon, 16 Oct 2023 08:33:45 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGQtVq+zRh2nhU57nlxMpJ9Sm3stXswqh1GZYg3nTdPNhVr9obIb3oyNHFCopTcw6C81ZF7 X-Received: by 2002:a17:90a:4ca4:b0:274:99ed:a80c with SMTP id k33-20020a17090a4ca400b0027499eda80cmr31799545pjh.3.1697470424701; Mon, 16 Oct 2023 08:33:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697470424; cv=pass; d=google.com; s=arc-20160816; b=KEpgYY6qvM+vzSqFJ8w5dD859ZRPAkKJ6BmpvzWCHxS6HsturKCx7uiazD22yv+YCn cSDb/iawkdWtD8One/1WnAz19cnMgbTi4gEU11iDkDVg5bWhriGjcBQuTRlM++8oAVuZ xmWlRLQ/HFgGAKBSB/KMk/liovWxexfIVe/pM5PRsWlQHtCMhVVLgzpdUtn9A5Bfk2+U oRNuRkBMLejVqZVPNZdHmphglxjpmfIxcjXBGGGT4S1CX8L3oYPlufYUVKM2vs63H7Ma mJ/VEWOz78jdZMAkNL0g4xWgke4HZE9ZeR+XQUqmbeNfo9FY+4r17YmSNh26C0JBBH0q NMjA== 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:to:from :dkim-signature; bh=jorvWz4GxmzMDIDvdhZin08SLMEa5RtSrhynf9Gb3b0=; fh=bn4KwJ7hiZC6iHD6ocv1YpB9R5Bd8J/ZarfJ7QImr28=; b=b7mJ1j7UMEuuO8NeanfhsP4+iNkMGKBvKvjK3No2+a8LkEnA6tLB1oAv5Cx6DlNHQo KOtqKXu/ekOyRqMe4DrM3+cKsOHIh62xhCiFxUsly11+PoLMJfOevneMHHjsB21XERSi sPDAQOpjZzLwewTpuatm1jc0NMjZAvKPP+wKN1NnHm/PKsuGWvXKTi9NGyk8KHextU/m muR7hmUBN1i6ORKEcGLM9THZYkgxGjwA1QGzXUmRAaJJN2we8l7DPCZ2wWWJA5ZbngTw 9quGw1U496dsjTw6tfTFyx0svSYsssPSRDIhPUPgfvNvglYJwWMHWBcL6e6qimkg9mqv EIdg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rXMw7J8Y; 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.31 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. [23.128.96.31]) by mx.google.com with ESMTPS id bw42-20020a056a0204aa00b005b3097b75c0si5982290pgb.56.2023.10.16.08.33.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:33:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=rXMw7J8Y; 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.31 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 C58208021B2D; Mon, 16 Oct 2023 08:33:42 -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 S233930AbjJPPd0 (ORCPT + 18 others); Mon, 16 Oct 2023 11:33:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233759AbjJPPdF (ORCPT ); Mon, 16 Oct 2023 11:33:05 -0400 Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2040.outbound.protection.outlook.com [40.107.104.40]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2BA5DE6 for ; Mon, 16 Oct 2023 08:33:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VmAUmKqK401Br0AJYvqvy2dhoSu6Jr4/dla8smGWtMbUi6brrR/zqnDLIwave4E1bgEmTNGF7/PwkzkpzznWWiK4l7Sf8NAOgc+3NBwGbq5dbwpT8Rebji7bRFVEDG1OONMXwFkripuQy8Gbi207tLUPzdat8FjwayVr97ZTQjMc1BJPiv0g8DXe+KLASzdllnozlkex6rI/wJG8bZCKGOigVXsYhqJfAwJlqHq5seNSB+G8WCu4kUkDlvvPe1c5GVTw8wMH6m9wnADGFbELLlKuT/MwX3ZNbbQLKQRp2PQBkN4Yo/q1pQn2LteMcyw7DiGAH22RxsuXts3L2vLczA== 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=jorvWz4GxmzMDIDvdhZin08SLMEa5RtSrhynf9Gb3b0=; b=hbBBJzrpUdsNUr3nyIYyEaS3peWMMRi8E2mi0tCB7cisHWJYO9TYeHPyxvgXzTHEAmSfDvYt+5geF4oteQcS/gtWlndfaWDAOHgmNO0bO0q2zHpUvcowHxPgstUk2tmCwtl+TxKBgaJnehyKhvP3nMW0KDYXbHHBdj5mg22E0XyNWRZMgvtYj2O4YBWeO8Wc68etqMAZgYrhvHrelVTC5rkJeDA6Z5BhGVlG6V0WvIXFpL6cqF0QJTRs190mskX4HRteCUtoscuDkqc/UqUQW83nvidP2PbQ44exixder3WwfPEhFWg7PgSOMkxi/+SPFLJnP3s0Rt7tpQGQGa4ERw== 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=jorvWz4GxmzMDIDvdhZin08SLMEa5RtSrhynf9Gb3b0=; b=rXMw7J8YJAr9dIX79Jwi742ViKY2IebJHIkhjS46zoxHOWin6/j6/fvhLRKFt483vhvHs1FWn6KvOkKv3Mwzp8ro0f2szkUJknyuc73l0AEf325MNHLyMEJ5RTgTQcod1m3Hy9m2LJeAebTfHINZeBeCFu7Dcts2iHSTuEtvy5w= 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 AS8PR04MB7592.eurprd04.prod.outlook.com (2603:10a6:20b:23f::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Mon, 16 Oct 2023 15:33:00 +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.6886.034; Mon, 16 Oct 2023 15:33:00 +0000 From: Frank Li To: miquel.raynal@bootlin.com, conor.culhane@silvaco.com, alexandre.belloni@bootlin.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 6/6] i3c: master: svc: fix random hot join failure since timeout error Date: Mon, 16 Oct 2023 11:32:32 -0400 Message-Id: <20231016153232.2851095-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016153232.2851095-1-Frank.Li@nxp.com> References: <20231016153232.2851095-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0P220CA0029.NAMP220.PROD.OUTLOOK.COM (2603:10b6:a03:41b::13) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AS8PR04MB7592:EE_ X-MS-Office365-Filtering-Correlation-Id: 29fbe925-b5c6-4cb2-63fb-08dbce5d2dca X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Omz6K+ukA2OsFCNQkf2lslJ4lb67m29Rgfg2LOyTuzX/C7R7xjDeKlpMGquTaz9qCcsqmhkTEZ0kM3oXw+QUxlJXqpD6YW/bSz+yKiJa0I7hf8GfSbQ/EAMD6OfZdSMUxtueeayvCg1FIFAcCPnThMEe8ORXTKrvwMuZXDDPNbiJkBOcFpMvHSYR2PJqMUbTJVsbcCgXFZXlAlVMrpSKBooWa7xIKog5KLsd2DH0lkYdpn87CIIy2/fi3MFNZxxFWKcBD0s41VvNYbAknJkgQwkbSbGVp6gepjiB87D3AZG6fhIPTwIf0AkVMsFp1p1lJWHk9vUC7KElqjPVkMFj1rSmiMGo8xse/OWuEEZnphQwoomvDbGNldr/VhKlzR66CLGKc8BetbzUEEa0vy7rvVlK/+0wtvxSTK4SaL2nnrYPLGd7M8/aHXEXd6oKaN8N1GmY8Pa6AKw3kGNXi48EJDMNtrD4VypogQyq1AkEgNcXaJfclbhMDPX7Y16MwJBUBl1EexWwW1AawmCFEdzzChJ8QeCk9Ra0xPGyuwCl+n1cTQlOo6eLUakzx3aENFWbSdRSWSifjqJmh4wRIQTyv8nPgW2HVY3FP03v39YUFu8Hd7Qlu0jVpxavlvJ5bF7+ 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)(346002)(136003)(376002)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799009)(186009)(6486002)(38350700005)(36756003)(38100700002)(83380400001)(6666004)(6512007)(26005)(6506007)(316002)(66946007)(66556008)(66476007)(478600001)(1076003)(2616005)(52116002)(2906002)(41300700001)(86362001)(5660300002)(8936002)(8676002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?hzE9PFifwDBpRzJ15Xezk4zAiddL?= =?utf-8?q?irHceZP6ASlN+eghLVVWO6IIkRI5jaItOPJoPVvvCNuhgkrhuXpeZ2tw20Xto7fD2?= =?utf-8?q?AcrrVlyGZaF8oXgz6zO38jI93vIRrtQQuRg97JaSCyZGuUqYew8egcVTEfuXe+vYH?= =?utf-8?q?iXxHHrmKmiaquryKom1bGW0hnY1DSUVii+5R9Lt7zCB+fppiQChHTRmZwaQN7KlGi?= =?utf-8?q?LtZIEdnP+hVovPa7xaKE2ImO8msxrttvIiUKMF48unCimCPRXLUzYqs1vMLrOjv2i?= =?utf-8?q?Q9fU0vmBuDNCOsbiZ5YV4dhkSF6b2sbHCLBabOk7wxO2Kp0+6qDvIFGGkOdyo0lb0?= =?utf-8?q?ZRR3yQgQ47FBQ9dCWOdOBPmzXfUbqik8Ylu3OvwFkEA8aXzMiLyuTaBYKj4qdzDSI?= =?utf-8?q?vHbys+Ay8hDvNIHHAU4R2+ZmqWXAroKSorT4cZjuaJ8qJJ1zZKyKlTqfZj2tA6tqn?= =?utf-8?q?kBJgCIyduFfohEkicH1/314agJ4A1FDwnHJH47g3UsO8zIH1kzdYgy5RS6k+vFFgg?= =?utf-8?q?gob3yxyvl+rLzzG5agpVf/7+qGoeuS5UnyczPO7TvBxkm6EzQ8voajRTqFf8QmbUG?= =?utf-8?q?XvbBC0G/4eUnrYHNJKymCpoEdRg70bfOoEAYvT+HxW1hSZPwk61O5/Gv947pYD8vz?= =?utf-8?q?6eaxTXuTCXfWdu6F/VkVDwfynzQDbsfdY7rOiJOFb4Zy2MDLDHB+wYjocZrBj2RYZ?= =?utf-8?q?Zv12VU8wRYPu1Ga5Pd6ZVxbecg1icdCqlUTQ3qrJmCiiHxfk4NwHq8B2SDCyYW1/I?= =?utf-8?q?GbFHvLTphLPSVUvj23CEUuFGYLjQvV0ZV6fXJH8UKcwQMncK58EYFj7VmvdG1lnX6?= =?utf-8?q?XxZcUf6dkDj02VW0TlwtppbrjvJJkUVgC6upAorhisCTDVayBcEkJ+ZNzkAaVVc4V?= =?utf-8?q?tSNoXjD7e/m+sF44E8ewIMpV/zphJjPhPraocTsgeJhz8nISEhXXT5T15uv+o7A5L?= =?utf-8?q?NKT1iMvz+U/5dmshh88eur8RP9PwhITY1jJ154l7+HmjBih92hNrr/cUN13dnX9rj?= =?utf-8?q?gN2TwH4Ynj9ioUyYrVkiONWYFvR3qTxVoBOSsuKEV6LuEr7aXsrcwzWWhK1TtjDug?= =?utf-8?q?vxiqE+bOyDIuHId+emMkQCWD7A82eoMZY2zHFT9NyTUqwXxbZEAYQuQq+o+NDr9RP?= =?utf-8?q?cMvlQt3QfAEK5Dqx6xmkJ8/pptgyfqpERV93teGYhVe3jwUxCvHnzpELnjg4Cbw8+?= =?utf-8?q?+YVZ93BlTge1TRuEQGdXLGQvyMTYyXexD0KAmEigSIUg/WgshY7IVRIcFYOylZwv4?= =?utf-8?q?XmMORpB2VL8qNZLM36OZ0lCpNoJ454fz/qUNcmxPdPuIgr/3xbqh2Qi/MQgFy1Ls9?= =?utf-8?q?YubbEOhvR6k1VfCCn43nDY0d+eTBM65kXhDZWPj9ICGh/6ULMsfDMMjAG+hMyUias?= =?utf-8?q?Q4lqDQlG3vU1OnApVrP11VzC2PIWYHSBQdD7hVUmKTNyL+C9EdzftWs4rApfVSqzI?= =?utf-8?q?h7sGvMgTgI2qG2yOAL01SYDAQFsBnrONcMi8Tk5SifGiu08CUK0tHh7E=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 29fbe925-b5c6-4cb2-63fb-08dbce5d2dca X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Oct 2023 15:33:00.0238 (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: fqbvfMzSso1nkE2LhfC/pJvaW4YIKna9QxITqKKFJWBikliTVEChVSNdZ1P9bHbeCTwLzvsTfflphDNHgJHNcA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7592 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]); Mon, 16 Oct 2023 08:33:42 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779926748149928261 X-GMAIL-MSGID: 1779926748149928261 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 10 KHz or 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 --- 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 5bca369d6912..18bc277edc8a 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) @@ -225,6 +226,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);