1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/can
Martin Jocic dd885d90c0 can: kvaser_pciefd: Use a single write when releasing RX buffers
Kvaser's PCIe cards uses the KCAN FPGA IP block which has dual 4K
buffers for incoming messages shared by all (currently up to eight)
channels. While the driver processes messages in one buffer, new
incoming messages are stored in the other and so on.

The design of KCAN is such that a buffer must be fully read and then
released. Releasing a buffer will make the FPGA switch buffers. If the
other buffer contains at least one incoming message the FPGA will also
instantly issue a new interrupt, if not the interrupt will be issued
after receiving the first new message.

With IRQx interrupts, it takes a little time for the interrupt to
happen, enough for any previous ISR call to do it's business and
return, but MSI interrupts are way faster so this time is reduced to
almost nothing.

So with MSI, releasing the buffer HAS to be the very last action of
the ISR before returning, otherwise the new interrupt might be
"masked" by the kernel because the previous ISR call hasn't returned.
And the interrupts are edge-triggered so we cannot loose one, or the
ping-pong reading process will stop.

This is why this patch modifies the driver to use a single write to
the SRB_CMD register before returning.

Signed-off-by: Martin Jocic <martin.jocic@kvaser.com>
Reviewed-by: Vincent Mailhol <mailhol.vincent@wanadoo.fr>
Link: https://patch.msgid.link/20240830153113.2081440-1-martin.jocic@kvaser.com
Fixes: 26ad340e58 ("can: kvaser_pciefd: Add driver for Kvaser PCIEcan devices")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
2024-08-30 23:45:55 +02:00
..
c_can net: can: Use device_get_match_data() 2024-01-19 08:08:53 -06:00
cc770 net: handle HAS_IOPORT dependencies 2024-04-08 11:56:56 +01:00
ctucanfd can: ctucanfd: Convert to platform remove callback returning void 2023-05-15 22:53:50 +02:00
dev net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
esd can: esd: add support for esd GmbH PCIe/402 CAN interface family 2024-02-12 16:58:30 +01:00
flexcan net: can: Use device_get_match_data() 2024-01-19 08:08:53 -06:00
ifi_canfd can: Explicitly include correct DT includes, part 2 2023-07-28 08:49:52 +02:00
m_can can: m_can: Limit coalescing to peripheral instances 2024-08-06 09:25:31 +02:00
mscan can: mscan: remove unused struct 'mscan_state' 2024-06-20 11:57:39 +02:00
peak_canfd net: Add struct kernel_ethtool_ts_info 2024-07-15 08:02:26 -07:00
rcar can: rcar_canfd: Remove superfluous parentheses in address calculations 2024-06-28 09:34:42 +02:00
sja1000 can: sja1000: plx_pci: Reuse predefined CTI subvendor ID 2024-06-20 11:52:56 +02:00
slcan tty: use u8 for flags 2023-08-11 21:12:45 +02:00
softing can: softing: remove redundant NULL check 2024-02-12 17:25:42 +01:00
spi can: mcp251x: fix deadlock if an interrupt occurs during mcp251x_open 2024-08-22 09:47:09 +02:00
usb minmax: don't use max() in situations that want a C constant expression 2024-07-28 20:23:27 -07:00
at91_can.c can: at91_can: switch to rx-offload implementation 2023-10-05 21:47:45 +02:00
bxcan.c can: Explicitly include correct DT includes, part 2 2023-07-28 08:49:52 +02:00
can327.c tty: use u8 for flags 2023-08-11 21:12:45 +02:00
grcan.c can: Explicitly include correct DT includes 2023-07-19 08:55:28 +02:00
janz-ican3.c can: janz-ican3: Convert to platform remove callback returning void 2023-05-15 22:53:50 +02:00
Kconfig can: Kconfig: remove obsolete help text for slcan 2024-06-20 11:52:56 +02:00
kvaser_pciefd.c can: kvaser_pciefd: Use a single write when releasing RX buffers 2024-08-30 23:45:55 +02:00
Makefile can: esd: add support for esd GmbH PCIe/402 CAN interface family 2024-02-12 16:58:30 +01:00
sun4i_can.c can: Explicitly include correct DT includes, part 2 2023-07-28 08:49:52 +02:00
ti_hecc.c can: rx-offload: rename rx_offload_get_echo_skb() -> can_rx_offload_get_echo_skb_queue_timestamp() 2023-07-28 09:45:24 +02:00
vcan.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
vxcan.c net: annotate writes on dev->mtu from ndo_change_mtu() 2024-05-07 16:19:14 -07:00
xilinx_can.c can: xilinx_can: Document driver description to list all supported IPs 2024-06-20 11:52:57 +02:00