linux/drivers/net/ethernet/freescale/enetc
Yangbo Lu 7ce9c3d363 enetc: fix locking for one-step timestamping packet transfer
The previous patch to support PTP Sync packet one-step timestamping
described one-step timestamping packet handling logic as below in
commit message:

- Trasmit packet immediately if no other one in transfer, or queue to
  skb queue if there is already one in transfer.
  The test_and_set_bit_lock() is used here to lock and check state.
- Start a work when complete transfer on hardware, to release the bit
  lock and to send one skb in skb queue if has.

There was not problem of the description, but there was a mistake in
implementation. The locking/test_and_set_bit_lock() should be put in
enetc_start_xmit() which may be called by worker, rather than in
enetc_xmit(). Otherwise, the worker calling enetc_start_xmit() after
bit lock released is not able to lock again for transfer.

Fixes: 7294380c52 ("enetc: support PTP Sync packet one-step timestamping")
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-04-23 13:52:30 -07:00
..
enetc_cbdr.c net: enetc: pass bd_count as an argument to enetc_setup_cbdr 2021-03-10 13:14:15 -08:00
enetc_ethtool.c net: enetc: add support for flow control 2021-04-19 15:31:45 -07:00
enetc_hw.h net: enetc: add support for flow control 2021-04-19 15:31:45 -07:00
enetc_ierb.c net: enetc: add a mini driver for the Integrated Endpoint Register Block 2021-04-19 15:31:45 -07:00
enetc_ierb.h net: enetc: add a mini driver for the Integrated Endpoint Register Block 2021-04-19 15:31:45 -07:00
enetc_mdio.c enetc: reorder macros and functions 2021-01-05 15:19:19 -08:00
enetc_msg.c enetc: Add vf to pf messaging support 2019-01-24 21:55:53 -08:00
enetc_pci_mdio.c net: enetc: fix an issue about leak system resources 2020-05-04 10:51:20 -07:00
enetc_pf.c net: enetc: add support for flow control 2021-04-19 15:31:45 -07:00
enetc_pf.h enetc: Migrate to PHYLINK and PCS_LYNX 2020-10-11 11:04:42 -07:00
enetc_ptp.c enetc: Add missing call to 'pci_free_irq_vectors()' in probe and remove functions 2019-08-31 23:53:17 -07:00
enetc_qos.c net: enetc: create a common enetc_pf_to_port helper 2021-04-19 15:31:45 -07:00
enetc_vf.c net: enetc: teardown CBDR during PF/VF unbind 2021-03-19 12:13:11 -07:00
enetc.c enetc: fix locking for one-step timestamping packet transfer 2021-04-23 13:52:30 -07:00
enetc.h net: enetc: create a common enetc_pf_to_port helper 2021-04-19 15:31:45 -07:00
Kconfig net: enetc: automatically select IERB module 2021-04-20 16:56:32 -07:00
Makefile net: enetc: add a mini driver for the Integrated Endpoint Register Block 2021-04-19 15:31:45 -07:00