Skip to content

Commit b887472

Browse files
endriftJiri Kosina
authored andcommitted
HID: nintendo: Rate limit IMU compensation message
Some controllers are very bad at updating the IMU, leading to these messages spamming the syslog. Rate-limiting them helps with this a bit. Signed-off-by: Vicki Pfau <vi@endrift.com> Signed-off-by: Jiri Kosina <jkosina@suse.com>
1 parent b73bc6a commit b887472

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hid/hid-nintendo.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,10 +1455,10 @@ static void joycon_parse_imu_report(struct joycon_ctlr *ctlr,
14551455
ctlr->imu_avg_delta_ms;
14561456
ctlr->imu_timestamp_us += 1000 * ctlr->imu_avg_delta_ms;
14571457
if (dropped_pkts > JC_IMU_DROPPED_PKT_WARNING) {
1458-
hid_warn(ctlr->hdev,
1458+
hid_warn_ratelimited(ctlr->hdev,
14591459
"compensating for %u dropped IMU reports\n",
14601460
dropped_pkts);
1461-
hid_warn(ctlr->hdev,
1461+
hid_warn_ratelimited(ctlr->hdev,
14621462
"delta=%u avg_delta=%u\n",
14631463
delta, ctlr->imu_avg_delta_ms);
14641464
}

0 commit comments

Comments
 (0)