netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Murali Karicheri <m-karicheri2@ti.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: mark.rutland@arm.com, devicetree@vger.kernel.org,
	malat@debian.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org, w-kwok2@ti.com, robh+dt@kernel.org,
	ssantosh@kernel.org, davem@davemloft.net,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [net-next PATCH v2 03/10] net: netcp: ethss: make call to gbe_sgmii_config() conditional
Date: Tue, 27 Mar 2018 15:39:47 -0400	[thread overview]
Message-ID: <1ef3864e-1cb7-ddf1-d03d-9c937736616f@ti.com> (raw)
In-Reply-To: <20180327171817.GO5862@lunn.ch>

On 03/27/2018 01:18 PM, Andrew Lunn wrote:
> On Tue, Mar 27, 2018 at 12:31:42PM -0400, Murali Karicheri wrote:
>> As a preparatory patch to add support for 2u cpsw hardware found on
>> K2G SoC, make call to gbe_sgmii_config() conditional. This is required
>> since 2u uses RGMII interface instead of SGMII and to allow for driver
>> re-use.
>>
>> Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
>> ---
>>  drivers/net/ethernet/ti/netcp_ethss.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/ti/netcp_ethss.c b/drivers/net/ethernet/ti/netcp_ethss.c
>> index 56dbc0b..1dea891 100644
>> --- a/drivers/net/ethernet/ti/netcp_ethss.c
>> +++ b/drivers/net/ethernet/ti/netcp_ethss.c
>> @@ -2271,7 +2271,8 @@ static int gbe_slave_open(struct gbe_intf *gbe_intf)
>>  
>>  	void (*hndlr)(struct net_device *) = gbe_adjust_link;
>>  
>> -	gbe_sgmii_config(priv, slave);
>> +	if ((priv->ss_version == GBE_SS_VERSION_14) || IS_SS_ID_NU(priv))
>> +		gbe_sgmii_config(priv, slave);
> 
> Or maybe:
> 
>    if (slave->phy_node == PHY_INTERFACE_MODE_SGMII)
>    	gbe_sgmii_config(priv, slave);

Yeah. Based on my response to your other comment, this would become

if ((slave->link_interface == SGMII_LINK_MAC_PHY) &&
    (IS_SS_ID_VER_14(priv) || IS_SS_ID_NU(priv)))
	gbe_sgmii_config(priv, slave);

We can't solely depends on phy_mode here. Phy interface is one of several
interface possible. There is MAC_TO_MAC_FORCED, NO_MDIO etc. So we check the
link_interface above.

If we can agree, here is what will appear in v3

1) Add another patch to do conversion of priv->ss_version == GBE_SS_VERSION_14 check 
with a macro, IS_SS_ID_VER_14
2) modify this patch as above.

Murali
> 
> 	Andrew
> 


-- 
Murali Karicheri
Linux Kernel, Keystone

  reply	other threads:[~2018-03-27 19:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-27 16:31 [net-next PATCH v2 00/10] Add support for netcp driver on K2G SoC Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 01/10] soc: ti: K2G: enhancement to support QMSS in NSS Murali Karicheri
2018-03-28 19:01   ` [net-next,v2,01/10] " Grygorii Strashko
2018-03-29 14:50     ` [net-next, v2, 01/10] " Murali Karicheri
2018-03-29 14:59     ` [net-next,v2,01/10] " Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 02/10] soc: ti: K2G: provide APIs to support driver probe deferral Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 03/10] net: netcp: ethss: make call to gbe_sgmii_config() conditional Murali Karicheri
2018-03-27 17:13   ` Andrew Lunn
2018-03-27 19:20     ` Murali Karicheri
2018-03-27 17:18   ` Andrew Lunn
2018-03-27 19:39     ` Murali Karicheri [this message]
2018-03-29 16:27     ` Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 04/10] net: netcp: ethss: add support for handling sgmii link interface Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 05/10] net: netcp: ethss: use rgmii link status for 2u cpsw hardware Murali Karicheri
2018-03-27 17:29   ` Andrew Lunn
2018-03-27 21:07     ` Murali Karicheri
2018-03-29 16:35     ` Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 06/10] net: netcp: ethss: map vlan priorities to zero flow Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 07/10] net: netcp: ethss: re-use stats handling code for 2u hardware Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 08/10] net: netcp: ethss: use of_get_phy_mode() to support different RGMII modes Murali Karicheri
2018-03-27 17:35   ` Andrew Lunn
2018-03-29 20:03     ` Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 09/10] Revert "net: netcp: remove dead code from the driver" Murali Karicheri
2018-03-27 16:31 ` [net-next PATCH v2 10/10] net: netcp: support probe deferral Murali Karicheri

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=1ef3864e-1cb7-ddf1-d03d-9c937736616f@ti.com \
    --to=m-karicheri2@ti.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=malat@debian.org \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=w-kwok2@ti.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;
as well as URLs for NNTP newsgroup(s).