From patchwork Fri Mar 4 10:52:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 8502211 Return-Path: X-Original-To: patchwork-linux-spi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 48E859F8A8 for ; Fri, 4 Mar 2016 10:52:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 668D6201C8 for ; Fri, 4 Mar 2016 10:52:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6D63E201BB for ; Fri, 4 Mar 2016 10:52:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751362AbcCDKwU (ORCPT ); Fri, 4 Mar 2016 05:52:20 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:63465 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750817AbcCDKwS (ORCPT ); Fri, 4 Mar 2016 05:52:18 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-FEM-01.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1abnLF-0002Eu-NX from Vladimir_Zapolskiy@mentor.com ; Fri, 04 Mar 2016 02:52:18 -0800 Received: from [137.202.108.186] (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server (TLS) id 14.3.224.2; Fri, 4 Mar 2016 10:52:16 +0000 Subject: Re: [PATCH 6/9] spi: imx: remove unnecessary bit clearing in mx51_ecspi_config To: Sascha Hauer , References: <1456302033-25638-1-git-send-email-s.hauer@pengutronix.de> <1456302033-25638-7-git-send-email-s.hauer@pengutronix.de> CC: , Mark Brown , Anton Bondarenko From: Vladimir Zapolskiy Message-ID: <56D968DF.7000007@mentor.com> Date: Fri, 4 Mar 2016 12:52:15 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:38.0) Gecko/20100101 Icedove/38.1.0 MIME-Version: 1.0 In-Reply-To: <1456302033-25638-7-git-send-email-s.hauer@pengutronix.de> X-Originating-IP: [137.202.0.76] Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Sascha, On 24.02.2016 10:20, Sascha Hauer wrote: > This reverts patch 1476253cef (spi: imx: fix ecspi mode setup) > The patch tried to fix something by clearing bits in the cfg variable, > but cfg is initialized to zero on function entry. There are no bits to > clear. > > Signed-off-by: Sascha Hauer I believe here the expected fix should be ----8<---- * The hardware seems to have a race condition when changing modes. The ----8<---- > --- > drivers/spi/spi-imx.c | 7 ------- > 1 file changed, 7 deletions(-) > > diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c > index 15b23f0..287ec0c 100644 > --- a/drivers/spi/spi-imx.c > +++ b/drivers/spi/spi-imx.c > @@ -366,20 +366,13 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx, > > if (config->mode & SPI_CPHA) > cfg |= MX51_ECSPI_CONFIG_SCLKPHA(config->cs); > - else > - cfg &= ~MX51_ECSPI_CONFIG_SCLKPHA(config->cs); > > if (config->mode & SPI_CPOL) { > cfg |= MX51_ECSPI_CONFIG_SCLKPOL(config->cs); > cfg |= MX51_ECSPI_CONFIG_SCLKCTL(config->cs); > - } else { > - cfg &= ~MX51_ECSPI_CONFIG_SCLKPOL(config->cs); > - cfg &= ~MX51_ECSPI_CONFIG_SCLKCTL(config->cs); > } > if (config->mode & SPI_CS_HIGH) > cfg |= MX51_ECSPI_CONFIG_SSBPOL(config->cs); > - else > - cfg &= ~MX51_ECSPI_CONFIG_SSBPOL(config->cs); > > /* CTRL register always go first to bring out controller from reset */ > writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL); > --- With best wishes, Vladimir -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 6a4ff27..9c9bae0 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -316,9 +316,10 @@ static void __maybe_unused mx51_ecspi_trigger(struct spi_imx_data *spi_imx) static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx, struct spi_imx_config *config) { - u32 ctrl = MX51_ECSPI_CTRL_ENABLE, cfg = 0, dma = 0; + u32 ctrl = MX51_ECSPI_CTRL_ENABLE, dma = 0; u32 tx_wml_cfg, rx_wml_cfg, rxt_wml_cfg; u32 clk = config->speed_hz, delay, reg; + u32 cfg = readl(spi_imx->base + MX51_ECSPI_CONFIG); /*