1. 22 4月, 2016 1 次提交
  2. 18 4月, 2016 1 次提交
  3. 14 4月, 2016 4 次提交
  4. 15 3月, 2016 3 次提交
  5. 11 3月, 2016 1 次提交
  6. 08 1月, 2016 1 次提交
  7. 08 12月, 2015 4 次提交
  8. 25 11月, 2015 1 次提交
    • A
      net: dsa: include gpio consumer header file · 85beabfe
      Arnd Bergmann 提交于
      After the introduction of the switch gpio reset API, I'm getting
      build errors in configurations that disable CONFIG_GPIOLIB:
      
      net/dsa/dsa.c:783:16: error: implicit declaration of function 'gpio_to_desc' [-Werror=implicit-function-declaration]
      
      The reason is that linux/gpio/consumer.h is not automatically
      included without gpiolib support. This adds an explicit #include
      statement to make it compile in all configurations. The reset
      functionality will not work without gpiolib, which is what you
      get when disabling the feature.
      
      As far as I can tell, gpiolib is supported on all architectures
      on which you can have DSA at the moment.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: cc30c163 ("net: dsa: Add support for a switch reset gpio")
      Acked-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      85beabfe
  9. 24 11月, 2015 1 次提交
  10. 07 10月, 2015 6 次提交
  11. 25 9月, 2015 2 次提交
    • R
      net: fix net_device refcounting · 9861f720
      Russell King 提交于
      of_find_net_device_by_node() uses class_find_device() internally to
      lookup the corresponding network device.  class_find_device() returns
      a reference to the embedded struct device, with its refcount
      incremented.
      
      Add a comment to the definition in net/core/net-sysfs.c indicating the
      need to drop this refcount, and fix the DSA code to drop this refcount
      when the OF-generated platform data is cleaned up and freed.  Also
      arrange for the ref to be dropped when handling errors.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9861f720
    • R
      net: dsa: fix of_mdio_find_bus() device refcount leak · e496ae69
      Russell King 提交于
      Current users of of_mdio_find_bus() leak a struct device refcount, as
      they fail to clean up the reference obtained inside class_find_device().
      
      Fix the DSA code to properly refcount the returned MDIO bus by:
      1. taking a reference on the struct device whenever we assign it to
         pd->chip[x].host_dev.
      2. dropping the reference when we overwrite the existing reference.
      3. dropping the reference when we free the data structure.
      4. dropping the initial reference we obtained after setting up the
         platform data structure, or on failure.
      
      In step 2 above, where we obtain a new MDIO bus, there is no need to
      take a reference on it as we would only have to drop it immediately
      after assignment again, iow:
      
      	put_device(cd->host_dev);	/* drop original assignment ref */
      	cd->host_dev = get_device(&mdio_bus_switch->dev); /* get our ref */
      	put_device(&mdio_bus_switch->dev); /* drop of_mdio_find_bus ref */
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e496ae69
  12. 01 9月, 2015 2 次提交
  13. 19 8月, 2015 1 次提交
    • A
      net: dsa: Allow multi hop routes to be expressed · 1e72e6f8
      Andrew Lunn 提交于
      With more than two switches in a hierarchy, it becomes necessary to
      describe multi-hop routes between switches. The current binding does
      not allow this, although the older platform_data did. Extend the link
      property to be a list rather than a single phandle to a remote switch.
      It is then possible to express that a port should be used to reach
      more than one switch and the switch maybe more than one hop away.
      Signed-off-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1e72e6f8
  14. 11 8月, 2015 1 次提交
  15. 12 7月, 2015 2 次提交
  16. 01 6月, 2015 1 次提交
    • F
      net: dsa: Properly propagate errors from dsa_switch_setup_one · 24595346
      Florian Fainelli 提交于
      While shuffling some code around, dsa_switch_setup_one() was introduced,
      and it was modified to return either an error code using ERR_PTR() or a
      NULL pointer when running out of memory or failing to setup a switch.
      
      This is a problem for its caler: dsa_switch_setup() which uses IS_ERR()
      and expects to find an error code, not a NULL pointer, so we still try
      to proceed with dsa_switch_setup() and operate on invalid memory
      addresses. This can be easily reproduced by having e.g: the bcm_sf2
      driver built-in, but having no such switch, such that drv->setup will
      fail.
      
      Fix this by using PTR_ERR() consistently which is both more informative
      and avoids for the caller to use IS_ERR_OR_NULL().
      
      Fixes: df197195 ("net: dsa: split dsa_switch_setup into two functions")
      Reported-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      24595346
  17. 30 4月, 2015 1 次提交
  18. 18 4月, 2015 1 次提交
  19. 07 4月, 2015 1 次提交
    • P
      net: dsa: fix filling routing table from OF description · 30303813
      Pavel Nakonechny 提交于
      According to description in 'include/net/dsa.h', in cascade switches
      configurations where there are more than one interconnected devices,
      'rtable' array in 'dsa_chip_data' structure is used to indicate which
      port on this switch should be used to send packets to that are destined
      for corresponding switch.
      
      However, dsa_of_setup_routing_table() fills 'rtable' with port numbers
      of the _target_ switch, but not current one.
      
      This commit removes redundant devicetree parsing and adds needed port
      number as a function argument. So dsa_of_setup_routing_table() now just
      looks for target switch number by parsing parent of 'link' device node.
      
      To remove possible misunderstandings with the way of determining target
      switch number, a corresponding comment was added to the source code and
      to the DSA device tree bindings documentation file.
      
      This was tested on a custom board with two Marvell 88E6095 switches with
      following corresponding routing tables: { -1, 10 } and { 8, -1 }.
      Signed-off-by: NPavel Nakonechny <pavel.nakonechny@skitlab.ru>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Reviewed-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      30303813
  20. 10 3月, 2015 1 次提交
    • F
      net: dsa: utilize of_find_net_device_by_node · 769a0202
      Florian Fainelli 提交于
      Using of_find_device_by_node() restricts the search to platform_device that
      match the specified device_node pointer. This is not even remotely true for
      network devices backed by a pci_device for instance.
      
      of_find_net_device_by_node() allows us to do a more thorough lookup to find the
      struct net_device corresponding to a particular device_node pointer.
      
      For symetry with the non-OF code path, we hold the net_device pointer in
      dsa_probe() just like what dev_to_net_dev() does when we call this
      function.
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      769a0202
  21. 06 3月, 2015 4 次提交