From patchwork Fri Sep 11 15:01:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Schiffer X-Patchwork-Id: 11770789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41DB692C for ; Fri, 11 Sep 2020 15:03:38 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F383C223EA for ; Fri, 11 Sep 2020 15:03:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mf7/y7a9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=tq-group.com header.i=@tq-group.com header.b="S7RNZ5vC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F383C223EA Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ew.tq-group.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Owner; bh=effbMZhVlwPvrzo93FB9HFe7cB/gXC47MnMuKzIASk4=; b=mf7/y7a9DEF6tBM/kS4IsziVHO LeK2jjk6OsbhougR9WAxZ3s9+vzcxe09rG4fp7BXipHOijTJcjbliMJbKGh+Oz3Csuqy673C52A2w 62ulKlSucLcN1g6mMlv/XpSLf8y5m6B9f5XwrKGuy9bpvzsE9oweX/r8JHc3j7xUTFX5Vy77+M2Gp eQPvKZ6WRTHOw2Gb57Q7y+C/VddSzFUIDznVfZYXzFtvOpLFbTpf9S64JcRcdvNcVnsLmJjRQxXjX kIsq00VCBSpi+ZLHGN+mo/cuNwFEv2K89dd/MV9KPEjFjMB2YcdL52vxMrTd8fLfxo+fNVvMe++6H C81tfJTA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGkYm-0000W6-41; Fri, 11 Sep 2020 15:01:56 +0000 Received: from mx1.tq-group.com ([62.157.118.193]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGkYi-0000Um-AJ for linux-arm-kernel@lists.infradead.org; Fri, 11 Sep 2020 15:01:53 +0000 IronPort-SDR: xAo6en6rEUfu6F1AMIgNOA39SC5hKt1QbgHPE1wbvLbovX07L8xr9rkv0QLAngULZRJVcl7gn3 joeuHL6LpSPU3RBcFPUDBkEH4Rr5dstqYIPcgRQnKDj7k7AyrciYEQaX6dBMtr+O8mfPjnSJRt LzoN5bQ9wAnofYQEpjlt2AWrx0Qh7ZeIGZ8HwNms964WmhMKd+6BsfPqf6OChsM1buaU4nXvLv kB9HGpGP5qjB0xpQZ8kgARiD9iIAKw891T45xINMSjLwOl7p8ZdSw8lZIS5vCzZU/RgoKDFaQm bg0= X-IronPort-AV: E=Sophos;i="5.76,415,1592863200"; d="scan'208";a="13831338" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 11 Sep 2020 17:01:49 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Fri, 11 Sep 2020 17:01:49 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Fri, 11 Sep 2020 17:01:49 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1599836509; x=1631372509; h=from:to:cc:subject:date:message-id; bh=rGnbFBeV98YZ6Jj0PFhBZ+Pm9hlOkM3MIOQgmK98Tx8=; b=S7RNZ5vCOf6ybbKaiTe+UBeKM+64f2hKOTGlGlFHHgAWyfZ8HOT4atbi ERMhgSm6Ou7mHsWrfDkkgVfjRa5zL6b/2J5VCUs2U4jAvyn75RDjJOSxo K/Zwew2ZPZia4+dcHLC4Jj879HETcevXYMbhPF5Ltqmf6PL9wdvhxcCAR s/2LJcuHDo38k+6CL6P6VL3hPZgKngRVKo99529URnupq2bl30ueGJZNi /rljbQhQhuByBulmejlAMyWpslzRcOaoCgMKDBVKZ9QYRGoxlVCPb0pRw bmFTEhc4FysZBLs37JQZt/yOs5C7cBm7WqRuh3i12lm2+4N0vqNhlfT+U Q==; IronPort-SDR: Z2Qh7HYOE9HEncPGGLxSJmyY6VUNxlaZXWQOlMXLamvJHIJcJB1oWm8TZ2YLNFdwtyyc/j7/qs Vl58Or6OOHMRuFISr9rrnI2uxVmWjd8glrNfbg4uuYAzV+OpZTLVnrToEAmrWCNycyfHSjdese RmACkYqLTsefdqB+zW6dDpYivyg+zUfiHB5wXKydOkiU6TWrEImH7ajRd8G8koOJ9Vn5UAY1Cs 3+17mAQHA45LU51cO882Ft9BnY7OESr749kX42eBAHfRFR31UzeTMhfJJdBGLmU2NMZHGIT7vQ Tq4= X-IronPort-AV: E=Sophos;i="5.76,415,1592863200"; d="scan'208";a="13831337" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 11 Sep 2020 17:01:49 +0200 Received: from schifferm-ubuntu4.tq-net.de (schifferm-ubuntu4.tq-net.de [10.117.49.134]) by vtuxmail01.tq-net.de (Postfix) with ESMTPA id D138D280070; Fri, 11 Sep 2020 17:01:48 +0200 (CEST) From: Matthias Schiffer To: Shawn Guo , Sascha Hauer Subject: [PATCH] i2c: mxs: use MXS_DMA_CTRL_WAIT4END instead of DMA_CTRL_ACK Date: Fri, 11 Sep 2020 17:01:39 +0200 Message-Id: <20200911150139.13690-1-matthias.schiffer@ew.tq-group.com> X-Mailer: git-send-email 2.17.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200911_110152_670017_08FF5AD3 X-CRM114-Status: GOOD ( 15.36 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 SPF_NONE SPF: sender does not publish an SPF Record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Matthias Schiffer , linux-kernel@vger.kernel.org, NXP Linux Team , Pengutronix Kernel Team , Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-i2c@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The driver-specific usage of the DMA_CTRL_ACK flag was replaced with a custom flag in commit ceeeb99cd821 ("dmaengine: mxs: rename custom flag"), but i2c-mxs was not updated to use the new flag, completely breaking I2C transactions using DMA. Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag") Signed-off-by: Matthias Schiffer Reviewed-by: Fabio Estevam --- I'm a bit out of my depth here - I have no idea what these flags are supposed to do. Looking at ceeeb99cd821, this is what I came up with, and it fixes I2C communication with multiple devices (an EEPROM and a PCF85063TP RTC) on one of our i.MX28 boards. I run-tested this on a 5.4.y kernel; given how little is happening in these drivers nowadays, I assume that the fix is still valid on newer kernels... drivers/i2c/busses/i2c-mxs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index 9587347447f0..c4b08a924461 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c @@ -25,6 +25,7 @@ #include #include #include +#include #define DRIVER_NAME "mxs-i2c" @@ -200,7 +201,8 @@ static int mxs_i2c_dma_setup_xfer(struct i2c_adapter *adap, dma_map_sg(i2c->dev, &i2c->sg_io[0], 1, DMA_TO_DEVICE); desc = dmaengine_prep_slave_sg(i2c->dmach, &i2c->sg_io[0], 1, DMA_MEM_TO_DEV, - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + DMA_PREP_INTERRUPT | + MXS_DMA_CTRL_WAIT4END); if (!desc) { dev_err(i2c->dev, "Failed to get DMA data write descriptor.\n"); @@ -228,7 +230,8 @@ static int mxs_i2c_dma_setup_xfer(struct i2c_adapter *adap, dma_map_sg(i2c->dev, &i2c->sg_io[1], 1, DMA_FROM_DEVICE); desc = dmaengine_prep_slave_sg(i2c->dmach, &i2c->sg_io[1], 1, DMA_DEV_TO_MEM, - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + DMA_PREP_INTERRUPT | + MXS_DMA_CTRL_WAIT4END); if (!desc) { dev_err(i2c->dev, "Failed to get DMA data write descriptor.\n"); @@ -260,7 +263,8 @@ static int mxs_i2c_dma_setup_xfer(struct i2c_adapter *adap, dma_map_sg(i2c->dev, i2c->sg_io, 2, DMA_TO_DEVICE); desc = dmaengine_prep_slave_sg(i2c->dmach, i2c->sg_io, 2, DMA_MEM_TO_DEV, - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + DMA_PREP_INTERRUPT | + MXS_DMA_CTRL_WAIT4END); if (!desc) { dev_err(i2c->dev, "Failed to get DMA data write descriptor.\n");