Skip to content

Commit 8ad228b

Browse files
committed
Merge tag 'linux-can-next-for-6.6-20230728' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next
linux-can-next-for-6.6-20230728 Marc Kleine-Budde says: ==================== Hello netdev-team, this is a pull request of 21 patches for net-next/master. The 1st patch is by Gerhard Uttenthaler, which adds Gerhard as the maintainer ems_pci driver. Peter Seiderer's patch removes a unused function from the peak_usb driver. The next 4 patches are by John Watts and add support for the sun4i_can driver on the Allwinner D1. Rob Herring's patch corrects the DT includes in various CAN drivers. Followed by 14 patches from me concerning the gs_usb driver. The first 11 are various cleanups consisting of coding style improvements, error path printout cleanups, and removal of unneeded usb_kill_anchored_urbs(). The last 3 convert the driver to use NAPI to avoid out-of-order reception of CAN frames. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 91fcb99 + 52be626 commit 8ad228b

File tree

20 files changed

+225
-124
lines changed

20 files changed

+225
-124
lines changed

Documentation/devicetree/bindings/net/can/allwinner,sun4i-a10-can.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ properties:
2121
- const: allwinner,sun4i-a10-can
2222
- const: allwinner,sun4i-a10-can
2323
- const: allwinner,sun8i-r40-can
24+
- const: allwinner,sun20i-d1-can
2425

2526
reg:
2627
maxItems: 1
@@ -37,8 +38,9 @@ properties:
3738
if:
3839
properties:
3940
compatible:
40-
contains:
41-
const: allwinner,sun8i-r40-can
41+
enum:
42+
- allwinner,sun8i-r40-can
43+
- allwinner,sun20i-d1-can
4244

4345
then:
4446
required:

MAINTAINERS

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7606,6 +7606,13 @@ L: linux-mmc@vger.kernel.org
76067606
S: Supported
76077607
F: drivers/mmc/host/cqhci*
76087608

7609+
EMS CPC-PCI CAN DRIVER
7610+
M: Gerhard Uttenthaler <uttenthaler@ems-wuensche.com>
7611+
M: support@ems-wuensche.com
7612+
L: linux-can@vger.kernel.org
7613+
S: Maintained
7614+
F: drivers/net/can/sja1000/ems_pci.c
7615+
76097616
EMULEX 10Gbps iSCSI - OneConnect DRIVER
76107617
M: Ketan Mukadam <ketan.mukadam@broadcom.com>
76117618
L: linux-scsi@vger.kernel.org

arch/riscv/boot/dts/allwinner/sunxi-d1s-t113.dtsi

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,18 @@
131131
pins = "PB6", "PB7";
132132
function = "uart3";
133133
};
134+
135+
/omit-if-no-ref/
136+
can0_pins: can0-pins {
137+
pins = "PB2", "PB3";
138+
function = "can0";
139+
};
140+
141+
/omit-if-no-ref/
142+
can1_pins: can1-pins {
143+
pins = "PB4", "PB5";
144+
function = "can1";
145+
};
134146
};
135147

136148
ccu: clock-controller@2001000 {
@@ -879,5 +891,23 @@
879891
clock-names = "bus", "hosc", "ahb";
880892
#clock-cells = <1>;
881893
};
894+
895+
can0: can@2504000 {
896+
compatible = "allwinner,sun20i-d1-can";
897+
reg = <0x02504000 0x400>;
898+
interrupts = <SOC_PERIPHERAL_IRQ(21) IRQ_TYPE_LEVEL_HIGH>;
899+
clocks = <&ccu CLK_BUS_CAN0>;
900+
resets = <&ccu RST_BUS_CAN0>;
901+
status = "disabled";
902+
};
903+
904+
can1: can@2504400 {
905+
compatible = "allwinner,sun20i-d1-can";
906+
reg = <0x02504400 0x400>;
907+
interrupts = <SOC_PERIPHERAL_IRQ(22) IRQ_TYPE_LEVEL_HIGH>;
908+
clocks = <&ccu CLK_BUS_CAN1>;
909+
resets = <&ccu RST_BUS_CAN1>;
910+
status = "disabled";
911+
};
882912
};
883913
};

drivers/net/can/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ config CAN_SLCAN
190190

191191
config CAN_SUN4I
192192
tristate "Allwinner A10 CAN controller"
193-
depends on MACH_SUN4I || MACH_SUN7I || COMPILE_TEST
193+
depends on MACH_SUN4I || MACH_SUN7I || RISCV || COMPILE_TEST
194194
help
195195
Say Y here if you want to use CAN controller found on Allwinner
196-
A10/A20 SoCs.
196+
A10/A20/D1 SoCs.
197197

198198
To compile this driver as a module, choose M here: the module will
199199
be called sun4i_can.

drivers/net/can/bxcan.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/mfd/syscon.h>
2424
#include <linux/module.h>
2525
#include <linux/of.h>
26-
#include <linux/of_device.h>
2726
#include <linux/platform_device.h>
2827
#include <linux/regmap.h>
2928

drivers/net/can/dev/rx-offload.c

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/* Copyright (c) 2014 Protonic Holland,
33
* David Jander
4-
* Copyright (C) 2014-2021 Pengutronix,
4+
* Copyright (C) 2014-2021, 2023 Pengutronix,
55
* Marc Kleine-Budde <kernel@pengutronix.de>
66
*/
77

@@ -240,9 +240,10 @@ int can_rx_offload_queue_timestamp(struct can_rx_offload *offload,
240240
}
241241
EXPORT_SYMBOL_GPL(can_rx_offload_queue_timestamp);
242242

243-
unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
244-
unsigned int idx, u32 timestamp,
245-
unsigned int *frame_len_ptr)
243+
unsigned int
244+
can_rx_offload_get_echo_skb_queue_timestamp(struct can_rx_offload *offload,
245+
unsigned int idx, u32 timestamp,
246+
unsigned int *frame_len_ptr)
246247
{
247248
struct net_device *dev = offload->dev;
248249
struct net_device_stats *stats = &dev->stats;
@@ -262,7 +263,7 @@ unsigned int can_rx_offload_get_echo_skb(struct can_rx_offload *offload,
262263

263264
return len;
264265
}
265-
EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb);
266+
EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb_queue_timestamp);
266267

267268
int can_rx_offload_queue_tail(struct can_rx_offload *offload,
268269
struct sk_buff *skb)
@@ -279,6 +280,31 @@ int can_rx_offload_queue_tail(struct can_rx_offload *offload,
279280
}
280281
EXPORT_SYMBOL_GPL(can_rx_offload_queue_tail);
281282

283+
unsigned int
284+
can_rx_offload_get_echo_skb_queue_tail(struct can_rx_offload *offload,
285+
unsigned int idx,
286+
unsigned int *frame_len_ptr)
287+
{
288+
struct net_device *dev = offload->dev;
289+
struct net_device_stats *stats = &dev->stats;
290+
struct sk_buff *skb;
291+
unsigned int len;
292+
int err;
293+
294+
skb = __can_get_echo_skb(dev, idx, &len, frame_len_ptr);
295+
if (!skb)
296+
return 0;
297+
298+
err = can_rx_offload_queue_tail(offload, skb);
299+
if (err) {
300+
stats->rx_errors++;
301+
stats->tx_fifo_errors++;
302+
}
303+
304+
return len;
305+
}
306+
EXPORT_SYMBOL_GPL(can_rx_offload_get_echo_skb_queue_tail);
307+
282308
void can_rx_offload_irq_finish(struct can_rx_offload *offload)
283309
{
284310
unsigned long flags;

drivers/net/can/flexcan/flexcan-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1097,8 +1097,8 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
10971097

10981098
handled = IRQ_HANDLED;
10991099
stats->tx_bytes +=
1100-
can_rx_offload_get_echo_skb(&priv->offload, 0,
1101-
reg_ctrl << 16, NULL);
1100+
can_rx_offload_get_echo_skb_queue_timestamp(&priv->offload, 0,
1101+
reg_ctrl << 16, NULL);
11021102
stats->tx_packets++;
11031103

11041104
/* after sending a RTR frame MB is in RX mode */

drivers/net/can/ifi_canfd/ifi_canfd.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/module.h>
2121
#include <linux/netdevice.h>
2222
#include <linux/of.h>
23-
#include <linux/of_device.h>
2423
#include <linux/platform_device.h>
2524

2625
#include <linux/can/dev.h>

drivers/net/can/m_can/m_can.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/module.h>
2020
#include <linux/netdevice.h>
2121
#include <linux/of.h>
22-
#include <linux/of_device.h>
2322
#include <linux/phy/phy.h>
2423
#include <linux/pinctrl/consumer.h>
2524
#include <linux/platform_device.h>
@@ -1017,10 +1016,10 @@ static void m_can_tx_update_stats(struct m_can_classdev *cdev,
10171016

10181017
if (cdev->is_peripheral)
10191018
stats->tx_bytes +=
1020-
can_rx_offload_get_echo_skb(&cdev->offload,
1021-
msg_mark,
1022-
timestamp,
1023-
NULL);
1019+
can_rx_offload_get_echo_skb_queue_timestamp(&cdev->offload,
1020+
msg_mark,
1021+
timestamp,
1022+
NULL);
10241023
else
10251024
stats->tx_bytes += can_get_echo_skb(dev, msg_mark, NULL);
10261025

drivers/net/can/m_can/m_can.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <linux/module.h>
2424
#include <linux/netdevice.h>
2525
#include <linux/of.h>
26-
#include <linux/of_device.h>
2726
#include <linux/phy/phy.h>
2827
#include <linux/pinctrl/consumer.h>
2928
#include <linux/pm_runtime.h>

0 commit comments

Comments
 (0)