stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Patch "[PATCH 100/135] cxlflash: Fix to avoid unnecessary scan with internal" has been added to the 4.4-stable tree
@ 2016-09-09 13:38 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-09-09 13:38 UTC (permalink / raw)
  To: manoj, alexander.levin, gregkh, martin.petersen, mrochs, ukrishn
  Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    [PATCH 100/135] cxlflash: Fix to avoid unnecessary scan with internal

to the 4.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     0100-cxlflash-Fix-to-avoid-unnecessary-scan-with-internal.patch
and it can be found in the queue-4.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From 635ddd20e481eec6a5fe6b33253abb0d1f174660 Mon Sep 17 00:00:00 2001
From: "Manoj N. Kumar" <manoj@linux.vnet.ibm.com>
Date: Fri, 4 Mar 2016 15:55:19 -0600
Subject: [PATCH 100/135] cxlflash: Fix to avoid unnecessary scan with internal
 LUNs

[ Upstream commit 603ecce95f4817074a724a889cd88c3c8210f933 ]

When switching to the internal LUN defined on the
IBM CXL flash adapter, there is an unnecessary
scan occurring on the second port. This scan leads
to the following extra lines in the log:

Dec 17 10:09:00 tul83p1 kernel: [ 3708.561134] cxlflash 0008:00:00.0: cxlflash_queuecommand: (scp=c0000000fc1f0f00) 11/1/0/0 cdb=(A0000000-00000000-10000000-00000000)
Dec 17 10:09:00 tul83p1 kernel: [ 3708.561147] process_cmd_err: cmd failed afu_rc=32 scsi_rc=0 fc_rc=0 afu_extra=0xE, scsi_extra=0x0, fc_extra=0x0

By definition, both of the internal LUNs are on the first port/channel.

When the lun_mode is switched to internal LUN the
same value for host->max_channel is retained. This
causes an unnecessary scan over the second port/channel.

This fix alters the host->max_channel to 0 (1 port), if internal
LUNs are configured and switches it back to 1 (2 ports) while
going back to external LUNs.

Signed-off-by: Manoj N. Kumar <manoj@linux.vnet.ibm.com>
Acked-by: Matthew R. Ochs <mrochs@linux.vnet.ibm.com>
Reviewed-by: Uma Krishnan <ukrishn@linux.vnet.ibm.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/scsi/cxlflash/main.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

--- a/drivers/scsi/cxlflash/main.c
+++ b/drivers/scsi/cxlflash/main.c
@@ -2149,6 +2149,16 @@ static ssize_t lun_mode_store(struct dev
 	rc = kstrtouint(buf, 10, &lun_mode);
 	if (!rc && (lun_mode < 5) && (lun_mode != afu->internal_lun)) {
 		afu->internal_lun = lun_mode;
+
+		/*
+		 * When configured for internal LUN, there is only one channel,
+		 * channel number 0, else there will be 2 (default).
+		 */
+		if (afu->internal_lun)
+			shost->max_channel = 0;
+		else
+			shost->max_channel = NUM_FC_PORTS - 1;
+
 		afu_reset(cfg);
 		scsi_scan_host(cfg->host);
 	}


Patches currently in stable-queue which might be from manoj@linux.vnet.ibm.com are

queue-4.4/0026-cxlflash-a-couple-off-by-one-bugs.patch
queue-4.4/0115-cxlflash-Fix-to-resolve-dead-lock-during-EEH-recover.patch
queue-4.4/0045-cxlflash-Resolve-oops-in-wait_port_offline.patch
queue-4.4/0046-cxlflash-Enable-device-id-for-future-IBM-CXL-adapter.patch
queue-4.4/0100-cxlflash-Fix-to-avoid-unnecessary-scan-with-internal.patch
queue-4.4/0044-cxlflash-Fix-to-resolve-cmd-leak-after-host-reset.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-09-09 13:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09 13:38 Patch "[PATCH 100/135] cxlflash: Fix to avoid unnecessary scan with internal" has been added to the 4.4-stable tree gregkh

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).