)]}'
{
  "commit": "116af378201ef793424cd10508ccf18b06d8a021",
  "tree": "2de792e7b9d8a122d88241d1ecfbe7bc92b9b8fe",
  "parents": [
    "0215ffb08ce99e2bb59eca114a99499a4d06e704"
  ],
  "author": {
    "name": "Benjamin Herrenschmidt",
    "email": "benh@kernel.crashing.org",
    "time": "Wed Oct 25 13:44:59 2006 +1000"
  },
  "committer": {
    "name": "Greg Kroah-Hartman",
    "email": "gregkh@suse.de",
    "time": "Fri Dec 01 14:51:58 2006 -0800"
  },
  "message": "Driver core: add notification of bus events\n\nI finally did as you suggested and added the notifier to the struct\nbus_type itself. There are still problems to be expected is something\nattaches to a bus type where the code can hook in different struct\ndevice sub-classes (which is imho a big bogosity but I won\u0027t even try to\nargue that case now) but it will solve nicely a number of issues I\u0027ve\nhad so far.\n\nThat also means that clients interested in registering for such\nnotifications have to do it before devices are added and after bus types\nare registered. Fortunately, most bus types that matter for the various\nusage scenarios I have in mind are registerd at postcore_initcall time,\nwhich means I have a really nice spot at arch_initcall time to add my\nnotifiers.\n\nThere are 4 notifications provided. Device being added (before hooked to\nthe bus) and removed (failure of previous case or after being unhooked\nfrom the bus), along with driver being bound to a device and about to be\nunbound.\n\nThe usage I have for these are:\n\n - The 2 first ones are used to maintain a struct device_ext that is\nhooked to struct device.firmware_data. This structure contains for now a\npointer to the Open Firmware node related to the device (if any), the\nNUMA node ID (for quick access to it) and the DMA operations pointers \u0026\niommu table instance for DMA to/from this device. For bus types I own\n(like IBM VIO or EBUS), I just maintain that structure directly from the\nbus code when creating the devices. But for bus types managed by generic\ncode like PCI or platform (actually, of_platform which is a variation of\nplatform linked to Open Firmware device-tree), I need this notifier.\n\n - The other two ones have a completely different usage scenario. I have\ncases where multiple devices and their drivers depend on each other. For\nexample, the IBM EMAC network driver needs to attach to a MAL DMA engine\nwhich is a separate device, and a PHY interface which is also a separate\ndevice. They are all of_platform_device\u0027s (well, about to be with my\nupcoming patches) but there is no say in what precise order the core\nwill \"probe\" them and instanciate the various modules. The solution I\nfound for that is to have the drivers for emac to use multithread_probe,\nand wait for a driver to be bound to the target MAL and PHY control\ndevices (the device-tree contains reference to the MAL and PHY interface\nnodes, which I can then match to of_platform_devices). Right now, I\u0027ve\nbeen polling, but with that notifier, I can more cleanly wait (with a\ntimeout of course).\n\nSigned-off-by: Benjamin Herrenschmidt \u003cbenh@kernel.crashing.org\u003e\nSigned-off-by: Greg Kroah-Hartman \u003cgregkh@suse.de\u003e\n\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "7d8a7ce73fb314a22d8d2ec51c8717b2ab10cc0b",
      "old_mode": 33188,
      "old_path": "drivers/base/bus.c",
      "new_id": "ed3e8a2be64a504f078c53cfe87bb0b7bff175f7",
      "new_mode": 33188,
      "new_path": "drivers/base/bus.c"
    },
    {
      "type": "modify",
      "old_id": "002fde46d38d71737ae07f6d905f8f2b5a8e4603",
      "old_mode": 33188,
      "old_path": "drivers/base/core.c",
      "new_id": "d4f35d8902a275b308b0599aa491de7fc302a9cc",
      "new_mode": 33188,
      "new_path": "drivers/base/core.c"
    },
    {
      "type": "modify",
      "old_id": "c5d6bb4290ad2d8fa24c279dc71aaef0b0eb46e4",
      "old_mode": 33188,
      "old_path": "drivers/base/dd.c",
      "new_id": "9c88b1e34bc3d9e014cfd8d046ac31d3ff9dd231",
      "new_mode": 33188,
      "new_path": "drivers/base/dd.c"
    },
    {
      "type": "modify",
      "old_id": "9d4f6a9639365bd6e2483ed911ea336a9e83caa0",
      "old_mode": 33188,
      "old_path": "include/linux/device.h",
      "new_id": "b00e027113930900956afe2902b54422088f6c37",
      "new_mode": 33188,
      "new_path": "include/linux/device.h"
    }
  ]
}
