linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
To: linux-scsi@vger.kernel.org,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	"Matthew R. Ochs" <mrochs@linux.vnet.ibm.com>,
	"Manoj N. Kumar" <manoj@linux.vnet.ibm.com>
Cc: linuxppc-dev@lists.ozlabs.org,
	Brian King <brking@linux.vnet.ibm.com>,
	Ian Munsie <imunsie@au1.ibm.com>,
	Andrew Donnellan <andrew.donnellan@au1.ibm.com>,
	Frederic Barrat <fbarrat@linux.vnet.ibm.com>,
	Christophe Lombard <clombard@linux.vnet.ibm.com>
Subject: [PATCH 2/7] cxlflash: Unmap problem state area before detaching master context
Date: Fri,  4 Mar 2016 15:55:15 -0600	[thread overview]
Message-ID: <1457128520-53056-2-git-send-email-ukrishn@linux.vnet.ibm.com> (raw)
In-Reply-To: <1457128520-53056-1-git-send-email-ukrishn@linux.vnet.ibm.com>

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 <ukrishn@linux.vnet.ibm.com>
---
 drivers/scsi/cxlflash/main.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/cxlflash/main.c b/drivers/scsi/cxlflash/main.c
index 3dbb9fa..ca702d8 100644
--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -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__);
 }
 
@@ -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;
-- 
2.1.0

  reply	other threads:[~2016-03-04 21:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-04 21:53 [PATCH 0/7] Miscellaneous patches to support cxlflash in PowerVM Uma Krishnan
2016-03-04 21:55 ` [PATCH 1/7] cxlflash: Simplify PCI registration Uma Krishnan
2016-03-04 21:55   ` Uma Krishnan [this message]
2016-03-07 18:33     ` [PATCH 2/7] cxlflash: Unmap problem state area before detaching master context Matthew R. Ochs
2016-03-04 21:55   ` [PATCH 3/7] cxlflash: Split out context initialization Uma Krishnan
2016-03-08 17:55     ` Uma Krishnan
2016-03-04 21:55   ` [PATCH 4/7] cxlflash: Simplify attach path error cleanup Uma Krishnan
2016-03-08 17:55     ` Uma Krishnan
2016-03-04 21:55   ` [PATCH 5/7] cxlflash: Reorder user context initialization Uma Krishnan
2016-03-07 18:37     ` Matthew R. Ochs
2016-03-04 21:55   ` [PATCH 6/7] cxlflash: Fix to avoid unnecessary scan with internal LUNs Uma Krishnan
2016-03-07 18:45     ` Matthew R. Ochs
2016-03-08 17:56     ` Uma Krishnan
2016-03-04 21:55   ` [PATCH 7/7] cxlflash: Increase cmd_per_lun for better throughput Uma Krishnan
2016-03-07 18:45     ` Matthew R. Ochs
2016-03-08 17:56     ` Uma Krishnan
2016-03-07 18:30   ` [PATCH 1/7] cxlflash: Simplify PCI registration Matthew R. Ochs
2016-03-08 17:54   ` Uma Krishnan
2016-03-09  2:21 ` [PATCH 0/7] Miscellaneous patches to support cxlflash in PowerVM Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1457128520-53056-2-git-send-email-ukrishn@linux.vnet.ibm.com \
    --to=ukrishn@linux.vnet.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=andrew.donnellan@au1.ibm.com \
    --cc=brking@linux.vnet.ibm.com \
    --cc=clombard@linux.vnet.ibm.com \
    --cc=fbarrat@linux.vnet.ibm.com \
    --cc=imunsie@au1.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=manoj@linux.vnet.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=mrochs@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).