Received: by 2002:ab2:3319:0:b0:1ef:7a0f:c32d with SMTP id i25csp161602lqc; Thu, 7 Mar 2024 13:25:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUN54vEPig6M+bHDndUk9m61GTmxgC36QKEtSgADfZotldC30a+46DwFQ4i598ooZb4ZSarvncqc6NtbAXfMZji7kPMeBbY7hsjeubcyw== X-Google-Smtp-Source: AGHT+IH3rhkKrk2rVVoAlKZRbS/n05kle/z4ZGhaf2AwGaYcBu9KcLekeVm543hal7CHarZkyUCr X-Received: by 2002:a05:6870:ff89:b0:220:941d:18b7 with SMTP id qp9-20020a056870ff8900b00220941d18b7mr1191853oab.59.1709846720466; Thu, 07 Mar 2024 13:25:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709846720; cv=pass; d=google.com; s=arc-20160816; b=V1fRQzhaiJqB06PkhMPBkhaDzbtJhFuPJJwRHQGmDx92k+oboJstqW40GkOhwYfVbm 88xm8zGsdjZBqiUm2nvR3GqBrg11lIXWDDnn2ko3SORB+UCsqpDSR8FNH/I0PFo8rqMd IVakF6wfV11X7US0IBHXHFGj8UC8cUYMn8zEoFAsagNRyf10qY6rzp4FfwoU3Q9anXre zpNhEmOryuc08/HVv+iJcZFzwkmbxMCF0gdfy82pTyrYus4ToX6LtRmjhCtdAv0pMEoz 6fB/eJ3okXKwkdJ0wO3+bPMcOSc+KczmYU8TNdg+ZRfmAm0tUJBGm8bqRpTYBmWWdckw 0TKQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=b9hhcys1gNGaG07NYC+PK2//TEd+2vYvb6mO1ZLDuZE=; fh=mLcAjTL4NEzqbS2cCm1fRUG3tHzuNfg2MsXJk122O2Y=; b=JW3vq2ubJiciL/UAQXT7oertgEopGYKKjbcSdGwHxkf+ImQEBdPOijGFu27SlGOQFe /tPC/EOQHdNr/fI+AHj702Y9NknMY43IAR0b0AxZgfeDpOlM2sMKfrQED5d1MtML9jN6 0STiAEWjDSrDNyGAPWL+nrrWXBHp1WvtDnvNHeJgoTN3AkPC3qNGHT9xRh4QoGJIDVPC CNfGYbK8IsvOAvariNPQGpPlj3mVzV8CL18b6x5H/ou5+YnSwHpEuTSTcmZ5sdU6rQZq 6V9sDoEqc1Z4D/hGUjIhnD/TfdDSKj4ulMoS2V7W0HnM+PhZ4OiV3qbejth1TD6h9/Ze bS3g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t9IcGzz0; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-96248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96248-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id j9-20020a37c249000000b0078821c63535si11298620qkm.628.2024.03.07.13.25.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Mar 2024 13:25:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-96248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t9IcGzz0; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-96248-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-96248-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 330A41C20C1D for ; Thu, 7 Mar 2024 21:25:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5D3B413B7A4; Thu, 7 Mar 2024 21:25:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="t9IcGzz0" Received: from mail-yw1-f176.google.com (mail-yw1-f176.google.com [209.85.128.176]) (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 0F8BE13AA52 for ; Thu, 7 Mar 2024 21:25:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709846712; cv=none; b=GG9IvPFEQVgFfhxZEjuG36C6FeKPclG11FPdoWOSz9B+ukGo+uF6f39trUJiTnQsk5y+cQ+oaiIf/hL2ZjrIyvqGogDHcB+aU/5YKDtnZj84D71XeqzHSj7FAWouyolxMEXSZMeAm3VSw4HMjs+3OeTyev/NPnoa5wR6pr+nLw8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709846712; c=relaxed/simple; bh=fmMP5iKplWZjMSpRw/sZdefxBphDjLLMtsB0POMq9wQ=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=JrZ/mvm/qhE0/H9957ziAKmDfExcIJWFnpTCEVtrxjBhqmlwJzAKDPQ1pHkzV6jVHcO7GEi06Y5WmaXwAUGaOh8qCsY9EmEF3hNBDTEW1QA7U+QFlja2LwCAkpIQQROQJEKdzjUytLV8lwCBzZsR8ozngxqJFYWsrHWrJAUFZ8Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=t9IcGzz0; arc=none smtp.client-ip=209.85.128.176 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-yw1-f176.google.com with SMTP id 00721157ae682-60974cb1cd7so13886797b3.3 for ; Thu, 07 Mar 2024 13:25:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1709846710; x=1710451510; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=b9hhcys1gNGaG07NYC+PK2//TEd+2vYvb6mO1ZLDuZE=; b=t9IcGzz0Nq1flpUvdkBGP5Euh/4CAnc5TKttnLkWvkLIn0vK0i9rW27uOo9+SmUQlJ VCzJHkZTAKx47kejlueRP2QE+k5AjymQSVlYHD5qsHOxCA746r7Ga3CVzbtCpph85uJE 9tDorYeSJPafo9f83e2tH7IoPOd+l2oUH+7b5df3G0ffh5nfJKAxMymyYAF6v8DeZGuk 2esjb8Go/cTbBn/WpbydR5opCavOrbjnogHsfebj6kS+dF8ROF10DJ7myT/2kYp005Ul ZtpZeDSeV3kScmmS4pmy7emHfBqUF45MQ5QP9pPLuCeivqvJAdzhW94033h4yUUaIyWt axwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709846710; x=1710451510; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=b9hhcys1gNGaG07NYC+PK2//TEd+2vYvb6mO1ZLDuZE=; b=LjTQONxA2LhkMhkDpqDrbB+LF3GxlV86hLSTL3PlhD9uyIlfaBgoVlN77aw5ULS4dL fr47Q5/HwQrJfhZy9uBWgb25cN8JeVp0o8um486X0Ic5k9r8c32CprEUwJEp2DgJFleQ 7xxO75mUGLov5Y855Xe7L69tZVKCpjLhhTIEUDTMWrRGjqdNpGafO+jgQ1JMDs/k37o8 Urx8kX12gdO38OUUwiLHQ9rmLPlykc+Iefwz4mXf1G8s6FwzboUaQQkzP+sh/GKYAmVk 2x+JwT3jbthEAYLWWvP191fN1mx9e1laAf5rkluyReYiQKPQDedVyAroUIvIrBSgwqBf hBqg== X-Forwarded-Encrypted: i=1; AJvYcCWBF7ylunMA72hWFQ1LCD6iLRzdjEZcdyli4N9u8+5mBs8eUXng0qbryolo4s0IL22I9Nlyhj2EUJPEOjRilPrrpzvc52FqTWH48LE+ X-Gm-Message-State: AOJu0YwSi+iDNeIgCkURZ8HYZG6OpOV3xjtk2Nhsrs4sG+NaHCk0JaGk H8DSGIZKKJjakomSowWBvSGdEj7pHFmPlD7FgPDMRnOcrhTnOnJNt2cboa/iq2LvU8TZmxVftm/ +GC7gHkmO1ry7Olw0x3Oy4tyEOg8A5pQvwhQetw== X-Received: by 2002:a05:690c:fc6:b0:609:2fad:a9d6 with SMTP id dg6-20020a05690c0fc600b006092fada9d6mr25256866ywb.7.1709846710102; Thu, 07 Mar 2024 13:25:10 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240307205539.217204-1-quic_msavaliy@quicinc.com> In-Reply-To: <20240307205539.217204-1-quic_msavaliy@quicinc.com> From: Dmitry Baryshkov Date: Thu, 7 Mar 2024 23:24:58 +0200 Message-ID: Subject: Re: [PATCH v3] i2c: i2c-qcom-geni: Parse Error correctly in i2c GSI mode To: Mukesh Kumar Savaliya Cc: konrad.dybcio@linaro.org, andersson@kernel.org, vkoul@kernel.org, andi.shyti@kernel.org, wsa@kernel.org, linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, quic_vdadhani@quicinc.com Content-Type: text/plain; charset="UTF-8" On Thu, 7 Mar 2024 at 22:56, Mukesh Kumar Savaliya wrote: > > I2C driver currently reports "DMA txn failed" error even though it's > NACK OR BUS_PROTO OR ARB_LOST. Detect NACK error when no device ACKs > on the bus instead of generic transfer failure which doesn't give any > specific clue. > > Make Changes inside i2c driver callback handler function > i2c_gpi_cb_result() to parse these errors and make sure GSI driver > stores the error status during error interrupt. > > Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA") > Co-developed-by: Viken Dadhaniya > Signed-off-by: Viken Dadhaniya > Signed-off-by: Mukesh Kumar Savaliya > --- > v2 -> v3: > - Modifed commit log reflecting an imperative mood. > > v1 -> v2: > - Commit log changed we->We. > - Explained the problem that we are not detecing NACK error. > - Removed Heap based memory allocation and hence memory leakage issue. > - Used FIELD_GET and removed shiting and masking every time as suggested by Bjorn. > - Changed commit log to reflect the code changes done. > - Removed adding anything into struct gpi_i2c_config and created new structure > for error status as suggested by Bjorn. > --- > > drivers/dma/qcom/gpi.c | 12 +++++++++++- > drivers/i2c/busses/i2c-qcom-geni.c | 19 +++++++++++++++---- > include/linux/dma/qcom-gpi-dma.h | 10 ++++++++++ > 3 files changed, 36 insertions(+), 5 deletions(-) Reviewed-by: Dmitry Baryshkov -- With best wishes Dmitry