Commit fcf89628 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

Merge tag 'linux-can-next-for-5.19-20220519' of...

Merge tag 'linux-can-next-for-5.19-20220519' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next

Marc Kleine-Budde says:

====================
pull-request: can-next 2022-05-19

Oliver Hartkopp contributes a patch for the ISO-TP CAN protocol to
update the validation of address information during bind.

The next patch is by Jakub Kicinski and converts the CAN network
drivers from netif_napi_add() to the netif_napi_add_weight() function.

Another patch by Oliver Hartkopp removes obsolete CAN specific LED
support.

Vincent Mailhol's patch for the mcp251xfd driver fixes a
-Wunaligned-access warning by clang-14.

* tag 'linux-can-next-for-5.19-20220519' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: mcp251xfd: silence clang's -Wunaligned-access warning
  can: can-dev: remove obsolete CAN LED support
  can: can-dev: move to netif_napi_add_weight()
  can: isotp: isotp_bind(): do not validate unused address information
====================

Link: https://lore.kernel.org/r/20220519202308.1435903-1-mkl@pengutronix.de


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents d353e1a3 1a6dd999
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -4376,7 +4376,6 @@ F: drivers/net/can/
F:	drivers/phy/phy-can-transceiver.c
F:	include/linux/can/bittiming.h
F:	include/linux/can/dev.h
F:	include/linux/can/led.h
F:	include/linux/can/length.h
F:	include/linux/can/platform/
F:	include/linux/can/rx-offload.h
+0 −17
Original line number Diff line number Diff line
@@ -71,23 +71,6 @@ config CAN_CALC_BITTIMING
	  arguments "tq", "prop_seg", "phase_seg1", "phase_seg2" and "sjw".
	  If unsure, say Y.

config CAN_LEDS
	bool "Enable LED triggers for Netlink based drivers"
	depends on LEDS_CLASS
	# The netdev trigger (LEDS_TRIGGER_NETDEV) should be able to do
	# everything that this driver is doing. This is marked as broken
	# because it uses stuff that is intended to be changed or removed.
	# Please consider switching to the netdev trigger and confirm it
	# fulfills your needs instead of fixing this driver.
	depends on BROKEN
	select LEDS_TRIGGERS
	help
	  This option adds two LED triggers for packet receive and transmit
	  events on each supported CAN device.

	  Say Y here if you are working on a system with led-class supported
	  LEDs and you want to use them as canbus activity indicators.

config CAN_AT91
	tristate "Atmel AT91 onchip CAN controller"
	depends on (ARCH_AT91 || COMPILE_TEST) && HAS_IOMEM
+1 −11
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@

#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/led.h>

#define AT91_MB_MASK(i)		((1 << (i)) - 1)

@@ -618,8 +617,6 @@ static void at91_read_msg(struct net_device *dev, unsigned int mb)
		stats->rx_bytes += cf->len;

	netif_receive_skb(skb);

	can_led_event(dev, CAN_LED_EVENT_RX);
}

/**
@@ -854,7 +851,6 @@ static void at91_irq_tx(struct net_device *dev, u32 reg_sr)
						 mb - get_mb_tx_first(priv),
						 NULL);
			dev->stats.tx_packets++;
			can_led_event(dev, CAN_LED_EVENT_TX);
		}
	}

@@ -1101,8 +1097,6 @@ static int at91_open(struct net_device *dev)
		goto out_close;
	}

	can_led_event(dev, CAN_LED_EVENT_OPEN);

	/* start chip and queuing */
	at91_chip_start(dev);
	napi_enable(&priv->napi);
@@ -1133,8 +1127,6 @@ static int at91_close(struct net_device *dev)

	close_candev(dev);

	can_led_event(dev, CAN_LED_EVENT_STOP);

	return 0;
}

@@ -1317,7 +1309,7 @@ static int at91_can_probe(struct platform_device *pdev)
	priv->pdata = dev_get_platdata(&pdev->dev);
	priv->mb0_id = 0x7ff;

	netif_napi_add(dev, &priv->napi, at91_poll, get_mb_rx_num(priv));
	netif_napi_add_weight(dev, &priv->napi, at91_poll, get_mb_rx_num(priv));

	if (at91_is_sam9263(priv))
		dev->sysfs_groups[0] = &at91_sysfs_attr_group;
@@ -1331,8 +1323,6 @@ static int at91_can_probe(struct platform_device *pdev)
		goto exit_free;
	}

	devm_can_led_init(dev);

	dev_info(&pdev->dev, "device registered (reg_base=%p, irq=%d)\n",
		 priv->reg_base, dev->irq);

+3 −16
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/can/led.h>

#include "c_can.h"

@@ -759,7 +758,6 @@ static void c_can_do_tx(struct net_device *dev)

	stats->tx_bytes += bytes;
	stats->tx_packets += pkts;
	can_led_event(dev, CAN_LED_EVENT_TX);

	tail = c_can_get_tx_tail(tx_ring);

@@ -906,9 +904,6 @@ static int c_can_do_rx_poll(struct net_device *dev, int quota)
		quota -= n;
	}

	if (pkts)
		can_led_event(dev, CAN_LED_EVENT_RX);

	return pkts;
}

@@ -1182,8 +1177,6 @@ static int c_can_open(struct net_device *dev)
	if (err)
		goto exit_start_fail;

	can_led_event(dev, CAN_LED_EVENT_OPEN);

	napi_enable(&priv->napi);
	/* enable status change, error and module interrupts */
	c_can_irq_control(priv, true);
@@ -1214,8 +1207,6 @@ static int c_can_close(struct net_device *dev)
	c_can_reset_ram(priv, false);
	c_can_pm_runtime_put_sync(priv);

	can_led_event(dev, CAN_LED_EVENT_STOP);

	return 0;
}

@@ -1246,7 +1237,8 @@ struct net_device *alloc_c_can_dev(int msg_obj_num)
	priv->tx.tail = 0;
	priv->tx.obj_num = msg_obj_tx_num;

	netif_napi_add(dev, &priv->napi, c_can_poll, priv->msg_obj_rx_num);
	netif_napi_add_weight(dev, &priv->napi, c_can_poll,
			      priv->msg_obj_rx_num);

	priv->dev = dev;
	priv->can.bittiming_const = &c_can_bittiming_const;
@@ -1364,8 +1356,6 @@ static const struct net_device_ops c_can_netdev_ops = {

int register_c_can_dev(struct net_device *dev)
{
	int err;

	/* Deactivate pins to prevent DRA7 DCAN IP from being
	 * stuck in transition when module is disabled.
	 * Pins are activated in c_can_start() and deactivated
@@ -1377,10 +1367,7 @@ int register_c_can_dev(struct net_device *dev)
	dev->netdev_ops = &c_can_netdev_ops;
	c_can_set_ethtool_ops(dev);

	err = register_candev(dev);
	if (!err)
		devm_can_led_init(dev);
	return err;
	return register_candev(dev);
}
EXPORT_SYMBOL_GPL(register_c_can_dev);

+0 −10
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@
#include <linux/string.h>
#include <linux/types.h>
#include <linux/can/error.h>
#include <linux/can/led.h>
#include <linux/pm_runtime.h>

#include "ctucanfd.h"
@@ -957,9 +956,6 @@ static int ctucan_rx_poll(struct napi_struct *napi, int quota)
		ctucan_write32(priv, CTUCANFD_COMMAND, REG_COMMAND_CDO);
	}

	if (work_done)
		can_led_event(ndev, CAN_LED_EVENT_RX);

	if (!framecnt && res != 0) {
		if (napi_complete_done(napi, work_done)) {
			/* Clear and enable RBNEI. It is level-triggered, so
@@ -1079,8 +1075,6 @@ static void ctucan_tx_interrupt(struct net_device *ndev)
		}
	} while (some_buffers_processed);

	can_led_event(ndev, CAN_LED_EVENT_TX);

	spin_lock_irqsave(&priv->tx_lock, flags);

	/* Check if at least one TX buffer is free */
@@ -1236,7 +1230,6 @@ static int ctucan_open(struct net_device *ndev)
	}

	netdev_info(ndev, "ctu_can_fd device registered\n");
	can_led_event(ndev, CAN_LED_EVENT_OPEN);
	napi_enable(&priv->napi);
	netif_start_queue(ndev);

@@ -1269,7 +1262,6 @@ static int ctucan_close(struct net_device *ndev)
	free_irq(ndev->irq, ndev);
	close_candev(ndev);

	can_led_event(ndev, CAN_LED_EVENT_STOP);
	pm_runtime_put(priv->dev);

	return 0;
@@ -1434,8 +1426,6 @@ int ctucan_probe_common(struct device *dev, void __iomem *addr, int irq, unsigne
		goto err_deviceoff;
	}

	devm_can_led_init(ndev);

	pm_runtime_put(dev);

	netdev_dbg(ndev, "mem_base=0x%p irq=%d clock=%d, no. of txt buffers:%d\n",
Loading