netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@gmail.com>
To: Marek Behun <marek.behun@nic.cz>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	f.fainelli@gmail.com, andrew@lunn.ch
Subject: Re: [PATCH net-next 3/6] net: dsa: enable and disable all ports
Date: Mon, 19 Aug 2019 14:03:47 -0400	[thread overview]
Message-ID: <20190819140347.GB1227@t480s.localdomain> (raw)
In-Reply-To: <20190819193246.0e40a1d4@nic.cz>

Hi Marek,

On Mon, 19 Aug 2019 19:32:46 +0200, Marek Behun <marek.behun@nic.cz> wrote:
> > Call the .port_enable and .port_disable functions for all ports,
> > not only the user ports, so that drivers may optimize the power
> > consumption of all ports after a successful setup.
> > 
> > Unused ports are now disabled on setup. CPU and DSA ports are now
> > enabled on setup and disabled on teardown. User ports were already
> > enabled at slave creation and disabled at slave destruction.
> 
> My original reason for enabling CPU and DSA ports is that enabling
> serdes irq could not be done in .setup in mv88e6xxx, since the required
> phylink structures did not yet exists for those ports.
> 
> The case after this patch would be that .port_enable is called for
> CPU/DSA ports right after these required phylink structures are created
> for this port. A thought came to me while reading this that some driver
> in the future can expect, in their implementation of
> port_enable/port_disable, that phylink structures already exist for all
> ports, not just the one being currently enabled/disabled.
> 
> Wouldn't it be safer if CPU/DSA ports were enabled in setup after all
> ports are registered, and disabled in teardown before ports are
> unregistered?
> 
> Current:
>   ->setup()
>   for each port
>       dsa_port_link_register_of()
>       dsa_port_enable()
> 
> Proposed:
>   ->setup()
>   for each port
>       dsa_port_link_register_of()
>   for each port
>       dsa_port_enable()

I understand what you mean, but the scope of .port_enable really is the
port itself, so I do not expect a driver to configure something else. Also,
I prefer to keep it simple at the moment and not speculate about what a
driver may need in the future, as we may also wonder which switch must be
enabled first in a tree, etc. If that case happens in the future, we can
definitely isolate the ports enabling code after the tree is setup.

So if this series meets your requirement for now, I'd keep it like that.


Thanks,

	Vivien

  reply	other threads:[~2019-08-19 18:03 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-18 17:35 [PATCH net-next 0/6] net: dsa: enable and disable all ports Vivien Didelot
2019-08-18 17:35 ` [PATCH net-next 1/6] net: dsa: use a single switch statement for port setup Vivien Didelot
2019-08-19 17:14   ` Florian Fainelli
2019-08-19 17:20     ` Vivien Didelot
2019-08-18 17:35 ` [PATCH net-next 2/6] net: dsa: do not enable or disable non user ports Vivien Didelot
2019-08-19 17:16   ` Florian Fainelli
2019-08-18 17:35 ` [PATCH net-next 3/6] net: dsa: enable and disable all ports Vivien Didelot
2019-08-19 17:17   ` Florian Fainelli
2019-08-19 17:32   ` Marek Behun
2019-08-19 18:03     ` Vivien Didelot [this message]
2019-08-18 17:35 ` [PATCH net-next 4/6] net: dsa: mv88e6xxx: do not change STP state on port disabling Vivien Didelot
2019-08-19 13:40   ` Andrew Lunn
2019-08-19 15:27     ` Vivien Didelot
2019-08-19 16:10       ` Andrew Lunn
2019-08-19 16:27         ` Vivien Didelot
2019-08-19 16:44           ` Andrew Lunn
2019-08-18 17:35 ` [PATCH net-next 5/6] net: dsa: mv88e6xxx: enable SERDES after setup Vivien Didelot
2019-08-18 17:35 ` [PATCH net-next 6/6] net: dsa: mv88e6xxx: wrap SERDES IRQ in power function Vivien Didelot
2019-08-19 20:11 ` [PATCH net-next 0/6] net: dsa: enable and disable all ports David Miller

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=20190819140347.GB1227@t480s.localdomain \
    --to=vivien.didelot@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=marek.behun@nic.cz \
    --cc=netdev@vger.kernel.org \
    /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).