Skip to contentSkip to conversation

usb/isp1760: set IRQ flags properly

PATCH Superseded Valentin Rothberg 4 participants 7 messages Feb 27, 2015 – Mar 4, 2015

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

PATCH 1/1 usb/isp1760: set IRQ flags properly

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED.

---
 drivers/usb/isp1760/isp1760-core.c | 5 ++---
 drivers/usb/isp1760/isp1760-udc.c  | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/usb/isp1760/isp1760-core.c +2 -3
index b982755..9f4a0de 100644
@@ -145,14 +145,13 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
 
 	if (IS_ENABLED(CONFIG_USB_ISP1760_HCD) && !usb_disabled()) {
 		ret = isp1760_hcd_register(&isp->hcd, isp->regs, mem, irq,
-					   irqflags | IRQF_SHARED, dev);
+					   irqflags, dev);
 		if (ret < 0)
 			return ret;
 	}
 
 	if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
-		ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED |
-					   IRQF_DISABLED);
+		ret = isp1760_udc_register(isp, irq, irqflags);
 		if (ret < 0) {
 			isp1760_hcd_unregister(&isp->hcd);
 			return ret;
drivers/usb/isp1760/isp1760-udc.c +2 -2
index 9612d79..0b46ff0 100644
@@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
 
 	sprintf(udc->irqname, "%s (udc)", devname);
 
-	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED |
-			  irqflags, udc->irqname, udc);
+	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
+			  udc->irqname, udc);
 	if (ret < 0)
 		goto error;
 
Signature · 1 line
1.9.1
#1 lore raw
Quoted 7 lines · Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED.

why is it redundant ?

Signature · 1 line
balbi
#2 lore raw
Quoted 10 lines · Felipe Balbi
Quoted 7 lines · Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED.

why is it redundant ?

It's redundant in the call of isp1760_udc_register() as this function sets the flag by requesting the IRQ. I mistakenly removed it also in the call of isp1760_hcd_register() which does not alter the passed irqflags. I will fix this in a second version of this patch. I am sorry for this mistake.

Valentin

Quoted 2 lines

--
balbi

#3 lore raw
Quoted 10 lines · Valentin Rothberg
Quoted 9 lines · Felipe Balbi
Quoted 7 lines · Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc (genirq: Run irq handlers with interrupts disabled) running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED.

Quoted 7 lines
Quoted 1 line

why is it redundant ?

It's redundant in the call of isp1760_udc_register() as this function sets the flag by requesting the IRQ. I mistakenly removed it also in the call of isp1760_hcd_register() which does not alter the passed irqflags. I will fix this in a second version of this patch. I am sorry for this mistake.

no problem, s**t happens ;)

Signature · 1 line
balbi
#4 lore raw

PATCH v2 1/1 usb/isp1760: set IRQ flags properly

In reply to Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc ("genirq: Run irq handlers with interrupts disabled") running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED for isp1760_udc_register().

---
v2: Reverted change that removed IRQF_SHARED in the call of

    isp1760_hcd_register().
---
 drivers/usb/isp1760/isp1760-core.c | 3 +--
 drivers/usb/isp1760/isp1760-udc.c  | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/usb/isp1760/isp1760-core.c +1 -2
index b982755..bfa402c 100644
@@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
 	}
 
 	if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
-		ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED |
-					   IRQF_DISABLED);
+		ret = isp1760_udc_register(isp, irq, irqflags);
 		if (ret < 0) {
 			isp1760_hcd_unregister(&isp->hcd);
 			return ret;
drivers/usb/isp1760/isp1760-udc.c +2 -2
index 9612d79..0b46ff0 100644
@@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
 
 	sprintf(udc->irqname, "%s (udc)", devname);
 
-	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED |
-			  irqflags, udc->irqname, udc);
+	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
+			  udc->irqname, udc);
 	if (ret < 0)
 		goto error;
 
Signature · 1 line
1.9.1
Acked-by on v2 1/1
#5 lore raw

Hi Valentin,

Thank you for the patch.

Quoted 9 lines · Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc ("genirq: Run irq handlers with interrupts disabled") running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED for isp1760_udc_register().

Quoted 41 lines

---
v2: Reverted change that removed IRQF_SHARED in the call of

    isp1760_hcd_register().
---
 drivers/usb/isp1760/isp1760-core.c | 3 +--
 drivers/usb/isp1760/isp1760-udc.c  | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/usb/isp1760/isp1760-core.c +1 -2
index b982755..bfa402c 100644
@@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
 	}
 
 	if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
-		ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED |
-					   IRQF_DISABLED);
+		ret = isp1760_udc_register(isp, irq, irqflags);
 		if (ret < 0) {
 			isp1760_hcd_unregister(&isp->hcd);
 			return ret;
drivers/usb/isp1760/isp1760-udc.c +2 -2
index 9612d79..0b46ff0 100644
@@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
 
 	sprintf(udc->irqname, "%s (udc)", devname);
 
-	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED |
-			  irqflags, udc->irqname, udc);
+	ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
+			  udc->irqname, udc);
 	if (ret < 0)
 		goto error;
 
Signature · 3 lines
1.9.1

���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
#6 lore raw

Andrew Morton asked me to prepare a big patch that removes IRQF_DISABLED entirely (see https://lkml.org/lkml/2015/3/2/819). It seems a good way to get rid of the few references and the definition at once.

So please don't apply this patch. After, I can prepare another patch later that takes care of the redundant setting of IRQF_SHARED for isp1760_udc_register().

Kind regards,
Valentin

Quoted 58 lines · On Mon, Mar 2, 2015 at 4:30 PM, <[email protected]> wrote:

Hi Valentin,

Thank you for the patch.

Quoted 9 lines · Valentin Rothberg

The IRQF_DISABLED is a NOOP and scheduled to be removed. According to commit e58aa3d2d0cc ("genirq: Run irq handlers with interrupts disabled") running IRQ handlers with interrupts enabled can cause stack overflows when the interrupt line of the issuing device is still active.

This patch removes using this deprecated flag and additionally removes redundantly setting IRQF_SHARED for isp1760_udc_register().

Quoted 41 lines

---
v2: Reverted change that removed IRQF_SHARED in the call of

    isp1760_hcd_register().
---
 drivers/usb/isp1760/isp1760-core.c | 3 +--
 drivers/usb/isp1760/isp1760-udc.c  | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)
drivers/usb/isp1760/isp1760-core.c +1 -2
index b982755..bfa402c 100644
@@ -151,8 +151,7 @@ int isp1760_register(struct resource *mem, int irq, unsigned long irqflags,
      }
 
      if (IS_ENABLED(CONFIG_USB_ISP1761_UDC) && !udc_disabled) {
-             ret = isp1760_udc_register(isp, irq, irqflags | IRQF_SHARED |
-                                        IRQF_DISABLED);
+             ret = isp1760_udc_register(isp, irq, irqflags);
              if (ret < 0) {
                      isp1760_hcd_unregister(&isp->hcd);
                      return ret;
drivers/usb/isp1760/isp1760-udc.c +2 -3
index 9612d79..0b46ff0 100644
@@ -1451,8 +1451,8 @@ int isp1760_udc_register(struct isp1760_device *isp, int irq,
 
      sprintf(udc->irqname, "%s (udc)", devname);
 
-     ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | IRQF_DISABLED |
-                       irqflags, udc->irqname, udc);
+     ret = request_irq(irq, isp1760_udc_irq, IRQF_SHARED | irqflags,
+                       udc->irqname, udc);
      if (ret < 0)
              goto error;
 
--

1.9.1