Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-31 Thread Vladimir Oltean
On Fri, Mar 26, 2021 at 02:57:20PM +0200, Vladimir Oltean wrote: > Hi Tobias, > > On Fri, Mar 26, 2021 at 11:56:47AM +0100, Tobias Waldekranz wrote: > > } else { > > - dst->tag_ops = dsa_tag_driver_get(tag_protocol); > > - if (IS_ERR(dst->tag_ops)) { > > -

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-29 Thread Vladimir Oltean
On Mon, Mar 29, 2021 at 12:04:39AM +0200, Andrew Lunn wrote: > On Mon, Mar 29, 2021 at 12:53:09AM +0300, Vladimir Oltean wrote: > > On Sun, Mar 28, 2021 at 05:52:43PM +0200, Andrew Lunn wrote: > > > > +static int dsa_switch_setup_tag_protocol(struct dsa_switch *ds) > > > > +{ > > > > + const

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-28 Thread Andrew Lunn
On Mon, Mar 29, 2021 at 12:53:09AM +0300, Vladimir Oltean wrote: > On Sun, Mar 28, 2021 at 05:52:43PM +0200, Andrew Lunn wrote: > > > +static int dsa_switch_setup_tag_protocol(struct dsa_switch *ds) > > > +{ > > > + const struct dsa_device_ops *tag_ops = ds->dst->tag_ops; > > > + struct dsa_switch_

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-28 Thread Vladimir Oltean
On Sun, Mar 28, 2021 at 05:52:43PM +0200, Andrew Lunn wrote: > > +static int dsa_switch_setup_tag_protocol(struct dsa_switch *ds) > > +{ > > + const struct dsa_device_ops *tag_ops = ds->dst->tag_ops; > > + struct dsa_switch_tree *dst = ds->dst; > > + int port, err; > > + > > + if (tag_ops->

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-28 Thread Andrew Lunn
> +static int dsa_switch_setup_tag_protocol(struct dsa_switch *ds) > +{ > + const struct dsa_device_ops *tag_ops = ds->dst->tag_ops; > + struct dsa_switch_tree *dst = ds->dst; > + int port, err; > + > + if (tag_ops->proto == dst->default_proto) > + return 0; > + > +

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-26 Thread Tobias Waldekranz
On Fri, Mar 26, 2021 at 14:57, Vladimir Oltean wrote: > Hi Tobias, > > On Fri, Mar 26, 2021 at 11:56:47AM +0100, Tobias Waldekranz wrote: >> } else { >> -dst->tag_ops = dsa_tag_driver_get(tag_protocol); >> -if (IS_ERR(dst->tag_ops)) { >> -if (PTR_ER

Re: [PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-26 Thread Vladimir Oltean
Hi Tobias, On Fri, Mar 26, 2021 at 11:56:47AM +0100, Tobias Waldekranz wrote: > } else { > - dst->tag_ops = dsa_tag_driver_get(tag_protocol); > - if (IS_ERR(dst->tag_ops)) { > - if (PTR_ERR(dst->tag_ops) == -ENOPROTOOPT) > -

[PATCH net-next 2/3] net: dsa: Allow default tag protocol to be overridden from DT

2021-03-26 Thread Tobias Waldekranz
Some combinations of tag protocols and Ethernet controllers are incompatible, and it is hard for the driver to keep track of these. Therefore, allow the device tree author (typically the board vendor) to inform the driver of this fact by selecting an alternate protocol that is known to work. Sign