All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Garzik <jeff@garzik.org>
To: Andy Fleming <afleming@freescale.com>
Cc: netdev@vger.kernel.org
Subject: Re: [PATCH] Fix PHY Lib support for gianfar and ucc_geth
Date: Wed, 06 Feb 2008 06:44:17 -0500	[thread overview]
Message-ID: <47A99D91.9000102@garzik.org> (raw)
In-Reply-To: <12022509302322-git-send-email-afleming@freescale.com>

Andy Fleming wrote:
> The PHY Lib now uses mutexes instead of spin_locks.  ucc_geth
> and gianfar both grab the locks in their mdio_reset functions,
> so they need to use mutex_(un)lock instead.  This was not caught
> until someone tested it on an SMP system.
> 
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> ---
>  drivers/net/gianfar_mii.c  |    4 ++--
>  drivers/net/ucc_geth_mii.c |    4 ++--
>  2 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/gianfar_mii.c b/drivers/net/gianfar_mii.c
> index 100bf41..6a647d9 100644
> --- a/drivers/net/gianfar_mii.c
> +++ b/drivers/net/gianfar_mii.c
> @@ -127,7 +127,7 @@ int gfar_mdio_reset(struct mii_bus *bus)
>  	struct gfar_mii __iomem *regs = (void __iomem *)bus->priv;
>  	unsigned int timeout = PHY_INIT_TIMEOUT;
>  
> -	spin_lock_bh(&bus->mdio_lock);
> +	mutex_lock(&bus->mdio_lock);
>  
>  	/* Reset the management interface */
>  	gfar_write(&regs->miimcfg, MIIMCFG_RESET);
> @@ -140,7 +140,7 @@ int gfar_mdio_reset(struct mii_bus *bus)
>  			timeout--)
>  		cpu_relax();
>  
> -	spin_unlock_bh(&bus->mdio_lock);
> +	mutex_unlock(&bus->mdio_lock);
>  
>  	if(timeout <= 0) {
>  		printk(KERN_ERR "%s: The MII Bus is stuck!\n",
> diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
> index e3ba14a..c69e654 100644
> --- a/drivers/net/ucc_geth_mii.c
> +++ b/drivers/net/ucc_geth_mii.c
> @@ -109,7 +109,7 @@ int uec_mdio_reset(struct mii_bus *bus)
>  	struct ucc_mii_mng __iomem *regs = (void __iomem *)bus->priv;
>  	unsigned int timeout = PHY_INIT_TIMEOUT;
>  
> -	spin_lock_bh(&bus->mdio_lock);
> +	mutex_lock(&bus->mdio_lock);
>  
>  	/* Reset the management interface */
>  	out_be32(&regs->miimcfg, MIIMCFG_RESET_MANAGEMENT);
> @@ -121,7 +121,7 @@ int uec_mdio_reset(struct mii_bus *bus)
>  	while ((in_be32(&regs->miimind) & MIIMIND_BUSY) && timeout--)
>  		cpu_relax();
>  
> -	spin_unlock_bh(&bus->mdio_lock);
> +	mutex_unlock(&bus->mdio_lock);
>  

applied



      reply	other threads:[~2008-02-06 11:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 22:35 [PATCH] Fix PHY Lib support for gianfar and ucc_geth Andy Fleming
2008-02-06 11:44 ` Jeff Garzik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47A99D91.9000102@garzik.org \
    --to=jeff@garzik.org \
    --cc=afleming@freescale.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.