diff options
author | Dan Williams <dan.j.williams@intel.com> | 2012-01-07 03:52:39 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 14:51:23 -0500 |
commit | e139942d77a6e3ac83bc322e826668054a8601d6 (patch) | |
tree | ef1741122d936f6fa9986a53f17e6f6108283649 | |
parent | 312d3e56119a4bc5c36a96818f87f650c069ddc2 (diff) |
[SCSI] libsas: convert dev->gone to flags
In preparation for adding tracking of another device state "destroy".
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r-- | drivers/scsi/libsas/sas_ata.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_expander.c | 6 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_port.c | 2 | ||||
-rw-r--r-- | drivers/scsi/libsas/sas_scsi_host.c | 2 | ||||
-rw-r--r-- | include/scsi/libsas.h | 7 |
5 files changed, 11 insertions, 8 deletions
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 81ce39d166d1..2fc5a3961ca6 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c | |||
@@ -184,7 +184,7 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) | |||
184 | spin_unlock(ap->lock); | 184 | spin_unlock(ap->lock); |
185 | 185 | ||
186 | /* If the device fell off, no sense in issuing commands */ | 186 | /* If the device fell off, no sense in issuing commands */ |
187 | if (dev->gone) | 187 | if (test_bit(SAS_DEV_GONE, &dev->state)) |
188 | goto out; | 188 | goto out; |
189 | 189 | ||
190 | task = sas_alloc_task(GFP_ATOMIC); | 190 | task = sas_alloc_task(GFP_ATOMIC); |
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 15d2239a378b..f33d0c9911c4 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c | |||
@@ -1750,7 +1750,7 @@ static void sas_unregister_ex_tree(struct asd_sas_port *port, struct domain_devi | |||
1750 | struct domain_device *child, *n; | 1750 | struct domain_device *child, *n; |
1751 | 1751 | ||
1752 | list_for_each_entry_safe(child, n, &ex->children, siblings) { | 1752 | list_for_each_entry_safe(child, n, &ex->children, siblings) { |
1753 | child->gone = 1; | 1753 | set_bit(SAS_DEV_GONE, &child->state); |
1754 | if (child->dev_type == EDGE_DEV || | 1754 | if (child->dev_type == EDGE_DEV || |
1755 | child->dev_type == FANOUT_DEV) | 1755 | child->dev_type == FANOUT_DEV) |
1756 | sas_unregister_ex_tree(port, child); | 1756 | sas_unregister_ex_tree(port, child); |
@@ -1771,7 +1771,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent, | |||
1771 | &ex_dev->children, siblings) { | 1771 | &ex_dev->children, siblings) { |
1772 | if (SAS_ADDR(child->sas_addr) == | 1772 | if (SAS_ADDR(child->sas_addr) == |
1773 | SAS_ADDR(phy->attached_sas_addr)) { | 1773 | SAS_ADDR(phy->attached_sas_addr)) { |
1774 | child->gone = 1; | 1774 | set_bit(SAS_DEV_GONE, &child->state); |
1775 | if (child->dev_type == EDGE_DEV || | 1775 | if (child->dev_type == EDGE_DEV || |
1776 | child->dev_type == FANOUT_DEV) | 1776 | child->dev_type == FANOUT_DEV) |
1777 | sas_unregister_ex_tree(parent->port, child); | 1777 | sas_unregister_ex_tree(parent->port, child); |
@@ -1780,7 +1780,7 @@ static void sas_unregister_devs_sas_addr(struct domain_device *parent, | |||
1780 | break; | 1780 | break; |
1781 | } | 1781 | } |
1782 | } | 1782 | } |
1783 | parent->gone = 1; | 1783 | set_bit(SAS_DEV_GONE, &parent->state); |
1784 | sas_disable_routing(parent, phy->attached_sas_addr); | 1784 | sas_disable_routing(parent, phy->attached_sas_addr); |
1785 | } | 1785 | } |
1786 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); | 1786 | memset(phy->attached_sas_addr, 0, SAS_ADDR_SIZE); |
diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c index a47c7a75327b..d88e55f9732b 100644 --- a/drivers/scsi/libsas/sas_port.c +++ b/drivers/scsi/libsas/sas_port.c | |||
@@ -171,7 +171,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) | |||
171 | 171 | ||
172 | if (port->num_phys == 1) { | 172 | if (port->num_phys == 1) { |
173 | if (dev && gone) | 173 | if (dev && gone) |
174 | dev->gone = 1; | 174 | set_bit(SAS_DEV_GONE, &dev->state); |
175 | sas_unregister_domain_devices(port); | 175 | sas_unregister_domain_devices(port); |
176 | sas_port_delete(port->port); | 176 | sas_port_delete(port->port); |
177 | port->port = NULL; | 177 | port->port = NULL; |
diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index fd60465d4b2d..15533a17eb97 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c | |||
@@ -192,7 +192,7 @@ int sas_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) | |||
192 | int res = 0; | 192 | int res = 0; |
193 | 193 | ||
194 | /* If the device fell off, no sense in issuing commands */ | 194 | /* If the device fell off, no sense in issuing commands */ |
195 | if (dev->gone) { | 195 | if (test_bit(SAS_DEV_GONE, &dev->state)) { |
196 | cmd->result = DID_BAD_TARGET << 16; | 196 | cmd->result = DID_BAD_TARGET << 16; |
197 | goto out_done; | 197 | goto out_done; |
198 | } | 198 | } |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index 42900fa95a03..d792b13cfcf5 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -173,7 +173,10 @@ struct sata_device { | |||
173 | struct ata_taskfile tf; | 173 | struct ata_taskfile tf; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* ---------- Domain device ---------- */ | 176 | enum { |
177 | SAS_DEV_GONE, | ||
178 | }; | ||
179 | |||
177 | struct domain_device { | 180 | struct domain_device { |
178 | enum sas_dev_type dev_type; | 181 | enum sas_dev_type dev_type; |
179 | 182 | ||
@@ -205,7 +208,7 @@ struct domain_device { | |||
205 | }; | 208 | }; |
206 | 209 | ||
207 | void *lldd_dev; | 210 | void *lldd_dev; |
208 | int gone; | 211 | unsigned long state; |
209 | struct kref kref; | 212 | struct kref kref; |
210 | }; | 213 | }; |
211 | 214 | ||