All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: esben.haabendal@gmail.com, Andrew Lunn <andrew@lunn.ch>,
	"open list:ETHERNET PHY LIBRARY" <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>
Cc: Esben Haabendal <eha@deif.com>,
	Rasmus Villemoes <rasmus.villemoes@prevas.dk>
Subject: Re: [PATCH 1/2] net: phy: Helper function for reading strapped configuration values
Date: Thu, 5 Apr 2018 09:00:13 -0700	[thread overview]
Message-ID: <49448b00-e3fd-25df-580e-c02428f1bfe6@gmail.com> (raw)
In-Reply-To: <20180405114424.8519-1-esben.haabendal@gmail.com>



On 04/05/2018 04:44 AM, esben.haabendal@gmail.com wrote:
> From: Esben Haabendal <eha@deif.com>
> 
> Add a function for use in PHY driver probe functions, reading current
> autoneg, speed and duplex configuration from BMCR register.
> 
> Useful for PHY that supports hardware strapped configuration, enabling
> Linux to respect that configuration (i.e. strapped non-autoneg
> configuration).
> 
> Signed-off-by: Esben Haabendal <eha@deif.com>
> Cc: Rasmus Villemoes <rasmus.villemoes@prevas.dk>
> ---
>  drivers/net/phy/phy_device.c | 41 +++++++++++++++++++++++++++++++++++++++++
>  include/linux/phy.h          |  1 +
>  2 files changed, 42 insertions(+)
> 
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 74664a6c0cdc..cc52ff2a2344 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1673,6 +1673,47 @@ int genphy_config_init(struct phy_device *phydev)
>  }
>  EXPORT_SYMBOL(genphy_config_init);
>  
> +/**
> + * genphy_read_config - read configuration from PHY
> + * @phydev: target phy_device struct
> + *
> + * Description: Reads MII_BMCR and sets phydev autoneg, speed and duplex
> + * accordingly.  For use in driver probe functions, to respect strapped
> + * configuration settings.
> + */
> +int genphy_read_config(struct phy_device *phydev)

This duplicates what already exists, in part at least within
genphy_read_status() can you find a way to use that?

I really wonder how this is going to work though because an user can
decide to force the PHY to have auto-negotiation disabled just like a
MAC could actually attempt to do that while connecting to the PHY...
more comments in patch 2.
-- 
Florian

  parent reply	other threads:[~2018-04-05 16:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-05 11:44 [PATCH 1/2] net: phy: Helper function for reading strapped configuration values esben.haabendal
2018-04-05 11:44 ` [PATCH 2/2] net: phy: dp83640: Read strapped configuration settings esben.haabendal
2018-04-05 16:02   ` Florian Fainelli
2018-04-05 20:30     ` Esben Haabendal
2018-04-05 20:40       ` Andrew Lunn
2018-04-06  2:24         ` David Miller
2018-04-06 11:05           ` Esben Haabendal
2018-04-05 20:34     ` Esben Haabendal
2018-04-05 16:00 ` Florian Fainelli [this message]
2018-04-05 20:18   ` [PATCH 1/2] net: phy: Helper function for reading strapped configuration values Esben Haabendal
2018-04-05 20:34   ` Esben Haabendal

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=49448b00-e3fd-25df-580e-c02428f1bfe6@gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=eha@deif.com \
    --cc=esben.haabendal@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rasmus.villemoes@prevas.dk \
    /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.