Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp162286rdb; Thu, 8 Feb 2024 02:08:23 -0800 (PST) X-Google-Smtp-Source: AGHT+IE1DzcgIfb58sPwF5dqpsmW5S7k77NJh0N4mG7/Fw5jC2+pGK071a3EhVS9H72cbyjTt4N9 X-Received: by 2002:a17:906:3107:b0:a38:4879:72f9 with SMTP id 7-20020a170906310700b00a38487972f9mr4926594ejx.24.1707386903011; Thu, 08 Feb 2024 02:08:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707386902; cv=pass; d=google.com; s=arc-20160816; b=H/N510p0Z0Ha1H/9SdChj8Uj57n9ITwVa4KeSFeYGav5XOAo9+uX91fuz0bnmcXOHj C5pH1HzArWxPxu9nqDUTWr8U7m9yG1B9EvyZUeT7isUargcE6LGxyETzrcI5PX/QtXEK 3dJPSfdWjorAASecBuK9QhzuIPejykD9GCeyveev9hN6YucYuib1xp/1aDP1KvbsRLWa D/3eyVKTvAxXfx22tS3rfriJQPrCjOaucG3MXme6M2QDMK6hKU4tjr2z8kVOD32GwSw7 DAE3nuCh1tsdZIEhONnPy7FQCKatuUhAsmVr1iZLWvdm5pypPASOgnRm1C0UVLc/Dnlc mVOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=9LO7dt0/l6s+DdFbaYZMo1+8hhbQkv88sViq+NKlRsg=; fh=ecovTKoi5o1CLxPJBkMfp0F0KDDWKvBoEa7Aup/5UhM=; b=ylJHW9FR14FjnvDQ8chndmoV631P89qDTQIWG3egUtkeijfDfGsdn7Kn0EbzzlheS6 S2vP/7LCQBu6wjcgBIDNaOwFJVmMR9Z6s6RpLba0F67+WMFhu12dGMO659y1KBkeqgSG urVX5iny8ep/0eGCX5pY9CAVY4O/BWc8qXFOtaQQkrJYm3EXKnsuXVS9vGKy4f3UJmn1 8lW0f2uckuCJHhg/q4ISm68XEeYmf+2VcLlh40qIlT7SmhKQtONan0o4R9PaWy8wyiJW NuoTm4wkP3Q5P+aEB/iGpYm41UV8LdKz0Ju+fh6FUYSU4miZBZVo7F8Uyn+CTytoSABG urWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VHeqwAoN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org X-Forwarded-Encrypted: i=2; AJvYcCVQCVWDVKrGfoBmZHWFVq3CydjqHcBw2W45RYbnUw3X4CkYW7EEjisBgF4PY3otEf32OvlqkBCMqQpvvhtMibq2KCU5knP+aCusJeuoKA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id pw19-20020a17090720b300b00a385ff2d957si2054220ejb.912.2024.02.08.02.08.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 02:08:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-57820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=VHeqwAoN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-57820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-57820-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8E0451F21B89 for ; Thu, 8 Feb 2024 10:08:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5434773164; Thu, 8 Feb 2024 10:02:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="VHeqwAoN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 641A16F52C; Thu, 8 Feb 2024 10:02:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707386557; cv=none; b=FgJey1UN89d3gyjIm0Pyi7TlRXn9l1XxTlLRr217alcWJ45RRfMN93ciGDTWw5fxHpQ89F+udupN1MI8uzKucS6joj9Dcc2TJxhlWk5oG2Sy1oBmnNKdtdmdhp1gQI3+MEOsgoIyN7cMqzEv8J3VCTiZBBz2UO+3IwMk9TakBTE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707386557; c=relaxed/simple; bh=D96AYJ0yVRf7SBQeHRHG9hGhNFiOxzG3tk5OOOiG5iI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=VedGqiWrmlcm9NINqTNv0Vk2FlLSQZjDbEkyVdqyXMe/ScF1zq+KgDSurKQSIUjrUodU8EQy/zskx6a5G2dtUUwVO8vq2MdkoUsf8Ma2dLxfEXQ8nfwa+RVklqPuxHQyVjpIWItHdhgpEEKOKUDYwkV1jlZ6GjOT/hx+Z/+u+Uc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=VHeqwAoN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33ADDC433F1; Thu, 8 Feb 2024 10:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1707386556; bh=D96AYJ0yVRf7SBQeHRHG9hGhNFiOxzG3tk5OOOiG5iI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=VHeqwAoNV7C/gX+AnZEx/HQqAh/y+NET+LhOfaOfSSEWMQXVj5Y6SpJgGXjQMUeZt gFTzmmmCA5hHb/LpelrqtBl0QK1JNu/9LkP//tgwsIdySN50IBdCQW42kgDGVkwY/R AcER4mY5OQ2OHqOW1E0U+Tdo+a1Ka3IJ627Xx1TQPQKpyAS5p/ClTaWnPqGHTaR3FK w0WJ0BLvHNgNhDT/A97tMRR5d6a7/m8Dz4Nxeg2b2akfBzXYXVO9Zr4YLw3dUx4gI1 k56zrnrNv8MrjhoVUTEGsV4/XrV964hS28JhP2onb8qzNxwd4UskxtVnNaTtiXajs2 d/NVwAAkPydpQ== Date: Thu, 8 Feb 2024 11:02:33 +0100 From: Andi Shyti To: Viken Dadhaniya Cc: Dmitry Baryshkov , andersson@kernel.org, konrad.dybcio@linaro.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, vkoul@kernel.org, quic_bjorande@quicinc.com, manivannan.sadhasivam@linaro.org, bryan.odonoghue@linaro.org, quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com Subject: Re: [V3] i2c: i2c-qcom-geni: Correct I2C TRE sequence Message-ID: References: <20240201101323.13676-1-quic_vdadhani@quicinc.com> <60b5e755-352b-476d-8c6e-2170594ae80d@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <60b5e755-352b-476d-8c6e-2170594ae80d@quicinc.com> Hi Viken, Dmitry, On Fri, Feb 02, 2024 at 04:13:06PM +0530, Viken Dadhaniya wrote: > > On 2/1/2024 5:24 PM, Dmitry Baryshkov wrote: > > On Thu, 1 Feb 2024 at 12:13, Viken Dadhaniya wrote: > > > > > > For i2c read operation in GSI mode, we are getting timeout > > > due to malformed TRE basically incorrect TRE sequence > > > in gpi(drivers/dma/qcom/gpi.c) driver. > > > > > > TRE stands for Transfer Ring Element - which is basically an element with > > > size of 4 words. It contains all information like slave address, > > > clk divider, dma address value data size etc). > > > > > > Mainly we have 3 TREs(Config, GO and DMA tre). > > > - CONFIG TRE : consists of internal register configuration which is > > > required before start of the transfer. > > > - DMA TRE : contains DDR/Memory address, called as DMA descriptor. > > > - GO TRE : contains Transfer directions, slave ID, Delay flags, Length > > > of the transfer. > > > > > > Driver calls GPI driver API to config each TRE depending on the protocol. > > > If we see GPI driver, for RX operation we are configuring DMA tre and > > > for TX operation we are configuring GO tre. > > > > > > For read operation tre sequence will be as below which is not aligned > > > to hardware programming guide. > > > > > > - CONFIG tre > > > - DMA tre > > > - GO tre > > > > > > As per Qualcomm's internal Hardware Programming Guide, we should configure > > > TREs in below sequence for any RX only transfer. > > > > > > - CONFIG tre > > > - GO tre > > > - DMA tre > > > > > > In summary, for RX only transfers, we are reordering DMA and GO TREs. > > > Tested covering i2c read/write transfer on QCM6490 RB3 board. > > > > This hasn't improved. You must describe what is the connection between > > TRE types and the geni_i2c_gpi calls. > > It is not obvious until somebody looks into the GPI DMA driver. > > > > Another point, for some reason you are still using just the patch > > version in email subject. Please fix your setup so that the email > > subject also includes the `[PATCH` part in the subject, which is there > > by default. > > Hint: git format-patch -1 -v4 will do that for you without a need to > > correct anything afterwards. > > > > At high level, let me explain the I2C to GPI driver flow in general. > > I2C driver calls GPI driver exposed functions which will prepare all the > TREs as per programming guide and > queues to the GPI DMA engine for execution. Upon completion of the Transfer, > GPI DMA engine will generate an > interrupt which will be handled inside the GPIO driver. Then GPI driver will > call DMA framework registered callback by i2c. > Upon receiving this callback, i2c driver marks the transfer completion. Any news about this? Dmitry do you still have concerns? We can add this last description in the commit log, as well, if needed. Andi