diff options
author | Oliver Hartkopp <oliver@hartkopp.net> | 2009-09-15 04:31:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-09-15 04:31:34 -0400 |
commit | 481a8199142c050b72bff8a1956a49fd0a75bbe0 (patch) | |
tree | 66bcd9798738a760c9982d62b9a39b57774e8349 /net/can/af_can.c | |
parent | 0b6a05c1dbebe8c616e2e5b0f52b7a01fd792911 (diff) |
can: fix NOHZ local_softirq_pending 08 warning
When using nanosleep() in an userspace application we get a ratelimit warning
NOHZ: local_softirq_pending 08
for 10 times.
The echo of CAN frames is done from process context and softirq context only.
Therefore the usage of netif_rx() was wrong (for years).
This patch replaces netif_rx() with netif_rx_ni() which has to be used from
process/softirq context. It also adds a missing comment that can_send() must
no be used from hardirq context.
Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
Signed-off-by: Urs Thuermann <urs@isnogud.escape.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/can/af_can.c')
-rw-r--r-- | net/can/af_can.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/can/af_can.c b/net/can/af_can.c index ef1c43a2ed56..606832115674 100644 --- a/net/can/af_can.c +++ b/net/can/af_can.c | |||
@@ -199,6 +199,8 @@ static int can_create(struct net *net, struct socket *sock, int protocol) | |||
199 | * @skb: pointer to socket buffer with CAN frame in data section | 199 | * @skb: pointer to socket buffer with CAN frame in data section |
200 | * @loop: loopback for listeners on local CAN sockets (recommended default!) | 200 | * @loop: loopback for listeners on local CAN sockets (recommended default!) |
201 | * | 201 | * |
202 | * Due to the loopback this routine must not be called from hardirq context. | ||
203 | * | ||
202 | * Return: | 204 | * Return: |
203 | * 0 on success | 205 | * 0 on success |
204 | * -ENETDOWN when the selected interface is down | 206 | * -ENETDOWN when the selected interface is down |
@@ -278,7 +280,7 @@ int can_send(struct sk_buff *skb, int loop) | |||
278 | } | 280 | } |
279 | 281 | ||
280 | if (newskb) | 282 | if (newskb) |
281 | netif_rx(newskb); | 283 | netif_rx_ni(newskb); |
282 | 284 | ||
283 | /* update statistics */ | 285 | /* update statistics */ |
284 | can_stats.tx_frames++; | 286 | can_stats.tx_frames++; |