From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58B7CC433F5 for ; Fri, 8 Oct 2021 11:33:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3AEE761872 for ; Fri, 8 Oct 2021 11:33:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242365AbhJHLfV (ORCPT ); Fri, 8 Oct 2021 07:35:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:59432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240930AbhJHLc5 (ORCPT ); Fri, 8 Oct 2021 07:32:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF49461353; Fri, 8 Oct 2021 11:30:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1633692643; bh=mUgukess8O9s+KgtEGp2K/ZCeaegdNTLZV51hG4FIk8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=f+fDam0dY66dDZuaWxnFgyP/obIlHjjWJM2d/KPd8PpHDH8D0Olc9V8kxcZ6EHkw6 tQeKMvpvG2HuKl7K7Jtk2AGQ4NoYDl0uQDwP3RZ6gx08O51PEqsIJtjT7TLF9aE6f8 6ed7DCPl7aXvUmfr5UxNSO2eTc7Yn5pIlxD+jZ0M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tobias Schramm , Mark Brown , Sasha Levin Subject: [PATCH 5.10 01/29] spi: rockchip: handle zero length transfers without timing out Date: Fri, 8 Oct 2021 13:27:48 +0200 Message-Id: <20211008112716.971550767@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211008112716.914501436@linuxfoundation.org> References: <20211008112716.914501436@linuxfoundation.org> User-Agent: quilt/0.66 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tobias Schramm [ Upstream commit 5457773ef99f25fcc4b238ac76b68e28273250f4 ] Previously zero length transfers submitted to the Rokchip SPI driver would time out in the SPI layer. This happens because the SPI peripheral does not trigger a transfer completion interrupt for zero length transfers. Fix that by completing zero length transfers immediately at start of transfer. Signed-off-by: Tobias Schramm Link: https://lore.kernel.org/r/20210827050357.165409-1-t.schramm@manjaro.org Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-rockchip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index 0aab37cd64e7..624273d0e727 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -582,6 +582,12 @@ static int rockchip_spi_transfer_one( int ret; bool use_dma; + /* Zero length transfers won't trigger an interrupt on completion */ + if (!xfer->len) { + spi_finalize_current_transfer(ctlr); + return 1; + } + WARN_ON(readl_relaxed(rs->regs + ROCKCHIP_SPI_SSIENR) && (readl_relaxed(rs->regs + ROCKCHIP_SPI_SR) & SR_BUSY)); -- 2.33.0