]> git.baikalelectronics.ru Git - kernel.git/commit
can: rx-offload: can_rx_offload_irq_offload_fifo(): continue on error
authorMarc Kleine-Budde <mkl@pengutronix.de>
Tue, 24 Sep 2019 18:45:38 +0000 (18:45 +0000)
committerMarc Kleine-Budde <mkl@pengutronix.de>
Mon, 4 Nov 2019 20:47:22 +0000 (21:47 +0100)
commitd90f4dfe21e6ab1bc7db85ca21df568d24d0dc0d
tree5651e44bf48a4ff1319f9a238bc1bfc2610ca05c
parent8e7e1187e13d193df745430400ec94dfbe26ce00
can: rx-offload: can_rx_offload_irq_offload_fifo(): continue on error

In case of a resource shortage, i.e. the rx_offload queue will overflow
or a skb fails to be allocated (due to OOM),
can_rx_offload_offload_one() will call mailbox_read() to discard the
mailbox and return an ERR_PTR.

If the hardware FIFO is empty can_rx_offload_offload_one() will return
NULL.

In case a CAN frame was read from the hardware,
can_rx_offload_offload_one() returns the skb containing it.

Without this patch can_rx_offload_irq_offload_fifo() bails out if no skb
returned, regardless of the reason.

Similar to can_rx_offload_irq_offload_timestamp() in case of a resource
shortage the whole FIFO should be discarded, to avoid an IRQ storm and
give the system some time to recover. However if the FIFO is empty the
loop can be left.

With this patch the loop is left in case of empty FIFO, but not on
errors.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
drivers/net/can/rx-offload.c