linux-mmc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers
@ 2023-06-08 19:45 Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 01/12] mmc: bcm2835: fix deferred probing Sergey Shtylyov
                   ` (12 more replies)
  0 siblings, 13 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc

Here are 12 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
The affected MMC/SD drivers call platform_get_irq[_byname]() but override its
result in case of error which prevents the deferred probing from working. Some
of these patches logically depend on commit ce753ad1549c ("platform: finally
disallow IRQ0 in platform_get_irq() and its ilk")...

Sergey Shtylyov (12):
  mmc: bcm2835: fix deferred probing
  mmc: meson-gx: fix deferred probing
  mmc: mtk-sd: fix deferred probing
  mmc: mvsdio: fix deferred probing
  mmc: omap: fix deferred probing
  mmc: omap_hsmmc: fix deferred probing
  mmc: owl: fix deferred probing
  mmc: sdhci-acpi: fix deferred probing
  mmc: sdhci-spear: fix deferred probing
  mmc: sh_mmcif: fix deferred probing
  mmc: sunxi: fix deferred probing
  mmc: usdhi60rol0: fix deferred probing

 drivers/mmc/host/bcm2835.c      | 4 ++--
 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 drivers/mmc/host/mtk-sd.c       | 2 +-
 drivers/mmc/host/mvsdio.c       | 2 +-
 drivers/mmc/host/omap.c         | 2 +-
 drivers/mmc/host/omap_hsmmc.c   | 6 ++++--
 drivers/mmc/host/owl-mmc.c      | 2 +-
 drivers/mmc/host/sdhci-acpi.c   | 2 +-
 drivers/mmc/host/sdhci-spear.c  | 4 ++--
 drivers/mmc/host/sh_mmcif.c     | 2 +-
 drivers/mmc/host/sunxi-mmc.c    | 4 ++--
 drivers/mmc/host/usdhi6rol0.c   | 6 ++++--
 12 files changed, 22 insertions(+), 18 deletions(-)

-- 
2.26.3


^ permalink raw reply	[flat|nested] 26+ messages in thread

* [PATCH v2 01/12] mmc: bcm2835: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 21:39   ` Stefan Wahren
  2023-06-08 19:45 ` [PATCH v2 02/12] mmc: meson-gx: " Sergey Shtylyov
                   ` (11 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the error
codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
can safely ignore it...

Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch;
- slightly reformatted the patch description.

 drivers/mmc/host/bcm2835.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
index 8648f7e63ca1..eea208856ce0 100644
--- a/drivers/mmc/host/bcm2835.c
+++ b/drivers/mmc/host/bcm2835.c
@@ -1403,8 +1403,8 @@ static int bcm2835_probe(struct platform_device *pdev)
 	host->max_clk = clk_get_rate(clk);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq <= 0) {
-		ret = -EINVAL;
+	if (host->irq < 0) {
+		ret = host->irq;
 		goto err;
 	}
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 02/12] mmc: meson-gx: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 01/12] mmc: bcm2835: fix deferred probing Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-09  7:20   ` Neil Armstrong
  2023-06-08 19:45 ` [PATCH v2 03/12] mmc: mtk-sd: " Sergey Shtylyov
                   ` (10 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Neil Armstrong, Kevin Hilman, Jerome Brunet, Martin Blumenstingl,
	linux-amlogic, linux-arm-kernel

The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the error
codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
can safely ignore it...

Fixes: cbcaac6d7dd2 ("mmc: meson-gx-mmc: Fix platform_get_irq's error checking")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- updated the fix due to the surrounding code change;
- refreshed the patch;
- removed stray newline in the Fixes: tag;
- slightly reformatted the patch description.

 drivers/mmc/host/meson-gx-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
index b8514d9d5e73..75f97dce7ef3 100644
--- a/drivers/mmc/host/meson-gx-mmc.c
+++ b/drivers/mmc/host/meson-gx-mmc.c
@@ -1192,8 +1192,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
 		return PTR_ERR(host->regs);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq <= 0)
-		return -EINVAL;
+	if (host->irq < 0)
+		return host->irq;
 
 	cd_irq = platform_get_irq_optional(pdev, 1);
 	mmc_gpio_set_cd_irq(mmc, cd_irq);
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 03/12] mmc: mtk-sd: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 01/12] mmc: bcm2835: fix deferred probing Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 02/12] mmc: meson-gx: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 04/12] mmc: mvsdio: " Sergey Shtylyov
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Chaotian Jing, Matthias Brugger, AngeloGioacchino Del Regno,
	linux-arm-kernel, linux-mediatek, linux-kernel

The driver overrides the error codes returned by platform_get_irq() to
-EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 208489032bdd ("mmc: mediatek: Add Mediatek MMC driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch.

 drivers/mmc/host/mtk-sd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index edade0e54a0c..9785ec91654f 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -2680,7 +2680,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
 
 	host->irq = platform_get_irq(pdev, 0);
 	if (host->irq < 0) {
-		ret = -EINVAL;
+		ret = host->irq;
 		goto host_free;
 	}
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 04/12] mmc: mvsdio: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (2 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 03/12] mmc: mtk-sd: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 05/12] mmc: omap: " Sergey Shtylyov
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Nicolas Pitre

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
 drivers/mmc/host/mvsdio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/mvsdio.c b/drivers/mmc/host/mvsdio.c
index 629efbe639c4..b4f6a0a2fcb5 100644
--- a/drivers/mmc/host/mvsdio.c
+++ b/drivers/mmc/host/mvsdio.c
@@ -704,7 +704,7 @@ static int mvsd_probe(struct platform_device *pdev)
 	}
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
-		return -ENXIO;
+		return irq;
 
 	mmc = mmc_alloc_host(sizeof(struct mvsd_host), &pdev->dev);
 	if (!mmc) {
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 05/12] mmc: omap: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (3 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 04/12] mmc: mvsdio: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 06/12] mmc: omap_hsmmc: " Sergey Shtylyov
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Aaro Koskinen, linux-omap

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- updated the fix due to the surrounding code change.

 drivers/mmc/host/omap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index ce78edfb402b..86454f1182bb 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -1343,7 +1343,7 @@ static int mmc_omap_probe(struct platform_device *pdev)
 
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
-		return -ENXIO;
+		return irq;
 
 	host->virt_base = devm_platform_get_and_ioremap_resource(pdev, 0, &res);
 	if (IS_ERR(host->virt_base))
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 06/12] mmc: omap_hsmmc: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (4 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 05/12] mmc: omap: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 07/12] mmc: owl: " Sergey Shtylyov
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: linux-omap

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch.

 drivers/mmc/host/omap_hsmmc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 517dde777413..1e0f2d7774bd 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1791,9 +1791,11 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	irq = platform_get_irq(pdev, 0);
-	if (res == NULL || irq < 0)
+	if (!res)
 		return -ENXIO;
+	irq = platform_get_irq(pdev, 0);
+	if (irq < 0)
+		return irq;
 
 	base = devm_ioremap_resource(&pdev->dev, res);
 	if (IS_ERR(base))
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 07/12] mmc: owl: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (5 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 06/12] mmc: omap_hsmmc: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 08/12] mmc: sdhci-acpi: " Sergey Shtylyov
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Andreas Färber, Manivannan Sadhasivam, linux-actions,
	linux-arm-kernel

The driver overrides the error codes returned by platform_get_irq() to
-EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: ff65ffe46d28 ("mmc: Add Actions Semi Owl SoCs SD/MMC driver")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch.

 drivers/mmc/host/owl-mmc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/owl-mmc.c b/drivers/mmc/host/owl-mmc.c
index 6f9d31a886ba..1bf22b08b373 100644
--- a/drivers/mmc/host/owl-mmc.c
+++ b/drivers/mmc/host/owl-mmc.c
@@ -637,7 +637,7 @@ static int owl_mmc_probe(struct platform_device *pdev)
 
 	owl_host->irq = platform_get_irq(pdev, 0);
 	if (owl_host->irq < 0) {
-		ret = -EINVAL;
+		ret = owl_host->irq;
 		goto err_release_channel;
 	}
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 08/12] mmc: sdhci-acpi: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (6 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 07/12] mmc: owl: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-09  5:43   ` Adrian Hunter
  2023-06-08 19:45 ` [PATCH v2 09/12] mmc: sdhci-spear: " Sergey Shtylyov
                   ` (4 subsequent siblings)
  12 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Adrian Hunter

The driver overrides the error codes returned by platform_get_irq() to
-EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 1b7ba57ecc86 ("mmc: sdhci-acpi: Handle return value of platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch.

 drivers/mmc/host/sdhci-acpi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
index 8f0e639236b1..edf2e6c14dc6 100644
--- a/drivers/mmc/host/sdhci-acpi.c
+++ b/drivers/mmc/host/sdhci-acpi.c
@@ -829,7 +829,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
 	host->ops	= &sdhci_acpi_ops_dflt;
 	host->irq	= platform_get_irq(pdev, 0);
 	if (host->irq < 0) {
-		err = -EINVAL;
+		err = host->irq;
 		goto err_free;
 	}
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 09/12] mmc: sdhci-spear: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (7 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 08/12] mmc: sdhci-acpi: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-09  4:40   ` Viresh Kumar
  2023-06-09  5:44   ` Adrian Hunter
  2023-06-08 19:45 ` [PATCH v2 10/12] mmc: sh_mmcif: " Sergey Shtylyov
                   ` (3 subsequent siblings)
  12 siblings, 2 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Adrian Hunter, Viresh Kumar

The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the error
codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
can safely ignore it...

Fixes: 682798a596a6 ("mmc: sdhci-spear: Handle return value of platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- slightly reformatted the patch description.

 drivers/mmc/host/sdhci-spear.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
index d463e2fd5b1a..c79035727b20 100644
--- a/drivers/mmc/host/sdhci-spear.c
+++ b/drivers/mmc/host/sdhci-spear.c
@@ -65,8 +65,8 @@ static int sdhci_probe(struct platform_device *pdev)
 	host->hw_name = "sdhci";
 	host->ops = &sdhci_pltfm_ops;
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq <= 0) {
-		ret = -EINVAL;
+	if (host->irq < 0) {
+		ret = host->irq;
 		goto err_host;
 	}
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 10/12] mmc: sh_mmcif: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (8 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 09/12] mmc: sdhci-spear: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-08 19:45 ` [PATCH v2 11/12] mmc: sunxi: " Sergey Shtylyov
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc

The driver overrides the error codes returned by platform_get_irq() to
-ENXIO, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the
error codes upstream.

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- refreshed the patch.

 drivers/mmc/host/sh_mmcif.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/host/sh_mmcif.c b/drivers/mmc/host/sh_mmcif.c
index 0fd4c9d644dd..5cf53348372a 100644
--- a/drivers/mmc/host/sh_mmcif.c
+++ b/drivers/mmc/host/sh_mmcif.c
@@ -1400,7 +1400,7 @@ static int sh_mmcif_probe(struct platform_device *pdev)
 	irq[0] = platform_get_irq(pdev, 0);
 	irq[1] = platform_get_irq_optional(pdev, 1);
 	if (irq[0] < 0)
-		return -ENXIO;
+		return irq[0];
 
 	reg = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(reg))
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 11/12] mmc: sunxi: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (9 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 10/12] mmc: sh_mmcif: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-09 20:48   ` Jernej Škrabec
  2023-06-08 19:45 ` [PATCH v2 12/12] mmc: usdhi60rol0: " Sergey Shtylyov
  2023-06-12 14:16 ` [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Ulf Hansson
  12 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc
  Cc: Chen-Yu Tsai, Jernej Skrabec, Samuel Holland, linux-arm-kernel,
	linux-sunxi

The driver overrides the error codes and IRQ0 returned by platform_get_irq()
to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing. Switch to propagating the error
codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
can safely ignore it...

Fixes: 2408a08583d ("mmc: sunxi-mmc: Handle return value of platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- slightly reformatted the patch description.

 drivers/mmc/host/sunxi-mmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sunxi-mmc.c b/drivers/mmc/host/sunxi-mmc.c
index 3db9f32d6a7b..69dcb8805e05 100644
--- a/drivers/mmc/host/sunxi-mmc.c
+++ b/drivers/mmc/host/sunxi-mmc.c
@@ -1350,8 +1350,8 @@ static int sunxi_mmc_resource_request(struct sunxi_mmc_host *host,
 		return ret;
 
 	host->irq = platform_get_irq(pdev, 0);
-	if (host->irq <= 0) {
-		ret = -EINVAL;
+	if (host->irq < 0) {
+		ret = host->irq;
 		goto error_disable_mmc;
 	}
 
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* [PATCH v2 12/12] mmc: usdhi60rol0: fix deferred probing
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (10 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 11/12] mmc: sunxi: " Sergey Shtylyov
@ 2023-06-08 19:45 ` Sergey Shtylyov
  2023-06-12 14:16 ` [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Ulf Hansson
  12 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-08 19:45 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc; +Cc: Jesper Nilsson, Lars Persson, linux-arm-kernel

The driver overrides the error codes returned by platform_get_irq_byname()
to -ENODEV, so if it returns -EPROBE_DEFER, the driver will fail the probe
permanently instead of the deferred probing.  Switch to propagating error
codes upstream.

Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq")
Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
---
Changes in version 2:
- fixed up the function name in the patch description and reformatted it.

 drivers/mmc/host/usdhi6rol0.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/usdhi6rol0.c b/drivers/mmc/host/usdhi6rol0.c
index 2f59917b105e..2e17903658fc 100644
--- a/drivers/mmc/host/usdhi6rol0.c
+++ b/drivers/mmc/host/usdhi6rol0.c
@@ -1757,8 +1757,10 @@ static int usdhi6_probe(struct platform_device *pdev)
 	irq_cd = platform_get_irq_byname(pdev, "card detect");
 	irq_sd = platform_get_irq_byname(pdev, "data");
 	irq_sdio = platform_get_irq_byname(pdev, "SDIO");
-	if (irq_sd < 0 || irq_sdio < 0)
-		return -ENODEV;
+	if (irq_sd < 0)
+		return irq_sd;
+	if (irq_sdio < 0)
+		return irq_sdio;
 
 	mmc = mmc_alloc_host(sizeof(struct usdhi6_host), dev);
 	if (!mmc)
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 01/12] mmc: bcm2835: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 01/12] mmc: bcm2835: fix deferred probing Sergey Shtylyov
@ 2023-06-08 21:39   ` Stefan Wahren
  2023-06-12 19:43     ` Sergey Shtylyov
  0 siblings, 1 reply; 26+ messages in thread
From: Stefan Wahren @ 2023-06-08 21:39 UTC (permalink / raw)
  To: Sergey Shtylyov, Ulf Hansson, linux-mmc
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

Hi Sergey,

was there a cover for this series, since the RFC series before had one?

Am 08.06.23 um 21:45 schrieb Sergey Shtylyov:
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the error
> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
> can safely ignore it...
> 
> Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")

I know this is very theoretical, but does the statement "IRQ0 is no 
longer returned by platform_get_irq()" also applies to the time of the 
fixes commit?

I'm asking because the fix could be backported to Linux 4.14.

Best regards

> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
> Changes in version 2:
> - refreshed the patch;
> - slightly reformatted the patch description.
> 
>   drivers/mmc/host/bcm2835.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/bcm2835.c b/drivers/mmc/host/bcm2835.c
> index 8648f7e63ca1..eea208856ce0 100644
> --- a/drivers/mmc/host/bcm2835.c
> +++ b/drivers/mmc/host/bcm2835.c
> @@ -1403,8 +1403,8 @@ static int bcm2835_probe(struct platform_device *pdev)
>   	host->max_clk = clk_get_rate(clk);
>   
>   	host->irq = platform_get_irq(pdev, 0);
> -	if (host->irq <= 0) {
> -		ret = -EINVAL;
> +	if (host->irq < 0) {
> +		ret = host->irq;
>   		goto err;
>   	}
>   

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 09/12] mmc: sdhci-spear: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 09/12] mmc: sdhci-spear: " Sergey Shtylyov
@ 2023-06-09  4:40   ` Viresh Kumar
  2023-06-09  5:44   ` Adrian Hunter
  1 sibling, 0 replies; 26+ messages in thread
From: Viresh Kumar @ 2023-06-09  4:40 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: Ulf Hansson, linux-mmc, Adrian Hunter, Viresh Kumar

On 08-06-23, 22:45, Sergey Shtylyov wrote:
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the error
> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
> can safely ignore it...
> 
> Fixes: 682798a596a6 ("mmc: sdhci-spear: Handle return value of platform_get_irq")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
> Changes in version 2:
> - slightly reformatted the patch description.
> 
>  drivers/mmc/host/sdhci-spear.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index d463e2fd5b1a..c79035727b20 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -65,8 +65,8 @@ static int sdhci_probe(struct platform_device *pdev)
>  	host->hw_name = "sdhci";
>  	host->ops = &sdhci_pltfm_ops;
>  	host->irq = platform_get_irq(pdev, 0);
> -	if (host->irq <= 0) {
> -		ret = -EINVAL;
> +	if (host->irq < 0) {
> +		ret = host->irq;
>  		goto err_host;
>  	}
>  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

-- 
viresh

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 08/12] mmc: sdhci-acpi: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 08/12] mmc: sdhci-acpi: " Sergey Shtylyov
@ 2023-06-09  5:43   ` Adrian Hunter
  0 siblings, 0 replies; 26+ messages in thread
From: Adrian Hunter @ 2023-06-09  5:43 UTC (permalink / raw)
  To: Sergey Shtylyov, linux-mmc, Ulf Hansson

On 8/06/23 22:45, Sergey Shtylyov wrote:
> The driver overrides the error codes returned by platform_get_irq() to
> -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the
> error codes upstream.
> 
> Fixes: 1b7ba57ecc86 ("mmc: sdhci-acpi: Handle return value of platform_get_irq")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> Changes in version 2:
> - refreshed the patch.
> 
>  drivers/mmc/host/sdhci-acpi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-acpi.c b/drivers/mmc/host/sdhci-acpi.c
> index 8f0e639236b1..edf2e6c14dc6 100644
> --- a/drivers/mmc/host/sdhci-acpi.c
> +++ b/drivers/mmc/host/sdhci-acpi.c
> @@ -829,7 +829,7 @@ static int sdhci_acpi_probe(struct platform_device *pdev)
>  	host->ops	= &sdhci_acpi_ops_dflt;
>  	host->irq	= platform_get_irq(pdev, 0);
>  	if (host->irq < 0) {
> -		err = -EINVAL;
> +		err = host->irq;
>  		goto err_free;
>  	}
>  


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 09/12] mmc: sdhci-spear: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 09/12] mmc: sdhci-spear: " Sergey Shtylyov
  2023-06-09  4:40   ` Viresh Kumar
@ 2023-06-09  5:44   ` Adrian Hunter
  1 sibling, 0 replies; 26+ messages in thread
From: Adrian Hunter @ 2023-06-09  5:44 UTC (permalink / raw)
  To: Sergey Shtylyov, Ulf Hansson, linux-mmc; +Cc: Viresh Kumar

On 8/06/23 22:45, Sergey Shtylyov wrote:
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the error
> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
> can safely ignore it...
> 
> Fixes: 682798a596a6 ("mmc: sdhci-spear: Handle return value of platform_get_irq")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Acked-by: Adrian Hunter <adrian.hunter@intel.com>

> ---
> Changes in version 2:
> - slightly reformatted the patch description.
> 
>  drivers/mmc/host/sdhci-spear.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci-spear.c b/drivers/mmc/host/sdhci-spear.c
> index d463e2fd5b1a..c79035727b20 100644
> --- a/drivers/mmc/host/sdhci-spear.c
> +++ b/drivers/mmc/host/sdhci-spear.c
> @@ -65,8 +65,8 @@ static int sdhci_probe(struct platform_device *pdev)
>  	host->hw_name = "sdhci";
>  	host->ops = &sdhci_pltfm_ops;
>  	host->irq = platform_get_irq(pdev, 0);
> -	if (host->irq <= 0) {
> -		ret = -EINVAL;
> +	if (host->irq < 0) {
> +		ret = host->irq;
>  		goto err_host;
>  	}
>  	host->quirks = SDHCI_QUIRK_BROKEN_ADMA;


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 02/12] mmc: meson-gx: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 02/12] mmc: meson-gx: " Sergey Shtylyov
@ 2023-06-09  7:20   ` Neil Armstrong
  0 siblings, 0 replies; 26+ messages in thread
From: Neil Armstrong @ 2023-06-09  7:20 UTC (permalink / raw)
  To: Sergey Shtylyov, Ulf Hansson, linux-mmc
  Cc: Kevin Hilman, Jerome Brunet, Martin Blumenstingl, linux-amlogic,
	linux-arm-kernel

On 08/06/2023 21:45, Sergey Shtylyov wrote:
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the error
> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
> can safely ignore it...
> 
> Fixes: cbcaac6d7dd2 ("mmc: meson-gx-mmc: Fix platform_get_irq's error checking")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> ---
> Changes in version 2:
> - updated the fix due to the surrounding code change;
> - refreshed the patch;
> - removed stray newline in the Fixes: tag;
> - slightly reformatted the patch description.
> 
>   drivers/mmc/host/meson-gx-mmc.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/meson-gx-mmc.c b/drivers/mmc/host/meson-gx-mmc.c
> index b8514d9d5e73..75f97dce7ef3 100644
> --- a/drivers/mmc/host/meson-gx-mmc.c
> +++ b/drivers/mmc/host/meson-gx-mmc.c
> @@ -1192,8 +1192,8 @@ static int meson_mmc_probe(struct platform_device *pdev)
>   		return PTR_ERR(host->regs);
>   
>   	host->irq = platform_get_irq(pdev, 0);
> -	if (host->irq <= 0)
> -		return -EINVAL;
> +	if (host->irq < 0)
> +		return host->irq;
>   
>   	cd_irq = platform_get_irq_optional(pdev, 1);
>   	mmc_gpio_set_cd_irq(mmc, cd_irq);

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 11/12] mmc: sunxi: fix deferred probing
  2023-06-08 19:45 ` [PATCH v2 11/12] mmc: sunxi: " Sergey Shtylyov
@ 2023-06-09 20:48   ` Jernej Škrabec
  0 siblings, 0 replies; 26+ messages in thread
From: Jernej Škrabec @ 2023-06-09 20:48 UTC (permalink / raw)
  To: Ulf Hansson, linux-mmc, Sergey Shtylyov
  Cc: Chen-Yu Tsai, Samuel Holland, linux-arm-kernel, linux-sunxi

Dne četrtek, 08. junij 2023 ob 21:45:18 CEST je Sergey Shtylyov napisal(a):
> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
> permanently instead of the deferred probing. Switch to propagating the error
> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
> can safely ignore it...
> 
> Fixes: 2408a08583d ("mmc: sunxi-mmc: Handle return value of platform_get_irq")
> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>

Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>

Best regards,
Jernej



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers
  2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
                   ` (11 preceding siblings ...)
  2023-06-08 19:45 ` [PATCH v2 12/12] mmc: usdhi60rol0: " Sergey Shtylyov
@ 2023-06-12 14:16 ` Ulf Hansson
  2023-06-12 19:48   ` Sergey Shtylyov
  12 siblings, 1 reply; 26+ messages in thread
From: Ulf Hansson @ 2023-06-12 14:16 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-mmc

On Thu, 8 Jun 2023 at 21:45, Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> Here are 12 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
> The affected MMC/SD drivers call platform_get_irq[_byname]() but override its
> result in case of error which prevents the deferred probing from working. Some
> of these patches logically depend on commit ce753ad1549c ("platform: finally
> disallow IRQ0 in platform_get_irq() and its ilk")...

The above patch is available in v5.19. If someone wants any of the
patches in $subject series to be backported to an older kernel
version, the commit above needs backporting too.

Therefore I am adding the tag below for the series and leaving
anything that older to be managed separately.

Cc: stable@vger.kernel.org # v5.19+

>
> Sergey Shtylyov (12):
>   mmc: bcm2835: fix deferred probing
>   mmc: meson-gx: fix deferred probing
>   mmc: mtk-sd: fix deferred probing
>   mmc: mvsdio: fix deferred probing
>   mmc: omap: fix deferred probing
>   mmc: omap_hsmmc: fix deferred probing
>   mmc: owl: fix deferred probing
>   mmc: sdhci-acpi: fix deferred probing
>   mmc: sdhci-spear: fix deferred probing
>   mmc: sh_mmcif: fix deferred probing
>   mmc: sunxi: fix deferred probing
>   mmc: usdhi60rol0: fix deferred probing
>
>  drivers/mmc/host/bcm2835.c      | 4 ++--
>  drivers/mmc/host/meson-gx-mmc.c | 4 ++--
>  drivers/mmc/host/mtk-sd.c       | 2 +-
>  drivers/mmc/host/mvsdio.c       | 2 +-
>  drivers/mmc/host/omap.c         | 2 +-
>  drivers/mmc/host/omap_hsmmc.c   | 6 ++++--
>  drivers/mmc/host/owl-mmc.c      | 2 +-
>  drivers/mmc/host/sdhci-acpi.c   | 2 +-
>  drivers/mmc/host/sdhci-spear.c  | 4 ++--
>  drivers/mmc/host/sh_mmcif.c     | 2 +-
>  drivers/mmc/host/sunxi-mmc.c    | 4 ++--
>  drivers/mmc/host/usdhi6rol0.c   | 6 ++++--
>  12 files changed, 22 insertions(+), 18 deletions(-)
>

Applied for fixes, thanks!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 01/12] mmc: bcm2835: fix deferred probing
  2023-06-08 21:39   ` Stefan Wahren
@ 2023-06-12 19:43     ` Sergey Shtylyov
  2023-06-13  8:56       ` Stefan Wahren
  0 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-12 19:43 UTC (permalink / raw)
  To: Stefan Wahren, Ulf Hansson, linux-mmc
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

On 6/9/23 12:39 AM, Stefan Wahren wrote:
[...]

>> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
>> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
>> permanently instead of the deferred probing. Switch to propagating the error
>> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
>> can safely ignore it...
>>
>> Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")
> 
> I know this is very theoretical, but does the statement "IRQ0 is no longer returned by platform_get_irq()" also applies to the time of the fixes commit?

   Unfortunately, no. IRQ0 finally ceased to be returned in 5.19; there was a fat
warning in platform_get_irq() and friends before that (which is still there)...

> I'm asking because the fix could be backported to Linux 4.14.

   I think the deferred probing can currently occur only with DT platforms
(I may be wrong here). Is this your case?

> Best regards
> 
>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
[...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers
  2023-06-12 14:16 ` [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Ulf Hansson
@ 2023-06-12 19:48   ` Sergey Shtylyov
  2023-06-12 20:18     ` Ulf Hansson
  0 siblings, 1 reply; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-12 19:48 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

On 6/12/23 5:16 PM, Ulf Hansson wrote:
[...]
>> Here are 12 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
>> The affected MMC/SD drivers call platform_get_irq[_byname]() but override its
>> result in case of error which prevents the deferred probing from working. Some
>> of these patches logically depend on commit ce753ad1549c ("platform: finally
>> disallow IRQ0 in platform_get_irq() and its ilk")...
> 
> The above patch is available in v5.19. If someone wants any of the
> patches in $subject series to be backported to an older kernel
> version, the commit above needs backporting too.

   Mmm... not quite correct: the abovementioned commit matters only when
the IRQ check in the driver is changed from <= 0 to < 0 (there's an extra
passage about IRQ0 at the end of the patch description).

> Therefore I am adding the tag below for the series and leaving
> anything that older to be managed separately.
> 
> Cc: stable@vger.kernel.org # v5.19+

   Please only add such tag where it is _actually_ needed. TIA!

[...]
> Kind regards
> Uffe

MBR, Sergey

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers
  2023-06-12 19:48   ` Sergey Shtylyov
@ 2023-06-12 20:18     ` Ulf Hansson
  2023-06-13 20:04       ` Sergey Shtylyov
  0 siblings, 1 reply; 26+ messages in thread
From: Ulf Hansson @ 2023-06-12 20:18 UTC (permalink / raw)
  To: Sergey Shtylyov; +Cc: linux-mmc

On Mon, 12 Jun 2023 at 21:48, Sergey Shtylyov <s.shtylyov@omp.ru> wrote:
>
> On 6/12/23 5:16 PM, Ulf Hansson wrote:
> [...]
> >> Here are 12 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
> >> The affected MMC/SD drivers call platform_get_irq[_byname]() but override its
> >> result in case of error which prevents the deferred probing from working. Some
> >> of these patches logically depend on commit ce753ad1549c ("platform: finally
> >> disallow IRQ0 in platform_get_irq() and its ilk")...
> >
> > The above patch is available in v5.19. If someone wants any of the
> > patches in $subject series to be backported to an older kernel
> > version, the commit above needs backporting too.
>
>    Mmm... not quite correct: the abovementioned commit matters only when
> the IRQ check in the driver is changed from <= 0 to < 0 (there's an extra
> passage about IRQ0 at the end of the patch description).
>
> > Therefore I am adding the tag below for the series and leaving
> > anything that older to be managed separately.
> >
> > Cc: stable@vger.kernel.org # v5.19+
>
>    Please only add such tag where it is _actually_ needed. TIA!

Seems reasonable to me!

Perhaps it's best if you can resend the series with the correct stable
tags then, so I don't screw up?

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 01/12] mmc: bcm2835: fix deferred probing
  2023-06-12 19:43     ` Sergey Shtylyov
@ 2023-06-13  8:56       ` Stefan Wahren
  2023-06-13 21:08         ` Sergey Shtylyov
  0 siblings, 1 reply; 26+ messages in thread
From: Stefan Wahren @ 2023-06-13  8:56 UTC (permalink / raw)
  To: Sergey Shtylyov, Ulf Hansson, linux-mmc
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

Am 12.06.23 um 21:43 schrieb Sergey Shtylyov:
> On 6/9/23 12:39 AM, Stefan Wahren wrote:
> [...]
> 
>>> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
>>> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
>>> permanently instead of the deferred probing. Switch to propagating the error
>>> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
>>> can safely ignore it...
>>>
>>> Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")
>>
>> I know this is very theoretical, but does the statement "IRQ0 is no longer returned by platform_get_irq()" also applies to the time of the fixes commit?
> 
>     Unfortunately, no. IRQ0 finally ceased to be returned in 5.19; there was a fat
> warning in platform_get_irq() and friends before that (which is still there)...

Okay, in this case the usage of the fixes tag is wrong. Maybe we should 
refer to the commit which changed platform_get_irq()?

> 
>> I'm asking because the fix could be backported to Linux 4.14.
> 
>     I think the deferred probing can currently occur only with DT platforms
> (I may be wrong here). Is this your case?

AFAIK Raspberry Pi was always a DT platform in the mainline kernel. At 
least in Linux 4.14.

> 
>> Best regards
>>
>>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
> [...]
> 
> MBR, Sergey
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers
  2023-06-12 20:18     ` Ulf Hansson
@ 2023-06-13 20:04       ` Sergey Shtylyov
  0 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-13 20:04 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: linux-mmc

On 6/12/23 11:18 PM, Ulf Hansson wrote:

>> [...]
>>>> Here are 12 patches against the 'fixes' branch of Ulf Hansson's 'mmc.git' repo.
>>>> The affected MMC/SD drivers call platform_get_irq[_byname]() but override its
>>>> result in case of error which prevents the deferred probing from working. Some
>>>> of these patches logically depend on commit ce753ad1549c ("platform: finally
>>>> disallow IRQ0 in platform_get_irq() and its ilk")...
>>>
>>> The above patch is available in v5.19. If someone wants any of the
>>> patches in $subject series to be backported to an older kernel
>>> version, the commit above needs backporting too.
>>
>>    Mmm... not quite correct: the abovementioned commit matters only when
>> the IRQ check in the driver is changed from <= 0 to < 0 (there's an extra
>> passage about IRQ0 at the end of the patch description).
>>
>>> Therefore I am adding the tag below for the series and leaving
>>> anything that older to be managed separately.
>>>
>>> Cc: stable@vger.kernel.org # v5.19+
>>
>>    Please only add such tag where it is _actually_ needed. TIA!
> 
> Seems reasonable to me!
> 
> Perhaps it's best if you can resend the series with the correct stable
> tags then, so I don't screw up?

   OK, it was my fault anyways... :-)

> Kind regards
> Uffe

MBR, Sergey

^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: [PATCH v2 01/12] mmc: bcm2835: fix deferred probing
  2023-06-13  8:56       ` Stefan Wahren
@ 2023-06-13 21:08         ` Sergey Shtylyov
  0 siblings, 0 replies; 26+ messages in thread
From: Sergey Shtylyov @ 2023-06-13 21:08 UTC (permalink / raw)
  To: Stefan Wahren, Ulf Hansson, linux-mmc
  Cc: Florian Fainelli, Ray Jui, Scott Branden, Nicolas Saenz Julienne,
	bcm-kernel-feedback-list, linux-rpi-kernel, linux-arm-kernel

On 6/13/23 11:56 AM, Stefan Wahren wrote:
[...]

>>>> The driver overrides the error codes and IRQ0 returned by platform_get_irq()
>>>> to -EINVAL, so if it returns -EPROBE_DEFER, the driver will fail the probe
>>>> permanently instead of the deferred probing. Switch to propagating the error
>>>> codes upstream.  IRQ0 is no longer returned by platform_get_irq(), so we now
>>>> can safely ignore it...
>>>>
>>>> Fixes: 660fc733bd74 ("mmc: bcm2835: Add new driver for the sdhost controller.")
>>>
>>> I know this is very theoretical, but does the statement "IRQ0 is no longer returned by platform_get_irq()" also applies to the time of the fixes commit?
>>
>>     Unfortunately, no. IRQ0 finally ceased to be returned in 5.19; there was a fat
>> warning in platform_get_irq() and friends before that (which is still there)...
> 
> Okay, in this case the usage of the fixes tag is wrong.

   Why? Returning -EPROBE_DEFER from platform_get_irq() predates this driver.

> Maybe we should refer to the commit which changed platform_get_irq()?

   No, IRQ0 is a different issue than that I'm trying to solve here.

>>> I'm asking because the fix could be backported to Linux 4.14.
>>
>>     I think the deferred probing can currently occur only with DT platforms

   ACPI too (I was too lazy to look on the code yesterday).

>> (I may be wrong here). Is this your case?
> 
> AFAIK Raspberry Pi was always a DT platform in the mainline kernel. At least in Linux 4.14.

   Good to know. :-)

>>> Best regards
>>>
>>>> Signed-off-by: Sergey Shtylyov <s.shtylyov@omp.ru>
>> [...]

MBR, Sergey

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2023-06-13 21:08 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 19:45 [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 01/12] mmc: bcm2835: fix deferred probing Sergey Shtylyov
2023-06-08 21:39   ` Stefan Wahren
2023-06-12 19:43     ` Sergey Shtylyov
2023-06-13  8:56       ` Stefan Wahren
2023-06-13 21:08         ` Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 02/12] mmc: meson-gx: " Sergey Shtylyov
2023-06-09  7:20   ` Neil Armstrong
2023-06-08 19:45 ` [PATCH v2 03/12] mmc: mtk-sd: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 04/12] mmc: mvsdio: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 05/12] mmc: omap: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 06/12] mmc: omap_hsmmc: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 07/12] mmc: owl: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 08/12] mmc: sdhci-acpi: " Sergey Shtylyov
2023-06-09  5:43   ` Adrian Hunter
2023-06-08 19:45 ` [PATCH v2 09/12] mmc: sdhci-spear: " Sergey Shtylyov
2023-06-09  4:40   ` Viresh Kumar
2023-06-09  5:44   ` Adrian Hunter
2023-06-08 19:45 ` [PATCH v2 10/12] mmc: sh_mmcif: " Sergey Shtylyov
2023-06-08 19:45 ` [PATCH v2 11/12] mmc: sunxi: " Sergey Shtylyov
2023-06-09 20:48   ` Jernej Škrabec
2023-06-08 19:45 ` [PATCH v2 12/12] mmc: usdhi60rol0: " Sergey Shtylyov
2023-06-12 14:16 ` [PATCH v2 00/12] Fix deferred probing in the MMC/SD drivers Ulf Hansson
2023-06-12 19:48   ` Sergey Shtylyov
2023-06-12 20:18     ` Ulf Hansson
2023-06-13 20:04       ` Sergey Shtylyov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).