)]}'
{
  "commit": "bae94d02371c402408a4edfb95e71e88dbd3e973",
  "tree": "8886acf5950d8f95d5d4d5a9737c462035709914",
  "parents": [
    "039d09a845209122c5193e650ab2d8b3c849ca7c"
  ],
  "author": {
    "name": "Inaky Perez-Gonzalez",
    "email": "inaky@linux.intel.com",
    "time": "Wed Nov 22 12:40:31 2006 -0800"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@suse.de",
    "time": "Fri Dec 01 14:36:59 2006 -0800"
  },
  "message": "PCI: switch pci_{enable,disable}_device() to be nestable\n\nChanges the pci_{enable,disable}_device() functions to work in a\nnested basis, so that eg, three calls to enable_device() require three\ncalls to disable_device().\n\nThe reason for this is to simplify PCI drivers for\nmulti-interface/capability devices. These are devices that cram more\nthan one interface in a single function. A relevant example of that is\nthe Wireless [USB] Host Controller Interface (similar to EHCI) [see\nhttp://www.intel.com/technology/comms/wusb/whci.htm]. \n\nIn these kind of devices, multiple interfaces are accessed through a\nsingle bar and IRQ line. For that, the drivers map only the smallest\narea of the bar to access their register banks and use shared IRQ\nhandlers. \n\nHowever, because the order at which those drivers load cannot be known\nahead of time, the sequence in which the calls to pci_enable_device()\nand pci_disable_device() cannot be predicted. Thus:\n\n1. driverA     starts     pci_enable_device()\n2. driverB     starts     pci_enable_device()\n3. driverA     shutdown   pci_disable_device()\n4. driverB     shutdown   pci_disable_device()\n\nbetween steps 3 and 4, driver B would loose access to it\u0027s device,\neven if it didn\u0027t intend to.\n\nBy using this modification, the device won\u0027t be disabled until all the\ncallers to enable() have called disable().\n\nThis is implemented by replacing \u0027struct pci_dev-\u003eis_enabled\u0027 from a\nbitfield to an atomic use count. Each caller to enable increments it,\neach caller to disable decrements it. When the count increments from 0\nto 1, __pci_enable_device() is called to actually enable the\ndevice. When it drops to zero, pci_disable_device() actually does the\ndisabling.\n\nWe keep the backend __pci_enable_device() for pci_default_resume() to\nuse and also change the sysfs method implementation, so that userspace\nenabling/disabling the device doesn\u0027t disable it one time too much.\n\nSigned-off-by: Inaky Perez-Gonzalez \u003cinaky@linux.intel.com\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "84ec9c8f6703fc22e2323ff690a085d0eb810224",
      "old_mode": 33188,
      "old_path": "drivers/pci/pci-driver.c",
      "new_id": "e5ae3a0c13bbcf08f724c8bfc990ddbc98c0f951",
      "new_mode": 33188,
      "new_path": "drivers/pci/pci-driver.c"
    },
    {
      "type": "modify",
      "old_id": "f952bfea48a6f972e0a1de9cc8bfc4a33920bfb7",
      "old_mode": 33188,
      "old_path": "drivers/pci/pci-sysfs.c",
      "new_id": "7a94076752d047125d4b72b876afeb28c034a344",
      "new_mode": 33188,
      "new_path": "drivers/pci/pci-sysfs.c"
    },
    {
      "type": "modify",
      "old_id": "427991741cf325c0cd1930be13ba91180bdf60d9",
      "old_mode": 33188,
      "old_path": "drivers/pci/pci.c",
      "new_id": "5a14b73cf3a1dc78af86642f349980744572f1ab",
      "new_mode": 33188,
      "new_path": "drivers/pci/pci.c"
    },
    {
      "type": "modify",
      "old_id": "6bf327db5c5e70fd39d62f060ca8d5cbd95da1de",
      "old_mode": 33188,
      "old_path": "drivers/pci/pci.h",
      "new_id": "398852f526a671d6111621bf9ca16ec1d392e39c",
      "new_mode": 33188,
      "new_path": "drivers/pci/pci.h"
    },
    {
      "type": "modify",
      "old_id": "09be0f81b27ba37d4125f4dfa7fa2de601858b37",
      "old_mode": 33188,
      "old_path": "include/linux/pci.h",
      "new_id": "01c707261f9ce6f9b42d03c62f622351100f82df",
      "new_mode": 33188,
      "new_path": "include/linux/pci.h"
    }
  ]
}
