Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341690
b: refs/heads/master
c: ebf98e7
h: refs/heads/master
v: v3
  • Loading branch information
Ben Hutchings committed Dec 1, 2012
1 parent 44e6281 commit c123ee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: c2f3b8e3a44b6fe9e36704e30157ebe1a88c08b1
refs/heads/master: ebf98e797b4e26ad52ace1511a0b503ee60a6cd4
12 changes: 6 additions & 6 deletions trunk/drivers/net/ethernet/sfc/mcdi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
**************************************************************************
*/

#define MCDI_RPC_TIMEOUT 10 /*seconds */
#define MCDI_RPC_TIMEOUT (10 * HZ)

#define MCDI_PDU(efx) \
(efx_port_num(efx) ? MC_SMEM_P1_PDU_OFST : MC_SMEM_P0_PDU_OFST)
Expand Down Expand Up @@ -120,7 +120,7 @@ static void efx_mcdi_copyout(struct efx_nic *efx, u8 *outbuf, size_t outlen)
static int efx_mcdi_poll(struct efx_nic *efx)
{
struct efx_mcdi_iface *mcdi = efx_mcdi(efx);
unsigned int time, finish;
unsigned long time, finish;
unsigned int respseq, respcmd, error;
unsigned int pdu = FR_CZ_MC_TREG_SMEM + MCDI_PDU(efx);
unsigned int rc, spins;
Expand All @@ -136,7 +136,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
* and poll once a jiffy (approximately)
*/
spins = TICK_USEC;
finish = get_seconds() + MCDI_RPC_TIMEOUT;
finish = jiffies + MCDI_RPC_TIMEOUT;

while (1) {
if (spins != 0) {
Expand All @@ -146,7 +146,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
schedule_timeout_uninterruptible(1);
}

time = get_seconds();
time = jiffies;

rmb();
efx_readd(efx, &reg, pdu);
Expand All @@ -158,7 +158,7 @@ static int efx_mcdi_poll(struct efx_nic *efx)
EFX_DWORD_FIELD(reg, MCDI_HEADER_RESPONSE))
break;

if (time >= finish)
if (time_after(time, finish))
return -ETIMEDOUT;
}

Expand Down Expand Up @@ -257,7 +257,7 @@ static int efx_mcdi_await_completion(struct efx_nic *efx)
if (wait_event_timeout(
mcdi->wq,
atomic_read(&mcdi->state) == MCDI_STATE_COMPLETED,
msecs_to_jiffies(MCDI_RPC_TIMEOUT * 1000)) == 0)
MCDI_RPC_TIMEOUT) == 0)
return -ETIMEDOUT;

/* Check if efx_mcdi_set_mode() switched us back to polled completions.
Expand Down

0 comments on commit c123ee0

Please sign in to comment.