All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Marc Kleine-Budde" <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org,
	"Oliver Hartkopp" <socketcan@hartkopp.net>,
	"Vincent Mailhol" <mailhol@kernel.org>,
	"Oleksij Rempel" <o.rempel@pengutronix.de>
Subject: Re: [PATCH net-next 08/13] can: at91_can: don't discard the IRQ lookup error in probe
Date: Fri, 20 Nov 2026 22:11:51 +0000	[thread overview]
Message-ID: <sashiko-outbox-226231@kernel.org> (raw)
In-Reply-To: <20261119220936.155728-9-mkl@pengutronix.de>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] can: at91_can: missing priv->transceiver assignment in
  at91_can_probe() [1]
--

commit fb6d34ef2c907ec33aacc966536e1987c18e5222
Author: Chaosheng Qu <chaosheng.qu.linux@gmail.com>

can: at91_can: don't discard the IRQ lookup error in probe

This commit splits the memory resource and interrupt lookups in
at91_can_probe() and propagates the error returned by platform_get_irq().

Link: https://patch.msgid.link/303815792800553c34842147941cab083823c212.1792118040.git.chaosheng.qu.linux@gmail.com

> diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c
> index 58da323f14d7c..3977de7616361 100644
> --- a/drivers/net/can/at91_can.c
> +++ b/drivers/net/can/at91_can.c
> @@ -1069,12 +1069,17 @@ static int at91_can_probe(struct platform_device *pdev)
>  	}
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	irq = platform_get_irq(pdev, 0);
> -	if (!res || irq <= 0) {
> +	if (!res) {
>  		err = -ENODEV;
>  		goto exit_put;
>  	}
>  
> +	irq = platform_get_irq(pdev, 0);
> +	if (irq < 0) {
> +		err = irq;
> +		goto exit_put;
> +	}
> +
>  	if (!request_mem_region(res->start,
>  				resource_size(res),
>  				pdev->name)) {

[Severity: High]
This problem wasn't introduced by this patch, but should at91_can_probe()
also assign transceiver to priv->transceiver [1]?

Later in at91_can_probe(), devm_phy_optional_get() stores the PHY in the
local transceiver variable and uses it to populate priv->can.bitrate_max,
but priv->transceiver is left NULL:

drivers/net/can/at91_can.c:at91_can_probe() {
    ...
	transceiver = devm_phy_optional_get(&pdev->dev, NULL);
    ...
	if (transceiver)
		priv->can.bitrate_max = transceiver->attrs.max_link_rate;
    ...
}

Because priv->transceiver is never set, phy_power_on() in at91_open() and
phy_power_off() in at91_close() are no-ops, leaving the CAN transceiver
unpowered when the interface is brought up on boards that manage it via
the PHY framework.

[1] https://sashiko.dev/#/bug/linux-940d736c-5531-4ec5-97e9-70c51890e25e

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261119220936.155728-1-mkl@pengutronix.de?part=8

  reply	other threads:[~2026-11-20 22:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 21:58 [PATCH net-next 0/13] pull-request: can-next 2026-11-19 Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 01/13] MAINTAINERS: add entry for PEAK-System CAN drivers Marc Kleine-Budde
2026-11-19 22:18   ` netdev-bot+sinfo
2026-11-19 22:24     ` Marc Kleine-Budde
2026-11-20  2:50   ` patchwork-bot+netdevbpf
2026-11-19 21:58 ` [PATCH net-next 02/13] can: raw: remove redundant NULL check before netdev_hold() Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 03/13] can: dev: remove unused safe_candev_priv() Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 04/13] can: convert to DEFINE_SIMPLE_DEV_PM_OPS() Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 05/13] can: sun4i_can: sun4ican_probe(): fix clk leak on unbound Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 06/13] can: cc770: don't discard the IRQ lookup error in probe Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 07/13] can: sun4i_can: " Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 08/13] can: at91_can: " Marc Kleine-Budde
2026-11-20 22:11   ` sashiko-bot [this message]
2026-11-19 21:58 ` [PATCH net-next 09/13] can: janz-ican3: " Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 10/13] can: ifi_canfd: " Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 11/13] can: remove Softing CANcard driver Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 12/13] can: ucan: fix repeated word 'is' in comment Marc Kleine-Budde
2026-11-19 21:58 ` [PATCH net-next 13/13] can: xilinx_can: set CAN FD flags on received frames Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-226231@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-can@vger.kernel.org \
    --cc=mailhol@kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=o.rempel@pengutronix.de \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=socketcan@hartkopp.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.