From patchwork Thu Feb 1 13:15:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ralf Schlatterbeck X-Patchwork-Id: 769095 Received: from tux.runtux.com (tux.runtux.com [176.9.82.136]) (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 8293D5336F; Thu, 1 Feb 2024 13:15:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=176.9.82.136 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706793348; cv=none; b=W375kFv3MEWG/01oUL6RUlX4oZdzirBmetHJD3/hyK8tm/nVWCTE6hpCZe42fhZkF7b3H0wdtVOzFS2+dlDSa5CObK/yQ5HBrlqmMEzH1hlvQLl3oNJNR/c4tjnwoqtzkHLC1CEj3fzoT5TWsbZQPvsF7UnFakr8o2ZXNNVH9L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706793348; c=relaxed/simple; bh=CN3V6/jyU6TYc7JhVGapD4+ahcpnC9dXp60iMREooAc=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type: Content-Disposition; b=MQW3wLd06wODxi1t8ZCU6X3XTGvd6BTQ11UEe1WqKpn2VILa6uaBWY9rPijXA8QCqVDNdmYbSH8CF13pEyE7P2xTRGEt3+IXYy/Ft9UCiMvhMXDOXEcAxJCDlBkHsWtz5qwso7JOv9V76zn6Z4aK7MWvP2MQ+1kzzg5libIot5Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=runtux.com; spf=pass smtp.mailfrom=runtux.com; arc=none smtp.client-ip=176.9.82.136 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=runtux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=runtux.com Received: from localhost (localhost [127.0.0.1]) by tux.runtux.com (Postfix) with ESMTP id 8D3E06EF8E; Thu, 1 Feb 2024 14:15:43 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at tux.runtux.com Received: from tux.runtux.com ([127.0.0.1]) by localhost (tux2.runtux.com [127.0.0.1]) (amavisd-new, port 10026) with LMTP id d--Q9PqJXrM2; Thu, 1 Feb 2024 14:15:42 +0100 (CET) Received: from bee.priv.zoo (62-99-217-90.static.upcbusiness.at [62.99.217.90]) (Authenticated sender: postmaster@runtux.com) by tux.runtux.com (Postfix) with ESMTPSA id 7A6BA6EF20; Thu, 1 Feb 2024 14:15:41 +0100 (CET) Received: by bee.priv.zoo (Postfix, from userid 1002) id 0BC85469; Thu, 1 Feb 2024 14:15:40 +0100 (CET) Date: Thu, 1 Feb 2024 14:15:40 +0100 From: Ralf Schlatterbeck To: Mark Brown , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Vinod Koul , Miquel Raynal , linux-spi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] spi-mxs: Fix chipselect glitch Message-ID: <20240201131540.3dlqoxlrrbzshz7w@runtux.com> Precedence: bulk X-Mailing-List: linux-spi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Disposition: inline X-ray: beware User-Agent: NeoMutt/20180716 There was a change in the mxs-dma engine that uses a new custom flag. The change was not applied to the mxs spi driver. This results in chipselect being deasserted too early. This fixes the chipselect problem by using the new flag in the mxs-spi driver. Fixes: ceeeb99cd821 ("dmaengine: mxs: rename custom flag") Signed-off-by: Ralf Schlatterbeck Tested-by: Stefan Wahren --- For oscilloscope screenshots and a verbose explanation see my blog post at https://blog.runtux.com/posts/2024/02/01/ drivers/spi/spi-mxs.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/spi/spi-mxs.c b/drivers/spi/spi-mxs.c index 1bf080339b5a..a296050c8bd3 100644 --- a/drivers/spi/spi-mxs.c +++ b/drivers/spi/spi-mxs.c @@ -39,6 +39,7 @@ #include #include #include +#include #define DRIVER_NAME "mxs-spi" @@ -251,8 +252,9 @@ static int mxs_spi_txrx_dma(struct mxs_spi *spi, desc = dmaengine_prep_slave_sg(ssp->dmach, &dma_xfer[sg_count].sg, 1, - (flags & TXRX_WRITE) ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, - DMA_PREP_INTERRUPT | DMA_CTRL_ACK); + (flags & TXRX_WRITE) + ? DMA_MEM_TO_DEV : DMA_DEV_TO_MEM, + DMA_PREP_INTERRUPT | MXS_DMA_CTRL_WAIT4END); if (!desc) { dev_err(ssp->dev,