Skip to content

Commit 36f6b72

Browse files
committed
Merge tag 'linux-can-fixes-for-6.11-20240912' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can
Marc Kleine-Budde says: ==================== pull-request: can 2024-09-12 Kuniyuki Iwashima's patch fixes an incomplete bug fix in the CAN BCM protocol, which was introduced during v6.11. A patch by Stefan Mätje removes the unsupported CAN_CTRLMODE_3_SAMPLES mode for CAN-USB/3-FD devices in the esd_usb driver. The next patch is by Martin Jocic and enables 64-bit DMA addressing for the kvaser_pciefd driver. The last two patches both affect the m_can driver. Jake Hamby's patch activates NAPI before interrupts are activated, a patch by me moves the stopping of the clock after the device has been shut down. * tag 'linux-can-fixes-for-6.11-20240912' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can: can: m_can: m_can_close(): stop clocks after device has been shut down can: m_can: enable NAPI before enabling interrupts can: kvaser_pciefd: Enable 64-bit DMA addressing can: esd_usb: Remove CAN_CTRLMODE_3_SAMPLES for CAN-USB/3-FD can: bcm: Clear bo->bcm_proc_read after remove_proc_entry(). ==================== Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 04ccecf + 717338e commit 36f6b72

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

drivers/net/can/kvaser_pciefd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1104,6 +1104,9 @@ static int kvaser_pciefd_setup_dma(struct kvaser_pciefd *pcie)
11041104

11051105
/* Disable the DMA */
11061106
iowrite32(0, KVASER_PCIEFD_SRB_ADDR(pcie) + KVASER_PCIEFD_SRB_CTRL_REG);
1107+
1108+
dma_set_mask_and_coherent(&pcie->pci->dev, DMA_BIT_MASK(64));
1109+
11071110
for (i = 0; i < KVASER_PCIEFD_DMA_COUNT; i++) {
11081111
pcie->dma_data[i] = dmam_alloc_coherent(&pcie->pci->dev,
11091112
KVASER_PCIEFD_DMA_SIZE,

drivers/net/can/m_can/m_can.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1763,11 +1763,7 @@ static int m_can_close(struct net_device *dev)
17631763

17641764
netif_stop_queue(dev);
17651765

1766-
if (!cdev->is_peripheral)
1767-
napi_disable(&cdev->napi);
1768-
17691766
m_can_stop(dev);
1770-
m_can_clk_stop(cdev);
17711767
free_irq(dev->irq, dev);
17721768

17731769
m_can_clean(dev);
@@ -1776,10 +1772,13 @@ static int m_can_close(struct net_device *dev)
17761772
destroy_workqueue(cdev->tx_wq);
17771773
cdev->tx_wq = NULL;
17781774
can_rx_offload_disable(&cdev->offload);
1775+
} else {
1776+
napi_disable(&cdev->napi);
17791777
}
17801778

17811779
close_candev(dev);
17821780

1781+
m_can_clk_stop(cdev);
17831782
phy_power_off(cdev->transceiver);
17841783

17851784
return 0;
@@ -2030,6 +2029,8 @@ static int m_can_open(struct net_device *dev)
20302029

20312030
if (cdev->is_peripheral)
20322031
can_rx_offload_enable(&cdev->offload);
2032+
else
2033+
napi_enable(&cdev->napi);
20332034

20342035
/* register interrupt handler */
20352036
if (cdev->is_peripheral) {
@@ -2063,9 +2064,6 @@ static int m_can_open(struct net_device *dev)
20632064
if (err)
20642065
goto exit_start_fail;
20652066

2066-
if (!cdev->is_peripheral)
2067-
napi_enable(&cdev->napi);
2068-
20692067
netif_start_queue(dev);
20702068

20712069
return 0;
@@ -2079,6 +2077,8 @@ static int m_can_open(struct net_device *dev)
20792077
out_wq_fail:
20802078
if (cdev->is_peripheral)
20812079
can_rx_offload_disable(&cdev->offload);
2080+
else
2081+
napi_disable(&cdev->napi);
20822082
close_candev(dev);
20832083
exit_disable_clks:
20842084
m_can_clk_stop(cdev);

drivers/net/can/usb/esd_usb.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* CAN driver for esd electronics gmbh CAN-USB/2, CAN-USB/3 and CAN-USB/Micro
44
*
55
* Copyright (C) 2010-2012 esd electronic system design gmbh, Matthias Fuchs <[email protected]>
6-
* Copyright (C) 2022-2023 esd electronics gmbh, Frank Jungclaus <[email protected]>
6+
* Copyright (C) 2022-2024 esd electronics gmbh, Frank Jungclaus <[email protected]>
77
*/
88

99
#include <linux/can.h>
@@ -1116,9 +1116,6 @@ static int esd_usb_3_set_bittiming(struct net_device *netdev)
11161116
if (priv->can.ctrlmode & CAN_CTRLMODE_LISTENONLY)
11171117
flags |= ESD_USB_3_BAUDRATE_FLAG_LOM;
11181118

1119-
if (priv->can.ctrlmode & CAN_CTRLMODE_3_SAMPLES)
1120-
flags |= ESD_USB_3_BAUDRATE_FLAG_TRS;
1121-
11221119
baud_x->nom.brp = cpu_to_le16(nom_bt->brp & (nom_btc->brp_max - 1));
11231120
baud_x->nom.sjw = cpu_to_le16(nom_bt->sjw & (nom_btc->sjw_max - 1));
11241121
baud_x->nom.tseg1 = cpu_to_le16((nom_bt->prop_seg + nom_bt->phase_seg1)
@@ -1219,7 +1216,6 @@ static int esd_usb_probe_one_net(struct usb_interface *intf, int index)
12191216
switch (le16_to_cpu(dev->udev->descriptor.idProduct)) {
12201217
case ESD_USB_CANUSB3_PRODUCT_ID:
12211218
priv->can.clock.freq = ESD_USB_3_CAN_CLOCK;
1222-
priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES;
12231219
priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD;
12241220
priv->can.bittiming_const = &esd_usb_3_nom_bittiming_const;
12251221
priv->can.data_bittiming_const = &esd_usb_3_data_bittiming_const;

net/can/bcm.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,8 +1471,10 @@ static void bcm_notify(struct bcm_sock *bo, unsigned long msg,
14711471
/* remove device reference, if this is our bound device */
14721472
if (bo->bound && bo->ifindex == dev->ifindex) {
14731473
#if IS_ENABLED(CONFIG_PROC_FS)
1474-
if (sock_net(sk)->can.bcmproc_dir && bo->bcm_proc_read)
1474+
if (sock_net(sk)->can.bcmproc_dir && bo->bcm_proc_read) {
14751475
remove_proc_entry(bo->procname, sock_net(sk)->can.bcmproc_dir);
1476+
bo->bcm_proc_read = NULL;
1477+
}
14761478
#endif
14771479
bo->bound = 0;
14781480
bo->ifindex = 0;

0 commit comments

Comments
 (0)