Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp2344601rdd; Fri, 12 Jan 2024 06:55:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IHfbktPK/hOGQxCExRjqj++7/2CxrgGfuTYyW496z7Sk+O0bQvl4akT8XH01EOgAPVjoLYA X-Received: by 2002:a05:600c:1994:b0:40e:485c:ae84 with SMTP id t20-20020a05600c199400b0040e485cae84mr708873wmq.9.1705071302062; Fri, 12 Jan 2024 06:55:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705071302; cv=none; d=google.com; s=arc-20160816; b=MINKICGcmAgv2e85AbL2j7bgJN5C0ShHHNUlv49iWfjSDfKUuWwADcNyYjgWLkUCDG iQUrL+Sa3kjAklXSuFffPH03xLilupL0Z9umeeGcpTfBgVCKGIpfnt9FwkMu28zE0N5q gz+GI2eVEyJrXfWIJaFTXKY7PJCLqqX4Xrogl+KXNVpBfsrIwkeYhyc32aprCBXmesCK SHz+fYgmwQirqzoh6ERrqEBR9GcULoF7Q9n1FFxdXKy94W/edJAIxQsb5lPAOmuByVXA 4hCGFv9TBwoABtBEXxPbk+MGmhZl1BEtgo/kS1SCwTRCpKjruy0+nW1xg1u2OOVPB990 GL+w== 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:dkim-signature; bh=X6Qa3jrvQodva+4geqsdAx5EZoSC1Kv1GVKpRBOoHNE=; fh=sQElu2Ult+auZfDO32Zk6HfKz5TcYZMenP6FvDAqWWk=; b=epPGZljsjPcsmAPs7TsMprmZcM0Op4d3qQsbnLqhnwQL29C7iq9h92RWXltp7NSNbr SIhshwN37OyM6a9w32S4UWrlbAB5l8rbrz6H8XAdYazlR6lVJXH9FKnCP+cO3dFY8Swe zIZywA3eKlPjadMbGExzlpnXB3p6HxoziyKem4kQ+uBCj6h90ZFTO9hdy10np64zHX0H dSm/8h9B/gRL6ToJK+mW7TQnJJVg00kmDH9ECbBXNFDydlrdXtPFQg9O8Kb/qJsmu1+H npvXOTE0ZFYrH3nZWGP/WPOT5T9g+yBtv+GqqCUAE5T613jkEn1KPZ2sFlSxIh8erFMI GZLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=SisCOnh0; spf=pass (google.com: domain of linux-kernel+bounces-24773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id o24-20020a1709064f9800b00a2750b90bfcsi1457915eju.175.2024.01.12.06.55.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jan 2024 06:55:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-24773-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=@linaro.org header.s=google header.b=SisCOnh0; spf=pass (google.com: domain of linux-kernel+bounces-24773-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-24773-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 CB62E1F25EF5 for ; Fri, 12 Jan 2024 14:55:01 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 927FD6E2BA; Fri, 12 Jan 2024 14:54:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="SisCOnh0" Received: from mail-wr1-f49.google.com (mail-wr1-f49.google.com [209.85.221.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2ED6D6DCF4 for ; Fri, 12 Jan 2024 14:54:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wr1-f49.google.com with SMTP id ffacd0b85a97d-33677fb38a3so5940399f8f.0 for ; Fri, 12 Jan 2024 06:54:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705071288; x=1705676088; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=X6Qa3jrvQodva+4geqsdAx5EZoSC1Kv1GVKpRBOoHNE=; b=SisCOnh0eAXyS8EnBJAvGX+Xb9wxRV45Utw9DeFS8DtraXm520VB2NVPGNDttwyImC ptBgf73YkwVwH/ccm2FfeW0AZ93/LoT1Vj5j9AibhWVmxKdiLpyMaigi3scxI9drkWFO C7kS756OepfduW2io1/g97tP7nBVZCkszP/UlWqDSemfa4kZByUMWJY+klZeP9P0zsjS kKjzTqPL3NpZnjQtAXx0zk7eiaXfmZObcHIgblSTa3eJ6JE40OxpB8qzCFl0OxbE0ck2 8WOQOYFfE4b4rEmH7tjkKLFu43oibFPJCfuoFtTJZiATU9R7eVZKeVN1d1u9/Wl33788 34jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705071288; x=1705676088; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=X6Qa3jrvQodva+4geqsdAx5EZoSC1Kv1GVKpRBOoHNE=; b=b8xmDcikY5vtpy8e+psB1P7Eqi8rQT+94GXXDtrMfJx9D2mS7Xnnpux9Mul145iMLS 4ggu+krKNgwiBoMs5T6XJAtNBVLaEIsym0vxApW4PwLsfv7thOK6dsv0djbqeHJf0HrS oXFlEwCj1zCR6eon/ia4iT32xOB5Ucpxy0owBnNTrtgZyP86AC0j+LPMbfbiwFefUGwW aZGUakJ0dwdVtMDDDlrn2nNCrCWS98g1j2BabSC62PSGkxVPmixzqzp/9Iki/9GB1CO3 +CAeG5WjNtP1XHbcGGiIEoh/r2cCieVCUwMleRUOUzD9JU9SCqhCgXz4w89foQQg55xy btmw== X-Gm-Message-State: AOJu0YxpXoSKeQgi0azuQ1hf8vwanP0cuoHKKNeePbSue1LIVhNewNcE 91rJfdFx6aXWygRONIvsCtEmajtgAu9q+A== X-Received: by 2002:adf:dd85:0:b0:336:e369:cef with SMTP id x5-20020adfdd85000000b00336e3690cefmr767777wrl.130.1705071288407; Fri, 12 Jan 2024 06:54:48 -0800 (PST) Received: from [192.168.100.86] ([37.228.218.3]) by smtp.gmail.com with ESMTPSA id d29-20020adfa35d000000b003375009accesm4082058wrb.50.2024.01.12.06.54.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Jan 2024 06:54:48 -0800 (PST) Message-ID: Date: Fri, 12 Jan 2024 14:54:47 +0000 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: [PATCH 1/1] i2c: i2c-qcom-geni: Correct I2C TRE sequence Content-Language: en-US To: Viken Dadhaniya , andersson@kernel.org, konrad.dybcio@linaro.org, andi.shyti@kernel.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, vkoul@kernel.org Cc: quic_msavaliy@quicinc.com, quic_vtanuku@quicinc.com References: <20240112135332.24957-1-quic_vdadhani@quicinc.com> From: Bryan O'Donoghue In-Reply-To: <20240112135332.24957-1-quic_vdadhani@quicinc.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/01/2024 13:53, Viken Dadhaniya wrote: > For i2c read operation, we are getting gsi mode timeout due > to malformed TRE(Transfer Ring Element). currently for read opreration, > we are configuring incorrect TRE sequence(config->dma->go). > > So correct TRE sequence(config->go->dma) to resolve timeout > issue for read operation. I don't think this commit log really captures what the code does. - Sets up optional RX DMA - Sets up TX DMA - Issues optional RX dma_async_issue_pending - Issues TX dma_async_issue_pending What your change does is sets up the TX DMA first - Sets up TX DMA - Sets up optional RX DMA - Issues optional RX dma_async_issue_pending - Issues TX dma_async_issue_pending but you've not really root-caused by re-ordering the calls fixes anything for you. This may be the right fix but I don't really think you've captured here in the commit log _why_ its the right fix if indeed it is correct. > Signed-off-by: Viken Dadhaniya You should have a Fixes: tag > --- > drivers/i2c/busses/i2c-qcom-geni.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c > index 0d2e7171e3a6..5904fc8bba71 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -613,6 +613,11 @@ 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); > @@ -620,11 +625,6 @@ static int geni_i2c_gpi_xfer(struct geni_i2c_dev *gi2c, struct i2c_msg msgs[], i > 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); If TX gets moved up top then the second check for if (msgs[i].flags & I2C_M_RD) is redundant. You could just have 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; dma_async_issue_pending(gi2c->rx_c); } - Please investigate further. Why/how does the new sequence TX DMA setup RX DMA setup RX DMA sync TX DMA sync Improve the situation over the existing and more logical RX DMA setup TX DMA setup RX DMA sync TX DMA sync - Add a Fixes tag if you work that out so we know which kernel version to back port to - Include the SoC version(s) you have tested on in the commit or cover letter - And drop the redundant check --- bod