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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 27E3FC433FE for ; Mon, 30 May 2022 13:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=dPP7lCUFhOJecLl1FGjJo5Nm9JRXYZEJH9cfcUkUtDw=; b=CMH3TMCnNgF1S8 iVf4eG8zsDQ9uxEbecpi0Qi7035HoxrK8lRvp40HgKswI02wI9NvXRqRSVv/f8h1dwn0pImrsgwdb vFWs9t2RM0niarIJQ1YeWmdlgx/0piCwlE7MG8ANPK0Bq/ZMtrGHpQoB8c11aypw5/mgiV6LwoWK+ L9urUU+cB/07XbhpC14ycCb/lvCNd9PMQ+D7H/jqKpSdnYjcmS7Dmsp3rHRJ10XVIFUW6uaarUDzJ Ko00ASo7ooErNvMnL9Cwb0KhS1fCTzpvWRzt/GZsGD5H1pCB3mJ67rFVyvbPKQlqvinO3LAxpgV94 G76qnsJvUUGWocNNADhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvfjG-006rkC-BY; Mon, 30 May 2022 13:46:42 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nvfYc-006lae-TY for linux-arm-kernel@lists.infradead.org; Mon, 30 May 2022 13:35:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5D2AB60F2A; Mon, 30 May 2022 13:35:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8EB3CC341C4; Mon, 30 May 2022 13:35:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653917741; bh=63KEk9VLTggDHYa7uCWhw1ThCahBRf68liu0x9+Y4Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sJZxUDSd/zCGqgBknaxliHzfAFhP1qrylxXnllVJj7qYMbBo2MR1z5hfzZ0a6e+We ge5dGcXTvAsj47KrU9cgt80chhv9xvxj+PgvRMVzi+42x32Y0SMMaFT0n8YRis4sEL DTBL6wJxxe9bsu7A0+cjZnDg9UHHhqyQIe/X3mbMOj+38auHmI7cIvCzaIb4ZDFMaP 0aiumuPkhHnjasbuFj22T//dXo/gczg2kOtGOqe+KjopAy9qVyNeas92IeWSkBHnwr 3oODxdwlbhfDHU0vtT/MbC1QyhFeOpEObHJh17bevZYIVxC/0REVGT0hU8WXk0jwzz g0583iFiUcjyg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Patrice Chotard , eberhard.stoll@kontron.de, Mark Brown , Sasha Levin , mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, linux-spi@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH AUTOSEL 5.17 082/135] spi: stm32-qspi: Fix wait_cmd timeout in APM mode Date: Mon, 30 May 2022 09:30:40 -0400 Message-Id: <20220530133133.1931716-82-sashal@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220530133133.1931716-1-sashal@kernel.org> References: <20220530133133.1931716-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220530_063543_061496_618EE2FA X-CRM114-Status: GOOD ( 12.06 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Patrice Chotard [ Upstream commit d83d89ea68b4726700fa87b22db075e4217e691c ] In APM mode, TCF and TEF flags are not set. To avoid timeout in stm32_qspi_wait_cmd(), don't check if TCF/TEF are set. Signed-off-by: Patrice Chotard Reported-by: eberhard.stoll@kontron.de Link: https://lore.kernel.org/r/20220511074644.558874-2-patrice.chotard@foss.st.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-stm32-qspi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-stm32-qspi.c b/drivers/spi/spi-stm32-qspi.c index ffdc55f87e82..dd38cb8ffbc2 100644 --- a/drivers/spi/spi-stm32-qspi.c +++ b/drivers/spi/spi-stm32-qspi.c @@ -308,7 +308,8 @@ static int stm32_qspi_wait_cmd(struct stm32_qspi *qspi, if (!op->data.nbytes) goto wait_nobusy; - if (readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) + if ((readl_relaxed(qspi->io_base + QSPI_SR) & SR_TCF) || + qspi->fmode == CCR_FMODE_APM) goto out; reinit_completion(&qspi->data_completion); -- 2.35.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel