Commit c8c748fb authored by Jakub Kicinski's avatar Jakub Kicinski

Merge tag 'linux-can-fixes-for-5.11-20210107' of...

Merge tag 'linux-can-fixes-for-5.11-20210107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can

Marc Kleine-Budde says:

====================
pull-request: can 2021-01-07

The first patch is by me for the m_can driver and removes an erroneous
m_can_clk_stop() from the driver's unregister function.

The second patch targets the tcan4x5x driver, is by me, and fixes the bit
timing constant parameters.

The next two patches are by me, target the mcp251xfd driver, and fix a race
condition in the optimized TEF path (which was added in net-next for v5.11).
The similar code in the RX path is changed to look the same, although it
doesn't suffer from the race condition.

A patch by Lad Prabhakar updates the description and help text for the rcar CAN
driver to reflect all supported SoCs.

In the last patch Sriram Dash transfers the maintainership of the m_can driver
to Pankaj Sharma.

* tag 'linux-can-fixes-for-5.11-20210107' of git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can:
  MAINTAINERS: Update MCAN MMIO device driver maintainer
  can: rcar: Kconfig: update help description for CAN_RCAR config
  can: mcp251xfd: mcp251xfd_handle_rxif_ring(): first increment RX tail pointer in HW, then in driver
  can: mcp251xfd: mcp251xfd_handle_tefif(): fix TEF vs. TX race condition
  can: tcan4x5x: fix bittiming const, use common bittiming from m_can driver
  can: m_can: m_can_class_unregister(): remove erroneous m_can_clk_stop()
====================

Link: https://lore.kernel.org/r/20210107103451.183477-1-mkl@pengutronix.deSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 1f685e6a 6ee49118
...@@ -10847,7 +10847,7 @@ F: drivers/media/radio/radio-maxiradio* ...@@ -10847,7 +10847,7 @@ F: drivers/media/radio/radio-maxiradio*
MCAN MMIO DEVICE DRIVER MCAN MMIO DEVICE DRIVER
M: Dan Murphy <dmurphy@ti.com> M: Dan Murphy <dmurphy@ti.com>
M: Sriram Dash <sriram.dash@samsung.com> M: Pankaj Sharma <pankj.sharma@samsung.com>
L: linux-can@vger.kernel.org L: linux-can@vger.kernel.org
S: Maintained S: Maintained
F: Documentation/devicetree/bindings/net/can/bosch,m_can.yaml F: Documentation/devicetree/bindings/net/can/bosch,m_can.yaml
......
...@@ -1852,8 +1852,6 @@ EXPORT_SYMBOL_GPL(m_can_class_register); ...@@ -1852,8 +1852,6 @@ EXPORT_SYMBOL_GPL(m_can_class_register);
void m_can_class_unregister(struct m_can_classdev *cdev) void m_can_class_unregister(struct m_can_classdev *cdev)
{ {
unregister_candev(cdev->net); unregister_candev(cdev->net);
m_can_clk_stop(cdev);
} }
EXPORT_SYMBOL_GPL(m_can_class_unregister); EXPORT_SYMBOL_GPL(m_can_class_unregister);
......
...@@ -131,30 +131,6 @@ static inline struct tcan4x5x_priv *cdev_to_priv(struct m_can_classdev *cdev) ...@@ -131,30 +131,6 @@ static inline struct tcan4x5x_priv *cdev_to_priv(struct m_can_classdev *cdev)
} }
static struct can_bittiming_const tcan4x5x_bittiming_const = {
.name = DEVICE_NAME,
.tseg1_min = 2,
.tseg1_max = 31,
.tseg2_min = 2,
.tseg2_max = 16,
.sjw_max = 16,
.brp_min = 1,
.brp_max = 32,
.brp_inc = 1,
};
static struct can_bittiming_const tcan4x5x_data_bittiming_const = {
.name = DEVICE_NAME,
.tseg1_min = 1,
.tseg1_max = 32,
.tseg2_min = 1,
.tseg2_max = 16,
.sjw_max = 16,
.brp_min = 1,
.brp_max = 32,
.brp_inc = 1,
};
static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv) static void tcan4x5x_check_wake(struct tcan4x5x_priv *priv)
{ {
int wake_state = 0; int wake_state = 0;
...@@ -469,8 +445,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi) ...@@ -469,8 +445,6 @@ static int tcan4x5x_can_probe(struct spi_device *spi)
mcan_class->dev = &spi->dev; mcan_class->dev = &spi->dev;
mcan_class->ops = &tcan4x5x_ops; mcan_class->ops = &tcan4x5x_ops;
mcan_class->is_peripheral = true; mcan_class->is_peripheral = true;
mcan_class->bit_timing = &tcan4x5x_bittiming_const;
mcan_class->data_timing = &tcan4x5x_data_bittiming_const;
mcan_class->net->irq = spi->irq; mcan_class->net->irq = spi->irq;
spi_set_drvdata(spi, priv); spi_set_drvdata(spi, priv);
......
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
config CAN_RCAR config CAN_RCAR
tristate "Renesas R-Car CAN controller" tristate "Renesas R-Car and RZ/G CAN controller"
depends on ARCH_RENESAS || ARM depends on ARCH_RENESAS || ARM
help help
Say Y here if you want to use CAN controller found on Renesas R-Car Say Y here if you want to use CAN controller found on Renesas R-Car
SoCs. or RZ/G SoCs.
To compile this driver as a module, choose M here: the module will To compile this driver as a module, choose M here: the module will
be called rcar_can. be called rcar_can.
......
...@@ -1368,13 +1368,10 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) ...@@ -1368,13 +1368,10 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv)
struct mcp251xfd_tx_ring *tx_ring = priv->tx; struct mcp251xfd_tx_ring *tx_ring = priv->tx;
struct spi_transfer *last_xfer; struct spi_transfer *last_xfer;
tx_ring->tail += len;
/* Increment the TEF FIFO tail pointer 'len' times in /* Increment the TEF FIFO tail pointer 'len' times in
* a single SPI message. * a single SPI message.
*/ *
* Note:
/* Note:
* *
* "cs_change == 1" on the last transfer results in an * "cs_change == 1" on the last transfer results in an
* active chip select after the complete SPI * active chip select after the complete SPI
...@@ -1391,6 +1388,8 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) ...@@ -1391,6 +1388,8 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv)
if (err) if (err)
return err; return err;
tx_ring->tail += len;
err = mcp251xfd_check_tef_tail(priv); err = mcp251xfd_check_tef_tail(priv);
if (err) if (err)
return err; return err;
...@@ -1553,10 +1552,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv, ...@@ -1553,10 +1552,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv,
/* Increment the RX FIFO tail pointer 'len' times in a /* Increment the RX FIFO tail pointer 'len' times in a
* single SPI message. * single SPI message.
*/ *
ring->tail += len; * Note:
/* Note:
* *
* "cs_change == 1" on the last transfer results in an * "cs_change == 1" on the last transfer results in an
* active chip select after the complete SPI * active chip select after the complete SPI
...@@ -1572,6 +1569,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv, ...@@ -1572,6 +1569,8 @@ mcp251xfd_handle_rxif_ring(struct mcp251xfd_priv *priv,
last_xfer->cs_change = 1; last_xfer->cs_change = 1;
if (err) if (err)
return err; return err;
ring->tail += len;
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment