Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2100309iof; Tue, 7 Jun 2022 19:45:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxpvDWv4JlqYqdcLZcfbW4mzL3LXRMmC66jzCC3sv/UkDx5bGhIqtEwmPyixS8+Gv8/7nm3 X-Received: by 2002:a17:903:2312:b0:163:daf7:83a9 with SMTP id d18-20020a170903231200b00163daf783a9mr32014945plh.160.1654656305278; Tue, 07 Jun 2022 19:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654656305; cv=none; d=google.com; s=arc-20160816; b=qiotEulwcwMPcbFDoH6Vy+PmzjgcGY1Qo21kNh3/u0z0b8b+5gwR9WWDbbcQSCnEPo hPIHRnRLnBuf5Mt8KmxtOP8T6qGVmwShzodEY16cNErWdbP7HQRS59blyl0zFxvJEWP6 UcL+dtM338TenlyUprfQrCrrC1DWhOYsyzdkbUECYjb/cvJ84VRB7qKZ81DndifD41In aw1abjVyXgPftRZx51jf1YeCHR32fAQXIPRnUvh+50HCcNBapdKYTcNgHl0l3a9ob3Ib ugNlH/UFUWlDmP9bvZXE+9Y10+1/wtQtBbLlQNKVskQLDPt3JkqvbI0qHHPCYxXcIrsB U1Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6skCEfKDqRqGqBX1lbA9dr/1KW2nsqBWRIx6igx2opo=; b=M9uwOqzPNVNKfNduWwRjv1CQ/ZxA7mBxKQETuFS7LQWOptDmqCq/0Lm4YBYa15Lt0V HlRSAQMVL1uXPNfEsnGVRZxmYQTN8ML0qYL/JC/so5FpBUnC8Zk9ipMLSnmDYmhg24WK ERCH3sMqky9Z+FUpNkimU+BHKSa/vH1pDr61accLYpSTrfFNmOvmYFpimLWqST3YoFn8 d+jheixg+keA7NN4cc+bir7citAaRePHekceL1NiO5MzKQLp1amVctkMyfMjkD5dVz3V jyrlP1D/GIFGbwTHe/8BUjv72piyEGPplPZoQjW6LfPXOTwXVd4l/in2aP6s4PXQ255v DkeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2olAgxP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id f1-20020a63dc41000000b003fc8c4e29bdsi24745233pgj.300.2022.06.07.19.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jun 2022 19:45:05 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2olAgxP; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (out1.vger.email [IPv6:2620:137:e000::1:20]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0FE5D262E23; Tue, 7 Jun 2022 18:14:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357195AbiFGWNu (ORCPT + 99 others); Tue, 7 Jun 2022 18:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379907AbiFGVLJ (ORCPT ); Tue, 7 Jun 2022 17:11:09 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4DAE216802; Tue, 7 Jun 2022 11:52:28 -0700 (PDT) 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 49EF4612F2; Tue, 7 Jun 2022 18:52:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5FB26C385A2; Tue, 7 Jun 2022 18:52:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1654627947; bh=63KEk9VLTggDHYa7uCWhw1ThCahBRf68liu0x9+Y4Q8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2olAgxPCtAWpqnZ838c+7Z05LLh6+GM5Vcp/HD00hXs4tUu6bt76Zy6i/fjE7/xk 35cIra2dpcwLDqfGFbMCmyLhoFscfyldsI/lSgD+SACiU2Jw+9iE6sAFZGJil31Y75 qmOvWsuCf8/x0tQfu1BYZr9PspWV6HRC6Sg45hmA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Patrice Chotard , eberhard.stoll@kontron.de, Mark Brown , Sasha Levin Subject: [PATCH 5.18 149/879] spi: stm32-qspi: Fix wait_cmd timeout in APM mode Date: Tue, 7 Jun 2022 18:54:27 +0200 Message-Id: <20220607165007.030694004@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220607165002.659942637@linuxfoundation.org> References: <20220607165002.659942637@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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