Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 86365
b: refs/heads/master
c: ce896d9
h: refs/heads/master
i:
  86363: c7126b5
v: v3
  • Loading branch information
Stefan Richter committed Feb 16, 2008
1 parent ea2a0c7 commit 7a510a2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 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: 0fa6dfdb0a2768541e998a5dab10b368de56c60a
refs/heads/master: ce896d95cc7886ae05859c5b409a7b2f3b606ec1
17 changes: 15 additions & 2 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,11 @@ static void sbp2_login(struct work_struct *work)
node_id = device->node_id;
local_node_id = device->card->node_id;

/* If this is a re-login attempt, log out, or we might be rejected. */
if (lu->sdev)
sbp2_send_management_orb(lu, device->node_id, generation,
SBP2_LOGOUT_REQUEST, lu->login_id, NULL);

if (sbp2_send_management_orb(lu, node_id, generation,
SBP2_LOGIN_REQUEST, lu->lun, &response) < 0) {
if (lu->retries++ < 5)
Expand Down Expand Up @@ -997,9 +1002,17 @@ static void sbp2_reconnect(struct work_struct *work)
if (sbp2_send_management_orb(lu, node_id, generation,
SBP2_RECONNECT_REQUEST,
lu->login_id, NULL) < 0) {
if (lu->retries++ >= 5) {
/*
* If reconnect was impossible even though we are in the
* current generation, fall back and try to log in again.
*
* We could check for "Function rejected" status, but
* looking at the bus generation as simpler and more general.
*/
smp_rmb(); /* get current card generation */
if (generation == device->card->generation ||
lu->retries++ >= 5) {
fw_error("%s: failed to reconnect\n", tgt->bus_id);
/* Fall back and try to log in again. */
lu->retries = 0;
PREPARE_DELAYED_WORK(&lu->work, sbp2_login);
}
Expand Down

0 comments on commit 7a510a2

Please sign in to comment.