Skip to content

Commit 634ec1f

Browse files
committed
Merge tag 'net-6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
Pull networking fixes from Paolo Abeni: "Including fixes from CAN Current release - regressions: - udp: do not use skb_release_head_state() before skb_attempt_defer_free() - gro_cells: use nested-BH locking for gro_cell - dpll: zl3073x: increase maximum size of flash utility Previous releases - regressions: - core: fix lockdep splat on device unregister - tcp: fix tcp_tso_should_defer() vs large RTT - tls: - don't rely on tx_work during send() - wait for pending async decryptions if tls_strp_msg_hold fails - can: j1939: add missing calls in NETDEV_UNREGISTER notification handler - eth: lan78xx: fix lost EEPROM write timeout in lan78xx_write_raw_eeprom Previous releases - always broken: - ip6_tunnel: prevent perpetual tunnel growth - dpll: zl3073x: handle missing or corrupted flash configuration - can: m_can: fix pm_runtime and CAN state handling - eth: - ixgbe: fix too early devlink_free() in ixgbe_remove() - ixgbevf: fix mailbox API compatibility - gve: Check valid ts bit on RX descriptor before hw timestamping - idpf: cleanup remaining SKBs in PTP flows - r8169: fix packet truncation after S4 resume on RTL8168H/RTL8111H" * tag 'net-6.18-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (50 commits) udp: do not use skb_release_head_state() before skb_attempt_defer_free() net: usb: lan78xx: fix use of improperly initialized dev->chipid in lan78xx_reset netdevsim: set the carrier when the device goes up selftests: tls: add test for short splice due to full skmsg selftests: net: tls: add tests for cmsg vs MSG_MORE tls: don't rely on tx_work during send() tls: wait for pending async decryptions if tls_strp_msg_hold fails tls: always set record_type in tls_process_cmsg tls: wait for async encrypt in case of error during latter iterations of sendmsg tls: trim encrypted message to match the plaintext on short splice tg3: prevent use of uninitialized remote_adv and local_adv variables MAINTAINERS: new entry for IPv6 IOAM gve: Check valid ts bit on RX descriptor before hw timestamping net: core: fix lockdep splat on device unregister MAINTAINERS: add myself as maintainer for b53 selftests: net: check jq command is supported net: airoha: Take into account out-of-order tx completions in airoha_dev_xmit() tcp: fix tcp_tso_should_defer() vs large RTT r8152: add error handling in rtl8152_driver_init usbnet: Fix using smp_processor_id() in preemptible code warnings ...
2 parents ef25485 + 6de1dec commit 634ec1f

File tree

57 files changed

+817
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+817
-182
lines changed

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ Dmitry Safonov <[email protected]> <[email protected]>
227227
228228
229229
Domen Puncer <[email protected]>
230+
230231
Douglas Gilbert <[email protected]>
231232
232233

Documentation/networking/can.rst

Lines changed: 67 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,10 +1398,9 @@ second bit timing has to be specified in order to enable the CAN FD bitrate.
13981398
Additionally CAN FD capable CAN controllers support up to 64 bytes of
13991399
payload. The representation of this length in can_frame.len and
14001400
canfd_frame.len for userspace applications and inside the Linux network
1401-
layer is a plain value from 0 .. 64 instead of the CAN 'data length code'.
1402-
The data length code was a 1:1 mapping to the payload length in the Classical
1403-
CAN frames anyway. The payload length to the bus-relevant DLC mapping is
1404-
only performed inside the CAN drivers, preferably with the helper
1401+
layer is a plain value from 0 .. 64 instead of the Classical CAN length
1402+
which ranges from 0 to 8. The payload length to the bus-relevant DLC mapping
1403+
is only performed inside the CAN drivers, preferably with the helper
14051404
functions can_fd_dlc2len() and can_fd_len2dlc().
14061405

14071406
The CAN netdevice driver capabilities can be distinguished by the network
@@ -1465,6 +1464,70 @@ Example when 'fd-non-iso on' is added on this switchable CAN FD adapter::
14651464
can <FD,FD-NON-ISO> state ERROR-ACTIVE (berr-counter tx 0 rx 0) restart-ms 0
14661465

14671466

1467+
Transmitter Delay Compensation
1468+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1469+
1470+
At high bit rates, the propagation delay from the TX pin to the RX pin of
1471+
the transceiver might become greater than the actual bit time causing
1472+
measurement errors: the RX pin would still be measuring the previous bit.
1473+
1474+
The Transmitter Delay Compensation (thereafter, TDC) resolves this problem
1475+
by introducing a Secondary Sample Point (SSP) equal to the distance, in
1476+
minimum time quantum, from the start of the bit time on the TX pin to the
1477+
actual measurement on the RX pin. The SSP is calculated as the sum of two
1478+
configurable values: the TDC Value (TDCV) and the TDC offset (TDCO).
1479+
1480+
TDC, if supported by the device, can be configured together with CAN-FD
1481+
using the ip tool's "tdc-mode" argument as follow:
1482+
1483+
**omitted**
1484+
When no "tdc-mode" option is provided, the kernel will automatically
1485+
decide whether TDC should be turned on, in which case it will
1486+
calculate a default TDCO and use the TDCV as measured by the
1487+
device. This is the recommended method to use TDC.
1488+
1489+
**"tdc-mode off"**
1490+
TDC is explicitly disabled.
1491+
1492+
**"tdc-mode auto"**
1493+
The user must provide the "tdco" argument. The TDCV will be
1494+
automatically calculated by the device. This option is only
1495+
available if the device supports the TDC-AUTO CAN controller mode.
1496+
1497+
**"tdc-mode manual"**
1498+
The user must provide both the "tdco" and "tdcv" arguments. This
1499+
option is only available if the device supports the TDC-MANUAL CAN
1500+
controller mode.
1501+
1502+
Note that some devices may offer an additional parameter: "tdcf" (TDC Filter
1503+
window). If supported by your device, this can be added as an optional
1504+
argument to either "tdc-mode auto" or "tdc-mode manual".
1505+
1506+
Example configuring a 500 kbit/s arbitration bitrate, a 5 Mbit/s data
1507+
bitrate, a TDCO of 15 minimum time quantum and a TDCV automatically measured
1508+
by the device::
1509+
1510+
$ ip link set can0 up type can bitrate 500000 \
1511+
fd on dbitrate 4000000 \
1512+
tdc-mode auto tdco 15
1513+
$ ip -details link show can0
1514+
5: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 72 qdisc pfifo_fast state UP \
1515+
mode DEFAULT group default qlen 10
1516+
link/can promiscuity 0 allmulti 0 minmtu 72 maxmtu 72
1517+
can <FD,TDC-AUTO> state ERROR-ACTIVE restart-ms 0
1518+
bitrate 500000 sample-point 0.875
1519+
tq 12 prop-seg 69 phase-seg1 70 phase-seg2 20 sjw 10 brp 1
1520+
ES582.1/ES584.1: tseg1 2..256 tseg2 2..128 sjw 1..128 brp 1..512 \
1521+
brp_inc 1
1522+
dbitrate 4000000 dsample-point 0.750
1523+
dtq 12 dprop-seg 7 dphase-seg1 7 dphase-seg2 5 dsjw 2 dbrp 1
1524+
tdco 15 tdcf 0
1525+
ES582.1/ES584.1: dtseg1 2..32 dtseg2 1..16 dsjw 1..8 dbrp 1..32 \
1526+
dbrp_inc 1
1527+
tdco 0..127 tdcf 0..127
1528+
clock 80000000
1529+
1530+
14681531
Supported CAN Hardware
14691532
----------------------
14701533

Documentation/networking/seg6-sysctl.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ seg6_require_hmac - INTEGER
2525

2626
Default is 0.
2727

28+
/proc/sys/net/ipv6/seg6_* variables:
29+
====================================
30+
2831
seg6_flowlabel - INTEGER
2932
Controls the behaviour of computing the flowlabel of outer
3033
IPv6 header in case of SR T.encaps

MAINTAINERS

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4804,6 +4804,7 @@ F: drivers/net/ethernet/broadcom/b44.*
48044804

48054805
BROADCOM B53/SF2 ETHERNET SWITCH DRIVER
48064806
M: Florian Fainelli <[email protected]>
4807+
M: Jonas Gorski <[email protected]>
48074808
48084809
L: [email protected] (subscribers-only)
48094810
S: Supported
@@ -18013,6 +18014,16 @@ X: net/rfkill/
1801318014
X: net/wireless/
1801418015
X: tools/testing/selftests/net/can/
1801518016

18017+
NETWORKING [IOAM]
18018+
M: Justin Iurman <[email protected]>
18019+
S: Maintained
18020+
F: Documentation/networking/ioam6*
18021+
F: include/linux/ioam6*
18022+
F: include/net/ioam6*
18023+
F: include/uapi/linux/ioam6*
18024+
F: net/ipv6/ioam6*
18025+
F: tools/testing/selftests/net/ioam6*
18026+
1801618027
NETWORKING [IPSEC]
1801718028
M: Steffen Klassert <[email protected]>
1801818029
M: Herbert Xu <[email protected]>

drivers/dpll/zl3073x/core.c

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,8 +1038,29 @@ zl3073x_dev_phase_meas_setup(struct zl3073x_dev *zldev)
10381038
int zl3073x_dev_start(struct zl3073x_dev *zldev, bool full)
10391039
{
10401040
struct zl3073x_dpll *zldpll;
1041+
u8 info;
10411042
int rc;
10421043

1044+
rc = zl3073x_read_u8(zldev, ZL_REG_INFO, &info);
1045+
if (rc) {
1046+
dev_err(zldev->dev, "Failed to read device status info\n");
1047+
return rc;
1048+
}
1049+
1050+
if (!FIELD_GET(ZL_INFO_READY, info)) {
1051+
/* The ready bit indicates that the firmware was successfully
1052+
* configured and is ready for normal operation. If it is
1053+
* cleared then the configuration stored in flash is wrong
1054+
* or missing. In this situation the driver will expose
1055+
* only devlink interface to give an opportunity to flash
1056+
* the correct config.
1057+
*/
1058+
dev_info(zldev->dev,
1059+
"FW not fully ready - missing or corrupted config\n");
1060+
1061+
return 0;
1062+
}
1063+
10431064
if (full) {
10441065
/* Fetch device state */
10451066
rc = zl3073x_dev_state_fetch(zldev);

drivers/dpll/zl3073x/fw.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct zl3073x_fw_component_info {
3737
static const struct zl3073x_fw_component_info component_info[] = {
3838
[ZL_FW_COMPONENT_UTIL] = {
3939
.name = "utility",
40-
.max_size = 0x2300,
40+
.max_size = 0x4000,
4141
.load_addr = 0x20000000,
4242
.flash_type = ZL3073X_FLASH_TYPE_NONE,
4343
},

drivers/dpll/zl3073x/regs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@
6767
* Register Page 0, General
6868
**************************/
6969

70+
#define ZL_REG_INFO ZL_REG(0, 0x00, 1)
71+
#define ZL_INFO_READY BIT(7)
72+
7073
#define ZL_REG_ID ZL_REG(0, 0x01, 2)
7174
#define ZL_REG_REVISION ZL_REG(0, 0x03, 2)
7275
#define ZL_REG_FW_VER ZL_REG(0, 0x05, 2)

drivers/net/can/m_can/m_can.c

Lines changed: 38 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
// CAN bus driver for Bosch M_CAN controller
33
// Copyright (C) 2014 Freescale Semiconductor, Inc.
4-
// Dong Aisheng <b29396@freescale.com>
4+
// Dong Aisheng <aisheng.dong@nxp.com>
55
// Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.ti.com/
66

77
/* Bosch M_CAN user manual can be obtained from:
@@ -812,6 +812,9 @@ static int m_can_handle_state_change(struct net_device *dev,
812812
u32 timestamp = 0;
813813

814814
switch (new_state) {
815+
case CAN_STATE_ERROR_ACTIVE:
816+
cdev->can.state = CAN_STATE_ERROR_ACTIVE;
817+
break;
815818
case CAN_STATE_ERROR_WARNING:
816819
/* error warning state */
817820
cdev->can.can_stats.error_warning++;
@@ -841,6 +844,12 @@ static int m_can_handle_state_change(struct net_device *dev,
841844
__m_can_get_berr_counter(dev, &bec);
842845

843846
switch (new_state) {
847+
case CAN_STATE_ERROR_ACTIVE:
848+
cf->can_id |= CAN_ERR_CRTL | CAN_ERR_CNT;
849+
cf->data[1] = CAN_ERR_CRTL_ACTIVE;
850+
cf->data[6] = bec.txerr;
851+
cf->data[7] = bec.rxerr;
852+
break;
844853
case CAN_STATE_ERROR_WARNING:
845854
/* error warning state */
846855
cf->can_id |= CAN_ERR_CRTL | CAN_ERR_CNT;
@@ -877,30 +886,33 @@ static int m_can_handle_state_change(struct net_device *dev,
877886
return 1;
878887
}
879888

880-
static int m_can_handle_state_errors(struct net_device *dev, u32 psr)
889+
static enum can_state
890+
m_can_state_get_by_psr(struct m_can_classdev *cdev)
881891
{
882-
struct m_can_classdev *cdev = netdev_priv(dev);
883-
int work_done = 0;
892+
u32 reg_psr;
884893

885-
if (psr & PSR_EW && cdev->can.state != CAN_STATE_ERROR_WARNING) {
886-
netdev_dbg(dev, "entered error warning state\n");
887-
work_done += m_can_handle_state_change(dev,
888-
CAN_STATE_ERROR_WARNING);
889-
}
894+
reg_psr = m_can_read(cdev, M_CAN_PSR);
890895

891-
if (psr & PSR_EP && cdev->can.state != CAN_STATE_ERROR_PASSIVE) {
892-
netdev_dbg(dev, "entered error passive state\n");
893-
work_done += m_can_handle_state_change(dev,
894-
CAN_STATE_ERROR_PASSIVE);
895-
}
896+
if (reg_psr & PSR_BO)
897+
return CAN_STATE_BUS_OFF;
898+
if (reg_psr & PSR_EP)
899+
return CAN_STATE_ERROR_PASSIVE;
900+
if (reg_psr & PSR_EW)
901+
return CAN_STATE_ERROR_WARNING;
896902

897-
if (psr & PSR_BO && cdev->can.state != CAN_STATE_BUS_OFF) {
898-
netdev_dbg(dev, "entered error bus off state\n");
899-
work_done += m_can_handle_state_change(dev,
900-
CAN_STATE_BUS_OFF);
901-
}
903+
return CAN_STATE_ERROR_ACTIVE;
904+
}
902905

903-
return work_done;
906+
static int m_can_handle_state_errors(struct net_device *dev)
907+
{
908+
struct m_can_classdev *cdev = netdev_priv(dev);
909+
enum can_state new_state;
910+
911+
new_state = m_can_state_get_by_psr(cdev);
912+
if (new_state == cdev->can.state)
913+
return 0;
914+
915+
return m_can_handle_state_change(dev, new_state);
904916
}
905917

906918
static void m_can_handle_other_err(struct net_device *dev, u32 irqstatus)
@@ -1031,8 +1043,7 @@ static int m_can_rx_handler(struct net_device *dev, int quota, u32 irqstatus)
10311043
}
10321044

10331045
if (irqstatus & IR_ERR_STATE)
1034-
work_done += m_can_handle_state_errors(dev,
1035-
m_can_read(cdev, M_CAN_PSR));
1046+
work_done += m_can_handle_state_errors(dev);
10361047

10371048
if (irqstatus & IR_ERR_BUS_30X)
10381049
work_done += m_can_handle_bus_errors(dev, irqstatus,
@@ -1606,7 +1617,7 @@ static int m_can_start(struct net_device *dev)
16061617
netdev_queue_set_dql_min_limit(netdev_get_tx_queue(cdev->net, 0),
16071618
cdev->tx_max_coalesced_frames);
16081619

1609-
cdev->can.state = CAN_STATE_ERROR_ACTIVE;
1620+
cdev->can.state = m_can_state_get_by_psr(cdev);
16101621

16111622
m_can_enable_all_interrupts(cdev);
16121623

@@ -2492,12 +2503,11 @@ int m_can_class_suspend(struct device *dev)
24922503
}
24932504

24942505
m_can_clk_stop(cdev);
2506+
cdev->can.state = CAN_STATE_SLEEPING;
24952507
}
24962508

24972509
pinctrl_pm_select_sleep_state(dev);
24982510

2499-
cdev->can.state = CAN_STATE_SLEEPING;
2500-
25012511
return ret;
25022512
}
25032513
EXPORT_SYMBOL_GPL(m_can_class_suspend);
@@ -2510,8 +2520,6 @@ int m_can_class_resume(struct device *dev)
25102520

25112521
pinctrl_pm_select_default_state(dev);
25122522

2513-
cdev->can.state = CAN_STATE_ERROR_ACTIVE;
2514-
25152523
if (netif_running(ndev)) {
25162524
ret = m_can_clk_start(cdev);
25172525
if (ret)
@@ -2529,6 +2537,8 @@ int m_can_class_resume(struct device *dev)
25292537
if (cdev->ops->init)
25302538
ret = cdev->ops->init(cdev);
25312539

2540+
cdev->can.state = m_can_state_get_by_psr(cdev);
2541+
25322542
m_can_write(cdev, M_CAN_IE, cdev->active_interrupts);
25332543
} else {
25342544
ret = m_can_start(ndev);
@@ -2546,7 +2556,7 @@ int m_can_class_resume(struct device *dev)
25462556
}
25472557
EXPORT_SYMBOL_GPL(m_can_class_resume);
25482558

2549-
MODULE_AUTHOR("Dong Aisheng <b29396@freescale.com>");
2559+
MODULE_AUTHOR("Dong Aisheng <aisheng.dong@nxp.com>");
25502560
MODULE_AUTHOR("Dan Murphy <[email protected]>");
25512561
MODULE_LICENSE("GPL v2");
25522562
MODULE_DESCRIPTION("CAN bus driver for Bosch M_CAN controller");

drivers/net/can/m_can/m_can_platform.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0
22
// IOMapped CAN bus driver for Bosch M_CAN controller
33
// Copyright (C) 2014 Freescale Semiconductor, Inc.
4-
// Dong Aisheng <b29396@freescale.com>
4+
// Dong Aisheng <aisheng.dong@nxp.com>
55
//
66
// Copyright (C) 2018-19 Texas Instruments Incorporated - http://www.ti.com/
77

@@ -180,7 +180,7 @@ static void m_can_plat_remove(struct platform_device *pdev)
180180
struct m_can_classdev *mcan_class = &priv->cdev;
181181

182182
m_can_class_unregister(mcan_class);
183-
183+
pm_runtime_disable(mcan_class->dev);
184184
m_can_class_free_dev(mcan_class->net);
185185
}
186186

@@ -236,7 +236,7 @@ static struct platform_driver m_can_plat_driver = {
236236

237237
module_platform_driver(m_can_plat_driver);
238238

239-
MODULE_AUTHOR("Dong Aisheng <b29396@freescale.com>");
239+
MODULE_AUTHOR("Dong Aisheng <aisheng.dong@nxp.com>");
240240
MODULE_AUTHOR("Dan Murphy <[email protected]>");
241241
MODULE_LICENSE("GPL v2");
242242
MODULE_DESCRIPTION("M_CAN driver for IO Mapped Bosch controllers");

0 commit comments

Comments
 (0)