public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Don Brace <don.brace@pmcs.com>
To: hch@infradead.org, webb.scales@hp.com,
	james.bottomley@parallels.com, brace@pmcs.com
Cc: linux-scsi@vger.kernel.org
Subject: [PATCH 12/13] hpsa: always call pci_set_master after pci_enable_device
Date: Fri, 14 Nov 2014 17:27:24 -0600	[thread overview]
Message-ID: <20141114232724.20808.42206.stgit@don-ProLiant-MicroServer-Gen8> (raw)
In-Reply-To: <20141114231145.20808.76898.stgit@don-ProLiant-MicroServer-Gen8>

From: Robert Elliott <elliott@hp.com>

If the kernel is booted with the reset_device parameter, which
is done for kdump, then the driver needs to call pci_set_master
after pci_enable_device to reenable bus mastering (since
the preceding pci_disable_device call disables bus mastering).

Also, place that after pci_request_regions both in the
kdump code and the normal pci_init code.

Remove the comment summarizing what pci_set_master
does, with the incomplete commentary on the impact of
pci_disable_device.

Signed-off-by: Robert Elliott <elliott@hp.com>
Signed-off-by: Don Brace <don.brace@pmcs.com>
Reviewed-by: Don Brace <don.brace@pmcs.com>
---
 drivers/scsi/hpsa.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 761612d..72daca9 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6363,15 +6363,15 @@ static int hpsa_pci_init(struct ctlr_info *h)
 		return err;
 	}
 
-	/* Enable bus mastering (pci_disable_device may disable this) */
-	pci_set_master(h->pdev);
-
 	err = pci_request_regions(h->pdev, HPSA);
 	if (err) {
 		dev_err(&h->pdev->dev,
 			"cannot obtain PCI resources, aborting\n");
 		return err;
 	}
+
+	pci_set_master(h->pdev);
+
 	hpsa_interrupt_mode(h);
 	err = hpsa_pci_find_memory_BAR(h->pdev, &h->paddr);
 	if (err)
@@ -6451,7 +6451,9 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
 		dev_warn(&pdev->dev, "failed to enable device.\n");
 		return -ENODEV;
 	}
+
 	pci_set_master(pdev);
+
 	/* Reset the controller with a PCI power-cycle or via doorbell */
 	rc = hpsa_kdump_hard_reset_controller(pdev);
 


  parent reply	other threads:[~2014-11-14 23:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-14 23:26 [PATCH 00/13] hpsa update Don Brace
2014-11-14 23:26 ` [PATCH 01/13] hpsa: Clean up warnings from sparse Don Brace
2014-11-14 23:26 ` [PATCH 02/13] hpsa: remove dev_warn prints from RAID-1ADM Don Brace
2014-11-14 23:26 ` [PATCH 03/13] hpsa: fix a couple pci id table mistakes Don Brace
2014-11-14 23:26 ` [PATCH 04/13] hpsa: correct off-by-one sizing of chained SG block Don Brace
2014-11-14 23:26 ` [PATCH 05/13] hpsa: remove 'action required' phrasing Don Brace
2014-11-14 23:26 ` [PATCH 06/13] hpsa: fix allocation sizes for CISS_REPORT_LUNs commands Don Brace
2014-11-14 23:26 ` [PATCH 07/13] hpsa: fix endianness issue with scatter gather elements Don Brace
2014-11-14 23:27 ` [PATCH 08/13] hpsa: get rid of type/attribute/direction bit field where possible Don Brace
2014-11-14 23:27 ` [PATCH 09/13] hpsa: use atomics for commands_outstanding Don Brace
2014-11-14 23:27 ` [PATCH 10/13] hpsa: do not be so noisy about check conditions Don Brace
2014-11-14 23:27 ` [PATCH 11/13] hpsa: Convert SCSI LLD ->queuecommand() for host_lock less operation Don Brace
2014-11-14 23:27 ` Don Brace [this message]
2014-11-14 23:27 ` [PATCH 13/13] hpsa: remove spin lock around command allocation Don Brace
2014-11-20 15:55 ` [PATCH 00/13] hpsa update Christoph Hellwig
2014-11-24 19:22   ` brace

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=20141114232724.20808.42206.stgit@don-ProLiant-MicroServer-Gen8 \
    --to=don.brace@pmcs.com \
    --cc=brace@pmcs.com \
    --cc=hch@infradead.org \
    --cc=james.bottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=webb.scales@hp.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