Received: by 2002:a05:7412:d008:b0:f9:6acb:47ec with SMTP id bd8csp293584rdb; Tue, 19 Dec 2023 17:55:42 -0800 (PST) X-Google-Smtp-Source: AGHT+IFKT+uVUUUo3cIN3Zx49wKvWb4EOFKW+JTiov11fw7BeKZ2zni8KIRcaoeDYFRK7v0oK35n X-Received: by 2002:ac8:5c01:0:b0:425:88bb:ca82 with SMTP id i1-20020ac85c01000000b0042588bbca82mr25161757qti.117.1703037341970; Tue, 19 Dec 2023 17:55:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703037341; cv=none; d=google.com; s=arc-20160816; b=hx/+X437klt+d8MhTrYvCxhvGAMqcEWpNz0kLjMLJV4ieKVdGH6BkCT3gDfwIG/Y/b H6nDu5t5Hra1GgjFBmSfeGNgSYRm/8gcHh1o2mdTQdi2qT3TdD0nNtxDoHvDR7W1UgyD KyvfDivhjMGqfpk32/ydoZvO9jc5aFL3zgZRL+G1IC2qiCCXhibLqA7nyTOPuvR/kK/P 9yv2S5xz0kX7KsOugfxVMhkUlx+nx+r1WwpfVXMmfkjcf+oyRjNF43qcsqiGNvbRA80C h+KgZ8nwmrtmFLmQY6+XEtJ0XVU39LRSeubpG5frA/pfIDZl/kpyTYg+aPmYov1PmhcR fuKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=kUvuLHUBsAJLfm4JzYY5HvBl3xZiGeUTtdW3yk6EWyo=; fh=cLpoIWXJzRWwGh1USwqSj2B9laIKrwhIuI/FqbvnuPA=; b=Kn7T7oEvlgtUhiLs4CuMeSv72DpdzgYQBoj5P4UAW+8+3x/NF6/vA7bb6gn2YhIe0x buhFEmB7kUGVlBiZcbcJzBGweIpJtUQq0A0Ct07JjCJNN0JI5XjffnSK8KoUkD93y1MH KiOczmhHNfbuZZ2jrcmgFHZ0ir/IEU/g9TUtphcbo/xWnooqyglGAuenMqYMh29bjwoE vDSqUwINTBXZU6BriOxSNbXBcbP836Pd46gi9kxyYWGkPxWbdYbWicE8RURUk/P3Wnbk teF74/wFn682xf7bZm/pxaAEamFPIATaOfwc+TnW57UJLymqoffA93EchTlxZeUyfMqJ WX9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-6272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6272-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id cn4-20020a05622a248400b00423c11fec7bsi29284483qtb.112.2023.12.19.17.55.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 17:55:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-6272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-6272-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-6272-linux.lists.archive=gmail.com@vger.kernel.org" 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8AF651C251C0 for ; Wed, 20 Dec 2023 01:55:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ABC8D1F608; Wed, 20 Dec 2023 01:55:34 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from ex01.ufhost.com (ex01.ufhost.com [61.152.239.75]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 55B821F5E7 for ; Wed, 20 Dec 2023 01:55:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=starfivetech.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=starfivetech.com Received: from EXMBX166.cuchost.com (unknown [175.102.18.54]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "EXMBX166", Issuer "EXMBX166" (not verified)) by ex01.ufhost.com (Postfix) with ESMTP id 0A7C224DBFD; Wed, 20 Dec 2023 09:55:29 +0800 (CST) Received: from EXMBX066.cuchost.com (172.16.7.66) by EXMBX166.cuchost.com (172.16.6.76) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 20 Dec 2023 09:55:28 +0800 Received: from [192.168.151.176] (172.16.6.8) by EXMBX066.cuchost.com (172.16.6.66) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Wed, 20 Dec 2023 09:55:27 +0800 Message-ID: <2cfc670f-56ad-4453-82f3-d72dcfd05840@starfivetech.com> Date: Wed, 20 Dec 2023 09:55:26 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [v5 resend 3/6] i3c: add actual_len in i3c_priv_xfer Content-Language: en-US To: Frank Li , CC: , , , , , , References: <20231201222532.2431484-1-Frank.Li@nxp.com> <20231201222532.2431484-4-Frank.Li@nxp.com> From: Joshua Yeong In-Reply-To: <20231201222532.2431484-4-Frank.Li@nxp.com> Content-Type: text/plain; charset="UTF-8"; format=flowed X-ClientProxiedBy: EXCAS081.cuchost.com (172.16.6.41) To EXMBX066.cuchost.com (172.16.6.66) X-YovoleRuleAgent: yovoleflag Content-Transfer-Encoding: quoted-printable 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, t= he > ninth Data bit from Target to Controller is an ACK by the Controller. B= y > contrast, in I3C this bit allows the Target to end a Read, and allows t= he > Controller to Abort a Read. In SDR terms, the ninth bit of Read data is > referred to as the T-Bit (for =E2=80=98Transition=E2=80=99)" > > I3C allow devices early terminate data transfer. So need "actual_len" f= ield > 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 controll= er > * @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=20 expects extra length from master? > + u16 actual_len; > union { > void *in; > const void *out;