• Keith Busch's avatar
    NVMe: Don't unmap controller registers on reset · 30d6592f
    Keith Busch authored
    BugLink: http://bugs.launchpad.net/bugs/1621113
    
    Commit b00a726a upstream.
    
    Unmapping the registers on reset or shutdown is not necessary. Keeping
    the mapping simplifies reset handling.
    
    This was backported to 4.4 stable tree because it prevents a race
    between the reset_work and the shutdown hook, that may provoke the Oops
    below, in the nvme_wait_ready function.
    
    The Oops is easily reproducible on systems that will kexec/reboot
    immediately after booting, which is actually the common use case for
    kexec based bootloaders, like Petitboot.  This patch removes the
    unnecessary early unmapping of the PCI configuration in the shutdown
    hook, allowing a proper handling of the reset work.
    
    Unable to handle kernel paging request for data at address 0x0000001c
    Faulting instruction address: 0xd000000000720b38
    cpu 0x1b: Vector: 300 (Data Access) at [c000007f7a9a38a0]
        pc: d000000000720b38: nvme_wait_ready+0x50/0x120 [nvme]
        lr: d000000000720b7c: nvme_wait_ready+0x94/0x120 [nvme]
        sp: c000007f7a9a3b20
       msr: 9000000000009033
       dar: 1c
     dsisr: 40000000
      current = 0xc000007f7a926c80
      paca    = 0xc00000000fe85100   softe: 0        irq_happened: 0x01
        pid   = 2608, comm = kworker/27:1
    enter ? for help
    [c000007f7a9a3bb0] d00000000072572c nvme_setup_io_queues+0xc08/0x1218 [nvme]
    [c000007f7a9a3c70] c00000000006bbd8 process_one_work+0x228/0x378
    [c000007f7a9a3d00] c00000000006c050 worker_thread+0x2e0/0x420
    [c000007f7a9a3d80] c00000000007161c kthread+0xfc/0x108
    [c000007f7a9a3e30] c0000000000094b4 ret_from_kernel_thread+0x5c/0xa8
    Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
    Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Signed-off-by: default avatarJens Axboe <axboe@fb.com>
    Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
    	[Backport to v4.4.y]
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    	[Backport to Ubuntu Xenial]
    Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
    Signed-off-by: default avatarKamal Mostafa <kamal@canonical.com>
    30d6592f
pci.c 56.1 KB