]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: Use prepare/commit phase in dsa_slave_vlan_rx_add_vid()
authorFlorian Fainelli <f.fainelli@gmail.com>
Fri, 1 Mar 2019 18:37:25 +0000 (10:37 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 4 Mar 2019 04:45:52 +0000 (20:45 -0800)
commitdf8910b43b233eec36bfe2149bcbf10bf01cc4f9
tree9f5fd31dafddf37ef48d165db35e01e823c0ed22
parent0d4cedce2d7c7e99e21ba7faa02e68746cc98c44
net: dsa: Use prepare/commit phase in dsa_slave_vlan_rx_add_vid()

We were skipping the prepare phase which causes some problems with at
least a couple of drivers:

- mv88e6xxx chooses to skip programming VID = 0 with -EOPNOTSUPP in
  the prepare phase, but we would still try to force this VID since we
  would only call the commit phase and so we would get the driver to
  return -EINVAL instead

- qca8k does not currently have a port_vlan_add() callback implemented,
  yet we would try to call that unconditionally leading to a NPD

Fix both issues by conforming to the current model doing a
prepare/commit phase, this makes us consistent throughout the code and
assumptions.

Reported-by: Heiner Kallweit <hkallweit1@gmail.com>
Reported-by: Michal Vokáč <michal.vokac@ysoft.com>
Fixes: 6ecf933fb3e9 ("net: dsa: Add ndo_vlan_rx_{add, kill}_vid implementation")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dsa/slave.c