diff options
author | Douglas Anderson <dianders@chromium.org> | 2020-09-03 07:43:02 +0300 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2020-09-09 09:40:01 +0300 |
commit | eafb2203626aedb599cc80aadcba533c917b53b0 (patch) | |
tree | 7f46d44189ffa57fb77fe7eaf25adf63a29a479c /drivers/hid | |
parent | fc3abb53250a90ba2150eebd182137c136f4d25a (diff) | |
download | linux-eafb2203626aedb599cc80aadcba533c917b53b0.tar.xz |
HID: i2c-hid: Prefer asynchronous probe
Adding printouts to the i2c_hid_probe() function shows that it takes
quite some time. It used to take about 70 ms, but after commit
eef4016243e9 ("HID: i2c-hid: Always sleep 60ms after I2C_HID_PWR_ON
commands") it takes about 190 ms. This is not tons of time but it's
not trivial. Because we haven't yet specified that we'd prefer
asynchronous probe for this driver then, if the driver is builtin to
the kernel, we'll wait for this driver to finish before we start
probes for more drivers. Let's set the flag to enable asynchronous
for this driver so that other drivers aren't blocked from probing
until we finish.
Since this driver can be configured as a module and modules are
always asynchronously probed this is quite a safe change and will
benefit anyone who has a reason to build this driver into the kernel
instead of using it as a module.
[jkosina@suse.cz: drop spurious whitespace addition]
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid')
-rw-r--r-- | drivers/hid/i2c-hid/i2c-hid-core.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid-core.c b/drivers/hid/i2c-hid/i2c-hid-core.c index dbd04492825d..d053b86d0e2e 100644 --- a/drivers/hid/i2c-hid/i2c-hid-core.c +++ b/drivers/hid/i2c-hid/i2c-hid-core.c @@ -1268,6 +1268,7 @@ static struct i2c_driver i2c_hid_driver = { .driver = { .name = "i2c_hid", .pm = &i2c_hid_pm, + .probe_type = PROBE_PREFER_ASYNCHRONOUS, .acpi_match_table = ACPI_PTR(i2c_hid_acpi_match), .of_match_table = of_match_ptr(i2c_hid_of_match), }, |