Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3850711rwb; Sun, 7 Aug 2022 08:41:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR6AdYU6TuaDJWSp6MoM/dDQeMrgnpngWHzdvarARsXzR6KDUCWKEdAla0YrR60XCBaIrvqL X-Received: by 2002:a63:6b06:0:b0:41b:79c9:7313 with SMTP id g6-20020a636b06000000b0041b79c97313mr12484411pgc.409.1659886872446; Sun, 07 Aug 2022 08:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659886872; cv=none; d=google.com; s=arc-20160816; b=gjpkkwGLpGl9n0HpJ5rMNgSsQ9v5iRBEfD9+xDNrQKHe4hZSUEpLMMnmq+0/WBu3dW 6iwTl4LwT57yWADhw4Q/Cn1roLhJ7YNLQYm7FZBojKBVau6jvvpD0d0DZ23nki2SpEl/ 8GeIFAnmh6N3kfgs24OKE7zBYIWbB2UHOVdfzLSRcXuHcZW5ZO0+Ib6AGu7y+sNpAgqF vcC1YDiPn+Sq9TUfqUFDgSqtWf3p5yD8rXcFVOH8kdIJX4ohK1K7VdVWi0jek+dz6XdN GyvzOw43gyIAgw6EA0J0/8E3L4VigiBRzi5Gw1YnILIdzoIGrgslrV5sNJyafa0fPmww 67hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=YHlXS1js2a8lbYFdeBlkI7exi/3zmStUxGjeZdRforw=; b=PuXsfT2YlP7La/JRx9vDDCvk/s3n4DcqUusDP7Um6AFxdnzFPVFOc+Bsdaamz8Tm+l u7CjAzQqwFC+fpLWzSjiz3kmkd03hCbgzrfIFOwifSn+wo+RVY3Vz9llaCo3DE8rZqsf WsaRiY+Lbn40AfXYRMXg9i4B64a/HrLSydzYnLX7aAtlnYnxrYJeF2hgSOqdzQK0MYLq YRrK2DJgVPxHZdblSN3Jjvt2049zhnhVxXza0WX0emJuC7cbCEo8LN+twF+jkYQWG/BE PcQd+mllYoUknhPc+cZV65XKtQ1okET4rtl81Kj4pdZD+l7D3lzYSTbKhiuosvSyGvEf MGGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=T52PhAI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mq4-20020a17090b380400b001f557276cecsi13881932pjb.52.2022.08.07.08.40.58; Sun, 07 Aug 2022 08:41:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=T52PhAI9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233135AbiHGPb2 (ORCPT + 99 others); Sun, 7 Aug 2022 11:31:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229531AbiHGPb1 (ORCPT ); Sun, 7 Aug 2022 11:31:27 -0400 Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF52063FA; Sun, 7 Aug 2022 08:31:22 -0700 (PDT) Date: Sun, 07 Aug 2022 15:31:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1659886279; x=1660145479; bh=YHlXS1js2a8lbYFdeBlkI7exi/3zmStUxGjeZdRforw=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=T52PhAI9tffZwaFkL5rQPfkf5ZKVzDLfVkbq2M+fh2xQLVX89r1mlhPgq9qDexrMk zyPoATlrq50HNVfQ4/sSYXpA4Sg0kq0XPpsCmSW5Poo1tSqxc1AK7Eo1Sqbotp1xH9 o0yDM7gOXq05wwTsiCztwlPifRp3v3EuFSUpTJrQ= To: Robin Reckmann , Andy Gross , Bjorn Andersson , Konrad Dybcio , Sumit Semwal , =?utf-8?Q?Christian_K=C3=B6nig?= From: Caleb Connolly Cc: Robin Reckmann , linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org Reply-To: Caleb Connolly Subject: Re: [PATCH] i2c: qcom-geni: Fix GPI DMA buffer sync-back Message-ID: <653e93e7-6bdc-3498-7719-f3a7860dd245@connolly.tech> In-Reply-To: <20220807140455.409417-1-robin.reckmann@gmail.com> References: <20220807140455.409417-1-robin.reckmann@gmail.com> Feedback-ID: 10753939:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/08/2022 15:04, Robin Reckmann wrote: > Fix i2c transfers using GPI DMA mode for all message types that do not se= t > the I2C_M_DMA_SAFE flag (e.g. SMBus "read byte"). > > In this case a bounce buffer is returned by i2c_get_dma_safe_msg_buf(), > and it has to synced back to the message after the transfer is done. > > Add missing assignment of dma buffer in geni_i2c_gpi(). > > Set xferred in i2c_put_dma_safe_msg_buf() to true in case of no error to > ensure the sync-back of this dma buffer to the message. Thanks for sending this, it fixes GPI DMA on the PocoPhone F1 and Pixel 3! > > Signed-off-by: Robin Reckmann Reviewed-by: Cale= b Connolly > --- > drivers/i2c/busses/i2c-qcom-geni.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-= qcom-geni.c > index 6ac402ea58fb..d3541e94794e 100644 > --- a/drivers/i2c/busses/i2c-qcom-geni.c > +++ b/drivers/i2c/busses/i2c-qcom-geni.c > @@ -484,12 +484,12 @@ static void geni_i2c_gpi_unmap(struct geni_i2c_dev = *gi2c, struct i2c_msg *msg, > { > =09if (tx_buf) { > =09=09dma_unmap_single(gi2c->se.dev->parent, tx_addr, msg->len, DMA_TO_= DEVICE); > -=09=09i2c_put_dma_safe_msg_buf(tx_buf, msg, false); > +=09=09i2c_put_dma_safe_msg_buf(tx_buf, msg, !gi2c->err); > =09} > > =09if (rx_buf) { > =09=09dma_unmap_single(gi2c->se.dev->parent, rx_addr, msg->len, DMA_FRO= M_DEVICE); > -=09=09i2c_put_dma_safe_msg_buf(rx_buf, msg, false); > +=09=09i2c_put_dma_safe_msg_buf(rx_buf, msg, !gi2c->err); > =09} > } > > @@ -553,6 +553,7 @@ static int geni_i2c_gpi(struct geni_i2c_dev *gi2c, st= ruct i2c_msg *msg, > =09desc->callback_param =3D gi2c; > > =09dmaengine_submit(desc); > +=09*buf =3D dma_buf; > =09*dma_addr_p =3D addr; > > =09return 0; > -- > 2.25.1 > -- Kind Regards, Caleb