Commit 49344462 authored by Paolo Abeni's avatar Paolo Abeni
Browse files

Merge tag 'linux-can-next-for-6.9-20240220' of...

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

Marc Kleine-Budde says:

====================
pull-request: can-next 2024-02-20

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

The first patch is by Francesco Dolcini and removes a redundant check
for pm_clock_support from the m_can driver.

Martin Hundebøll contributes 3 patches to the m_can/tcan4x5x driver to
allow resume upon RX of a CAN frame.

3 patches by Srinivas Goud add support for ECC statistics to the
xilinx_can driver.

The last 2 patches are by Oliver Hartkopp and me, target the CAN RAW
protocol and fix an error in the getsockopt() for CAN-XL introduced in
the previous pull request to net-next (linux-can-next-for-6.9-20240213).

linux-can-next-for-6.9-20240220

* tag 'linux-can-next-for-6.9-20240220' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next:
  can: raw: raw_getsockopt(): reduce scope of err
  can: raw: fix getsockopt() for new CAN_RAW_XL_VCID_OPTS
  can: xilinx_can: Add ethtool stats interface for ECC errors
  can: xilinx_can: Add ECC support
  dt-bindings: can: xilinx_can: Add 'xlnx,has-ecc' optional property
  can: tcan4x5x: support resuming from rx interrupt signal
  can: m_can: allow keeping the transceiver running in suspend
  dt-bindings: can: tcan4x5x: Document the wakeup-source flag
  can: m_can: remove redundant check for pm_clock_support
====================

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


Signed-off-by: default avatarPaolo Abeni <pabeni@redhat.com>
parents 219eee9c 00bf80c4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,8 @@ Optional properties:
			      available with tcan4552/4553.
	- device-wake-gpios: Wake up GPIO to wake up the TCAN device. Not
			     available with tcan4552/4553.
	- wakeup-source: Leave the chip running when suspended, and configure
			 the RX interrupt to wake up the device.

Example:
tcan4x5x: tcan4x5x@0 {
@@ -42,4 +44,5 @@ tcan4x5x: tcan4x5x@0 {
		device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
		device-wake-gpios = <&gpio1 15 GPIO_ACTIVE_HIGH>;
		reset-gpios = <&gpio1 27 GPIO_ACTIVE_HIGH>;
		wakeup-source;
};
+5 −0
Original line number Diff line number Diff line
@@ -49,6 +49,10 @@ properties:
  resets:
    maxItems: 1

  xlnx,has-ecc:
    $ref: /schemas/types.yaml#/definitions/flag
    description: CAN TX_OL, TX_TL and RX FIFOs have ECC support(AXI CAN)

required:
  - compatible
  - reg
@@ -137,6 +141,7 @@ examples:
        interrupts = <GIC_SPI 59 IRQ_TYPE_EDGE_RISING>;
        tx-fifo-depth = <0x40>;
        rx-fifo-depth = <0x40>;
        xlnx,has-ecc;
    };

  - |
+20 −10
Original line number Diff line number Diff line
@@ -2312,11 +2312,9 @@ int m_can_class_register(struct m_can_classdev *cdev)
		}
	}

	if (cdev->pm_clock_support) {
	ret = m_can_clk_start(cdev);
	if (ret)
		return ret;
	}

	if (cdev->is_peripheral) {
		ret = can_rx_offload_add_manual(cdev->net, &cdev->offload,
@@ -2384,7 +2382,15 @@ int m_can_class_suspend(struct device *dev)
	if (netif_running(ndev)) {
		netif_stop_queue(ndev);
		netif_device_detach(ndev);

		/* leave the chip running with rx interrupt enabled if it is
		 * used as a wake-up source.
		 */
		if (cdev->pm_wake_source)
			m_can_write(cdev, M_CAN_IE, IR_RF0N);
		else
			m_can_stop(ndev);

		m_can_clk_stop(cdev);
	}

@@ -2411,12 +2417,16 @@ int m_can_class_resume(struct device *dev)
		ret = m_can_clk_start(cdev);
		if (ret)
			return ret;

		if (cdev->pm_wake_source) {
			m_can_write(cdev, M_CAN_IE, cdev->active_interrupts);
		} else {
			ret  = m_can_start(ndev);
			if (ret) {
				m_can_clk_stop(cdev);

				return ret;
			}
		}

		netif_device_attach(ndev);
		netif_start_queue(ndev);
+1 −0
Original line number Diff line number Diff line
@@ -97,6 +97,7 @@ struct m_can_classdev {
	u32 irqstatus;

	int pm_clock_support;
	int pm_wake_source;
	int is_peripheral;

	// Cached M_CAN_IE register content
+1 −0
Original line number Diff line number Diff line
@@ -125,6 +125,7 @@ static int m_can_pci_probe(struct pci_dev *pci, const struct pci_device_id *id)
	mcan_class->dev = &pci->dev;
	mcan_class->net->irq = pci_irq_vector(pci, 0);
	mcan_class->pm_clock_support = 1;
	mcan_class->pm_wake_source = 0;
	mcan_class->can.clock.freq = id->driver_data;
	mcan_class->ops = &m_can_pci_ops;

Loading