From patchwork Thu Jun 2 09:10:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrice CHOTARD X-Patchwork-Id: 12867697 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 183BAC43334 for ; Thu, 2 Jun 2022 09:11:37 +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: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:In-Reply-To:References: List-Owner; bh=wJDDZNBYgLVUmzN3uTCMkCixwB4882VHta7sEfP+s+U=; b=A/xtPgGlxvJnzI 7Gb9++4pbmFbMvWk3kxBoOPVl/3XHgMJAH9u96LnJgq/uO4jd+jjRRWyhU9D9jDAwzREDS73lVMpf Pr+yDtORNsTmIynsccrS2IVaV4gK7EDSHEa3ssQTDkBK5tZbJ6BPCifmNMDMkj6AipPEgY52sXmPI 1I6SdDFyVBKr6lDawNHVUqlOWSQY/Y4XSAhN4oXjlT1zjvnCWesO2okTt9uc4QHXGBYDhyQWbP1Wm WI5zCyivlYXqjXHrDvKSAYBSRH+472n2FsOcoa/b+/F6pO1w9LLUHCT329ChWtQsMZ2VGV/YW7E2A yP5uU6DbKQORJR0fVvTQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwgqi-002NzA-If; Thu, 02 Jun 2022 09:10:36 +0000 Received: from mx07-00178001.pphosted.com ([185.132.182.106]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nwgqf-002Nxf-1P for linux-arm-kernel@lists.infradead.org; Thu, 02 Jun 2022 09:10:34 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2527sS2D005071; Thu, 2 Jun 2022 11:10:28 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=selector1; bh=VWQ7tzWGog3nAEbIjFtGWXl2yPJ82VtZopPyXWeTyP0=; b=3/wjKDMJo8/cKibkYsADL2XjFchNSGQabCLOzCCKoPEa3oqxgRXI19Xzs8tyNC8s7YbB wyWKAaEoxFsVu2u6/pBTgnSsMynHMFfTxEgsHuiZf3qROUh/IVyiAHZns9AoN+jqJGSV GdoTDCVWBDGVou3NfmdkOpg4/SAEm9FnCPhsXe04kp6RUzIPJJJoKO81sBFgFB2JCWwQ TK1jJyVEWIYu91PyInAQ1d+fSFx8zytPPqQfJBae3v/wl6XT0n/QASdtX7Gn7RX3cZik XMmlTr0THvhMgVo2fqgbrypWYyCjzzQYX+9u31yZxv4uJAwizdhZgWYqbhPBN7TQVzud 0g== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com (PPS) with ESMTPS id 3gbc50xgqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 Jun 2022 11:10:28 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id C9B8510002A; Thu, 2 Jun 2022 11:10:27 +0200 (CEST) Received: from Webmail-eu.st.com (shfdag1node1.st.com [10.75.129.69]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id BF8A02171D3; Thu, 2 Jun 2022 11:10:27 +0200 (CEST) Received: from localhost (10.75.127.51) by SHFDAG1NODE1.st.com (10.75.129.69) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2308.20; Thu, 2 Jun 2022 11:10:27 +0200 From: To: Mark Brown , Alexandre Torgue CC: , , , , , Subject: [PATCH 1/1] spi: spi-mem: Fix spi_mem_poll_status() Date: Thu, 2 Jun 2022 11:10:22 +0200 Message-ID: <20220602091022.358127-1-patrice.chotard@foss.st.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Originating-IP: [10.75.127.51] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SHFDAG1NODE1.st.com (10.75.129.69) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.874,Hydra:6.0.517,FMLib:17.11.64.514 definitions=2022-06-02_01,2022-06-01_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220602_021033_421878_393F50F9 X-CRM114-Status: GOOD ( 16.08 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Patrice Chotard In spi_mem_exec_op(), in case cs_gpiod descriptor is set, exec_op() callback can't be used. The same must be applied in spi_mem_poll_status(), poll_status() callback can't be used, we must use the legacy path using read_poll_timeout(). Tested on STM32mp257c-ev1 specific evaluation board on which a spi-nand was mounted instead of a spi-nor. Signed-off-by: Patrice Chotard Tested-by: Patrice Chotard --- drivers/spi/spi-mem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c index e8de4f5017cd..0c79193d9697 100644 --- a/drivers/spi/spi-mem.c +++ b/drivers/spi/spi-mem.c @@ -808,7 +808,7 @@ int spi_mem_poll_status(struct spi_mem *mem, op->data.dir != SPI_MEM_DATA_IN) return -EINVAL; - if (ctlr->mem_ops && ctlr->mem_ops->poll_status) { + if (ctlr->mem_ops && ctlr->mem_ops->poll_status && !mem->spi->cs_gpiod) { ret = spi_mem_access_start(mem); if (ret) return ret;