]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2024 12:34:32 +0000 (14:34 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jul 2024 12:34:32 +0000 (14:34 +0200)
added patches:
mmc-sdhci-pci-convert-pcibios_-return-codes-to-errnos.patch

queue-4.19/mmc-sdhci-pci-convert-pcibios_-return-codes-to-errnos.patch [new file with mode: 0644]
queue-4.19/series

diff --git a/queue-4.19/mmc-sdhci-pci-convert-pcibios_-return-codes-to-errnos.patch b/queue-4.19/mmc-sdhci-pci-convert-pcibios_-return-codes-to-errnos.patch
new file mode 100644 (file)
index 0000000..791b5c1
--- /dev/null
@@ -0,0 +1,74 @@
+From ebc4fc34eae8ddfbef49f2bdaced1bf4167ef80d Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>
+Date: Mon, 27 May 2024 16:24:41 +0300
+Subject: mmc: sdhci-pci: Convert PCIBIOS_* return codes to errnos
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+
+commit ebc4fc34eae8ddfbef49f2bdaced1bf4167ef80d upstream.
+
+jmicron_pmos() and sdhci_pci_probe() use pci_{read,write}_config_byte()
+that return PCIBIOS_* codes. The return code is then returned as is by
+jmicron_probe() and sdhci_pci_probe(). Similarly, the return code is
+also returned as is from jmicron_resume(). Both probe and resume
+functions should return normal errnos.
+
+Convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal
+errno before returning them the fix these issues.
+
+Fixes: 7582041ff3d4 ("mmc: sdhci-pci: fix simple_return.cocci warnings")
+Fixes: 45211e215984 ("sdhci: toggle JMicron PMOS setting")
+Cc: stable@vger.kernel.org
+Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: https://lore.kernel.org/r/20240527132443.14038-1-ilpo.jarvinen@linux.intel.com
+Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/mmc/host/sdhci-pci-core.c |   11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/drivers/mmc/host/sdhci-pci-core.c
++++ b/drivers/mmc/host/sdhci-pci-core.c
+@@ -1103,7 +1103,7 @@ static int jmicron_pmos(struct sdhci_pci
+       ret = pci_read_config_byte(chip->pdev, 0xAE, &scratch);
+       if (ret)
+-              return ret;
++              goto fail;
+       /*
+        * Turn PMOS on [bit 0], set over current detection to 2.4 V
+@@ -1114,7 +1114,10 @@ static int jmicron_pmos(struct sdhci_pci
+       else
+               scratch &= ~0x47;
+-      return pci_write_config_byte(chip->pdev, 0xAE, scratch);
++      ret = pci_write_config_byte(chip->pdev, 0xAE, scratch);
++
++fail:
++      return pcibios_err_to_errno(ret);
+ }
+ static int jmicron_probe(struct sdhci_pci_chip *chip)
+@@ -1986,7 +1989,7 @@ static int sdhci_pci_probe(struct pci_de
+       ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &slots);
+       if (ret)
+-              return ret;
++              return pcibios_err_to_errno(ret);
+       slots = PCI_SLOT_INFO_SLOTS(slots) + 1;
+       dev_dbg(&pdev->dev, "found %d slot(s)\n", slots);
+@@ -1997,7 +2000,7 @@ static int sdhci_pci_probe(struct pci_de
+       ret = pci_read_config_byte(pdev, PCI_SLOT_INFO, &first_bar);
+       if (ret)
+-              return ret;
++              return pcibios_err_to_errno(ret);
+       first_bar &= PCI_SLOT_INFO_FIRST_BAR_MASK;
index 6b63162032b4bb08dcc32e79e1acca92f8951e88..b3b9da47548846cd3db655e7b226f2e515958b8a 100644 (file)
@@ -126,3 +126,4 @@ gpio-davinci-validate-the-obtained-number-of-irqs.patch
 i2c-ocores-stop-transfer-on-timeout.patch
 i2c-ocores-set-iack-bit-after-core-is-enabled.patch
 x86-stop-playing-stack-games-in-profile_pc.patch
+mmc-sdhci-pci-convert-pcibios_-return-codes-to-errnos.patch