summaryrefslogtreecommitdiffstats
path: root/drivers/hid/intel-ish-hid/ishtp/hbm.c
diff options
context:
space:
mode:
authorLinus Torvalds2017-07-10 18:22:48 +0200
committerLinus Torvalds2017-07-10 18:22:48 +0200
commita91ab911df51ac364e594d5950ed508d91091498 (patch)
tree035d64bd871f752b74f9e8128244311e702d95d4 /drivers/hid/intel-ish-hid/ishtp/hbm.c
parentMerge tag 'drm-for-v4.13' of git://people.freedesktop.org/~airlied/linux (diff)
parentMerge branches 'for-4.13/multitouch', 'for-4.13/retrode', 'for-4.13/transport... (diff)
downloadkernel-qcow2-linux-a91ab911df51ac364e594d5950ed508d91091498.tar.gz
kernel-qcow2-linux-a91ab911df51ac364e594d5950ed508d91091498.tar.xz
kernel-qcow2-linux-a91ab911df51ac364e594d5950ed508d91091498.zip
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: - open/close tracking improvements from Dmitry Torokhov - battery support improvements in Wacom driver from Jason Gerecke - Win8 support fixes from Benjamin Tissories and Hans de Geode - misc fixes to Intel-ISH driver from Arnd Bergmann - support for quite a few new devices and small assorted fixes here and there * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (35 commits) HID: intel-ish-hid: Enable Gemini Lake ish driver HID: intel-ish-hid: Enable Cannon Lake ish driver HID: wacom: fix mistake in printk HID: multitouch: optimize the sticky fingers timer HID: multitouch: fix rare Win 8 cases when the touch up event gets missing HID: multitouch: use BIT macro HID: Add driver for Retrode2 joypad adapter HID: multitouch: Add support for Google Rose Touchpad HID: multitouch: Support PTP Stick and Touchpad device HID: core: don't use negative operands when shift HID: apple: Use country code to detect ISO keyboards HID: remove no longer used hid->open field greybus: hid: remove custom locking from gb_hid_open/close HID: usbhid: remove custom locking from usbhid_open/close HID: i2c-hid: remove custom locking from i2c_hid_open/close HID: serialize hid_hw_open and hid_hw_close HID: usbhid: do not rely on hid->open when deciding to do IO HID: hiddev: use hid_hw_power instead of usbhid_get/put_power HID: hiddev: use hid_hw_open/close instead of usbhid_open/close HID: asus: Add support for Zen AiO MD-5110 keyboard ...
Diffstat (limited to 'drivers/hid/intel-ish-hid/ishtp/hbm.c')
-rw-r--r--drivers/hid/intel-ish-hid/ishtp/hbm.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/hid/intel-ish-hid/ishtp/hbm.c b/drivers/hid/intel-ish-hid/ishtp/hbm.c
index b7213608ce43..ae4a69f7f2f4 100644
--- a/drivers/hid/intel-ish-hid/ishtp/hbm.c
+++ b/drivers/hid/intel-ish-hid/ishtp/hbm.c
@@ -321,13 +321,10 @@ int ishtp_hbm_cl_flow_control_req(struct ishtp_device *dev,
if (!rv) {
++cl->out_flow_ctrl_creds;
++cl->out_flow_ctrl_cnt;
- getnstimeofday(&cl->ts_out_fc);
- if (cl->ts_rx.tv_sec && cl->ts_rx.tv_nsec) {
- struct timespec ts_diff;
-
- ts_diff = timespec_sub(cl->ts_out_fc, cl->ts_rx);
- if (timespec_compare(&ts_diff, &cl->ts_max_fc_delay)
- > 0)
+ cl->ts_out_fc = ktime_get();
+ if (cl->ts_rx) {
+ ktime_t ts_diff = ktime_sub(cl->ts_out_fc, cl->ts_rx);
+ if (ktime_after(ts_diff, cl->ts_max_fc_delay))
cl->ts_max_fc_delay = ts_diff;
}
} else {