Skip to contentSkip to conversation

mtd: nand: lpc32xx: fix invalid error handling of a requested irq

PATCH New Vladimir Zapolskiy 4 participants 7 messages Dec 5, 2016 – Jan 5, 2017

Subsystems (3)
lore
Share & tools
lore

Vladimir Zapolskiy

author maintainer
#0 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes LPC32xx NAND MLC driver initialization on boot.

---
 drivers/mtd/nand/lpc32xx_mlc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/lpc32xx_mlc.c +1 -1
index 8523881..bc6e49a 100644
@@ -776,7 +776,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	init_completion(&host->comp_controller);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if ((host->irq < 0) || (host->irq >= NR_IRQS)) {
+	if (host->irq < 0) {
 		dev_err(&pdev->dev, "failed to get platform irq\n");
 		res = -EINVAL;
 		goto err_exit3;
Signature · 1 line
2.10.2
#1 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Quoted 7 lines · Vladimir Zapolskiy

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

Quoted 7 lines

The change fixes LPC32xx NAND MLC driver initialization on boot.

---
 drivers/mtd/nand/lpc32xx_mlc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
#2 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

In reply to Vladimir Zapolskiy

Hi Vladimir

Quoted 8 lines · On Mon, 5 Dec 2016 03:47:10 +0200 Vladimir Zapolskiy <[email protected]> wrote:

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

The change fixes LPC32xx NAND MLC driver initialization on boot.

Do you need to backport this fix to stable releases? If that's the case, I'll add the Cc: stable tag when applying.

Thanks,

Boris

Quoted 19 lines
---
 drivers/mtd/nand/lpc32xx_mlc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/lpc32xx_mlc.c +1 -1
index 8523881..bc6e49a 100644
@@ -776,7 +776,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
 	init_completion(&host->comp_controller);
 
 	host->irq = platform_get_irq(pdev, 0);
-	if ((host->irq < 0) || (host->irq >= NR_IRQS)) {
+	if (host->irq < 0) {
 		dev_err(&pdev->dev, "failed to get platform irq\n");
 		res = -EINVAL;
 		goto err_exit3;
author maintainer
#3 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Hi Boris,

Quoted 12 lines · Boris Brezillon

Hi Vladimir

Quoted 7 lines · On Mon, 5 Dec 2016 03:47:10 +0200 Vladimir Zapolskiy <[email protected]> wrote:

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

Quoted 4 lines
Quoted 1 line

The change fixes LPC32xx NAND MLC driver initialization on boot.

Do you need to backport this fix to stable releases? If that's the case, I'll add the Cc: stable tag when applying.

that will be great if you can add

Cc stable at kernel.org # v4.7+

Please feel free to add also the tag

Fixes 8cb17b5ed017 ("irqchip: Add LPC32xx interrupt controller driver")

--
With best wishes,
Vladimir

#4 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Quoted 20 lines · On Tue, 3 Jan 2017 12:16:26 +0200 Vladimir Zapolskiy <[email protected]> wrote:

Hi Boris,

Quoted 12 lines · Boris Brezillon

Hi Vladimir

Quoted 7 lines · On Mon, 5 Dec 2016 03:47:10 +0200 Vladimir Zapolskiy <[email protected]> wrote:

Semantics of NR_IRQS is different on machines with SPARSE_IRQ option disabled or enabled, in the latter case IRQs are allocated starting at least from the value specified by NR_IRQS and going upwards, so the check of (irq >= NR_IRQ) to decide about an error code returned by platform_get_irq() is completely invalid, don't attempt to overrule irq subsystem in the driver.

Quoted 4 lines
Quoted 1 line

The change fixes LPC32xx NAND MLC driver initialization on boot.

Do you need to backport this fix to stable releases? If that's the case, I'll add the Cc: stable tag when applying.

Quoted 7 lines

that will be great if you can add

Cc stable at kernel.org # v4.7+

Please feel free to add also the tag

Fixes 8cb17b5ed017 ("irqchip: Add LPC32xx interrupt controller driver")

Applied to nand/next (this patch will appear in 4.11).

Thanks,

Boris

Quoted 5 lines

--
With best wishes,
Vladimir

#5 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Quoted 8 lines · Boris Brezillon
Quoted 6 lines · On Tue, 3 Jan 2017 12:16:26 +0200 Vladimir Zapolskiy <[email protected]> wrote:
Quoted 2 lines · Boris Brezillon

Do you need to backport this fix to stable releases? If that's the case, I'll add the Cc: stable tag when applying.

that will be great if you can add

Quoted 7 lines
Quoted 5 lines
Cc stable at kernel.org # v4.7+

Please feel free to add also the tag

Fixes 8cb17b5ed017 ("irqchip: Add LPC32xx interrupt controller driver")

Applied to nand/next (this patch will appear in 4.11).

For next time, checkpatch noticed that you got the stable address wrong:

ERROR:STABLE_ADDRESS: The 'stable' address should be 'stable at vger.kernel.org' #17: Cc: stable at kernel.org # v4.7+

Brian

author maintainer
#6 lore raw

PATCH 1/1 mtd: nand: lpc32xx: fix invalid error handling of a requested irq

Quoted 15 lines · Brian Norris
Quoted 14 lines · Boris Brezillon
Quoted 11 lines · On Tue, 3 Jan 2017 12:16:26 +0200 Vladimir Zapolskiy <[email protected]> wrote:
Quoted 2 lines · Boris Brezillon

Do you need to backport this fix to stable releases? If that's the case, I'll add the Cc: stable tag when applying.

that will be great if you can add

Cc stable at kernel.org # v4.7+

Please feel free to add also the tag

Fixes 8cb17b5ed017 ("irqchip: Add LPC32xx interrupt controller driver")
Quoted 9 lines
Quoted 1 line

Applied to nand/next (this patch will appear in 4.11).

For next time, checkpatch noticed that you got the stable address wrong:

ERROR:STABLE_ADDRESS: The 'stable' address should be 'stable at vger.kernel.org' #17: Cc: stable at kernel.org # v4.7+

Brian

sorry, I've git-logged to commit 52bce91165 and pasted the address from its commit message.

--
With best wishes,
Vladimir