aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c24
1 files changed, 24 insertions, 0 deletions
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;