Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80953
b: refs/heads/master
c: a4c379c
h: refs/heads/master
i:
  80951: 1d7c699
v: v3
  • Loading branch information
Jarod Wilson authored and Stefan Richter committed Jan 30, 2008
1 parent 76ae9e1 commit ae29f56
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 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: 8f9f963e5d9853dbc5fa5091f15ae64f423d3d89
refs/heads/master: a4c379c1979fbc417099cd22ba16735bc3625bbf
16 changes: 13 additions & 3 deletions trunk/drivers/firewire/fw-sbp2.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,16 @@ struct sbp2_target {
struct list_head lu_list;
};

#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000
/*
* Per section 7.4.8 of the SBP-2 spec, a mgt_ORB_timeout value can be
* provided in the config rom. A high timeout value really only matters
* on initial login, where we'll just use 20s rather than hassling with
* reading the config rom, since it really wouldn't buy us much.
*/
#define SBP2_LOGIN_ORB_TIMEOUT 20000 /* Timeout in ms */
#define SBP2_ORB_TIMEOUT 2000 /* Timeout in ms */
#define SBP2_ORB_NULL 0x80000000
#define SBP2_MAX_SG_ELEMENT_LENGTH 0xf000

#define SBP2_DIRECTION_TO_MEDIA 0x0
#define SBP2_DIRECTION_FROM_MEDIA 0x1
Expand Down Expand Up @@ -488,6 +495,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
{
struct fw_device *device = fw_device(lu->tgt->unit->device.parent);
struct sbp2_management_orb *orb;
unsigned int timeout;
int retval = -ENOMEM;

orb = kzalloc(sizeof(*orb), GFP_ATOMIC);
Expand Down Expand Up @@ -519,6 +527,9 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
orb->request.misc |=
MANAGEMENT_ORB_RECONNECT(2) |
MANAGEMENT_ORB_EXCLUSIVE(sbp2_param_exclusive_login);
timeout = SBP2_LOGIN_ORB_TIMEOUT;
} else {
timeout = SBP2_ORB_TIMEOUT;
}

fw_memcpy_to_be32(&orb->request, &orb->request, sizeof(orb->request));
Expand All @@ -535,8 +546,7 @@ sbp2_send_management_orb(struct sbp2_logical_unit *lu, int node_id,
sbp2_send_orb(&orb->base, lu, node_id, generation,
lu->tgt->management_agent_address);

wait_for_completion_timeout(&orb->done,
msecs_to_jiffies(SBP2_ORB_TIMEOUT));
wait_for_completion_timeout(&orb->done, msecs_to_jiffies(timeout));

retval = -EIO;
if (sbp2_cancel_orbs(lu) == 0) {
Expand Down

0 comments on commit ae29f56

Please sign in to comment.