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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdVCmchuN1LyHGoE6A0TEpc9R1unXi2KNYO94cmT1WwOHA@mail.gmail.com>
Date: Thu, 20 Mar 2025 11:25:27 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Vincent Mailhol <mailhol.vincent@...adoo.fr>
Cc: linux-can@...r.kernel.org, linux-phy@...ts.infradead.org, 
	linux-renesas-soc@...r.kernel.org, linux-kernel@...r.kernel.org, 
	Rob Herring <robh@...nel.org>, Marc Kleine-Budde <mkl@...gutronix.de>, Vinod Koul <vkoul@...nel.org>, 
	Kishon Vijay Abraham I <kishon@...nel.org>, Peter Rosin <peda@...ntia.se>, 
	Aswath Govindraju <a-govindraju@...com>
Subject: Re: [PATCH] phy: can-transceiver: Re-instate "mux-states" property
 presence check

Hi Vincent,

On Wed, 19 Mar 2025 at 15:07, Vincent Mailhol
<mailhol.vincent@...adoo.fr> wrote:
> For some reasons, I received your message twice (with a two minutes
> interval between both messages). These look identical. I am answering

My scripting didn't handle the comment in Rob's address correctly,
so I resent the patch with the fixed address.

> the most recent. :)

Good ;-)

> On 19/03/2025 at 22:27, Geert Uytterhoeven wrote:
> > On the Renesas Gray Hawk Single development board:
> >
> >     can-transceiver-phy can-phy0: /can-phy0: failed to get mux-state (0)
> >
> > "mux-states" is an optional property for CAN transceivers.  However,
> > mux_get() always prints an error message in case of an error, including
> > when the property is not present, confusing the user.
>
> Hmmm, I understand why you are doing this patch. But on the long term,
> wouldn't it make more sense to have a devm_mux_state_get_optional()? Or
> maybe add a property somewhere to inform devm_mux_state_get() that this
> is optional?
>
> Regardless, just see this as an open question. I am OK with the approach
> of your patch.

Alternatively, we can be proactive and add a temporary local wrapper:

    /* Dummy wrapper until optional muxes are supported */
    static inline struct mux_state *
    devm_mux_state_get_optional(struct device *dev, const char *mux_name)
    {
            if (!of_property_present(dev->of_node, "mux-states"))
                    return NULL;

            return devm_mux_state_get(dev, mux_name);
    }

and call that instead?  Then the probe function needs no future changes
when the real devm_mux_state_get_optional() arrives.

> > Fix this by re-instating the property presence check.
> >
> > This is bascially a revert of commit d02dfd4ceb2e9f34 ("phy:
> > can-transceiver: Drop unnecessary "mux-states" property presence
> > check"), with two changes:
> >   1. Use the proper API for checking whether a property is present,
> >   2. Do not print an error message, as the mux core already takes care
> >      of that.
> >
> > Fixes: d02dfd4ceb2e9f34 ("phy: can-transceiver: Drop unnecessary "mux-states" property presence check")> Signed-off-by: Geert Uytterhoeven <geert+renesas@...der.be>
>
> Notwithstanding of above comment:
>
> Reviewed-by: Vincent Mailhol <mailhol.vincent@...adoo.fr>

Thanks!

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