LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Joakim Tjernlund <joakim.tjernlund@transmode.se>
To: 'linuxppc-dev Development' <linuxppc-dev@ozlabs.org>
Subject: Re: [PATCH] Fix ucc_geth MII master selection
Date: Fri, 15 Feb 2008 11:09:59 +0100	[thread overview]
Message-ID: <1203070199.5419.101.camel@gentoo-jocke.transmode.se> (raw)
In-Reply-To: <1203009081-10966-1-git-send-email-Joakim.Tjernlund@transmode.se>

On Thu, 2008-02-14 at 18:11 +0100, Joakim Tjernlund wrote:
> Remove bogus UCC regs range test and correct
> off by one error in call to ucc_set_qe_mux_mii_mng()
> 
> Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> ---
> 
> I am not 100% sure this is the correct fix, please ACK or NACK
> 
>  drivers/net/ucc_geth_mii.c |   26 +++++++++++---------------
>  1 files changed, 11 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/net/ucc_geth_mii.c b/drivers/net/ucc_geth_mii.c
> index 6c257b8..472d5a1 100644
> --- a/drivers/net/ucc_geth_mii.c
> +++ b/drivers/net/ucc_geth_mii.c
> @@ -200,21 +200,17 @@ static int uec_mdio_probe(struct of_device *ofdev, const struct of_device_id *ma
>  		if (err)
>  			goto bus_register_fail;
>  
> -		/* if our mdio regs fall within this UCC regs range */
> -		if ((res.start >= tempres.start) &&
> -		    (res.end <= tempres.end)) {
> -			/* set this UCC to be the MII master */
> -			const u32 *id = of_get_property(tempnp, "device-id", NULL);
> -			if (id == NULL)
> -				goto bus_register_fail;
> -
> -			ucc_set_qe_mux_mii_mng(*id - 1);
> -
> -			/* assign the TBI an address which won't
> -			 * conflict with the PHYs */
> -			out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
> -			break;
> -		}
> +		/* set this UCC to be the MII master */
> +		const u32 *id = of_get_property(tempnp, "device-id", NULL);
> +		if (id == NULL)
> +			goto bus_register_fail;
> +
> +		ucc_set_qe_mux_mii_mng(*id);
> +
> +		/* assign the TBI an address which won't
> +		 * conflict with the PHYs */
> +		out_be32(&regs->utbipar, UTBIPAR_INIT_TBIPA);
> +		break;
>  	}
>  
>  	err = mdiobus_register(new_bus);

This patch is crap, turns out that ucc_set_qe_mux_mii_mng(2) always
works even if UCC3 isn't used at all. I can't figured out why not 1 
or 3 works.

 Jocke

      reply	other threads:[~2008-02-15 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 17:11 [PATCH] Fix ucc_geth MII master selection Joakim Tjernlund
2008-02-15 10:09 ` Joakim Tjernlund [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=1203070199.5419.101.camel@gentoo-jocke.transmode.se \
    --to=joakim.tjernlund@transmode.se \
    --cc=linuxppc-dev@ozlabs.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox