]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
serial: 8250_pci: Detach low-level driver during PCI error recovery
authorGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Mon, 28 Nov 2016 21:34:42 +0000 (19:34 -0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 29 Nov 2016 19:20:07 +0000 (20:20 +0100)
commitf209fa03fc9d131b3108c2e4936181eabab87416
tree496ad5de5cccecd1ba1ab8a31301722c45d0fe4e
parentef510bea5f6c16663428d914699935bdd7913de8
serial: 8250_pci: Detach low-level driver during PCI error recovery

During a PCI error recovery, like the ones provoked by EEH in the ppc64
platform, all IO to the device must be blocked while the recovery is
completed.  Current 8250_pci implementation only suspends the port
instead of detaching it, which doesn't prevent incoming accesses like
TIOCMGET and TIOCMSET calls from reaching the device.  Those end up
racing with the EEH recovery, crashing it.  Similar races were also
observed when opening the device and when shutting it down during
recovery.

This patch implements a more robust IO blockage for the 8250_pci
recovery by unregistering the port at the beginning of the procedure and
re-adding it afterwards.  Since the port is detached from the uart
layer, we can be sure that no request will make through to the device
during recovery.  This is similar to the solution used by the JSM serial
driver.

I thank Peter Hurley <peter@hurleysoftware.com> for valuable input on
this one over one year ago.

Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/8250/8250_pci.c