]> git.baikalelectronics.ru Git - kernel.git/commit
enetc: Factor out the traffic start/stop procedures
authorClaudiu Manoil <claudiu.manoil@nxp.com>
Tue, 21 Jul 2020 07:55:18 +0000 (10:55 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 21 Jul 2020 22:38:30 +0000 (15:38 -0700)
commitd4b49449495b8091d21fc9aba6090c64e7ed2904
tree8bfa54adf369dadf0e85c8499a87ee469467e10d
parent1ee2da4648f34648131a781ae71e9d05463c3822
enetc: Factor out the traffic start/stop procedures

A reliable traffic pause (and reconfiguration) procedure
is needed to be able to safely make h/w configuration
changes during run-time, like changing the mode in which the
interrupts are operating (i.e. with or without coalescing),
as opposed to making on-the-fly register updates that
may be subject to h/w or s/w concurrency issues.
To this end, the code responsible of the run-time device
configurations that basically starts resp. stops the traffic
flow through the device has been extracted from the
the enetc_open/_close procedures, to the separate standalone
enetc_start/_stop procedures. Traffic stop should be as
graceful as possible, it lets the executing napi threads to
to finish while the interrupts stay disabled.  But since
the napi thread will try to re-enable interrupts by clearing
the device's unmask register, the enable_irq/ disable_irq
API has been used to avoid this potential concurrency issue
and make the traffic pause procedure more reliable.

Signed-off-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/enetc.c