From patchwork Mon Oct 16 15:46:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153511 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3552087vqb; Mon, 16 Oct 2023 08:47:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IELx2GwiwodGFTtwUGO3pAHecy53+0bnzTBBKpdQXgjzAGj0kyF74tA9k+ivIqJk31FRuiU X-Received: by 2002:a17:902:e28b:b0:1c9:e48c:7260 with SMTP id o11-20020a170902e28b00b001c9e48c7260mr11694555plc.6.1697471243436; Mon, 16 Oct 2023 08:47:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697471243; cv=pass; d=google.com; s=arc-20160816; b=ecJlNJ4Du9Zc2tXhpndqHXvCW7asxyLufo4nLyT0ohpRiVq6dkpczCvZJ6vqEv0ChD fWvCYGqPmcm1BwOPEKzVQ/2gujVhnvsQvQfkFNJQbXY7t/pU8mZwJ4Uq0QIxwAGrhUZX 4tVyhs3kpfw3SSEi3A1IpWNQWKRXsd5Tixxlzrc0cm6YzToeyB1OUFhV0AaNIip3hTRY BoVkaYwupDeU0Kpi+G23wJwTcyVJdVUyZbfqhQl7wCYIQKtm4QWYfnHZEL6fdPR5DZyh jpAyOiVL8HyWZRGMk5tYMqZEjhUYTC9LF0E2ra7KT+UCsAgDiYjxK1boNggou79sKHuV cJvw== 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=CC4uwQKDKlFvTEP4XC+cCKeORb/n/Onc64lf+Xn5MAk=; fh=Ti0qdvZV/i089alSarny0opSonFaCxJFklfGvdi8roA=; b=Q+qO9mXiK5oupG+NjKdGtSPdwk1CF91EeNoygJakVUYdULRjT9jKZ9OUcqFf5+sqi4 K7sqEUTiadv6gLS9eTVA8EjRV/7DY1XeOp8ySjeMvGF+IMRpdbQqr4vdjtMevDEXd2SQ Li1smB+Zdu4W6w6wTJ9+oYlq3x90013Whe1iX7A89J9oRhdU2YWzKBzGhPtfni7cAb3S Vh8NqXahVxlQqywki70+FayPBEzyDOas2MeRPiL4qtl0F1DdzVcCV2FVAC2nnm3rIcp6 CuEmHiZERe25mnq5ipelwY5iSbXH0GEja/P4XG+UXH+jKdK2Ml0D8jFVsdeFbrHyBvwt +Plg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b="jLEt/FVV"; 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 i16-20020a170902c95000b001c9ff840285si8191226pla.414.2023.10.16.08.47.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:47:23 -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="jLEt/FVV"; 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 4233180219F5; Mon, 16 Oct 2023 08:47:18 -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 S233774AbjJPPqz (ORCPT + 18 others); Mon, 16 Oct 2023 11:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232802AbjJPPqx (ORCPT ); Mon, 16 Oct 2023 11:46:53 -0400 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on2042.outbound.protection.outlook.com [40.107.8.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28838D9 for ; Mon, 16 Oct 2023 08:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DpE1/Gu8qSVjVtxiWq/3u9ip8SoHTJ6gJstQVrzci3Ps6yxiJZeHKBO0dV/bxfARQ+ShngskK/JmOnYOuPz96OVfyDVxSmsFEVuJ12Nm1rxQO0udkkuOz9IkZVgwRs9CtM1jg83x82X0xSYF+OMv7b8ZzSY+yMHmpAuM9XPLunz+wGDqmvtv3t97tpXj3v2I+UR2TDyoLUxv/lCTRDUyAFpYlkIs7d2qBDFdPqYqJiY5crn9NlmvRD3V7UQpWzYTzKfXMt/ZGbzpEeI8WQpG49eGaAn91xGL8aMRffbN7wnIXQtU+5EFrtFMzm6yjT5lXP0R7T1zXICYfarToP2KCA== 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=CC4uwQKDKlFvTEP4XC+cCKeORb/n/Onc64lf+Xn5MAk=; b=UnxgJfb+KQiQwCF1IT/1SYF7MECKTm+lXkG5KTtXfZVdjNfqIbFiDoH/JEtXbQZ3FynWRbUEbWIlPbFYG7fJq0jwCbhUcQ9qCQj7V9HN8YN08iTMzSgbVkHoKN4RMdBqLlz8d0B8eLH74iBmrlZEcukVFRo10AkSaapKDZeMiunXUONrzY/3zUPXafKHopvjuubW1DlvOWQIp7GMpisfssYgoyMFMyw19Ne0RN20n24ocnYIaUkkODmIFUYI4OADR2lHooY9P1yAofQwwyLEnsNJdcA7qPbCiNJV8IqXlqviMnSJCbO0PyDgvD9X0bYov4sYgYL0kBYVBz3bmcV/Ww== 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=CC4uwQKDKlFvTEP4XC+cCKeORb/n/Onc64lf+Xn5MAk=; b=jLEt/FVV6uDpNhuei3qaSI+goXO57oKtnw5yjgYGs+WWmnCbO63M3FL09Flcmpzb9DQEV3BqWurCIlxUjYU7EWl8HykwOAoyGXv4tHsdp++JHMg4H04xpyGfo2V+Cy54Plvi+n+N+CjRjgJus3Eiu0MtQnmXyDpUYhi5yDTqiC8= 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 AM7PR04MB6998.eurprd04.prod.outlook.com (2603:10a6:20b:10a::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Mon, 16 Oct 2023 15:46: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:46:50 +0000 From: Frank Li To: alexandre.belloni@bootlin.com, miquel.raynal@bootlin.com, conor.culhane@silvaco.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 1/5] i3c: master: svc: enable hotjoin default Date: Mon, 16 Oct 2023 11:46:28 -0400 Message-Id: <20231016154632.2851957-2-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016154632.2851957-1-Frank.Li@nxp.com> References: <20231016154632.2851957-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0089.namprd03.prod.outlook.com (2603:10b6:a03:331::34) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AM7PR04MB6998:EE_ X-MS-Office365-Filtering-Correlation-Id: 4a04a720-617e-4436-5e00-08dbce5f1c8b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pd94ebbfR+3dkAnX/5ZhnSTZT2kKLNly0Tok7v51wc1ooZ7SP9b42aS/NUmTKrGL9Rxw+m0dw6wFvwttErdYQQr4vyUqEPRRBv5wbVMqYW92rk4NZhxTmEnlab1Un2jreyD/fQJBB6OhNEXxEfpPTB5zvAmL/aNy0MEd2kymWmlLZjLhlhXPKkbxtXsZ2OjoB2yt5fdBr64kK289MK++oCxcW8fwhaV+dMZ5G3aoJEG516DSW6Wbf+XRLzoG8winA0vZ9SDaRe0V3LzdHUyVGJPxckJWafeCaQDUwtvfIawNvVZAHc3dMsT1wQI4UEI+V5zc+dQrKSdTap+o33sk5B0017kMeLDyKlrJW+H5w0TLkxYe7n3XD18Lh0AH2gJYW5BJLRG9tOtJTm3CN6l2zAxPHnKOE5Lffkg5x2sfcUuekeIVolLx0IMx6YdWoqzb6Gi2Pcgx0vonXsCv4MAC0atYVFCTfBSkzBBbItQBpBg00GpFQTp5rUVzG8s6fMEbajeTWoGgUdq5LDFC9vg6Es2LYcaYvS58g7uY2D7DlSlGHtjGRFP3VGVwkimJUkcyA7Ee+jeq4LVofAqfURTV77X29tnOsxPBTgnI+sfnJP+bte1+nvfH4gtEvjynsi/t 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)(376002)(366004)(396003)(136003)(39860400002)(346002)(230922051799003)(451199024)(186009)(1800799009)(64100799003)(1076003)(26005)(2616005)(8676002)(8936002)(5660300002)(38100700002)(83380400001)(41300700001)(478600001)(86362001)(6486002)(38350700005)(2906002)(316002)(6666004)(6506007)(6512007)(52116002)(66946007)(36756003)(66556008)(66476007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1o3Sdf3+Hw+X3X1UE0VA8rBd9H3XLan3HNpLqpHZQ6Jctm6EdQkEuClyfdivcInfDxc9c1vUy4G03zv1OhkapS6uzhgSM25N8Aqkl+LsXHIh8OGEhLX1o7q8jk6/FWyByt1rllpA2Gn0noERmQ5sSD99VOSACiAyUJNq+VFEsPVOvXfnIhYWEMMEp13NkcTOH5gfkKDCpfO18OI7BK43Gle0REVoACXG9q37ujs85vwv800d5GXkInq376u/G7j2Bk+/Q4BCw1ldwQReZ6nghGTeI3qjMUJ5+ELF9qHrhp63yQpGdlWHEl1kfwajpjOf1pAdLSzWZK4XJY7HuTWy1r05Q1doKtb6nOJruPeE5njks+fZBfjz5DT5cogHEqHLc4cpXDW1szO+wE1RdJftZz4BkBBS+E+GILUFIkJfIznIQnBgxAIu/EmPjUBg6eIgG41U4mwKl4WCJRh/SGWdkgi4EbEcOBByMSFX1qga4Wu8iBemcxlYrLyvTfvvm795UD51yciOXk911XFks3R+dUnRoka70nURBT/YdH02v1Ib+e+8nO57EAHeCWcAwlYsWX2d8wJ/3appTBBOy0S2dkLOlp+zILcKJzc/36pJ2UlH29XNBhhPnhBXGSoQIAfNOUSCxasxflwo039QF9rLM3BU4yzeowKkdfBE6SniyJuJ3L1QcIZoL01A4M+pd5i7oeWj6HzPuOtUjc6HMJY9mMvWhwDa0gTnw5vv/tZmhq+DCDqGEkEhZIaPg7tbc+9AND1Dbm6vh+NgKr6LIaoKeF91oJKmztqD41rNQAGWW6lFswZXPm/quP9dRKK1+0FXJo48bx0llAedNbjj/T2GjFxVS9bCNw9WrV3XPJWsX9EpH3nuS7cxLApw141DXMGZjwseAbNbNfGRMPVk7G0ygUmwrT3bg5LvqCM4+g0qk7PUIDtOktQGjbg4Ul83Ej6kjz4gxg9wgF75Xw6iDhuPU7Rxny6TnKSElkcoPXmi/4emuT5P/Oihj+aLugUo80/CcE+GQ1080VF632/SBhpnkd46iUMWIf0Vlk9cQGq48xUuGOHLRYBXQnlir7jFSDIt0moKPlzOgb4oGSDjjdFfD1ADec9gS+CGyi3moAdKBkqvcnikafBrkRssh+BNN+XUwcEOwQXxoBxRGKFCg8f1jHbq/ppVbSly95meT5/op2wkq/5CowvRu5Ymaq2BZSZQBUpFo8t+BDfKYG/+FPTzsOtZDr0Qp+XzyeNEsl4hsvXRmiLThM4ITydX2nk5S871wzNCQlo07n/UqnNjn/u3VsqdWYMYIrxHEBPzTSzzoijoLZ1Xb8xMklatNpd7v/vK3YUC99cTVT7vK+ABGo0UQBpRPoOtkYbrJn3j2CcVx9xnw4P6b9BmBzu+SSue0+ngsxrohkHzyC726kKFDV9ehrUprOjDiB4K2e8InA6w2+4gUPR7HAQYTdl7HxOAZKwwvOyE+P6mM/6a0/cnyFC47zcbScGN+gq6dXULJ45ZakViRMb+a8NGsoynOqca+AxD+BwdMxMVQcUdji8PAM0WAglxv6RvK1u4+v9Rkb833ck= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4a04a720-617e-4436-5e00-08dbce5f1c8b 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:46:50.0264 (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: 5cOgdy+IuVBBO5JR4VEUYqsZFkWqRH3ZVBwlVs9oIBmViBzCdsBfknlAYltG9nCIGLAo+bFEh3VbJE54LL51og== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB6998 X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:47:18 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779927606568157333 X-GMAIL-MSGID: 1779927606568157333 Hotjoin require clock running and enable SLVSTART irq. Add module parameter 'hotjoin' to disable hotjoin and enable runtime_pm to save power. Signed-off-by: Frank Li --- drivers/i3c/master/svc-i3c-master.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 18bc277edc8a..f0d99b029e5f 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -128,6 +128,9 @@ /* This parameter depends on the implementation and may be tuned */ #define SVC_I3C_FIFO_SIZE 16 +static bool hotjoin = true; +module_param(hotjoin, bool, S_IRUGO | S_IWUSR); + struct svc_i3c_cmd { u8 addr; bool rnw; @@ -1623,8 +1626,12 @@ static int svc_i3c_master_probe(struct platform_device *pdev) if (ret) goto rpm_disable; - pm_runtime_mark_last_busy(&pdev->dev); - pm_runtime_put_autosuspend(&pdev->dev); + if (hotjoin) { + svc_i3c_master_enable_interrupts(master, SVC_I3C_MINT_SLVSTART); + } else { + pm_runtime_mark_last_busy(&pdev->dev); + pm_runtime_put_autosuspend(&pdev->dev); + } return 0; From patchwork Mon Oct 16 15:46:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153512 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3552109vqb; Mon, 16 Oct 2023 08:47:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEvyMWAD14IJT6MqftM36YH0eXmRpmQ1nQUtFiH+HilGKAvaHcbJbxMWtXWkzTnmaWdKznH X-Received: by 2002:a92:dc02:0:b0:34f:36ae:e8d2 with SMTP id t2-20020a92dc02000000b0034f36aee8d2mr33277359iln.3.1697471244680; Mon, 16 Oct 2023 08:47:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697471244; cv=pass; d=google.com; s=arc-20160816; b=Oj5MQHaRnDX68O2neM5OY7hZxMgm5Bga2LFT8Ln2TqKnw0nVSgu8clo5GM2taRe6ow jw+hQtkWKifp6Z8oF3JijhrLzTbKM2H7JWDJb6SDT19O3z+11aJvSEpxlNow6exxCf8B FBFTkS+P9KNu9kM2FJT4tTO3x4sNhYzm/jtU3/f9rYxr5v9A7CPJglgLhsCjhPQU64FU 8g5VsF4+v+M/EQOuRNPU3+DBlv9Wly0iaqjELMoQ4w5V2vqzc2jO/bNrWoZlVynrXpoq u2r9xcKdpfQHanabhdmLnkNaud9c5cnoc4fyFqhvfhfFCryNubP9B/ChuxsfSgAf35UQ aFrQ== 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=y6wYLxGqIqDAdgK8VtmcvwBleY7Zkme71O6KK0sSUG8=; fh=Ti0qdvZV/i089alSarny0opSonFaCxJFklfGvdi8roA=; b=0XP1xFAOA8G238tK7B/U707Ez4Jcrc//mFZtdgh9U2TBc2/fJfHb7Xu0QoOlmHBDed OQ+zftOR63OSTKMUatKwgLtaQK/nkT3fRtXWnTVHKs8kTcPgVO94ARVdInmp12JB4BV1 ZPTCpSfsSRTR7p/UDquGZsDitDJlcRRkonL0nLCxAzjIgieg+0YT6N/4UwE6nAEj/kRr 4PGKPLpWStjDLFaCkMedj4xNRDlBr/ouXp5SOOoQRQ+O4e8REMHEcnjbY3pKRPlg+6z5 t81kWGLNptV9uYdf4x6PTJQvUFGJvgy3UtEtWfjx2SdR29UVJt4Lx7vxQoOJKMurBMkT 1edg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=quZ3tJ87; 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 y193-20020a638aca000000b005653e3f6d58si6253756pgd.748.2023.10.16.08.47.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:47:24 -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=quZ3tJ87; 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 A21978047543; Mon, 16 Oct 2023 08:47: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 S232802AbjJPPrC (ORCPT + 18 others); Mon, 16 Oct 2023 11:47:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233826AbjJPPrA (ORCPT ); Mon, 16 Oct 2023 11:47:00 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2068.outbound.protection.outlook.com [40.107.105.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E675D9 for ; Mon, 16 Oct 2023 08:46:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MHcAIEyeVxYH9ZG/l2Vet2h6x7UeTlmTQWI2hdeSlzCjhuHnlGNFiIrIfMjlSPtjWFWdpwT9L08SLGWn0AHBYdr2ePboZfckPIHwyoj7xmLv+ag0p5uxfrFKXhDfRYXlL3r/aFL9GLaH4TlrhGT4Ym23wMVZ3gAcJkFAIpbj2h4Cyve/vgLKPp6jMwF5wU7ao53tFMFEuvLK+sjZ9o12jwLSaS86kgwp3suMbj8jMaFYYepZDR9yeCbIjjkvSaTxQf2S+VYf3OwWi43M6YTLtZ5Oo3/V4d1sttA6F+1nHg2PjvIdSGg9+vzuIZ4AfZ1TASsBzxHF9oGB5Jjj+AbQ9A== 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=y6wYLxGqIqDAdgK8VtmcvwBleY7Zkme71O6KK0sSUG8=; b=DeuvMWkjWa6gYQq7wPu77jzPiDPUah6LiE2wog1N+tiptqa8vzXr28qBaLSfsWuzeXsP3bmLKX3edDIT3rPxMJpVMBH9fjde/DQwh57z5nHAj5i1qhTFQIkV6dB31OetAUSf4nWXfG/d7XEoY3aep1amLMhaAYhjPCilj2MQcwSbDNiQuZ58RPWVDlGAR17zMrGUEstxns599mrcEYzj2KFB6tC6hCBc/q9X7gnqFza/Yl99QQdUijeTEYy6+Ry4DTOnvv1nJyHJVqQpbth+oC1up36frxIkCiUHkDFh/34flcHmLDm6Q5OgckzO8ZdYD0URUuVpKEIbAqH29Xsu7A== 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=y6wYLxGqIqDAdgK8VtmcvwBleY7Zkme71O6KK0sSUG8=; b=quZ3tJ87J2E1Xeb9FiNoUY0SJV73FIiNO1C4CZOo/VqR5Rj0GYxSqX3DJ0XSAM2hOU7xCwJTFEAdZ8yXYGVOQW9aOT7OI0xUvnEYhuW+BNPgg+Ps+r8q/bt3rlB58HJIHRf9zkgAfCURbsN8EFJanEbi2Fj+ELQ2GR3rdIj+MeY= 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 DB9PR04MB8329.eurprd04.prod.outlook.com (2603:10a6:10:24c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Mon, 16 Oct 2023 15:46:52 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 15:46:52 +0000 From: Frank Li To: alexandre.belloni@bootlin.com, miquel.raynal@bootlin.com, conor.culhane@silvaco.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 2/5] i3c: add actual in i3c_priv_xfer Date: Mon, 16 Oct 2023 11:46:29 -0400 Message-Id: <20231016154632.2851957-3-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016154632.2851957-1-Frank.Li@nxp.com> References: <20231016154632.2851957-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0089.namprd03.prod.outlook.com (2603:10b6:a03:331::34) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB8329:EE_ X-MS-Office365-Filtering-Correlation-Id: 034fbd37-0c12-40bf-625f-08dbce5f1dd4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JgTpxcQQEV/sVhOP2G79UuNaFe24g3ryy5V8MTpQJ/2z7qbevjA5IDqYkbbC0iM1iv+bq/0j6LsFKjqClwFAn/+NuFtdJ5yfAc/9/93p9SVkwKx0fCbGfEd4NuDh6GR0Cn++ffmbndfpPjk0ycQ5kBUvUwV+Q+me0fWiuGugNlV1cZchbpPgsjyhRIviTAn1lpmJ7IMITpVL+9LuWZawVorBOGLVavjGuwcCKC1ExpniRTjaF978joyvrMx1Z+lx7N+XtIJjVXNoyuN1M2BmvtcNBTNcDbPjxBB6mOfEjGcN8Zcd0BNUdHvjCudDBOJbCz4SnsIuAn/9rRMBxFGHE9txT71ymPNrZIpxGoD8cgObSk4SwiolgwT0po4blOgTBLY9PZ1x5BKTDbBm7UTqKTU4ESQF8FCQ0g5kZZBehjJRTNknrikh0glBMm9Lejtb5CN0CBZPgmVTEDQf20FDfqjNZruz8TGpVSTxmUgjLnAon8iahlJH3JrMRa1evo/T8UyZnatgDs8FYl2kYhw9e7OsUGw5XejJuQdAgSWpt6SZziV6MqiDILqn8k5JwMTaUClkUWfEDqb8QfEwhDU0ZVVfs4rhWG6nAJ7k295LQvbWGk0Z+/IU1bxMG6lVt0hf 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6666004)(6512007)(6506007)(52116002)(5660300002)(8936002)(8676002)(38350700005)(478600001)(6486002)(1076003)(2616005)(26005)(66476007)(66556008)(66946007)(316002)(41300700001)(86362001)(4744005)(38100700002)(2906002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?/sshdKD2AKBO07XeQUOD7Btqg5AD?= =?utf-8?q?znfo6cwvJcmD9xjEGNZ8K8Iv6+PLQykMYOSKcEjVo6yMlHAc7praBBHXIeheD2Tm5?= =?utf-8?q?cY4uVXO8l0VWNVMhdHp4UmkrbKU94H7qSD+BYgKvqChrxm8mQVY0Jg8SZDXO7fY1d?= =?utf-8?q?li+Y78AryJ8oxyyGmjuGKTXRzCpsWNFoGZ7lQ/9NdvyA6E9yN/mVcU6GtziV5Dob6?= =?utf-8?q?/+t1xAXxSqGUtY+kCa9C3HEs8MLfJtbyQU5KLp1mWtdV9XLPO9EgKxTcZ5Nn7FS0F?= =?utf-8?q?v7wJcfJtH1lYjjwF8p5RigBUwzCau99la0xCuzsDPnKGqWRnpnwN5yjEEPjtELgxl?= =?utf-8?q?8Hkwj1IKGbWHWNL3qDoVMhNOWyfYdfWrLc8BaUMUypbnVvAaJneSOVrCyubpQ8dHx?= =?utf-8?q?+9JA3DBg7hdDbJrNFGqOSfsReLNsMFepS7VN3un0rpSXZHhvUPyujKhbxXOEl6BeZ?= =?utf-8?q?uYlM06g1lZZiaHYfMGfuAcESUUQ4JUkV4qXSGBB9PVf4VT+5/Q8H8Iaa1vzgBZQPo?= =?utf-8?q?ujnS/29mLFhE4OX/XKNaOITwkBinUGj+6jPgOd29ZCjsb5z5gaEdC16tQ9UziBRep?= =?utf-8?q?A1NnloPoP2wI8n061qVJaKqfmVvHAlcQ6WC8EZoWuD4Cbb237urzp37gfV0jLYjky?= =?utf-8?q?gOMrQrIQnXsjTeFYoNsfXqSdCfdUwH1I0ZhIaV1aA0mA0NibG/JnA0piU5ryg4Bvp?= =?utf-8?q?cZ8jZeCIl7u4TovO7jjNjgpEra5wNYrwJOBT+woF9MvhzWhw+zM6KIVfjRgVb3HOL?= =?utf-8?q?nYi4C9Ne4hMEaL4JvChmoVGSjTqWeNxZ+dP/SXlkQuJcEaeI7SgptFjYyb4Eub3Bt?= =?utf-8?q?92C6CMVTzuqYy8AiQ0gYCsJmgCDi6TjBXHreDVxq+IZyQfHadtiSfcLyrqICCwnXP?= =?utf-8?q?gLjzLIlWCJxhorKS3ZHI978fcxru8ASm6aqr+tGcueKdTKzK3YylDo6Kep26Gn/BV?= =?utf-8?q?0vLUsyohEhin7igpiWiucBJ1sP7j0gSbb61wgVUOo8Q3dA7EbDVVpwmO4ahGLrjS7?= =?utf-8?q?awSzmDJ1EtPINPYqR/flXCq3MjwlRQ9P/s6QQWWHAkMMlrBOq1xZK8JBQmYSalX02?= =?utf-8?q?azn4V0Byr2xUpvEjyu9OFPkIfAwUB/Av21hGXn4DVcRC7Tj8Eio4Rw5lTBtXcu6Lz?= =?utf-8?q?6Wcb0Bz7kfp86N6pQOeIza6eGzV1yDiQqzSiJI6PBBqNK1FgT6Laxi5fINQCBBX5X?= =?utf-8?q?GSOF2slfMrB8UQgNiVz0A8K+gQEBHg+5zmgU8ZqeY1JeB+Uk1l0/R4btJLyJLvAzu?= =?utf-8?q?Ko9Xru9ZZyqHBKwxEKgsUVmMd/R88Q+U2/pljbFdRvD8rMpzwYIdZ+bRg/5QS+jOn?= =?utf-8?q?WutxU1UV2D5fyN+CVisomhnP2h4XQP9QXoLssqxqBCPGOO4t897p8dID1Y5dWrKXo?= =?utf-8?q?N77ZDQzMFyXrM6hK9jvhuUIY4fdhJsjOtuaqPtZu1xyGazEkC8J0QwbnxdfP4n0xL?= =?utf-8?q?v0U+Da8666sWACzozCQ1LIoSz2u93H8A7KKjqppchA4zlDT4m42umz0M=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 034fbd37-0c12-40bf-625f-08dbce5f1dd4 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:46:52.3691 (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: qHK+GOFjTtmnVvDxP7agUGS5rSS5ak5mlYcnxQsr506ZReVVfQv74W8H+zKDWByTmzSOpPLFThk67OXSgNvdiA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8329 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]); Mon, 16 Oct 2023 08:47:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779927607580500518 X-GMAIL-MSGID: 1779927607580500518 In MIPI I3C Specification: "Ninth Bit of SDR Target Returned (Read) Data as End-of-Data: In I2C, the ninth Data bit from Target to Controller is an ACK by the Controller. By contrast, in I3C this bit allows the Target to end a Read, and allows the Controller to Abort a Read. In SDR terms, the ninth bit of Read data is referred to as the T-Bit (for ‘Transition’)" I3C allow devices early terminate data transfer. So need "actual" field to indicate how much get by i3c_priv_xfer. Signed-off-by: Frank Li --- include/linux/i3c/device.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h index 90fa83464f00..f2fa7ee5d96d 100644 --- a/include/linux/i3c/device.h +++ b/include/linux/i3c/device.h @@ -66,6 +66,7 @@ struct i3c_priv_xfer { void *in; const void *out; } data; + u16 actual; enum i3c_error_code err; }; From patchwork Mon Oct 16 15:46:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153514 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3552236vqb; Mon, 16 Oct 2023 08:47:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGPQwX+s2D5Z2USeVJoIA7w12U5dOku+VUmwC5NxwiVErN4xCePA7ln3Yd0smXsaQJrsUF5 X-Received: by 2002:a05:6870:b508:b0:192:6fce:d3be with SMTP id v8-20020a056870b50800b001926fced3bemr37092518oap.1.1697471258105; Mon, 16 Oct 2023 08:47:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697471258; cv=pass; d=google.com; s=arc-20160816; b=OJHv1A028muNsUCuf8oTM9sPVPopbaQpZkT1cKn5hP+77l+Akf0wyzfPS9rtT6iMej ZlT+fGScKhVXjFLxaiTmOCCPyjrxkosUDsXuFzaiv1lY1D2W04ZEYUqag7pLs2eouGtU cQklumdYeZm/m5Zw4x+Ae4u5gHjaODrJmLOfeaZ4BWJlv3HCAyu828vYQmQKEGbro8HK 8AVTGuiZO+wxucUnHQVnrUDq0/r11bwinA0srHoECEpohgJWjyjmzv7gGUTLq8OZvQx7 UeHrU5lpaSRgU7tlU2/SYLbxyvdku068z7GaL7qrT6cht6IXDf3DaTKTsjx5eq5au/21 1pwQ== 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=OLHHTxYnZgBT1P+zxKSvT0yfK4m2Bh87+eq/thPm0/I=; fh=Ti0qdvZV/i089alSarny0opSonFaCxJFklfGvdi8roA=; b=Tmtn4mFb19yq9szeaHYFVq1BcK9G8R5Zh6gs9SpHY6fMAiAxujxLJ7OHxsdRaUvyNB P7TK7zOnnBej6q2st+gasBmytmSLuGXzBOUmluaoUok8JXg2t50z68aGiIlN7B0nZJi2 gQBCUppkyTW6ZZe8To6kJnBWbTUVI3hxj2awjsrYKFWF9YHGqixhmusy1w6XtsAvweBI hiF04srr2kfWvzRAqryRrr7pg/liWoazfeRw2rv2hlOzMCncuN6nX7uUFIKGkYeW2XFT z79bKQHe8I2gqKnfVr2WG6PzYxTonzGoOXp0dEMS+i5V9hfcVLqdLgMY0hRenWq00RBs IWFA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=aKMROMOk; 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.35 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 groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id 188-20020a6300c5000000b005b7dd1d190asi1205608pga.263.2023.10.16.08.47.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:47:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=aKMROMOk; 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.35 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 groat.vger.email (Postfix) with ESMTP id 1AEFD8058A2C; Mon, 16 Oct 2023 08:47:34 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233869AbjJPPrE (ORCPT + 18 others); Mon, 16 Oct 2023 11:47:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233830AbjJPPrB (ORCPT ); Mon, 16 Oct 2023 11:47:01 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2068.outbound.protection.outlook.com [40.107.105.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 846CE83 for ; Mon, 16 Oct 2023 08:46:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FePhy3FDQKkK4p/W+jKqMrAhfLaiHcxhyoOMmC515f/v7CjHHE2ElRfFqakeKdjr17gkGFa7A+hlIfzLgCw7sQFZqZu1r+gqw39N9/pz1LbmaU8jh69QIZDBbvT75vHpW5WWUe0nKU5hQ06uNOs6Lr+R0Q3l9KQwQNTKXjA+zBEbTRjCBspj4V4WZo1fgIQpWyX0R+aNECJxvoLic32OiNH2EGaAnvPf201iiUVybbpBjdaX+exOH071q1HlGunUAK+RZ/qQanZmhd1OXPzpQRk4xShpp7s2jBsFAoGT77AzMEcIfKA0NcDp7SbinZZxNbnAvPPbjHvB9EzCRGj4FQ== 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=OLHHTxYnZgBT1P+zxKSvT0yfK4m2Bh87+eq/thPm0/I=; b=eZjJkxjJasigD1vrZYNDdpc7PqAn2iK8op0zBKBlpNOqSQj22vjXBKZppCrIPHFqcnaYGXEQ+KFxUtf8CMjjw1npE0vMlFwWkJvi1OhSFUTfzqfYpVK1C/24kElUsR9OM5hBm//G9K/BAcGNsZQwV/AzErIuc+KDr9wAv7gNMDqlDEdGKdyq2bHPq3ZFigU9rOAJfYlujwPyZBZp+W6BmjW2tpJJOl9oLHxQfXwyq3sV7GHwsnOkwuS9NLYvlNfdDHxtUDaCbLSlIHWKE+xqa/0+JmX7q5bDntUVfQCet3HOt9jE1ILVXD3fQIgzelM8rtEX4y+IAaz95mFzy07aMg== 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=OLHHTxYnZgBT1P+zxKSvT0yfK4m2Bh87+eq/thPm0/I=; b=aKMROMOkMevOzDzDvm82bWDCv82tFFW4CL0FZ7HtkgeofpJ4/2KiSVAAzmz9l43AFJooVBzJ/z3NflIwBcnAgDLOGZOeAAdkOPu9VIxD4xYoIu91FYZ4WoFb1ai+1kghjzW6Ok4my61y/JXE7BlLy/t42lDXJe2c/w6z6zCstoo= 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 DB9PR04MB8329.eurprd04.prod.outlook.com (2603:10a6:10:24c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Mon, 16 Oct 2023 15:46:55 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 15:46:54 +0000 From: Frank Li To: alexandre.belloni@bootlin.com, miquel.raynal@bootlin.com, conor.culhane@silvaco.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 3/5] i3c: svc: rename read_len as actual_len Date: Mon, 16 Oct 2023 11:46:30 -0400 Message-Id: <20231016154632.2851957-4-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016154632.2851957-1-Frank.Li@nxp.com> References: <20231016154632.2851957-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0089.namprd03.prod.outlook.com (2603:10b6:a03:331::34) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB8329:EE_ X-MS-Office365-Filtering-Correlation-Id: 13f4452e-4a36-48d8-02a4-08dbce5f1f3a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sEnhSdoX2aci+Tt16neEBngChGa37im3tUGzfvjurC0Phxy1mn7fU53TfMIQBzbU9wv9CVYhYA2QW+aFzoYinrr3y3t8etrpyPP6Xb/mbK7ormB0bcKXmYGaRCGwXR9Yjg/Rqas5bVAuLjhzTlOb5K3JAHtJJHKmyCEhVSGwSNj4Ic/Q3nDRbmg/ffzr1VCWwkXjwCkN3ePGRWhFm/DHlCB67kfJUvTSNKotlYPM9SZfV6dlOI5qJZ2HFXLlHl8vALMIoYIFBJEUgUZqFOnwSKVmGxduMoGCQlROLPqfM/YZ1uG+xNyeut7pnTXXTqLZ1VbJy/hyXZbrdx4LI0+q1USHfXOt73OCxzfkL8e7+kExv8ew/7jG8zjsxzExxxz03Zpq8pJWRQv0US7MBVl7nsBdggoXuNlDrkhPdaXUYFjj4tZIi5oJLTqr7GBfDUPL0uqfJcI1KLBc0B0B/+ssKgemptGQEsUa8wTGazaU4xWTSRSf1i1fT4JIAF6707cFv3WtbpWmmGVIaFhWFkRgwTc7DkZIKBbjU147yPLC3YsQFpvKOS10tsmbFrOurS5ZeQQZgJfpNLm1ZBGmNgkIr1XC61K6bf066lzmLG2tS04CeMBZB54ZHckaxObLZZcA 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6666004)(6512007)(6506007)(52116002)(5660300002)(8936002)(8676002)(38350700005)(478600001)(6486002)(1076003)(83380400001)(2616005)(26005)(66476007)(66556008)(66946007)(316002)(41300700001)(86362001)(38100700002)(2906002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: NQWI7pH9Xi9gNjr1mSV7lB5IUbcqQp0e3BRxSU6+/uMBfbIeuI1yeDCG0O9WcS1bnkwHebrU0Yd0sQZRPdy0YMnF4OxyXxC7JIGqr/Q1wXmo8TAwHlNOm8xXVkbRdGC9XGIxsiKp93AilfTNweuIalNN6kigcOMYzpSZJ4QV33SA8orEqjlQdKJtkKAt0C3FuzZJiTBGbd7ktX08EDuHz/844mx4vIbq38FB4n0dnRdhVTJsSEBCvDx3R6I+cyo+R9pPNw22SDKnhZSvUwk9fc6yXY4FvT6cFgDZzVInHhCDFNKnVsYKREGvfZcNHo71uXVs1YmAmOf8fEMq0fZmT/MosS3EjXUkWeCklx4V+N6rIhqd2ClunvAsyMbxQ0qNFulGUtQ+hsFdzQCj/8afKzh/54Q7MGn7YDU6JeLkGSA3cWR9AH9K9+PCPwk2pTHcgaSvyy4eEAr4kn2cDlKXFeVEOITGiOISllK65tbssgMmJVtvdly7EgkrQci/2ThuLjmL2uXsxDzw7cnoHB17eeh4M6sYYf6cirFppZTcgldZ7tXGBiBx+4n5l95RQl6Lmp3xLuVRV3l8UT83tcuVwrVB6WpsTk+J3vLTKq9wtGGLtpft7+8J3cEtnGwd6EEeg9Zoorjs94RqoLMW0UFav0jcgv6cb0ULp++hiCcCmdSzXJQDiai/r8Gcw6329SQAHQjK3gEvor1ViHJ/J8xngYY3uQK9iZUhG5Ocexhxf5wge/S2edpQcHPXjYKrTYA1ZRENGLmrG2F52juNuMNM0HBUwrX4cRV/1sY3SqPzMdX7QLimlMe1cMmLUtX1CiRXk4f1CUbQytl3DMbbIow+4BopAeDePVnVwHX9WEmHvgNQT6+kGY4tQHlXyNPMGpx1GOOu547m108fUHoxXh/y+rD5uGt2CpoHU/FEiz7Bmd/IVxtxT18pIVFdgzcpeV942dxq+JljtHFtjfnbxcM5Jc7bXgkoQDpl7yasTgqrpZF/RDmX5IJKvlF3PdBAl60chMnmud+XP1zaTHfc+2R12kjqr5OqnRKE7M4jnOMBdh5E6/S0Is3a01gnAITVO5FERk1zZL5VKrMDm4zkM0Yqyid+riVmXIP5uXBtjBdkkrmdkP2JyM7Hekhp2v9vklR7NJlXP++3AQXTeKk6TPyFh4QbpykBGRseSzaAunfTefwBhcLyvtUyg8csI5tXOPHmBTGND1KaotMT1HKGIH0JvXPGzDVJ3dcagfkua3Zmdx+p5FnrylvXndrGf2O3n3pWAW+9UDli+cnWiLMdJ20jxTO10LbiQyiDnV9sczcQr720ekNolL2WlmuiyIUlRvGMXeej0U4FMe56DjjLFYWq1hiJcSs9EKwzXY+T8nKYGaTWMSjKXfp+p2lwk2FxzpCqy5CDVcfXwdBEpbs7kmhNw1ozanyYFE5JbH+L1p+Q5v5xlXcfMwcfZ4ejbZKiWkAzmk/ka7MMYllFwWpa7mO1yRuG/PmzEkWf1ZT2FaMRzxkFalhGYXWNIN4h5MN9hWTKRobGo+Ze1GwXEQrdJQPO/WUD8vsva+yIQ1VKYqZ1WH0= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 13f4452e-4a36-48d8-02a4-08dbce5f1f3a 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:46:54.6724 (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: 2siZ+6N1jqsO6gBklU2WvZgLnMz4RqG4mUBlmC9GO35MDrbghme0tkrCph+c3q/GifFezA3vRpK8KWfZPgB4LA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8329 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 groat.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 (groat.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:47:34 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779927621528551300 X-GMAIL-MSGID: 1779927621528551300 I3C transfer, target can early terminate transfer. I2C transfer, target can NACK write transfer. 'actual_len' is better name than 'read_len'. Signed-off-by: Frank Li Reviewed-by: Miquel Raynal --- drivers/i3c/master/svc-i3c-master.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index f0d99b029e5f..3570b709cf60 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -137,7 +137,7 @@ struct svc_i3c_cmd { u8 *in; const void *out; unsigned int len; - unsigned int read_len; + unsigned int actual_len; bool continued; }; @@ -1022,7 +1022,7 @@ static int svc_i3c_master_write(struct svc_i3c_master *master, static int svc_i3c_master_xfer(struct svc_i3c_master *master, bool rnw, unsigned int xfer_type, u8 addr, u8 *in, const u8 *out, unsigned int xfer_len, - unsigned int *read_len, bool continued) + unsigned int *actual_len, bool continued) { u32 reg; int ret; @@ -1035,7 +1035,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, SVC_I3C_MCTRL_IBIRESP_NACK | SVC_I3C_MCTRL_DIR(rnw) | SVC_I3C_MCTRL_ADDR(addr) | - SVC_I3C_MCTRL_RDTERM(*read_len), + SVC_I3C_MCTRL_RDTERM(*actual_len), master->regs + SVC_I3C_MCTRL); ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, @@ -1073,7 +1073,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, goto emit_stop; if (rnw) - *read_len = ret; + *actual_len = ret; ret = readl_poll_timeout(master->regs + SVC_I3C_MSTATUS, reg, SVC_I3C_MSTATUS_COMPLETE(reg), 0, 1000); @@ -1155,7 +1155,7 @@ static void svc_i3c_master_start_xfer_locked(struct svc_i3c_master *master) ret = svc_i3c_master_xfer(master, cmd->rnw, xfer->type, cmd->addr, cmd->in, cmd->out, - cmd->len, &cmd->read_len, + cmd->len, &cmd->actual_len, cmd->continued); if (ret) break; @@ -1241,7 +1241,7 @@ static int svc_i3c_master_send_bdcast_ccc_cmd(struct svc_i3c_master *master, cmd->in = NULL; cmd->out = buf; cmd->len = xfer_len; - cmd->read_len = 0; + cmd->actual_len = 0; cmd->continued = false; mutex_lock(&master->lock); @@ -1261,7 +1261,7 @@ static int svc_i3c_master_send_direct_ccc_cmd(struct svc_i3c_master *master, struct i3c_ccc_cmd *ccc) { unsigned int xfer_len = ccc->dests[0].payload.len; - unsigned int read_len = ccc->rnw ? xfer_len : 0; + unsigned int actual_len = ccc->rnw ? xfer_len : 0; struct svc_i3c_xfer *xfer; struct svc_i3c_cmd *cmd; int ret; @@ -1279,7 +1279,7 @@ static int svc_i3c_master_send_direct_ccc_cmd(struct svc_i3c_master *master, cmd->in = NULL; cmd->out = &ccc->id; cmd->len = 1; - cmd->read_len = 0; + cmd->actual_len = 0; cmd->continued = true; /* Directed message */ @@ -1289,7 +1289,7 @@ static int svc_i3c_master_send_direct_ccc_cmd(struct svc_i3c_master *master, cmd->in = ccc->rnw ? ccc->dests[0].payload.data : NULL; cmd->out = ccc->rnw ? NULL : ccc->dests[0].payload.data, cmd->len = xfer_len; - cmd->read_len = read_len; + cmd->actual_len = actual_len; cmd->continued = false; mutex_lock(&master->lock); @@ -1298,8 +1298,8 @@ static int svc_i3c_master_send_direct_ccc_cmd(struct svc_i3c_master *master, 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; + if (cmd->actual_len != xfer_len) + ccc->dests[0].payload.len = cmd->actual_len; ret = xfer->ret; svc_i3c_master_free_xfer(xfer); @@ -1349,7 +1349,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev, cmd->in = xfers[i].rnw ? xfers[i].data.in : NULL; cmd->out = xfers[i].rnw ? NULL : xfers[i].data.out; cmd->len = xfers[i].len; - cmd->read_len = xfers[i].rnw ? xfers[i].len : 0; + cmd->actual_len = xfers[i].rnw ? xfers[i].len : 0; cmd->continued = (i + 1) < nxfers; } @@ -1389,7 +1389,7 @@ static int svc_i3c_master_i2c_xfers(struct i2c_dev_desc *dev, cmd->in = cmd->rnw ? xfers[i].buf : NULL; cmd->out = cmd->rnw ? NULL : xfers[i].buf; cmd->len = xfers[i].len; - cmd->read_len = cmd->rnw ? xfers[i].len : 0; + cmd->actual_len = cmd->rnw ? xfers[i].len : 0; cmd->continued = (i + 1 < nxfers); } From patchwork Mon Oct 16 15:46:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153513 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3552164vqb; Mon, 16 Oct 2023 08:47:30 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF64LxnZteBhzXoesCSUOmF4xsghIjpUIALx66RaQIhk5sdxYxK1hXR7JAcjoZzNI7fmKWS X-Received: by 2002:a05:6a20:3d85:b0:163:f945:42c4 with SMTP id s5-20020a056a203d8500b00163f94542c4mr40929957pzi.1.1697471249870; Mon, 16 Oct 2023 08:47:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697471249; cv=pass; d=google.com; s=arc-20160816; b=0Lb4HDefJd2UaUU5G+j4J4aix6jgIwxnrbAEjYLuc9FQ2DIImKxWMc87QcaeuCFUEM fQo7lUcnBVsPk6T5KKyevQznbQmb2C+W3+vDNYYADa4PnPY79E4+7UYG/0etisCEOhB9 kq3eYBFOpMxa6mgFLelUQqUah4d9Xc/BwvNr8QQjiQ84bCR0Ie1Rm7m0rX9G9LvjMQFD c25sDuQwwAQiG88v9cU9RosgSu+cIXLRifBMkzrXmfTmOCPfojgT8sun7aHQQeExCKPo rVXTOM8nRbDaW8kVieiP1/7ewcMjjmJjqqTlVb3NJLOynr69kGUQqoqBssQv5i9b+Uhm keHw== 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=4JvC4g+VD60esWxTBSv5RI8lGH6ctutNh7mqUTggFg4=; fh=Ti0qdvZV/i089alSarny0opSonFaCxJFklfGvdi8roA=; b=CTyvQlN0xJbuT0VTKncDCFQuAkJ5RJqFga82+WO+P29cpFHrceT6jEwrPu3ts5AKi2 I3+tG1sdtuMtY4ZC0MPlKMsEYOnoACPtxmSgrRvfp0gIFAgFqpfwZ0ZhfV3W6t4mkOQM 0srfZWh1+Z4a1mKZMhCsPd23rn0HVtRgLW1XDGViYZkz+3d77J6d0+8JggloYrFv+94a 5v9PPmPYWGCZ60iJPtAo3IZfrTsX0JyebfDL7Xc27smjwzd67p2mZ+93LYB9/l5HipzU B9wobm/rdH/o6B8vGBWl0AQ0FM84i8Cv0wb6pz8OuIHfM1smKQeFBsDRExI+nQovEVHP tXbA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LsDggOlD; 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:8 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. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o3-20020a170902bcc300b001c5fc13fb2dsi10617664pls.294.2023.10.16.08.47.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:47:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LsDggOlD; 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:8 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 97ECB808EE76; Mon, 16 Oct 2023 08:47:27 -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 S233848AbjJPPrJ (ORCPT + 18 others); Mon, 16 Oct 2023 11:47:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233738AbjJPPrD (ORCPT ); Mon, 16 Oct 2023 11:47:03 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2068.outbound.protection.outlook.com [40.107.105.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F6C2F5 for ; Mon, 16 Oct 2023 08:47:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YC63Vy8RV0HVKD9Y9X1Yyt11DQjTsNyAoj0VzoR+2DflTQOffgGlzhovZkfiigPJjVlhH0f1ZHNmWbVnqQ92f8sCSvHjDke9op9EJh11/olcq19hqljYHQ4O01bWnJ9L+w6RGQhaXB3L+mLm5AH4JABao6E+/f3Peht5zikMtcxVBShH4EK/IPb8JaGrXs9Hajg6qCHMDfuryd4PAX4bAyDCn6WtmwVyKvkrFY9jp3rQCWpp+shBihnNatLN3VUyCEZSsojmfbY9a+r3rXudjikK/TYaHR0EIT17TMe/v3WdGMCC+YwjrA8WjgdcZR2TOcH6u+ncw7ba3Su8OGLTqA== 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=4JvC4g+VD60esWxTBSv5RI8lGH6ctutNh7mqUTggFg4=; b=Q3cxx1j+5BWyV8Xxc34x5VZjQ5z7ykhEqk79pt3M/ekZOgW1SNk3rpHAfHyBzPrWqOrTV+HHdT6cSeEQn2/I9lFlGbqya23LkeGOLvDYBRxWoGU8eaJD9qWeOZuoZ0HJnfKLOSsI3cWflYBZRaWFJsEyrSBE/TI2/faK5d17QCKZgkKvtO7VuUy7UmahwVNB2qRH2w5DNZQLQrHdjQ2XIQ0Aa0DLem9LQ9JPT3pcSVx/+r6X/4PP26myzOI2wff4fVEMpEVejNZSzu2BZlTpTGrFZRQcEHvbcqvOMs4kT7HppKatViJ6DKfZyDAHAhrQlMoHcgmcy1UZApGdGxKRNg== 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=4JvC4g+VD60esWxTBSv5RI8lGH6ctutNh7mqUTggFg4=; b=LsDggOlDpdF0D5PC7RDi556E7dlhJCMvdMhLUOEpim4v7GobtHQW34vnHaA8eDjLZBj/VYBiKjStYxsTYlkeSsRZhF1lAxV/3ECexolwrePCw3xFfPZFzj4q2bgRFGk36t/gd5HfV9QK9Zy/zbQ2Ra8DodiNEx4LEBztsBBx2nI= 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 DB9PR04MB8329.eurprd04.prod.outlook.com (2603:10a6:10:24c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Mon, 16 Oct 2023 15:46:57 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::1774:e25f:f99:aca2%4]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 15:46:56 +0000 From: Frank Li To: alexandre.belloni@bootlin.com, miquel.raynal@bootlin.com, conor.culhane@silvaco.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 4/5] i3c: master: svc return actual transfer data len Date: Mon, 16 Oct 2023 11:46:31 -0400 Message-Id: <20231016154632.2851957-5-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016154632.2851957-1-Frank.Li@nxp.com> References: <20231016154632.2851957-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0089.namprd03.prod.outlook.com (2603:10b6:a03:331::34) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB8329:EE_ X-MS-Office365-Filtering-Correlation-Id: 161f0a0d-488c-4f24-6797-08dbce5f20a4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: aZP4zi1TXB2RW3tc0UjLWEfyIfKkJGYn6XJgWeEq+B8tpUDrOcTqGTObIV+sxrggL1v1Tn5V2FwE0ketkYHN6flV1Pht0MWZq8uSNlmxl0lN/s/WiaJkX//WqHdDxuQmP5H/BJ8bOt1j4EeJjrlVf/hM/5PIg+qDupIqIgx6uXpBTjZbeNuw0TP5zKkxOhpHvpS74s3Byi0seNM04XTNY4Nb2Exj8Q7jGLSJ2zbDnTpQgOHMaTDtJ2Ok0nVvJuDJVNt3Z9XzvYtiMBgX1N4B0MdRZIJXTVkwC0Y0u+GFYVlQboP/6z9xQivqzr2Lii8HPPSh0ia/vT3Hm6SP5mNVqoz1CPFve43YHU9SdZIQCmQZKfoLshcEnh2UhYq15zIylX9YxsTqbiHw4+Ie+/XzqqQxp/LRenXmS1h2zeWSQRA37TJO0scN/5cIsO1Si1ZmOATwZsyE3IAkFSUSh/3eVnFjUYnofpL4nlGLNCjLrDgBa9u46vXBJlmDLqMuo9ZeFrJoyqC7Mn7pjThmHE5IPxi/j7ouUY8elJFoXRL75NLDwASd4KxcN5JeHuU3JLb7ne2hxs1Xu4PdLrRLycClhkBCRGz9D5duFtHIA5toIj8OwQOw0I1GKW0qI4L+3b94 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6666004)(6512007)(6506007)(52116002)(5660300002)(8936002)(8676002)(38350700005)(478600001)(6486002)(1076003)(83380400001)(2616005)(26005)(66476007)(66556008)(66946007)(316002)(41300700001)(86362001)(38100700002)(2906002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: s55BwbT+di1ygJjsy++c9ZIyg1r/4g2JZ7mx7+jNLH/zoaNOzFDiYouvX6LskWibhokFdEudYhG3xAz4VaP+7gD3s5H7DjLW0UHAFI9EvG9di5VunkHD0YajlBTrrfCWXIhzoCaKL0Y9ASrkzsD+xZ/AVzZttxggqgKG+eRvdvqH2b1p+OxVbFQk7ceMzKEzN7zCXrzdZdeIIdt2PzXRt91dQbh1up+hOtLHsJSPkG+0EbeJlGyWYfQTj1NmPJF9Tqxcuyl7kOStRGd86mtpy3Te2aTgpaF5nH03PnpYzK4eLfGRy2g98YiQQ3IxNrVIL5EbFK2msV+kvKQbY0Ze7IdS0cHcGPlPaOdRkCNKnvfFXhB1KpKRwEqnVURrayr4+yiGEI2WuYiCJVfpyc9baoKsc9kGCU4NbSCkj2+2DfFiX6HemkcGJhr1C43uS6QvzjN+E2vT0fqS5+o/ivS8GJIuiIhvEcvHmdmgsFdZDGD/X3vI73kkxxhobQQMQCbxhTh+4HwH1RguUef/M6vVeqJEvRQQ7SSPWjRd7hKGCmlWC+hIRncg8UuKQpnxB3IJ5rTzDJZRFavBiOA/j8lv6wnTQWSbgp0M4ISyjA6/J30rhQTdawGFtElGMUh2RlI0jzqetESWhwz6r1GWSJahNRwphUxL6g+rYXyNRiQHC+vYvVbta8VnRi7AInUKmKuZLN02zEPJzJ540az4Wazz04/FtT6KlSxxDfRuuezsUgVzZ/T4LPunWYeeVJi/S8BH4bt9tWJivwEGqoFXIz5C6DQ7sYb3gdiJA4agpjU2rNOi8YKxapOyP4hiakTaDQrUhj258OFU+zppjE4QhXrn+plHpqdZ38N1/krQh/X4IigIr7bGtOs23seWbIDoasVHh2esTYa9AWc5Kf9q4U/tagVww+4iRkHgh679RnmKcDJg6hZhqhktn6d5/yi4xkA5DtwU4yKK+ScwB44AUsQHKllfQKxSx7gthKtm01H4NKdT8LddgUus+2RuHzSG8iLk0kSP1X946/zbBmE+gAdAKY5BH4tEjpEdYUKILDTZtErjgBGmIDG20i8V5eSBwxZthKpyDnu6ci5OrqHLWILVCgAtVVGE7ySnKCsGn1XE7R/tFuJQbZBsgfe554D7rgI0v6ifdxGEq8JmsEAKduhdL6tYFsBrxJXTJ00eHIJVssrypV+m38mNS8f0O9fb3kQECTCx2k1mqObeh/coXNYJvXWMptZHDFKcHk25J+1vu05gpogCU2gqULyKZixpDD1HajOIxXIytq7ZT2xQl/axGKTQ3C9M/RDHVqQouISmOZVM+VIw3HAeShXv3c/cNS/j0Zr9qFOTi1ofq2u83XAARentOjobLXKOPQLKvnV4vrIcA4xnWi198l5h4q9OEsi4kS30LEr8Oj6p0vySiDjR+88aXgyIDQH3IxfJT4q18yNiWiOPZVn93cw/i4uzP3rRj8gYhGNo2v86uWwF5JlOV5mP6/hcn4N4zs9VxJ2DywBCy8UpZuDl7LYljTJGtatNljuBvrEIcL4NX1rFJNkoAml9d3Q8tPUP9EtO7qnK8qc= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 161f0a0d-488c-4f24-6797-08dbce5f20a4 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:46:56.9398 (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: VCx1GMDBNUymHlGT9sARvJMbYQ3aHpIjC74ifTcRNHCBehZTlK4FOyogFMYFMPVGefxyjrSW+ZxTT+yjThZVCw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8329 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]); Mon, 16 Oct 2023 08:47:27 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779927613199435846 X-GMAIL-MSGID: 1779927613199435846 I3C allow devices early terminate data transfer. So set "actual" to indicate how much data get by i3c_priv_xfer. Signed-off-by: Frank Li --- drivers/i3c/master/svc-i3c-master.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i3c/master/svc-i3c-master.c b/drivers/i3c/master/svc-i3c-master.c index 3570b709cf60..444825aafa6f 100644 --- a/drivers/i3c/master/svc-i3c-master.c +++ b/drivers/i3c/master/svc-i3c-master.c @@ -138,6 +138,7 @@ struct svc_i3c_cmd { const void *out; unsigned int len; unsigned int actual_len; + struct i3c_priv_xfer *xfer; bool continued; }; @@ -1045,6 +1046,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, if (readl(master->regs + SVC_I3C_MERRWARN) & SVC_I3C_MERRWARN_NACK) { ret = -ENXIO; + *actual_len = 0; goto emit_stop; } @@ -1062,6 +1064,7 @@ static int svc_i3c_master_xfer(struct svc_i3c_master *master, */ if (SVC_I3C_MSTATUS_IBIWON(reg)) { ret = -ENXIO; + *actual_len = 0; goto emit_stop; } @@ -1157,6 +1160,9 @@ static void svc_i3c_master_start_xfer_locked(struct svc_i3c_master *master) cmd->addr, cmd->in, cmd->out, cmd->len, &cmd->actual_len, cmd->continued); + if (cmd->xfer) + cmd->xfer->actual = cmd->actual_len; + if (ret) break; } @@ -1344,6 +1350,7 @@ static int svc_i3c_master_priv_xfers(struct i3c_dev_desc *dev, for (i = 0; i < nxfers; i++) { struct svc_i3c_cmd *cmd = &xfer->cmds[i]; + cmd->xfer = xfers + i; cmd->addr = master->addrs[data->index]; cmd->rnw = xfers[i].rnw; cmd->in = xfers[i].rnw ? xfers[i].data.in : NULL; From patchwork Mon Oct 16 15:46:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Li X-Patchwork-Id: 153515 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp3552260vqb; Mon, 16 Oct 2023 08:47:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFQSv/kbDHuB2kVwJP2O+PxRyEisZ27+g4H5VAIwYYS4rAnG5JcLmufYiezCwka7kArTn6t X-Received: by 2002:a17:903:22cc:b0:1b8:2ba0:c9a8 with SMTP id y12-20020a17090322cc00b001b82ba0c9a8mr37953656plg.2.1697471262440; Mon, 16 Oct 2023 08:47:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697471262; cv=pass; d=google.com; s=arc-20160816; b=WMWZtbkEPd8QiA7VJDuFKDONksgRkunivh7bM+s1SvrvY3VC/KyEk2f1VWuuNbUKM1 m0Hl04ukmU6i4uSPUxXKRCQTriTKmwe3QBtHuJRyk4E0hYfZ2MPrDT+jIuv5ZEaw1BB3 5XCIfYbjmlVD0SncQtaelbkGCHrkuNiLfZbTak4AyEDabUeMOOVjlM8+HiIVlbKCslLo tMWuySt/N0f0d8eCZ6mGrI39fJB+zT3V+N3mpuJ9L4x3O4WwaZgNK53/HXGrwBIgqwhX zI5bsvHHARChonUwr5IQNsi5RTFqcT0X+u96haVn+6l1pcnR7we7tPOZSGx6r077igPC jPsQ== 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=pr4HS15qL0Lr/tIXBZpHIbmsN7TKrO1OgsFr9lMg6OA=; fh=Ti0qdvZV/i089alSarny0opSonFaCxJFklfGvdi8roA=; b=VfWVOdoL8DUUQxjrwR1mUasucJnXl97e7RaRCj01wTjOGPnyHGE7nOiiunB9nkNdAp eP7VtkLq4SqqMQr8D4jW5dWNkDoAjgRnUqyXGsXeHOBbC/MEXrb+t6+rbZNZwdeo2RUT Ibrm7Qkp7z7xGDAWTHo4CHqjxVRd2ZMuJCk5E9So37srqtgdT6iqww9j59up81AQ/7Ry zLlw5sy63VLsopmtTlUW5+G+i2nMw49CmOg5r1kfHSWhblFvrPrjlyuyzZR+1WgZyauw k4Hhl8YWK+gUIJmEruOkdvnofnDraR/7Y45/1AJnTyb3G2mJdpYg0NRtTD24f24ijSET fqBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=LXRe+7ms; 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 v7-20020a170902b7c700b001ca85b996a7si1685735plz.192.2023.10.16.08.47.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:47:42 -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=LXRe+7ms; 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 409DA8047540; Mon, 16 Oct 2023 08:47:40 -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 S233952AbjJPPrP (ORCPT + 18 others); Mon, 16 Oct 2023 11:47:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39782 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233913AbjJPPrI (ORCPT ); Mon, 16 Oct 2023 11:47:08 -0400 Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2068.outbound.protection.outlook.com [40.107.105.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2480FE for ; Mon, 16 Oct 2023 08:47:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PKz8g9SX+ugY25mhv1ZZr1kaclV9s6Y+1/0b6fGQexmz3OJs0Xb66zeMSH60bg/6ce7uhYV0dKNzMLiKPsOAZ0tt5rVlOpsZlU4tJyXNCZOp3D1adQfJ5vZYDueWYyROJRF9X3gYPkRP3dtTLo4eFIOuFUOoqSLzSoms5zu8EPEdi4MvFUsSl62JkR/aGzX8d9H5cUFwzSIVZEfMcN6gIWMrl4fFSNdfqsXzm/WthBlgYqdjljNszwPo9JRqX26XUjaZ8zy9UvdzNmNvdyJs/djGEbnT7RqqStRhLnvZICPghwr055eRnoWpyjZQT83MpBStVhbqBpo3P1Q/5ydmQg== 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=pr4HS15qL0Lr/tIXBZpHIbmsN7TKrO1OgsFr9lMg6OA=; b=jHg4dQXSSYYR0q9D2SGAeeUV/Br2C6IGpEBE+ak+wDv4XT1wI4cLD71SP0PVvoOWYgP9nmSXKZnHWQsR3+Y4KlptWhQS5GKY896awW/PzeQXDrJ7h24pKXrMnctWevUyFRpDqmBFFdwfCqr8KWVDiBVpqSwodu13rsCmsIAdtKdMb63gUy7750Qx3VV7m+BPg9Z2yY4NuavbutggohRbo4os9S5Qk5mh52vQwNWbEpe7+8Q9FlCqVt8OIwYnA0dkhoGfvnqoc+R6azgHUT+dZNvC6h9S+6SvAazoSWWAwg7PtABRVR9za9W5ZEilAp7B8/WBkssgCHPAS2bhFFRCPg== 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=pr4HS15qL0Lr/tIXBZpHIbmsN7TKrO1OgsFr9lMg6OA=; b=LXRe+7ms000qs+sOyh1LPEHpfMf3Xc8pFBfO3JxADVMrAOAPtiLbRqIXkR0ZZX0XwsKU0Wt/fZlIzSr8ECnSs/h/C4Mm7hGXBINBVpzWUCSFzQVGXUrN/LEC0G0bA24b3EB4xCQpuZqyku7dhUpZX2G0f0aJFsOZE1kIhZEr1fs= 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 DB9PR04MB8329.eurprd04.prod.outlook.com (2603:10a6:10:24c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6863.47; Mon, 16 Oct 2023 15:46:59 +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:46:59 +0000 From: Frank Li To: alexandre.belloni@bootlin.com, miquel.raynal@bootlin.com, conor.culhane@silvaco.com, joe@perches.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev Subject: [PATCH 5/5] i3c: add API i3c_dev_gettstatus_format1() to get target device status Date: Mon, 16 Oct 2023 11:46:32 -0400 Message-Id: <20231016154632.2851957-6-Frank.Li@nxp.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231016154632.2851957-1-Frank.Li@nxp.com> References: <20231016154632.2851957-1-Frank.Li@nxp.com> X-ClientProxiedBy: SJ0PR03CA0089.namprd03.prod.outlook.com (2603:10b6:a03:331::34) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|DB9PR04MB8329:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e822f8a-11cf-40be-f505-08dbce5f21f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VfqJhnqUGNDaA6+YFVt6oS/spGgX26bblxho9jI2UtCMiMxfDh7iPhMYVa3o58cnoQgZR2i48wA4BW6WmyFxXKc8+SpFMHF5XGGlvTrIbt5ySY+/w1vtCNN9np11Qm2JoJG1qAqeLIv1Gp9i/MioIUZVsnT9R55HMT9dJscA4bFy3as93A3C7n+rsZ6I7hjkopDTrf/kJjkpM18NJluc3W0mtuUoHBiyNLGuIOwmMHKKtgUAQM65fSEsyf/Dc4KGDRwe67DbU0wmV9I0/YlgOxIgxGI9sh6UZ8avdFdb1gR5p98rkIy2v5+TxCnWg96L4jP0LrjJYxrGqa2fpFtLfvliiIRIR8mB5nYnBLqDlctf9FO0qk3CdRpDaZPjbA+iv0uItkah3JUgiS6y2/Bf7VlS8AjBB6ESp7xQZcJ9PM9Tk9CvOvDYXVh8x/mTBK1d52x6IO+TcE8R7AGxTrO6+VMi1s8oudtFoom78j71WGV5AQZM0nVWFZppS7ekOUMybV1TU6zTVe34qc1dZdf26wAfe57Co8fio7o7EmGN3MCoID8Wr2Tld0HexM1tg4OUx//27n2FNUuruUXSkFVkJ24ozkT8KYzomRoU5wrFVoKyzH5wk1RieUMKdGEJVxvq 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)(39860400002)(366004)(136003)(346002)(376002)(396003)(230922051799003)(186009)(1800799009)(451199024)(64100799003)(6666004)(6512007)(6506007)(52116002)(5660300002)(8936002)(8676002)(38350700005)(478600001)(6486002)(1076003)(83380400001)(2616005)(26005)(66476007)(66556008)(66946007)(316002)(41300700001)(86362001)(38100700002)(2906002)(36756003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: wvZS4rMownKFy30Ttmq8onegMjl2kViS/IJ8ZfTOr11gvvSXEq6KXwRpRUmbni2U50Ng3xITwvWnUfJTbEJsJfSyv5KyRMcoUxqs0DAeh3Upb3mdoqJAt0rX1mCu915QwjJyu+wwD7WPa3YAQ5wr2ZZO+EjI8I8Nkex7W4zjkWjNBlz68UG67JpOaFtqiWNX6oiDiTtboOKEI7S/5RuBFq9o6OdBsBhetLoonBmTa5H3soNS/Ej1zYKjnSryfuoDOlbNercaNgiY8idA2EKhdakYWeB4KQ1oYhTv8AgCkhxIXNXqmALx0zzGHh8sfuI6Aa2aBZ/lfLSXxH3MbQKCdKHX+/YLEKRUR4cqHODBwvMvvVl08OtZtmaCx80yXAwEk2AlsJrnSZfXcERk+q4BQp8Z/7GrEcTdzRqp2SMnrwrzDMRTItiZmHn6cz1lRAaZvoGCTE2Zk6LCFdL0QOIkWwkQ/jhUoTdHKGIqWNrz42FKPnHCbP6m4VOQlMfJsH3sMvHP88U1HtCOFMSqqNgNFJiiE/3yq/iNk+TqjRCYT+qRGPRYM+M66myEV0XdnKuH7xXTzq14ZupT5U9BYbIDK07rDy+RJbjqiOUE7buD0ZwqlpBwcNTFcfbliGDSTE1GAEb8HmVWbeuQDpkZIiWSRIopvm6fLNchKW7rspMPjAjJIKeyFTOGiuBxoeSkCL5RVK9d9c64OSWMoG//4aXywg136HwvxcyWI9vts8IJglfj8keZEdSQjdt4oBaEg53rkh0LQMoa8iyLuT8P3zHRpuuiGtJNQbfhmSIFqaPuwWAsqjdOO0LuxSwaDZ/Sv1hRemx4k5Cao8YQVoLXUBloySxWjLCGlk2MjToECQD3rewUJlP6Y48AoZqjrJTDFY7LGEUm64gLe137cPz6U+ZUIpgMGjQjjF8b9u4avQw1rWSlxW4KfWUdVLyxiOGwIorVBGd+sgQu9OVaYkLvghI/ZliaA0DzLs8e4ooSZWC5SM57hl1kLjfSZxx4qZl+xAI9JUrGC7V/9usaUpSeWubFjpXSIg9wK4Q9XSkSwmuZHuF8IleO2y/jSGUwahH3/uClhLuBbOqSun0a7KLC9skt2PuSYWTYkTQqI/axsuA61ZZnnqRjbh7zGtm6LwuGmdb6d/VsiIVul2DalQNHBUHGlfMq+dggopdE4JNnZNFVfo1OD7S++915THTLn13NiVNT04DOpVpCrsVykUNoNhZxnm4L03SmGYAR+URA7e8XOxca6GP5fmXUCbCMOWpHfQdXw3d7Wtoz6jk5+EGZOUeb7jE9SZeEcwYqrn0XbcL9X0syD3ovo1iuHNQJEGkdHszAzg1Q4lWFkxd+JpDTsUOqyKfGY2lU4N+/paIt5lBFmz02xB9Y9rfruZEs1o7HlUL/EQtHwsiqbEleVK0B5ew5i0Vy7BIVQ56D0MIXSQGsF/ss311yNBdLNATEnX8nvks+8/d7XhYhcIq+UKE7tXF3+dly37rBnCzuw6jrd0Fp/q0EfSYkbdebLJLpCBV4nee3vPtdgEZTiShB6OX2ApfdTImQmAM61FZJi2F7B1t6CXk= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2e822f8a-11cf-40be-f505-08dbce5f21f6 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:46:59.1855 (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: JeQ6TXz93fDbAFi8r/aBnp5ou9uTh7T6EqDbdedPEPJqsk64LpmUhgDs8nvEuRm1Y9MH2moiCjeMIxet3PK0Ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR04MB8329 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]); Mon, 16 Oct 2023 08:47:40 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779927626533472312 X-GMAIL-MSGID: 1779927626533472312 I3C standard 5.1.9.3.15 Get Device Status (GETSTATUS): Get request for one I3C Target Device to return its current status. Add API to fetch it with format1. Signed-off-by: Frank Li --- drivers/i3c/device.c | 24 ++++++++++++++++++++++++ drivers/i3c/internals.h | 1 + drivers/i3c/master.c | 27 +++++++++++++++++++++++++++ include/linux/i3c/device.h | 1 + 4 files changed, 53 insertions(+) diff --git a/drivers/i3c/device.c b/drivers/i3c/device.c index 1a6a8703dbc3..0566ab9f1498 100644 --- a/drivers/i3c/device.c +++ b/drivers/i3c/device.c @@ -196,6 +196,30 @@ void i3c_device_free_ibi(struct i3c_device *dev) } EXPORT_SYMBOL_GPL(i3c_device_free_ibi); +/** + * i3c_device_getstatus_format1() - Get device status with format 1. + * @dev: device for which you want to get status. + * @status: I3C status format 1 + * + * Return: 0 in case of success, a negative error core otherwise. + */ +int i3c_device_getstatus_format1(struct i3c_device *dev, u16 *status) +{ + int ret = -EINVAL; + + if (!status) + return -EINVAL; + + i3c_bus_normaluse_lock(dev->bus); + if (dev->desc) { + ret = i3c_dev_getstatus_format1_locked(dev->desc, status); + } + i3c_bus_normaluse_unlock(dev->bus); + + return ret; +} +EXPORT_SYMBOL_GPL(i3c_device_getstatus_format1); + /** * i3cdev_to_dev() - Returns the device embedded in @i3cdev * @i3cdev: I3C device diff --git a/drivers/i3c/internals.h b/drivers/i3c/internals.h index 908a807badaf..976ad26ca79c 100644 --- a/drivers/i3c/internals.h +++ b/drivers/i3c/internals.h @@ -24,4 +24,5 @@ int i3c_dev_enable_ibi_locked(struct i3c_dev_desc *dev); int i3c_dev_request_ibi_locked(struct i3c_dev_desc *dev, const struct i3c_ibi_setup *req); void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev); +int i3c_dev_getstatus_format1_locked(struct i3c_dev_desc *dev, u16 *status); #endif /* I3C_INTERNAL_H */ diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 08aeb69a7800..fa831721f305 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -2840,6 +2840,33 @@ void i3c_dev_free_ibi_locked(struct i3c_dev_desc *dev) dev->ibi = NULL; } +int i3c_dev_getstatus_format1_locked(struct i3c_dev_desc *dev, u16 *status) +{ + struct i3c_master_controller *master = i3c_dev_get_master(dev); + struct i3c_ccc_getstatus *format1; + struct i3c_ccc_cmd_dest dest; + struct i3c_ccc_cmd cmd; + int ret; + + format1 = i3c_ccc_cmd_dest_init(&dest, dev->info.dyn_addr, + sizeof(*format1)); + if (!format1) + return -ENOMEM; + + i3c_ccc_cmd_init(&cmd, true, I3C_CCC_GETSTATUS, &dest, 1); + + ret = i3c_master_send_ccc_cmd_locked(master, &cmd); + if (ret) + goto out; + + *status = be16_to_cpu(format1->status); + +out: + i3c_ccc_cmd_dest_cleanup(&dest); + + return ret; +} + static int __init i3c_init(void) { int res; diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h index f2fa7ee5d96d..212cdcd17179 100644 --- a/include/linux/i3c/device.h +++ b/include/linux/i3c/device.h @@ -344,4 +344,5 @@ void i3c_device_free_ibi(struct i3c_device *dev); int i3c_device_enable_ibi(struct i3c_device *dev); int i3c_device_disable_ibi(struct i3c_device *dev); +int i3c_device_getstatus_format1(struct i3c_device *dev, u16 *status); #endif /* I3C_DEV_H */