]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commit
NVMe: Don't unmap controller registers on reset
authorKeith Busch <keith.busch@intel.com>
Wed, 24 Feb 2016 16:15:52 +0000 (09:15 -0700)
committerKamal Mostafa <kamal@canonical.com>
Thu, 15 Sep 2016 16:32:39 +0000 (09:32 -0700)
commit30d6592fce71beabe18460252c3823747c4742f6
treeefba98840643430e371b3d8e24ddee9cc0771bc7
parent7a100d5429ddb99c684b2107639c383cb4d7f935
NVMe: Don't unmap controller registers on reset

BugLink: http://bugs.launchpad.net/bugs/1621113
Commit b00a726a9fd82ddd4c10344e46f0d371e1674303 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
[c000007f7a9a3bb0d00000000072572c nvme_setup_io_queues+0xc08/0x1218 [nvme]
[c000007f7a9a3c70c00000000006bbd8 process_one_work+0x228/0x378
[c000007f7a9a3d00c00000000006c050 worker_thread+0x2e0/0x420
[c000007f7a9a3d80c00000000007161c kthread+0xfc/0x108
[c000007f7a9a3e30c0000000000094b4 ret_from_kernel_thread+0x5c/0xa8

Signed-off-by: Keith Busch <keith.busch@intel.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
Signed-off-by: Gabriel Krisman Bertazi <krisman@linux.vnet.ibm.com>
[Backport to v4.4.y]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
[Backport to Ubuntu Xenial]
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/nvme/host/pci.c