linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dsa: mt7530: correct ds->num_ports
@ 2021-10-16  6:24 DENG Qingfang
  2021-10-17  2:36 ` Florian Fainelli
  2021-10-18 12:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 6+ messages in thread
From: DENG Qingfang @ 2021-10-16  6:24 UTC (permalink / raw)
  To: Sean Wang, Landen Chao, Andrew Lunn, Vivien Didelot,
	Florian Fainelli, Vladimir Oltean, David S. Miller,
	Jakub Kicinski, Matthias Brugger, Philipp Zabel, Russell King,
	netdev, linux-arm-kernel, linux-mediatek, linux-kernel
  Cc: stable

Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
dsa_port's and call mt7530_port_disable for non-existent ports.

Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
port_enable/disable is no longer required.

Cc: stable@vger.kernel.org
Signed-off-by: DENG Qingfang <dqfext@gmail.com>
---
 drivers/net/dsa/mt7530.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
index a3b49abd32f1..dbd15da977b5 100644
--- a/drivers/net/dsa/mt7530.c
+++ b/drivers/net/dsa/mt7530.c
@@ -1035,9 +1035,6 @@ mt7530_port_enable(struct dsa_switch *ds, int port,
 {
 	struct mt7530_priv *priv = ds->priv;
 
-	if (!dsa_is_user_port(ds, port))
-		return 0;
-
 	mutex_lock(&priv->reg_mutex);
 
 	/* Allow the user port gets connected to the cpu port and also
@@ -1060,9 +1057,6 @@ mt7530_port_disable(struct dsa_switch *ds, int port)
 {
 	struct mt7530_priv *priv = ds->priv;
 
-	if (!dsa_is_user_port(ds, port))
-		return;
-
 	mutex_lock(&priv->reg_mutex);
 
 	/* Clear up all port matrix which could be restored in the next
@@ -3265,7 +3259,7 @@ mt7530_probe(struct mdio_device *mdiodev)
 		return -ENOMEM;
 
 	priv->ds->dev = &mdiodev->dev;
-	priv->ds->num_ports = DSA_MAX_PORTS;
+	priv->ds->num_ports = MT7530_NUM_PORTS;
 
 	/* Use medatek,mcm property to distinguish hardware type that would
 	 * casues a little bit differences on power-on sequence.
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: mt7530: correct ds->num_ports
  2021-10-16  6:24 [PATCH net] net: dsa: mt7530: correct ds->num_ports DENG Qingfang
@ 2021-10-17  2:36 ` Florian Fainelli
  2021-10-18  8:42   ` DENG Qingfang
  2021-10-18 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2021-10-17  2:36 UTC (permalink / raw)
  To: DENG Qingfang, Sean Wang, Landen Chao, Andrew Lunn,
	Vivien Didelot, Vladimir Oltean, David S. Miller, Jakub Kicinski,
	Matthias Brugger, Philipp Zabel, Russell King, netdev,
	linux-arm-kernel, linux-mediatek, linux-kernel
  Cc: stable



On 10/15/2021 11:24 PM, DENG Qingfang wrote:
> Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
> dsa_port's and call mt7530_port_disable for non-existent ports.
> 
> Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
> port_enable/disable is no longer required.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: DENG Qingfang <dqfext@gmail.com>

Do you really want to target the net tree for this change?
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: mt7530: correct ds->num_ports
  2021-10-17  2:36 ` Florian Fainelli
@ 2021-10-18  8:42   ` DENG Qingfang
  2021-10-18 16:22     ` Florian Fainelli
  0 siblings, 1 reply; 6+ messages in thread
From: DENG Qingfang @ 2021-10-18  8:42 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Sean Wang, Landen Chao, Andrew Lunn, Vivien Didelot,
	Vladimir Oltean, David S. Miller, Jakub Kicinski,
	Matthias Brugger, Philipp Zabel, Russell King, netdev,
	linux-arm-kernel, linux-mediatek, linux-kernel, stable

On Sat, Oct 16, 2021 at 07:36:14PM -0700, Florian Fainelli wrote:
> On 10/15/2021 11:24 PM, DENG Qingfang wrote:
> > Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
> > dsa_port's and call mt7530_port_disable for non-existent ports.
> > 
> > Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
> > port_enable/disable is no longer required.
> > 
> > Cc: stable@vger.kernel.org
> > Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> 
> Do you really want to target the net tree for this change?

Yes because I consider this a bug fix.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: mt7530: correct ds->num_ports
  2021-10-16  6:24 [PATCH net] net: dsa: mt7530: correct ds->num_ports DENG Qingfang
  2021-10-17  2:36 ` Florian Fainelli
@ 2021-10-18 12:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 6+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-10-18 12:40 UTC (permalink / raw)
  To: DENG Qingfang
  Cc: sean.wang, Landen.Chao, andrew, vivien.didelot, f.fainelli,
	olteanv, davem, kuba, matthias.bgg, p.zabel, linux, netdev,
	linux-arm-kernel, linux-mediatek, linux-kernel, stable

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Sat, 16 Oct 2021 14:24:14 +0800 you wrote:
> Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
> dsa_port's and call mt7530_port_disable for non-existent ports.
> 
> Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
> port_enable/disable is no longer required.
> 
> Cc: stable@vger.kernel.org
> Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> 
> [...]

Here is the summary with links:
  - [net] net: dsa: mt7530: correct ds->num_ports
    https://git.kernel.org/netdev/net/c/342afce10d6f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: mt7530: correct ds->num_ports
  2021-10-18  8:42   ` DENG Qingfang
@ 2021-10-18 16:22     ` Florian Fainelli
  2021-10-19  5:59       ` Greg KH
  0 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2021-10-18 16:22 UTC (permalink / raw)
  To: DENG Qingfang
  Cc: Sean Wang, Landen Chao, Andrew Lunn, Vivien Didelot,
	Vladimir Oltean, David S. Miller, Jakub Kicinski,
	Matthias Brugger, Philipp Zabel, Russell King, netdev,
	linux-arm-kernel, linux-mediatek, linux-kernel, stable

On 10/18/21 1:42 AM, DENG Qingfang wrote:
> On Sat, Oct 16, 2021 at 07:36:14PM -0700, Florian Fainelli wrote:
>> On 10/15/2021 11:24 PM, DENG Qingfang wrote:
>>> Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
>>> dsa_port's and call mt7530_port_disable for non-existent ports.
>>>
>>> Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
>>> port_enable/disable is no longer required.
>>>
>>> Cc: stable@vger.kernel.org
>>> Signed-off-by: DENG Qingfang <dqfext@gmail.com>
>>
>> Do you really want to target the net tree for this change?
> 
> Yes because I consider this a bug fix.


OK, why not provide a Fixes tag to help with targeting the back port
then? This has been applied anyway, so hopefully the auto selection will
do its job and tell you where it stops applying cleanly.
-- 
Florian

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH net] net: dsa: mt7530: correct ds->num_ports
  2021-10-18 16:22     ` Florian Fainelli
@ 2021-10-19  5:59       ` Greg KH
  0 siblings, 0 replies; 6+ messages in thread
From: Greg KH @ 2021-10-19  5:59 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: DENG Qingfang, Sean Wang, Landen Chao, Andrew Lunn,
	Vivien Didelot, Vladimir Oltean, David S. Miller, Jakub Kicinski,
	Matthias Brugger, Philipp Zabel, Russell King, netdev,
	linux-arm-kernel, linux-mediatek, linux-kernel, stable

On Mon, Oct 18, 2021 at 09:22:49AM -0700, Florian Fainelli wrote:
> On 10/18/21 1:42 AM, DENG Qingfang wrote:
> > On Sat, Oct 16, 2021 at 07:36:14PM -0700, Florian Fainelli wrote:
> >> On 10/15/2021 11:24 PM, DENG Qingfang wrote:
> >>> Setting ds->num_ports to DSA_MAX_PORTS made DSA core allocate unnecessary
> >>> dsa_port's and call mt7530_port_disable for non-existent ports.
> >>>
> >>> Set it to MT7530_NUM_PORTS to fix that, and dsa_is_user_port check in
> >>> port_enable/disable is no longer required.
> >>>
> >>> Cc: stable@vger.kernel.org
> >>> Signed-off-by: DENG Qingfang <dqfext@gmail.com>
> >>
> >> Do you really want to target the net tree for this change?
> > 
> > Yes because I consider this a bug fix.
> 
> 
> OK, why not provide a Fixes tag to help with targeting the back port
> then? This has been applied anyway, so hopefully the auto selection will
> do its job and tell you where it stops applying cleanly.

Without a "Fixes:" tag, I just backport things as far are they are easy
to go and then stop without an email saying anything fails on older
kernels.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-19  5:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-16  6:24 [PATCH net] net: dsa: mt7530: correct ds->num_ports DENG Qingfang
2021-10-17  2:36 ` Florian Fainelli
2021-10-18  8:42   ` DENG Qingfang
2021-10-18 16:22     ` Florian Fainelli
2021-10-19  5:59       ` Greg KH
2021-10-18 12:40 ` patchwork-bot+netdevbpf

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).