Re: [PATCH net-next 08/30] net: dsa: mt7530: change p{5,6}_interface to p{5,6}_configured

Arınç ÜNAL
2023-06-03T12:17:27Z

On 26.05.2023 16:01, Vladimir Oltean wrote:
> On Thu, May 25, 2023 at 09:49:58AM +0300, Arınç ÜNAL wrote:
>> On 24.05.2023 20:51, Vladimir Oltean wrote:
>>> On Mon, May 22, 2023 at 03:15:10PM +0300, arinc9.unal@gmail.com wrote:
>>>> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
>>>> index 710c6622d648..d837aa20968c 100644
>>>> --- a/drivers/net/dsa/mt7530.c
>>>> +++ b/drivers/net/dsa/mt7530.c
>>>> @@ -2728,25 +2722,20 @@ mt753x_phylink_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
>>>> goto unsupported;
>>>> break;
>>>> case 5: /* Port 5, can be used as a CPU port. */
>>>> - if (priv->p5_interface == state->interface)
>>>> + if (priv->p5_configured)
>>>> break;
>>>> if (mt753x_mac_config(ds, port, mode, state) < 0)
>>>> goto unsupported;
>>>> -
>>>> - if (priv->p5_intf_sel != P5_DISABLED)
>>>> - priv->p5_interface = state->interface;
>>>
>>> If you don't replace this bit with anything, who will set priv->p5_configured
>>> for mt7530?
>>
>> I intend priv->p5_configured and priv->p6_configured to be only used for
>> MT7531 as I have stated on the mt7530_priv description.
>
> Ok, but given the premise of this patch set, that phylink is always available,
> does it make sense for mt7531_cpu_port_config() and mt7988_cpu_port_config()
> to manually call phylink methods?

All I know is that that's how the implementation of phylink's PCS
support in this driver works. It expects the MAC to be set up before
calling mt753x_phylink_pcs_link_up() and mt753x_phylink_mac_link_up().

Arınç