Message ID | 20231016153232.2851095-3-Frank.Li@nxp.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;hjfbswb@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <Frank.Li@nxp.com> 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> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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 |
Series |
i3c: master: svc: collection of bugs fixes
|
|
Commit Message
Frank Li
Oct. 16, 2023, 3:32 p.m. UTC
┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌─────
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 <Frank.Li@nxp.com>
---
drivers/i3c/master/svc-i3c-master.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Comments
Hi Frank, Frank.Li@nxp.com wrote on Mon, 16 Oct 2023 11:32:28 -0400: > ┌─────┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┏──┐ ┌───── > SCL: ┘ └─────┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┛ └──┘ > ───┐ ┌─────┐ ┌─────┐ ┌───────────┐ > SDA: └───────────────────────┘ └─────┘ └─────┘ └───── > xxx╱ ╲╱ ╲╱ ╲╱ ╲╱ ╲ > : xxx╲IBI ╱╲ Addr(0x0a) ╱╲ RW ╱╲NACK╱╲ S ╱ > > In-Band Interrupt (IBI) occurred and IBI work thread may not to be If an In-Band... occurs and the IBI work thread is not immediately scheduled, when svc... initiates an I3C transfer and attempts... > 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 Add IBIWON check in svc_... > situation occurs, a failure is now returned to the driver. return a failure... > > Fixes: dd3c52846d59 ("i3c: master: svc: Add Silvaco I3C master driver") > Cc: stable@vger.kernel.org > Signed-off-by: Frank Li <Frank.Li@nxp.com> > --- > 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. Typos: yeild and falure > + */ > + if (SVC_I3C_MSTATUS_IBIWON(reg)) { > + ret = -ENXIO; > + goto emit_stop; > + } > + > if (rnw) > ret = svc_i3c_master_read(master, in, xfer_len); > else With all the typos fixed: Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com> Thanks, Miquèl
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