Date: Sat, 2 Feb 2013 11:38:27 +0000 (UTC) From: Andriy Gapon <avg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r246243 - head/sys/dev/uart Message-ID: <201302021138.r12BcRwr025576@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: avg Date: Sat Feb 2 11:38:26 2013 New Revision: 246243 URL: http://svnweb.freebsd.org/changeset/base/246243 Log: uart: add resume method and enable it for attachments on the most common x86 buses Otherwise the uart hardware could be in such a state after the resume where IER is cleared and thus no interrupts are generated. This behavior is observed and tested with QEMU, so I am comitting this change to help with my debugging. There has been no feedback from users of serial ports on real hardware. MFC after: 20 days Modified: head/sys/dev/uart/uart_bus.h head/sys/dev/uart/uart_bus_acpi.c head/sys/dev/uart/uart_bus_isa.c head/sys/dev/uart/uart_bus_pci.c head/sys/dev/uart/uart_core.c Modified: head/sys/dev/uart/uart_bus.h ============================================================================== --- head/sys/dev/uart/uart_bus.h Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus.h Sat Feb 2 11:38:26 2013 (r246243) @@ -138,6 +138,7 @@ extern char uart_driver_name[]; int uart_bus_attach(device_t dev); int uart_bus_detach(device_t dev); +int uart_bus_resume(device_t dev); serdev_intr_t *uart_bus_ihand(device_t dev, int ipend); int uart_bus_ipend(device_t dev); int uart_bus_probe(device_t dev, int regshft, int rclk, int rid, int chan); Modified: head/sys/dev/uart/uart_bus_acpi.c ============================================================================== --- head/sys/dev/uart/uart_bus_acpi.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_acpi.c Sat Feb 2 11:38:26 2013 (r246243) @@ -47,6 +47,7 @@ static device_method_t uart_acpi_methods DEVMETHOD(device_probe, uart_acpi_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_bus_isa.c ============================================================================== --- head/sys/dev/uart/uart_bus_isa.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_isa.c Sat Feb 2 11:38:26 2013 (r246243) @@ -50,6 +50,7 @@ static device_method_t uart_isa_methods[ DEVMETHOD(device_probe, uart_isa_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_bus_pci.c ============================================================================== --- head/sys/dev/uart/uart_bus_pci.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_bus_pci.c Sat Feb 2 11:38:26 2013 (r246243) @@ -51,6 +51,7 @@ static device_method_t uart_pci_methods[ DEVMETHOD(device_probe, uart_pci_probe), DEVMETHOD(device_attach, uart_bus_attach), DEVMETHOD(device_detach, uart_bus_detach), + DEVMETHOD(device_resume, uart_bus_resume), { 0, 0 } }; Modified: head/sys/dev/uart/uart_core.c ============================================================================== --- head/sys/dev/uart/uart_core.c Sat Feb 2 11:35:18 2013 (r246242) +++ head/sys/dev/uart/uart_core.c Sat Feb 2 11:38:26 2013 (r246243) @@ -590,3 +590,12 @@ uart_bus_detach(device_t dev) return (0); } + +int +uart_bus_resume(device_t dev) +{ + struct uart_softc *sc; + + sc = device_get_softc(dev); + return (UART_ATTACH(sc)); +}
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302021138.r12BcRwr025576>