• Gabriel Krisman Bertazi's avatar
    serial: 8250_pci: Detach low-level driver during PCI error recovery · b6580bd9
    Gabriel Krisman Bertazi authored
    commit f209fa03 upstream.
    
    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: default avatarGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    b6580bd9
8250_pci.c 129 KB