1. 24 9月, 2020 2 次提交
  2. 10 9月, 2020 1 次提交
  3. 06 9月, 2020 1 次提交
    • F
      net: dsa: bcm_sf2: Ensure that MDIO diversion is used · 771089c2
      Florian Fainelli 提交于
      Registering our slave MDIO bus outside of the OF infrastructure is
      necessary in order to avoid creating double references of the same
      Device Tree nodes, however it is not sufficient to guarantee that the
      MDIO bus diversion is used because of_phy_connect() will still resolve
      to a valid PHY phandle and it will connect to the PHY using its parent
      MDIO bus which is still the SF2 master MDIO bus. The reason for that is
      because BCM7445 systems were already shipped with a Device Tree blob
      looking like this (irrelevant parts omitted for simplicity):
      
      	ports {
      		#address-cells = <1>;
      		#size-cells = <0>;
      
      		port@1 {
      			phy-mode = "rgmii-txid";
      			phy-handle = <&phy0>;
                              reg = <1>;
      			label = "rgmii_1";
      		};
      	...
      
      	mdio@403c0 {
      		...
      
      		phy0: ethernet-phy@0 {
      			broken-turn-around;
      			device_type = "ethernet-phy";
      			max-speed = <0x3e8>;
      			reg = <0>;
      			compatible = "brcm,bcm53125", "ethernet-phy-ieee802.3-c22";
      		};
      	};
      
      There is a hardware issue with chip revisions (Dx) that lead to the
      development of the following commits:
      
      461cd1b0 ("net: dsa: bcm_sf2: Register our slave MDIO bus")
      536fab5b ("net: dsa: bcm_sf2: Do not register slave MDIO bus with OF")
      b8c6cd1d ("net: dsa: bcm_sf2: do not use indirect reads and writes for 7445E0")
      
      There should have been an internal MDIO bus node created for the chip
      revision (Dx) that suffers from this problem, but it did not happen back
      then.
      
      Had that happen, that we should have correctly parented phy@0 (bcm53125
      below) as child node of the internal MDIO bus, but the production Device
      Tree blob that was shipped with the firmware targeted the fixed version
      of the chip, despite both the affected and corrected chips being shipped
      into production.
      
      The problem is that of_phy_connect() for port@1 will happily resolve the
      'phy-handle' from the mdio@403c0 node, which bypasses the diversion
      completely. This results in this double programming that the diversion
      refers to and aims to avoid. In order to force of_phy_connect() to fail,
      and have DSA call to dsa_slave_phy_connect(), we must deactivate
      ethernet-phy@0 from mdio@403c0, and the best way to do that is by
      removing the phandle property completely.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NJakub Kicinski <kuba@kernel.org>
      771089c2
  4. 04 9月, 2020 2 次提交
  5. 24 8月, 2020 1 次提交
  6. 01 7月, 2020 3 次提交
  7. 19 6月, 2020 1 次提交
    • F
      net: dsa: bcm_sf2: Fix node reference count · 8dbe4c5d
      Florian Fainelli 提交于
      of_find_node_by_name() will do an of_node_put() on the "from" argument.
      With CONFIG_OF_DYNAMIC enabled which checks for device_node reference
      counts, we would be getting a warning like this:
      
      [    6.347230] refcount_t: increment on 0; use-after-free.
      [    6.352498] WARNING: CPU: 3 PID: 77 at lib/refcount.c:156
      refcount_inc_checked+0x38/0x44
      [    6.360601] Modules linked in:
      [    6.363661] CPU: 3 PID: 77 Comm: kworker/3:1 Tainted: G        W
      5.4.46-gb78b3e9956e6 #13
      [    6.372546] Hardware name: BCM97278SV (DT)
      [    6.376649] Workqueue: events deferred_probe_work_func
      [    6.381796] pstate: 60000005 (nZCv daif -PAN -UAO)
      [    6.386595] pc : refcount_inc_checked+0x38/0x44
      [    6.391133] lr : refcount_inc_checked+0x38/0x44
      ...
      [    6.478791] Call trace:
      [    6.481243]  refcount_inc_checked+0x38/0x44
      [    6.485433]  kobject_get+0x3c/0x4c
      [    6.488840]  of_node_get+0x24/0x34
      [    6.492247]  of_irq_find_parent+0x3c/0xe0
      [    6.496263]  of_irq_parse_one+0xe4/0x1d0
      [    6.500191]  irq_of_parse_and_map+0x44/0x84
      [    6.504381]  bcm_sf2_sw_probe+0x22c/0x844
      [    6.508397]  platform_drv_probe+0x58/0xa8
      [    6.512413]  really_probe+0x238/0x3fc
      [    6.516081]  driver_probe_device+0x11c/0x12c
      [    6.520358]  __device_attach_driver+0xa8/0x100
      [    6.524808]  bus_for_each_drv+0xb4/0xd0
      [    6.528650]  __device_attach+0xd0/0x164
      [    6.532493]  device_initial_probe+0x24/0x30
      [    6.536682]  bus_probe_device+0x38/0x98
      [    6.540524]  deferred_probe_work_func+0xa8/0xd4
      [    6.545061]  process_one_work+0x178/0x288
      [    6.549078]  process_scheduled_works+0x44/0x48
      [    6.553529]  worker_thread+0x218/0x270
      [    6.557285]  kthread+0xdc/0xe4
      [    6.560344]  ret_from_fork+0x10/0x18
      [    6.563925] ---[ end trace 68f65caf69bb152a ]---
      
      Fix this by adding a of_node_get() to increment the reference count
      prior to the call.
      
      Fixes: afa3b592 ("net: dsa: bcm_sf2: Ensure correct sub-node is parsed")
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8dbe4c5d
  8. 07 4月, 2020 2 次提交
  9. 31 3月, 2020 1 次提交
  10. 28 2月, 2020 1 次提交
  11. 27 2月, 2020 2 次提交
  12. 17 2月, 2020 1 次提交
  13. 07 2月, 2020 1 次提交
  14. 17 1月, 2020 1 次提交
  15. 06 11月, 2019 2 次提交
  16. 05 11月, 2019 1 次提交
    • A
      net: of_get_phy_mode: Change API to solve int/unit warnings · 0c65b2b9
      Andrew Lunn 提交于
      Before this change of_get_phy_mode() returned an enum,
      phy_interface_t. On error, -ENODEV etc, is returned. If the result of
      the function is stored in a variable of type phy_interface_t, and the
      compiler has decided to represent this as an unsigned int, comparision
      with -ENODEV etc, is a signed vs unsigned comparision.
      
      Fix this problem by changing the API. Make the function return an
      error, or 0 on success, and pass a pointer, of type phy_interface_t,
      where the phy mode should be stored.
      
      v2:
      Return with *interface set to PHY_INTERFACE_MODE_NA on error.
      Add error checks to all users of of_get_phy_mode()
      Fixup a few reverse christmas tree errors
      Fixup a few slightly malformed reverse christmas trees
      
      v3:
      Fix 0-day reported errors.
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      0c65b2b9
  17. 02 11月, 2019 1 次提交
  18. 29 10月, 2019 1 次提交
  19. 23 10月, 2019 1 次提交
  20. 22 8月, 2019 1 次提交
  21. 21 8月, 2019 1 次提交
    • V
      net: dsa: do not enable or disable non user ports · 74be4bab
      Vivien Didelot 提交于
      The .port_enable and .port_disable operations are currently only
      called for user ports, hence assuming they have a slave device. In
      preparation for using these operations for other port types as well,
      simply guard all implementations against non user ports and return
      directly in such case.
      
      Note that bcm_sf2_sw_suspend() currently calls bcm_sf2_port_disable()
      (and thus b53_disable_port()) against the user and CPU ports, so do
      not guards those functions. They will be called for unused ports in
      the future, but that was expected by those drivers anyway.
      Signed-off-by: NVivien Didelot <vivien.didelot@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      74be4bab
  22. 02 8月, 2019 1 次提交
  23. 31 5月, 2019 1 次提交
  24. 22 3月, 2019 1 次提交
  25. 25 2月, 2019 1 次提交
  26. 16 2月, 2019 1 次提交
  27. 14 2月, 2019 1 次提交
  28. 09 2月, 2019 3 次提交
  29. 28 12月, 2018 1 次提交
  30. 07 11月, 2018 2 次提交