bianbu-linux-6.6/drivers/net/ethernet/intel
Michal Schmidt bf15bb38ec ice: make writes to /dev/gnssX synchronous
The current ice driver's GNSS write implementation buffers writes and
works through them asynchronously in a kthread. That's bad because:
 - The GNSS write_raw operation is supposed to be synchronous[1][2].
 - There is no upper bound on the number of pending writes.
   Userspace can submit writes much faster than the driver can process,
   consuming unlimited amounts of kernel memory.

A patch that's currently on review[3] ("[v3,net] ice: Write all GNSS
buffers instead of first one") would add one more problem:
 - The possibility of waiting for a very long time to flush the write
   work when doing rmmod, softlockups.

To fix these issues, simplify the implementation: Drop the buffering,
the write_work, and make the writes synchronous.

I tested this with gpsd and ubxtool.

[1] https://events19.linuxfoundation.org/wp-content/uploads/2017/12/The-GNSS-Subsystem-Johan-Hovold-Hovold-Consulting-AB.pdf
    "User interface" slide.
[2] A comment in drivers/gnss/core.c:gnss_write():
        /* Ignoring O_NONBLOCK, write_raw() is synchronous. */
[3] https://patchwork.ozlabs.org/project/intel-wired-lan/patch/20230217120541.16745-1-karol.kolacinski@intel.com/

Fixes: d6b98c8d24 ("ice: add write functionality for GNSS TTY")
Signed-off-by: Michal Schmidt <mschmidt@redhat.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>
Signed-off-by: David S. Miller <davem@davemloft.net>
2023-06-07 10:51:58 +01:00
..
e1000 e1000: Remove unnecessary use of kmap_atomic() 2022-11-02 11:09:13 -07:00
e1000e Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-04-20 16:29:51 -07:00
fm10k fm10k: Remove unnecessary aer.h include 2023-03-08 23:34:39 -08:00
i40e net: vlan: introduce skb_vlan_eth_hdr() 2023-04-23 14:16:44 +01:00
iavf iavf: send VLAN offloading caps once after VFR 2023-05-16 09:51:41 -07:00
ice ice: make writes to /dev/gnssX synchronous 2023-06-07 10:51:58 +01:00
igb igb: fix bit_shift to be in [1..8] range 2023-05-17 09:25:04 +01:00
igbvf Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-24 10:10:20 -07:00
igc igc: read before write to SRRCTL register 2023-05-03 09:19:11 +01:00
ixgbe ixgbe: Fix panic during XDP_TX with > 64 CPUs 2023-04-27 11:54:33 +02:00
ixgbevf drivers: net: turn on XDP features 2023-02-02 20:48:23 -08:00
e100.c e100: Fix possible use after free in e100_xmit_prepare 2022-11-23 08:38:22 -08:00
Kconfig ixgb: Remove ixgb driver 2023-03-19 10:51:07 +00:00
Makefile ixgb: Remove ixgb driver 2023-03-19 10:51:07 +00:00