Skip to content

Commit

Permalink
cxlflash: Unmap problem state area before detaching master context
Browse files Browse the repository at this point in the history
When operating in the PowerVM environment, the cxlflash module can
receive an error from the hypervisor indicating that there are
existing mappings in the page table for the process MMIO space.

This issue exists because term_afu() currently invokes term_mc()
before stop_afu(), allowing for the master context to be detached
first and the problem state area to be unmapped second.

To resolve this issue, stop_afu() should be called before term_mc().

Signed-off-by: Uma Krishnan <[email protected]>
Acked-by: Matthew R. Ochs <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
  • Loading branch information
umakrishn authored and martinkpetersen committed Mar 9, 2016
1 parent 961487e commit 6ded8b3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/scsi/cxlflash/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -726,11 +726,11 @@ static void term_mc(struct cxlflash_cfg *cfg, enum undo_level level)
*/
static void term_afu(struct cxlflash_cfg *cfg)
{
term_mc(cfg, UNDO_START);

if (cfg->afu)
stop_afu(cfg);

term_mc(cfg, UNDO_START);

pr_debug("%s: returning\n", __func__);
}

Expand Down Expand Up @@ -2492,8 +2492,8 @@ static pci_ers_result_t cxlflash_pci_error_detected(struct pci_dev *pdev,
if (unlikely(rc))
dev_err(dev, "%s: Failed to mark user contexts!(%d)\n",
__func__, rc);
term_mc(cfg, UNDO_START);
stop_afu(cfg);
term_mc(cfg, UNDO_START);
return PCI_ERS_RESULT_NEED_RESET;
case pci_channel_io_perm_failure:
cfg->state = STATE_FAILTERM;
Expand Down

0 comments on commit 6ded8b3

Please sign in to comment.