)]}'
{
  "commit": "1758bde2e4aa5ff188d53e7d9d388bbb7e12eebb",
  "tree": "535ca40e10a9352a71475d2ff5f29e0bcb6609d7",
  "parents": [
    "e65af5403e462ccd7dff6a045a886c64da598c2e"
  ],
  "author": {
    "name": "Lukas Wunner",
    "email": "lukas@wunner.de",
    "time": "Tue Jun 28 12:15:08 2022 +0200"
  },
  "committer": {
    "name": "Jakub Kicinski",
    "email": "kuba@kernel.org",
    "time": "Wed Jun 29 20:38:52 2022 -0700"
  },
  "message": "net: phy: Don\u0027t trigger state machine while in suspend\n\nUpon system sleep, mdio_bus_phy_suspend() stops the phy_state_machine(),\nbut subsequent interrupts may retrigger it:\n\nThey may have been left enabled to facilitate wakeup and are not\nquiesced until the -\u003esuspend_noirq() phase.  Unwanted interrupts may\nhence occur between mdio_bus_phy_suspend() and dpm_suspend_noirq(),\nas well as between dpm_resume_noirq() and mdio_bus_phy_resume().\n\nRetriggering the phy_state_machine() through an interrupt is not only\nundesirable for the reason given in mdio_bus_phy_suspend() (freezing it\nmidway with phydev-\u003elock held), but also because the PHY may be\ninaccessible after it\u0027s suspended:  Accesses to USB-attached PHYs are\nblocked once usb_suspend_both() clears the can_submit flag and PHYs on\nPCI network cards may become inaccessible upon suspend as well.\n\nAmend phy_interrupt() to avoid triggering the state machine if the PHY\nis suspended.  Signal wakeup instead if the attached net_device or its\nparent has been configured as a wakeup source.  (Those conditions are\nidentical to mdio_bus_phy_may_suspend().)  Postpone handling of the\ninterrupt until the PHY has resumed.\n\nBefore stopping the phy_state_machine() in mdio_bus_phy_suspend(),\nwait for a concurrent phy_interrupt() to run to completion.  That is\nnecessary because phy_interrupt() may have checked the PHY\u0027s suspend\nstatus before the system sleep transition commenced and it may thus\nretrigger the state machine after it was stopped.\n\nLikewise, after re-enabling interrupt handling in mdio_bus_phy_resume(),\nwait for a concurrent phy_interrupt() to complete to ensure that\ninterrupts which it postponed are properly rerun.\n\nThe issue was exposed by commit 1ce8b37241ed (\"usbnet: smsc95xx: Forward\nPHY interrupts to PHY driver to avoid polling\"), but has existed since\nforever.\n\nFixes: 541cd3ee00a4 (\"phylib: Fix deadlock on resume\")\nLink: https://lore.kernel.org/netdev/a5315a8a-32c2-962f-f696-de9a26d30091@samsung.com/\nReported-by: Marek Szyprowski \u003cm.szyprowski@samsung.com\u003e\nTested-by: Marek Szyprowski \u003cm.szyprowski@samsung.com\u003e\nSigned-off-by: Lukas Wunner \u003clukas@wunner.de\u003e\nAcked-by: Rafael J. Wysocki \u003crafael.j.wysocki@intel.com\u003e\nCc: stable@vger.kernel.org # v2.6.33+\nReviewed-by: Andrew Lunn \u003candrew@lunn.ch\u003e\nLink: https://lore.kernel.org/r/b7f386d04e9b5b0e2738f0125743e30676f309ef.1656410895.git.lukas@wunner.de\nSigned-off-by: Jakub Kicinski \u003ckuba@kernel.org\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ef62f357b76d949a57b461c530c5d9c5efb786c7",
      "old_mode": 33188,
      "old_path": "drivers/net/phy/phy.c",
      "new_id": "8d3ee3a6495b45754095c8c8a0c842ced8a26434",
      "new_mode": 33188,
      "new_path": "drivers/net/phy/phy.c"
    },
    {
      "type": "modify",
      "old_id": "431a8719c6359b24029c8964405ab165b21edde6",
      "old_mode": 33188,
      "old_path": "drivers/net/phy/phy_device.c",
      "new_id": "46acddd865a782f550bf11536a67010b4485d5dc",
      "new_mode": 33188,
      "new_path": "drivers/net/phy/phy_device.c"
    },
    {
      "type": "modify",
      "old_id": "508f1149665b8c138793f16089508874bc6bec99",
      "old_mode": 33188,
      "old_path": "include/linux/phy.h",
      "new_id": "b09f7d36cff2a4ee62332460476d2bab7716d586",
      "new_mode": 33188,
      "new_path": "include/linux/phy.h"
    }
  ]
}
