netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/2] pull-request: can 2022-07-20
@ 2022-07-20  8:36 Marc Kleine-Budde
  2022-07-20  8:36 ` [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863 Marc Kleine-Budde
  2022-07-20  8:36 ` [PATCH net 2/2] can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() Marc Kleine-Budde
  0 siblings, 2 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2022-07-20  8:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel

Hello Jakub, hello David,

this is a pull request of 2 patches for net/master.

The first patch is by me and fixes the detection of the mcp251863 in
the mcp251xfd driver.

The last patch is by Liang He and adds a missing of_node_put() in the
rcar_canfd driver.

regards,
Marc

---

The following changes since commit 48ea8ea32dbf3231882e9bc0b297fe1400785219:

  Merge branch '40GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/net-queue (2022-07-19 17:43:02 -0700)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.19-20220720

for you to fetch changes up to 7b66dfcc6e1e1f018492619c3d0fc432b6b54272:

  can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() (2022-07-20 10:20:19 +0200)

----------------------------------------------------------------
linux-can-fixes-for-5.19-20220720

----------------------------------------------------------------
Liang He (1):
      can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe()

Marc Kleine-Budde (1):
      can: mcp251xfd: fix detection of mcp251863

 drivers/net/can/rcar/rcar_canfd.c              |  1 +
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 18 +++++++++++++-----
 2 files changed, 14 insertions(+), 5 deletions(-)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863
  2022-07-20  8:36 [PATCH net 0/2] pull-request: can 2022-07-20 Marc Kleine-Budde
@ 2022-07-20  8:36 ` Marc Kleine-Budde
  2022-07-20 10:20   ` patchwork-bot+netdevbpf
  2022-07-20  8:36 ` [PATCH net 2/2] can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() Marc Kleine-Budde
  1 sibling, 1 reply; 4+ messages in thread
From: Marc Kleine-Budde @ 2022-07-20  8:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Marc Kleine-Budde

In commit c6f2a617a0a8 ("can: mcp251xfd: add support for mcp251863")
support for the mcp251863 was added. However it was not taken into
account that the auto detection of the chip model cannot distinguish
between mcp2518fd and mcp251863 and would lead to a warning message if
the firmware specifies a mcp251863.

Fix auto detection: If a mcp2518fd compatible chip is found, keep the
mcp251863 if specified by firmware, use mcp2518fd instead.

Link: https://lore.kernel.org/all/20220706064835.1848864-1-mkl@pengutronix.de
Fixes: c6f2a617a0a8 ("can: mcp251xfd: add support for mcp251863")
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9b47b07162fe..bc6518504fd4 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1690,8 +1690,8 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
 	u32 osc;
 	int err;
 
-	/* The OSC_LPMEN is only supported on MCP2518FD, so use it to
-	 * autodetect the model.
+	/* The OSC_LPMEN is only supported on MCP2518FD and MCP251863,
+	 * so use it to autodetect the model.
 	 */
 	err = regmap_update_bits(priv->map_reg, MCP251XFD_REG_OSC,
 				 MCP251XFD_REG_OSC_LPMEN,
@@ -1703,10 +1703,18 @@ static int mcp251xfd_register_chip_detect(struct mcp251xfd_priv *priv)
 	if (err)
 		return err;
 
-	if (osc & MCP251XFD_REG_OSC_LPMEN)
-		devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
-	else
+	if (osc & MCP251XFD_REG_OSC_LPMEN) {
+		/* We cannot distinguish between MCP2518FD and
+		 * MCP251863. If firmware specifies MCP251863, keep
+		 * it, otherwise set to MCP2518FD.
+		 */
+		if (mcp251xfd_is_251863(priv))
+			devtype_data = &mcp251xfd_devtype_data_mcp251863;
+		else
+			devtype_data = &mcp251xfd_devtype_data_mcp2518fd;
+	} else {
 		devtype_data = &mcp251xfd_devtype_data_mcp2517fd;
+	}
 
 	if (!mcp251xfd_is_251XFD(priv) &&
 	    priv->devtype_data.model != devtype_data->model) {

base-commit: 48ea8ea32dbf3231882e9bc0b297fe1400785219
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH net 2/2] can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe()
  2022-07-20  8:36 [PATCH net 0/2] pull-request: can 2022-07-20 Marc Kleine-Budde
  2022-07-20  8:36 ` [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863 Marc Kleine-Budde
@ 2022-07-20  8:36 ` Marc Kleine-Budde
  1 sibling, 0 replies; 4+ messages in thread
From: Marc Kleine-Budde @ 2022-07-20  8:36 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Liang He, Marc Kleine-Budde

From: Liang He <windhl@126.com>

We should use of_node_put() for the reference returned by
of_get_child_by_name() which has increased the refcount.

Fixes: 45721c406dcf ("can: rcar_canfd: Add support for r8a779a0 SoC")
Link: https://lore.kernel.org/all/20220712095623.364287-1-windhl@126.com
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/rcar/rcar_canfd.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/can/rcar/rcar_canfd.c b/drivers/net/can/rcar/rcar_canfd.c
index ba42cef10a53..cb0321ea853c 100644
--- a/drivers/net/can/rcar/rcar_canfd.c
+++ b/drivers/net/can/rcar/rcar_canfd.c
@@ -1843,6 +1843,7 @@ static int rcar_canfd_probe(struct platform_device *pdev)
 		of_child = of_get_child_by_name(pdev->dev.of_node, name);
 		if (of_child && of_device_is_available(of_child))
 			channels_mask |= BIT(i);
+		of_node_put(of_child);
 	}
 
 	if (chip_id != RENESAS_RZG2L) {
-- 
2.35.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863
  2022-07-20  8:36 ` [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863 Marc Kleine-Budde
@ 2022-07-20 10:20   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-07-20 10:20 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: netdev, davem, kuba, linux-can, kernel

Hello:

This series was applied to netdev/net.git (master)
by Marc Kleine-Budde <mkl@pengutronix.de>:

On Wed, 20 Jul 2022 10:36:20 +0200 you wrote:
> In commit c6f2a617a0a8 ("can: mcp251xfd: add support for mcp251863")
> support for the mcp251863 was added. However it was not taken into
> account that the auto detection of the chip model cannot distinguish
> between mcp2518fd and mcp251863 and would lead to a warning message if
> the firmware specifies a mcp251863.
> 
> Fix auto detection: If a mcp2518fd compatible chip is found, keep the
> mcp251863 if specified by firmware, use mcp2518fd instead.
> 
> [...]

Here is the summary with links:
  - [net,1/2] can: mcp251xfd: fix detection of mcp251863
    https://git.kernel.org/netdev/net/c/db87c005b9cc
  - [net,2/2] can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe()
    https://git.kernel.org/netdev/net/c/7b66dfcc6e1e

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-07-20 10:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  8:36 [PATCH net 0/2] pull-request: can 2022-07-20 Marc Kleine-Budde
2022-07-20  8:36 ` [PATCH net 1/2] can: mcp251xfd: fix detection of mcp251863 Marc Kleine-Budde
2022-07-20 10:20   ` patchwork-bot+netdevbpf
2022-07-20  8:36 ` [PATCH net 2/2] can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe() Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).