mirror of https://gitee.com/openkylin/linux.git
bf0ffea336
"x25_close" is called by "hdlc_close" in "hdlc.c", which is called by
hardware drivers' "ndo_stop" function.
"x25_xmit" is called by "hdlc_start_xmit" in "hdlc.c", which is hardware
drivers' "ndo_start_xmit" function.
"x25_rx" is called by "hdlc_rcv" in "hdlc.c", which receives HDLC frames
from "net/core/dev.c".
"x25_close" races with "x25_xmit" and "x25_rx" because their callers race.
However, we need to ensure that the LAPB APIs called in "x25_xmit" and
"x25_rx" are called before "lapb_unregister" is called in "x25_close".
This patch adds locking to ensure when "x25_xmit" and "x25_rx" are doing
their work, "lapb_unregister" is not yet called in "x25_close".
Reasons for not solving the racing between "x25_close" and "x25_xmit" by
calling "netif_tx_disable" in "x25_close":
1. We still need to solve the racing between "x25_close" and "x25_rx";
2. The design of the HDLC subsystem assumes the HDLC hardware drivers
have full control over the TX queue, and the HDLC protocol drivers (like
this driver) have no control. Controlling the queue here in the protocol
driver may interfere with hardware drivers' control of the queue.
Fixes:
|
||
---|---|---|
.. | ||
lmc | ||
.gitignore | ||
Kconfig | ||
Makefile | ||
c101.c | ||
cosa.c | ||
cosa.h | ||
farsync.c | ||
farsync.h | ||
fsl_ucc_hdlc.c | ||
fsl_ucc_hdlc.h | ||
hd64570.c | ||
hd64570.h | ||
hd64572.c | ||
hd64572.h | ||
hdlc.c | ||
hdlc_cisco.c | ||
hdlc_fr.c | ||
hdlc_ppp.c | ||
hdlc_raw.c | ||
hdlc_raw_eth.c | ||
hdlc_x25.c | ||
hostess_sv11.c | ||
ixp4xx_hss.c | ||
lapbether.c | ||
n2.c | ||
pc300too.c | ||
pci200syn.c | ||
sbni.c | ||
sbni.h | ||
sealevel.c | ||
slic_ds26522.c | ||
slic_ds26522.h | ||
wanxl.c | ||
wanxl.h | ||
wanxlfw.S | ||
wanxlfw.inc_shipped | ||
z85230.c | ||
z85230.h |