Skip to contentSkip to conversation

Fix deferred probing in the EDAC drivers

PATCH In review Sergey Shtylyov 4 participants 17 messages Jan 24, 2022 – Jan 29, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover Fix deferred probing in the EDAC drivers

Here are 2 patches against the 'edac-for-next' branch of the 'ras.git' repo (for the lack of a better branch for fixes?). The affected drivers call platform_get_irq[_optional]() but override its result in case of error -- which prevents the deferred probing from working.

Sergey Shtylyov (2):
edac: altera: fix deferred probing
edac: xgene: fix deferred probing

 drivers/edac/altera_edac.c | 2 +-
 drivers/edac/xgene_edac.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.26.3
#1 lore raw

PATCH 1/2 edac: altera: fix deferred probing

The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, 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 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support")
---
 drivers/edac/altera_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/altera_edac.c +1 -1
index 3a6d2416cb0f..5dd29789f97d 100644
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
 	if (irq < 0) {
 		edac_printk(KERN_ERR, EDAC_MC,
 			    "No irq %d in DT\n", irq);
-		return -ENODEV;
+		return irq;
 	}
 
 	/* Arria10 has a 2nd IRQ */
Signature · 1 line
2.26.3
maintainer Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 16 lines · Sergey Shtylyov

The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, 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 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support")
---
  drivers/edac/altera_edac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/altera_edac.c +0 -0
index 3a6d2416cb0f..5dd29789f97d 100644

drivers/edac/altera_edac.c static int altr_sdram_probe(struct platform_device *pdev) · line 356

Quoted 8 lines
drivers/edac/altera_edac.c +1 -1
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
  	if (irq < 0) {
  		edac_printk(KERN_ERR, EDAC_MC,
  			    "No irq %d in DT\n", irq);
-		return -ENODEV;
+		return irq;
  	}
 
  	/* Arria10 has a 2nd IRQ */
maintainer
#3 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 12 lines · Dinh Nguyen
Quoted 11 lines · Sergey Shtylyov

The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, 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 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support")
---
  drivers/edac/altera_edac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

drivers/edac/altera_edac.c static int altr_sdram_probe(struct platform_device *pdev) · line 355

Quoted 12 lines
drivers/edac/altera_edac.c +1 -1
index 3a6d2416cb0f..5dd29789f97d 100644
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
  	if (irq < 0) {
  		edac_printk(KERN_ERR, EDAC_MC,
  			    "No irq %d in DT\n", irq);
-		return -ENODEV;
+		return irq;
  	}
  	/* Arria10 has a 2nd IRQ */

It sounds to me like we want this CC: stable@ too?

If so, looking at

2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()")

that added that dev_err_probe() call, which was in Nov. 2021, which would mean, even if stable, only 5.15 and not in all stable trees judging by the Fixes: tag which is a patch from 3.17, i.e., 2014.

Right?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#4 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 27 lines · Borislav Petkov
Quoted 11 lines
Quoted 11 lines

The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, 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 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support")
---
  drivers/edac/altera_edac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

drivers/edac/altera_edac.c static int altr_sdram_probe(struct platform_device *pdev) · line 355

Quoted 12 lines
drivers/edac/altera_edac.c +1 -1
index 3a6d2416cb0f..5dd29789f97d 100644
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
  	if (irq < 0) {
  		edac_printk(KERN_ERR, EDAC_MC,
  			    "No irq %d in DT\n", irq);
-		return -ENODEV;
+		return irq;
  	}
  	/* Arria10 has a 2nd IRQ */
Quoted 1 line

It sounds to me like we want this CC: stable@ too?

I think the -stable people will pick it up based on the Fixes: tag.

Quoted 5 lines

If so, looking at

2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()")

that added that dev_err_probe() call, which was in Nov. 2021, which

It didn't add anything new -- there was dev_err() there before that,
added by 7723f4c5ecdb8d832f049f8483beb0d1081cedf6.

Quoted 4 lines

would mean, even if stable, only 5.15 and not in all stable trees judging by the Fixes: tag which is a patch from 3.17, i.e., 2014.

Right?

Mmm, platfrom_get_irq() started to return errors long ago, no?

MBR, Sergey

#5 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 40 lines · Sergey Shtylyov
Quoted 27 lines
Quoted 11 lines
Quoted 11 lines

The driver overrides the error codes returned by platform_get_irq() to -ENODEV for some strange reason, 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 71bcada88b0f ("edac: altera: Add Altera SDRAM EDAC support")
---
  drivers/edac/altera_edac.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines

drivers/edac/altera_edac.c static int altr_sdram_probe(struct platform_device *pdev) · line 355

Quoted 12 lines
drivers/edac/altera_edac.c +1 -1
index 3a6d2416cb0f..5dd29789f97d 100644
@@ -350,7 +350,7 @@ static int altr_sdram_probe(struct platform_device *pdev)
  	if (irq < 0) {
  		edac_printk(KERN_ERR, EDAC_MC,
  			    "No irq %d in DT\n", irq);
-		return -ENODEV;
+		return irq;
  	}
  	/* Arria10 has a 2nd IRQ */
Quoted 1 line

It sounds to me like we want this CC: stable@ too?

I think the -stable people will pick it up based on the Fixes: tag.

Quoted 5 lines

If so, looking at

2043727c2882 ("driver core: platform: Make use of the helper function dev_err_probe()")

that added that dev_err_probe() call, which was in Nov. 2021, which

It didn't add anything new -- there was dev_err() there before that,
added by 7723f4c5ecdb8d832f049f8483beb0d1081cedf6.

Quoted 6 lines
Quoted 4 lines

would mean, even if stable, only 5.15 and not in all stable trees judging by the Fixes: tag which is a patch from 3.17, i.e., 2014.

Right?

Mmm, platfrom_get_irq() started to return errors long ago, no?

Ah, you were wondering about returing -EPROBE_DEFER? It started to be returned
by the commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef several months before that...

MBR, Sergey

maintainer
#6 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 1 line · Sergey Shtylyov
Quoted 1 line

I think the -stable people will pick it up based on the Fixes: tag.

My last info is that they don't do that yet.

Quoted 2 lines

Ah, you were wondering about returing -EPROBE_DEFER? It started to be returned by the commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef several months before that...

More precisely, I'm wondering after which commit does the deferred probing code interpret -EPROBE_DEFER properly so that a backport of this commit would be even worth the trouble?

Because if we backport it to kernel where there's not even deferred probing support, then that backport is a waste of time.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#7 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 3 lines · Borislav Petkov
Quoted 1 line
Quoted 1 line

I think the -stable people will pick it up based on the Fixes: tag.

My last info is that they don't do that yet.

My experience tells they do.

Quoted 9 lines
Quoted 2 lines

Ah, you were wondering about returing -EPROBE_DEFER? It started to be returned by the commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef several months before that...

More precisely, I'm wondering after which commit does the deferred probing code interpret -EPROBE_DEFER properly so that a backport of this commit would be even worth the trouble?

Because if we backport it to kernel where there's not even deferred probing support, then that backport is a waste of time.

See my other mail...

MBR, Sergey

maintainer
#8 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 1 line · Sergey Shtylyov

My experience tells they do.

Let's ask them:

@stable folks, do you guys take patches based only on Fixes: tags nowadays or you still require CC:stable to be present in the commit message?

Quoted 1 line

See my other mail...

Which other mail?

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#10 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

On 1/28/22 10:35 PM, Sergey Shtylyov wrote:

[...]

Quoted 5 lines
Quoted 3 lines
Quoted 1 line

See my other mail...

Which other mail?

https://lore.kernel.org/all/[email protected]/

Ah, you've already replied to that! Sorry, I'm in a little bit of haste,
so didn't always read your replies attentively enough. :-/

MBR, Sergey

#11 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

In reply to Borislav Petkov
Quoted 8 lines · Borislav Petkov
Quoted 1 line · Sergey Shtylyov

My experience tells they do.

Let's ask them:

@stable folks, do you guys take patches based only on Fixes: tags nowadays or you still require CC:stable to be present in the commit message?

If you know you want a patch in the stable tree, add cc: stable.

Because not all maintainers remember to do so, we do dig through all patches with just the fixes: tag, and try to backport them if needed, but it does not always happen, and there can be long lags as well.

So again, if you know you want it in a stable kernel, add the cc:
stable.

thanks,

greg k-h

maintainer
#12 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

Quoted 8 lines · Greg KH

If you know you want a patch in the stable tree, add cc: stable.

Because not all maintainers remember to do so, we do dig through all patches with just the fixes: tag, and try to backport them if needed, but it does not always happen, and there can be long lags as well.

So again, if you know you want it in a stable kernel, add the cc:
stable.

Thanks for clarifying. I already did so - I figured having cc:stable won't hurt anyway. Besides, it is an explicit statement that "that patch is stable material" because Fixes: doesn't always necessarily mean, stable material.

Thx.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
#13 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

In reply to Borislav Petkov

On 1/28/22 10:16 PM, Borislav Petkov wrote:

[...]

Quoted 6 lines
Quoted 2 lines

Ah, you were wondering about returing -EPROBE_DEFER? It started to be returned by the commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef several months before that...

More precisely, I'm wondering after which commit does the deferred probing code interpret -EPROBE_DEFER properly so that a backport of this commit would be even worth the trouble?

That was even longer ago, done by the commit d1c3414c2a9d10ef7f0f7665f5d2947cd088c093
in 20212, if you must know. :-)

Quoted 2 lines

Because if we backport it to kernel where there's not even deferred probing support, then that backport is a waste of time.

I think you're overly caustious in this case. :-)

MBR, Sergey

#14 lore raw

Re: [PATCH 1/2] edac: altera: fix deferred probing

On 1/28/22 10:53 PM, Sergey Shtylyov wrote:

[...]

Quoted 9 lines
Quoted 6 lines
Quoted 2 lines

Ah, you were wondering about returing -EPROBE_DEFER? It started to be returned by the commit 9ec36cafe43bf835f8f29273597a5b0cbc8267ef several months before that...

More precisely, I'm wondering after which commit does the deferred probing code interpret -EPROBE_DEFER properly so that a backport of this commit would be even worth the trouble?

That was even longer ago, done by the commit d1c3414c2a9d10ef7f0f7665f5d2947cd088c093
in 20212, if you must know. :-)

Heh, 2012, of/c. :-)

Quoted 4 lines
Quoted 2 lines

Because if we backport it to kernel where there's not even deferred probing support, then that backport is a waste of time.

I think you're overly caustious in this case. :-)

Cautious -- my typing still sucks and even the spell checker doesn't help. /me blames
laptops with their smallish dot sizes! :-)

MBR, Sergey

#15 lore raw

PATCH 2/2 edac: xgene: fix deferred probing

In reply to Sergey Shtylyov

The driver overrides error codes returned by platform_get_irq_optional() to -EINVAL for some strange reason, 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 0d4429301c4 ("EDAC: Add APM X-Gene SoC EDAC driver")
---
 drivers/edac/xgene_edac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/edac/xgene_edac.c +1 -1
index 2ccd1db5e98f..7197f9fa0245 100644
@@ -1919,7 +1919,7 @@ static int xgene_edac_probe(struct platform_device *pdev)
 			irq = platform_get_irq_optional(pdev, i);
 			if (irq < 0) {
 				dev_err(&pdev->dev, "No IRQ resource\n");
-				rc = -EINVAL;
+				rc = irq;
 				goto out_err;
 			}
 			rc = devm_request_irq(&pdev->dev, irq,
Signature · 1 line
2.26.3
maintainer
#16 lore raw
In reply to Sergey Shtylyov
Quoted 5 lines · Sergey Shtylyov

Here are 2 patches against the 'edac-for-next' branch of the 'ras.git' repo (for the lack of a better branch for fixes?). The affected drivers call platform_get_irq[_optional]() but override its result in case of error -- which prevents the deferred probing from working.

Quoted 9 lines

Sergey Shtylyov (2):
edac: altera: fix deferred probing
edac: xgene: fix deferred probing

 drivers/edac/altera_edac.c | 2 +-
 drivers/edac/xgene_edac.c  | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Both applied, thanks.

Signature · 4 lines
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette