From: Moore, Eric Date: Thu, 13 Apr 2006 22:08:17 +0000 (-0600) Subject: [SCSI] mptfusion - fix panic in mptsas_slave_configure X-Git-Tag: v2.6.17-rc2~30^2~1 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3c0c25b97c7d020ef07f6366cf1d668a8e980c7c;p=linux-2.6 [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 Signed-off-by: James Bottomley --- diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index 010d4a3926..e9716b10ac 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -366,7 +366,15 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure, static int mptsas_slave_configure(struct scsi_device *sdev) { - sas_read_port_mode_page(sdev); + struct Scsi_Host *host = sdev->host; + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata; + + /* + * RAID volumes placed beyond the last expected port. + * Ignore sending sas mode pages in that case.. + */ + if (sdev->channel < hd->ioc->num_ports) + sas_read_port_mode_page(sdev); return mptscsih_slave_configure(sdev); }