Commit fee62ea7 authored by David S. Miller's avatar David S. Miller
Browse files

Merge tag 'linux-can-next-for-5.18-20220224' of...

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



Marc Kleine-Budde says:

====================
this is a pull request of 36 patches for net-next/master.

The first 5 patches are by me and update various CAN DT bindings.

Eric Dumazet's patch for the CAN GW replaces a costly
synchronize_rcu() by a call_rcu().

The next 2 patches by me enhance the CAN bit rate handling, the bit
rate checking is simplified and the arguments and local variables of
functions are marked as const.

A patch by me for the kvaser_usb driver removes a redundant variable.

The next patch by me lets the c_can driver use the default ethtool
drvinfo.

Minghao Chi's patch for the softing driver removes a redundant
variable.

Srinivas Neeli contributes an enhancement for the xilinx_can NAPI poll
function.

Vincent Mailhol's patch for the etas_es58x driver converts to
BITS_PER_TYPE() from of manual calculation.

The next 23 patches target the mcp251xfd driver and are by me. The
first 15 patches, add support for the internal PLL, which includes
simplifying runtime PM handling, better chip detection and error
handling after wakeup, and the PLL handling. The last 8 patches
prepare the driver to support multiple RX-FIFOs and runtime
configurable RX/TX rings. The actual runtime ring configuration via
ethtool will be added in a later patch series.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents e422eef2 aada7422
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -10,6 +10,9 @@ maintainers:
  - Chen-Yu Tsai <wens@csie.org>
  - Maxime Ripard <mripard@kernel.org>

allOf:
  - $ref: can-controller.yaml#

properties:
  compatible:
    oneOf:
+6 −3
Original line number Diff line number Diff line
@@ -9,7 +9,10 @@ title: Bosch MCAN controller Bindings
description: Bosch MCAN controller for CAN bus

maintainers:
  - Sriram Dash <sriram.dash@samsung.com>
  - Chandrasekar Ramakrishnan <rcsekar@samsung.com>

allOf:
  - $ref: can-controller.yaml#

properties:
  compatible:
+3 −0
Original line number Diff line number Diff line
@@ -11,6 +11,9 @@ title:
maintainers:
  - Marc Kleine-Budde <mkl@pengutronix.de>

allOf:
  - $ref: can-controller.yaml#

properties:
  compatible:
    oneOf:
+0 −9
Original line number Diff line number Diff line
@@ -11,14 +11,6 @@

#include "c_can.h"

static void c_can_get_drvinfo(struct net_device *netdev,
			      struct ethtool_drvinfo *info)
{
	struct c_can_priv *priv = netdev_priv(netdev);
	strscpy(info->driver, "c_can", sizeof(info->driver));
	strscpy(info->bus_info, dev_name(priv->device), sizeof(info->bus_info));
}

static void c_can_get_ringparam(struct net_device *netdev,
				struct ethtool_ringparam *ring,
				struct kernel_ethtool_ringparam *kernel_ring,
@@ -33,7 +25,6 @@ static void c_can_get_ringparam(struct net_device *netdev,
}

static const struct ethtool_ops c_can_ethtool_ops = {
	.get_drvinfo = c_can_get_drvinfo,
	.get_ringparam = c_can_get_ringparam,
};

+8 −12
Original line number Diff line number Diff line
@@ -24,7 +24,7 @@
 */
static int
can_update_sample_point(const struct can_bittiming_const *btc,
			unsigned int sample_point_nominal, unsigned int tseg,
			const unsigned int sample_point_nominal, const unsigned int tseg,
			unsigned int *tseg1_ptr, unsigned int *tseg2_ptr,
			unsigned int *sample_point_error_ptr)
{
@@ -63,7 +63,7 @@ can_update_sample_point(const struct can_bittiming_const *btc,
	return best_sample_point;
}

int can_calc_bittiming(struct net_device *dev, struct can_bittiming *bt,
int can_calc_bittiming(const struct net_device *dev, struct can_bittiming *bt,
		       const struct can_bittiming_const *btc)
{
	struct can_priv *priv = netdev_priv(dev);
@@ -208,10 +208,10 @@ void can_calc_tdco(struct can_tdc *tdc, const struct can_tdc_const *tdc_const,
 * prescaler value brp. You can find more information in the header
 * file linux/can/netlink.h.
 */
static int can_fixup_bittiming(struct net_device *dev, struct can_bittiming *bt,
static int can_fixup_bittiming(const struct net_device *dev, struct can_bittiming *bt,
			       const struct can_bittiming_const *btc)
{
	struct can_priv *priv = netdev_priv(dev);
	const struct can_priv *priv = netdev_priv(dev);
	unsigned int tseg1, alltseg;
	u64 brp64;

@@ -244,25 +244,21 @@ static int can_fixup_bittiming(struct net_device *dev, struct can_bittiming *bt,

/* Checks the validity of predefined bitrate settings */
static int
can_validate_bitrate(struct net_device *dev, struct can_bittiming *bt,
can_validate_bitrate(const struct net_device *dev, const struct can_bittiming *bt,
		     const u32 *bitrate_const,
		     const unsigned int bitrate_const_cnt)
{
	struct can_priv *priv = netdev_priv(dev);
	unsigned int i;

	for (i = 0; i < bitrate_const_cnt; i++) {
		if (bt->bitrate == bitrate_const[i])
			break;
			return 0;
	}

	if (i >= priv->bitrate_const_cnt)
	return -EINVAL;

	return 0;
}

int can_get_bittiming(struct net_device *dev, struct can_bittiming *bt,
int can_get_bittiming(const struct net_device *dev, struct can_bittiming *bt,
		      const struct can_bittiming_const *btc,
		      const u32 *bitrate_const,
		      const unsigned int bitrate_const_cnt)
Loading