[PATCH 03/19] Ensure that the old style MDIO interface is active

Andrew Jeffery andrew at aj.id.au
Tue Sep 20 10:29:27 AEST 2016


On Mon, 2016-09-19 at 17:50 -0500, Timothy Pearson wrote:
>  before registering the MDIO bus on Faraday style
>  MACs.  Without this patch the hardware may continue
>  to expect new style commands, yielding MDIO timeouts
>  and general lack of communication with the MII.
> 
> Signed-off-by: Timothy Pearson <tpearson at raptorengineering.com>

I've had a look at this patch from your git repo on github. Whilst git-
send-email is changing the patch in ways you're not expecting, it's
because your commit message isn't formatted in the manner expected by
git's tools. Your object looks like:

    $ git cat-file -p 322ca61d9a6adbbc70a89d64a07469e384ca3931
    tree bbbf2ad42043eee22d7daa755c42ce372356053a
    parent f06ba7f29a26de27a2feb1dd8ec26022c4fbd77e
    author Timothy Pearson <    tpearson at raptorengineering.com    > 1473775455 -0500
    committer Timothy Pearson <    tpearson at raptorengineering.com    > 1473775938 -0500

    Ensure that the old style MDIO interface is active before registering
    the MDIO bus on Faraday style MACs.  Without this patch the hardware
    may continue to expect new style commands, yielding MDIO timeouts
    and general lack of communication with the MII.

    Signed-off-by: Timothy Pearson <    tpearson at raptorengineering.com>

From `git help commit`:

    DISCUSSION
           Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, followed by a blank line
           and then a more thorough description. The text up to the first blank line in a commit message is treated as the commit title, and that title is used throughout Git.
           For example, git-format-patch(1) turns a commit into email, and it uses the title on the Subject line and the rest of the commit in the body.

As you don't have the blank line separator I expect one of git-format-
patch or git-send-email is treating your whole commit message as the
subject.

Separating your commit message into short and long descriptions as
detailed above should resolve your problem. For example, it might look
something like:

    ftgmac100: Enable old-style MDIO interface

    Ensure that the old style MDIO interface is active before registering
    the MDIO bus on Faraday style MACs.  Without this patch the hardware
    may continue to expect new style commands, yielding MDIO timeouts
    and general lack of communication with the MII.

Separately, I had some questions on the v1 of the patch. Can you
pleaserespond to those?

Hope that helps,

Andrew

> ---
>  drivers/net/ethernet/faraday/ftgmac100.c |    6 ++++++
>  drivers/net/ethernet/faraday/ftgmac100.h |    2 ++
>  2 files changed, 8 insertions(+)
> 
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.c b/drivers/net/ethernet/faraday/ftgmac100.c
> index c20f767..778c625 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.c
> +++ b/drivers/net/ethernet/faraday/ftgmac100.c
> @@ -1250,6 +1250,7 @@ static int ftgmac100_setup_mdio(struct net_device *netdev)
>  {
>  	struct ftgmac100 *priv = netdev_priv(netdev);
>  	struct platform_device *pdev = to_platform_device(priv->dev);
> +	uint32_t revcr;
>  	int i, err = 0;
>  
>  	/* initialize mdio bus */
> @@ -1257,6 +1258,11 @@ static int ftgmac100_setup_mdio(struct net_device *netdev)
>  	if (!priv->mii_bus)
>  		return -EIO;
>  
> +	/* This driver only supports the old MDIO interface -- enable it */
> +	revcr = ioread32(priv->base + FTGMAC100_OFFSET_REVR);
> +	revcr &= ~FTGMAC100_OFFSET_REVR_NEW_INTERFACE;
> +	iowrite32(revcr, priv->base + FTGMAC100_OFFSET_REVR);
> +
>  	priv->mii_bus->name = "ftgmac100_mdio";
>  	snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%d",
>  		 pdev->name, pdev->id);
> diff --git a/drivers/net/ethernet/faraday/ftgmac100.h b/drivers/net/ethernet/faraday/ftgmac100.h
> index d07b6ea..ee5f758 100644
> --- a/drivers/net/ethernet/faraday/ftgmac100.h
> +++ b/drivers/net/ethernet/faraday/ftgmac100.h
> @@ -133,6 +133,8 @@
>  #define FTGMAC100_DMAFIFOS_RXDMA_REQ		(1 << 30)
>  #define FTGMAC100_DMAFIFOS_TXDMA_REQ		(1 << 31)
>  
> +#define FTGMAC100_OFFSET_REVR_NEW_INTERFACE	(1 << 31)
> +
>  /*
>   * Receive buffer size register
>   */
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20160920/daf15f88/attachment-0001.sig>


More information about the openbmc mailing list