Re: [PATCH 5/8] net: ethernet: ti: am65-cpsw: Add support for fixed-link configuration

From: Siddharth Vadapalli
Date: Thu Sep 15 2022 - 04:59:46 EST


Hello Russell,

On 14/09/22 21:11, Russell King (Oracle) wrote:
> On Wed, Sep 14, 2022 at 03:20:50PM +0530, Siddharth Vadapalli wrote:
>> diff --git a/drivers/net/ethernet/ti/am65-cpsw-nuss.c b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> index 72b1df12f320..1739c389af20 100644
>> --- a/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> +++ b/drivers/net/ethernet/ti/am65-cpsw-nuss.c
>> @@ -1494,10 +1494,50 @@ static void am65_cpsw_nuss_mac_config(struct phylink_config *config, unsigned in
>> phylink_config);
>> struct am65_cpsw_port *port = container_of(slave, struct am65_cpsw_port, slave);
>> struct am65_cpsw_common *common = port->common;
>> + struct fwnode_handle *fwnode;
>> + bool fixed_link = false;
>>
>> if (common->pdata.extra_modes & BIT(state->interface))
>> writel(AM65_CPSW_SGMII_CONTROL_MR_AN_ENABLE,
>> port->sgmii_base + AM65_CPSW_SGMII_CONTROL_REG);
>> +
>> + /* Detecting fixed-link */
>> + fwnode = of_node_to_fwnode(port->slave.phy_node);
>> + if (fwnode)
>> + fixed_link = !!fwnode_get_named_child_node(fwnode, "fixed-link");
>> +
>> + if (fixed_link) {
>> + /* In fixed-link mode, mac_link_up is not invoked.
>> + * Therefore, the relevant mac_link_up operations
>> + * have to be moved to mac_config.
>> + */
>
> This seems very wrong. Why is mac_link_up() not invoked? Have you
> debugged this? It works for other people.
>
> Please debug rather than adding hacks to drivers when you find
> things that don't seem to work.

I will debug and find out. I had assumed that mac_link_up() is not
invoked in fixed-link mode. Thank you for clarifying.

Regards,
Siddharth.