Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp52346ybg; Mon, 8 Jun 2020 16:12:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyTod6MaKW2juSaUis65l33tEhK0HLpR25cdLKuico9ypYLeF3dvd2SgIUm1U0zGzx4C//5 X-Received: by 2002:a05:6402:34e:: with SMTP id r14mr24152165edw.351.1591657921467; Mon, 08 Jun 2020 16:12:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591657921; cv=none; d=google.com; s=arc-20160816; b=VUd1TQ5oYBp8JNGdTqw7xH4WpbuZquWwENXCdBVYclr8uyCot4xMZuO1ywWw7qb464 cW1XSrWDN8ElPz09r1uT1PNW9mO00BrA2gvwDnExpwf0bDKLVLmPHUQCM+nHu692GtGy tszTAeEfHGS2D85Mk11HGGn/7YG8b2D3+buszkhpbiY+C5NQJ944/fbMD7i4Ep8RIgap BBQ9kMT3zmKSdAKlPhexeCwTP5exOooeBOyppfoQLfU4Owh51tyuzr44zQeav+Cbk65F JZZ5YDGo+2lS+mk+bVlgK+qTdV3vybg9jPi85d9yEcIJQ4M1xt3OcC12Bz2btiI0DsGT RhoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=AVe/LMeq9vrGEXSMYg5Lm1PxdbiziKJ5wsiO2cbesR0=; b=bOAfqZ7LfJWvFGazwoOScYK9rZMr/dcHGsTHpDvvC9ujAjSTcYeBWBYXRo6cvSUV8Y qydefloUROEk6Fvni5wQhR2ifJELXlB1SWfuzynV88AcmX7jtYmHSzcTUzm/TbcwUkBJ 7o5c38B4ljF0LSERqxumROqIXW4f+w/cn5SlrdgtO7R5qS/6oSBiNc/PQn3Uw7f4HV/m 8GuqOvlFUNV/GjikYGn0uUgu9WlaSjwPFItYQWW6hnaMCBqsc7VXuxct25QsJFxKHRPg /Q/43n8vTDLKT2NssKScYBnwvQ81lDYNzqpibuiWpBnGdXzqGeM4/uMCCldn8hhv18c8 LZwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SaRQmJij; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cz19si9339385edb.40.2020.06.08.16.11.38; Mon, 08 Jun 2020 16:12:01 -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; dkim=pass header.i=@kernel.org header.s=default header.b=SaRQmJij; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727017AbgFHXI5 (ORCPT + 99 others); Mon, 8 Jun 2020 19:08:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:52576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728027AbgFHXHw (ORCPT ); Mon, 8 Jun 2020 19:07:52 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1C4C32087E; Mon, 8 Jun 2020 23:07:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1591657671; bh=3WMrB6CIg3LMf536G7ZwY2EFfDrDAtqAJlC+4oM9Ndw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SaRQmJijO2kztoniRC5VahQlY57ih1YxiDOWgKxT6tYnwdmM5oJEP5nn+ua+4K80a bRVtOtL2mtVQEyYxrQCr1xKaNLAx/yjeYpBWiKtiLCrd3uPJwpCgDZ8rh7wdq7s3Kd bqsUb4wxMfzUCToRZn1yD2wGL20LfDY0w0BNLKDw= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Serge Semin , Andy Shevchenko , Georgy Vlasov , Ramil Zaripov , Alexey Malahov , Thomas Bogendoerfer , Arnd Bergmann , Feng Tang , Rob Herring , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Mark Brown , Sasha Levin , linux-spi@vger.kernel.org Subject: [PATCH AUTOSEL 5.7 080/274] spi: dw: Fix Rx-only DMA transfers Date: Mon, 8 Jun 2020 19:02:53 -0400 Message-Id: <20200608230607.3361041-80-sashal@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200608230607.3361041-1-sashal@kernel.org> References: <20200608230607.3361041-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Serge Semin [ Upstream commit 46164fde6b7890e7a3982d54549947c8394c0192 ] Tx-only DMA transfers are working perfectly fine since in this case the code just ignores the Rx FIFO overflow interrupts. But it turns out the SPI Rx-only transfers are broken since nothing pushing any data to the shift registers, so the Rx FIFO is left empty and the SPI core subsystems just returns a timeout error. Since DW DMAC driver doesn't support something like cyclic write operations of a single byte to a device register, the only way to support the Rx-only SPI transfers is to fake it by using a dummy Tx-buffer. This is what we intend to fix in this commit by setting the SPI_CONTROLLER_MUST_TX flag for DMA-capable platform. Signed-off-by: Serge Semin Reviewed-by: Andy Shevchenko Cc: Georgy Vlasov Cc: Ramil Zaripov Cc: Alexey Malahov Cc: Thomas Bogendoerfer Cc: Arnd Bergmann Cc: Feng Tang Cc: Rob Herring Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Link: https://lore.kernel.org/r/20200529131205.31838-9-Sergey.Semin@baikalelectronics.ru Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-dw.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-dw.c b/drivers/spi/spi-dw.c index 31e3f866d11a..e8f275c850ce 100644 --- a/drivers/spi/spi-dw.c +++ b/drivers/spi/spi-dw.c @@ -523,6 +523,7 @@ int dw_spi_add_host(struct device *dev, struct dw_spi *dws) dws->dma_inited = 0; } else { master->can_dma = dws->dma_ops->can_dma; + master->flags |= SPI_CONTROLLER_MUST_TX; } } -- 2.25.1