Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp78493rdb; Thu, 1 Feb 2024 02:38:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IEg3T4IYTeyEuxQXatXQpzY9FXp8jtBekHEV/WrhiQ2vABz3cy9au883bWSm2Q7YneDQMxh X-Received: by 2002:a17:90b:a02:b0:290:1bca:6a01 with SMTP id gg2-20020a17090b0a0200b002901bca6a01mr1692188pjb.6.1706783913595; Thu, 01 Feb 2024 02:38:33 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706783913; cv=pass; d=google.com; s=arc-20160816; b=qXlrY+UeNXuu1MXlBpn33ESStuWGKmz1ayTwA+lCRpqfhpJgnU1qMos4hFdfRXIuZB SoJ2pbgKboq7NKqbU7e8CwciSjjYVtaHGObnGo6YsSeEb6JGHnGHj8uLDSk2GTVJ0KJa PZKFWGuQcsbwlbGdAMiqw/OrKRhOWGeZdlwDfGFajRHtNi3/V8qgGZt6oE3U/P63iEkN mPuith2+BZHZJPo/QkXBdpOWSWnyIUrbDBViWYHiSLxTk7smHEYAyh92AbIuoHeriTdz KEAUBNePkPJGi+4iXONWOCR4pq1rK2rI+mur5RcSbaZgNyHfIEejq2x0dFYDq2cYxM0M PHsA== ARC-Message-Signature: i=2; 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=tSMRL+Wo88yleBuFktPj4UsGKmCGz8Z2pFHi1k2PXLE=; fh=TaLc94maskDWc1mwoZaZkzuldlk8wnFvV3d0JPfDWPQ=; b=Wh72vXdE46LC1iR6rg8CXtQMr+S88JCMLBkD80QUqr1ZJ/E74OIbFd4GyDagq6l62P Hdy+tBNuxM3H8BO9eBvcfyq66yVS3Ixqqfvly1wMD5+V8x+rT+louRRNub9/LXRPvFEP 7OyrmyLoMndWdCAY1QU8pGBb+kw3xKVgRYcTbIQnReMZQzSQtLpoOJDcBJhZud1zLL2x wEtT5h9X9Lgr3iPEPbDRoAT4sIU2DgPtPlTUV1fPA753m8T3BB++c9k57DQc13w7540U jMLZN19ILSyxn5jeLOwq6P/25nzO1DOVortWBf5yY76yG0+XHYfVQPy6ZfYb2XEr4AR8 EWVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="KLwlOq/g"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-47954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCUo7Mnvdy3WFs8FQvaw1zAnjQayKgOprsOjX7jUOSw4rk3BHIacFrvRJsZXT+uyGFXubHrkjHxPol+DpsUfIb9Klw71uUYKChrNQDXFuQ== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id y8-20020a17090a644800b002904ea1a4b7si3339976pjm.188.2024.02.01.02.38.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 02:38:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47954-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=@quicinc.com header.s=qcppdkim1 header.b="KLwlOq/g"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-47954-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47954-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 E8F39B23187 for ; Thu, 1 Feb 2024 10:22:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD87615B976; Thu, 1 Feb 2024 10:22:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="KLwlOq/g" Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 385A71F941; Thu, 1 Feb 2024 10:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706782928; cv=none; b=ZYCt68rdv5zGlbOhpm1Q7qrXRRgb78vPSXuaibc28ZvaHEaZzwFkdEQeYYCbh4kXdTNSus7D1P99eOiETghKdXN31QW13UVGeORsEUs+NnEgpLYiADAZN0AP/blfhpZf8uOsO3KIYFn0FLDGaVDNpfsKVDRxiyWyp2dctZhDteQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706782928; c=relaxed/simple; bh=Ma2m3h0dyRMeRB8FQVuwC9Ujq2irukJ+Xh+XndSbWE0=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=EWCn79qGw8HKvvXFP1ACbLSnzF8JBaMomE/QxWm1irCyzdEmNZjnXmA0/xREjNOGRO/E9q1+KS6EDrpW5V68Eew3DlG0GPOqY0+rMIZUMwV3UnMSXd3jqOdASdwlKnr4XxBuF+RwWoUk4bR6+0KU9da49coIsO5QzpC0Vn9WSTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=KLwlOq/g; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4119vb2u013926; Thu, 1 Feb 2024 10:22:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=tSMRL+Wo88yleBuFktPj4UsGKmCGz8Z2pFHi1k2PXLE=; b=KL wlOq/gcvXH/W6a3tPRnq9XEHEQ7mwU2e5Y7s8XrLOTDAPAcWQogU44N09Wsfed2r lg9TKuxmUtqW8czXtaBqy54g+hcywRIwq5auDjHMYrJ8C0JKqB3lNMnyi2KhAsRQ IRc+LY8HRNT8zfYTmzfQ8tn1EZDaPG0P3SF3OvXYegXyx3T2I8uxfeC6ofZbVBtl jpC7LFuVeMMn/iFnymakCDvOm4jN3Knk8ENsKyr8k+BgjT6KkPJrSplXDtdcfLVa YN/NC87mhdayYVOrwycLX/yPBRkdmtkRauyUaY4OvZ5IZxyG2v/AkkyxGSIqS4Bk Yzj001XnRBBIWTeXPMvA== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w094881sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Feb 2024 10:22:04 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 411AM3iv009393 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2024 10:22:03 GMT Received: from [10.218.25.146] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Thu, 1 Feb 2024 02:21:59 -0800 Message-ID: <7679809d-d080-4192-84db-df06a481a456@quicinc.com> Date: Thu, 1 Feb 2024 15:51:56 +0530 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: [V2] i2c: i2c-qcom-geni: Correct I2C TRE sequence Content-Language: en-US To: Andi Shyti , Dmitry Baryshkov CC: , , , , , , , , , References: <20240129061003.4085-1-quic_vdadhani@quicinc.com> From: Viken Dadhaniya In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: 05ElQmRNTV-5vO7hmDj23HYBazxEsOs4 X-Proofpoint-ORIG-GUID: 05ElQmRNTV-5vO7hmDj23HYBazxEsOs4 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-01-31_10,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 phishscore=0 bulkscore=0 impostorscore=0 clxscore=1015 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2402010083 On 1/30/2024 3:12 PM, Andi Shyti wrote: > 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. > Submitted V3 with proper commit log >>> --- >>> 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 > Submitted V3 with proper email format. >>> >>> >> >> >> -- >> With best wishes >> Dmitry