All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] netdev/phy: skip disabled mdio-mux nodes
@ 2012-08-07 16:51 Timur Tabi
  2012-08-07 16:59 ` David Daney
  2012-08-14 19:19 ` Tabi Timur-B04825
  0 siblings, 2 replies; 7+ messages in thread
From: Timur Tabi @ 2012-08-07 16:51 UTC (permalink / raw)
  To: david.daney, David Miller, netdev

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@freescale.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;
+
 		r = of_property_read_u32(child_bus_node, "reg", &v);
 		if (r)
 			continue;
-- 
1.7.3.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
  2012-08-07 16:51 [PATCH] netdev/phy: skip disabled mdio-mux nodes Timur Tabi
@ 2012-08-07 16:59 ` David Daney
       [not found]   ` <5021496D.8070200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  2012-08-14 19:19 ` Tabi Timur-B04825
  1 sibling, 1 reply; 7+ messages in thread
From: David Daney @ 2012-08-07 16:59 UTC (permalink / raw)
  To: Timur Tabi, Grant Likely, Rob Herring
  Cc: david.daney, David Miller, netdev, devicetree-discuss

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@freescale.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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
       [not found]   ` <5021496D.8070200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
@ 2012-08-07 17:04     ` Timur Tabi
  0 siblings, 0 replies; 7+ messages in thread
From: Timur Tabi @ 2012-08-07 17:04 UTC (permalink / raw)
  To: David Daney
  Cc: david.daney-YGCgFSpz5w/QT0dZR+AlfA,
	netdev-u79uwXL29TY76Z2rM5mHXA,
	devicetree-discuss-uLR06cmDAlY/bJ5BZ2RsiQ, Rob Herring,
	David Miller

David Daney wrote:
> 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.

You're probably right, but this is how it's normally done.  If you're
going to scan child nodes manually, you have to skip disabled nodes.

If someone else wants to implement for_each_available_child_of_node(), I'm
all for it, but such a patch would not be merged until 3.7.  I was hoping
to have my patch applied to 3.6, since it fixes a real bug.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
  2012-08-07 16:51 [PATCH] netdev/phy: skip disabled mdio-mux nodes Timur Tabi
  2012-08-07 16:59 ` David Daney
@ 2012-08-14 19:19 ` Tabi Timur-B04825
  2012-08-14 21:07   ` David Miller
  1 sibling, 1 reply; 7+ messages in thread
From: Tabi Timur-B04825 @ 2012-08-14 19:19 UTC (permalink / raw)
  To: Tabi Timur-B04825; +Cc: david.daney, David Miller, netdev

On Tue, Aug 7, 2012 at 11:51 AM, Timur Tabi <timur@freescale.com> 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@freescale.com>
> ---

Mr. Miller,

Any chance this patch can get into 3.6?  I don't know if it qualifies
as a fix or not, but getting it into 3.6 would make it easier for me
to apply other patches to the powerpc tree.

-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
  2012-08-14 19:19 ` Tabi Timur-B04825
@ 2012-08-14 21:07   ` David Miller
  2012-08-14 21:12     ` Timur Tabi
  0 siblings, 1 reply; 7+ messages in thread
From: David Miller @ 2012-08-14 21:07 UTC (permalink / raw)
  To: B04825; +Cc: david.daney, netdev

From: Tabi Timur-B04825 <B04825@freescale.com>
Date: Tue, 14 Aug 2012 19:19:58 +0000

> On Tue, Aug 7, 2012 at 11:51 AM, Timur Tabi <timur@freescale.com> 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@freescale.com>
>> ---
> 
> Any chance this patch can get into 3.6?  I don't know if it qualifies
> as a fix or not, but getting it into 3.6 would make it easier for me
> to apply other patches to the powerpc tree.
> 

I want you to implement it the way David Daney said to do so.

And you never need to ask me questions like this, I clearly mark the
state of your patch:

http://patchwork.ozlabs.org/patch/175750/

So that you can just monitor it instead of wasting my time asking what
is happening to your patch.

Time of mine you consume forcing me to reply to you in situations like
this, which you could handle on your own, is time that I can't spend
reviewing patches from oher people that really are ready to go into
the tree.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
  2012-08-14 21:07   ` David Miller
@ 2012-08-14 21:12     ` Timur Tabi
  2012-08-14 21:16       ` David Miller
  0 siblings, 1 reply; 7+ messages in thread
From: Timur Tabi @ 2012-08-14 21:12 UTC (permalink / raw)
  To: David Miller; +Cc: david.daney, netdev

David Miller wrote:

>> Any chance this patch can get into 3.6?  I don't know if it qualifies
>> as a fix or not, but getting it into 3.6 would make it easier for me
>> to apply other patches to the powerpc tree.
>>
> 
> I want you to implement it the way David Daney said to do so.

So you're saying that you don't want this fixed for 3.6?  Because David
Daney's suggestion would require me to introduce a new device tree
function, and that won't be accepted until 3.7 at the earliest.

> And you never need to ask me questions like this, I clearly mark the
> state of your patch:
> 
> http://patchwork.ozlabs.org/patch/175750/
> 
> So that you can just monitor it instead of wasting my time asking what
> is happening to your patch.

Sorry.

> Time of mine you consume forcing me to reply to you in situations like
> this, which you could handle on your own, is time that I can't spend
> reviewing patches from oher people that really are ready to go into
> the tree.
> 


-- 
Timur Tabi
Linux kernel developer at Freescale

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] netdev/phy: skip disabled mdio-mux nodes
  2012-08-14 21:12     ` Timur Tabi
@ 2012-08-14 21:16       ` David Miller
  0 siblings, 0 replies; 7+ messages in thread
From: David Miller @ 2012-08-14 21:16 UTC (permalink / raw)
  To: timur; +Cc: david.daney, netdev

From: Timur Tabi <timur@freescale.com>
Date: Tue, 14 Aug 2012 16:12:10 -0500

> David Miller wrote:
> 
>>> Any chance this patch can get into 3.6?  I don't know if it qualifies
>>> as a fix or not, but getting it into 3.6 would make it easier for me
>>> to apply other patches to the powerpc tree.
>>>
>> 
>> I want you to implement it the way David Daney said to do so.
> 
> So you're saying that you don't want this fixed for 3.6?  Because David
> Daney's suggestion would require me to introduce a new device tree
> function, and that won't be accepted until 3.7 at the earliest.

If it is infrastrucure needed to fix a bug, it would be accepted.  Stop
talking nonsense.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2012-08-14 21:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-07 16:51 [PATCH] netdev/phy: skip disabled mdio-mux nodes Timur Tabi
2012-08-07 16:59 ` David Daney
     [not found]   ` <5021496D.8070200-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2012-08-07 17:04     ` Timur Tabi
2012-08-14 19:19 ` Tabi Timur-B04825
2012-08-14 21:07   ` David Miller
2012-08-14 21:12     ` Timur Tabi
2012-08-14 21:16       ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.