diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2023-04-12 10:19:24 +0200 |
---|---|---|
committer | Tony Nguyen <anthony.l.nguyen@intel.com> | 2023-04-21 01:33:14 +0200 |
commit | 2f8fdcb0a73a1831cc4f205f23493a17c0e5536f (patch) | |
tree | fe3b55f104b233d1bcd3315e8a9b3fbb00b84ef9 /drivers/mfd | |
parent | net: libwx: fix memory leak in wx_setup_rx_resources (diff) | |
download | linux-2f8fdcb0a73a1831cc4f205f23493a17c0e5536f.tar.xz linux-2f8fdcb0a73a1831cc4f205f23493a17c0e5536f.zip |
ice: do not busy-wait to read GNSS data
The ice-gnss-<dev_name> kernel thread, which reads data from the u-blox
GNSS module, keep a CPU core almost 100% busy. The main reason is that
it busy-waits for data to become available.
A simple improvement would be to replace the "mdelay(10);" in
ice_gnss_read() with sleeping. A better fix is to not do any waiting
directly in the function and just requeue this delayed work as needed.
The advantage is that canceling the work from ice_gnss_exit() becomes
immediate, rather than taking up to ~2.5 seconds (ICE_MAX_UBX_READ_TRIES
* 10 ms).
This lowers the CPU usage of the ice-gnss-<dev_name> thread on my system
from ~90 % to ~8 %.
I am not sure if the larger 0.1 s pause after inserting data into the
gnss subsystem is really necessary, but I'm keeping that as it was.
Of course, ideally the driver would not have to poll at all, but I don't
know if the E810 can watch for GNSS data availability over the i2c bus
by itself and notify the driver.
Signed-off-by: Michal Schmidt <mschmidt@redhat.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Tested-by: Sunitha Mekala <sunithax.d.mekala@intel.com> (A Contingent worker at Intel)
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Diffstat (limited to 'drivers/mfd')
0 files changed, 0 insertions, 0 deletions