Hi Marek, On Sat, 17 Aug 2019 20:15:52 +0200, Marek Behun <marek.be...@nic.cz> wrote: > On Sat, 17 Aug 2019 20:03:42 +0200 > Marek Behun <marek.be...@nic.cz> wrote: > > > One way would be to rename the mv88e6xxx_setup_port function to > > mv88e6xxx_setup_port_regs, or mv88e6xxx_port_pre_setup, or something > > like that. Would the names mv88e6xxx_port_setup and > > mv88e6xxx_setup_port_regs still be very confusing and error prone? > > I think maybe yes... > > > > Other solution would be to, instead of the .port_setup() > > and .port_teardown() DSA ops, create the .after_setup() > > and .before_teardown() ops I mentioned in the previous mail. > > > > And yet another (in my opinion very improper) solution could be that > > the .setup() method could call dsa_port_setup() from within itself, to > > ensure that the needed structres exist. > > I thought of another solution, one that does not need new DSA > operations. What if dsa_port_enable was called for CPU/DSA ports after > in dsa_port_setup_switches, after all ports are setup, and > dsa_port_disable called for CPU/DSA ports in dsa_port_teardown_switches? > > This seems to me as cleaner solution. > > Marek
Yes DSA needs to initialize a switch before its ports, but the driver may need the opposite. Splitting the switch and ports setup and moving it up to the DSA stack is a separate topic in fact that I'll handle soon. I guess you meant dsa_tree_setup_switches instead of dsa_port_setup_switches. Let's call dsa_port_enable/dsa_port_disable for the CPU and DSA ports as well. Thanks, Vivien