Skip to content

Commit 3c0c25b

Browse files
Moore, EricJames Bottomley
authored andcommitted
[SCSI] mptfusion - fix panic in mptsas_slave_configure
Driver panic when RAID logical volume was present when driver loaded, or when a RAID logical volume was created on the fly. This issue was created in due to recent scsi_transport_sas change, when sas_read_port_mode_page was added into the mptsas drivers slave_config entry point. This new API expects that all sdev's to be assocated to an rphy, however that is not the case for logical volumes, as they are created using scsi_add_device, instead of sas_rphy_add(). Signed-off-by: Eric Moore <Eric.Moore@lsil.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
1 parent 1e08dcb commit 3c0c25b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

drivers/message/fusion/mptsas.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,15 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
366366
static int
367367
mptsas_slave_configure(struct scsi_device *sdev)
368368
{
369-
sas_read_port_mode_page(sdev);
369+
struct Scsi_Host *host = sdev->host;
370+
MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
371+
372+
/*
373+
* RAID volumes placed beyond the last expected port.
374+
* Ignore sending sas mode pages in that case..
375+
*/
376+
if (sdev->channel < hd->ioc->num_ports)
377+
sas_read_port_mode_page(sdev);
370378

371379
return mptscsih_slave_configure(sdev);
372380
}

0 commit comments

Comments
 (0)