Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 127180
b: refs/heads/master
c: 621f6dd
h: refs/heads/master
v: v3
  • Loading branch information
Stefan Richter committed Jan 4, 2009
1 parent c3c200f commit 6ecc983
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 16 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: c82cdea1e1cb3790788d04ef5cab33488e1455c9
refs/heads/master: 621f6dd715209d3c3c27841943ae71fc2c75c9f5
21 changes: 6 additions & 15 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,17 +670,6 @@ static void sbp2_agent_reset_no_wait(struct sbp2_logical_unit *lu)
&d, sizeof(d), complete_agent_reset_write_no_wait, t);
}

static void sbp2_set_generation(struct sbp2_logical_unit *lu, int generation)
{
struct fw_card *card = fw_device(lu->tgt->unit->device.parent)->card;
unsigned long flags;

/* serialize with comparisons of lu->generation and card->generation */
spin_lock_irqsave(&card->lock, flags);
lu->generation = generation;
spin_unlock_irqrestore(&card->lock, flags);
}

static inline void sbp2_allow_block(struct sbp2_logical_unit *lu)
{
/*
Expand Down Expand Up @@ -884,7 +873,7 @@ static void sbp2_login(struct work_struct *work)
goto out;

generation = device->generation;
smp_rmb(); /* node_id must not be older than generation */
smp_rmb(); /* node IDs must not be older than generation */
node_id = device->node_id;
local_node_id = device->card->node_id;

Expand All @@ -908,7 +897,8 @@ static void sbp2_login(struct work_struct *work)

tgt->node_id = node_id;
tgt->address_high = local_node_id << 16;
sbp2_set_generation(lu, generation);
smp_wmb(); /* node IDs must not be older than generation */
lu->generation = generation;

lu->command_block_agent_address =
((u64)(be32_to_cpu(response.command_block_agent.high) & 0xffff)
Expand Down Expand Up @@ -1201,7 +1191,7 @@ static void sbp2_reconnect(struct work_struct *work)
goto out;

generation = device->generation;
smp_rmb(); /* node_id must not be older than generation */
smp_rmb(); /* node IDs must not be older than generation */
node_id = device->node_id;
local_node_id = device->card->node_id;

Expand All @@ -1228,7 +1218,8 @@ static void sbp2_reconnect(struct work_struct *work)

tgt->node_id = node_id;
tgt->address_high = local_node_id << 16;
sbp2_set_generation(lu, generation);
smp_wmb(); /* node IDs must not be older than generation */
lu->generation = generation;

fw_notify("%s: reconnected to LUN %04x (%d retries)\n",
tgt->bus_id, lu->lun, lu->retries);
Expand Down

0 comments on commit 6ecc983

Please sign in to comment.