Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1348726lqg; Sun, 3 Mar 2024 06:12:51 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX4s1osf2W4bnlPav82oLx0ah5UCEO6pdVSUz4LHT31aOSZurUywsSp6viowaL1t3qYk+nm8HZ9LefrLRqmlv1vWx9PToXTktBaDlZpTQ== X-Google-Smtp-Source: AGHT+IGj7dRchDJJdBljobVBWo0/NJ6Okv0ydejF8eKmWl8TfslO9DBEhsjOAuKp9qxYaK7kxOTz X-Received: by 2002:a05:6808:1202:b0:3c1:a315:9c74 with SMTP id a2-20020a056808120200b003c1a3159c74mr8960303oil.32.1709475171594; Sun, 03 Mar 2024 06:12:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709475171; cv=pass; d=google.com; s=arc-20160816; b=Evld+Uh3KIRqamjkrM3WDKjYwnQoV+Vjlvz81rpZTKMEm7sjjx+RCff4L+ARQiHhHX /dZ1S+y2qGSpNo/TgtWhcqboAOxE2xK1b6XFwBePMy4lbVGqQZR/lhNBW3mKuuzhI3iJ E1kpA96KQWmBDQfoGCsZFXbjOTEDOkcnMrIqsyixUYC6X6YfXypJZcR3cYarRdIqeQDj ibBsRNlcp5oDxLsdoSzcPAmffFZmiJGBPax4NORu96lRXDXF5pOFlAjARRV3XxcDqHu5 gimqK/nPj/hut5yFSmPU4usCxsyjlFV5kYe+2btU/lj8l0E1t9tCjj29XBxiiLNPH1Gx kGbA== 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=M8siEIaZm75Jg2swDVWcG18WwwEq8VcUkQ2nlocgZRw=; fh=FKjXaGCQ7ISDi3MOMP2vb4nwzB8spWr6CcqviVVCG5s=; b=ak8E0dfHshF41OYJGgIg/ZeOFXgzmcIJpvqhYBgOwON430ySPgqB54/im3om77vxYA TizfNCcwP0ilI2KPkL/p82MzkT5X9GOwDrnzAgd20LrNpr8CkJBTwe6xebxBj2S67uL+ 8grto5+NAWP/Ojv6Xf9QpaIyMKxR9/nQNVnfb1O62VeHCPiItitkpGTkAV/8eQLdP0x8 1Rd4ZQFrMnzB6wQ7DoX//lWR04eh+xVm8D4n5NM9+g93xgWbwmNVjrwNEGT2ocFAW+lA tNBsQDJhOTOG59OeGLyuBShsIJHDH63dwSKBjERp13eIS63QiC5NlF/Iwi5+Fj7maahS yJkA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aaDfvrKn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89771-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v1-20020ab05581000000b007d997fd3703si1047775uaa.95.2024.03.03.06.12.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Mar 2024 06:12:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-89771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aaDfvrKn; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-89771-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-89771-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 49FA81C20A26 for ; Sun, 3 Mar 2024 14:12:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B2AE15A10F; Sun, 3 Mar 2024 14:12:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aaDfvrKn" 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 C156D59B78; Sun, 3 Mar 2024 14:12:41 +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=1709475161; cv=none; b=FWtQleUdRWrPDcF1o76JLlxMmQfqlfCwcat5JcxqkbdIoAkCvVTygOxC2G2+iY1HqXYcyIUj+pGy9nrgBPmvZu58yPGbKxM9sZPpcewolflypUlTRAJyU1yI8gQCjd4ZngSq+yEVQE/20zsNQ/SZ034EkrXn8J3O1xA7/kAb1jA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709475161; c=relaxed/simple; bh=e7TtZTt6negFXYMOthELEKIIMFN91RWYmubklIaNQB0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=K2+zfcgOalWnUxe4JKuPS8WzmXVK8yEXgqdiCO9Yagv+G0ew+rcXAU7mVQt4IqEUl+cvm82ll9aqexeBsdI2+7m3beDpgy6TSJeMiucnt70nNj+2x2X9duoqRZ/maIcp7KfRNxl6gp82iGKhaatMt3MJecEYZU6MFdpUn5Bwtok= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aaDfvrKn; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8703CC433F1; Sun, 3 Mar 2024 14:12:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1709475161; bh=e7TtZTt6negFXYMOthELEKIIMFN91RWYmubklIaNQB0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aaDfvrKnqH4Qlfl3ZvLVT/d9em1h5PCMym8D5iLtWrFpkefEk38LMQKk1eCp1t+vY JlukEiY1xus8v39ySUXxewXidPAF7jd7ZAPwfk9VgoB12yUqxluj5zLruKEUXrP+F3 gNbEwppOpHcgdtNI1JDQlW7h7iWXIMWhGnYrrdmkHBrqkYIm3jpB6sD5FlzfjPg2Ew X1oipLSPHlGYkZB8XQYea0zgaJlTDxjDK0uKTGRdPyswLoEuahSl6EbzRhwZnQuAiM Uua/ix46UPixnDZgoqknf94AAKrHoHIO4q/EmYBrx+4pC34e4xVt97j662sgDcmGTJ TPcBbkLPPTRiA== Date: Sun, 3 Mar 2024 19:42:36 +0530 From: Vinod Koul To: Bjorn Andersson Cc: Mukesh Kumar Savaliya , konrad.dybcio@linaro.org, bjorn.andersson@linaro.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 Subject: Re: [PATCH v1] i2c: i2c-qcom-geni: Parse Error correctly in i2c GSI mode Message-ID: References: <20240301112638.990045-1-quic_msavaliy@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: On 01-03-24, 10:37, Bjorn Andersson wrote: > On Fri, Mar 01, 2024 at 04:56:38PM +0530, Mukesh Kumar Savaliya wrote: > > we are seeing protocol errors like NACK as transfer failure but > > ideally it should report exact error like NACK, BUS_PROTO or ARB_LOST. > > > > Hence we are adding such error support in GSI mode and reporting it > > accordingly by adding respective error logs. > > > > geni_i2c_gpi_xfer() needed to allocate heap based memory instead of > > stack memory to handle and store the geni_i2c_dev handle. > > > > Copy event status from GSI driver to the i2c device status and parse > > error when callback comes from gsi driver to the i2c driver. In the > > gpi.c, we need to store callback param into i2c config data structure > > so that inside the i2c driver, we can check what exactly the error is > > and parse it accordingly. > > > > 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 > > --- > > drivers/dma/qcom/gpi.c | 12 +++++++- > > drivers/i2c/busses/i2c-qcom-geni.c | 46 +++++++++++++++++++----------- > > include/linux/dma/qcom-gpi-dma.h | 4 +++ > > 3 files changed, 44 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c > > index 1c93864e0e4d..6d718916fba4 100644 > > --- a/drivers/dma/qcom/gpi.c > > +++ b/drivers/dma/qcom/gpi.c > > @@ -1076,7 +1076,17 @@ static void gpi_process_xfer_compl_event(struct gchan *gchan, > > dev_dbg(gpii->gpi_dev->dev, "Residue %d\n", result.residue); > > > > dma_cookie_complete(&vd->tx); > > - dmaengine_desc_get_callback_invoke(&vd->tx, &result); > > + if (gchan->protocol == QCOM_GPI_I2C) { > > + struct dmaengine_desc_callback cb; > > + struct gpi_i2c_config *i2c; > > + > > + dmaengine_desc_get_callback(&vd->tx, &cb); > > + i2c = cb.callback_param; > > + i2c->status = compl_event->status; > > What would the DMA maintainer say about extending struct > dmaengine_tx_result with some protocol-specific status field? That would be sane thing to do if we can get protocol status. Most of the times DMA txn would tell you success or fail, here we have firmware which tells us this and I see no reason why this can't be propagated. -- ~Vinod