From patchwork Wed Oct 18 15:48:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154939 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4886716vqb; Wed, 18 Oct 2023 08:48:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFZ8P1ukB4h/T8jdZN2D4j8nNZJGe7NUKHvutSCfA2yS0fJhJ/VaO8mtrW3Juf5Q/nUpjjA X-Received: by 2002:a17:902:760d:b0:1c6:2b3d:d918 with SMTP id k13-20020a170902760d00b001c62b3dd918mr5779266pll.3.1697644133675; Wed, 18 Oct 2023 08:48:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644133; cv=pass; d=google.com; s=arc-20160816; b=IDVmyr4y7rSD22+4dIoZrxIGiX5RXCEv/o3PwKfU8ajOlO3SaUn9vRYVVFqEnq4RT4 Wo4194JN/gctHRrxGJQtDXCrWUQRp7+psEyiL7fsB0VnI3qVz8mKK4V+aZv35zGR7F5u O5FY2kcwkzMCv1fabk6FfXKLEu1BehtYFwq0vqiJgIgFegMMgaO+PIL2mI8Cuy+GKi2S VIi5R17pIsiIaPM9e32CMBSDJtLv97Au2bUV8el1I7Qrs2N2DiTb8VhfIQGTQ8b1K4kM ObQtMtq4xWeYDgqc7xzyNxbWC8BOmITvsGl4GYPq93tHtlz55SZEaN1Eae5Bx9NHEWwJ wRJQ== 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=zxJI3Q1/N120E1UZrO8OotkdCQQ9CDow6ekaDNU32Hk=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=oJOKX4M7l7hmqs5o00A81W/ISe/2IqNp/A+BtIdAyhBTylKl37zDWsZvjLmspsB924 c5mPw4ngUlYvZm0Y/drDk5nMZwDsR/NgOkDsvmIqIsIGvdg712iS4UAeK4E34m5QUpLu xL75GtbcMvxS4/mYuzssTC4SiWD4dFI/jU/K6IqWlbmMXTEPQgi/MJWkSBUlNGePwPPZ +iTtXYLhQHk8mJItK10rJHiMITMrX/9efQyoLmbdjxQSRZgRfUDqZHX1xQO8KZyo2Jm5 tfAJOXpaBntzq8sCydrm4+CZBBFI09x7oQI+WKfjGaCW+21vrYyrbYBaq4PvEqRFU4/P wbNA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Jg7E+gzU; 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 d13-20020a170902cecd00b001c74876f029si132461plg.381.2023.10.18.08.48.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:48:53 -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=Jg7E+gzU; 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 7D09D80F8F4C; Wed, 18 Oct 2023 08:48:51 -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 S232110AbjJRPsi (ORCPT + 23 others); Wed, 18 Oct 2023 11:48:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231767AbjJRPsd (ORCPT ); Wed, 18 Oct 2023 11:48:33 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2089.outbound.protection.outlook.com [40.107.6.89]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 998EF116 for ; Wed, 18 Oct 2023 08:48:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VeVPXoPmzEKqhb1UD1I6O1BpPbUmY60nIiXpoi1T+kMu9rMSacmW75LaqJk7Pxan+p/2kk3nkCBA280/GwOKt6Cpemq+gnbkqq/9jjjg/wsVX6NYMIED0x6PWGjBwwd8sJ1HzxlaJhYBP17XB9lE7xY6ToHVc+bK7FwJWnZFNZhDwJ/XrOE7mKmN90i3GI55JAbGZCK8P9EGbGEkrg5q9c5mQaN+Xy9C5KvIP/chJRYkxJoY7Xzqo4C5nNST69JZzQUcRnigCIVvwTbo4CDJBIsAtcRMiwz7bD7knlkZhX8HJeG9qn38vCr8bw7ELlbF08TpjwTwR8rBZfY/YqlnRw== 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=zxJI3Q1/N120E1UZrO8OotkdCQQ9CDow6ekaDNU32Hk=; b=GmmsaLbhFTkvb4RmI9wEpdqsOazmyfFK5HbZc5iFD9IzXPh+gdTreEGtjFfbQg2o7Ce8UhswfsDkqUk5oxyFV9paRaGhcmxJX22XYr4Iw+0/daUMWnU1p/m17IM0DDkS+vTxja59dOz8ESOp9VDkXU11jSRzjV0prC9EUJF2Vyk20P+/4wl4HWVJ5J+x+XpGOgYJVtFvVNQF68wiM7db2aT3Vp/LIbkmP9iZxztQDk4UgrjgHgsvM1Z7ekFh8Gn3GROQyZxLVfuO4dpIfPyNDCLOM2TIVXHttR2lgpUlGxbbT9/VO6n0Kalbkzf1k3wCoX3wJrwG8IPZ+qIvSytEsQ== 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=zxJI3Q1/N120E1UZrO8OotkdCQQ9CDow6ekaDNU32Hk=; b=Jg7E+gzUMtn9lOTW/Txv20o63KVwAzPrGp5Y8G7L9hr65vjuUFfgHUUlV4SRXpp9wdmQUtZPQZgqKimjeZ4vuY8mioMWvWwXJdUIH4NugbmUxa6XZPmMl6pfxYc9TsD5Cgrpz3xRutzDO8fpHhvYZtD4wK4yB91CpKBoJiCzAqs= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48:30 +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; Wed, 18 Oct 2023 15:48:30 +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 v2 1/6] master reduce clock Date: Wed, 18 Oct 2023 11:48:04 -0400 Message-Id: <20231018154809.3304558-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: 1df620a8-decb-426b-4e5d-08dbcff1accd X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Jh8fCvz3YuNDbuzIcsSuT1HBiXw3B/sigeNH2bk6SioXZJ1JXI6Lskqa4p4QWhl4Mz1Aw/YIDwEgLpV1ytRC2+Grg+bnmJV89IFtgRnJ+iSnrqacbR7QskDEGfkRhn44ZfX82sCQyDwydD7xz8FW48TuYuZF3pRRh9u9G/sPcmhd/KH1u24fPdDe1zQMqikszBJSA9IANKgNK4ZQNrJZN2rjqxvPKEBH1hBn3Ip+BMP7/2VCBB/tkR29XhVLNRs73RS6WTqg36e6HodPBrNEj99zB0uFPRRtGyRFHgR5L98yqyf5+I9nSc6Miwb6ny7i4TZU82d5czT0aAso8IiVJlmAJ7u06sOObQm1M0RyMRKCSPNPfvCV7ui7xC7XGJtmPOBTcaGo74iWuwscCg4U0kM2BRJjxCya0Mxufo1LAU/stOQ4+d1sxO/OyN42iP7CrDEfCqba6Kuf5Zo41nRCGSoZbdKAd9ZYWsZ8jzquJOM6iUs5felaNkF4Wgp0+JP1Zl35Vu+L/8WhlWFawIofWQr6MLjRSxL2yERp6eFVNu4BpxdlvbmPmVfaXkuEheWLQpLCi6ieOG7PK1cvRiXnMnMSKeSVIN97O+oFnRdDtnYjyF35BxvuFbIZ36GIxjyJ 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(4744005)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: MGWecXSVnYbtX+HD9vWj9hJAve/wIzvyRBPe09T5163aP8wPuxwl4SsXpErmPdtDEQiAakvMzipc0DcYLEYLuC7Wxnv+xR8reRItQHdkxPqqStDDtgQjki+ZKWpXX2QP93NRVKhfcdMdwp/e7SETMietj00wsCcfQ2Av46VPBZAzYMe853Qlg/iYEV6RGEqpAlcX0kiPcz4iud8zwjybeaxcvy6A+6O+yHQ62fm/HJI5dSWWOrJPQvGYHNkwtgRzi3xoVlBgBJq+s+3oOv6jIE21nCLlhfuV20v6JP55IDTNedEanlQpPwseDZRKt9QY1S4OcbHCOChg66KBGrZNb8KClW/drZfAhx4ab0WJKiuIwoxN4zZvbPqg/CLmdkHoUXBOd7hhK7Qz2cFtU3mLttJlOHxslC5DVvBGbas5a581PsxfVRgc5eK4aJ5njJ0AFPTnXChoqFWwpGOOnHdSxWadxW+5Jg/zHUnQvCBDBr9bNQG+uo266lZ/9U635DvYeNInwKEboetMOIDI73AfQ3RHhc5Ahh8gBDVTwtjJsYMCrhCibxKP6uhh1a71VhJSNgQz5Wny9h0+/bib1HnXNJiN8NBOPzJMwdT4z5EA+hmk3BNWG94VmL5/1TE9FgILL6GpVWg53YaCe9P6dC+5GXl4nP8GNMZ9kMiG64eRV9DsfBjlmw6t4ZqSphCv5zbIyvluhQ5sMtO7kg996Rt3AgDi8VGhot1PhNN8e8f+kT068nPrryokAK2PJxpO4+RiXFWACksY+CpyzIx0WaKSIMZVl+VlpN0aU4md3oLN/NBjZdlGrZcbxhYqH1pkm6ltdmdkUd01N/CNwqxPRfum9jZi49ipjj5F8sOdvb/VJ5VJSbqYb4Hh264pUjYOrxpLeyrCZiQIcHE8jPclyXFJURq/sCfFIBGO20sMXYLTzfrn1NhgTkK57hLS79KrMapHM+nMB/7gzIzBhv7uZlHLR1+wT27Wd/Cabk7F8rtW9XleyVVQw6v60rk59lajTKBNitaTlC06z+HXZTsbC5qBDJi/BnnKUl/B6gyjeVv46qvFLiKNCKKlRUJRIv6/2Lc7hL81xPRjMh1eEbPZnHL2QAJWCdnhG/haRiXkz1mgxeZAdDWmdXToWLAY2IrXV0//8TiIwNJZrdxH3b3rlQ6sBh1bfIekLukETKI4iVC5UJGeMAkWKwV1knyRzrxFQjV/Uj5x6ZHlLqc41GNlYX1A7uPBfrthFtw3a38YZnEE757NIaSEkGghNQR0FLjeOtTH2YYDE2PiQfW2w+hoTJ58NBVsJ24bB4oe/6Pgv6848ertI1xgjM6Kv3XAh8AQU48er8gYINZ6x5yjdpUiliwnUW/fL2Y/ne4FtGIL7mUBfL7rHoS4dDDqyBZ7ZrHT2VPasG2dTR55jRwY0d3eZ1Vn85z4NkksRWqzEywBKxnq3cH9590283YxfoJjJnC/STTpZ8/UC/k4NFhFMXM6zZviGZoa4gy9cP4NwsxjKq9zTrFW5EWk1IQ0THuCtMBrxd/kIq3dEhQZqPW30DG/ExvGRlwT1qbC1DSIL18ZW08aEHhsj8s38gMcakqkFvIjvUXD X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1df620a8-decb-426b-4e5d-08dbcff1accd X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:30.4182 (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: xibRjJmgC29NjHX7sScLMVC4j53lD2TTf5XEpTpQhg05xdFJGO+qZTc0QwJwIsI4TluiSGRRcpvb2twirTmghQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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]); Wed, 18 Oct 2023 08:48:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780108895242593444 X-GMAIL-MSGID: 1780108895242593444 --- drivers/i3c/master/svc-i3c-master.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index e307ba2b965e6..d29de5fe533e6 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -511,7 +511,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m) * Using I3C Push-Pull mode, target is 12.5MHz/80ns period. * Simplest configuration is using a 50% duty-cycle of 40ns. */ - ppbaud = DIV_ROUND_UP(40, fclk_period_ns) - 1; + ppbaud = DIV_ROUND_UP(500, fclk_period_ns) - 1; pplow = 0; /* @@ -521,7 +521,7 @@ static int svc_i3c_master_bus_init(struct i3c_master_controller *m) */ odhpp = 1; high_period_ns = (ppbaud + 1) * fclk_period_ns; - odbaud = DIV_ROUND_UP(240 - high_period_ns, high_period_ns) - 1; + odbaud = DIV_ROUND_UP(540 - high_period_ns, high_period_ns) - 1; od_low_period_ns = (odbaud + 1) * high_period_ns; switch (bus->mode) { From patchwork Wed Oct 18 15:48:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154940 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4886905vqb; Wed, 18 Oct 2023 08:49:20 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHpZ3OxZBBa+LuL7qCBlaX97+lNr5uWqMRpBkWO4GMW4pjZlFNTZuXKUMV25KEaKJyc2YVV X-Received: by 2002:a05:6a00:1c92:b0:690:d0d4:6fb0 with SMTP id y18-20020a056a001c9200b00690d0d46fb0mr5720385pfw.3.1697644160371; Wed, 18 Oct 2023 08:49:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644160; cv=pass; d=google.com; s=arc-20160816; b=xDcrgMDpHxAn/diR1caCUF2R2U4MSUs8qX1xhCetH0p53WOnxyiH+MHXfsEo4IOy50 yp5t95WjT7v6ZYSUVNdXEOIKxvkoRis/p/51tYxKp9sFfof1LDq0NDnZJBojc2cneP4w MTl8B2lW8NeXjOLw+9bJXTBTK5KzUReFiJsyek8t//rEvVKU0uSL8R42PAC0OKk3OaFK CX8VKca02Tc6gSObb+qzukwkQoF7S7pcX/trj3VFKY6VC/uTUf77DhZ64jcZRkDUm0qA qGj4F78AZZYZRfLaQV7ffuLvivwuT+03bGihjbRFOYekAnpJbeIC124hlIfbvPeyA7Q3 zRtg== 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=KIiAS+J+d4jPqahKmAt5BuPu1Yb0XOlDiorZR0246joNBdhS14iZxnLmcfGbYbs2RG /zuwg7RoPs3FmRdxcijeHDVSvx4Fs1qwFw2gzhRgQwkYNDenr1rreUpxluOYfTk+UVNm FzhzEi9ifllLa5kXHzn0434PUzIAIJNTDS+fHhJvJwGGi+Iwv9JwWiM+VBxs5xNBGyCw RTRfCewfbctBPUxYyaPAJG2O2GGZwOi2vZGZu3gZ5tbb3wvu4NO7Y4H394f8IxTOrXGe gBgLCSSeDqzIRUCy6WpLU+GdoH8OZXYMNWG9R2y9r9YvFqS1szkJQXk7eOs3rNI+lwex qMhQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=evmvXvmA; 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 z29-20020aa7949d000000b00690f9e835d8si4100167pfk.132.2023.10.18.08.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:49:20 -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=evmvXvmA; 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 81C3780F8F56; Wed, 18 Oct 2023 08:49:16 -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 S232303AbjJRPss (ORCPT + 23 others); Wed, 18 Oct 2023 11:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232042AbjJRPsi (ORCPT ); Wed, 18 Oct 2023 11:48:38 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77BC311D for ; Wed, 18 Oct 2023 08:48:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l+CenkIwzsnVHsjaS5Cg5ZoLxIUhWxzP9hutF4Y1Eg9GQ637qwbXqTS8zG98yGxgRc6r/z+Nr6QdblKlvrYp1RfkH6Lz6KvDxsiWP1Wa+fUCFEjyuqdczGDEh4hUwhWhR4qQfSN2TZSJn9j1HCVMvQuTF3Ro1kdmk1/iCjuUeccfunxW+eYbhRauNLV67I1Mqs3faaIfPKOtAOMgJsJANmIGpKKaCI3L+fZvsuwiaa3ZGnLQ9xPfXvzXGrDg41DenbJK1rifZdzYR1XrKpGndksm39bhaOdSJAC1fPc3xt3Ob3oFbhdN+KQ7ij40knTK0X592NPyBX/WZR4Il8CUYA== 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=L1Ys++cWQrl2s7nx7FWhIU1sAS/eDdwVeXH/YGxw+0DF81pza6wG+UjBVAfoIAZ63fOp3KUli/tUCh+95LP7dLmAnP7Rz28syW9AzFAst2IW4a237qSF0HL8EZbMQSdVWPGQZ71dOwtDDsAtDK8516DI/zF2sUil0uG45R38EneVswK+CduzBPzz39cmjv9casemZ8ko3N7NY61LOTgQGShbKQFQ5TIW7C4394fvW9kfakzdlneezdmlmGUHK8mtxkW6aYGkR1ww9JcS5YddQErwrf6LUiGNzgBoxKPzgmya6JPmaYPVL3G2MSnnTo9zo8LvZzDXJLHyQL5n/55iLg== 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=evmvXvmAb3RQKhxuEtXQoHA/3NenBbnxL/G/b2BUmf1HL1aHEBW3pCO36YjnPV2qB95BVhW7eSG6wHbLsT9pndy1gOSRFxe3Pf1Lac4CtV6rR6B3sSIy9mxOM36qz0L3FO5lLKV4HwXQPjAe80C8rs8WQqd9g7inwVFpEaQQ3T8= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48:33 +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; Wed, 18 Oct 2023 15:48:32 +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 v2 2/6] i3c: master: svc: fix race condition in ibi work thread Date: Wed, 18 Oct 2023 11:48:05 -0400 Message-Id: <20231018154809.3304558-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: b20d1882-96d6-4a09-aedd-08dbcff1ae94 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0+Q/Ukd5g2IUZXKr+z0tk3w+NIkANMEusDnMctqE0xndhJutSceawI+ojGYUZZhaASkXS+LLhAJANNObkWWyHgRjm6SeeFQxvT25Y9DqGkURkb4hZviv4TW0o0kQetfXRt/2AOVI5ndcrpUeN54dVSLIaVGgCKD7n8yrTeCLvz5XB8nkRMPiprK6M7oK7lOyxCJlF0erfKSZ4vW/JMa+DmZ0oPci9NCXQ0WVj3cAfoaFxfIGQgtBFnm1Bsp1zMV0m9YYZD/gHZxW6Rg5y/q4uwCt5RNkGJyI91/2dZy/pStdKugCRZ/GwTuxTNbmo/ijivFiLk98DWqlVcw0jbXVCuxESqlVKbIY/TMYb0RsNreN/gwibvdhiPD+eCRfN8rv2ZVD4W6WIHjIFpgbmdgD+qz9gRiJtiSDsmKGX2iRvMoi5hMyfTItPmL7fgphHngpXWWrr/jvBfVTsEoE+hgwu7gudaBLjx13V/XkvAYdtskdWTroojzhfc9O6H1hvNf6rscG1uD8rqNSbIPH4hu2Gu5J4P2uT/S0I2PBmxbZ8WAGnRtfoImApA8fl8P1LfSkm0Sf25F5nSqWYa4df08nNVxjVVYOgekMzPY/RX9QALXBSid0Nidm+Bie8cJGXse4 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: zA3JdFDuGC9RgBRVuUr6L/dtDg/B3Za5hxIjdqLGe82mQeTKv2kFQrN4/mbDPybWwnFnrqDHpXkl3U89srg3LrDOnOz7IKROwXiu5LVwtXgCpwipNkANqQi9/HjmeO4Fk0t3d+vrE2RyT8lIlj4A0pXk/y3l2f8TeMx3gUAMTTt8QJqdvaRwwmMlDZLLC6WG0SaPzLU1OA7uheyTyMu7aLW1mzfp93ND/w37QWVbDzHfZx1An3G1ENvCZOLEFzSiz77PrWPUDDmCybDevdIrBokwQ3yVHCu+REPamivE0S7rM6ltSAMO28ZgLgFan03RC4VxxzAcWtVSehwDmHxGSszi/33l2T0ZJhn8mg5vBpcirVAhZS+/YPwGyT/DCmxfjmZwutXAPRcybgp/BJAmoYPmWdshA2eBMAfwmYbnAIoPZaAMuBfoUZ3Noed72lGgTy8RlQYDBhrHEff3eFgoRP9j2gIls7uGRy9CIcfF2vc+pXUAbx5DaEzfJd+BTYHVG+lvfvqMpRG5TAsKrKzzay0ZIloXx2cwYip+0FNQ/U7AHZmZISA+AElhFCtbgCoEdCJ5tWUH/74+NPahNru9pPnPiByBfzprDzxiwX8+MWmbEoqqGm0eQZ8Y6iZvp0JlWbRUBZKxKB2HbO3nUa42dqpXAOPxDWrODeBFEnqpWYt24E9QCSAN+WLoSp6Sl4RbGAK2c4Nq5/cJ6d7922xLPL4tDRrkqDsPkQse84K/fiVYH3u7V5aZ8k8xpXwQv/2DtvAqHIqwj0yqyudQ+ub/7OGCd3x19R9PCs2+QzGfbCPXPPB3Det6R51EEZYTmUo2E9LZAklq96MHHl4KJ5Wj6pWXMg0/RO/0IIdv9GqtK+JTeuh4JAe1FTiD0eHyfRISFe/D4z7A9ct57Sfph4DO8IpJe8j9wrAbqvQ3XjIyg3SBV5K6QOT00FYwFUPqipc4jCNGLDhfC7SUs3pakXgL6NRwluDsIcIYBVFyLrIk9te7/HO1cptwiTBvJ6o/4rPjdU6yaPFuul2oxBp2SB8y1wyF+YYaXeJPWNaVm0riTC8NLukQS+a4+cYCxNqtiCRShzoOfBWadgBstkh5fUkArKAf9Tls6wYyBVv3h9jEouMYtCmkAkmQY7XnXpa2HPxTrUCVvgnFUuJ/6v9jNYA8X+9i00pcwKmo0r5WV3TAuV1CKPfU7gd7+yfC/PwZo0G45TSPF0HBr2kRTR1eXLlypz0QrZXsnolQKCXv60/lcTwwiGDTT3u42LYYzTe1oUWsuva8c+5DVAOaB+admQSrG3GsvdUVV+DiurmTv3BdyApIQkDPADSsrLKhLRQmJ26qxczRheWTHkssqqRmTLXJfuxfmqP0AHKTDKq2uxhsavZkImGGMpM8gGrRwBubffmX1GcrjAG3jroEN3iJsjeR+gaFPNJIxQouxSZt5Oze3TMEijGT/s/xPCJl+tynMyCnef2LKfM+BEHrpMNMc4/slvKNJzHI9jaAprTZyYt1CE6M6PJfnIc6u9TvRalmkYKY8rOLcpIWJTS56PK1C3nbMBS2qzcUjqhbgB6xcND3Htzznoo4zMule/o2EHv/VLTz X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b20d1882-96d6-4a09-aedd-08dbcff1ae94 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:32.7747 (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: 7P7Ie+rzo4AT7Mnud9DtPd5jdNqi1JgJ2vJt96ou2ir8p2HbkB21oDIZsxEY9cvmhPCb24PUwwtt2HkaddMQaw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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]); Wed, 18 Oct 2023 08:49:16 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780108923067534744 X-GMAIL-MSGID: 1780108923067534744 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 Wed Oct 18 15:48:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154942 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4886939vqb; Wed, 18 Oct 2023 08:49:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG86tvIB0dsfs4EV8wFNVxLtfqfeGS+J0bRK2dn5kmLxLQSS2vT15hYlWmchF/4QWdptHI2 X-Received: by 2002:a17:903:334c:b0:1c7:5581:f9c with SMTP id ka12-20020a170903334c00b001c755810f9cmr5634935plb.0.1697644163438; Wed, 18 Oct 2023 08:49:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644163; cv=pass; d=google.com; s=arc-20160816; b=Izqoc/js1Rqz4FozWATgS5aeBTRkoKWqSmfrRZW4AzTN2ev5vhDuuXvdxP1mHrgM4x tKxUM3pFbD69Wjcp3pIQonCY734Ydck131GPOP0zZSZkY/whuW7wietKgngRzGAAu2Lf xLSqpw6kPzbHZSlyecPjXc+J2awO8nZpPDcDppH3rpun8pYpX38Hdyzugu3B3VSo5zEX FKAT+MArdxisMiDPS89Ig39RJNLLhHsnQkpzNxRxSDFWgjTpMN6Xsqnh25qbxhCzq6CV xhfcEoSYCGQFxmGtTac9Y/vcgtT3jo7FewBc30b2XmvlO7HChR9qbySyoHEtfMolRgmx h60w== 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=Dc2N88CMmTZSjgLn5AoONsBi581k/cRIShP/BEVj4nfgYa3vYAlHF5HaEjTR5Ni1B8 yYCXag8cXcKc5McaD+rOMaoQdE8JE+rsJAT/hbWJ7wJf3/vKybiYHxGHZhZ6R2OVgORR UqnDKnAZLYK8GGGeCxfZH8PjtUQwqahJrRbQj8eNefJTNt15a2INHuOXyGUty9yjSaGl PemkFKtvIn56Jo12wkL8xPemF7AtHA7dvGnCkH4CB3lrqEGzLFS0+pyqLy77lVi6rNNt XrEuBmFxoGAHkBudpkRPqN5i+UWgHahj5MPoq8oCtLOV1tdpuo7UYHYEq0VX6SWua014 AcUg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BQSHst45; 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 w16-20020a1709027b9000b001c9cc3a07c3si117617pll.280.2023.10.18.08.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:49:23 -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=BQSHst45; 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 2CCA980562ED; Wed, 18 Oct 2023 08:49:20 -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 S1344066AbjJRPsx (ORCPT + 23 others); Wed, 18 Oct 2023 11:48:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232129AbjJRPsn (ORCPT ); Wed, 18 Oct 2023 11:48:43 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCF8711A for ; Wed, 18 Oct 2023 08:48:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=afqTGQhBV+S01vmLED46XIzuai5p/fUBdGYFZg+zJTmUFIlHaz87EyVaKcDwzgoKJthCs87gmPNurfdGoqnKRmm7bjRco/BXUjBgGv/vHPJqtILG2p/RgMOCB/xa22jpfeTg43oqNodwaHeOxzBABLJsXP7zaB+SgNoFlFaF9Hd4pQaRqU5LcX1nRrkrTtZzKSsOhBc0t1Tjf/3ZoLAnTjgxcA/htgjhoMsVmarWui69OXU9uxQEWAwuvic5p7rO8dvuECmeXVK7nhtStQjxUDQbm23aujMFYCNkpNKxuO0WM0lXOlIJ/Yt+T1bL9GdIEolwnzLMPPLFbi1jJapCww== 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=AZB8u7/PU5Esj3h0w3ySjWfj6elivLpYHUqpyJIS/lnjCTc/HfNlHE04BdbjH0JMMLbqHk6cK+mTAlyKsoK8vrNF6UDwgm8+cFy7uAO1TpQR7eJQqBdW3Hp8z0Lr/pxcYdxLd3JVmwG7qNYzuEF9GPaTqCo66dj/M/gCvbSsVJsttVVzBPdkrOtMxQF9rJLUch/qyufm1qoPIJC7t4HLN/X5GAiKA4Ev+QUpzI2NuMKqyJnKOJgT/VomRHYFJ/eMhFbNWN7YrGNm7I//DWp0lO5C4HIo6heF5GmMmJ6oA/YW+zDrZ5PQFXu7GpASFVwOK6EWwHKSjQ1GBuU0v3/VfQ== 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=BQSHst45l4vP3VRu43j9WQfpoakSpnUa3oogy+JyqHX+vnLO29cHCSpDQJfowaWGIBlsSjJin+EdhVpzGASes8Ll1Z8hajw2CVLPQtzBsmMZvSWqEDSEYhFdcCNEh7TbufPGsB6ht1q2OCU6AyZKh5NURR93xaDnOI9wvOK1Xj8= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48:36 +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; Wed, 18 Oct 2023 15:48:36 +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 v2 3/6] i3c: master: svc: fix wrong data return when IBI happen during start frame Date: Wed, 18 Oct 2023 11:48:06 -0400 Message-Id: <20231018154809.3304558-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: 6e79c569-37fe-446e-ffbc-08dbcff1b00a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: g3pPO8fogqbRA8hyuXJwsLvPDK4fJ5FAH5cfIv6U3kL6WBsfBMhl+SnwG/wXbtUYVvE7kn7fLcQjP/ihem5fyCsFdacu4OMoLtfDENfLR3pMjKV5vuuN0jAS4L5hYbOEImQxiN0jnszJNlq1jrEatMwsz6EH1daqB3vAQgkWEWExRvK5mY9rpsQ77ivUFTdNOraA4EL5l3I5IsydGJTj70j+Ng4vK6PD+jL2Wk/eljIlbS0tlX5l03SWzIw3V+u3DKz7GlxdIVEWNXuN3HWwphISmqHP2/1Unqi36HqjKjhVXvVIHvtXnuKvNznKsyUJP5ow1cRMUkqpLNZ+f3CuO3gQF4jJvunWNhQNIYiS9EsJgBu+n7IWcR7uO/m6pP3qaboMf7HmsQfgV2dhAMnwg3WM03hkklMbj/7O1ivU9ywd1hG8Vu6EF3qF6HkSkROvRcbM/8nADPF7/xfKD2sEs5UHC8So2y1Cg0ihdEWi14VD2q4/sFEOn33B9hzh4R0oPHOnEO8A9stFRRaGM3fCBjK5V5/ms375pWvWkkZSWaQbefJ11IvvT8JO3+fDGHz6plSTAWOGuFsbgNXH4YRuh6Wp5h/lrZ/PrQaMxz2/RLgNZmtb4L6xVXlDpbKB9yEv 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?USXCNXR6QdJHHS0g92DCpxBpschL?= =?utf-8?q?4s5+Xm6fXr62Zy+O0nMcNGragV6jlnJ64OXJnI0pCusO6a02JmREAtGSsJmkVMYIF?= =?utf-8?q?nPhO6BPYqpbX+sLC58rdjazbK2kHlNH1nU8JnOBzgGtGTspjn6EUC8hpIoiQK+7OA?= =?utf-8?q?Oc5r9kYueztfpyEAOgLGrl9MN9RthmwoPeWiK1GbGAk6jqN1FIqhNBKQqxUkCbS2t?= =?utf-8?q?O1Y6Pt3GCLpzXNwZiFQjqnba/JLJcOLBlUPW4zP3lo5S1MfBz/2dGExgh3Hc0Ri75?= =?utf-8?q?LHHsihLXWwe+keR4gRKN4hcwYbHXNArWbDZwkA1yc6TEGPYy8RQXTSZWevNC2Sif0?= =?utf-8?q?wA/lvDSodOlAqAmuSpTwIMVGmEiatjh012gzsijxcN3pw0nuOImaN43c0RV0pyEx1?= =?utf-8?q?64qlviJcOuBtM+7YfQ55UK6Lk1k5fuYbBhEdFCSAAII4WhJbKgPKJ+CLsBkRvfKmt?= =?utf-8?q?kHYWQHXUy1UOA/z0+5sftZLC5Fyxw1ucs0DIPjf2wnjLqICvJzG3ti4EYQnYHsShI?= =?utf-8?q?EUcp/HHN2CZLDXJ/QILwLtNfylbUu/nFQl63tZziKVIu7LaAHT66ufv9G/K1+4Rf6?= =?utf-8?q?dMsVvAvfoiJ18wGH+abL4NE4MyvMkCr8N4PERxKP79tLRJJr5XQGa8ugnAMKuyj/8?= =?utf-8?q?2CDPIpjvdtK1LXwx2C59J8rBo+MxMEwZ5DYWXGOvuXZ/pRzCES/SajeoVW7modQ5K?= =?utf-8?q?BZGkG6CBUsPzI9DpMMbWHtHZ+lhAqlzIg4dbQglnY0DTSn9Sz3e5FCevvEDERSb9x?= =?utf-8?q?zhA/uggCvBy4bcjqkyqOWajc3zZF59MmA3vi3IluXmpKN53NQXKAop18NMnhjWAfO?= =?utf-8?q?/57W4Rn8Dp37l2TVYqDdK50sYOs8xrVmWTEvBFYotmzkXcYcVtEohMp0mer7rHisj?= =?utf-8?q?EGe85psTdVUY+DXI8qpz+5BlFSyk3snDD0UViNv3fbzvCxc5AGpsgPM6FN80jKrT0?= =?utf-8?q?lBfxXQa2o3m5hUPDgGsQKqOGhqmDZHgN3+JlspYO7kZ0g9ji5cVrN6OItiYl5Pmz1?= =?utf-8?q?SJCM37Intmg3c5xaTtKGllGNM4L2w8BKHYl8LJmXb7ZaBlqNuQQFjSIyVtypZxznw?= =?utf-8?q?VlnamnGEAP8E1P3hyjiR3xI+0Di8wyKlFaP/NwXWBfDViUULxhSkxfL/KekvDjVlg?= =?utf-8?q?or3/IxJCdtIE18bHyoY1oDM8CiDrN6rwcHrq5ItPWDrvg7u7t8GSpn7ivBmc+eL5P?= =?utf-8?q?b3eD1zOYMt8JmxnEA441p9EGKSraEqSzBuYNdvOzIyPvvOiqq5Ntne4yNafThV+QC?= =?utf-8?q?7w2P1f6JysM3E3DZgGSgPnJGgnvEo+mKjEN+JPVudoKnYv3hCMI/VEbPsFUZOttFn?= =?utf-8?q?GSZ8VzWFVPV8gDI0RTHqhrfWoOpShMat0bkxMqa4kVxLJPQz4Tf134DxdUoE1g0uG?= =?utf-8?q?yPrggAs+QxeF5iV0YFyBunuvc9mXhbY3PoeDR2+2ws29zWpQwR20L8+Re7B+fG7w2?= =?utf-8?q?ucLceIWuyT2MbnKXW1INwuQeU+D267j1JUOKbTdihfkM8maz/jIdd+Q7UmyT/HhyZ?= =?utf-8?q?MqDrAEuUi6R1?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6e79c569-37fe-446e-ffbc-08dbcff1b00a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:35.7675 (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: zr8YtR3ICoQoXqSYGm4VOWefbS9VGz6RDy9MJDZM6fElBonGCflxgW34xSiKG6A6TldK2Wdld4A08LEwdIpq6A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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]); Wed, 18 Oct 2023 08:49:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780108926231320710 X-GMAIL-MSGID: 1780108926231320710 ┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌───── 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 Wed Oct 18 15:48:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154948 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4893525vqb; Wed, 18 Oct 2023 09:00:44 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiTib2IbPa39ER8UzoirhW20uIl+UsZYX56OjeHTyslNAbcep8VZNlEttQpNylcQJssOT1 X-Received: by 2002:a05:6870:15c2:b0:1e9:a8ff:67e3 with SMTP id k2-20020a05687015c200b001e9a8ff67e3mr6476629oad.4.1697644844159; Wed, 18 Oct 2023 09:00:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644844; cv=pass; d=google.com; s=arc-20160816; b=vDj/d7pq+PFob8WNDOINrdQFTqcXuVLWGs1/KVwaNJIs0JAgoQ3ShCIIT7lQTPo0FO b/pPLH8r3EA8dpfY0CaCBDt4lPjqUHRzn9Eoc3TLnDfVIqesEgS/KKxhmhph3NPTedaQ IqDtxWPXV5r5kizYEP9tNV7a+WeKsslZMYMiVTkUxn/d7yfh+/soj/AXAFucjq1QRZRa MmcX7RNsqj9isq4EtF74v1s0u4HrSkE78/VRlZs3gmrNp2tCUHIPixcprs3m4djqJRfc 74qhppMDd+nL16RVeL2D6Qz2sOofvwbJucUzPQFCl60LmUKLffIgOxlkEpra9RJ6dnqc PHEw== 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=rmA0TmfYW8MJ+DqQikfItM+khhjIvm5K1uwmiII6AZE=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=VyRkv42PltifMzGkqXyfvrxpNC3QLZfCmTFRgRUn+QsflwdpURl2y0PinIbIhFtQUJ uPGg1l2ID1zpwVT9vxp1JZ+G9BrRS0F3nLKX/X2wsltas1eMelIOOiNnSP2l7GrXp+/i pQaBDx8s1ioSM5B+qcmf8yqbe5I2pWKZhXmTqqHclV9TNopseGydc+nZxZYh7HplXwjM zGCWI0LLAIyeYg5kVgtbr8+SLo/V7XvFF0zsqnyEx46MkLmtIeNJDehyxy7LbQedTxU4 YeFt2tNu26/fDvIXtVQsdtrHmgfELXfkuA33VLg+UJ4hXHcy2joc1FAtRmlhm1W+OIpc +vXw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BEaFHAB6; 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.36 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. [23.128.96.36]) by mx.google.com with ESMTPS id y72-20020a638a4b000000b005acd2009192si2469952pgd.13.2023.10.18.09.00.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:00:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=BEaFHAB6; 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.36 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 96B3E80725D4; Wed, 18 Oct 2023 09:00:21 -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 S1344803AbjJRPs4 (ORCPT + 23 others); Wed, 18 Oct 2023 11:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48024 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232191AbjJRPso (ORCPT ); Wed, 18 Oct 2023 11:48:44 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2045.outbound.protection.outlook.com [40.107.6.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9435F12B for ; Wed, 18 Oct 2023 08:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mV3GhGnX77bCWJDXtc+GBx/BQCalJ0WBQJYLVUTS1YG2aZ22NwWD2fPYJYd6a7pwb4jTVahzNikIJmLMR/S8FXc3FNC55Zc0BD6ODOmeRmUqpHeEcpj6KRvRlb6WfVeVJwWIYEJaJIvKqZc7/R7zh1xsmrL7QIAhtzLqTeVuVEkBpe215B6MSwVFDXc8zTZvcxkntE8EuK3K/92X1LnR76EwGpqwLfQQw7oTpMQKTCGtUxHAKwPdXr90HZA7krKuun4WKj4lTreWHPuNK9Us8PbYKsxdjkoiDUo7H8QEB7KdEAHRTVTH1XSbhrLnUciY3pFu1b3cUDtI3tYitfsdcg== 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=rmA0TmfYW8MJ+DqQikfItM+khhjIvm5K1uwmiII6AZE=; b=lStxfRtmJbGx8B55Y7Ik43+YdQ6g6LH3gZZDz61mbus85+21+AylwHfCXoo7vOkarzz7Qi3JznMfmEU7uI6lqHeCkUDWcIFd0vMVD2zszXYkT1TSlTbJGl2Pz+XdIEyddS3jcKuY7kv9zSysP+DpbNAf+7PZ9UfApUqv69qB2erVlblXTER/8w5R5QwtyceHbe9lSmugVn99gi51K4/ZhXQjZRAfinIMMDGUOGxDBFSjFpHs8NU3+1wU62HSGyVL8P1S5b85VB5TNaHFmMlq6v3dT3xHeiLpv3QP/7oWS2XMsxKFdOa7noLTGXHdxVh/wBI3nCD0PWwcZBDlnBmLkQ== 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=rmA0TmfYW8MJ+DqQikfItM+khhjIvm5K1uwmiII6AZE=; b=BEaFHAB6VDbsMMlUgo69cCkGE2ySfMOXEGRVbxSovR+vH47CTMfZFlNadOu2vtqcwQuTWtxtt/mR92bTKv4Zlbrp5GCndqIzS3enF5l7E1dfrzi79jRJjRr3EVDYzSktWyxNsmhU80/zARJzbY2A5ETLTRk5IFmdfOK+19iqKk8= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48:38 +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; Wed, 18 Oct 2023 15:48:38 +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 v2 4/6] i3c: master: svc: fix ibi may not return mandatory data byte Date: Wed, 18 Oct 2023 11:48:07 -0400 Message-Id: <20231018154809.3304558-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: 2deb1180-91c4-4248-c2c1-08dbcff1b1d4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tbe+w5H0apfWOZZNQ01OrziD8IaJqDRL8hba/zyUqCkirsK5Cu9nKV8MiYCKE4SoT5peguTEbqI+I6mI5evgK5KXeGh/fBrg+PtAfHuRdp/e4uRlNwHOji6tk1V8YUGLViZVBjUdnkjUyrDYW0QRze0EDf3XerNZpksGeRnVuSZqJWWXsAuQTKqK2WWicMaJN6QTn49ppaUheG4AsbhStMM5pDXvO2Q/zki3kP+84e5x88QSaEezWE2ZI/HBP/oNYraxBFoyVGjNbwo0jyhKfH38KE/VgEnp+UDj9jmiWMn93Xjr3H8i7OjRYi70XelSFVvNxm0AzbPxlb2l0/EsAFA3tEe5fM5y6YAyU6+hiE2+1RjMBCnqT86UZqyZXCTx7In0HGlU2ByDUqKh57SbMnKtnydh9ZKxo0vzmKV+9I+8kITCCu/314AEK3HIWyUc8PnXVbh53k+d6pOQAyeicgwxBP7WOt20mZaEgMTbh8mhsZj2VWwiBkx2EG58GmGLY9nyqm+CbQ3yPPvWP3M57BL/13k0Tx7dc00XebiaVGwxGmP0IVjw5XZZL1L2CWi0smjOx4iFq2uT21CzenLnIL5F0xbUX77shGBb8k8EEeUT/UW/HMpb3EBema/lZN6k 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YjuaCyS/KmCK38k2Ppy9tfk0XizCa6ZuomtOKMGfaE/i03sLPDtbyTnt0+tPPQ/gGYUKnaj4267R39iD2z+lMt4SJtU/dfzhv91t/5Qve6WwPVtIJOdGMR0uTMDi6xZmYu/+BZgAe5wWlAprO0rHyaBDNbMli7XimCK1Es6lQY3bp25xOX0ZsdZ3cCIXsN1KbqRii6MMxVWwmHYBH2YIQnMKGyL5cJM5qwAWnyyYNHmK6IqBE3Cd4RFGdkYyYk7bdiTKT6E0eyx4nA6qOA0/X4FlqFrnJ7JxjVBB/5wGuJGlvpdgMzM1bMzkpc+l6PH5f8Ab/vpqzK6d0dyywCGWPuqjb6gLD0uN3++ilS0aKgrYMJ5SxLaxmKTIjtYeo2t3Ltoong9g9S80TBb2CqTmp7zPuUcvqnOxFAjd7zf4SvNWFEH+2+Bequ1ktAEPHMvV/1tHMtBUlcZlakkv+9/Li9l0kec1+7VqmEBxmiyH7UZRwfb1Ag+0mtXEtRt+tBMB1tH5aJM5t0Y5lRAdVc5JR4NXfFoocBh+y6dprEFr1lAsUMQmm7/PxSecjxKsoxXmx0uFx6my5ALJJ6dsUYvIC+BQezfo2mygBvso9rJe2bYIZCnFpZrF/7uhLmpPVALM6LxRhDR6w/qgamIxaVPsQQBNkB6HDHHX/dhhtyTuP2ZymnS5CBCNYKld23YST8BB8Ttcbf9E1jQOnumiN1jqghgZPWcHDcxA0Qba6hAmdojzhrWwUAGuRHenT3gFSkRowguEP+bbuedDNJc83hBUJCmkQ6T37Zw8bGjp3uqVer5nqj+vO05/PQ53tmEj3c1GONAPw6Tj5M1owAInqNOAUrSAG9Pk2hCbKuXDAEYlrYzErBx/dtaUHISmNdmqbv/WaLc2ADm7iGhdKDV174C9PrBi8LBE5BNh0nUOJo9bhIbAMkJLbS/c47y9GCvPqhbWRswKR/y/mI3yVcjyv6sY34xFbkdrIHdBTfNTx1XpXJraoXmAdW7cE9TihLgfG3fgSYI6N5dSZA4QrqMjzp1v4Hst9HGLATiIkl+zdgRjsr6T8JzN0NCMy7G9+NMQH4okKkmliDGriILapnLuUmSQTjkx1BM1dOsHkZBlfDxH521HDj2pEjiM/f1IoEcLE6TvF/rk44HH1Rn4QxXbEKiM3GFYGwoyuJb/cxDGgMoQG1UGDKX2pxAt0aXAzgLl7AhW3fF4JsX9styE0u90+0niJjcQ+oPSI87ZCXSXcidzEoDXyeUnxvUWAv9vkIO0QEcT+cz4RI5ALGaJwD8heJlOqfywxcgTKP6mKLsqQpWxCWlE2W5xBAOBnE9ROufABGTwlkoL/baTkKK4Np+JyiKJsUoPAQY20U/pqUfQfkv09SlUACRFNciAopUUIzH87/ur+bo3a8zoZTTCiU8dPKMJ7NkcTFFVcWIjF9rTaWpeaMXMKceQasUEul/EDx6/2EGbXlInX4yUwU56VbLe/Fnf5DTPPwLAV9mHOfFixaP7ymd5nZa/RZc6RCkkHlXEehSZhM+9AfYNkNk44Ipzy4rBZpNokcNeLBjFN5A48QZLCOfT7D+M8d1m8ki+JqDm1QLC X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2deb1180-91c4-4248-c2c1-08dbcff1b1d4 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:38.2040 (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: ogH19tpNhtZkONen2isHhbejKbKjlaM+yO53avLYa8F2Co9z5/rxbVBqscv+CkKEXTQ5HRLXE3thw4NaM2cw1Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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]); Wed, 18 Oct 2023 09:00:21 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780109640406232398 X-GMAIL-MSGID: 1780109640406232398 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 is already in FIFO. Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") Cc: stable@vger.kernel.org Signed-off-by: Frank Li --- Notes: 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 Wed Oct 18 15:48:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154941 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4886923vqb; Wed, 18 Oct 2023 08:49:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEipKsLF4xcX58hCyJvZmSn4d8QT/yKpLsXDE+jvlhCV6K8SYDHhCp28/7fJ0ut+W3rDfEy X-Received: by 2002:a17:90b:3b48:b0:27d:55b4:e72 with SMTP id ot8-20020a17090b3b4800b0027d55b40e72mr5924118pjb.2.1697644161760; Wed, 18 Oct 2023 08:49:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644161; cv=pass; d=google.com; s=arc-20160816; b=T8O5Ok5HZJPOtowhTiXNCW3gXwE4mb0c277s3OnmKhF526sJox240NnmIW1Ucb81n7 DwWqs0trBcZWUB/wdffuC1cIkKw5EaWoUUNqVrgjBOQalcPPhB1JQDp1gmD1nkEH6v4h cChfPi6namKPuTb9fkHCexmdoosmBzT1/1ABSkC3Skv9IzKSn58a1Mh2h+TagdQvXsn2 LTxU96tOtgJsEzm+jj2x0sfZSJmc7k0VKu9bpzDtk9QZfGw1JxvTowd0kqTwhnMeIloH hH9E2B7gJofAcfLdoUYuSL0Tks5x6Zd5oKow6++q1iEObm4PcqFC/cfpSYx4p49KPINS m8QQ== 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=m504Q6qvpgHyLNW2YEZd6Q5/L1sz6yLzyuqKQvk8KIutYOeCSQrxGsAHkyOb5pERte pkoGkWtNS3WFNiK02V5qHsHh1t9yI+Bsf8+KTcEc4tgvPWcuCeD83vDldvXdb+MORVnr FWNpDya4LpHGTgRopBTosQpVhxNJPE+oQO24I3W3/UkbfKAviTA3YQt2Z+6lKnNr2fZl Jpt0TeVlQ3d+bxlx7j6vx3Oe7F2xRJHOKZ1f67dmEDpAJbvrqQUXOdVAq65RFDxdbA9X JwbFVG2h/O0R97zhxrAlh3iZzeEoWaDa+K33905OKCnI/bOVeHSJsYnR6DQfa6va4ks6 lmbw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ZLKZ8NZ+; 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.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id in8-20020a17090b438800b0027da14d150esi51310pjb.187.2023.10.18.08.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:49:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=ZLKZ8NZ+; 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.38 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 fry.vger.email (Postfix) with ESMTP id BC95780C6DDE; Wed, 18 Oct 2023 08:49:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232146AbjJRPtB (ORCPT + 23 others); Wed, 18 Oct 2023 11:49:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232263AbjJRPsr (ORCPT ); Wed, 18 Oct 2023 11:48:47 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2062.outbound.protection.outlook.com [40.107.6.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D51811D for ; Wed, 18 Oct 2023 08:48:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Sf0z5Ht8MDN+QtGCuqSwLunbyZp2YBagN3WMcjiKeu5DiyqPDVf8UXl/Hj3yesZ0ZU+zSul8HjLnX/rNttC3EHs/BLn6Thdc9izuY61FPzUYn2twtcvCbCT6xGrOB3C9cT5q9qQ+eiNQL9g73jRU3vx2/pSCiMJqabrZoCZCvPW8dEtlOM5sgovzG/ZxWnJNCH2nPl3XEIcZdNtBbGJa6U8axQU7ezz/17txE9NOpT0wZpOAtQQgQQdXP48VO8Et+reLr2bI122t6MTre65yX3rX8ir/OfJqKCGZ1SJ2xQ7vkjdD+CUhCI5NkUxm+vY3Oqp4eYdIFoQ5B55lBiBiZA== 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=Bp0hElbf1iM4KVy/QmwCs0lEAduzKxsFda9GJU+HEruhOMcDRDyXTWg2g5Orh9t0+S4x6hYm+Z3swTIlEBH3oMBOmjc1PjbZgT2hysWrfvvRp6/STMqf/HaTrAqT025RmorE84AbXhGUP8zU9wRkDWYFc2woMnCcvMR31ZB5mMdtUrYSEq3wZbKNH1j06I3zAGS2PPcMqVWHkX89wwBkvvu9uIiHejIL2cyG30jL4hZqpZ/KoBxxi4YIOCc/uvYGg9sBuYV3wFKu90pmr/doQ9IPOcgke98kgSWY40Dc+qKsu6yVGdGalx6fFpfuKVABiAcbZ4tE24cUk1NEo4+YjA== 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=ZLKZ8NZ+v31L84V+xd1aWL7jQjpYao+Htoo377qKt6uQukQP3HioimYblMPRC2t8uo8L/DZpag6O/mbaI6qQFRYObi26oFtQYWmLuvwaBHFZ/CwVY7mk+E+LWn8Y1wCGAjwvZl0IAGgw+AF6u7Im5w8O+XtiVylEV5+3pqIdUxE= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48:42 +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; Wed, 18 Oct 2023 15:48:42 +0000 From: Frank Li To: miquel.raynal@bootlin.com Cc: Frank.Li@nxp.com, alexandre.belloni@bootlin.com, conor.culhane@silvaco.com, imx@lists.linux.dev, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 5/6] i3c: master: svc: fix check wrong status register in irq handler Date: Wed, 18 Oct 2023 11:48:08 -0400 Message-Id: <20231018154809.3304558-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: 78fc1490-50dc-4c58-632b-08dbcff1b33a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j2hQV3ymHm6djGEuZvc9UoObUFDKb+exdGptBRfUUPEkq3I62gnzr/e3h6CHTZSnZ+J+KGpMhGkYkd6hQhW7JXehSbiCov8QxN16RLEM0VWOE5zsKDk6AVf7h8phbHhxi24sw0gpwcbWY9KyM/EUvxHDVM/ODnS+Nq2NyrUTX8CXPsNEWuvH5wiIgnThIBy/rxH6sm2wjkScSxFBmHSzGs/zB1GHAjxmcQMEieSLGZWsnGAanDOj6TdwKzUcihOZet89x5qPCBGeNgIw/Wz6xjUYyEHdvq3A5po6CWOMLi6yu4hFjveDGyDP75T9/IngfMyKbreiasXgCtIFGcP1V1Gthr0S66wkzi9yZw7pByJEag6mI5IYmEzTLbmMebJ9rI2rEEVHhfQdAE2Ajkol3UNC0eBFMa2879c0iKWmMpVzPq/m7tglMkjGTUlQWV5Yaf+FJNzX8For34juOfwb7CS20q4Pqi1e7Dd5mXMLEHL0L/MoW2ICnmmixrVpLPEtb0nH5ZIwYVT5QDUqUIBYAUsqrI/dFJEOFw1mOn3+eeNk6IX3vEy/2Stp+PcVSPHkBNhpyzmtsS8WEb7bfiwFpZ1P3qU8T0M6Ctrz2gvimeFmkoJSa1wRyl3SFhgv+8n8 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: j0QtZFf3aYWpYZxkYWbaudE/uMmdXYs2x37Apel2A4JEpj07lKW+XT2lY2srelMCq/9/82g9jPwoohKVftQsiDNf0la+RnbrRQPm11BOQkA86N50w7chav2q5zDGmCD7BrdfwBYUWbpNxjJVsdqaSWO7SckAF9mWR614ECGqlRDvTUKt5JCpKCD4iuz7Skoe6FcsQD5SxWmVWfFLOf4hpToVzukj7dJaF91w9kWpfXz712b2FpwaG9SOx6KmU9JPdUE/jKjhKq0oipXN8fYC2b7zvQYwp7dS0ITEaRkEcYKCdPkEdG4OBJgmnP1N7IghPhvdhjE8EBUerNE32MwYfvQwo25qXSO4dU4ga9a2A6nmoUVXCyfzZQ9LWjAFqSgbR8I2Uph5R7K/T62kN6Qmju58wHFfxebXO9thYtqGXuXZmKs493Jmx5KJCM2q1sr8NFViHMQapd4ukqznPfI3hfUTWf6o6lwD3XMV78V5bkqEjPNvaCiqVu6frbrNo7ogH3uFmkhhxJ+C+dTkrnEX8VBuIRrPSp8vSEHXFgOAGk4BN+y5O/UDg3SeY3aL6BZ6kOCCE8QA/DW1iCfkRkZ1NrFZLYd0AE+fxGYQy6XmT+wgGyTSsrtUj0DF36gOPduycOOH/GAyLjx4vFzZRWPC8vm7kUrpYZYY9+duEz9kR9JMxmHw//+RoPoLPH2NQAjjTb3whrQQEhFu/R+3WW2gyZ0M3xCfCdOshcE9QTYLECJe24AopN1W4NMuAEFnbz2Z20TdtP07SjSeVjoowME8DVdA7GFl/MkibW9xKmcT9NBJYeBN/KdGaq6ceairEqPQ7PRk+ERvHVDPRtr31xCfVvwbEwFDQVTuwAB4NATB0heoVQQedfsTXVJry9xI2H0RSmz20j7+C/B+5kbB/YCPEaDwe4Wn2PahRtPDlL/0AIpPWvC4Zf2Ss4TXM/PrqomdF3JaxssG92ngDPgELD4yJS+149EnR/XVJxUn8AUYNflbinxlTHasgPSRf4FSUpsCc+vkWx1N8hBIxXZKJEZvk4NKIDie36nV++OfHxv9fROiudjawzht7bBMk/Cj6ej9aEkJlQwUokwxRSaL5oe5xFlTsqNVQvn5/VMTHerQU4PKBgX+zG3+BM2z0/wOmxGGcZWMFrrWISJljToTcBdFGhKWWQZ44zP5p7kOj8vCIPDb9fccTcJ26y9qgJWLqnaZrljueNjcESpjuKSwRVAIKHZoI8TVSQq6hSlqP6tubY30tpqFVijCP6+/HTbH++kpbXoOWzdOR0DXUVQXuLutWPRprEUgQbOFONA6ByXVF+FAjI+hj0q13mu2Vd8EqgpA7gUhzgrFJHv0MU7Fg1R2g1gjl9YblJGhuPzvLdeHBBrR1C9z+RpznUZhKUd6VFeUsLwJT6V6GU7f3kYBk/JFvwsfABPykH0vEEes5Q4NzMAx4hqaZSqCgalBmN7buGTYExTUvj0L9OJfNCIMzlLX34Y9yKR8Pfxz2tNGwxsDWTKjlttE9ZSV3cnuDbqRoREO4nyqgmuhH8I2f3OYBlT6KE/A2FKfocRNZidFVYtuDrqGM6BUtVC8lmw9j3yTy19F X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 78fc1490-50dc-4c58-632b-08dbcff1b33a X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:41.6971 (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: 4AksJpKiTfA0O9w1rwQOYzRn2fe7HQJBID/6YLvjFZeo4Q870KY0jxE5zCRK2vQvPHalrjkGtLqggYx4P7HzGQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 18 Oct 2023 08:49:15 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780108924424069342 X-GMAIL-MSGID: 1780108924424069342 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 Wed Oct 18 15:48:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 154943 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp4886999vqb; Wed, 18 Oct 2023 08:49:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFN/umNpbfsc6oPeJ/lCkzDwGDUakj93wR/3/jC6ZYJ6jCa2Q91awCKmQUIlCsILe67fsBH X-Received: by 2002:a05:6a20:9741:b0:163:ab09:196d with SMTP id hs1-20020a056a20974100b00163ab09196dmr5202979pzc.1.1697644170912; Wed, 18 Oct 2023 08:49:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697644170; cv=pass; d=google.com; s=arc-20160816; b=R8O8liDYwIe4qCiNcKmFeznsaYW1ZkqeaZOdcBg1umosqTJSJiS6f8tThPvhtMnJ3Y 5QpCAi0q5Z5oL95D93ii8WexgtT82yzL1Nl3pVB7L6w1Pyv3wQehmry1ztmyzCBf9rJd cZw/wlXGSnyg5k2NftnXOxvbzgmeuGdDMME2gYdk8+JcDH5TTmNmrrY4kzJeiguRCsZQ eFCh8F5q+i8c1HC2UQRTwhYM5xBXRchBguMamu5/PmiZ+ByV2j1d6Q6J/n1R121hP16P eG+V6IwUd39UXRxyiQ1Q3WnI9FtifR0/c3vSlT48xDEBOavjWOsqQAwWFC8D3rquk+4I fezQ== 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=HRiKdLELnJRJ0nyk972LH2tykiePszc/EPeBiGyUew8=; fh=sDe3TG6/b46JEOvF2xh0f1K4oYWCH8cpxTVfh1/w/G8=; b=pNFpQVx7rRl/4zbAflk+xsWJQ/BI5liEzp01ZqitSFWpnnCJGxbLqo9+GgU9FoBJB7 WL2k/lzpUBQjYlCZWYe4eDhI/id+/PQYdkDFOXESHxR6KLLAgGRJ8SxpaJxYAcn1veo6 JmKQ3G9uqfDFQePGWgiJjJH+1Abp7ckGK72zLf2nfZ2/1nIqs7R+mpXCDRb2Fm/nQdCh 16v5DndYzizj5FEhYBdgFbzALW1ss/qTF4q4GeJ7VWdrlTzPHbLZlkCuUZZi9n4h+ANN TiuYT5eVnbWKUyDzeaUiz5OCYULMtgOhPflhz+5dQxoyqEX7ZMY11sSxYQ/pU28eUhdR Y6Qw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Wll0VfR3; 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 j63-20020a638042000000b005ac7812065fsi2521955pgd.18.2023.10.18.08.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 08:49:30 -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=Wll0VfR3; 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 A068480F9CA5; Wed, 18 Oct 2023 08:49:28 -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 S232183AbjJRPtE (ORCPT + 23 others); Wed, 18 Oct 2023 11:49:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47982 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232311AbjJRPss (ORCPT ); Wed, 18 Oct 2023 11:48:48 -0400 Received: from EUR04-DB3-obe.outbound.protection.outlook.com (mail-db3eur04on2062.outbound.protection.outlook.com [40.107.6.62]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52C9A130 for ; Wed, 18 Oct 2023 08:48:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SGrhov8fI6zL8mWhSFC88UxAjsDKtPSeyQIhcFXsNu0fTn9Th/GwutiML7b2b0izNTrRvjnHoRNy3dwmPrtw7liZuve4wOzSstPm45fWg0iWtch57UyyHC7K9+MKjE/bB+0Qg/D1ZwAcp7FcCn/Q3z7BhDVfUnr+ZYkCsE58mnUx8fMbvh5OgbPYkGNN780JAFjrEwovwv65AKO9A7DTNkswONpoz68aBFfl5it5oSrxp9k14k92dT1YsmVhAJbKBzgQ70VfTVZk/IHr55Q6kviuO59L9R3SG/BX6t2wBiHoBFB2G7zqeQ14RqfQZLG6qoeQKMKgqdWbhKQTgUgcLg== 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=HRiKdLELnJRJ0nyk972LH2tykiePszc/EPeBiGyUew8=; b=NsSBsUohwxo9xnO0SFbnH/gBNUk5jgf7tzmlREUaEkznvpaOGkyopvdc8tjs0sj6EfwI35m5Ijvd4YCGrLgfyVWE4pQ/vPnryTHSGlhHMk7X/cS++MN6lf5gJpmGwojwPlV6wb3DMTnzkyzeoJkeLga0F/5jNEnOt8TzI2UUDB+xI1+gPMh8AdWEsbCMf1SwehuEaQpharSvGIyXUWbgMCP4+g6BzQnh4l8jFI8JTrosCjrvESiz6ZKcCFUrruCCIiDST9jht1gmpQspUcs8n56GBwNyETo6DQpKWnBYx02vvZw4c/aVYO7YkQzyv643riOa3yPSK4l7QIhsgfi6Zg== 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=HRiKdLELnJRJ0nyk972LH2tykiePszc/EPeBiGyUew8=; b=Wll0VfR3jRzEhCp4FzPqF9wn/ris6GnAoNHQ/v7ficZ8qc9ycRqux/h/ojMJA2wOSPLII/k7QDtmgMXSKxhNCMPBs4JDFBQ7Ujtq/I+BZU0/mZb9RZOpBOTEWBSA38O2jr0+pvRtFAeZOsAoQoHpHZrenPVz6Tkup0xEJd69TRY= 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 GVXPR04MB9777.eurprd04.prod.outlook.com (2603:10a6:150:115::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.36; Wed, 18 Oct 2023 15:48: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; Wed, 18 Oct 2023 15:48: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 v2 6/6] i3c: master: svc: fix SDA keep low when polling IBIWON timeout happen Date: Wed, 18 Oct 2023 11:48:09 -0400 Message-Id: <20231018154809.3304558-7-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231018154809.3304558-1-Frank.Li@nxp.com> References: <20231018154809.3304558-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0087.namprd03.prod.outlook.com (2603:10b6:a03:331::32) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|GVXPR04MB9777:EE_ X-MS-Office365-Filtering-Correlation-Id: 0ced5ba4-5fa5-48b4-bf87-08dbcff1b55e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r7rB+zp2xEpftdMfpGDFhcqR1oOQQpS/M33D9/C06whG541Ky63FESVJxYqQJDxB/hxsK3B0KdZhB+maHpFgBJ/MHACzFE+YIie1ZotqKm0dRMSs4m6rasjVO4992ZSRqCAHTByGPDk3fLB5yKyZalNm/zqGChClEO31ei7Pq0XuSIQeNSGjxmD2GnJNFI1YBBluNHvSpC19j4wpZQEcf4a/7Nbf2BUE8raoRMhY9GhQ6kYE/NnZ6tyNf+wpniisqujoiaOEtGJy0Imu0RxAm4Vu5FferAhgqUma4QXIlXCb9GtDVBjC/m99tk6WnS2F9wZrDobQ+XXxnNeSkzKSyHP0v1QXRs736p8b5cVg+S4dOx3qq+r7ys6qNZdhOVtkI1egVvR5yI21EQG2P+gSH4GdfT+aWBgGSAqa8yNhg/9ytWhcpuPoD/GdBAe7cJFijLCpPN3jhwyxN/ATH6TkV02YLybGpnLIIuFIHWNKWS2V5YLIiCOvKGaTzsyVziLZl6x1KP+F1sUSUc9gdkoq4OGj3/We5dGY4xaSlh2M4emzjCt52xyVMppVe6C5au3Aw/k1bO79YzeNUJpzmdPlj8On3MY4C4yEVaU//ioFqqr0XCJjFFnVCNUPVVNAmmeh 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)(366004)(396003)(136003)(346002)(376002)(39860400002)(230922051799003)(64100799003)(186009)(451199024)(1800799009)(38350700005)(52116002)(6666004)(6486002)(6506007)(6512007)(478600001)(66556008)(6916009)(66476007)(316002)(66946007)(36756003)(2616005)(1076003)(83380400001)(26005)(41300700001)(38100700002)(5660300002)(4744005)(8936002)(4326008)(8676002)(2906002)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Rmakb5F2Gaiw/HJwAu8lZOW2FjbOSyvvMyZQUYamq2/rTF5E2aume+2b4pkBKZIJ3PkEpR5bLc91CMNc2qbdcLTkF+8MClUpjGnDtQ5rUQujP8JbXNhcVih4oqpXDrY0apzXFpyBtXeAh1BzoEpJZ9taKpuAbZB7rHarSPSJsE8AzyzlG+iBggkVph8yRrZvTTpPr8DUR1oT3PQqCTdlLvPTJfaBLufcvKi/rMHi6vnVyrnFLTfvx9qFv5Uk4psCbDtDExYasGamrcst2U0UxWzGyQSHoUTId/B+zezeWxdIU3D7uUDIk37oCC2mS52hEvWaWgWxoIYajFd8x4Jz/r0zsEb7iBybgs3e+/ntgdf3iI5XKH1QDrCqnwVws+9Gf9/SrEZgqOghjLHLModR2rUwW5QdeYK07N9vJl57c5n7CuGrfzkOJoIcpcKIYvbxsFiQTqlyLll9J1KGduUDIaQu64sNFP3AA5G/lEs0bKH8J1eUKCaPa8JrW8b8wXyfwNFbBOtDuQb+XepEjCpCbqYHwTsT+4L/vHz56lsVvLqeC5Jzb3GOzw/NH/3SWy0RUl+R9rwNunM68QL1087yBpmSRXoKT+dyt8GYraDDgYqqiSdf5DP1h3IiWG9WDK+a4xflWk+akoHrPorn9HHqTkzNsWDVbIZOaJG93hxu6yPvgFh7bJsl7tUMEYLzxp6sRxfE5vCsRojQluoiyZzAjSa6DzsNt07PgM6lo6+bivWqU7fh1d8UjXyLHt3kKKiF72KEQdGRAe2Z1Ab8HL6uO1TvngoDYYSzJDIDwEsPXXtTZvwS+8+wcZvbDZmx4lrukeRkDFUSRBw/OjLl3mTeJBSIALqwjzMwJOqc3Rgph+C8a+eUQ+6ueuIokjw8Ayut1RMV3DbtmMnnXgUXaHcZQZN29nYLphi71TPAes+MhRNdADbXmrdLScugxSQ/uMLc5CUMIl4QSk+m+/NFwErMWH0hf39KTy6si64+682h/zD4vPPQYH0DCiOS/q055mKnEydI3fEzo55v8wxkIdOX0MSb4NMuy+XcZn0O/uk0RUNO7EXRmKxHVlXgB/61d47Vr7ggkBXsqvfQfXIGObb7j2bgmJmXlQMGCKHC8d+J4lU0R+dPCgJhPhcQPfXUReyJPXVMNj3T5WQFFDV6Dz698DSUrkXW2m0qj3azvieKN01FC5XW9vPxfX8qXe2ZvsISWwYgcC4SVEYjST6SvPD8GGkAF9FJWIDrbb8wVywjWcV6RsfvI0y9ZpXgHj49X2Oh9YYDMmqTo0YmP9VlN4Xz2yh/gM/ZstvkPgPpyZSfHcwHNTp3cWmhXBBQhM+wxfBafSs6retjBXhgCgv8xtjQkbfd+sFBfqJfUa2Bgm237ZztTdtJhrT5oeWnTiRPDA1iMTxythrOzKADZeH+BDtRzAEGoDmTHkPtaCqQGjSr/swI2GY6OX7JYZrxQkCUU0C30JSpSP8e/fj+pvNCV6asSie5qhYcxvDQUvDRAXkb8UIQX6GrNlw1xmXiSlorseficD7LNn5qH00eKffQ6T/W5SmNORBTV554vizIKXcIeWWdmTVHLbt/qQjzsmXcjXRa X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0ced5ba4-5fa5-48b4-bf87-08dbcff1b55e X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2023 15:48:44.2846 (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: AbpqE8UHBIPP1/uHbGLSYPsaISRwc3jvcX/n2y6D2SyY5TyZzhRUHb4atlURTi/QlXz8vDTz+fBwNYhZqjfVkw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR04MB9777 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]); Wed, 18 Oct 2023 08:49:28 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780108934042610820 X-GMAIL-MSGID: 1780108934042610820 If IBIWON timeout happen, SDA line will always keep low because miss emit stop. 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 Signed-off-by: Frank Li --- Notes: 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; }