Skip to content

Commit 755f516

Browse files
hreineckeChristoph Hellwig
authored andcommitted
qla2xxx: Restrict max_lun to 16-bit for older HBAs
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: Ewan Milne <emilne@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent 22ffeb4 commit 755f516

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎drivers/scsi/qla2xxx/qla_os.c‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2661,7 +2661,12 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
26612661
else
26622662
host->max_cmd_len = MAX_CMDSZ;
26632663
host->max_channel = MAX_BUSES - 1;
2664-
host->max_lun = ql2xmaxlun;
2664+
/* Older HBAs support only 16-bit LUNs */
2665+
if (!IS_QLAFX00(ha) && !IS_FWI2_CAPABLE(ha) &&
2666+
ql2xmaxlun > 0xffff)
2667+
host->max_lun = 0xffff;
2668+
else
2669+
host->max_lun = ql2xmaxlun;
26652670
host->transportt = qla2xxx_transport_template;
26662671
sht->vendor_id = (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC);
26672672

0 commit comments

Comments
 (0)