Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hannes Reinecke and committed by
Christoph Hellwig
755f516b 22ffeb48

+6 -1
+6 -1
drivers/scsi/qla2xxx/qla_os.c
··· 2661 2661 else 2662 2662 host->max_cmd_len = MAX_CMDSZ; 2663 2663 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; 2665 2670 host->transportt = qla2xxx_transport_template; 2666 2671 sht->vendor_id = (SCSI_NL_VID_TYPE_PCI | PCI_VENDOR_ID_QLOGIC); 2667 2672