Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 271098
b: refs/heads/master
c: 1a34c06
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and James Bottomley committed Oct 16, 2011
1 parent 3b54425 commit 82cc792
Show file tree
Hide file tree
Showing 4 changed files with 19 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: 29f366e8a99fdced4c0b5417a478d7539adc66d3
refs/heads/master: 1a34c0640137eed8dabdac3a68a7a84116ac9e0d
13 changes: 8 additions & 5 deletions trunk/drivers/scsi/libsas/sas_discover.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,20 @@ int sas_discover_end_dev(struct domain_device *dev)

/* ---------- Device registration and unregistration ---------- */

static inline void sas_unregister_common_dev(struct domain_device *dev)
static void sas_unregister_common_dev(struct asd_sas_port *port, struct domain_device *dev)
{
sas_notify_lldd_dev_gone(dev);
if (!dev->parent)
dev->port->port_dev = NULL;
else
list_del_init(&dev->siblings);

spin_lock_irq(&port->dev_list_lock);
list_del_init(&dev->dev_list_node);
spin_unlock_irq(&port->dev_list_lock);
}

void sas_unregister_dev(struct domain_device *dev)
void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *dev)
{
if (dev->rphy) {
sas_remove_children(&dev->rphy->dev);
Expand All @@ -241,15 +244,15 @@ void sas_unregister_dev(struct domain_device *dev)
kfree(dev->ex_dev.ex_phy);
dev->ex_dev.ex_phy = NULL;
}
sas_unregister_common_dev(dev);
sas_unregister_common_dev(port, dev);
}

void sas_unregister_domain_devices(struct asd_sas_port *port)
{
struct domain_device *dev, *n;

list_for_each_entry_safe_reverse(dev,n,&port->dev_list,dev_list_node)
sas_unregister_dev(dev);
list_for_each_entry_safe_reverse(dev, n, &port->dev_list, dev_list_node)
sas_unregister_dev(port, dev);

port->port->rphy = NULL;

Expand Down
15 changes: 9 additions & 6 deletions trunk/drivers/scsi/libsas/sas_expander.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,10 @@ static struct domain_device *sas_ex_discover_end_dev(
out_list_del:
sas_rphy_free(child->rphy);
child->rphy = NULL;

spin_lock_irq(&parent->port->dev_list_lock);
list_del(&child->dev_list_node);
spin_unlock_irq(&parent->port->dev_list_lock);
out_free:
sas_port_delete(phy->port);
out_err:
Expand Down Expand Up @@ -1739,7 +1742,7 @@ static int sas_find_bcast_dev(struct domain_device *dev,
return res;
}

static void sas_unregister_ex_tree(struct domain_device *dev)
static void sas_unregister_ex_tree(struct asd_sas_port *port, struct domain_device *dev)
{
struct expander_device *ex = &dev->ex_dev;
struct domain_device *child, *n;
Expand All @@ -1748,11 +1751,11 @@ static void sas_unregister_ex_tree(struct domain_device *dev)
child->gone = 1;
if (child->dev_type == EDGE_DEV ||
child->dev_type == FANOUT_DEV)
sas_unregister_ex_tree(child);
sas_unregister_ex_tree(port, child);
else
sas_unregister_dev(child);
sas_unregister_dev(port, child);
}
sas_unregister_dev(dev);
sas_unregister_dev(port, dev);
}

static void sas_unregister_devs_sas_addr(struct domain_device *parent,
Expand All @@ -1769,9 +1772,9 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent,
child->gone = 1;
if (child->dev_type == EDGE_DEV ||
child->dev_type == FANOUT_DEV)
sas_unregister_ex_tree(child);
sas_unregister_ex_tree(parent->port, child);
else
sas_unregister_dev(child);
sas_unregister_dev(parent->port, child);
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion trunk/include/scsi/libsas.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ int sas_discover_event(struct asd_sas_port *, enum discover_event ev);
int sas_discover_sata(struct domain_device *);
int sas_discover_end_dev(struct domain_device *);

void sas_unregister_dev(struct domain_device *);
void sas_unregister_dev(struct asd_sas_port *port, struct domain_device *);

void sas_init_dev(struct domain_device *);

Expand Down

0 comments on commit 82cc792

Please sign in to comment.