HID: core: Add printk_ratelimited variants to hid_warn() etc
Subsystems (2)
Vicki Pfau
maintainerPATCH 1/3 HID: core: Add printk_ratelimited variants to hid_warn() etc
hid_warn_ratelimited() is needed. Add the others as part of the block.
Signed-off-by Vicki Pfau <[email protected]>
--- include/linux/hid.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
include/linux/hid.h +11 -0
@@ -1261,4 +1261,15 @@ void hid_quirks_exit(__u16 bus);#define hid_dbg_once (hid, fmt, ...) \ dev_dbg_once(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_err_ratelimited (hid, fmt, ...) \ + dev_err_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_notice_ratelimited (hid, fmt, ...) \ + dev_notice_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_warn_ratelimited (hid, fmt, ...) \ + dev_warn_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_info_ratelimited (hid, fmt, ...) \ + dev_info_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#define hid_dbg_ratelimited (hid, fmt, ...) \ + dev_dbg_ratelimited(&(hid)->dev, fmt, ##__VA_ARGS__) +#endif
Signature · 1 line
2.51.0
Vicki Pfau
maintainerPATCH 2/3 HID: nintendo: Wait longer for initial probe
Some third-party controllers, such as the PB Tails CHOC, won't always respond quickly on startup. Since this packet is needed for probe, and only once during probe, let's just wait an extra second, which makes connecting consistent.
Signed-off-by Vicki Pfau <[email protected]>
--- drivers/hid/hid-nintendo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/hid-nintendo.c +1 -1
@@ -2420,7 +2420,7 @@ static int joycon_read_info(struct joycon_ctlr *ctlr)struct joycon_input_report *report; req.subcmd_id =JC_SUBCMD_REQ_DEV_INFO ; - ret =joycon_send_subcmd (ctlr, &req,0 ,HZ ); + ret =joycon_send_subcmd (ctlr, &req,0 ,2 *HZ );if (ret) {hid_err (ctlr->hdev,"Failed to get joycon info; ret=%d\n" , ret);return ret;
Signature · 1 line
2.51.0
Vicki Pfau
maintainerPATCH 3/3 HID: nintendo: Rate limit IMU compensation message
In reply to Vicki PfauSome 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 <[email protected]>
--- drivers/hid/hid-nintendo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hid/hid-nintendo.c +2 -2
@@ -1455,10 +1455,10 @@ static void joycon_parse_imu_report(struct joycon_ctlr *ctlr, ctlr->imu_avg_delta_ms; ctlr->imu_timestamp_us +=1000 * ctlr->imu_avg_delta_ms;if (dropped_pkts >JC_IMU_DROPPED_PKT_WARNING ) { -hid_warn (ctlr->hdev, +hid_warn_ratelimited (ctlr->hdev,"compensating for %u dropped IMU reports\n" , dropped_pkts); -hid_warn (ctlr->hdev, +hid_warn_ratelimited (ctlr->hdev,"delta=%u avg_delta=%u\n" , delta, ctlr->imu_avg_delta_ms); }
Signature · 1 line
2.51.0
Applied all three to hid.git#for-6.18/upstream-fixes, thanks.
Signature · 2 lines
Jiri Kosina SUSE Labs