1. 18 2月, 2021 1 次提交
  2. 11 10月, 2020 1 次提交
  3. 25 9月, 2020 1 次提交
  4. 04 8月, 2020 1 次提交
  5. 21 6月, 2020 1 次提交
  6. 20 6月, 2020 1 次提交
    • F
      of: of_mdio: Correct loop scanning logic · 5a8d7f12
      Florian Fainelli 提交于
      Commit 209c65b6 ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
      introduced a break of the loop on the premise that a successful
      registration should exit the loop. The premise is correct but not to
      code, because rc && rc != -ENODEV is just a special error condition,
      that means we would exit the loop even with rc == -ENODEV which is
      absolutely not correct since this is the error code to indicate to the
      MDIO bus layer that scanning should continue.
      
      Fix this by explicitly checking for rc = 0 as the only valid condition
      to break out of the loop.
      
      Fixes: 209c65b6 ("drivers/of/of_mdio.c:fix of_mdiobus_register()")
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5a8d7f12
  7. 23 4月, 2020 1 次提交
  8. 04 3月, 2020 1 次提交
  9. 31 1月, 2020 2 次提交
  10. 26 12月, 2019 1 次提交
  11. 20 12月, 2019 1 次提交
  12. 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
  13. 27 9月, 2019 1 次提交
  14. 30 7月, 2019 1 次提交
    • S
      drivers: Introduce device lookup variants by of_node · cfba5de9
      Suzuki K Poulose 提交于
      Introduce wrappers for {bus/driver/class}_find_device() to
      locate devices by its of_node.
      
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: dri-devel@lists.freedesktop.org
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: devicetree@vger.kernel.org
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: linux-i2c@vger.kernel.org
      Cc: linux-rockchip@lists.infradead.org
      Cc: linux-spi@vger.kernel.org
      Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Takashi Iwai <tiwai@suse.com>
      Cc: Alan Tull <atull@kernel.org>
      Cc: linux-fpga@vger.kernel.org
      Cc: Peter Rosin <peda@axentia.se>
      Cc: Florian Fainelli <f.fainelli@gmail.com>
      Cc: Heiner Kallweit <hkallweit1@gmail.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Liam Girdwood <lgirdwood@gmail.com>
      Cc: "Rafael J. Wysocki" <rafael@kernel.org>
      Cc: Thor Thayer <thor.thayer@linux.intel.com>
      Cc: Jiri Slaby <jslaby@suse.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Peter Rosin <peda@axentia.se>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Acked-by: NLee Jones <lee.jones@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # I2C part
      Acked-by: Moritz Fischer <mdf@kernel.org> # For FPGA part
      Acked-by: NMark Brown <broonie@kernel.org>
      Link: https://lore.kernel.org/r/20190723221838.12024-3-suzuki.poulose@arm.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cfba5de9
  15. 24 6月, 2019 1 次提交
    • S
      bus_find_device: Unify the match callback with class_find_device · 418e3ea1
      Suzuki K Poulose 提交于
      There is an arbitrary difference between the prototypes of
      bus_find_device() and class_find_device() preventing their callers
      from passing the same pair of data and match() arguments to both of
      them, which is the const qualifier used in the prototype of
      class_find_device().  If that qualifier is also used in the
      bus_find_device() prototype, it will be possible to pass the same
      match() callback function to both bus_find_device() and
      class_find_device(), which will allow some optimizations to be made in
      order to avoid code duplication going forward.  Also with that, constify
      the "data" parameter as it is passed as a const to the match function.
      
      For this reason, change the prototype of bus_find_device() to match
      the prototype of class_find_device() and adjust its callers to use the
      const qualifier in accordance with the new prototype of it.
      
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Andrew Lunn <andrew@lunn.ch>
      Cc: Andreas Noever <andreas.noever@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Corey Minyard <minyard@acm.org>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: David Kershner <david.kershner@unisys.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Felipe Balbi <balbi@kernel.org>
      Cc: Frank Rowand <frowand.list@gmail.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Harald Freudenberger <freude@linux.ibm.com>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Heiko Stuebner <heiko@sntech.de>
      Cc: Jason Gunthorpe <jgg@ziepe.ca>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michael Jamet <michael.jamet@intel.com>
      Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
      Cc: Peter Oberparleiter <oberpar@linux.ibm.com>
      Cc: Sebastian Ott <sebott@linux.ibm.com>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Cc: Yehezkel Bernat <YehezkelShB@gmail.com>
      Cc: rafael@kernel.org
      Acked-by: NCorey Minyard <minyard@acm.org>
      Acked-by: NDavid Kershner <david.kershner@unisys.com>
      Acked-by: NMark Brown <broonie@kernel.org>
      Acked-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
      Acked-by: Wolfram Sang <wsa@the-dreams.de> # for the I2C parts
      Acked-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NSuzuki K Poulose <suzuki.poulose@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      418e3ea1
  16. 05 6月, 2019 1 次提交
  17. 05 2月, 2019 1 次提交
    • L
      net: phy: fixed-phy: Drop GPIO from fixed_phy_add() · 5468e82f
      Linus Walleij 提交于
      All users of the fixed_phy_add() pass -1 as GPIO number
      to the fixed phy driver, and all users of fixed_phy_register()
      pass -1 as GPIO number as well, except for the device
      tree MDIO bus.
      
      Any new users should create a proper device and pass the
      GPIO as a descriptor associated with the device so delete
      the GPIO argument from the calls and drop the code looking
      requesting a GPIO in fixed_phy_add().
      
      In fixed phy_register(), investigate the "fixed-link"
      node and pick the GPIO descriptor from "link-gpios" if
      this property exists. Move the corresponding code out
      of of_mdio.c as the fixed phy code anyways requires
      OF to be in use.
      Tested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5468e82f
  18. 08 9月, 2018 1 次提交
  19. 14 7月, 2018 1 次提交
    • L
      of: mdio: Support fixed links in of_phy_get_and_connect() · 6eb9c9da
      Linus Walleij 提交于
      By a simple extension of of_phy_get_and_connect() drivers
      that have a fixed link on e.g. RGMII can support also
      fixed links, so in addition to:
      
      ethernet-port {
      	phy-mode = "rgmii";
      	phy-handle = <&foo>;
      };
      
      This setup with a fixed-link node and no phy-handle will
      now also work just fine:
      
      ethernet-port {
      	phy-mode = "rgmii";
      	fixed-link {
      		speed = <1000>;
      		full-duplex;
      		pause;
      	};
      };
      
      This is very helpful for connecting random ethernet ports
      to e.g. DSA switches that typically reside on fixed links.
      
      The phy-mode is still there as the fixes link in this case
      is still an RGMII link.
      
      Tested on the Cortina Gemini driver with the Vitesse DSA
      router chip on a fixed 1Gbit link.
      Suggested-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Reviewed-by: NAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6eb9c9da
  20. 17 5月, 2018 1 次提交
  21. 11 1月, 2018 1 次提交
  22. 28 12月, 2017 1 次提交
  23. 14 12月, 2017 2 次提交
  24. 22 10月, 2017 1 次提交
    • G
      of_mdio: Fix broken PHY IRQ in case of probe deferral · 66bdede4
      Geert Uytterhoeven 提交于
      If an Ethernet PHY is initialized before the interrupt controller it is
      connected to, a message like the following is printed:
      
          irq: no irq domain found for /interrupt-controller@e61c0000 !
      
      However, the actual error is ignored, leading to a non-functional (POLL)
      PHY interrupt later:
      
          Micrel KSZ8041RNLI ee700000.ethernet-ffffffff:01: attached PHY driver [Micrel KSZ8041RNLI] (mii_bus:phy_addr=ee700000.ethernet-ffffffff:01, irq=POLL)
      
      Depending on whether the PHY driver will fall back to polling, Ethernet
      may or may not work.
      
      To fix this:
        1. Switch of_mdiobus_register_phy() from irq_of_parse_and_map() to
           of_irq_get().
           Unlike the former, the latter returns -EPROBE_DEFER if the
           interrupt controller is not yet available, so this condition can be
           detected.
           Other errors are handled the same as before, i.e. use the passed
           mdio->irq[addr] as interrupt.
        2. Propagate and handle errors from of_mdiobus_register_phy() and
           of_mdiobus_register_device().
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66bdede4
  25. 14 8月, 2017 1 次提交
  26. 08 8月, 2017 1 次提交
  27. 25 7月, 2017 1 次提交
  28. 19 7月, 2017 1 次提交
  29. 14 6月, 2017 2 次提交
  30. 25 4月, 2017 1 次提交
    • R
      mdio_bus: Issue GPIO RESET to PHYs. · 69226896
      Roger Quadros 提交于
      Some boards [1] leave the PHYs at an invalid state
      during system power-up or reset thus causing unreliability
      issues with the PHY which manifests as PHY not being detected
      or link not functional. To fix this, these PHYs need to be RESET
      via a GPIO connected to the PHY's RESET pin.
      
      Some boards have a single GPIO controlling the PHY RESET pin of all
      PHYs on the bus whereas some others have separate GPIOs controlling
      individual PHY RESETs.
      
      In both cases, the RESET de-assertion cannot be done in the PHY driver
      as the PHY will not probe till its reset is de-asserted.
      So do the RESET de-assertion in the MDIO bus driver.
      
      [1] - am572x-idk, am571x-idk, a437x-idk
      Signed-off-by: NRoger Quadros <rogerq@ti.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      69226896
  31. 20 2月, 2017 1 次提交
  32. 30 11月, 2016 1 次提交
  33. 18 11月, 2016 2 次提交
  34. 17 7月, 2016 1 次提交
  35. 28 6月, 2016 1 次提交
    • A
      of_mdio: select fixed phy support unconditionally · a5e4bd99
      Arnd Bergmann 提交于
      Calling the fixed-phy functions when CONFIG_FIXED_PHY=m as a previous
      change tried cannot work if the caller is in built-in code:
      
      drivers/of/built-in.o: In function `of_phy_register_fixed_link':
      of_reserved_mem.c:(.text+0x85e0): undefined reference to `fixed_phy_register'
      
      Making of_mdio depend on 'FIXED_PHY || !FIXED_PHY' would solve this
      dependency by enforcing that OF_MDIO itself becomes a loadable module
      when FIXED_PHY=y, but that creates a different dependency as it
      breaks any built-in ethernet driver that uses of_mdio.
      
      Making FIXED_PHY a bool option also cannot work, since it depends on
      PHYLIB, which again is tristate.
      
      This version now uses 'select FIXED_PHY' to ensure that the fixed-phy
      portion of of_mdio is not optional. The main downside of this is
      a small increase in code size for cases that do not need fixed phy
      support, but it should avoid all of the link-time problems.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Fixes: d1bd330a ("of_mdio: Enable fixed PHY support if driver is a module")
      Acked-by: NRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a5e4bd99
  36. 24 6月, 2016 1 次提交