scale=0 define gcd(a,b) { auto t; while (b) { t = b; b = a % b; a = t; } return a; } /* Division by reciprocal multiplication. */ define fmul(b,n,d) { return (2^b*n+d-1)/d; } /* Adjustment factor when a ceiling value is used. Use as: (imul * n) + (fmulxx * n + fadjxx) >> xx) */ define fadj(b,n,d) { auto v; d = d/gcd(n,d); v = 2^b*(d-1)/d; return v; } /* Compute the appropriate mul/adj values as well as a shift count, which brings the mul value into the range 2^b-1 <= x < 2^b. Such a shift value will be correct in the signed integer range and off by at most one in the upper half of the unsigned range. */ define fmuls(b,n,d) { auto s, m; for (s = 0; 1; s++) { m = fmul(s,n,d); if (m >= 2^(b-1)) return s; } return 0; } define timeconst(hz) { print "/* Automatically generated by kernel/time/timeconst.bc */\n" print "/* Time conversion constants for HZ == ", hz, " */\n" print "\n" print "#ifndef KERNEL_TIMECONST_H\n" print "#define KERNEL_TIMECONST_H\n\n" print "#include \n" print "#include \n\n" print "#if HZ != ", hz, "\n" print "#error \qinclude/generated/timeconst.h has the wrong HZ value!\q\n" print "#endif\n\n" if (hz < 2) { print "#error Totally bogus HZ value!\n" } else { s=fmuls(32,1000,hz) obase=16 print "#define HZ_TO_MSEC_MUL32\tU64_C(0x", fmul(s,1000,hz), ")\n" print "#define HZ_TO_MSEC_ADJ32\tU64_C(0x", fadj(s,1000,hz), ")\n" obase=10 print "#define HZ_TO_MSEC_SHR32\t", s, "\n" s=fmuls(32,hz,1000) obase=16 print "#define MSEC_TO_HZ_MUL32\tU64_C(0x", fmul(s,hz,1000), ")\n" print "#define MSEC_TO_HZ_ADJ32\tU64_C(0x", fadj(s,hz,1000), ")\n" obase=10 print "#define MSEC_TO_HZ_SHR32\t", s, "\n" obase=10 cd=gcd(hz,1000) print "#define HZ_TO_MSEC_NUM\t\t", 1000/cd, "\n" print "#define HZ_TO_MSEC_DEN\t\t", hz/cd, "\n" print "#define MSEC_TO_HZ_NUM\t\t", hz/cd, "\n" print "#define MSEC_TO_HZ_DEN\t\t", 1000/cd, "\n" print "\n" s=fmuls(32,1000000,hz) obase=16 print "#define HZ_TO_USEC_MUL32\tU64_C(0x", fmul(s,1000000,hz), ")\n" print "#define HZ_TO_USEC_ADJ32\tU64_C(0x", fadj(s,1000000,hz), ")\n" obase=10 print "#define HZ_TO_USEC_SHR32\t", s, "\n" s=fmuls(32,hz,1000000) obase=16 print "#define USEC_TO_HZ_MUL32\tU64_C(0x", fmul(s,hz,1000000), ")\n" print "#define USEC_TO_HZ_ADJ32\tU64_C(0x", fadj(s,hz,1000000), ")\n" obase=10 print "#define USEC_TO_HZ_SHR32\t", s, "\n" obase=10 cd=gcd(hz,1000000) print "#define HZ_TO_USEC_NUM\t\t", 1000000/cd, "\n" print "#define HZ_TO_USEC_DEN\t\t", hz/cd, "\n" print "#define USEC_TO_HZ_NUM\t\t", hz/cd, "\n" print "#define USEC_TO_HZ_DEN\t\t", 1000000/cd, "\n" print "\n" print "#endif /* KERNEL_TIMECONST_H */\n" } halt } hz = read(); timeconst(hz) /commit/include?id=407788b51db6f6aab499d02420082f436abf3238'>include/net/mac80211.h
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2017-01-24 09:18:57 -0600
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-25 11:02:29 +0100
commit407788b51db6f6aab499d02420082f436abf3238 (patch)
treeb2fb3c885baf47cd2bd8ee0429f423b352e11905 /include/net/mac80211.h
parent7a308bb3016f57e5be11a677d15b821536419d36 (diff)
usb: musb: Fix host mode error -71 regression
Commit 467d5c980709 ("usb: musb: Implement session bit based runtime PM for musb-core") started implementing musb generic runtime PM support by introducing devctl register session bit based state control. This caused a regression where if a USB mass storage device is connected to a USB hub, we can get: usb 1-1: reset high-speed USB device number 2 using musb-hdrc usb 1-1: device descriptor read/64, error -71 usb 1-1.1: new high-speed USB device number 4 using musb-hdrc This is because before the USB storage device is connected, musb is in OTG_STATE_A_SUSPEND. And we currently only set need_finish_resume in musb_stage0_irq() and the related code calling finish_resume_work in musb_resume() and musb_runtime_resume() never gets called. To fix the issue, we can call schedule_delayed_work() directly in musb_stage0_irq() to have finish_resume_work run. And we should no longer never get interrupts when when suspended. We have changed musb to no longer need pm_runtime_irqsafe(). The need_finish_resume flag was added in commit 9298b4aad37e ("usb: musb: fix device hotplug behind hub") and no longer applies as far as I can tell. So let's just remove the earlier code that no longer is needed. Fixes: 467d5c980709 ("usb: musb: Implement session bit based runtime PM for musb-core") Reported-by: Bin Liu <b-liu@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Bin Liu <b-liu@ti.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/net/mac80211.h')