lkml.org 
[lkml]   [2016]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH V4 2/4] net-next: mediatek: add support for MT7623 ethernet
From
From: John Crispin <blogic@openwrt.org>
Date: Mon, 7 Mar 2016 09:56:35 +0100

> +static int mtk_mdio_busy_wait(struct mtk_eth *eth)
> +{
> + unsigned long t_start = jiffies;
> +
> + while (1) {
> + if (!(mtk_r32(eth, MTK_PHY_IAC) & PHY_IAC_ACCESS))
> + return 0;
> + if (time_after(jiffies, t_start + PHY_IAC_TIMEOUT))
> + break;
> + }
> +
> + dev_err(eth->dev, "mdio: MDIO timeout\n");
> + return -1;
> +}

Busy polling in a loop for up to 5 seconds with no preemption points
is not something you can do, sorry.

\
 
 \ /
  Last update: 2016-03-07 18:01    [W:0.510 / U:1.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site