Message ID | 20200920112914.26501-21-Sergey.Semin@baikalelectronics.ru (mailing list archive) |
---|---|
State | Superseded |
Headers | show
Return-Path: <SRS0=0Kns=C5=vger.kernel.org=linux-spi-owner@kernel.org> 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 A10806CA for <patchwork-linux-spi@patchwork.kernel.org>; Sun, 20 Sep 2020 11:31:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 91AE120EDD for <patchwork-linux-spi@patchwork.kernel.org>; Sun, 20 Sep 2020 11:31:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726789AbgITLbB (ORCPT <rfc822;patchwork-linux-spi@patchwork.kernel.org>); Sun, 20 Sep 2020 07:31:01 -0400 Received: from mail.baikalelectronics.com ([87.245.175.226]:53690 "EHLO mail.baikalelectronics.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726473AbgITL3t (ORCPT <rfc822;linux-spi@vger.kernel.org>); Sun, 20 Sep 2020 07:29:49 -0400 Received: from localhost (unknown [127.0.0.1]) by mail.baikalelectronics.ru (Postfix) with ESMTP id 1E791803202E; Sun, 20 Sep 2020 11:29:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at baikalelectronics.ru Received: from mail.baikalelectronics.ru ([127.0.0.1]) by localhost (mail.baikalelectronics.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MPRx6JeoOrAO; Sun, 20 Sep 2020 14:29:36 +0300 (MSK) From: Serge Semin <Sergey.Semin@baikalelectronics.ru> To: Mark Brown <broonie@kernel.org> CC: Serge Semin <Sergey.Semin@baikalelectronics.ru>, Serge Semin <fancer.lancer@gmail.com>, Alexey Malahov <Alexey.Malahov@baikalelectronics.ru>, Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru>, Pavel Parkhomenko <Pavel.Parkhomenko@baikalelectronics.ru>, Andy Shevchenko <andy.shevchenko@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Lars Povlsen <lars.povlsen@microchip.com>, "wuxu . wu" <wuxu.wu@huawei.com>, Feng Tang <feng.tang@intel.com>, Rob Herring <robh+dt@kernel.org>, <linux-spi@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org> Subject: [PATCH 20/30] spi: dw: Unmask IRQs after enabling the chip Date: Sun, 20 Sep 2020 14:29:04 +0300 Message-ID: <20200920112914.26501-21-Sergey.Semin@baikalelectronics.ru> In-Reply-To: <20200920112914.26501-1-Sergey.Semin@baikalelectronics.ru> References: <20200920112914.26501-1-Sergey.Semin@baikalelectronics.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MAIL.baikal.int (192.168.51.25) To mail (192.168.51.25) Precedence: bulk List-ID: <linux-spi.vger.kernel.org> X-Mailing-List: linux-spi@vger.kernel.org |
Series |
spi: dw: Add full Baikal-T1 SPI Controllers support
|
expand
|
diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c index 08bc53b9de88..8dbe11c1821c 100644 --- a/drivers/spi/spi-dw-core.c +++ b/drivers/spi/spi-dw-core.c @@ -355,8 +355,6 @@ static int dw_spi_transfer_one(struct spi_controller *master, spi_enable_chip(dws, 1); return ret; } - } else { - dw_spi_irq_setup(dws); } spi_enable_chip(dws, 1); @@ -364,6 +362,8 @@ static int dw_spi_transfer_one(struct spi_controller *master, if (dws->dma_mapped) return dws->dma_ops->dma_transfer(dws, transfer); + dw_spi_irq_setup(dws); + return 1; }
It's theoretically erroneous to enable IRQ before the chip is turned on. If IRQ handler gets executed before the chip is enabled, then any data written to the Tx FIFO will be just ignored. I say "theoretically" because we haven't noticed any problem with that, but let's fix it anyway just in case... Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> --- drivers/spi/spi-dw-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)