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: <Yas3HpT59X4dnXCg@shell.armlinux.org.uk>
Date:   Sat, 4 Dec 2021 09:38:38 +0000
From:   "Russell King (Oracle)" <linux@...linux.org.uk>
To:     Yinbo Zhu <zhuyinbo@...ngson.cn>
Cc:     Andrew Lunn <andrew@...n.ch>,
        Heiner Kallweit <hkallweit1@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Masahiro Yamada <masahiroy@...nel.org>,
        Michal Marek <michal.lkml@...kovi.net>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-kbuild@...r.kernel.org
Subject: Re: [PATCH v4 2/2] net: mdio: rework mdio_uevent for mdio ethernet
 phy device

On Sat, Dec 04, 2021 at 05:13:28PM +0800, Yinbo Zhu wrote:
> The of_device_uevent_modalias is service for 'of' type platform driver
> , which ask the first args must be 'of' that use MODULE_DEVICE_TABLE
> when driver was exported, but ethernet phy is a kind of 'mdio' type
> device and it is inappropriate if driver use 'of' type for exporting,
> in fact, most mainstream ethernet phy driver hasn't used 'of' type,
> even though phy driver was exported use 'of' type and it's irrelevant
> with mdio_uevent, at this time, platform_uevent was responsible for
> reporting uevent to match modules.alias configure, so, whatever that
> of_device_uevent_modalias was unnecessary, this patch was to remove it
> and add phy_id as modio uevent then ethernet phy module auto load
> function will work well.
> 
> Signed-off-by: Yinbo Zhu <zhuyinbo@...ngson.cn>

NAK.

> ---
> 
>  drivers/net/phy/mdio_bus.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/phy/mdio_bus.c b/drivers/net/phy/mdio_bus.c
> index 6865d93..999f0d4 100644
> --- a/drivers/net/phy/mdio_bus.c
> +++ b/drivers/net/phy/mdio_bus.c
> @@ -962,12 +962,12 @@ static int mdio_bus_match(struct device *dev, struct device_driver *drv)
>  
>  static int mdio_uevent(struct device *dev, struct kobj_uevent_env *env)
>  {
> -	int rc;
> +	struct phy_device *pdev;
>  
> -	/* Some devices have extra OF data and an OF-style MODALIAS */
> -	rc = of_device_uevent_modalias(dev, env);
> -	if (rc != -ENODEV)
> -		return rc;
> +	pdev = to_phy_device(dev);
> +
> +	if (add_uevent_var(env, "MODALIAS=mdio:p%08X", pdev->phy_id))
> +		return -ENOMEM;
>  
>  	return 0;
>  }
> @@ -991,7 +991,7 @@ static int mdio_uevent(struct device *dev, struct kobj_uevent_env *env)
>  };
>  
>  struct bus_type mdio_bus_type = {
> -	.name		= "mdio_bus",
> +	.name		= "mdio",
>  	.dev_groups	= mdio_bus_dev_groups,
>  	.match		= mdio_bus_match,
>  	.uevent		= mdio_uevent,
> -- 
> 1.8.3.1
> 
> 

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ