Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp489924pxv; Fri, 9 Jul 2021 02:36:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9k0qoPSwSzDrUw8UKBNCjSdEmynFVBtTrnZs1/6xqS4fTiwXgWkvU0VveJVaqH0VLlp2H X-Received: by 2002:a92:db44:: with SMTP id w4mr7193052ilq.112.1625823389248; Fri, 09 Jul 2021 02:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625823389; cv=none; d=google.com; s=arc-20160816; b=tRZdOqotrqFqbhJ1CcrfZJ/LiFIdvPYBOx++uw1bTSVChvtOOCWn7djxcbrPCsaKVx ZWoLUvV7V5ETsPRAG1r0fMXSqsnwuW6kes+QUFhSger0NopcSb6vM7yfjaJHU2LUILCB huQQVIhx4gMjhECeIMajfpFvQRKU+Fm8qaxIHljJuWU+zypxmj2kpA2mVzeLyufnNXzA xM3qm+HZLrybEDBtVVxpx1D5V5c9jf0g3UgpS5o2ejASwMxxUqamKAezUrvPwXydVrUM XHZC7isz4cHYCeKEhSzBghOQqmDdGv2IHbCcM7i6jshRHgXKqqwWo6xt2hWUxAtdhol/ S4Rg== 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 :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=FH6nciakRBNDU9PThwEeeS5JhMmpBtCrfMWzWKX7NxQ=; b=dKZilUCvZgRyfV6NBSaTL7WlX7kLRXpX/MhAczglQ97Ujk/TZRMjXfqUBaurn+njbJ XAWIxNZBJzkP2myD0kEnZZrix4/BnbvarwT1errM2qoUgETq7xGLWA3ypX1iSTe9yjC5 xOtUcCsf14s0S13i9FsXMWSfXRFBHbDEDDOwnhLG58NyCu2qUh/PXdcJryAZtvYFVn4j W+657O/+Y/madixX5Q5gbKoAJV0WILyM2JzrCXRpAXI6Onn6EagGSOMduLOBxeTk0sly nV8sfGIkWjt8gkxmDnmi5qvVxUV28gbO/gjPN+YXUzJPf1OznnAdAT0BOzYCLKTdTe3i Kqbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o15si2086232ilf.79.2021.07.09.02.36.17; Fri, 09 Jul 2021 02:36:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231827AbhGIJid (ORCPT + 99 others); Fri, 9 Jul 2021 05:38:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231772AbhGIJic (ORCPT ); Fri, 9 Jul 2021 05:38:32 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A1F7C0613DD for ; Fri, 9 Jul 2021 02:35:48 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[IPv6:::1]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m1mv3-0007h4-JP; Fri, 09 Jul 2021 11:35:37 +0200 Message-ID: <6cacef63be4c6335b8bfa26043c3f787c9affd41.camel@pengutronix.de> Subject: Re: [PATCH v14 07/12] spi: imx: fix ERR009165 From: Lucas Stach To: Robin Gong , vkoul@kernel.org, mark.rutland@arm.com, broonie@kernel.org, robh+dt@kernel.org, catalin.marinas@arm.com, will.deacon@arm.com, shawnguo@kernel.org, festevam@gmail.com, s.hauer@pengutronix.de, martin.fuzzey@flowbird.group, u.kleine-koenig@pengutronix.de, dan.j.williams@intel.com, matthias.schiffer@ew.tq-group.com, frieder.schrempf@kontron.de, m.felsch@pengutronix.de, xiaoning.wang@nxp.com Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Fri, 09 Jul 2021 11:35:35 +0200 In-Reply-To: <1617809456-17693-8-git-send-email-yibin.gong@nxp.com> References: <1617809456-17693-1-git-send-email-yibin.gong@nxp.com> <1617809456-17693-8-git-send-email-yibin.gong@nxp.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.1 (3.40.1-1.fc34) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, dem 07.04.2021 um 23:30 +0800 schrieb Robin Gong: > Change to XCH mode even in dma mode, please refer to the below > errata: > https://www.nxp.com/docs/en/errata/IMX6DQCE.pdf > > Signed-off-by: Robin Gong > Acked-by: Mark Brown Reviewed-by: Lucas Stach > --- > drivers/spi/spi-imx.c | 10 +++------- > 1 file changed, 3 insertions(+), 7 deletions(-) > > diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c > index 4fe767a..cf235b9 100644 > --- a/drivers/spi/spi-imx.c > +++ b/drivers/spi/spi-imx.c > @@ -593,8 +593,8 @@ static int mx51_ecspi_prepare_transfer(struct spi_imx_data *spi_imx, > ctrl |= mx51_ecspi_clkdiv(spi_imx, t->speed_hz, &clk); > spi_imx->spi_bus_clk = clk; > > - if (spi_imx->usedma) > - ctrl |= MX51_ECSPI_CTRL_SMC; > + /* ERR009165: work in XHC mode as PIO */ > + ctrl &= ~MX51_ECSPI_CTRL_SMC; > > writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); > > @@ -625,7 +625,7 @@ static void mx51_setup_wml(struct spi_imx_data *spi_imx) > * and enable DMA request. > */ > writel(MX51_ECSPI_DMA_RX_WML(spi_imx->wml - 1) | > - MX51_ECSPI_DMA_TX_WML(spi_imx->wml) | > + MX51_ECSPI_DMA_TX_WML(0) | > MX51_ECSPI_DMA_RXT_WML(spi_imx->wml) | > MX51_ECSPI_DMA_TEDEN | MX51_ECSPI_DMA_RXDEN | > MX51_ECSPI_DMA_RXTDEN, spi_imx->base + MX51_ECSPI_DMA); > @@ -1234,10 +1234,6 @@ static int spi_imx_sdma_init(struct device *dev, struct spi_imx_data *spi_imx, > { > int ret; > > - /* use pio mode for i.mx6dl chip TKT238285 */ > - if (of_machine_is_compatible("fsl,imx6dl")) > - return 0; > - > spi_imx->wml = spi_imx->devtype_data->fifo_size / 2; > > /* Prepare for TX DMA: */