Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp688843rdb; Mon, 29 Jan 2024 15:24:36 -0800 (PST) X-Google-Smtp-Source: AGHT+IEUW60/2n2eKgGAM94aIzUQuYcZvM9YxS/T/kOzkmJBdNXDW7MJm13k2o7kK8eWQ03wB0bJ X-Received: by 2002:aa7:d1c4:0:b0:55f:2ae8:7d21 with SMTP id g4-20020aa7d1c4000000b0055f2ae87d21mr1064017edp.24.1706570676570; Mon, 29 Jan 2024 15:24:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706570676; cv=pass; d=google.com; s=arc-20160816; b=Ab9LyHq7e9ULnv90AhSri/whav9jInoCO6s5cIK4/ECY7l25GwwdMSFob9JKSUYSBI 4mxFmX9L9KzOiAeqAG6J0y+uQyvgoeOP3m7/7QSxPK3rQ6SuQChX4Y2jGsWkeHiEOiIX SCICbgxt7Nk0nta7dHU4+gZhSijaj3Efj47L++/yxDyjoz3z6iWbqLnOVOCeY82pUWcD yFGVfiXq62wAqVLeJOcqkm+uCZCBHF/IaFb8xc91OsUvIAy9qoOvh7FxmGJto6OMlKCL o6oMbm2wDTXsrveZ6NMf/lUrOV+OBZv8tJZENU4PTyr7f8m4Ku1CZfKh8ERKmxP5xUPX IfNA== 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=QdmSYffY0GkUAIxZszAtkZLF8VVnpRDXPyAflZwKGXM=; fh=6sDDsbgK+sNEZxLl1hBUdjDhAAWU6wXVYKzkgT+lzlc=; b=LeLEDdNmXBQ+K2/dOA0T8ZyN7h7HaiIfjLM70njgTLN7wKFTgRL+KRrAF3j5+lan+g AsV8M5X9QdiC2Bku8wT8At3INkls9XV1lnpwt8dqzQn/veN7aBMVWlKKJYNtLLP+Pb7+ aE0Vq7mqZs8b6qbwvGKssY0J0oxQkG7N3wMS0tHH0r0htWmh7RCcoc4rNnzVyZ+d6s6c 1qvxXypeMksIG3Alxzfhtwp29Z/7DwHz/dejQopVXzdlV9cxDeT9MPtOyA6V8fFXxOZK tz3tjh6gIev/7llXjtrlO3mxP0ILyS1RZ2GPITOKMmu85vgNLNZ1nTV29VQOBueXLtfS bpDg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XFGx3Gz4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43615-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43615-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id fe12-20020a056402390c00b0055a4d0e3a77si3859382edb.266.2024.01.29.15.24.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Jan 2024 15:24:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-43615-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=@kernel.org header.s=k20201202 header.b=XFGx3Gz4; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-43615-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-43615-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 275041F23C34 for ; Mon, 29 Jan 2024 23:24:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA6DF52F93; Mon, 29 Jan 2024 23:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XFGx3Gz4" 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 0626D3DB9B; Mon, 29 Jan 2024 23:24:23 +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=1706570664; cv=none; b=qWn9pZKtu6vuibyvnkULK9aXQOQTV/Fy9hTnQynyDhuAgWZODi8pzNFVZQEzSCeMn5asJ5jcE/dRPYhwlcRVLOrMxgKIYMvtVxBDLs0FxFLqDSI7eJUPzaJccCkf4HIw1b/wQ0g7iOwoOo8TcNOYXrx4rpju60rbf3FvA+e1ncc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706570664; c=relaxed/simple; bh=mWUBJyBeMt6z7cjJB3+Z1M8avUCRugedRzkfc+fGegs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=V8g6rAy9jlcNrqA2W5LHv8DLUZl9KK6RH2vgu6js7SaEXiYEKLXqhbCMSoikdcRXC/Sm6+PNtbhByo7hDFH1AerRlOlcjMOuonW+GJBmFjbAH224DjaGQ72d4L5HaJO6abX1HlTAADbm/dvejSi6Kj/ptz9hzzkDCEradjMYC8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XFGx3Gz4; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA6A8C433C7; Mon, 29 Jan 2024 23:24:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706570663; bh=mWUBJyBeMt6z7cjJB3+Z1M8avUCRugedRzkfc+fGegs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XFGx3Gz4PCFhvob49dUcmVxul8W3WHlmW9+lobeVGy3HBZpjUfoMc1aRNp85XYBF0 1+gfotfq8dfQEgOpqgCDcRpwCrLmKaJeYOmEAeS4gXuKZIwTTOiKzjkijavns98YOu 9Fd+JXT5zY9QpqMnEw79kYZ/wnghpIxIskNh23v2ZrssT19IOgkJO67j1Rnp75GdBk eKul14sWvnKMW/Z3VvAw1m8LDtc2QfKHP6SQfzYoVKnoT2IiHH/mDaa9jYdRnG7fcx +YlqUeWInh2j8WAF51pxLyToR0mT4SxfjvW5SqPGfnQh0+HJJgtSORsY2SiCEWYb8v Hz69Tqfb3FQlA== Date: Tue, 30 Jan 2024 00:24:17 +0100 From: Andi Shyti To: Viken Dadhaniya , Bryan O'Donoghue Cc: 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, quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com Subject: Re: [V2] i2c: i2c-qcom-geni: Correct I2C TRE sequence Message-ID: References: <20240129061003.4085-1-quic_vdadhani@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: <20240129061003.4085-1-quic_vdadhani@quicinc.com> Hi Viken, as Bryan has done some comments in version 1, please, Cc him to this patch. On Mon, Jan 29, 2024 at 11:40:03AM +0530, Viken Dadhaniya wrote: > For i2c read operation, we are getting gsi mode timeout due > to malformed TRE(Transfer Ring Element). Currently we are > configuring incorrect TRE sequence in gpi driver > (drivers/dma/qcom/gpi.c) as below > > - Sets up CONFIG > - Sets up DMA tre > - Sets up GO tre > > As per HPG(Hardware programming guide), We should configure TREs in below > sequence for any i2c transfer > > - Sets up CONFIG tre > - Sets up GO tre > - Sets up DMA tre > > For only write operation or write followed by read operation, > existing software sequence is correct. > > for only read operation, TRE sequence need to be corrected. > Hence, we have changed the sequence to submit GO tre before DMA tre. > > Tested covering i2c read/write transfer on QCM6490 RB3 board. > > Signed-off-by: Viken Dadhaniya > Fixes: commit d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") The format is: Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") and goes above the SoB. > --- > v1 -> v2: > - Remove redundant check. > - update commit log. > - add fix tag. > --- > --- > drivers/i2c/busses/i2c-qcom-geni.c | 14 +++++++------- > 1 file changed, 7 insertions(+), 7 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index 0d2e7171e3a6..da94df466e83 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -613,20 +613,20 @@ static int geni_i2c_gpi_xfer(struct geni_i2c_dev *gi2c, struct i2c_msg msgs[], i > > peripheral.addr = msgs[i].addr; > > + ret = geni_i2c_gpi(gi2c, &msgs[i], &config, > + &tx_addr, &tx_buf, I2C_WRITE, gi2c->tx_c); > + if (ret) > + goto err; > + > if (msgs[i].flags & I2C_M_RD) { > ret = geni_i2c_gpi(gi2c, &msgs[i], &config, > &rx_addr, &rx_buf, I2C_READ, gi2c->rx_c); > if (ret) > goto err; > - } > - > - ret = geni_i2c_gpi(gi2c, &msgs[i], &config, > - &tx_addr, &tx_buf, I2C_WRITE, gi2c->tx_c); > - if (ret) > - goto err; > > - if (msgs[i].flags & I2C_M_RD) > dma_async_issue_pending(gi2c->rx_c); > + } > + Bryan, could you please check here? Thanks for your review! Andi