Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 89696
b: refs/heads/master
c: 7748369
h: refs/heads/master
v: v3
  • Loading branch information
Michael Reed authored and James Bottomley committed Apr 7, 2008
1 parent 72f7977 commit f41a65c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9d56291366cd6ab156be722e42cf487bef20f5fd
refs/heads/master: 7748369f49d428e558c519ed344d3005d38347b7
1 change: 0 additions & 1 deletion trunk/drivers/message/fusion/mptbase.h
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@ typedef struct _MPT_ADAPTER
struct mutex sas_discovery_mutex;
u8 sas_discovery_runtime;
u8 sas_discovery_ignore_events;
u16 handle;
int sas_index; /* index refrencing */
MPT_SAS_MGMT sas_mgmt;
struct work_struct sas_persist_task;
Expand Down
22 changes: 17 additions & 5 deletions trunk/drivers/message/fusion/mptsas.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,20 @@ static inline MPT_ADAPTER *rphy_to_ioc(struct sas_rphy *rphy)
return ((MPT_SCSI_HOST *)shost->hostdata)->ioc;
}

static struct mptsas_portinfo *
mptsas_get_hba_portinfo(MPT_ADAPTER *ioc)
{
struct list_head *head = &ioc->sas_topology;
struct mptsas_portinfo *pi = NULL;

/* always the first entry on sas_topology list */

if (!list_empty(head))
pi = list_entry(head->next, struct mptsas_portinfo, list);

return pi;
}

/*
* mptsas_find_portinfo_by_handle
*
Expand Down Expand Up @@ -1290,7 +1304,7 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
struct mptsas_portinfo *port_info;

mutex_lock(&ioc->sas_topology_mutex);
port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
port_info = mptsas_get_hba_portinfo(ioc);
if (port_info && port_info->phy_info)
sas_address =
port_info->phy_info[0].phy->identify.sas_address;
Expand Down Expand Up @@ -2028,8 +2042,7 @@ static int mptsas_probe_one_phy(struct device *dev,
int i;

mutex_lock(&ioc->sas_topology_mutex);
port_info = mptsas_find_portinfo_by_handle(ioc,
ioc->handle);
port_info = mptsas_get_hba_portinfo(ioc);
mutex_unlock(&ioc->sas_topology_mutex);

for (i = 0; i < port_info->num_phys; i++)
Expand Down Expand Up @@ -2099,8 +2112,7 @@ mptsas_probe_hba_phys(MPT_ADAPTER *ioc)

mptsas_sas_io_unit_pg1(ioc);
mutex_lock(&ioc->sas_topology_mutex);
ioc->handle = hba->phy_info[0].handle;
port_info = mptsas_find_portinfo_by_handle(ioc, ioc->handle);
port_info = mptsas_get_hba_portinfo(ioc);
if (!port_info) {
port_info = hba;
list_add_tail(&port_info->list, &ioc->sas_topology);
Expand Down

0 comments on commit f41a65c

Please sign in to comment.