Skip to contentSkip to conversation

USB/host: Cleanup unneccessary irq disable code

PATCH RESEND Superseded Chuansheng Liu 2 participants 4 messages Sep 7, 2012 – Sep 10, 2012

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

PATCH RESEND 1/1 USB/host: Cleanup unneccessary irq disable code

Because the IRQF_DISABLED as the flag is now a NOOP and has been deprecated and in hardirq context the interrupt is disabled.

so in usb/host code:
Removing the usage of flag IRQF_DISABLED; Removing the calling local_irq save/restore actions in irq handler usb_hcd_irq();

---
 drivers/usb/core/hcd.c       |   15 ---------------
 drivers/usb/host/ehci-ls1x.c |    2 +-
 drivers/usb/host/ohci-xls.c  |    2 +-
 3 files changed, 2 insertions(+), 17 deletions(-)
drivers/usb/core/hcd.c +0 -15
index bc84106..f84ddea 100644
@@ -2153,15 +2153,8 @@ EXPORT_SYMBOL_GPL(usb_bus_start_enum);
 irqreturn_t usb_hcd_irq (int irq, void *__hcd)
 {
 	struct usb_hcd		*hcd = __hcd;
-	unsigned long		flags;
 	irqreturn_t		rc;
 
-	/* IRQF_DISABLED doesn't work correctly with shared IRQs
-	 * when the first handler doesn't use it.  So let's just
-	 * assume it's never used.
-	 */
-	local_irq_save(flags);
-
 	if (unlikely(HCD_DEAD(hcd) || !HCD_HW_ACCESSIBLE(hcd)))
 		rc = IRQ_NONE;
 	else if (hcd->driver->irq(hcd) == IRQ_NONE)
@@ -2169,7 +2162,6 @@ irqreturn_t usb_hcd_irq (int irq, void *__hcd)
 	else
 		rc = IRQ_HANDLED;
 
-	local_irq_restore(flags);
 	return rc;
 }
 EXPORT_SYMBOL_GPL(usb_hcd_irq);
@@ -2358,13 +2350,6 @@ static int usb_hcd_request_irqs(struct usb_hcd *hcd,
 
 	if (hcd->driver->irq) {
 
-		/* IRQF_DISABLED doesn't work as advertised when used together
-		 * with IRQF_SHARED. As usb_hcd_irq() will always disable
-		 * interrupts we can remove it here.
-		 */
-		if (irqflags & IRQF_SHARED)
-			irqflags &= ~IRQF_DISABLED;
-
 		snprintf(hcd->irq_descr, sizeof(hcd->irq_descr), "%s:usb%d",
 				hcd->driver->description, hcd->self.busnum);
 		retval = request_irq(irqnum, &usb_hcd_irq, irqflags,
drivers/usb/host/ehci-ls1x.c +1 -1
index a283e59..425cb4a 100644
@@ -119,7 +119,7 @@ static int ehci_hcd_ls1x_probe(struct platform_device *pdev)
 		goto err_release_region;
 	}
 
-	ret = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
+	ret = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (ret)
 		goto err_iounmap;
 
drivers/usb/host/ohci-xls.c +1 -1
index 41e378f..84201cd 100644
@@ -56,7 +56,7 @@ static int ohci_xls_probe_internal(const struct hc_driver *driver,
 		goto err3;
 	}
 
-	retval = usb_add_hcd(hcd, irq, IRQF_DISABLED | IRQF_SHARED);
+	retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
 	if (retval != 0)
 		goto err4;
 	return retval;
Signature · 1 line
1.7.0.4
#1 lore raw
Quoted 11 lines

-----Original Message-----
From: Liu, Chuansheng
Sent: Friday, September 07, 2012 5:20 PM
To: [email protected]
Cc: [email protected]
Subject: [PATCH RESEND] USB/host: Cleanup unneccessary irq disable code

Because the IRQF_DISABLED as the flag is now a NOOP and has been deprecated and in hardirq context the interrupt is disabled.

Quoted 7 lines

so in usb/host code:
Removing the usage of flag IRQF_DISABLED; Removing the calling local_irq save/restore actions in irq handler usb_hcd_irq();

Hi greg,
This new patch is still not OK in a right format to apply? Please let me know, thanks. ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

maintainer
#2 lore raw
In reply to Chuansheng Liu
Quoted 8 lines · Chuansheng Liu

Because the IRQF_DISABLED as the flag is now a NOOP and has been deprecated and in hardirq context the interrupt is disabled.

so in usb/host code:
Removing the usage of flag IRQF_DISABLED; Removing the calling local_irq save/restore actions in irq handler usb_hcd_irq();

Quoted 7 lines
---
 drivers/usb/core/hcd.c       |   15 ---------------
 drivers/usb/host/ehci-ls1x.c |    2 +-
 drivers/usb/host/ohci-xls.c  |    2 +-
 3 files changed, 2 insertions(+), 17 deletions(-)

This fails to apply to my usb-next branch for some odd reason, please refresh it and resend.

thanks,

greg k-h

#3 lore raw
Quoted 8 lines
Quoted 7 lines
---
 drivers/usb/core/hcd.c       |   15 ---------------
 drivers/usb/host/ehci-ls1x.c |    2 +-
 drivers/usb/host/ohci-xls.c  |    2 +-
 3 files changed, 2 insertions(+), 17 deletions(-)
Quoted 6 lines

This fails to apply to my usb-next branch for some odd reason, please refresh it and resend.

thanks,

greg k-h

Has resent, refresh the code base and sent with evolution client, wish it is OK, thanks.