Linux Answers »Kernel »USB Serial device disconnect causes IRQ disable |
|||
|
|
|||
|
amruth wrote at: 2008-08-20 14:40:21
USB Serial device disconnect causes IRQ disable | |||
|
Hi I again encountered the same issue IRQ23 disabled. Here is my /proc/interrupts CPU0 CPU1 0: 381 0 IO-APIC-edge timer 1: 47 6499 IO-APIC-edge i8042 3: 2 0 IO-APIC-edge 4: 4 0 IO-APIC-edge 6: 7 0 IO-APIC-edge floppy 9: 0 0 IO-APIC-fasteoi acpi 12: 4 0 IO-APIC-edge i8042 14: 27742 0 IO-APIC-edge ide0 15: 3152 809663 IO-APIC-edge ide1 16: 383 0 IO-APIC-fasteoi uhci_hcd:usb2, uhci_hcd:usb5 18: 888468 0 IO-APIC-fasteoi ata_piix, uhci_hcd:usb4, eth0 19: 268 0 IO-APIC-fasteoi uhci_hcd:usb3 23: 300001 0 IO-APIC-fasteoi ehci_hcd:usb1 NMI: 436 172 Non-maskable interrupts LOC: 1810724 1760209 Local timer interrupts RES: 171199 167417 Rescheduling interrupts CAL: 140 6288 function call interrupts TLB: 4071 1963 TLB shootdowns TRM: 0 0 Thermal event interrupts SPU: 0 0 Spurious interrupts ERR: 0 MIS: 0 Thanks Amruth p.v --- On Thu, 8/7/08, Oliver Neukum <oliver (~=~) neukum.org> wrote: > From: Oliver Neukum <oliver (~=~) neukum.org> > Subject: Re: USB Serial device disconnect causes IRQ disable > To: "amruth" <amruth_pv (~=~) yahoo.com> > Cc: linux-usb (~=~) vger.kernel.org > Date: Thursday, August 7, 2008, 3:10 AM > Am Mittwoch 06 August 2008 22:58:08 schrieb amruth: >> Hi >> All >> After disconnecting the usb serial device randomly. I > am getting the following error. >> >> usr/src/linux-2.6.26/drivers/usb/serial/usb-serial.c: > serial is OK >> /usr/src/linux-2.6.26/drivers/usb/serial/usb-serial.c: > after rteturn serial >> /usr/src/linux-2.6.26/drivers/usb/serial/usb-serial.c: > before unregister serial >> magtek ttyUSB0: Magtek 75/Excella USB card reader > converter now disconnected from ttyUSB0 >> /usr/src/linux-2.6.26/drivers/usb/serial/usb-serial.c: > port_release - ttyUSB0 >> /usr/src/linux-2.6.26/drivers/usb/serial/usb-serial.c: > after unregister serial > > If you have a spurious interrupt sharing a line with a > legitimate source > of interrupts, you'll see nothing while the legitimate > source operates. > Is there another device sharing irq 23? What does > /proc/interrupts say? > > Regards > Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
Oliver Neukum wrote at: 2008-08-20 15:30:28
USB Serial device disconnect causes IRQ disable | |||
|
Am Mittwoch 20 August 2008 21:34:51 schrieb amruth: > Hi > I again encountered the same issue IRQ23 disabled. > Here is my /proc/interrupts There is some unknown interrupt on 23. Try unloading drivers until it works. You can sort of bisect it if you divide your loaded modules in groups. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
amruth wrote at: 2008-08-20 19:30:10
USB Serial device disconnect causes IRQ disable | |||
|
Hi I don't have any driver modules. I have everything built into kernel. When can this kind of IRQ disable happen, what causes this. The issue happened because of hotplugging my device but the device works fine. usb_register(driver) might have caused the issue. How do we debug this problem. Thanks Amruth p.v --- On Wed, 8/20/08, Oliver Neukum <oliver (~=~) neukum.org> wrote: > From: Oliver Neukum <oliver (~=~) neukum.org> > Subject: Re: USB Serial device disconnect causes IRQ disable > To: amruth_pv (~=~) yahoo.com > Cc: linux-usb (~=~) vger.kernel.org, linux-kernel (~=~) vger.kernel.org > Date: Wednesday, August 20, 2008, 3:23 PM > Am Mittwoch 20 August 2008 21:34:51 schrieb amruth: >> Hi >> I again encountered the same issue IRQ23 disabled. >> Here is my /proc/interrupts > > There is some unknown interrupt on 23. Try unloading > drivers until it works. You can sort of bisect it if you > divide > your loaded modules in groups. > > Regards > Oliver > -- > To unsubscribe from this list: send the line > "unsubscribe linux-kernel" in > the body of a message to majordomo (~=~) vger.kernel.org > More majordomo info at > http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
Oliver Neukum wrote at: 2008-08-21 00:20:07
USB Serial device disconnect causes IRQ disable | |||
|
Am Donnerstag 21 August 2008 02:18:37 schrieb amruth: > Hi > I don't have any driver modules. I have everything built into kernel. > When can this kind of IRQ disable happen, what causes this. The issue happened because of hotplugging my device but the device works fine. > usb_register(driver) might have caused the issue. How do we debug this problem. What happens when you never plug in the device? I think you have another device causing interrupts whose driver doesn't handle them. While the usb host controller is busy due to your device, it generates enough interrupts to keep the logic for detection of spurious interrupts happy. When you unplug your device you get too many unhandled interrupts. Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
Oliver Neukum wrote at: 2008-08-21 01:10:05
USB Serial device disconnect causes IRQ disable | |||
|
Am Donnerstag 21 August 2008 08:03:57 schrieb amruth: >> What happens when you never plug in the device? > Everything works fine without plugging the device. I have memory stick > which never creates any problem. OK, do you have any other USB device on the same bus as your serial converter? Regards Oliver -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
amruth wrote at: 2008-08-21 01:10:08
USB Serial device disconnect causes IRQ disable | |||
|
Hi Oliver > What happens when you never plug in the device? Everything works fine without plugging the device. I have memory stick which never creates any problem. > I think you have another device causing interrupts whose > driver doesn't handle them. While the usb host controller is > busy due to your device, it generates enough interrupts to keep the > logic for detection of spurious interrupts happy. When you unplug > your device you get too many unhandled interrupts. I understand the problem because I have 2 devices using the same driver. One device requies only to read from bulk in pipe and other gets null packet interrupt followed by bulk in read to get data. Previously I did only bulk in read for both the devices and no handler for interrupt. When I use together, there is flooding of interrupts coming from the device but unhandled by the driver. I need to separate out both the logics one for interrupt the other to get bulk pipe to read data directly. Thanks Oliver for pointing the issue, I never understood why it happened but I see the data being read from bulk in pipe irrespective of handling interrupts which means we need to read interrupts otherwise spurious interrupts logic detects it and disables the USB bus I have another issue where I need to stop the bulk in read callback when it no longer has data to give to the application because the data length is dynamic. I see that we continue to read without even data in the urb. /* Continue to read if we have still urbs to do. */ port->read_urb->dev = port->serial->dev; result = usb_submit_urb(port->read_urb, GFP_ATOMIC); if (result) err("%s - failed resubmitting read urb, error %d", __FUNCTION__, result); dbg("%s - usb_submit_urb(read urb)", __FUNCTION__); This logic is used in all drivers. After close is called in the application, the driver continues to call read_bulk_in callback function which continues to read and the error "failed resubmitting read urb" is displayed. This particular functions below in close does not kill read_urb and hence the bulk in call back continues to read. usb_kill_urb(port->write_urb); usb_kill_urb(port->read_urb); How to effectively stop urbs submitting read request into USB when no longer data is ther in the transfer buffer. Thanks Amruth p.v --- On Thu, 8/21/08, Oliver Neukum <oliver (~=~) neukum.org> wrote: > From: Oliver Neukum <oliver (~=~) neukum.org> > Subject: Re: USB Serial device disconnect causes IRQ disable > To: amruth_pv (~=~) yahoo.com > Cc: linux-usb (~=~) vger.kernel.org, linux-kernel (~=~) vger.kernel.org > Date: Thursday, August 21, 2008, 12:19 AM > Am Donnerstag 21 August 2008 02:18:37 schrieb amruth: >> Hi >> I don't have any driver modules. I have everything > built into kernel. >> When can this kind of IRQ disable happen, what causes > this. The issue happened because of hotplugging my device > but the device works fine. >> usb_register(driver) might have caused the issue. How > do we debug this problem. > > What happens when you never plug in the device? > I think you have another device causing interrupts whose > driver > doesn't handle them. While the usb host controller is > busy due > to your device, it generates enough interrupts to keep the > logic > for detection of spurious interrupts happy. When you unplug > your > device you get too many unhandled interrupts. > > Regards > Oliver > -- > To unsubscribe from this list: send the line > "unsubscribe linux-kernel" in > the body of a message to majordomo (~=~) vger.kernel.org > More majordomo info at > http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||
|
amruth wrote at: 2008-08-21 01:20:07
USB Serial device disconnect causes IRQ disable | |||
|
> OK, do you have any other USB device on the same bus as > your serial > converter? I have one USB storage flash key device nothing else. The problem is coming from serial convertor and my driver did not handle interrupts. Thanks Amruth p.v --- On Thu, 8/21/08, Oliver Neukum <oliver (~=~) neukum.org> wrote: > From: Oliver Neukum <oliver (~=~) neukum.org> > Subject: Re: USB Serial device disconnect causes IRQ disable > To: amruth_pv (~=~) yahoo.com > Cc: linux-usb (~=~) vger.kernel.org, linux-kernel (~=~) vger.kernel.org > Date: Thursday, August 21, 2008, 1:09 AM > Am Donnerstag 21 August 2008 08:03:57 schrieb amruth: >>> What happens when you never plug in the device? >> Everything works fine without plugging the device. I > have memory stick >> which never creates any problem. > > OK, do you have any other USB device on the same bus as > your serial > converter? > > Regards > Oliver > > -- > To unsubscribe from this list: send the line > "unsubscribe linux-kernel" in > the body of a message to majordomo (~=~) vger.kernel.org > More majordomo info at > http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo (~=~) vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ . |
|||










