1. 25 Nov, 2020 17 commits
    • Ioana Ciornei's avatar
      net: phy: remove the .did_interrupt() and .ack_interrupt() callback · 6527b938
      Ioana Ciornei authored
      Now that all the PHY drivers have been migrated to directly implement
      the generic .handle_interrupt() callback for a seamless support of
      shared IRQs and all the .config_inter() implementations clear any
      pending interrupts, we can safely remove the two callbacks.
      
      With this patch, phylib has a proper support for shared IRQs (and not
      just for multi-PHY devices. A PHY driver must implement both the
      .handle_interrupt() and .config_intr() callbacks for the IRQs to be
      actually used.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6527b938
    • Ioana Ciornei's avatar
      net: phy: qsemi: remove the use of .ack_interrupt() · a1a44174
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Also, add a comment describing the multiple step interrupt
      acknoledgement process.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a1a44174
    • Ioana Ciornei's avatar
      net: phy: qsemi: implement generic .handle_interrupt() callback · efc3d9de
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      efc3d9de
    • Ioana Ciornei's avatar
      net: phy: ti: remove the use of .ack_interrupt() · aa2d603a
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Dan Murphy <dmurphy@ti.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      aa2d603a
    • Ioana Ciornei's avatar
      net: phy: ti: implement generic .handle_interrupt() callback · 1d1ae3c6
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Dan Murphy <dmurphy@ti.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1d1ae3c6
    • Ioana Ciornei's avatar
      net: phy: national: remove the use of the .ack_interrupt() · a4d77421
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      a4d77421
    • Ioana Ciornei's avatar
      net: phy: national: implement generic .handle_interrupt() callback · 6571b455
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6571b455
    • Ioana Ciornei's avatar
      net: phy: micrel: remove the use of .ack_interrupt() · c0c99d0c
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Antoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c0c99d0c
    • Ioana Ciornei's avatar
      net: phy: micrel: implement generic .handle_interrupt() callback · 59ca4e58
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Divya Koppera <Divya.Koppera@microchip.com>
      Cc: Oleksij Rempel <o.rempel@pengutronix.de>
      Cc: Philippe Schenker <philippe.schenker@toradex.com>
      Cc: Marek Vasut <marex@denx.de>
      Cc: Antoine Tenart <atenart@kernel.org>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      59ca4e58
    • Ioana Ciornei's avatar
      net: phy: meson-gxl: remove the use of .ack_callback() · 84c8f773
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      84c8f773
    • Ioana Ciornei's avatar
      net: phy: meson-gxl: implement generic .handle_interrupt() callback · 6719e2be
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Jerome Brunet <jbrunet@baylibre.com>
      Cc: Neil Armstrong <narmstrong@baylibre.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      6719e2be
    • Ioana Ciornei's avatar
      net: phy: icplus: remove the use .ack_interrupt() · 12ae7ba3
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      12ae7ba3
    • Ioana Ciornei's avatar
      net: phy: icplus: implement generic .handle_interrupt() callback · 25497b7f
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      25497b7f
    • Ioana Ciornei's avatar
      net: phy: intel-xway: remove the use of .ack_interrupt() · 16c9709a
      Ioana Ciornei authored
      In preparation of removing the .ack_interrupt() callback, we must replace
      its occurrences (aka phy_clear_interrupt), from the 2 places where it is
      called from (phy_enable_interrupts and phy_disable_interrupts), with
      equivalent functionality.
      
      This means that clearing interrupts now becomes something that the PHY
      driver is responsible of doing, before enabling interrupts and after
      clearing them. Make this driver follow the new contract.
      
      Cc: Mathias Kresin <dev@kresin.me>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      16c9709a
    • Ioana Ciornei's avatar
      net: phy: intel-xway: implement generic .handle_interrupt() callback · 1566db04
      Ioana Ciornei authored
      In an attempt to actually support shared IRQs in phylib, we now move the
      responsibility of triggering the phylib state machine or just returning
      IRQ_NONE, based on the IRQ status register, to the PHY driver. Having
      3 different IRQ handling callbacks (.handle_interrupt(),
      .did_interrupt() and .ack_interrupt() ) is confusing so let the PHY
      driver implement directly an IRQ handler like any other device driver.
      Make this driver follow the new convention.
      
      Cc: Mathias Kresin <dev@kresin.me>
      Cc: Hauke Mehrtens <hauke@hauke-m.de>
      Signed-off-by: default avatarIoana Ciornei <ioana.ciornei@nxp.com>
      Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      1566db04
    • Sven Van Asbroeck's avatar
      lan743x: replace polling loop by wait_event_timeout() · 470dfd80
      Sven Van Asbroeck authored
      The driver's ISR sends a 'software interrupt' event to the probe()
      thread using the following method:
      - probe(): write 0 to flag, enable s/w interrupt
      - probe(): poll on flag, relax using usleep_range()
      - ISR    : write 1 to flag
      
      Replace with wake_up() / wait_event_timeout(). Besides being easier
      to get right, this abstraction has better timing and memory
      consistency properties.
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Signed-off-by: default avatarSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201123191529.14908-2-TheSven73@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      470dfd80
    • Sven Van Asbroeck's avatar
      lan743x: clean up software_isr function · c31799ba
      Sven Van Asbroeck authored
      For no apparent reason, this function reads the INT_STS register, and
      checks if the software interrupt bit is set. These things have already
      been carried out by this function's only caller.
      
      Clean up by removing the redundant code.
      
      Tested-by: Sven Van Asbroeck <thesven73@gmail.com> # lan7430
      Signed-off-by: default avatarSven Van Asbroeck <thesven73@gmail.com>
      Link: https://lore.kernel.org/r/20201123191529.14908-1-TheSven73@gmail.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
      c31799ba
  2. 24 Nov, 2020 23 commits