Linux-mediatek Archive mirror
 help / color / mirror / Atom feed
From: "Arınç ÜNAL" <arinc.unal@arinc9.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Daniel Golle <daniel@makrotopia.org>,
	DENG Qingfang <dqfext@gmail.com>,
	Sean Wang <sean.wang@mediatek.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Vladimir Oltean <olteanv@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: dsa: mt7530: do not set MT7530_P5_DIS when PHY muxing is being used
Date: Sat, 27 Apr 2024 18:43:03 +0300	[thread overview]
Message-ID: <5acf02b1-8af4-4259-9ce1-c7c7ae00ae9d@arinc9.com> (raw)
In-Reply-To: <7c476e63-5747-4128-af97-13edc252a263@lunn.ch>

On 27.04.2024 16:31, Andrew Lunn wrote:
> On Sat, Apr 27, 2024 at 02:24:42PM +0300, Arınç ÜNAL via B4 Relay wrote:
>> From: Arınç ÜNAL <arinc.unal@arinc9.com>
>>
>> When the PHY muxing feature is in use, port 5 won't be defined in the
>> device tree. Because of this, the type member of the dsa_port structure for
>> this port will be assigned DSA_PORT_TYPE_UNUSED. The dsa_port_setup()
>> function calls ds->ops->port_disable() when the port type is
>> DSA_PORT_TYPE_UNUSED.
>>
>> The MT7530_P5_DIS bit is unset when PHY muxing is being used.
>> mt7530_port_disable() which is assigned to ds->ops->port_disable() is
>> called afterwards. Currently, mt7530_port_disable() sets MT7530_P5_DIS
>> which breaks network connectivity when PHY muxing is being used.
>>
>> Therefore, do not set MT7530_P5_DIS when PHY muxing is being used.
>>
>> Fixes: 377174c5760c ("net: dsa: mt7530: move MT753X_MTRAP operations for MT7530")
>> Reported-by: Daniel Golle <daniel@makrotopia.org>
>> Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
>> ---
>> Hello.
>>
>> I've sent this to net-next as the patch it fixes is on the current
>> development cycle.
>> ---
>>   drivers/net/dsa/mt7530.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
>> index 2b9f904a98f0..07b6da3ae97c 100644
>> --- a/drivers/net/dsa/mt7530.c
>> +++ b/drivers/net/dsa/mt7530.c
>> @@ -1220,7 +1220,7 @@ mt7530_port_disable(struct dsa_switch *ds, int port)
>>   	if (priv->id != ID_MT7530 && priv->id != ID_MT7621)
>>   		return;
>>   
>> -	if (port == 5)
>> +	if (port == 5 && priv->p5_mode == GMAC5)
>>   		mt7530_set(priv, MT753X_MTRAP, MT7530_P5_DIS);
> 
> 
> It might be worth a comment. It is not obvious that
> priv->p5_mode == GMAC5 means the PHY MUX is being used.
> mt7530_setup_port5() thinks it is sufficiently obscure that
> it comments each case.

priv->p5_mode == GMAC5 means PHY muxing is not being used. That is why
MT7530_P5_DIS is set when priv->p5_mode is GMAC5. Anyway, I believe this
proves your point.

Arınç


      reply	other threads:[~2024-04-27 15:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-27 11:24 [PATCH net-next] net: dsa: mt7530: do not set MT7530_P5_DIS when PHY muxing is being used Arınç ÜNAL via B4 Relay
2024-04-27 13:31 ` Andrew Lunn
2024-04-27 15:43   ` Arınç ÜNAL [this message]

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=5acf02b1-8af4-4259-9ce1-c7c7ae00ae9d@arinc9.com \
    --to=arinc.unal@arinc9.com \
    --cc=andrew@lunn.ch \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=daniel@makrotopia.org \
    --cc=davem@davemloft.net \
    --cc=dqfext@gmail.com \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=sean.wang@mediatek.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 read-only IMAP folder(s) and NNTP newsgroup(s).