]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
cxlflash: Fix regression issue with re-ordering patch
authorManoj N. Kumar <manoj@linux.vnet.ibm.com>
Fri, 24 Jun 2016 16:34:55 +0000 (10:34 -0600)
committerKamal Mostafa <kamal@canonical.com>
Tue, 28 Jun 2016 17:44:57 +0000 (10:44 -0700)
commit7b6493485ca3e663d18a551aea04756972c047cc
treef9f67e0305cde8eaefefa36e48d2a82e2ab7e590
parent61151724156a3a21b7bfe7d853ed4f3befae3dd4
cxlflash: Fix regression issue with re-ordering patch

BugLink: http://bugs.launchpad.net/bugs/1592114
While running 'sg_reset -H' back to back the following exception was seen:

[  735.115695] Faulting instruction address: 0xd0000000098c0864
cpu 0x0: Vector: 300 (Data Access) at [c000000ffffafa80]
    pc: d0000000098c0864: cxlflash_async_err_irq+0x84/0x5c0 [cxlflash]
    lr: c00000000013aed0: handle_irq_event_percpu+0xa0/0x310
    sp: c000000ffffafd00
   msr: 9000000000009033
   dar: 2010000
 dsisr: 40000000
  current = 0xc000000001510880
  paca    = 0xc00000000fb80000   softe: 0        irq_happened: 0x01
    pid   = 0, comm = swapper/0

Linux version 4.5.0-491-26f710d+

enter ? for help
[c000000ffffafe10c00000000013aed0 handle_irq_event_percpu+0xa0/0x310
[c000000ffffafed0c00000000013b1a8 handle_irq_event+0x68/0xc0
[c000000ffffaff00c0000000001404ec handle_fasteoi_irq+0xec/0x2a0
[c000000ffffaff30c00000000013a084 generic_handle_irq+0x54/0x80
[c000000ffffaff60c000000000011130 __do_irq+0x80/0x1d0
[c000000ffffaff90c000000000024d40 call_do_irq+0x14/0x24
[c000000001573a20c000000000011318 do_IRQ+0x98/0x140
[c000000001573a70c000000000002594 hardware_interrupt_common+0x114/0x180

This exception is being hit because the async_err interrupt path performs
an MMIO to read the interrupt status register. The MMIO region in this
case is not available.

Commit 6ded8b3cbd9a ("cxlflash: Unmap problem state area before detaching
master context") re-ordered the sequence in which term_mc() and stop_afu()
are called. This introduces a window for interrupts to come in with the
problem space area unmapped, that did not exist previously.

The fix is to separate the disabling of all AFU interrupts to a distinct
function, term_intr() so that it is the first thing that is done in the
tear down process.

To keep the initialization process symmetric, separate the AFU interrupt
setup also to a distinct function: init_intr().

Fixes: 6ded8b3cbd9a ("cxlflash: Unmap problem state area before detaching master context")
Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
(cherry picked from commit 9526f36026f778e82b5175249443854c03b2e660)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
drivers/scsi/cxlflash/main.c
drivers/scsi/cxlflash/main.h