mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "lipeng (Y)" <lipeng321@huawei.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: <davem@davemloft.net>, <netdev@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>, <linuxarm@huawei.com>,
	<yisen.zhuang@huawei.com>, <salil.mehta@huawei.com>
Subject: Re: [PATCH NET 3/3] net: hns: add configuration constraints for 1000M half
Date: Sat, 25 Aug 2018 09:21:55 +0800	[thread overview]
Message-ID: <7c40c758-2ef2-665d-f429-0cc4e63a7a38@huawei.com> (raw)
In-Reply-To: <20180824132857.GA1999@lunn.ch>



On 2018/8/24 21:28, Andrew Lunn wrote:
> On Fri, Aug 24, 2018 at 02:39:36PM +0800, lipeng (Y) wrote:
>>
>> On 2018/8/24 11:41, Andrew Lunn wrote:
>>> On Fri, Aug 24, 2018 at 11:42:23AM +0800, Peng Li wrote:
>>>> Hisilicon hip05 and hip06 board network card do not support
>>>> 1000M half configuration. Driver can not config gmac as
>>>> 1000M half.
>>>>
>>>> Signed-off-by: Peng Li <lipeng321@huawei.com>
>>> Hi Peng
>>>
>>> Does the driver remove SUPPORTED_1000baseT_Half from
>>> phydev->supported?  If you do that, the PHY should never negotiate
>>> this speed.
>>>
>>>     Andrew
>> Hi, Andrew,
>>
>> The driver has removed SUPPORTED_1000baseT_Half from
>>
>> phydev->supported.
>>
>> the code is :
>> #define MAC_GMAC_SUPPORTED \
>> 	(SUPPORTED_10baseT_Half \
>> 	| SUPPORTED_10baseT_Full \
>> 	| SUPPORTED_100baseT_Half \
>> 	| SUPPORTED_100baseT_Full \
>> 	| SUPPORTED_Autoneg)
>>   h->if_support = MAC_GMAC_SUPPORTED;
>>   h->if_support |= SUPPORTED_1000baseT_Full;
>> phydev->supported &= h->if_support;
>>
>> As gmac do not support 1000M half, we add this patch to
>> make sure that no users can set 1000M half in any case.
> Well, not quite. What this patch does is protect the hardware when it
> is asked to change to an unsupported mode. This patch has nothing to
> do with user APIs.
>
> The user API for setting link modes is hns_nic_set_link_ksettings().
>
> What you do have is
>
>                  if (speed == SPEED_1000 && cmd->base.duplex == DUPLEX_HALF)
>                          return -EINVAL;
>
> which should stop somebody setting up a fixed speed link at 1000Half.
>
> But you don't do anything with cmd->link_modes.advertising. However,
> when you call phy_ethtool_ksettings_set(), it gets AND'ed with
> phydev->supported, which you have already removed 1000Half from.
>
> So is this a patch for a theoretical problem? Or have you seen it
> happen? If it did happen, how did the user configure it to cause this
> problem? That user API needs to prevent it.
>
> 	 Andrew
Hi,  Andrew,

HW  do not support 1000M half, and the driver has done the 2 things:
1, remove SUPPORTED_1000baseT_Half from phydev->supported.
2,   add the protect in  hns_nic_set_link_ksettings().

This patch is a  theoretical protect, and the problem does not really  
happen.

I think you really get the point, do you think we need this patch?

Thanks
> .
>



  reply	other threads:[~2018-08-25  1:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24  3:42 [PATCH net 0/3] net: hns: fix some bugs about speed and duplex change Peng Li
2018-08-24  3:42 ` [PATCH NET 1/3] net: hns: add the code for cleaning pkt in chip Peng Li
2018-08-24  3:42 ` [PATCH NET 2/3] net: hns: add netif_carrier_off before change speed and duplex Peng Li
2018-08-24  3:42 ` [PATCH NET 3/3] net: hns: add configuration constraints for 1000M half Peng Li
2018-08-24  3:41   ` Andrew Lunn
2018-08-24  6:39     ` lipeng (Y)
2018-08-24 13:28       ` Andrew Lunn
2018-08-25  1:21         ` lipeng (Y) [this message]
2018-08-25 18:07           ` Andrew Lunn
2018-08-27  1:08             ` lipeng (Y)

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=7c40c758-2ef2-665d-f429-0cc4e63a7a38@huawei.com \
    --to=lipeng321@huawei.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=yisen.zhuang@huawei.com \
    /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®