All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sasha Levin <sasha.levin@oracle.com>
To: stable@vger.kernel.org, stable-commits@vger.kernel.org
Cc: Quinn Tran <quinn.tran@qlogic.com>,
	Alexander Gordeev <agordeev@redhat.com>,
	qla2xxx-upstream@qlogic.com, linux-scsi@vger.kernel.org,
	linux-pci@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Sasha Levin <sasha.levin@oracle.com>
Subject: [added to the 4.1 stable tree] qla2xxx: Use pci_enable_msix_range() instead of pci_enable_msix()
Date: Wed,  2 Mar 2016 15:13:41 -0500	[thread overview]
Message-ID: <1456949673-25036-34-git-send-email-sasha.levin@oracle.com> (raw)
In-Reply-To: <1456949673-25036-1-git-send-email-sasha.levin@oracle.com>

From: Quinn Tran <quinn.tran@qlogic.com>

This patch has been added to the 4.1 stable tree. If you have any
objections, please let us know.

===============

[ Upstream commit 84e32a06f4f8756ce9ec3c8dc7e97896575f0771 ]

As result of deprecation of MSI-X/MSI enablement functions
pci_enable_msix() and pci_enable_msi_block() all drivers
using these two interfaces need to be updated to use the
new pci_enable_msi_range()  or pci_enable_msi_exact()
and pci_enable_msix_range() or pci_enable_msix_exact()
interfaces.

Log message code 0x00c6 preserved, although it is reported
after successful call to pci_enable_msix_range(), not before
possibly unsuccessful call to pci_enable_msix(). Consumers
of the error code should not notice the difference.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Cc: qla2xxx-upstream@qlogic.com
Cc: linux-scsi@vger.kernel.org
Cc: linux-pci@vger.kernel.org
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
---
 drivers/scsi/qla2xxx/qla_init.c | 10 +++++-----
 drivers/scsi/qla2xxx/qla_isr.c  |  4 ++--
 drivers/scsi/qla2xxx/qla_mid.c  |  4 ++--
 drivers/scsi/qla2xxx/qla_os.c   |  6 ++++++
 drivers/scsi/qla2xxx/qla_tmpl.c | 16 ++++++++++++++++
 5 files changed, 31 insertions(+), 9 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index b323ad0..60f9651 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2194,7 +2194,7 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 	/* Clear outstanding commands array. */
 	for (que = 0; que < ha->max_req_queues; que++) {
 		req = ha->req_q_map[que];
-		if (!req)
+		if (!req || !test_bit(que, ha->req_qid_map))
 			continue;
 		req->out_ptr = (void *)(req->ring + req->length);
 		*req->out_ptr = 0;
@@ -2211,7 +2211,7 @@ qla2x00_init_rings(scsi_qla_host_t *vha)
 
 	for (que = 0; que < ha->max_rsp_queues; que++) {
 		rsp = ha->rsp_q_map[que];
-		if (!rsp)
+		if (!rsp || !test_bit(que, ha->rsp_qid_map))
 			continue;
 		rsp->in_ptr = (void *)(rsp->ring + rsp->length);
 		*rsp->in_ptr = 0;
@@ -4957,7 +4957,7 @@ qla25xx_init_queues(struct qla_hw_data *ha)
 
 	for (i = 1; i < ha->max_rsp_queues; i++) {
 		rsp = ha->rsp_q_map[i];
-		if (rsp) {
+		if (rsp && test_bit(i, ha->rsp_qid_map)) {
 			rsp->options &= ~BIT_0;
 			ret = qla25xx_init_rsp_que(base_vha, rsp);
 			if (ret != QLA_SUCCESS)
@@ -4972,8 +4972,8 @@ qla25xx_init_queues(struct qla_hw_data *ha)
 	}
 	for (i = 1; i < ha->max_req_queues; i++) {
 		req = ha->req_q_map[i];
-		if (req) {
-		/* Clear outstanding commands array. */
+		if (req && test_bit(i, ha->req_qid_map)) {
+			/* Clear outstanding commands array. */
 			req->options &= ~BIT_0;
 			ret = qla25xx_init_req_que(base_vha, req);
 			if (ret != QLA_SUCCESS)
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 6dc14cd..1f3991b 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2992,9 +2992,9 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 		    "MSI-X: Failed to enable support "
 		    "-- %d/%d\n Retry with %d vectors.\n",
 		    ha->msix_count, ret, ret);
+		ha->msix_count = ret;
+		ha->max_rsp_queues = ha->msix_count - 1;
 	}
-	ha->msix_count = ret;
-	ha->max_rsp_queues = ha->msix_count - 1;
 	ha->msix_entries = kzalloc(sizeof(struct qla_msix_entry) *
 				ha->msix_count, GFP_KERNEL);
 	if (!ha->msix_entries) {
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index cc94192..63abed1 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -601,7 +601,7 @@ qla25xx_delete_queues(struct scsi_qla_host *vha)
 	/* Delete request queues */
 	for (cnt = 1; cnt < ha->max_req_queues; cnt++) {
 		req = ha->req_q_map[cnt];
-		if (req) {
+		if (req && test_bit(cnt, ha->req_qid_map)) {
 			ret = qla25xx_delete_req_que(vha, req);
 			if (ret != QLA_SUCCESS) {
 				ql_log(ql_log_warn, vha, 0x00ea,
@@ -615,7 +615,7 @@ qla25xx_delete_queues(struct scsi_qla_host *vha)
 	/* Delete response queues */
 	for (cnt = 1; cnt < ha->max_rsp_queues; cnt++) {
 		rsp = ha->rsp_q_map[cnt];
-		if (rsp) {
+		if (rsp && test_bit(cnt, ha->rsp_qid_map)) {
 			ret = qla25xx_delete_rsp_que(vha, rsp);
 			if (ret != QLA_SUCCESS) {
 				ql_log(ql_log_warn, vha, 0x00eb,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index e7a97a57..d007255 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -398,6 +398,9 @@ static void qla2x00_free_queues(struct qla_hw_data *ha)
 	int cnt;
 
 	for (cnt = 0; cnt < ha->max_req_queues; cnt++) {
+		if (!test_bit(cnt, ha->req_qid_map))
+			continue;
+
 		req = ha->req_q_map[cnt];
 		qla2x00_free_req_que(ha, req);
 	}
@@ -405,6 +408,9 @@ static void qla2x00_free_queues(struct qla_hw_data *ha)
 	ha->req_q_map = NULL;
 
 	for (cnt = 0; cnt < ha->max_rsp_queues; cnt++) {
+		if (!test_bit(cnt, ha->rsp_qid_map))
+			continue;
+
 		rsp = ha->rsp_q_map[cnt];
 		qla2x00_free_rsp_que(ha, rsp);
 	}
diff --git a/drivers/scsi/qla2xxx/qla_tmpl.c b/drivers/scsi/qla2xxx/qla_tmpl.c
index 962cb89..af806fd 100644
--- a/drivers/scsi/qla2xxx/qla_tmpl.c
+++ b/drivers/scsi/qla2xxx/qla_tmpl.c
@@ -395,6 +395,10 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
 	if (ent->t263.queue_type == T263_QUEUE_TYPE_REQ) {
 		for (i = 0; i < vha->hw->max_req_queues; i++) {
 			struct req_que *req = vha->hw->req_q_map[i];
+
+			if (!test_bit(i, vha->hw->req_qid_map))
+				continue;
+
 			if (req || !buf) {
 				length = req ?
 				    req->length : REQUEST_ENTRY_CNT_24XX;
@@ -408,6 +412,10 @@ qla27xx_fwdt_entry_t263(struct scsi_qla_host *vha,
 	} else if (ent->t263.queue_type == T263_QUEUE_TYPE_RSP) {
 		for (i = 0; i < vha->hw->max_rsp_queues; i++) {
 			struct rsp_que *rsp = vha->hw->rsp_q_map[i];
+
+			if (!test_bit(i, vha->hw->rsp_qid_map))
+				continue;
+
 			if (rsp || !buf) {
 				length = rsp ?
 				    rsp->length : RESPONSE_ENTRY_CNT_MQ;
@@ -634,6 +642,10 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
 	if (ent->t274.queue_type == T274_QUEUE_TYPE_REQ_SHAD) {
 		for (i = 0; i < vha->hw->max_req_queues; i++) {
 			struct req_que *req = vha->hw->req_q_map[i];
+
+			if (!test_bit(i, vha->hw->req_qid_map))
+				continue;
+
 			if (req || !buf) {
 				qla27xx_insert16(i, buf, len);
 				qla27xx_insert16(1, buf, len);
@@ -645,6 +657,10 @@ qla27xx_fwdt_entry_t274(struct scsi_qla_host *vha,
 	} else if (ent->t274.queue_type == T274_QUEUE_TYPE_RSP_SHAD) {
 		for (i = 0; i < vha->hw->max_rsp_queues; i++) {
 			struct rsp_que *rsp = vha->hw->rsp_q_map[i];
+
+			if (!test_bit(i, vha->hw->rsp_qid_map))
+				continue;
+
 			if (rsp || !buf) {
 				qla27xx_insert16(i, buf, len);
 				qla27xx_insert16(1, buf, len);
-- 
2.5.0


  parent reply	other threads:[~2016-03-02 20:15 UTC|newest]

Thread overview: 88+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-02 20:13 [added to the 4.1 stable tree] iommu/vt-d: Fix 64-bit accesses to 32-bit DMAR_GSTS_REG Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ASoC: rt5645: fix the shift bit of IN1 boost Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] cgroup: separate out include/linux/cgroup-defs.h Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] cgroup: make sure a parent css isn't offlined before its children Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] PCI/AER: Flush workqueue on device remove to avoid use-after-free Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] libata: disable forced PORTS_IMPL for >= AHCI 1.3 Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Input: vmmouse - fix absolute device registration Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: cleanup cmd in qla workqueue before processing TMR Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: delay plogi/prli ack until existing sessions are deleted Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: drop cmds/tmrs arrived while session is being deleted Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: Abort stale cmds on qla_tgt_wq when plogi arrives Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: added sess generations to detect RSCN update races Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] qla2xxx: terminate exchange when command is aborted by LIO Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] intel_scu_ipcutil: underflow in scu_reg_access() Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] libata: fix sff host state machine locking while polling Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] MIPS: Fix buffer overflow in syscall_get_arguments() Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] cputime: Prevent 32bit overflow in time[val|spec]_to_cputime() Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ASoC: dpcm: fix the BE state on hw_free Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] target: Remove first argument of target_{get,put}_sess_cmd() Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] target: Fix LUN_RESET active TMR descriptor handling Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Btrfs: fix hang on extent buffer lock caused by the inode_paths ioctl Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] scsi_dh_rdac: always retry MODE SELECT on command lock violation Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] SCSI: Add Marvell Console to VPD blacklist Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: hda - Fix static checker warning in patch_hdmi.c Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Revert "ALSA: hda - Fix noise on Gigabyte Z170X mobo" Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] crypto: user - lock crypto_alg_list on alg dump Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Backport fix for crypto: algif_skcipher - Require setkey before accept(2) Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Backport fix for crypto: algif_skcipher - Add nokey compatibility path Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Backport fix for crypto: algif_skcipher - Remove custom release parent function Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Backport fix for crypto: algif_skcipher - Fix race condition in skcipher_check_key Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] crypto: atmel - use devm_xxx() managed function Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] crypto: atmel - Check for clk_prepare_enable() return value Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] crypto: atmel-sha - remove calls of clk_prepare() from atomic contexts Sasha Levin
2016-03-02 20:13 ` Sasha Levin [this message]
2016-03-02 20:13 ` [added to the 4.1 stable tree] serial: omap: Prevent DoS using unprivileged ioctl(TIOCSRS485) Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] tty: Add support for PCIe WCH382 2S multi-IO card Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] pty: fix possible use after free of tty->driver_data Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] pty: make sure super_block is still valid in final /dev/tty close Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: hda - Fix speaker output from VAIO AiO machines Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] klist: fix starting point removed bug in klist iterators Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: dummy: Implement timer backend switching more safely Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] drm/i915/dsi: defend gpio table against out of bounds access Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] drm/i915/dsi: don't pass arbitrary data to sideband Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] powerpc: Simplify module TOC handling Sasha Levin
2016-03-03  0:59   ` Michael Ellerman
2016-03-03  3:43     ` Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] powerpc: Fix dedotify for binutils >= 2.26 Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: timer: Fix wrong instance passed to slave callbacks Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ARM: 8517/1: ICST: avoid arithmetic overflow in icst_hz() Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: timer: Fix race between stop and interrupt Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: hda - Fix bad dereference of jack object Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] ALSA: timer: Fix race at concurrent reads Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] Revert "workqueue: make sure delayed work run in local cpu" Sasha Levin
2016-03-02 20:13 ` [added to the 4.1 stable tree] phy: core: fix wrong err handle for phy_power_on Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] phy: twl4030-usb: Relase usb phy on unload Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] phy: twl4030-usb: Fix unbalanced pm_runtime_enable on module reload Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ahci: Intel DNV device IDs SATA Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] workqueue: split apply_workqueue_attrs() into 3 stages Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] workqueue: wq_pool_mutex protects the attrs-installation Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] workqueue: handle NUMA_NO_NODE for unbound pool_workqueue lookup Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] drm/radeon: hold reference to fences in radeon_sa_bo_new Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] cifs: fix erroneous return value Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] s390/dasd: prevent incorrect length error under z/VM after PAV changes Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] s390/dasd: fix refcount for PAV reassignment Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ARM: 8519/1: ICST: try other dividends than 1 Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] btrfs: properly set the termination value of ctx->pos in readdir Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ext4: fix potential integer overflow Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ext4: don't read blocks from disk after extents being swapped Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] EVM: Use crypto_memneq() for digest comparisons Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] bio: return EINTR if copying to user space got interrupted Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ALSA: usb-audio: avoid freeing umidi object twice Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] powerpc/eeh: Fix stale cached primary bus Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ALSA: seq: Fix leak of pool buffer at concurrent writes Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ALSA: hda - Cancel probe work instead of flush at remove Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] dmaengine: dw: disable BLOCK IRQs for non-cyclic xfer Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] tracepoints: Do not trace when cpu is offline Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] tracing: Fix freak link error caused by branch tracer Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ALSA: seq: Fix double port list deletion Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] drm/radeon: use post-decrement in error handling Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] drm/qxl: use kmalloc_array to alloc reloc_info in qxl_process_single_command Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] x86/mm: Fix vmalloc_fault() to handle large pages properly Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ALSA: pcm: Fix rwsem deadlock for non-atomic PCM stream Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] mm: fix regression in remap_file_pages() emulation Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ipc,shm: move BUG_ON check into shm_lock Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ipc: convert invalid scenarios to use WARN_ON Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ipc/shm: handle removed segments gracefully in shm_mmap() Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] ext4: fix crashes in dioread_nolock mode Sasha Levin
2016-03-02 20:14 ` [added to the 4.1 stable tree] powerpc/eeh: Fix build error caused by pci_dn Sasha Levin

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=1456949673-25036-34-git-send-email-sasha.levin@oracle.com \
    --to=sasha.levin@oracle.com \
    --cc=agordeev@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=qla2xxx-upstream@qlogic.com \
    --cc=quinn.tran@qlogic.com \
    --cc=stable-commits@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.