aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/fusion/mptsas.c56
-rw-r--r--drivers/scsi/scsi_transport_sas.c8
3 files changed, 24 insertions, 41 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 0b555e2309f4..014e1de0f7cb 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -634,7 +634,6 @@ typedef struct _MPT_ADAPTER
634 u16 handle; 634 u16 handle;
635 int sas_index; /* index refrencing */ 635 int sas_index; /* index refrencing */
636 MPT_SAS_MGMT sas_mgmt; 636 MPT_SAS_MGMT sas_mgmt;
637 int num_ports;
638 struct work_struct sas_persist_task; 637 struct work_struct sas_persist_task;
639 638
640 struct work_struct fc_setup_reset_work; 639 struct work_struct fc_setup_reset_work;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 0fb7d5881f4f..b28e930528e8 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -67,6 +67,11 @@
67#define my_VERSION MPT_LINUX_VERSION_COMMON 67#define my_VERSION MPT_LINUX_VERSION_COMMON
68#define MYNAM "mptsas" 68#define MYNAM "mptsas"
69 69
70/*
71 * Reserved channel for integrated raid
72 */
73#define MPTSAS_RAID_CHANNEL 1
74
70MODULE_AUTHOR(MODULEAUTHOR); 75MODULE_AUTHOR(MODULEAUTHOR);
71MODULE_DESCRIPTION(my_NAME); 76MODULE_DESCRIPTION(my_NAME);
72MODULE_LICENSE("GPL"); 77MODULE_LICENSE("GPL");
@@ -644,16 +649,13 @@ mptsas_sas_enclosure_pg0(MPT_ADAPTER *ioc, struct mptsas_enclosure *enclosure,
644static int 649static int
645mptsas_slave_configure(struct scsi_device *sdev) 650mptsas_slave_configure(struct scsi_device *sdev)
646{ 651{
647 struct Scsi_Host *host = sdev->host;
648 MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)host->hostdata;
649 652
650 /* 653 if (sdev->channel == MPTSAS_RAID_CHANNEL)
651 * RAID volumes placed beyond the last expected port. 654 goto out;
652 * Ignore sending sas mode pages in that case.. 655
653 */ 656 sas_read_port_mode_page(sdev);
654 if (sdev->channel < hd->ioc->num_ports)
655 sas_read_port_mode_page(sdev);
656 657
658 out:
657 return mptscsih_slave_configure(sdev); 659 return mptscsih_slave_configure(sdev);
658} 660}
659 661
@@ -682,10 +684,7 @@ mptsas_target_alloc(struct scsi_target *starget)
682 684
683 hd->Targets[target_id] = vtarget; 685 hd->Targets[target_id] = vtarget;
684 686
685 /* 687 if (starget->channel == MPTSAS_RAID_CHANNEL)
686 * RAID volumes placed beyond the last expected port.
687 */
688 if (starget->channel == hd->ioc->num_ports)
689 goto out; 688 goto out;
690 689
691 rphy = dev_to_rphy(starget->dev.parent); 690 rphy = dev_to_rphy(starget->dev.parent);
@@ -736,7 +735,7 @@ mptsas_target_destroy(struct scsi_target *starget)
736 if (!starget->hostdata) 735 if (!starget->hostdata)
737 return; 736 return;
738 737
739 if (starget->channel == hd->ioc->num_ports) 738 if (starget->channel == MPTSAS_RAID_CHANNEL)
740 goto out; 739 goto out;
741 740
742 rphy = dev_to_rphy(starget->dev.parent); 741 rphy = dev_to_rphy(starget->dev.parent);
@@ -776,10 +775,7 @@ mptsas_slave_alloc(struct scsi_device *sdev)
776 starget = scsi_target(sdev); 775 starget = scsi_target(sdev);
777 vdev->vtarget = starget->hostdata; 776 vdev->vtarget = starget->hostdata;
778 777
779 /* 778 if (sdev->channel == MPTSAS_RAID_CHANNEL)
780 * RAID volumes placed beyond the last expected port.
781 */
782 if (sdev->channel == hd->ioc->num_ports)
783 goto out; 779 goto out;
784 780
785 rphy = dev_to_rphy(sdev->sdev_target->dev.parent); 781 rphy = dev_to_rphy(sdev->sdev_target->dev.parent);
@@ -1728,7 +1724,6 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
1728 hba = NULL; 1724 hba = NULL;
1729 } 1725 }
1730 mutex_unlock(&ioc->sas_topology_mutex); 1726 mutex_unlock(&ioc->sas_topology_mutex);
1731 ioc->num_ports = port_info->num_phys;
1732 1727
1733 for (i = 0; i < port_info->num_phys; i++) { 1728 for (i = 0; i < port_info->num_phys; i++) {
1734 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i], 1729 mptsas_sas_phy_pg0(ioc, &port_info->phy_info[i],
@@ -1977,7 +1972,7 @@ mptsas_scan_sas_topology(MPT_ADAPTER *ioc)
1977 if (!ioc->raid_data.pIocPg2->NumActiveVolumes) 1972 if (!ioc->raid_data.pIocPg2->NumActiveVolumes)
1978 goto out; 1973 goto out;
1979 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) { 1974 for (i=0; i<ioc->raid_data.pIocPg2->NumActiveVolumes; i++) {
1980 scsi_add_device(ioc->sh, ioc->num_ports, 1975 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL,
1981 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0); 1976 ioc->raid_data.pIocPg2->RaidVolume[i].VolumeID, 0);
1982 } 1977 }
1983 out: 1978 out:
@@ -2283,35 +2278,26 @@ mptsas_hotplug_work(void *arg)
2283 mptsas_set_rphy(phy_info, rphy); 2278 mptsas_set_rphy(phy_info, rphy);
2284 break; 2279 break;
2285 case MPTSAS_ADD_RAID: 2280 case MPTSAS_ADD_RAID:
2286 sdev = scsi_device_lookup( 2281 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2287 ioc->sh, 2282 ev->id, 0);
2288 ioc->num_ports,
2289 ev->id,
2290 0);
2291 if (sdev) { 2283 if (sdev) {
2292 scsi_device_put(sdev); 2284 scsi_device_put(sdev);
2293 break; 2285 break;
2294 } 2286 }
2295 printk(MYIOC_s_INFO_FMT 2287 printk(MYIOC_s_INFO_FMT
2296 "attaching raid volume, channel %d, id %d\n", 2288 "attaching raid volume, channel %d, id %d\n",
2297 ioc->name, ioc->num_ports, ev->id); 2289 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2298 scsi_add_device(ioc->sh, 2290 scsi_add_device(ioc->sh, MPTSAS_RAID_CHANNEL, ev->id, 0);
2299 ioc->num_ports,
2300 ev->id,
2301 0);
2302 mpt_findImVolumes(ioc); 2291 mpt_findImVolumes(ioc);
2303 break; 2292 break;
2304 case MPTSAS_DEL_RAID: 2293 case MPTSAS_DEL_RAID:
2305 sdev = scsi_device_lookup( 2294 sdev = scsi_device_lookup(ioc->sh, MPTSAS_RAID_CHANNEL,
2306 ioc->sh, 2295 ev->id, 0);
2307 ioc->num_ports,
2308 ev->id,
2309 0);
2310 if (!sdev) 2296 if (!sdev)
2311 break; 2297 break;
2312 printk(MYIOC_s_INFO_FMT 2298 printk(MYIOC_s_INFO_FMT
2313 "removing raid volume, channel %d, id %d\n", 2299 "removing raid volume, channel %d, id %d\n",
2314 ioc->name, ioc->num_ports, ev->id); 2300 ioc->name, MPTSAS_RAID_CHANNEL, ev->id);
2315 vdevice = sdev->hostdata; 2301 vdevice = sdev->hostdata;
2316 vdevice->vtarget->deleted = 1; 2302 vdevice->vtarget->deleted = 1;
2317 mptsas_target_reset(ioc, vdevice->vtarget); 2303 mptsas_target_reset(ioc, vdevice->vtarget);
diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
index 7871bc25fafb..5a625c3fddae 100644
--- a/drivers/scsi/scsi_transport_sas.c
+++ b/drivers/scsi/scsi_transport_sas.c
@@ -1194,7 +1194,7 @@ int sas_rphy_add(struct sas_rphy *rphy)
1194 1194
1195 if (identify->device_type == SAS_END_DEVICE && 1195 if (identify->device_type == SAS_END_DEVICE &&
1196 rphy->scsi_target_id != -1) { 1196 rphy->scsi_target_id != -1) {
1197 scsi_scan_target(&rphy->dev, parent->port_identifier, 1197 scsi_scan_target(&rphy->dev, 0,
1198 rphy->scsi_target_id, ~0, 0); 1198 rphy->scsi_target_id, ~0, 0);
1199 } 1199 }
1200 1200
@@ -1296,15 +1296,13 @@ static int sas_user_scan(struct Scsi_Host *shost, uint channel,
1296 1296
1297 mutex_lock(&sas_host->lock); 1297 mutex_lock(&sas_host->lock);
1298 list_for_each_entry(rphy, &sas_host->rphy_list, list) { 1298 list_for_each_entry(rphy, &sas_host->rphy_list, list) {
1299 struct sas_port *parent = dev_to_sas_port(rphy->dev.parent);
1300
1301 if (rphy->identify.device_type != SAS_END_DEVICE || 1299 if (rphy->identify.device_type != SAS_END_DEVICE ||
1302 rphy->scsi_target_id == -1) 1300 rphy->scsi_target_id == -1)
1303 continue; 1301 continue;
1304 1302
1305 if ((channel == SCAN_WILD_CARD || channel == parent->port_identifier) && 1303 if ((channel == SCAN_WILD_CARD || channel == 0) &&
1306 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) { 1304 (id == SCAN_WILD_CARD || id == rphy->scsi_target_id)) {
1307 scsi_scan_target(&rphy->dev, parent->port_identifier, 1305 scsi_scan_target(&rphy->dev, 0,
1308 rphy->scsi_target_id, lun, 1); 1306 rphy->scsi_target_id, lun, 1);
1309 } 1307 }
1310 } 1308 }