freebsd-dev/sys/dev/uart
Marcel Moolenaar eead2d551c Protect against broken hardware. In this particular case, protect against
H/W not de-asserting the interrupt at all. On x86, and because of the
following conditions, this results in a hard hang with interrupts disabled:
1.  The uart(4) driver uses a spin lock to protect against concurrent
    access to the H/W. Spin locks disable and restore interrupts.
2.  Restoring the interrupt on x86 always writes the flags register. Even
    if we're restoring the interrupt from disabled to disabled.
3.  The x86 CPU has a short window in which interrupts are enabled when the
    flags register is written.
4.  The uart(4) driver registers a fast interrupt by default.

To catch this case, we first try to clear any pending H/W interrupts and in
particular, before setting up the interrupt. This makes sure the interrupt
is masked on the PIC. The interrupt handler now has a limit set on the
number of iterations it'll go through to clear interrupt conditions. If the
limit is hit, the handler will return FILTER_SCHEDULE_THREAD. The attach
function will check for this return code and avoid setting up the interrupt
and foce polling in that case.

Obtained from:	Juniper Networks, Inc.
2013-07-10 17:42:20 +00:00
..
uart_bus_acpi.c uart: add resume method and enable it for attachments on the most common 2013-02-02 11:38:26 +00:00
uart_bus_ebus.c
uart_bus_fdt.c Teach UART to attach Exynos/s3/s5 class driver. 2013-06-29 23:48:08 +00:00
uart_bus_isa.c uart: add resume method and enable it for attachments on the most common 2013-02-02 11:38:26 +00:00
uart_bus_pccard.c
uart_bus_pci.c Add support for Intel C600/X79 Series Chipset KT Controller. 2013-04-23 13:03:08 +00:00
uart_bus_puc.c
uart_bus_scc.c
uart_bus.h uart: add resume method and enable it for attachments on the most common 2013-02-02 11:38:26 +00:00
uart_core.c Protect against broken hardware. In this particular case, protect against 2013-07-10 17:42:20 +00:00
uart_cpu_fdt.c Teach UART to attach Exynos/s3/s5 class driver. 2013-06-29 23:48:08 +00:00
uart_cpu_ia64.c
uart_cpu_pc98.c
uart_cpu_powerpc.c
uart_cpu_sparc64.c
uart_cpu_x86.c uart_cpu_amd64.c and uart_cpu_i386.c (under sys/dev/uart) are 2012-04-11 02:42:01 +00:00
uart_cpu.h
uart_dbg.c
uart_dev_imx5xx.h Integrate Efika MX project back to home. 2013-03-20 15:39:27 +00:00
uart_dev_imx.c Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
uart_dev_lpc.c Merging of projects/armv6, part 8 2012-08-15 05:37:10 +00:00
uart_dev_ns8250.c Add support for A10 uart. 2013-03-01 01:42:31 +00:00
uart_dev_pl011.c Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
uart_dev_quicc.c Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
uart_dev_sab82532.c Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
uart_dev_z8530.c Fix low-level uart drivers that set their fifo sizes in the softc too late. 2013-04-01 00:44:20 +00:00
uart_if.m Complete polled-mode operation by using a callout if the device will be 2012-04-12 18:46:48 +00:00
uart_kbd_sun_tables.h
uart_kbd_sun.c
uart_kbd_sun.h
uart_subr.c Teach UART to attach Exynos/s3/s5 class driver. 2013-06-29 23:48:08 +00:00
uart_tty.c
uart.h Teach UART to attach Exynos/s3/s5 class driver. 2013-06-29 23:48:08 +00:00