Skip to contentSkip to conversation

net: emaclite: adding MDIO and phy lib support

PATCH John Linn 2 participants 3 messages Feb 8, 2010 – Feb 9, 2010 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

John Linn

author
#1 lore raw
In reply to a message not in the archive
Quoted 4 lines

-----Original Message-----
From: John Linn [mailto:[email protected]]
Sent: Friday, February 05, 2010 3:41 PM
To: [email protected]; [email protected];

[email protected]; [email protected];

Quoted 8 lines

[email protected]
Cc: [email protected]; John Linn; Sadanand Mutyala
Subject: [PATCH] [V2] net: emaclite: adding MDIO and phy lib support

These changes add MDIO and phy lib support to the driver as the IP core now supports the MDIO bus.

The MDIO bus and phy are added as a child to the emaclite in the

device

Quoted 14 lines

tree as illustrated below.

mdio {
	#address-cells = <1>;
	#size-cells = <0>;
	compatible = "xlnx,emaclite-mdio";
	phy0: phy@7 {
		reg = <7>;
	} ;
}
Quoted 7 lines

---

V2 - updated it for Grant's comments, except I couldn't find any tabs converted to white space issue, let's see if V2 has it also

---
 drivers/net/Kconfig           |    1 +
 drivers/net/xilinx_emaclite.c |  393

++++++++++++++++++++++++++++++++++++-----

Review

Quoted 15 lines
 2 files changed, 351 insertions(+), 43 deletions(-)
drivers/net/Kconfig +1 -0
index dd9a09c..9509a36 100644
@@ -1939,6 +1939,7 @@ config ATL2
 config XILINX_EMACLITE
 	tristate "Xilinx 10/100 Ethernet Lite support"
 	depends on PPC32 || MICROBLAZE
+	select PHYLIB
 	help
 	  This driver supports the 10/100 Ethernet Lite from Xilinx.
 
(quoted diff) +0 -0

b/drivers/net/xilinx_emaclite.c

Quoted 10 lines

index 8c777ba..02f18dd 100644

drivers/net/xilinx_emaclite.c +2 -0
@@ -22,11 +22,17 @@
 
 #include <linux/of_device.h>
 #include <linux/of_platform.h>
+#include <linux/of_mdio.h>
+#include <linux/phy.h>
 

<snip>

Quoted 1 line

+static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int

reg)

drivers/net/xilinx_emaclite.c

Quoted 9 lines
drivers/net/xilinx_emaclite.c +9 -0
+{
+	struct net_local *lp = bus->priv;
+	u32 ctrl_reg;
+	u32 rc;
+
+	mutex_lock(&lp->mdio_mutex);
+
+	if (xemaclite_mdio_wait(lp))
+		return -ETIMEDOUT;

I already see a problem with this patch as when there's a timeout waiting for the mdio the mutex won't get unlocked. This is true anywhere the timeout happens (other places also).

I tested it with normal operation, but don't have a great way to test the timeout paths.

I'll wait for other comments then spin it again to unlock the mutex when there's a timeout.

Thanks,
John

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.

#2 lore raw
Quoted 9 lines · John Linn
Quoted 4 lines

-----Original Message-----
From: John Linn [mailto:[email protected]]
Sent: Friday, February 05, 2010 3:41 PM
To: [email protected]; [email protected];

[email protected]; [email protected];

Quoted 4 lines

[email protected]
Cc: [email protected]; John Linn; Sadanand Mutyala
Subject: [PATCH] [V2] net: emaclite: adding MDIO and phy lib support

Quoted 15 lines
Quoted 4 lines

These changes add MDIO and phy lib support to the driver as the IP core now supports the MDIO bus.

The MDIO bus and phy are added as a child to the emaclite in the

device

Quoted 10 lines

tree as illustrated below.

mdio {
      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "xlnx,emaclite-mdio";
      phy0: phy@7 {
              reg = <7>;
      } ;
}

You misunderstood me about the compatible property. You don't need a compatible prop in the mdio node because it is *alwasy* a child of the emaclite node, and the emaclite driver knows to go looking for it (ie. it is a part of the device).

What I want to see is a compatible value in the phy@7 node for the make & model of the phy.

Otherwise, looks good to me. Fix the mutex timeout problem and then you can add my acked-by line to the patch.

Cheers,
g.

author
#3 lore raw
Quoted 34 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Grant Likely
Sent: Tuesday, February 09, 2010 8:45 AM
To: John Linn
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Sadanand Mutyala
Subject: Re: [PATCH] [V2] net: emaclite: adding MDIO and phy lib support

Quoted 9 lines · John Linn
Quoted 4 lines

-----Original Message-----
From: John Linn [mailto:[email protected]]
Sent: Friday, February 05, 2010 3:41 PM
To: [email protected]; [email protected];

[email protected]; [email protected];

Quoted 4 lines

[email protected]
Cc: [email protected]; John Linn; Sadanand Mutyala
Subject: [PATCH] [V2] net: emaclite: adding MDIO and phy lib support

Quoted 15 lines
Quoted 4 lines

These changes add MDIO and phy lib support to the driver as the IP core now supports the MDIO bus.

The MDIO bus and phy are added as a child to the emaclite in the

device

Quoted 10 lines

tree as illustrated below.

mdio {
      #address-cells = <1>;
      #size-cells = <0>;
      compatible = "xlnx,emaclite-mdio";
      phy0: phy@7 {
              reg = <7>;
      } ;
}

Quoted 4 lines

You misunderstood me about the compatible property. You don't need a compatible prop in the mdio node because it is *alwasy* a child of the emaclite node, and the emaclite driver knows to go looking for it (ie. it is a part of the device).

OK, now I see, sorry for my denseness there.

Quoted 3 lines

What I want to see is a compatible value in the phy@7 node for the make & model of the phy.

Makes more sense.

Quoted 3 lines

Otherwise, looks good to me. Fix the mutex timeout problem and then you can add my acked-by line to the patch.

Will spin V3 patch with fixes and add your ack, appreciate the help and your patience.

- John

Quoted 3 lines

Cheers,
g.

This email and any attachments are intended for the sole use of the named recipient(s) and contain(s) confidential information that may be proprietary, privileged or copyrighted under applicable law. If you are not the intended recipient, do not read, copy, or forward this email message or any attachments. Delete this email message and any attachments immediately.