lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMuHMdW26JDM+BDq8+vyJG2c316ZoF9ODmCfF4KfwJFJe6B7sA@mail.gmail.com>
Date: Wed, 19 Feb 2025 17:34:06 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: "Rob Herring (Arm)" <robh@...nel.org>
Cc: Marc Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol <mailhol.vincent@...adoo.fr>, 
	Vinod Koul <vkoul@...nel.org>, Kishon Vijay Abraham I <kishon@...nel.org>, linux-can@...r.kernel.org, 
	linux-phy@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	Linux-Renesas <linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCH] phy: can-transceiver: Drop unnecessary "mux-states"
 property presence check

Hi Rob,

On Mon, 3 Feb 2025 at 19:55, Rob Herring (Arm) <robh@...nel.org> wrote:
> It doesn't matter whether "mux-states" is not present or there is some
> other issue parsing it causing an error. Drop the presence check and
> rework the error handling to ignore anything other than deferred probe.
>
> Acked-by: Marc Kleine-Budde <mkl@...gutronix.de>
> Signed-off-by: Rob Herring (Arm) <robh@...nel.org>
> ---
> Now a warning in v6.14-rc1, so please apply for 6.14.
>
> v2:
>  - Use brackets on else clause

Thanks for your patch, which is now commit d02dfd4ceb2e9f34 ("phy:
can-transceiver: Drop unnecessary "mux-states" property presence check")
in phy/next (next-20250212 and later).

I have bisected the following error during boot on the Gray Hawk Single
and White Hawk development boards:

    can-transceiver-phy can-phy0: /can-phy0: failed to get mux-state (0)

> --- a/drivers/phy/phy-can-transceiver.c
> +++ b/drivers/phy/phy-can-transceiver.c
> @@ -113,13 +114,11 @@ static int can_transceiver_phy_probe(struct platform_device *pdev)
>         match = of_match_node(can_transceiver_phy_ids, pdev->dev.of_node);
>         drvdata = match->data;
>
> -       if (of_property_read_bool(dev->of_node, "mux-states")) {
> -               struct mux_state *mux_state;
> -
> -               mux_state = devm_mux_state_get(dev, NULL);
> -               if (IS_ERR(mux_state))
> -                       return dev_err_probe(&pdev->dev, PTR_ERR(mux_state),
> -                                            "failed to get mux\n");
> +       mux_state = devm_mux_state_get(dev, NULL);

If the (optional) "mux-states" property is not present, mux_get()
prints an error message, and returns -ENOENT....

> +       if (IS_ERR(mux_state)) {
> +               if (PTR_ERR(mux_state) == -EPROBE_DEFER)
> +                       return PTR_ERR(mux_state);

... which is ignored here, so in the end all is good.
Still, it is confusing to erroneously print an error message.

> +       } else {
>                 can_transceiver_phy->mux_state = mux_state;
>         }

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ