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]
Date:	Mon, 04 Jan 2016 12:15:50 -0800
From:	Florian Fainelli <f.fainelli@...il.com>
To:	Andrew Lunn <andrew@...n.ch>
CC:	netdev <netdev@...r.kernel.org>
Subject: Re: [RFC PATCH net-next 08/24] phy: Centralise print about attached
 phy

On 04/01/16 09:36, Andrew Lunn wrote:
> Many Ethernet drivers contain the same netdev_info() print statement
> about the attached phy. Move it into the phy device code.
> 
> Signed-off-by: Andrew Lunn <andrew@...n.ch>
> ---

[snip]

> diff --git a/drivers/net/ethernet/adi/bfin_mac.c b/drivers/net/ethernet/adi/bfin_mac.c
> index 5f8a5182b8dc..4c6f7a7f9352 100644
> --- a/drivers/net/ethernet/adi/bfin_mac.c
> +++ b/drivers/net/ethernet/adi/bfin_mac.c
> @@ -444,11 +444,6 @@ static int mii_probe(struct net_device *dev, int phy_mode)
>  	lp->old_duplex = -1;
>  	lp->phydev = phydev;
>  
> -	pr_info("attached PHY driver [%s] "
> -	        "(mii_bus:phy_addr=%s, irq=%d, mdc_clk=%dHz(mdc_div=%d)@sclk=%dMHz)\n",
> -		phydev->drv->name, phydev_name(phydev), phydev->irq,
> -	        MDC_CLK, mdc_div, sclk/1000000);

Removing this gets rid of the bus clocking information that is displayed
here.

[snip]

>  	/* mask with MAC supported features */
>  	phydev->supported &= PHY_BASIC_FEATURES;
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 0f179709a289..e41bea8e898d 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -662,6 +662,10 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
>  	phydev->attached_dev = dev;
>  	dev->phydev = phydev;
>  
> +	netdev_info(dev,
> +		    "attached PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
> +		    phydev->drv->name, phydev_name(phydev), phydev->irq);

It could be nice to expose the format string here along with parameters
to let drivers decide how much additional information they want to print
rather than forcing this to the core PHY library. Maybe something ala
phy_print_status() which takes variadic arguments?

Some drivers also seem to have a netif_msg_probe() conditional to guard
this print, I am not sure if we should keep that, probably not.
-- 
Florian
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ