aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-06-30 13:54:02 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-06-30 22:35:17 -0400
commit2686de27a356914e098329463d5a8cd7aa6f29a4 (patch)
tree8bf625cb1a387f6f179662a101ca256463e67f7f /drivers/message
parent413975a0f1a43a896490fc5c589d05c95624c6d2 (diff)
[SCSI] mptsas: eliminate ghost devices
One of the current problems the mptsas driver has is that of "ghost" devices (these are devices the firmware reports as existing, but what they actually represent are the parents of a lower device), so for example in my dual expander configuration, three expanders actually show up, two for the real expanders but a third is created because the firmware reports that the lower expander also has another expander connected (which is simply the port going back to the upper expander). The attached patch eliminates all these ghosts by not allocating any devices for them if the SAS address is the SAS address of the parent. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/message')
-rw-r--r--drivers/message/fusion/mptbase.h1
-rw-r--r--drivers/message/fusion/mptsas.c24
2 files changed, 25 insertions, 0 deletions
diff --git a/drivers/message/fusion/mptbase.h b/drivers/message/fusion/mptbase.h
index 7bf0855f9349..2697b70653f2 100644
--- a/drivers/message/fusion/mptbase.h
+++ b/drivers/message/fusion/mptbase.h
@@ -632,6 +632,7 @@ typedef struct _MPT_ADAPTER
632 struct mutex sas_discovery_mutex; 632 struct mutex sas_discovery_mutex;
633 u8 sas_discovery_runtime; 633 u8 sas_discovery_runtime;
634 u8 sas_discovery_ignore_events; 634 u8 sas_discovery_ignore_events;
635 u16 handle;
635 int sas_index; /* index refrencing */ 636 int sas_index; /* index refrencing */
636 MPT_SAS_MGMT sas_mgmt; 637 MPT_SAS_MGMT sas_mgmt;
637 int num_ports; 638 int num_ports;
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 85eff1509d66..f7bd8b11ed3b 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -1635,8 +1635,10 @@ static int mptsas_probe_one_phy(struct device *dev,
1635 if (!mptsas_get_rphy(phy_info) && port && !port->rphy) { 1635 if (!mptsas_get_rphy(phy_info) && port && !port->rphy) {
1636 1636
1637 struct sas_rphy *rphy; 1637 struct sas_rphy *rphy;
1638 struct device *parent;
1638 struct sas_identify identify; 1639 struct sas_identify identify;
1639 1640
1641 parent = dev->parent->parent;
1640 /* 1642 /*
1641 * Let the hotplug_work thread handle processing 1643 * Let the hotplug_work thread handle processing
1642 * the adding/removing of devices that occur 1644 * the adding/removing of devices that occur
@@ -1647,6 +1649,27 @@ static int mptsas_probe_one_phy(struct device *dev,
1647 goto out; 1649 goto out;
1648 1650
1649 mptsas_parse_device_info(&identify, &phy_info->attached); 1651 mptsas_parse_device_info(&identify, &phy_info->attached);
1652 if (scsi_is_host_device(parent)) {
1653 struct mptsas_portinfo *port_info;
1654 int i;
1655
1656 mutex_lock(&ioc->sas_topology_mutex);
1657 port_info = mptsas_find_portinfo_by_handle(ioc,
1658 ioc->handle);
1659 mutex_unlock(&ioc->sas_topology_mutex);
1660
1661 for (i = 0; i < port_info->num_phys; i++)
1662 if (port_info->phy_info[i].identify.sas_address ==
1663 identify.sas_address)
1664 goto out;
1665
1666 } else if (scsi_is_sas_rphy(parent)) {
1667 struct sas_rphy *parent_rphy = dev_to_rphy(parent);
1668 if (identify.sas_address ==
1669 parent_rphy->identify.sas_address)
1670 goto out;
1671 }
1672
1650 switch (identify.device_type) { 1673 switch (identify.device_type) {
1651 case SAS_END_DEVICE: 1674 case SAS_END_DEVICE:
1652 rphy = sas_end_device_alloc(port); 1675 rphy = sas_end_device_alloc(port);
@@ -1698,6 +1721,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)
1698 goto out_free_port_info; 1721 goto out_free_port_info;
1699 1722
1700 mutex_lock(&ioc->sas_topology_mutex); 1723 mutex_lock(&ioc->sas_topology_mutex);
1724 ioc->handle = hba->handle;
1701 port_info = mptsas_find_portinfo_by_handle(ioc, hba->handle); 1725 port_info = mptsas_find_portinfo_by_handle(ioc, hba->handle);
1702 if (!port_info) { 1726 if (!port_info) {
1703 port_info = hba; 1727 port_info = hba;