Re: 3.4.4: disabling irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 29 Aug 2013, Udo van den Heuvel wrote:

> On 2013-08-28 21:37, Alan Stern wrote:
> >>> No, if you unload the ohci-hcd driver then the webcam won't be used.  
> >>> Are you certain that merely stopping the daemon program will prevent 
> >>> the problem?
> >>
> >> Quite certain but retesting can confirm that.
> > 
> > Maybe without activity, the OHCI controller goes into suspend.  You can 
> > prevent it by doing:
> > 
> > 	echo on >/sys/bus/pci/devices/0000:00:13.1/usb?/power/control
> 
> /sys/bus/pci/devices/0000:00:13.0 has a file irq containing 18.
> subdirectory usb8 under there has no power/control subdir/file.
> Is this a configuration issue or kernel version difference?

It could be a config issue.  The file will be present only if 
CONFIG_PM_RUNTIME is enabled.

> > By the way, since you switched to the new computer, are there any 
> > devices attached to this USB bus other than the webcam?
> 
> The wired mouse (logitech M-BD58) is connected via usb.

Is it connected to the 0000:00:13.1 controller or to the 0000:00:13.0
controller?

> > Also, at one point you had a second webcam attached to a different OHCI
> > controller, as well as a Bluetooth device and a USB-serial device.  
> > Are they still present?
> 
> Nope. Presently not connected.
> 
> I'll have some hubs this weekend to play with.

In the meantime, here is a diagnostic patch you can try out.

Alan Stern



Index: usb-3.11/drivers/usb/host/ohci-hcd.c
===================================================================
--- usb-3.11.orig/drivers/usb/host/ohci-hcd.c
+++ usb-3.11/drivers/usb/host/ohci-hcd.c
@@ -592,7 +592,10 @@ static int ohci_run (struct ohci_hcd *oh
 	u32			mask, val;
 	int			first = ohci->fminterval == 0;
 	struct usb_hcd		*hcd = ohci_to_hcd(ohci);
+	static int		alan_id;
 
+	ohci->alan_time = jiffies;
+	ohci->alan_limit = (++alan_id) * 1000;
 	ohci->rh_state = OHCI_RH_HALTED;
 
 	/* boot firmware should have set this up (5.1.1.3.1) */
@@ -810,6 +813,20 @@ static irqreturn_t ohci_irq (struct usb_
 		return IRQ_HANDLED;
 	}
 
+	if (ohci->alan_count < 0)
+		return IRQ_NOTMINE;
+	else if (time_after(jiffies, ohci->alan_time)) {
+		ohci->alan_time = jiffies + HZ/10;
+		ohci->alan_count = 0;
+	} else if (++ohci->alan_count > ohci->alan_limit) {
+		ohci_info(ohci, "Too many interrupts %d, disabling\n",
+				ohci->alan_limit);
+		ohci->alan_count = -1;
+		ohci_writel(ohci, ~0, &regs->intrdisable);
+		ohci_writel(ohci, ~0, &regs->intrstatus);
+		return IRQ_NOTMINE;
+	}
+
 	/* We only care about interrupts that are enabled */
 	ints &= ohci_readl(ohci, &regs->intrenable);
 
Index: usb-3.11/drivers/usb/host/ohci-hub.c
===================================================================
--- usb-3.11.orig/drivers/usb/host/ohci-hub.c
+++ usb-3.11/drivers/usb/host/ohci-hub.c
@@ -218,7 +218,8 @@ __acquires(ohci->lock)
 
 skip_resume:
 	/* interrupts might have been disabled */
-	ohci_writel (ohci, OHCI_INTR_INIT, &ohci->regs->intrenable);
+	if (ohci->alan_count >= 0)
+		ohci_writel (ohci, OHCI_INTR_INIT, &ohci->regs->intrenable);
 	if (ohci->ed_rm_list)
 		ohci_writel (ohci, OHCI_INTR_SF, &ohci->regs->intrenable);
 
Index: usb-3.11/drivers/usb/host/ohci.h
===================================================================
--- usb-3.11.orig/drivers/usb/host/ohci.h
+++ usb-3.11/drivers/usb/host/ohci.h
@@ -415,6 +415,10 @@ struct ohci_hcd {
 	struct ed		*ed_to_check;
 	unsigned		zf_delay;
 
+	unsigned long		alan_time;
+	int			alan_count;
+	int			alan_limit;
+
 #ifdef DEBUG
 	struct dentry		*debug_dir;
 	struct dentry		*debug_async;

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux