Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp908370rdb; Tue, 30 Jan 2024 02:09:46 -0800 (PST) X-Google-Smtp-Source: AGHT+IHc3qbBZiBWUMBqexBNidpsCFokSUzpN1VGj7Wsb6cD6XKgY09hQ4WJTcJCKTvwVBV0r69Z X-Received: by 2002:a05:6a00:a0a:b0:6dd:893a:f6c with SMTP id p10-20020a056a000a0a00b006dd893a0f6cmr1352434pfh.22.1706609385665; Tue, 30 Jan 2024 02:09:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706609385; cv=pass; d=google.com; s=arc-20160816; b=kO694JCSgdH6ZfzuFcHkY8NOif0M+IdtwrJEHMsTLE8c05foTaV1uU0GVYxOYRhmrL 6lGwxh9MEBot99rVQqc2f+vXEt+6RsNyrynXSKNFv64pUBgDxH7zodNYCMtQCU1gxcZW U3RJANVmDWtxcAvXpfAz9fTawjytQGxdhsFygKDZwo5yFG0srycWEzhB8QltZnuC9Pxa JMOtwf7PJOGMZFtIQjWpwXnCNO7wWiWWeaQKHhUVFohKitheUAC/3EfhUb5hdWWHMmz8 uQ5oHahUTjSRTLcEUeojzJ/+0t2aVYaqVIWpL+xXf+zHsWsfQHjkhzOVkLSa+P4k60YA dqzQ== 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=lzbNin3UlmTZ87u99hJmpNL4E4Lhs3y7AFdkwO0U3ck=; fh=pOTzEEZUNmNFkzzcPO1ZfK8tutpgBQgQMlnbJUKsrSY=; b=raVBHAuRb6mYsiKoM0L7k/6Lo6/EI9EFC+8DABcSi/HqfWxuldfYIkqMX8RWqEdtfo lgszcBb6P2jZHQ8O2s22soEh73Uzi2Q4tIvMbMpo1967AJBbWU98eaSE2/hBAR8ZgNPj Go09D/MPtw5UsZEx4V33glgzSQpSWB6Fy/nOJKgTjHA0ovCv9LFmlIxq4Z1hZDO08FpC 68L2RbNSFSOmvJAeDUAXH8gbAhh72a5Z5nb1JTOyD1KqNNJwlGZny6+0XLaqNxZbjx99 IsrSoHNFj/MR3uuF1ayBZL3W9Pf48m2qgwdqICrIcESoI2hX+NA0KYfYrU1N2+QxEzig 2QQw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TvvvnK8M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44286-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44286-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id x27-20020a63b21b000000b005d8b547307bsi5637693pge.575.2024.01.30.02.09.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 02:09:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44286-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=TvvvnK8M; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-44286-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44286-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 64CACB2BC0C for ; Tue, 30 Jan 2024 09:43:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3333B60B8F; Tue, 30 Jan 2024 09:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TvvvnK8M" 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 4968660884; Tue, 30 Jan 2024 09:43:03 +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=1706607784; cv=none; b=tV0ZF4bayWCHsFr8dWJDXglGL82yqVpAVMMw+/+/5gwVmdE7DxtCaGlq8VwaCpbrQuJzwNldFMQ0gnBhCbacbS5E7dtmf5BcnL1BFokBeAb0HgntGg1HNV+5QLram+H2THKEPl1hFrAorj6Nu6xXqouX1jaHinCnMJB11zeX2Gg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706607784; c=relaxed/simple; bh=ldrlgKcrWSPBN/HSbuJTM+glXjW0wkDulQn6qoVjgNQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=l8jBNpbEF1bmQzzVFxItfTPXz9CpzbtYtILh5rPl6rC8YfkaXEyfzCmj4DDgED51jqB82hbsogJf+yk+GFOq73AUg5rpqmx5JSN5apQdub3a8hBmaRXaDDB38eEPGATbag/wpW/zDyQnSzSRhn7zPGFD6duA2CvdwkLeuyP2ohw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TvvvnK8M; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0FD4C433F1; Tue, 30 Jan 2024 09:43:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1706607783; bh=ldrlgKcrWSPBN/HSbuJTM+glXjW0wkDulQn6qoVjgNQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=TvvvnK8M//BQMdjyfgNqe0NVXQyupwifsm7Gw4xTWob7fSp3IRxVz0aBGvzazjMtY 0JVeNxfwhRcomwW/zCTgB1vThCBPzePW/pSpo7P2cBvQ7BkJ1B0KHJnkbXjSqfcXE0 5Y8a5tQ9mRTSKXvcw9gRtFmSR3GJ4uGdsGLSodNDG9Asyi4R49qKJUP4gXeebAl/NP /SueJccH0u82j0fPsq9baa7XkdOyHtPJRxLGt+LCNKwu0v6tyulpwvnb1yfjFCMSP9 v4jyAjcZXnYB/eI+6RzkbRXyUOZEqDxy/thGd69zsI4Ie+4dyND1Bte9R8ymdPIVMH lnBt+sH4XNRXg== Date: Tue, 30 Jan 2024 10:42:57 +0100 From: Andi Shyti To: Dmitry Baryshkov Cc: Viken Dadhaniya , 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: Hi Dmitry, thanks a lot for your review! On Tue, Jan 30, 2024 at 01:49:57AM +0200, Dmitry Baryshkov wrote: > On Mon, 29 Jan 2024 at 08:10, 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 > > It is not clear how this is relevant and/or affected by swapping > I2C_WRITE and I2C_READ gpi calls. > > > > > 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. > > Please read Documentation/process/submitting-patches.rst, understand > it and write a proper commit message. > > > > > Signed-off-by: Viken Dadhaniya > > Fixes: commit d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") > > As it was pointed out, this line shows ignorance of the mentioned file > and of the existing community practices. If the issue is only in the commit message Viken can propose a proper commit message as reply to this e-mail and I can fix it before merging the change. Important is that no issue is seen in the code. Please, Viken, can you either send a v3 with a proper commit message or write it in the reply to this e-mail with the changes that Dmitry suggested. > > --- > > 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); > > + } > > + > > dma_async_issue_pending(gi2c->tx_c); > > > > timeout = wait_for_completion_timeout(&gi2c->done, XFER_TIMEOUT); > > -- > > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member > > of Code Aurora Forum, hosted by The Linux Foundation If you are going to submit again, please make also sure that the e-mail is formatted properly. I'm not sure that this footer will be accepted by git. Thanks, Andi > > > > > > > -- > With best wishes > Dmitry