mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dan Murphy <dmurphy@ti.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <davem@davemloft.net>, <f.fainelli@gmail.com>,
	<hkallweit1@gmail.com>, <mkubecek@suse.cz>,
	<netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/3] net: dp83869: Add ability to advertise Fiber connection
Date: Thu, 17 Sep 2020 09:57:36 -0500	[thread overview]
Message-ID: <44ee56f6-fd72-b479-3b96-7565a439e4bc@ti.com> (raw)
In-Reply-To: <20200916221313.GI3526428@lunn.ch>

Andrew

On 9/16/20 5:13 PM, Andrew Lunn wrote:
> On Wed, Sep 16, 2020 at 03:54:34PM -0500, Dan Murphy wrote:
>> Andrew
>>
>> On 9/15/20 3:17 PM, Andrew Lunn wrote:
>>>> +		linkmode_set_bit(ETHTOOL_LINK_MODE_100baseFX_Full_BIT,
>>>> +				 phydev->supported);
>>>> +		linkmode_set_bit(ETHTOOL_LINK_MODE_100baseFX_Half_BIT,
>>>> +				 phydev->supported);
>>>> +
>>>> +		/* Auto neg is not supported in 100base FX mode */
>>> Hi Dan
>>>
>>> If it does not support auto neg, how do you decide to do half duplex?
>>> I don't see any code here which allows the user to configure it.
>> Ethtool has the provisions to set the duplex and speed right?.
> What i'm getting at is you say you support
> ETHTOOL_LINK_MODE_100baseFX_Full_BIT &
> ETHTOOL_LINK_MODE_100baseFX_Half_BIT. If there is no auto neg in FX
> mode, i'm questioning how these two different modes code be used? I'm
> guessing the PHY defaults to ETHTOOL_LINK_MODE_100baseFX_Full_BIT? How
> does the user set it to ETHTOOL_LINK_MODE_100baseFX_Half_BIT?

The user can use ethtool to set the speed and duplex. And ethtool uses 
the IOCTLs to configure the device.

So if the user creates their own HAL then they can use those IOCTLs as well.

The data sheet indicates

"In fiber mode, the speed is not
decided through auto-negotiation. Both sides of the link must be 
configured to the same operating speed."

>
>> The only call back I see which is valid is config_aneg which would still
>> require a user space tool to set the needed link modes.
> Correct. Maybe all you need to do is point me at the code in the
> driver which actually sets the PHY into half duplex in FX mode when
> the user asks for it. Is it just clearing BMCR_FULLDPLX?

Here is the full flow when setting the speed and duplex mode from the 
Ethtool or when the IOCTL's are called to update the PHY

phy_ethtool_ksettings_set updates the phydev->speed and phydev->duplex

Since Auto Neg is disabled the call to genphy_setup_forced is done in 
the __genphy_config_aneg in phy_device.

genphy_setup_forced updates the BMCR with the updated values.

So IMO there is no need to populate the config_aneg call back to

root@am335x-evm:~# ./ethtool -s eth0 speed 10 duplex half
[   92.098491] phy_ethtool_ksettings_set
[   92.102247] phy_ethtool_ksettings_set: speed 10 duplex 0
[   92.107755] phy_sanitize_settings
[   92.111085] phy_config_aneg
[   92.113930] genphy_config_aneg
[   92.116997] __genphy_config_aneg
[   92.120237] genphy_setup_forced
[   92.123419] genphy_setup_forced: Update the BMCR
root@am335x-evm:~# ./ethtool -s eth0 speed 100 duplex full
[  102.693105] phy_ethtool_ksettings_set
[  102.697029] phy_ethtool_ksettings_set: speed 100 duplex 1
[  102.702462] phy_sanitize_settings
[  102.705892] phy_config_aneg
[  102.708702] genphy_config_aneg
[  102.711770] __genphy_config_aneg
[  102.715051] genphy_setup_forced
[  102.718209] genphy_setup_forced: Update the BMCR

I am hoping this answers your question.

Dan


  reply	other threads:[~2020-09-17 19:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-15 18:17 [PATCH net-next 0/3] 100base Fx link modes Dan Murphy
2020-09-15 18:17 ` [PATCH net-next 1/3] ethtool: Add 100base-FX link mode entries Dan Murphy
2020-09-15 20:10   ` Andrew Lunn
2020-09-15 23:26     ` Dan Murphy
2020-09-15 20:21   ` Andrew Lunn
2020-09-15 23:29     ` Dan Murphy
2020-09-17 15:03       ` Dan Murphy
2020-09-15 18:17 ` [PATCH net-next 2/3] net: dp83869: Add ability to advertise Fiber connection Dan Murphy
2020-09-15 20:17   ` Andrew Lunn
2020-09-16 20:54     ` Dan Murphy
2020-09-16 22:13       ` Andrew Lunn
2020-09-17 14:57         ` Dan Murphy [this message]
2020-09-15 18:17 ` [PATCH net-next 3/3] net: phy: dp83822: Update the fiber advertisement for speed 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=44ee56f6-fd72-b479-3b96-7565a439e4bc@ti.com \
    --to=dmurphy@ti.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkubecek@suse.cz \
    --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

all inboxes | Powered by JetHome®