Module Name: src Committed By: skrll Date: Fri Feb 19 21:10:18 UTC 2016
Modified Files: src/sys/external/bsd/dwc2: dwc2.h Log Message: In msleep use udelay if cold or sleep is small enough. This is mostly copied from the drm2 version. To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/sys/external/bsd/dwc2/dwc2.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/external/bsd/dwc2/dwc2.h diff -u src/sys/external/bsd/dwc2/dwc2.h:1.7 src/sys/external/bsd/dwc2/dwc2.h:1.8 --- src/sys/external/bsd/dwc2/dwc2.h:1.7 Sun Aug 30 13:02:42 2015 +++ src/sys/external/bsd/dwc2/dwc2.h Fri Feb 19 21:10:18 2016 @@ -1,4 +1,4 @@ -/* $NetBSD: dwc2.h,v 1.7 2015/08/30 13:02:42 skrll Exp $ */ +/* $NetBSD: dwc2.h,v 1.8 2016/02/19 21:10:18 skrll Exp $ */ /*- * Copyright (c) 2013 The NetBSD Foundation, Inc. @@ -260,10 +260,13 @@ ndelay(unsigned long nsecs) } static inline void -msleep(unsigned int msecs) +msleep(unsigned int msec) { - - kpause("mdelay", false, mstohz(msecs), NULL); + if (cold || + ((hz < 1000) && (msec < (1000/hz)))) + udelay(msec * 1000); + else + (void)kpause("mdelay", false, mstohz(msec), NULL); } #define EREMOTEIO EIO