748-v5.16-net-dsa-qca8k-fix-delay-applied-to-wrong-cpu-in-parse-p.patch 1.0 KB

12345678910111213141516171819202122232425262728
  1. From 06dd34a628ae5b6a839b757e746de165d6789ca8 Mon Sep 17 00:00:00 2001
  2. From: Ansuel Smith <[email protected]>
  3. Date: Sun, 17 Oct 2021 16:56:46 +0200
  4. Subject: net: dsa: qca8k: fix delay applied to wrong cpu in parse_port_config
  5. Fix delay settings applied to wrong cpu in parse_port_config. The delay
  6. values is set to the wrong index as the cpu_port_index is incremented
  7. too early. Start the cpu_port_index to -1 so the correct value is
  8. applied to address also the case with invalid phy mode and not available
  9. port.
  10. Signed-off-by: Ansuel Smith <[email protected]>
  11. Signed-off-by: David S. Miller <[email protected]>
  12. ---
  13. drivers/net/dsa/qca8k.c | 2 +-
  14. 1 file changed, 1 insertion(+), 1 deletion(-)
  15. --- a/drivers/net/dsa/qca8k.c
  16. +++ b/drivers/net/dsa/qca8k.c
  17. @@ -976,7 +976,7 @@ qca8k_setup_of_pws_reg(struct qca8k_priv
  18. static int
  19. qca8k_parse_port_config(struct qca8k_priv *priv)
  20. {
  21. - int port, cpu_port_index = 0, ret;
  22. + int port, cpu_port_index = -1, ret;
  23. struct device_node *port_dn;
  24. phy_interface_t mode;
  25. struct dsa_port *dp;