From patchwork Fri Mar 4 13:51:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Gautier X-Patchwork-Id: 12769149 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 CD38CC433F5 for ; Fri, 4 Mar 2022 13:53:46 +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=pEOOax6Y/C1mS0FhKhdwyzj59pNzucCEtDAEAfE5jiA=; b=0ILb8dr3yBXk8+ 1OzwYmSmiSfJ1CNOieRuISlZdcIOsvy48rdpKTMBqRBl+YHc966U6SZ1vTR0yzFC+yt3LEHa9HiE9 /gypsUT804sZtVtUeAnyhvx0rusg5m+WYJeyrAC9sgFi0zhimmNx9srT3mCftRoZ0S23g40SYabCZ vrnMuX2Nyc/EbOSqPFzNJptnpbLpQXgtnNNyaeu7eTFXr87eFUnjwm4U5h7GGkw8ekYw4ZjqFSO/2 LoGuqpzxCklA04VID3Xp4nBorTXV3Wq/OwWRUgNmkoT8UwcD+MEEyIgh5bizV2sEFoIzX2a966UOe 3UH68T6GQX7tGfxBzCbA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ8M9-00AKzH-Hn; Fri, 04 Mar 2022 13:52:29 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ8M4-00AKx1-EH for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 13:52:27 +0000 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 224BsWNn027044; Fri, 4 Mar 2022 14:51:47 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=yG2HlQUVVcKdPHhJLDBcI8iIPMmmChs9y0unwzPfcW8=; b=KZ4DoPUyPhrUbK8Ynakguzw0ymd9Ak+sX7T+7rL5n2Ikf976kGd5CtfAcST2e9tmTdj6 DkP912YQg4M18Dj6Kl7zt28ySFDolR+PkiLn8C9EGxmBJL9zOoaFcn7DZ8Ak3LIXN7P7 D8LamAgQ4Gh18If+mDqJsy6Nst8bF8VESFVPMf/RVxV1RotgMnVaxOfK/LlwvNEu7CLT tkTogtL0uFq3N4V8mzKJdR2tcPNa0kpEW9yEegkV5oBFK5pNDmdO5j4HEYmAyBjgHnHZ ynJDlodPs7N1y5WcLZjn9ADQo5Mh0Ka5ErelWHgcknfcbILnZ86AOkGRKfi1qmAZ92Xz 0Q== 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 3ek4jxd557-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Mar 2022 14:51:47 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7A038100034; Fri, 4 Mar 2022 14:51:43 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 7067E2278B6; Fri, 4 Mar 2022 14:51:43 +0100 (CET) Received: from localhost (10.75.127.47) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Fri, 4 Mar 2022 14:51:42 +0100 From: Yann Gautier To: Rob Herring , Ulf Hansson CC: , , , , , Alexandre Torgue , Christophe Kerello , Linus Walleij , Ludovic Barre , Maxime Coquelin , Philipp Zabel , Russell King , Marek Vasut , , Manivannan Sadhasivam , Grzegorz Szymaszek , Yann Gautier Subject: [PATCH 1/3] dt-bindings: mmc: mmci: add a property to disable DMA LLI Date: Fri, 4 Mar 2022 14:51:32 +0100 Message-ID: <20220304135134.47827-2-yann.gautier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304135134.47827-1-yann.gautier@foss.st.com> References: <20220304135134.47827-1-yann.gautier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-04_06,2022-03-04_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_055225_261042_EE41975C X-CRM114-Status: GOOD ( 17.48 ) 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 On STMicroelectronics variant of PL18x, the DMA Linked Lists are supported starting from revision v2 of the peripheral. But it has limitations, as all the buffers should be aligned on block size (except the last one). But this cannot be guaranteed with SDIO. We should then have a property to disable the support of LLI. Signed-off-by: Yann Gautier --- Documentation/devicetree/bindings/mmc/arm,pl18x.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/mmc/arm,pl18x.yaml b/Documentation/devicetree/bindings/mmc/arm,pl18x.yaml index 1e69a5a42439..309a2c0426e5 100644 --- a/Documentation/devicetree/bindings/mmc/arm,pl18x.yaml +++ b/Documentation/devicetree/bindings/mmc/arm,pl18x.yaml @@ -145,6 +145,11 @@ properties: driver to sample the receive data (for example with a voltage switch transceiver). + st,disable-dma-lli: + $ref: /schemas/types.yaml#/definitions/flag + description: ST Micro-specific property, disable DMA linked lists. + It is used for SDIO. + st,cmd-gpios: maxItems: 1 description: From patchwork Fri Mar 4 13:51:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Gautier X-Patchwork-Id: 12769152 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 6D81AC433F5 for ; Fri, 4 Mar 2022 13:54:06 +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=RZDRig7emR+QMQFAbNo96xgVFkflVwSTCE83ypa93s8=; b=VYDDB9Np7j2bUB WOOktuR6AUFyCJBEI+keJwr1kF4H3luRhY3EOe9cdYAaq/necMr6GQSsWSCcGYyIb+L4XYkHM3Anj 34Gsxzj7qqdXQQ1zulfSIe27WOiVsKXMQPogaiEuzhAMa63quiS6B5n3dvCoEEGEVg/c5W7HrIuiC kmnP2c96c4t4Ex+EvIs8IJRU5mmoiSFkgSwufOz8St2mrC8D6B5tPaYlXbDUvvdUIyOs2jBv+Vnl5 jlfzzclpf4gaMhNvhNyEbFGT3PYmjl28PNNakzLnb/uGo8dlnWrw5xpuZoW7eHNoV1Z3e8OI87951 eNikQCfGDXffawv0CQ8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ8Mc-00AL7D-K9; Fri, 04 Mar 2022 13:52:58 +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 1nQ8M6-00AKxE-Hb for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 13:52:28 +0000 Received: from pps.filterd (m0241204.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 224Bde9n009228; Fri, 4 Mar 2022 14:51:50 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=E9lwcKG1DlBq5u4AWYgkseFeV+BKpDz1KA6ijNiJ/GE=; b=s8yJpi+vIXOIhJCSOrLHc0WYyFDgBCMNZ+6NWlWMMymzV/cEgPP/ZKATKe/feTFzDxPi Nv+wrA4mPQ3vBekwNmtXnEE02i+N6XixdPxFbRvSv39/TkF3snEFg0N0HzG9I01U3KTk za1he2ioFpWdfwZSz7c2yBGx1thBSgVgbnJFPXte3V2EZerhtofWbfF/yNqX0u9Jdxet ojg+Zuk0qPxr8p/JrFH+eo3Sirvsgs5k6t/Ryt9Eet1rwSdm7oU29R+/ZwPha3fQI//f Nf5HiaQi3j/Uludd9uIOyCHqHsoaBQXtwTN6lm/++LuauSvSUEx7LKTWU0TAMTWMmmBM Nw== 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 3ek4jgn288-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Mar 2022 14:51:50 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D4AC4100039; Fri, 4 Mar 2022 14:51:44 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 747AC2291C3; Fri, 4 Mar 2022 14:51:44 +0100 (CET) Received: from localhost (10.75.127.47) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Fri, 4 Mar 2022 14:51:43 +0100 From: Yann Gautier To: Rob Herring , Ulf Hansson CC: , , , , , Alexandre Torgue , Christophe Kerello , Linus Walleij , Ludovic Barre , Maxime Coquelin , Philipp Zabel , Russell King , Marek Vasut , , Manivannan Sadhasivam , Grzegorz Szymaszek , Yann Gautier Subject: [PATCH 2/3] mmc: mmci: stm32: manage st,disable-dma-lli property Date: Fri, 4 Mar 2022 14:51:33 +0100 Message-ID: <20220304135134.47827-3-yann.gautier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304135134.47827-1-yann.gautier@foss.st.com> References: <20220304135134.47827-1-yann.gautier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.47] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-04_06,2022-03-04_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_055226_924933_6A3A292E X-CRM114-Status: GOOD ( 20.75 ) 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 This property is used to disable DMA LLI for an SDMMC instance. We cannot directly modify the variant struct as it will affect all MMC instances. The parameter is then copied in the struct sdmmc_idma, and force to 0 if the st,disable-dma-lli property is set in DT. Signed-off-by: Yann Gautier --- drivers/mmc/host/mmci_stm32_sdmmc.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/mmci_stm32_sdmmc.c b/drivers/mmc/host/mmci_stm32_sdmmc.c index 9c13f2c31365..02cb0929c465 100644 --- a/drivers/mmc/host/mmci_stm32_sdmmc.c +++ b/drivers/mmc/host/mmci_stm32_sdmmc.c @@ -43,6 +43,7 @@ struct sdmmc_lli_desc { struct sdmmc_idma { dma_addr_t sg_dma; void *sg_cpu; + u8 dma_lli:1; }; struct sdmmc_dlyb { @@ -118,6 +119,7 @@ static void sdmmc_idma_unprep_data(struct mmci_host *host, static int sdmmc_idma_setup(struct mmci_host *host) { + struct device_node *np = host->mmc->parent->of_node; struct sdmmc_idma *idma; struct device *dev = mmc_dev(host->mmc); @@ -125,9 +127,13 @@ static int sdmmc_idma_setup(struct mmci_host *host) if (!idma) return -ENOMEM; + idma->dma_lli = host->variant->dma_lli; + if (of_get_property(np, "st,disable-dma-lli", NULL)) + idma->dma_lli = 0; + host->dma_priv = idma; - if (host->variant->dma_lli) { + if (idma->dma_lli) { idma->sg_cpu = dmam_alloc_coherent(dev, SDMMC_LLI_BUF_LEN, &idma->sg_dma, GFP_KERNEL); if (!idma->sg_cpu) { @@ -154,7 +160,7 @@ static int sdmmc_idma_start(struct mmci_host *host, unsigned int *datactrl) struct scatterlist *sg; int i; - if (!host->variant->dma_lli || data->sg_len == 1) { + if (!idma->dma_lli || data->sg_len == 1) { writel_relaxed(sg_dma_address(data->sg), host->base + MMCI_STM32_IDMABASE0R); writel_relaxed(MMCI_STM32_IDMAEN, From patchwork Fri Mar 4 13:51:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Gautier X-Patchwork-Id: 12769151 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 B3D06C433F5 for ; Fri, 4 Mar 2022 13:53:58 +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=aFBmjIlQFjcD5KohyYUm1dTjLhIkM6EErfY+UOyMQKI=; b=Ki5ISelUZKnjs2 wOANj+XmGpztMflvr/KkKrA8rBGVSi8BQRUm+qXjGrZ3/YZ4rZFfAwwGC87xWIBSgV4rURJWhkOXE ngxKQaJbx+0+BlvvRKgO/cgn7g7sadScPDrZEYHyLXQXPwj4edAh9ZVatf/z1M82opS1842noFgGA 1VjL4YlXyEFevk6MOFLA15Q43m6dnNdAetn747StN8sxwDIX0QqxjurkXq0FnXT1BNAoe7mMDMHxW UMzNz6lvEYeoQI3DW7s/08iioC62dfBZGWu2gFtzb/hwJrJenHqzuN6DmRticsCcWk5XvS5IIXTNA J8F6J+xlvJEAyJSJnN5A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ8MS-00AL2v-DS; Fri, 04 Mar 2022 13:52:48 +0000 Received: from mx08-00178001.pphosted.com ([91.207.212.93] helo=mx07-00178001.pphosted.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nQ8M5-00AKxA-PI for linux-arm-kernel@lists.infradead.org; Fri, 04 Mar 2022 13:52:28 +0000 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.1.2/8.16.1.2) with ESMTP id 224BrQTP011332; Fri, 4 Mar 2022 14:51:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foss.st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=selector1; bh=tbU0qOc6Ayx6hnhXQ94zwIDGkMujBZbQs9NbPVdBY5A=; b=xTD9vKiQCmfnFprZmglcB5VgO+UPllnPsraMHR7AjH/CQpzG459UvGxKnuppKF7l3phZ O5DrbC4o7iq/H/OHufsZQu25IFcemolPNTOK+y3iprzO4ek4r7m0kqOFSGZX5XYIjjAb AX4jJbPI9lpjQs0I9JEGu1LeMT3IddwRABqkJiMVBVNhnUCaUsnMQigYTy17CP/Mlvcr 1Go75TThmKHtS8jbmBRCVHJhmQjNMkx2rsHpujwkyYwZFISvdr/Y9kOshHoV/T8Jpp+v bGKh0kpEr7M1rx8PZ/g7guIEhZNtXz8V0waxHONJL24IYvNfBmpwj3GIza4raQAvZgi/ zQ== 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 3ek4k5d52b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Mar 2022 14:51:49 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 59220100038; Fri, 4 Mar 2022 14:51:45 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag2node2.st.com [10.75.127.5]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 2741C2291CC; Fri, 4 Mar 2022 14:51:45 +0100 (CET) Received: from localhost (10.75.127.45) by SFHDAG2NODE2.st.com (10.75.127.5) with Microsoft SMTP Server (TLS) id 15.0.1497.26; Fri, 4 Mar 2022 14:51:44 +0100 From: Yann Gautier To: Rob Herring , Ulf Hansson CC: , , , , , Alexandre Torgue , Christophe Kerello , Linus Walleij , Ludovic Barre , Maxime Coquelin , Philipp Zabel , Russell King , Marek Vasut , , Manivannan Sadhasivam , Grzegorz Szymaszek , Yann Gautier Subject: [PATCH 3/3] mmc: mmci: manage MMC_PM_KEEP_POWER per variant config Date: Fri, 4 Mar 2022 14:51:34 +0100 Message-ID: <20220304135134.47827-4-yann.gautier@foss.st.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220304135134.47827-1-yann.gautier@foss.st.com> References: <20220304135134.47827-1-yann.gautier@foss.st.com> MIME-Version: 1.0 X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG2NODE2.st.com (10.75.127.5) To SFHDAG2NODE2.st.com (10.75.127.5) X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-04_06,2022-03-04_01,2022-02-23_01 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220304_055226_147232_25C51FCC X-CRM114-Status: GOOD ( 21.11 ) 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 Add a disable_keep_power field in variant_data struct. The MMC_PM_KEEP_POWER flag will be enabled if disable_keep_power is not set. It is only set to true for stm32_sdmmc variants. The issue was seen on STM32MP157C-DK2 board, which embeds a wifi chip. It doesn't correctly support low power, and we need to unbind the wifi driver before a suspend sequence. But the wifi chip firmware is then lost, and the communication with SDIO fails if MMC_PM_KEEP_POWER is enabled. The flag can still be enabled through DT property: keep-power-in-suspend. Signed-off-by: Yann Gautier --- drivers/mmc/host/mmci.c | 5 ++++- drivers/mmc/host/mmci.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index 45b8608c935c..0e2f2f5d6a52 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -274,6 +274,7 @@ static struct variant_data variant_stm32_sdmmc = { .busy_detect = true, .busy_detect_flag = MCI_STM32_BUSYD0, .busy_detect_mask = MCI_STM32_BUSYD0ENDMASK, + .disable_keep_power = true, .init = sdmmc_variant_init, }; @@ -301,6 +302,7 @@ static struct variant_data variant_stm32_sdmmcv2 = { .busy_detect = true, .busy_detect_flag = MCI_STM32_BUSYD0, .busy_detect_mask = MCI_STM32_BUSYD0ENDMASK, + .disable_keep_power = true, .init = sdmmc_variant_init, }; @@ -2172,7 +2174,8 @@ static int mmci_probe(struct amba_device *dev, host->stop_abort.flags = MMC_RSP_R1B | MMC_CMD_AC; /* We support these PM capabilities. */ - mmc->pm_caps |= MMC_PM_KEEP_POWER; + if (!variant->disable_keep_power) + mmc->pm_caps |= MMC_PM_KEEP_POWER; /* * We can do SGIO diff --git a/drivers/mmc/host/mmci.h b/drivers/mmc/host/mmci.h index e1a9b96a3396..2cad1ef9766a 100644 --- a/drivers/mmc/host/mmci.h +++ b/drivers/mmc/host/mmci.h @@ -361,6 +361,7 @@ struct variant_data { u32 opendrain; u8 dma_lli:1; u32 stm32_idmabsize_mask; + u8 disable_keep_power:1; void (*init)(struct mmci_host *host); };