[PATCH] [V2] net: emaclite: adding MDIO and phy lib support

John Linn John.Linn at xilinx.com
Tue Feb 9 01:09:01 EST 2010


> -----Original Message-----
> From: John Linn [mailto:john.linn at xilinx.com]
> Sent: Friday, February 05, 2010 3:41 PM
> To: netdev at vger.kernel.org; linuxppc-dev at ozlabs.org;
jgarzik at pobox.com; grant.likely at secretlab.ca;
> jwboyer at linux.vnet.ibm.com
> Cc: john.williams at petalogix.com; 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
> tree as illustrated below.
> 
> mdio {
> 	#address-cells = <1>;
> 	#size-cells = <0>;
> 	compatible = "xlnx,emaclite-mdio";
> 	phy0: phy at 7 {
> 		reg = <7>;
> 	} ;
> }
> 
> Signed-off-by: Sadanand Mutyala <Sadanand.Mutyala at xilinx.com>
> Signed-off-by: John Linn <john.linn at xilinx.com>
> 
> ---
> 
> 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
++++++++++++++++++++++++++++++++++++-----
>  2 files changed, 351 insertions(+), 43 deletions(-)
> 
> diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
> index dd9a09c..9509a36 100644
> --- a/drivers/net/Kconfig
> +++ b/drivers/net/Kconfig
> @@ -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.
> 
> diff --git a/drivers/net/xilinx_emaclite.c
b/drivers/net/xilinx_emaclite.c
> index 8c777ba..02f18dd 100644
> --- a/drivers/net/xilinx_emaclite.c
> +++ b/drivers/net/xilinx_emaclite.c
> @@ -22,11 +22,17 @@
> 
>  #include <linux/of_device.h>
>  #include <linux/of_platform.h>
> +#include <linux/of_mdio.h>
> +#include <linux/phy.h>
> 

<snip>

> +static int xemaclite_mdio_read(struct mii_bus *bus, int phy_id, int
reg)
> +{
> +	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.




More information about the Linuxppc-dev mailing list