)]}'
{
  "commit": "541cd3ee00a4fe975b22fac6a3bc846bacef37f7",
  "tree": "238becb3dab2920caea760356c13351a2e964872",
  "parents": [
    "7f9d3577e2603ca279c3176b696eba392f21cbe2"
  ],
  "author": {
    "name": "Anton Vorontsov",
    "email": "avorontsov@ru.mvista.com",
    "time": "Wed Dec 30 08:23:28 2009 +0000"
  },
  "committer": {
    "name": "David S. Miller",
    "email": "davem@davemloft.net",
    "time": "Wed Dec 30 22:03:41 2009 -0800"
  },
  "message": "phylib: Fix deadlock on resume\n\nSometimes kernel hangs on resume with the following trace:\n\n ucc_geth e0102000.ucc: resume\n INFO: task bash:1764 blocked for more than 120 seconds.\n \"echo 0 \u003e /proc/sys/kernel/hung_task_timeout_secs\" disables this message.\n bash          D 0fecf43c     0  1764   1763 0x00000000\n Call Trace:\n [cf9a7c10] [c0012868] ret_from_except+0x0/0x14 (unreliable)\n --- Exception: cf9a7ce0 at __switch_to+0x4c/0x6c\n     LR \u003d 0xcf9a7cc0\n [cf9a7cd0] [c0008c14] __switch_to+0x4c/0x6c (unreliable)\n [cf9a7ce0] [c028bcfc] schedule+0x158/0x260\n [cf9a7d10] [c028c720] __mutex_lock_slowpath+0x80/0xd8\n [cf9a7d40] [c01cf388] phy_stop+0x20/0x70\n [cf9a7d50] [c01d514c] ugeth_resume+0x6c/0x13c\n [...]\n\nHere is why.\n\nOn suspend:\n\n- PM core starts suspending devices, ucc_geth_suspend gets called;\n\n- ucc_geth calls phy_stop() on suspend. Note that phy_stop() is\n  mostly asynchronous so it doesn\u0027t block ucc_geth\u0027s suspend routine,\n  it just sets PHY_HALTED state and disables PHY\u0027s interrupts;\n\n- Suddenly the state machine gets scheduled, it grabs the phydev-\u003elock\n  mutex and tries to process the PHY_HALTED state, so it calls\n  phydev-\u003eadjust_link(phydev-\u003eattached_dev). In ucc_geth case\n  adjust_link() calls msleep(), which reschedules the code flow back to\n  PM core, which now finishes suspend and so we end up sleeping with\n  phydev-\u003elock mutex held.\n\nOn resume:\n\n- PM core starts resuming devices (notice that nobody rescheduled\n  the state machine yet, so the mutex is still held), the core calls\n  ucc_geth\u0027s resume routine;\n\n- ucc_geth_resume restarts the PHY with phy_stop()/phy_start()\n  sequence, and the phy_*() calls are trying to grab the phydev-\u003elock\n  mutex. Here comes the deadlock.\n\nThis patch fixes the issue by stopping the state machine on suspend\nand starting it again on resume.\n\nSigned-off-by: Anton Vorontsov \u003cavorontsov@ru.mvista.com\u003e\nSigned-off-by: David S. Miller \u003cdavem@davemloft.net\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bd4e8d72dc08fa7e5a14822ef9d577cabdf3a185",
      "old_mode": 33188,
      "old_path": "drivers/net/phy/mdio_bus.c",
      "new_id": "49252d390903c1335f4d3c32ca45a66d108cc00d",
      "new_mode": 33188,
      "new_path": "drivers/net/phy/mdio_bus.c"
    }
  ]
}
