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: <5021496D.8070200@gmail.com>
Date:	Tue, 07 Aug 2012 09:59:25 -0700
From:	David Daney <ddaney.cavm@...il.com>
To:	Timur Tabi <timur@...escale.com>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>
CC:	david.daney@...ium.com, David Miller <davem@...emloft.net>,
	netdev@...r.kernel.org,
	"devicetree-discuss@...ts.ozlabs.org" 
	<devicetree-discuss@...ts.ozlabs.org>
Subject: Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes

On 08/07/2012 09:51 AM, Timur Tabi wrote:
> The mdio-mux driver scans all child mdio nodes, without regard to whether
> the node is actually used.  Some device trees include all possible
> mdio-mux nodes and rely on the boot loader to disable those that are not
> present, based on some run-time configuration.  Those nodes need to be
> skipped.
>
> Signed-off-by: Timur Tabi<timur@...escale.com>
> ---
>   drivers/net/phy/mdio-mux.c |    9 +++++++++
>   1 files changed, 9 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/phy/mdio-mux.c b/drivers/net/phy/mdio-mux.c
> index 5c12018..d0c231e 100644
> --- a/drivers/net/phy/mdio-mux.c
> +++ b/drivers/net/phy/mdio-mux.c
> @@ -135,6 +135,15 @@ int mdio_mux_init(struct device *dev,
>   	for_each_child_of_node(dev->of_node, child_bus_node) {
>   		u32 v;
>
> +		/*
> +		 * Some device trees include all possible mdio-mux nodes and
> +		 * rely on the boot loader to disable those that are not
> +		 * present, based on some run-time configuration.  Those nodes
> +		 * need to be skipped.
> +		 */
> +		if (!of_device_is_available(child_bus_node))
> +			continue;


Although this will get the job done, I don't think it is the cleanest 
approach.

Would it be better to create a new iterator 
(for_each_available_child_of_node perhaps) that skips the unavailable 
nodes?  This seems like a general problem that is not restricted to mdio 
multiplexers.

David Daney
--
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