linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: James Bottomley <jbottomley@parallels.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Ewan Milne <emilne@redhat.com>,
	linux-scsi@vger.kernel.org, Hannes Reinecke <hare@suse.de>
Subject: [PATCH 3/6] qla2xxx: Restrict max_lun to 16-bit for older HBAs
Date: Sat, 31 May 2014 11:01:15 +0200	[thread overview]
Message-ID: <1401526878-119472-4-git-send-email-hare@suse.de> (raw)
In-Reply-To: <1401526878-119472-1-git-send-email-hare@suse.de>

Older HBAs are only capable of supporting 16-bit LUNs,
so we need to make sure to adjust max_lun accordingly.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Acked-by: Chad Dupuis <chad.dupuis@qlogic.com>
Reviewed-by: Christoph Hellwig <hch@infradead.org>
Reviewed-by: Ewan Milne <emilne@redhat.com>
---
 drivers/scsi/qla2xxx/qla_os.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 19e99cc..264d97e 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -2656,7 +2656,12 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
 	else
 		host->max_cmd_len = MAX_CMDSZ;
 	host->max_channel = MAX_BUSES - 1;
-	host->max_lun = ql2xmaxlun;
+	/* Older HBAs support only 16-bit LUNs */
+	if (!IS_QLAFX00(ha) && !IS_FWI2_CAPABLE(ha) &&
+	    ql2xmaxlun > 0xffff)
+		host->max_lun = 0xffff;
+	else
+		host->max_lun = ql2xmaxlun;
 	host->transportt = qla2xxx_transport_template;
 	sht->vendor_id = (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC);
 
-- 
1.7.12.4


  parent reply	other threads:[~2014-05-31  9:01 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-31  9:01 [PATCHv3 0/6] Support 64-bit LUNs Hannes Reinecke
2014-05-31  9:01 ` [PATCH 1/6] scsi: Remove CONFIG_SCSI_MULTI_LUN Hannes Reinecke
2014-05-31  9:01 ` [PATCH 2/6] scsi_scan: Restrict sequential scan to 256 LUNs Hannes Reinecke
2014-05-31  9:01 ` Hannes Reinecke [this message]
2014-05-31  9:01 ` [PATCH 4/6] scsi: use 64-bit LUNs Hannes Reinecke
2014-06-02 16:13   ` Bart Van Assche
2014-05-31  9:01 ` [PATCH 5/6] scsi: use 64-bit value for 'max_luns' Hannes Reinecke
2014-05-31  9:01 ` [PATCH 6/6] scsi_scan: Fixup scsilun_to_int() Hannes Reinecke
2014-06-02 16:03   ` James Bottomley
2014-06-02 16:16   ` Bart Van Assche
2014-06-02  8:15 ` [PATCHv3 0/6] Support 64-bit LUNs Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2014-06-03  8:58 [PATCHv4 " Hannes Reinecke
2014-06-03  8:58 ` [PATCH 3/6] qla2xxx: Restrict max_lun to 16-bit for older HBAs Hannes Reinecke

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=1401526878-119472-4-git-send-email-hare@suse.de \
    --to=hare@suse.de \
    --cc=emilne@redhat.com \
    --cc=hch@infradead.org \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@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 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).