)]}'
{
  "commit": "e1866b33b1e89f077b7132daae3dfd9a594e9a1a",
  "tree": "674760cf6db30a664112ef73ad15b7b676a4debd",
  "parents": [
    "ee940d8dccd899aa1777ea84da3d9cd04b1d2e8e"
  ],
  "author": {
    "name": "Rafael J. Wysocki",
    "email": "rjw@sisk.pl",
    "time": "Fri Apr 29 00:33:45 2011 +0200"
  },
  "committer": {
    "name": "Rafael J. Wysocki",
    "email": "rjw@sisk.pl",
    "time": "Tue May 17 23:19:17 2011 +0200"
  },
  "message": "PM / Runtime: Rework runtime PM handling during driver removal\n\nThe driver core tries to prevent race conditions between runtime PM\nand driver removal from happening by incrementing the runtime PM\nusage counter of the device and executing pm_runtime_barrier() before\nrunning the bus notifier and the -\u003eremove() callbacks provided by the\ndevice\u0027s subsystem or driver.  This guarantees that, if a future\nruntime suspend of the device has been scheduled or a runtime resume\nor idle request has been queued up right before the driver removal,\nit will be canceled or waited for to complete and no other\nasynchronous runtime suspend or idle requests for the device will be\nput into the PM workqueue until the -\u003eremove() callback returns.\nHowever, it doesn\u0027t prevent resume requests from being queued up\nafter pm_runtime_barrier() has been called and it doesn\u0027t prevent\npm_runtime_resume() from executing the device subsystem\u0027s runtime\nresume callback.  Morever, it prevents the device\u0027s subsystem or\ndriver from putting the device into the suspended state by calling\npm_runtime_suspend() from its -\u003eremove() routine.  This turns out to\nbe a major inconvenience for some subsystems and drivers that want to\nleave the devices they handle in the suspended state.\n\nTo really prevent runtime PM callbacks from racing with the bus\nnotifier callback in __device_release_driver(), which is necessary,\nbecause the notifier is used by some subsystems to carry out\noperations affecting the runtime PM functionality, use\npm_runtime_get_sync() instead of the combination of\npm_runtime_get_noresume() and pm_runtime_barrier().  This will resume\nthe device if it\u0027s in the suspended state and will prevent it from\nbeing suspended again until pm_runtime_put_*() is called.\n\nTo allow subsystems and drivers to put devices into the suspended\nstate by calling pm_runtime_suspend() from their -\u003eremove() routines,\nexecute pm_runtime_put_sync() after running the bus notifier in\n__device_release_driver().  This will require subsystems and drivers\nto make their -\u003eremove() callbacks avoid races with runtime PM\ndirectly, but it will allow of more flexibility in the handling of\ndevices during the removal of their drivers.\n\nSigned-off-by: Rafael J. Wysocki \u003crjw@sisk.pl\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "da57ee9d63febb2d525883a84a137962ca3a07c0",
      "old_mode": 33188,
      "old_path": "drivers/base/dd.c",
      "new_id": "29917c7506cb57b2085181163c664ecf777f5ff4",
      "new_mode": 33188,
      "new_path": "drivers/base/dd.c"
    }
  ]
}
