I see what is going on here, we put a conditional check on the duration of the sleep range to use the correct delay function, but it only went on in one of the sleeps.
I will submit a patch for this. Could you please submit your kernel configuration so that I can enable the same debugging that you are using to recreate the error message? DE > -----Original Message----- > From: bup...@figpost.com [mailto:bup...@figpost.com] > Sent: Saturday, November 30, 2013 4:24 AM > To: e1000-devel@lists.sourceforge.net > Subject: [E1000-devel] Is call to e1000e_phy_has_link_generic with > interval=100000 too large for udelay? > > I'm getting the error: > ERROR: "__bad_udelay" [drivers/net/ethernet/intel/e1000e/e1000e.ko] > undefined! > when building Gentoo's hardened-sources-3.11.2 with GCC 4.7.3 on x86_64. > > Looking at drivers/net/ethernet/intel/e1000e/phy.c, there are several calls > to e1000e_phy_has_link_generic() with usec_interval=100000 (e.g., > https://github.com/torvalds/linux/blob/master/drivers/net/ethernet/intel/ > e1000e/phy.c#L1244 ). > > The implementation of e1000e_phy_has_link_generic() does this: > > ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); > if (ret_val) > /* If the first read fails, another entity may have > * ownership of the resources, wait and try again to > * see if they have relinquished the resources yet. > */ > udelay(usec_interval); > ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); > > Is calling udelay() with such a large interval allowed? include/asm- > generic/delay.h seems to indicate that udelay() cannot be used for intervals > bigger than 20000 usec. (And note that later in > e1000e_phy_has_link_generic(), we do switch to mdelay() for intervals > larger than 1000 usec -- though I'm not sure if it's a good idea to mdelay() > for > 100000 usec either, since mdelay() is still implemented as a busy-loop.) > > (I'm not sure why I haven't seen the __bad_udelay error before, since the > implementation of phy.c has not changed recently.) > > ------------------------------------------------------------------------------ > Rapidly troubleshoot problems before they affect your business. Most IT > organizations don't have a clear picture of how application performance > affects their revenue. With AppDynamics, you get 100% visibility into your > Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics > Pro! > http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clk > trk > _______________________________________________ > E1000-devel mailing list > E1000-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/e1000-devel > To learn more about Intel® Ethernet, visit > http://communities.intel.com/community/wired ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349351&iu=/4140/ostg.clktrk _______________________________________________ E1000-devel mailing list E1000-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/e1000-devel To learn more about Intel® Ethernet, visit http://communities.intel.com/community/wired