Skip to content

Commit d5c8725

Browse files
committed
Merge tag 'linux-can-next-for-5.17-20220108' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
Marc Kleine-Budde says: ==================== pull-request: can-next 2022-01-08 this is a pull request of 22 patches for net-next/master. The first patch is by Tom Rix and fixes an uninitialized variable in the janz-ican3 driver (introduced in linux-can-next-for-5.17-20220105). The next 13 patches are by my and target the mcp251xfd driver. First several cleanup patches, then the driver is prepared for the upcoming ethtool ring parameter and IRQ coalescing support, which is added in a later pull request. The remaining 8 patches are by Dario Binacchi and me and enhance the flexcan driver. The driver is moved into a sub directory. An ethtool private flag is added to optionally disable CAN RTR frame reception, to make use of more RX buffers. The resulting RX buffer configuration can be read by ethtool ring parameter support. Finally documentation for the ethtool private flag is added to the Documentation/networking/device_drivers/can directory. ==================== Signed-off-by: David S. Miller <[email protected]>
2 parents 82192cb + bc3897f commit d5c8725

File tree

18 files changed

+1621
-1214
lines changed

18 files changed

+1621
-1214
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
.. SPDX-License-Identifier: GPL-2.0+
2+
3+
=============================
4+
Flexcan CAN Controller driver
5+
=============================
6+
7+
Authors: Marc Kleine-Budde <[email protected]>,
8+
Dario Binacchi <[email protected]>
9+
10+
On/off RTR frames reception
11+
===========================
12+
13+
For most flexcan IP cores the driver supports 2 RX modes:
14+
15+
- FIFO
16+
- mailbox
17+
18+
The older flexcan cores (integrated into the i.MX25, i.MX28, i.MX35
19+
and i.MX53 SOCs) only receive RTR frames if the controller is
20+
configured for RX-FIFO mode.
21+
22+
The RX FIFO mode uses a hardware FIFO with a depth of 6 CAN frames,
23+
while the mailbox mode uses a software FIFO with a depth of up to 62
24+
CAN frames. With the help of the bigger buffer, the mailbox mode
25+
performs better under high system load situations.
26+
27+
As reception of RTR frames is part of the CAN standard, all flexcan
28+
cores come up in a mode where RTR reception is possible.
29+
30+
With the "rx-rtr" private flag the ability to receive RTR frames can
31+
be waived at the expense of losing the ability to receive RTR
32+
messages. This trade off is beneficial in certain use cases.
33+
34+
"rx-rtr" on
35+
Receive RTR frames. (default)
36+
37+
The CAN controller can and will receive RTR frames.
38+
39+
On some IP cores the controller cannot receive RTR frames in the
40+
more performant "RX mailbox" mode and will use "RX FIFO" mode
41+
instead.
42+
43+
"rx-rtr" off
44+
45+
Waive ability to receive RTR frames. (not supported on all IP cores)
46+
47+
This mode activates the "RX mailbox mode" for better performance, on
48+
some IP cores RTR frames cannot be received anymore.
49+
50+
The setting can only be changed if the interface is down::
51+
52+
ip link set dev can0 down
53+
ethtool --set-priv-flags can0 rx-rtr {off|on}
54+
ip link set dev can0 up
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
3+
Controller Area Network (CAN) Device Drivers
4+
============================================
5+
6+
Device drivers for CAN devices.
7+
8+
Contents:
9+
10+
.. toctree::
11+
:maxdepth: 2
12+
13+
freescale/flexcan
14+
15+
.. only:: subproject and html
16+
17+
Indices
18+
=======
19+
20+
* :ref:`genindex`

Documentation/networking/device_drivers/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Contents:
1111
appletalk/index
1212
atm/index
1313
cable/index
14+
can/index
1415
cellular/index
1516
ethernet/index
1617
fddi/index

drivers/net/can/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ obj-y += softing/
1616
obj-$(CONFIG_CAN_AT91) += at91_can.o
1717
obj-$(CONFIG_CAN_CC770) += cc770/
1818
obj-$(CONFIG_CAN_C_CAN) += c_can/
19-
obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
19+
obj-$(CONFIG_CAN_FLEXCAN) += flexcan/
2020
obj-$(CONFIG_CAN_GRCAN) += grcan.o
2121
obj-$(CONFIG_CAN_IFI_CANFD) += ifi_canfd/
2222
obj-$(CONFIG_CAN_JANZ_ICAN3) += janz-ican3.o

drivers/net/can/flexcan/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-License-Identifier: GPL-2.0
2+
3+
obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
4+
5+
flexcan-objs :=
6+
flexcan-objs += flexcan-core.o
7+
flexcan-objs += flexcan-ethtool.o

0 commit comments

Comments
 (0)