netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: Alexander Graf <agraf@suse.de>, <netdev@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <michal.simek@xilinx.com>
Subject: Re: [PATCH] phy dp83867: depend on CONFIG_OF_MDIO
Date: Mon, 16 May 2016 08:38:20 -0500	[thread overview]
Message-ID: <5739CD4C.7020208@ti.com> (raw)
In-Reply-To: <1463398095-123269-1-git-send-email-agraf@suse.de>

Alexander

On 05/16/2016 06:28 AM, Alexander Graf wrote:
> The DP83867 phy driver doesn't actually work when CONFIG_OF_MDIO isn't enabled.
> It simply passes the device tree test, but leaves all internal configuration
> initialized at 0. Then it configures the phy with those values and renders a
> previously working configuration useless.
>
> This patch makes sure that we only build the DP83867 phy code when
> CONFIG_OF_MDIO is set, to not run into that problem.
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
>  drivers/net/phy/Kconfig   | 1 +
>  drivers/net/phy/dp83867.c | 7 -------
>  2 files changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
> index 6dad9a9..4265ad5 100644
> --- a/drivers/net/phy/Kconfig
> +++ b/drivers/net/phy/Kconfig
> @@ -148,6 +148,7 @@ config DP83848_PHY
>  
>  config DP83867_PHY
>  	tristate "Drivers for Texas Instruments DP83867 Gigabit PHY"
> +	depends on OF_MDIO
>  	---help---
>  	  Currently supports the DP83867 PHY.
>  
> diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
> index 2afa61b..ff867ba 100644
> --- a/drivers/net/phy/dp83867.c
> +++ b/drivers/net/phy/dp83867.c
> @@ -99,7 +99,6 @@ static int dp83867_config_intr(struct phy_device *phydev)
>  	return phy_write(phydev, MII_DP83867_MICR, micr_status);
>  }
>  
> -#ifdef CONFIG_OF_MDIO
>  static int dp83867_of_init(struct phy_device *phydev)
>  {
>  	struct dp83867_private *dp83867 = phydev->priv;
> @@ -123,12 +122,6 @@ static int dp83867_of_init(struct phy_device *phydev)
>  	return of_property_read_u32(of_node, "ti,fifo-depth",
>  				   &dp83867->fifo_depth);
>  }
> -#else
> -static int dp83867_of_init(struct phy_device *phydev)
> -{
> -	return 0;
> -}
> -#endif /* CONFIG_OF_MDIO */
>  
>  static int dp83867_config_init(struct phy_device *phydev)
>  {
I don't think we want this to depend solely on OF_MDIO.

The #else case should probably be coded to look at platform data, if
it exists.  I don't have any boards that still used platform data to test this
out so I did not feel comfortable adding code I could not test.

The platform data should contain the RGMII tx/rx delay and FIFO control.


Dan

-- 
------------------
Dan Murphy

  parent reply	other threads:[~2016-05-16 13:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-16 11:28 [PATCH] phy dp83867: depend on CONFIG_OF_MDIO Alexander Graf
2016-05-16 12:44 ` Andrew Lunn
2016-05-16 17:59   ` Alexander Graf
2016-05-16 13:38 ` Dan Murphy [this message]
2016-05-16 17:57   ` Alexander Graf
2016-05-16 18:22     ` Dan Murphy

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=5739CD4C.7020208@ti.com \
    --to=dmurphy@ti.com \
    --cc=agraf@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).