* Thecus n2100 uart irq? @ 2009-09-23 12:36 Mikael Pettersson 2009-09-23 13:07 ` Lennert Buytenhek 2009-09-23 13:13 ` Aaro Koskinen 0 siblings, 2 replies; 4+ messages in thread From: Mikael Pettersson @ 2009-09-23 12:36 UTC (permalink / raw) To: linux-arm-kernel The plat_serial8250_port data in mach-iop32x/n2100.c stores a zero in the .irq field. This causes the 8250 serial driver to run the serial console in irq-less mode with a high-frequency polling timer. According to /proc/timer_stats on my n2100, the 8250 polling timer generates more timeouts than any other timer in my kernel, and about 10 times more timeouts than the second most active timer. Apart from the constant CPU overhead, this prevents CONFIG_NO_HZ (in my pending plat-iop clocksource/clockevents conversion) from being effective: the frequent timeouts keeps the timer interrupt rate just as high as in the NO_HZ case. The other mach-iop32x machines use one of the IRQ_IOP32X_XINT[0-3] interrupts for their uarts. I've tried all four values on the n2100, but none of them seemed to work: the console would go silent when the kernel starts init. Does anyone know how run the n2100 uart properly with an irq? /Mikael ^ permalink raw reply [flat|nested] 4+ messages in thread
* Thecus n2100 uart irq? 2009-09-23 12:36 Thecus n2100 uart irq? Mikael Pettersson @ 2009-09-23 13:07 ` Lennert Buytenhek 2009-09-24 13:15 ` Mikael Pettersson 2009-09-23 13:13 ` Aaro Koskinen 1 sibling, 1 reply; 4+ messages in thread From: Lennert Buytenhek @ 2009-09-23 13:07 UTC (permalink / raw) To: linux-arm-kernel On Wed, Sep 23, 2009 at 02:36:12PM +0200, Mikael Pettersson wrote: > The plat_serial8250_port data in mach-iop32x/n2100.c stores > a zero in the .irq field. This causes the 8250 serial driver > to run the serial console in irq-less mode with a high-frequency > polling timer. > > According to /proc/timer_stats on my n2100, the 8250 polling > timer generates more timeouts than any other timer in my kernel, > and about 10 times more timeouts than the second most active > timer. > > Apart from the constant CPU overhead, this prevents CONFIG_NO_HZ > (in my pending plat-iop clocksource/clockevents conversion) from > being effective: the frequent timeouts keeps the timer interrupt > rate just as high as in the NO_HZ case. > > The other mach-iop32x machines use one of the IRQ_IOP32X_XINT[0-3] > interrupts for their uarts. I've tried all four values on the n2100, > but none of them seemed to work: the console would go silent when > the kernel starts init. The XINT interrupt sources are interrupt sources for external pins on the SoC (GPIO-like). On the Thecus, the serial port IRQ is not hooked up by default (but see below), so that explains why that wouldn't work. > Does anyone know how run the n2100 uart properly with an irq? If I recall correctly (it's been a while), then on the n2100, there is one XINT line that can either be jumpered to hook up to the serial port IRQ or to the interrupt line of one of the USB controllers, and the default is to connect to the USB controller interrupt line. Note that when I last looked, the 8250 driver had the option to work in irq-less mode but the USB *HCI drivers didn't, so the only way to get serial to run irq-less was to break USB. I suppose that that's still true, but if the serial and USB controller interrupt output are both open drain or so (please check the datasheets to see if that's true, as I don't know), you could perhaps just tie the three pins together, and have the 8250 and the USB *HCI drivers use the same IRQ number. (If you're not sure whether they are, then you could test by tying them together with suitably large resistors, and seeing how much current you end up drawing.) ^ permalink raw reply [flat|nested] 4+ messages in thread
* Thecus n2100 uart irq? 2009-09-23 13:07 ` Lennert Buytenhek @ 2009-09-24 13:15 ` Mikael Pettersson 0 siblings, 0 replies; 4+ messages in thread From: Mikael Pettersson @ 2009-09-24 13:15 UTC (permalink / raw) To: linux-arm-kernel Lennert Buytenhek writes: > On Wed, Sep 23, 2009 at 02:36:12PM +0200, Mikael Pettersson wrote: > > > The plat_serial8250_port data in mach-iop32x/n2100.c stores > > a zero in the .irq field. This causes the 8250 serial driver > > to run the serial console in irq-less mode with a high-frequency > > polling timer. > > > > According to /proc/timer_stats on my n2100, the 8250 polling > > timer generates more timeouts than any other timer in my kernel, > > and about 10 times more timeouts than the second most active > > timer. > > > > Apart from the constant CPU overhead, this prevents CONFIG_NO_HZ > > (in my pending plat-iop clocksource/clockevents conversion) from > > being effective: the frequent timeouts keeps the timer interrupt > > rate just as high as in the NO_HZ case. > > > > The other mach-iop32x machines use one of the IRQ_IOP32X_XINT[0-3] > > interrupts for their uarts. I've tried all four values on the n2100, > > but none of them seemed to work: the console would go silent when > > the kernel starts init. > > The XINT interrupt sources are interrupt sources for external pins on > the SoC (GPIO-like). On the Thecus, the serial port IRQ is not hooked > up by default (but see below), so that explains why that wouldn't work. > > > > Does anyone know how run the n2100 uart properly with an irq? > > If I recall correctly (it's been a while), then on the n2100, there > is one XINT line that can either be jumpered to hook up to the serial > port IRQ or to the interrupt line of one of the USB controllers, and > the default is to connect to the USB controller interrupt line. I've done some experiments now. The n2100 has 3 USB controllers, 2 UHCI and 1 EHCI, and 3 USB ports. The EHCI is on irq 29 shared with the SiL SATA controller, and one of the UHCIs is on irq 27 shared with the RTL gigaether controller. With the jumper in the J3 position, irq 28 goes to the second UHCI. In this configuration each USB port will accept both high-speed and low-speed devices. The UHCI on irq 28 handles the rear two ports and the UHCI on irq 27 handles the front port. The serial console has no irq so runs with a high-frequency polling timer. With the jumper in the J4 position, irq 28 goes to the UART. Each USB port will still accept high-speed devices (tested with a memory stick and an ethernet dongle), but only the front port will accept low-speed devices (tested with a mouse). The serial console has an irq so the polling timer is gone. I'll run my n2100 with the jumper in J4 from now on. > I suppose that that's still true, but if the serial and USB controller > interrupt output are both open drain or so (please check the datasheets > to see if that's true, as I don't know), you could perhaps just tie the > three pins together, and have the 8250 and the USB *HCI drivers use the > same IRQ number. (If you're not sure whether they are, then you could > test by tying them together with suitably large resistors, and seeing > how much current you end up drawing.) I don't need the second UHCI controller so I'm leaving that experiment aside for now. A crude patch to reassign irq 28 to the uart follows below. Is this something that might be interesting for others? If so, then perhaps it should be a config option or a command line parameter? /Mikael --- linux-2.6.31/arch/arm/mach-iop32x/n2100.c.~1~ 2009-09-24 11:57:17.000000000 +0200 +++ linux-2.6.31/arch/arm/mach-iop32x/n2100.c 2009-09-24 12:02:19.000000000 +0200 @@ -94,7 +94,11 @@ n2100_pci_map_irq(struct pci_dev *dev, u irq = IRQ_IOP32X_XINT2; } else if (PCI_SLOT(dev->devfn) == 4 && pin == 1) { /* VT6212 INTA */ +#if 1 /* J4 */ + irq = -1; +#else irq = IRQ_IOP32X_XINT1; +#endif } else if (PCI_SLOT(dev->devfn) == 4 && pin == 2) { /* VT6212 INTB */ irq = IRQ_IOP32X_XINT0; @@ -176,7 +180,11 @@ static struct plat_serial8250_port n2100 { .mapbase = N2100_UART, .membase = (char *)N2100_UART, +#if 1 /* J4 */ + .irq = IRQ_IOP32X_XINT1, +#else .irq = 0, +#endif .flags = UPF_SKIP_TEST, .iotype = UPIO_MEM, .regshift = 0, ^ permalink raw reply [flat|nested] 4+ messages in thread
* Thecus n2100 uart irq? 2009-09-23 12:36 Thecus n2100 uart irq? Mikael Pettersson 2009-09-23 13:07 ` Lennert Buytenhek @ 2009-09-23 13:13 ` Aaro Koskinen 1 sibling, 0 replies; 4+ messages in thread From: Aaro Koskinen @ 2009-09-23 13:13 UTC (permalink / raw) To: linux-arm-kernel Hello, Mikael Pettersson wrote: > The other mach-iop32x machines use one of the IRQ_IOP32X_XINT[0-3] > interrupts for their uarts. I've tried all four values on the n2100, > but none of them seemed to work: the console would go silent when > the kernel starts init. > > Does anyone know how run the n2100 uart properly with an irq? I found the following mention from OpenBSD installation instructions: "On the Thecus N2100, it is necessary to move jumper J3 to J4 to properly route the serial port interrupt to allow serial to work under OpenBSD." And they seem to use XINT3 (not sure if looked at the right place). Some Debian instructions recommend the opposite jumper position, without giving any reasons. A. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-09-24 13:15 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2009-09-23 12:36 Thecus n2100 uart irq? Mikael Pettersson 2009-09-23 13:07 ` Lennert Buytenhek 2009-09-24 13:15 ` Mikael Pettersson 2009-09-23 13:13 ` Aaro Koskinen
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).