Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86358
b: refs/heads/master
c: be6f48b
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Feb 16, 2008
1 parent 694283e commit d4910ea
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 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: 96b19062e741b715cf399312c30e0672d8889569
refs/heads/master: be6f48b0174584c9c415012ca14803c7e941e27e
16 changes: 11 additions & 5 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,9 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
unsigned int timeout;
int retval = -ENOMEM;

if (function == SBP2_LOGOUT_REQUEST && fw_device_is_shutdown(device))
return 0;

orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
if (orb == NULL)
return -ENOMEM;
Expand Down Expand Up @@ -619,16 +622,13 @@ static void sbp2_release_target(struct kref *kref)
struct sbp2_logical_unit *lu, *next;
struct Scsi_Host *shost =
container_of((void *)tgt, struct Scsi_Host, hostdata[0]);
struct fw_device *device = fw_device(tgt->unit->device.parent);

list_for_each_entry_safe(lu, next, &tgt->lu_list, link) {
if (lu->sdev)
scsi_remove_device(lu->sdev);

if (!fw_device_is_shutdown(device))
sbp2_send_management_orb(lu, tgt->node_id,
lu->generation, SBP2_LOGOUT_REQUEST,
lu->login_id, NULL);
sbp2_send_management_orb(lu, tgt->node_id, lu->generation,
SBP2_LOGOUT_REQUEST, lu->login_id, NULL);

fw_core_remove_address_handler(&lu->address_handler);
list_del(&lu->link);
Expand Down Expand Up @@ -673,6 +673,9 @@ static void sbp2_login(struct work_struct *work)
struct sbp2_login_response response;
int generation, node_id, local_node_id;

if (fw_device_is_shutdown(device))
goto out;

generation = device->generation;
smp_rmb(); /* node_id must not be older than generation */
node_id = device->node_id;
Expand Down Expand Up @@ -944,6 +947,9 @@ static void sbp2_reconnect(struct work_struct *work)
struct fw_device *device = fw_device(unit->device.parent);
int generation, node_id, local_node_id;

if (fw_device_is_shutdown(device))
goto out;

generation = device->generation;
smp_rmb(); /* node_id must not be older than generation */
node_id = device->node_id;
Expand Down

0 comments on commit d4910ea

Please sign in to comment.