Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp73760rdb; Thu, 1 Feb 2024 02:27:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJ6pgPj1dXWXEUilQhF31MbWwkCeF+AdP8xEIqeghPpG/PRoaZy2N4/KPGypwot1r718HS X-Received: by 2002:a17:906:ad92:b0:a35:69c3:8af5 with SMTP id la18-20020a170906ad9200b00a3569c38af5mr1348648ejb.36.1706783227749; Thu, 01 Feb 2024 02:27:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706783227; cv=pass; d=google.com; s=arc-20160816; b=uE1mLezqSmLemKN7WBPL906dTBpsZEfNU6L0A3TRtH7rVOipD+07MdiWHfYFR9YjPz 5CV7EbVdLc/pCsBz4GbrMT3N3TzC6vVMCL2GU1eis8NnRyDUiuz1Zmsva35IW+hOsRZR OQRJwK4oK8aGgcr79yiQr0W17tRLdg5RL2Edf+rSGGQgqyMIDN5euJLgZNqQb3TgJnhh eOwVx2kKSD/VNOxmfONT58Jb/uH5SYifBhA5nEvIa1n0yelZkD0uIWxk9TS0UICDXQWL WV51PVF2mvu/x8NGYSbE7bwDokKIuC95nXwxystlzHAanonBNFGlWl5ueLF0SYu6tZ/H Vrzg== 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=AfWuN6LbuvcvxBSPjYrEHyzxmGBZs4Ru/UowddQIa/I=; fh=NGSAqb/mat0drROB/ucjx7e6f+3w1nKsk/+i7R0/YBg=; b=kRTMCKOuaashuLfx7TTjcTC+8Husl/XgOwqCOUj9GuUL6/XNAzcEyP2/ifrYY4fB0V a7O5VHhQgfO1aqiozS8r/KJtYv5be3y4vOxXG8ITfEmTtN5UR/bCMBDfvQd9MWz8hwvI 3aw006TGs1vJfGiikwG8yGyehukSDBVW9daMv9VHIS1pJffFfHjsxnXzgH6UK2qtNUZ/ lEBqYTK3LvNz6KkW8Q/4hHoFNU7Npavp8SK5ICmXv0ItLLA9LKf+kdpwZhS/cE9QO3/F hGSJkaqf7IcPVN0SwH5d/5UWcFukqSQ9IEe3CXtUhEvUvr/EVbSkUA9ssPC1X4VJQtEb URgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=oy5MO2uP; 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-47948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47948-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; AJvYcCW0wcBvCblPLNwlmoAuPb3S5CzdtQ9lVOfnFDyHMCfOHB8dzy6f0/mY1rmAVmPCWFdj26fTm7xhr6WAQjOABFUsGPh6VWV7UGYqThHiTA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id j17-20020a170906279100b00a36715df0f8si1654423ejc.112.2024.02.01.02.27.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 02:27:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-47948-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=@quicinc.com header.s=qcppdkim1 header.b=oy5MO2uP; 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-47948-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-47948-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6E0D21F2C0A5 for ; Thu, 1 Feb 2024 10:17:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D936B15B966; Thu, 1 Feb 2024 10:17:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="oy5MO2uP" 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 7C3D115B102; Thu, 1 Feb 2024 10:17:40 +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=1706782662; cv=none; b=nBKjxzEekcVcb1jRnRKNTlLVV65ieVv0LEQ+wY/ncXuwWW/JKoe7m6uFypTQzRm//Gu9eE3oePaVLOJ2ThxInBSzjAb9PqwdvpS2PYdEgyIMf3QKeJikaZFWSWI1hC6T2HFub4q1jhYxTX99Ih23EwBBhPWvXvugUAa9gVb3mDE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706782662; c=relaxed/simple; bh=e90Rv4w1hU2IykaN/Qvvk//SylNjfXirH78B0STgVfo=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=HGzbbvtl2WXzntERs4sf2oj4q0QyRVHsl7r7x9aCuULgZcDvludcjg42jnm6anZpYnqqIiJWk4eNbi8XhcoTJlhWrqLG+lAaNEKgvkcgK7yRcz5H4k8DPtIobWwZzBUKW1LMjFMByC8g1yn7wetnuzVJq8XylAaXZotQrHfgd/U= 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=oy5MO2uP; 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 (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 411A6ABJ023316; Thu, 1 Feb 2024 10:17:37 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=AfWuN6LbuvcvxBSPjYrEHyzxmGBZs4Ru/UowddQIa/I=; b=oy 5MO2uPH1iOGDMn1K3AYBte2R2rk5ue8ufwysMeg8lbtByd+K7bgYIaVC3vOPaFVq SVWB1vh+tTL5P0aZdipalfO93ohBmZ9YE1MOPjscyV6WgwFBnLGIbI2sOmNYOl7i RopZKjmOIxUxFn92IvNrQUW4Mirrdy0CqUX0YgPHao1ru063WRAKg17jaaPLS26N Lc2BslgE/4J9l4WhFLhmKF1omw373row0Bihot+NL+BXHKjPHRVywKG4xaAYQPDX oofcs+LJtbVqUmc1rqdjXGO6HRRifRmlQ5MvJht3Rg8nn+bw+uEkntLDABzIzOi/ m/RLlSSHyLa/yU/mMYWw== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w098c00ud-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Feb 2024 10:17:36 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 411AHaxr022716 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Feb 2024 10:17:36 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:17:32 -0800 Message-ID: <3a3a5ef2-c5c5-4c19-8760-6805d571658e@quicinc.com> Date: Thu, 1 Feb 2024 15:47:15 +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 , Bryan O'Donoghue 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: nasanex01a.na.qualcomm.com (10.52.223.231) 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-ORIG-GUID: GC_OZ6MCaLT0ZsA1jftpdRcrMfW03cg8 X-Proofpoint-GUID: GC_OZ6MCaLT0ZsA1jftpdRcrMfW03cg8 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 spamscore=0 bulkscore=0 phishscore=0 clxscore=1015 suspectscore=0 impostorscore=0 priorityscore=1501 mlxscore=0 adultscore=0 malwarescore=0 mlxlogscore=999 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401190000 definitions=main-2402010081 On 1/30/2024 4:54 AM, Andi Shyti wrote: > 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. > Submitted V3 with correct fix tag. >> --- >> 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