bianbu-linux-6.6/drivers/net/ethernet/intel/ice
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
..
ice.h Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-17 16:29:25 -07:00
ice_adminq_cmd.h ice: Add 'Execute Pending LLDP MIB' Admin Queue command 2023-01-19 08:18:03 -08:00
ice_arfs.c ice: arfs: fix use-after-free when freeing @rx_cpu_rmap 2022-04-08 09:08:36 -07:00
ice_arfs.h
ice_base.c ice: Add support for XDP multi-buffer on Rx side 2023-02-01 23:30:27 +01:00
ice_base.h
ice_cgu_regs.h
ice_common.c ice: make writes to /dev/gnssX synchronous 2023-06-07 10:51:58 +01:00
ice_common.h ice: make writes to /dev/gnssX synchronous 2023-06-07 10:51:58 +01:00
ice_controlq.c ice: sleep, don't busy-wait, for ICE_CTL_Q_SQ_CMD_TIMEOUT 2023-04-20 16:33:14 -07:00
ice_controlq.h ice: sleep, don't busy-wait, for ICE_CTL_Q_SQ_CMD_TIMEOUT 2023-04-20 16:33:14 -07:00
ice_dcb.c ice: Fix DSCP PFC TLV creation 2023-03-07 13:02:01 -08:00
ice_dcb.h ice: Handle LLDP MIB Pending change 2023-01-19 08:18:03 -08:00
ice_dcb_lib.c ice: Fix undersized tx_flags variable 2023-05-12 09:27:44 +01:00
ice_dcb_lib.h ice: Prevent set_channel from changing queues while RDMA active 2023-01-27 11:32:18 -08:00
ice_dcb_nl.c
ice_dcb_nl.h
ice_ddp.c ice: Move support DDP code out of ice_flex_pipe.c 2023-01-19 08:18:03 -08:00
ice_ddp.h ice: Move support DDP code out of ice_flex_pipe.c 2023-01-19 08:18:03 -08:00
ice_devids.h ice: support features on new E810T variants 2022-09-28 11:40:57 -07:00
ice_devlink.c ice: remove comment about not supporting driver reinit 2023-03-30 09:35:07 -07:00
ice_devlink.h ice: Prevent ADQ, DCB coexistence with Custom Tx scheduler 2022-11-17 21:41:28 -08:00
ice_eswitch.c ice: remove unnecessary virtchnl_ether_addr struct use 2023-02-06 09:47:48 -08:00
ice_eswitch.h ice: allow creating VFs for !CONFIG_NET_SWITCHDEV 2022-04-14 08:19:54 -07:00
ice_ethtool.c ice: copy last block omitted in ice_get_module_eeprom() 2023-03-03 08:25:29 +00:00
ice_ethtool_fdir.c ice: Use correct order for the parameters of devm_kcalloc() 2022-06-08 08:55:13 -07:00
ice_fdir.c
ice_fdir.h
ice_flex_pipe.c ice: Reduce scope of variables 2023-01-19 08:18:03 -08:00
ice_flex_pipe.h ice: Move support DDP code out of ice_flex_pipe.c 2023-01-19 08:18:03 -08:00
ice_flex_type.h ice: Move support DDP code out of ice_flex_pipe.c 2023-01-19 08:18:03 -08:00
ice_flow.c
ice_flow.h
ice_fltr.c ice: sync netdev filters after clearing VSI 2023-02-03 09:54:18 -08:00
ice_fltr.h
ice_fw_update.c ice: handle E822 generic device ID in PLDM header 2022-07-12 09:25:34 -07:00
ice_fw_update.h
ice_gnss.c ice: make writes to /dev/gnssX synchronous 2023-06-07 10:51:58 +01:00
ice_gnss.h ice: make writes to /dev/gnssX synchronous 2023-06-07 10:51:58 +01:00
ice_hw_autogen.h ice: Add support Flex RXD 2022-10-27 13:23:43 +02:00
ice_idc.c ice: alloc id for RDMA using xa_array 2023-02-03 09:54:18 -08:00
ice_idc_int.h
ice_lag.c ice: remove non-inclusive language 2022-08-18 08:26:11 -07:00
ice_lag.h ice: remove non-inclusive language 2022-08-18 08:26:11 -07:00
ice_lan_tx_rx.h ice: Remove and replace ice speed defines with ethtool.h versions 2022-11-23 08:59:42 -08:00
ice_lib.c ice: Fix stats after PF reset 2023-05-16 09:51:40 -07:00
ice_lib.h ice: refactor VSI setup to use parameter structure 2023-02-06 09:37:31 -08:00
ice_main.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-24 10:10:20 -07:00
ice_nvm.c ice: Remove cppcheck suppressions 2023-01-19 08:18:03 -08:00
ice_nvm.h ice: Add additional flags to ice_nvm_write_activate 2022-08-24 08:45:54 -07:00
ice_osdep.h
ice_pf_vsi_vlan_ops.c
ice_pf_vsi_vlan_ops.h
ice_protocol_type.h ice: Add L2TPv3 hardware offload support 2022-09-20 09:13:38 +02:00
ice_ptp.c ice/ptp: fix the PTP worker retrying indefinitely if the link went down 2023-02-14 13:08:02 -08:00
ice_ptp.h ice: handle flushing stale Tx timestamps in ice_ptp_tx_tstamp 2022-12-08 13:15:03 -08:00
ice_ptp_consts.h
ice_ptp_hw.c ice: make Tx and Rx vernier offset calibration independent 2022-12-08 13:15:03 -08:00
ice_ptp_hw.h ice: make Tx and Rx vernier offset calibration independent 2022-12-08 13:15:03 -08:00
ice_repr.c ice: Accumulate ring statistics over reset 2022-11-23 08:59:43 -08:00
ice_repr.h
ice_sbq_cmd.h
ice_sched.c ice: fix invalid check for empty list in ice_sched_assoc_vsi_to_agg() 2023-03-28 09:48:49 -07:00
ice_sched.h ice: Add an option to pre-allocate memory for ice_sched_node 2022-11-17 21:41:28 -08:00
ice_sriov.c ice: Fix ice VF reset during iavf initialization 2023-05-16 09:51:41 -07:00
ice_sriov.h ice: move ice_is_malicious_vf() to ice_virtchnl.c 2023-03-13 11:06:06 -07:00
ice_switch.c ice: Fix ice_cfg_rdma_fltr() to only update relevant fields 2023-03-28 09:43:12 -07:00
ice_switch.h ice: Introduce enabling promiscuous mode on multiple VF's 2022-07-28 11:44:22 -07:00
ice_tc_lib.c ice: block LAN in case of VF to VF offload 2023-05-05 09:29:21 +01:00
ice_tc_lib.h ice: Support drop action 2023-01-19 08:18:03 -08:00
ice_trace.h
ice_txrx.c ice: recycle/free all of the fragments from multi-buffer frame 2023-06-01 09:59:39 -07:00
ice_txrx.h ice: Fix undersized tx_flags variable 2023-05-12 09:27:44 +01:00
ice_txrx_lib.c ice: fix W=1 headers mismatch 2023-03-28 09:42:05 -07:00
ice_txrx_lib.h ice: Micro-optimize .ndo_xdp_xmit() path 2023-02-13 19:13:13 +01:00
ice_type.h ice: move VF overflow message count into struct ice_mbx_vf_info 2023-03-13 10:32:32 -07:00
ice_vf_lib.c ice: Fix ice VF reset during iavf initialization 2023-05-16 09:51:41 -07:00
ice_vf_lib.h ice: Fix ice VF reset during iavf initialization 2023-05-16 09:51:41 -07:00
ice_vf_lib_private.h ice: introduce ice_vf_init_host_cfg function 2023-02-06 09:41:56 -08:00
ice_vf_mbx.c ice: merge ice_mbx_report_malvf with ice_mbx_vf_state_handler 2023-03-13 11:00:10 -07:00
ice_vf_mbx.h ice: initialize mailbox snapshot earlier in PF init 2023-03-13 11:06:05 -07:00
ice_vf_vsi_vlan_ops.c ice: Fix disabling Rx VLAN filtering with port VLAN enabled 2023-02-06 15:13:02 -08:00
ice_vf_vsi_vlan_ops.h
ice_virtchnl.c ice: Fix ice VF reset during iavf initialization 2023-05-16 09:51:41 -07:00
ice_virtchnl.h ice: call ice_is_malicious_vf() from ice_vc_process_vf_msg() 2023-03-13 11:06:06 -07:00
ice_virtchnl_allowlist.c ice: Add support Flex RXD 2022-10-27 13:23:43 +02:00
ice_virtchnl_allowlist.h
ice_virtchnl_fdir.c ice: Reset FDIR counter in FDIR init stage 2023-04-04 08:34:52 -07:00
ice_virtchnl_fdir.h
ice_vlan.h
ice_vlan_mode.c ice: Add support for VLAN TPID filters in switchdev 2022-06-30 13:53:33 -07:00
ice_vlan_mode.h
ice_vsi_vlan_lib.c
ice_vsi_vlan_lib.h
ice_vsi_vlan_ops.c
ice_vsi_vlan_ops.h
ice_xsk.c ice: xsk: disable txq irq before flushing hw 2023-03-16 17:36:58 +00:00
ice_xsk.h ice: xsk: change batched Tx descriptor cleaning 2022-09-27 08:11:02 -07:00
Makefile ice: remove unnecessary CONFIG_ICE_GNSS 2023-02-26 14:53:09 +00:00