Skip to contentSkip to conversation

sfc: Fix polling for slow MCDI operations

PATCH Applied Ben Hutchings 2 participants 2 messages Jan 13, 2010 – Jan 14, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 sfc: Fix polling for slow MCDI operations

When the interface is down and we are using polled mode for MCDI operations, we busy-wait for completion for approximately 1 jiffy using udelay() and then back off to schedule(). But the completion will not wake the task, since we are using polled mode! We must use schedule_timeout_uninterruptible() instead.

---
 drivers/net/sfc/mcdi.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/sfc/mcdi.c +3 -2
index 683353b..0d4eba7 100644
@@ -142,8 +142,9 @@ static int efx_mcdi_poll(struct efx_nic *efx)
 		if (spins != 0) {
 			--spins;
 			udelay(1);
-		} else
-			schedule();
+		} else {
+			schedule_timeout_uninterruptible(1);
+		}
 
 		time = get_seconds();
 
Signature · 6 lines
1.5.5

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
maintainer Applied
#1 lore raw

From: Ben Hutchings <[email protected]>
Date: Wed, 13 Jan 2010 14:34:25 +0000

Quoted 7 lines

When the interface is down and we are using polled mode for MCDI operations, we busy-wait for completion for approximately 1 jiffy using udelay() and then back off to schedule(). But the completion will not wake the task, since we are using polled mode! We must use schedule_timeout_uninterruptible() instead.

Applied.