Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252460
b: refs/heads/master
c: 90f1e10
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and James Bottomley committed May 27, 2011
1 parent 66d09f0 commit 7e3c686
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 13 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: c95286d81b976f4224c7b153defc8eec07e837d9
refs/heads/master: 90f1e10d08bad84f8fd15d3469a60d437d4de64f
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/libsas/sas_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ int sas_init_queue(struct sas_ha_struct *sas_ha);
int sas_init_events(struct sas_ha_struct *sas_ha);
void sas_shutdown_queue(struct sas_ha_struct *sas_ha);

void sas_deform_port(struct asd_sas_phy *phy);
void sas_deform_port(struct asd_sas_phy *phy, int gone);

void sas_porte_bytes_dmaed(struct work_struct *work);
void sas_porte_broadcast_rcvd(struct work_struct *work);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/libsas/sas_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static void sas_phye_loss_of_signal(struct work_struct *work)
sas_begin_event(PHYE_LOSS_OF_SIGNAL, &phy->ha->event_lock,
&phy->phy_events_pending);
phy->error = 0;
sas_deform_port(phy);
sas_deform_port(phy, 1);
}

static void sas_phye_oob_done(struct work_struct *work)
Expand All @@ -66,7 +66,7 @@ static void sas_phye_oob_error(struct work_struct *work)
sas_begin_event(PHYE_OOB_ERROR, &phy->ha->event_lock,
&phy->phy_events_pending);

sas_deform_port(phy);
sas_deform_port(phy, 1);

if (!port && phy->enabled && i->dft->lldd_control_phy) {
phy->error++;
Expand Down
21 changes: 12 additions & 9 deletions trunk/drivers/scsi/libsas/sas_port.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ static void sas_form_port(struct asd_sas_phy *phy)

if (port) {
if (!phy_is_wideport_member(port, phy))
sas_deform_port(phy);
sas_deform_port(phy, 0);
else {
SAS_DPRINTK("%s: phy%d belongs to port%d already(%d)!\n",
__func__, phy->id, phy->port->id,
Expand Down Expand Up @@ -153,28 +153,31 @@ static void sas_form_port(struct asd_sas_phy *phy)
* This is called when the physical link to the other phy has been
* lost (on this phy), in Event thread context. We cannot delay here.
*/
void sas_deform_port(struct asd_sas_phy *phy)
void sas_deform_port(struct asd_sas_phy *phy, int gone)
{
struct sas_ha_struct *sas_ha = phy->ha;
struct asd_sas_port *port = phy->port;
struct sas_internal *si =
to_sas_internal(sas_ha->core.shost->transportt);
struct domain_device *dev;
unsigned long flags;

if (!port)
return; /* done by a phy event */

if (port->port_dev)
port->port_dev->pathways--;
dev = port->port_dev;
if (dev)
dev->pathways--;

if (port->num_phys == 1) {
if (dev && gone)
dev->gone = 1;
sas_unregister_domain_devices(port);
sas_port_delete(port->port);
port->port = NULL;
} else
sas_port_delete_phy(port->port, phy->phy);


if (si->dft->lldd_port_deformed)
si->dft->lldd_port_deformed(phy);

Expand Down Expand Up @@ -244,7 +247,7 @@ void sas_porte_link_reset_err(struct work_struct *work)
sas_begin_event(PORTE_LINK_RESET_ERR, &phy->ha->event_lock,
&phy->port_events_pending);

sas_deform_port(phy);
sas_deform_port(phy, 1);
}

void sas_porte_timer_event(struct work_struct *work)
Expand All @@ -256,7 +259,7 @@ void sas_porte_timer_event(struct work_struct *work)
sas_begin_event(PORTE_TIMER_EVENT, &phy->ha->event_lock,
&phy->port_events_pending);

sas_deform_port(phy);
sas_deform_port(phy, 1);
}

void sas_porte_hard_reset(struct work_struct *work)
Expand All @@ -268,7 +271,7 @@ void sas_porte_hard_reset(struct work_struct *work)
sas_begin_event(PORTE_HARD_RESET, &phy->ha->event_lock,
&phy->port_events_pending);

sas_deform_port(phy);
sas_deform_port(phy, 1);
}

/* ---------- SAS port registration ---------- */
Expand Down Expand Up @@ -306,6 +309,6 @@ void sas_unregister_ports(struct sas_ha_struct *sas_ha)

for (i = 0; i < sas_ha->num_phys; i++)
if (sas_ha->sas_phy[i]->port)
sas_deform_port(sas_ha->sas_phy[i]);
sas_deform_port(sas_ha->sas_phy[i], 0);

}

0 comments on commit 7e3c686

Please sign in to comment.