Received: by 2002:a05:7412:a986:b0:f9:90c9:de9f with SMTP id o6csp14906rdh; Wed, 20 Dec 2023 12:56:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGQepP70Ti/2sTozUJfJwJ76ockJJcKS9gpZO/LdMXMIeaZFqUthl9ZbFXv/JWCtgVOosR X-Received: by 2002:a50:c057:0:b0:530:74ed:fc8a with SMTP id u23-20020a50c057000000b0053074edfc8amr11285234edd.41.1703105785124; Wed, 20 Dec 2023 12:56:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1703105785; cv=pass; d=google.com; s=arc-20160816; b=HWYURyRNySkmGyEtVWVs/Fq8vX/aq9mlm7fCsUaQuZ/hSVY4WWY1FGdkcEnrLd2jhP vZqTj3zqZMQ312gfhEJepZdg3GBwfIY7UkyvZxXcUqhwnG623sqKg61mb5peV6zQbIOn +1jZX4tTWiXMtEdNhi3HIoBY1n6HfZ3UdjxdaJVce7tRT2gm+T0LRh5Tj0pOtm/G8Ogh yuKWEVMVzzOlTZgolBSvvBxR4MfpE78MXhdOC3NDIHSYNt42C17YtcrChxkdt83+uGMy hvgO0vpalm3n/TG6YBiFwyDUoNlrwLcBh+Q+SQWHqAAGovv9+LC1QArI+4A0dnnRYdla YBUQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:content-transfer-encoding:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IMmqdNqWeBI/k9PJ5woNz6J3+/zQQRQaw3Bwp4YM1l8=; fh=T7AUefCk+QIddN/BjXfcNAsSFuLD7EKaW41gOkKde7M=; b=N5oMEKpeJM2f/Bxa4utmA7IbZYAToXKarDbIZTpgLJH6uY6b3RjvhUZcSk0ZHVp7S3 952ppaRT7WXdnD3q56wN8+r/DRLmKWmZfs4xC7+nnFO1wuf+ALlPjVBozHDIyMlcsI8m En1z+bTBDx8lDJ2MrccVKfUmqFZNjXpyKmQEY8G3JquW3PI2FIIZ9T5SkbnkleSyl57h G0j1sIx5AdG8nniNruqNEVXeFa+sPqe7M0yicxpgqQIC/g+VRZ+Db0Qz4BzWu/DRFy1B a9l/16wJAiCKvIpUq9a5zookpwZT4BTKQ2L8t9aT/E1X3ZDsODMf1Qx7eQgCWJf6POQ1 FG3A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Wx3ZWVgD; 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+bounces-7427-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w2-20020a056402268200b0055364ee15ccsi165054edd.446.2023.12.20.12.56.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 12:56:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7427-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=Wx3ZWVgD; 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+bounces-7427-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7427-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B2A4F1F23758 for ; Wed, 20 Dec 2023 20:56:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4B3B1495EC; Wed, 20 Dec 2023 20:56:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="Wx3ZWVgD" X-Original-To: linux-kernel@vger.kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 43FC1495D7 for ; Wed, 20 Dec 2023 20:56:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rib03Pw8Go9JUBIckA/VCOuavgMsAJxCs3LueeuFVeqZojsLvli9aKnBMwB1DryqbIOcEyu/vvYGOjjdfNjToe221MPVM5CHrdGxDR16Kx5yhz5MelBRBadJ34hrRxa74JEiN1R3rgyG/WVqdbwgNko/y2Nw0jv4vNkzU37H2qHZaIgiEI5LpLCJkR48UPCw1RLWRSCYu2ZAxNcm0GNMBJEtYWcCB6mfir2yvMvrTeskHcAQcNb5k1xcCjPYWiVIEzcjVmFsmgPmOApZrsjVlZdmuc6HD9LD0rB6mkRSrJspOvnLxw/IRWMw2jPwetkhpfLE/uO5/w5YaHwZ/3pcpA== 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=IMmqdNqWeBI/k9PJ5woNz6J3+/zQQRQaw3Bwp4YM1l8=; b=YZVU1PhVOEDyvXm58AjwTpRImHIjdytLzzdvL8sE1Tos2S64xIIDZsS0oEXyaeLyN7x9aHmlu+d/r1YLFxOO+kyvmCL2VO7UWOyV1SbAw7QEr6KL87FScc1oLiDiW24izxtJ9vMYo8Qx8UYJQYGKyoKqi00GrBzDpnkERv/b1gXchQSf082nJrMaTFzQZmEkyQcXLW30n1neygCtDOIKz5b3AI6GiiGGqbyB9bWXzrL/Zx/VG44UmHWeYBfWyjw07mVzIUyBllsoPL9a0FDWd9GdoCTazQQQGfAAk296dX0uL6O7Vs5HvsFAM9rLE7IKnPS6KZ8oOEsKfzDIDJkZCQ== 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=IMmqdNqWeBI/k9PJ5woNz6J3+/zQQRQaw3Bwp4YM1l8=; b=Wx3ZWVgDyC3Ex0OwIaOCzSiorQYe4j2n/Szsa951/Q5gofpgRnMPth0+Gu9xERuZMdc9fKempk0OgAgd8l7wCXzOP2rcFW88fA9O3YrrROlhb577yKa7kq+Ql7vmsRqNlYtKhMX2yv+SFPEhnp133KCf2/eIQPfs/NMPFJWuIPA= 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 AM8PR04MB7729.eurprd04.prod.outlook.com (2603:10a6:20b:24c::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7113.18; Wed, 20 Dec 2023 20:56:06 +0000 Received: from AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40]) by AM6PR04MB4838.eurprd04.prod.outlook.com ([fe80::95f5:5118:258f:ee40%7]) with mapi id 15.20.7113.019; Wed, 20 Dec 2023 20:56:06 +0000 Date: Wed, 20 Dec 2023 15:55:59 -0500 From: Frank Li To: Joshua Yeong Cc: miquel.raynal@bootlin.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, zbigniew.lukwinski@linux.intel.com Subject: Re: [v5 resend 3/6] i3c: add actual_len in i3c_priv_xfer Message-ID: References: <20231201222532.2431484-1-Frank.Li@nxp.com> <20231201222532.2431484-4-Frank.Li@nxp.com> <2cfc670f-56ad-4453-82f3-d72dcfd05840@starfivetech.com> Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2cfc670f-56ad-4453-82f3-d72dcfd05840@starfivetech.com> X-ClientProxiedBy: PH8PR02CA0006.namprd02.prod.outlook.com (2603:10b6:510:2d0::23) To AM6PR04MB4838.eurprd04.prod.outlook.com (2603:10a6:20b:4::16) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM6PR04MB4838:EE_|AM8PR04MB7729:EE_ X-MS-Office365-Filtering-Correlation-Id: 5342cd92-5a57-46d6-42ca-08dc019e15cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Pduo9ZDSdBA0FwFy3dbX3hLPyVPf/4kDrj2PUXwotG+lFuF3y4goOgPkUOF+CvFuhMM39rLTmY7Bc34mBGPIXAOyGIYUUmK285cWSU1SAaR51Lr/evqZklM22DAVyWwapIh3Lqk1AAaq5T0eWunKhd9d700A72Ci4pbaAhjqaTZDQJ0i503J9//l2sDxWW/hKPnRiCYDupHPmpR7C1Apy9NYAunqQjK3uY9NNKIkW//B0v2qVkpXlNqJ/Fj3QiAqj6NhLh5/pmwlHoWCt2G6HwavoqDvJCiCDZ2+crhsYQwxb1QYqH9JUmmiQu2Hn+P76rOzKWMofAUWJ7fFFq9A7tK0svA8B8uMYAcNPWZtbUjF7kc/vOTuKFGJAiIBtQ3WAkQZVJKZ1Lggs32jzaUxHUfLtypAigLAEzO8U7G8oF4mhMz3BC7OqyqERd6dCM2QL0MEMvJctKVxmqJ4XcBRaVRkFj5bJ1uALVUmA/75leRimYcazPzbjJZI26moXTeZ2UFOCOVxQUH68A+KE3YI66OJgXfAeZs8smGUwt1cCMrg4buZVzgAdMjRRcMi9ag6o2jC3IHoFBsqP+Q0IziEWj5U7gLeLv5NA5n8MnOB0XAfBDz8jbPR5MC54JbOJ8BN 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)(7916004)(376002)(396003)(39860400002)(136003)(346002)(366004)(230922051799003)(64100799003)(186009)(451199024)(1800799012)(33716001)(38100700002)(38350700005)(5660300002)(4326008)(8676002)(8936002)(2906002)(26005)(6486002)(53546011)(52116002)(9686003)(66556008)(66476007)(6916009)(316002)(66946007)(6506007)(6666004)(478600001)(41300700001)(6512007)(86362001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VDNQQ2lLL0NiUUtIQkJrZGhRTUNvbTE1NlJmbmNqa3U1MldHWndJMXRtV04y?= =?utf-8?B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DYzRUJ6dkN0Q1Rz?= =?utf-8?B?QmNtK0ZPTlQ1U2huOXVkRG5Zc2ZMUmYrOGxEQWlBamEzMmx4NCt5dGZ2dFJj?= =?utf-8?B?ZU9IT3V4Q3ppT2JGdVBjU0tXczlSSFVKakdOeXROenhQaHpJQlZhcEx2aUlS?= =?utf-8?B?NE1ZMTBudHh0ZHVPdEszK00wZ09YY29qTXpzb25JSC80R2dZY1ptYlhlcFRB?= =?utf-8?B?RVJHc1J6NEJZNmg4SW53b1RoOHFnalpyckIvY2NURmE1ZGo3T0h2OGdGWnF3?= =?utf-8?Q?YU8FgF5vCYF4oFLC0pLH50zvv?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5342cd92-5a57-46d6-42ca-08dc019e15cf X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB4838.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2023 20:56:06.4288 (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: rrgdk7YiyW9srCIs8qj8ScKDULQYSBYztKC49sjj2XbGecDCdPXmW8jlz/rJcimwVERnT1T/fo7GbkovdNkm3Q== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR04MB7729 On Wed, Dec 20, 2023 at 09:55:26AM +0800, Joshua Yeong wrote: > > On 02/12/2023 6:25 AM, Frank Li wrote: > > 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_len" field > > to indicate how much get by i3c_priv_xfer. > > > > Reviewed-by: Miquel Raynal > > Signed-off-by: Frank Li > > --- > > > > Notes: > > change from v4 to v5 > > - Add Miquel review tag > > > > include/linux/i3c/device.h | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/include/linux/i3c/device.h b/include/linux/i3c/device.h > > index 90fa83464f003..ef6217da8253b 100644 > > --- a/include/linux/i3c/device.h > > +++ b/include/linux/i3c/device.h > > @@ -54,6 +54,7 @@ enum i3c_hdr_mode { > > * struct i3c_priv_xfer - I3C SDR private transfer > > * @rnw: encodes the transfer direction. true for a read, false for a write > > * @len: transfer length in bytes of the transfer > > + * @actual_len: actual length in bytes are transferred by the controller > > * @data: input/output buffer > > * @data.in: input buffer. Must point to a DMA-able buffer > > * @data.out: output buffer. Must point to a DMA-able buffer > > @@ -62,6 +63,7 @@ enum i3c_hdr_mode { > > struct i3c_priv_xfer { > > u8 rnw; > > u16 len; > What happens if I3C device does not terminate the T-Bit because it expects > extra length from master? If devices don't terminate T, there are two cases. 1. Master send STOP, then START new transfer. I3C Devices can decide start new transfer, or continue transfer left data, which is totally up to how I3C device and devices' driver implementation. 2. Master continue toggle SCL to get extra data. Just like a low frequency at short period. Frank > > + u16 actual_len; > > union { > > void *in; > > const void *out;