Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 314153 Details for
Bug 438761
LTC:5.4:201049:DM-MP SCSI Hardware Handlers
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
Port bus notifications infrastructure from mainline
bus_notifications (text/plain), 4.47 KB, created by
IBM Bug Proxy
on 2008-08-13 00:40:37 UTC
(
hide
)
Description:
Port bus notifications infrastructure from mainline
Filename:
MIME Type:
Creator:
IBM Bug Proxy
Created:
2008-08-13 00:40:37 UTC
Size:
4.47 KB
patch
obsolete
>RHEL 5.2 doesn't have support for bus notifications, which is needed >for SCSI Hardware Handlers. > >This is the direct port of the functionality from mainline > >Signed-off-by: Chandra Seetharaman <sekharan@us.ibm.com> >----- >Index: linux-2.6.18.ppc64/drivers/base/bus.c >=================================================================== >--- linux-2.6.18.ppc64.orig/drivers/base/bus.c >+++ linux-2.6.18.ppc64/drivers/base/bus.c >@@ -683,6 +683,8 @@ int bus_register(struct bus_type * bus) > { > int retval; > >+ BLOCKING_INIT_NOTIFIER_HEAD(&bus->bus_notifier); >+ > retval = kobject_set_name(&bus->subsys.kset.kobj, "%s", bus->name); > if (retval) > goto out; >@@ -720,6 +722,17 @@ out: > return retval; > } > >+int bus_register_notifier(struct bus_type *bus, struct notifier_block *nb) >+{ >+ return blocking_notifier_chain_register(&bus->bus_notifier, nb); >+} >+EXPORT_SYMBOL_GPL(bus_register_notifier); >+ >+int bus_unregister_notifier(struct bus_type *bus, struct notifier_block *nb) >+{ >+ return blocking_notifier_chain_unregister(&bus->bus_notifier, nb); >+} >+EXPORT_SYMBOL_GPL(bus_unregister_notifier); > > /** > * bus_unregister - remove a bus from the system >Index: linux-2.6.18.ppc64/drivers/base/core.c >=================================================================== >--- linux-2.6.18.ppc64.orig/drivers/base/core.c >+++ linux-2.6.18.ppc64/drivers/base/core.c >@@ -368,6 +368,11 @@ int device_add(struct device *dev) > /* notify platform of device entry */ > if (platform_notify) > platform_notify(dev); >+ >+ /* notify clients of device entry (new way) */ >+ if (dev->bus) >+ blocking_notifier_call_chain(&dev->bus->bus_notifier, >+ BUS_NOTIFY_ADD_DEVICE, dev); > Done: > kfree(class_name); > put_device(dev); >@@ -487,6 +492,9 @@ void device_del(struct device * dev) > if (platform_notify_remove) > platform_notify_remove(dev); > >+ if (dev->bus) >+ blocking_notifier_call_chain(&dev->bus->bus_notifier, >+ BUS_NOTIFY_DEL_DEVICE, dev); > device_pm_remove(dev); > kobject_uevent(&dev->kobj, KOBJ_REMOVE); > kobject_del(&dev->kobj); >Index: linux-2.6.18.ppc64/drivers/base/dd.c >=================================================================== >--- linux-2.6.18.ppc64.orig/drivers/base/dd.c >+++ linux-2.6.18.ppc64/drivers/base/dd.c >@@ -45,6 +45,10 @@ void device_bind_driver(struct device * > > pr_debug("bound device '%s' to driver '%s'\n", > dev->bus_id, dev->driver->name); >+ if (dev->bus) >+ blocking_notifier_call_chain(&dev->bus->bus_notifier, >+ BUS_NOTIFY_BOUND_DRIVER, dev); >+ > klist_add_tail(&dev->knode_driver, &dev->driver->klist_devices); > sysfs_create_link(&dev->driver->kobj, &dev->kobj, > kobject_name(&dev->kobj)); >@@ -212,6 +216,10 @@ static void __device_release_driver(stru > sysfs_remove_link(&dev->kobj, "driver"); > klist_remove(&dev->knode_driver); > >+ if (dev->bus) >+ blocking_notifier_call_chain(&dev->bus->bus_notifier, >+ BUS_NOTIFY_UNBIND_DRIVER, >+ dev); > if (dev->bus && dev->bus->remove) > dev->bus->remove(dev); > else if (drv->remove) >Index: linux-2.6.18.ppc64/include/linux/device.h >=================================================================== >--- linux-2.6.18.ppc64.orig/include/linux/device.h >+++ linux-2.6.18.ppc64/include/linux/device.h >@@ -41,6 +41,8 @@ struct bus_type { > struct klist klist_devices; > struct klist klist_drivers; > >+ struct blocking_notifier_head bus_notifier; >+ > struct bus_attribute * bus_attrs; > struct device_attribute * dev_attrs; > struct driver_attribute * drv_attrs; >@@ -71,6 +73,28 @@ int bus_for_each_drv(struct bus_type * b > void * data, int (*fn)(struct device_driver *, void *)); > > >+/* >+ * Bus notifiers: Get notified of addition/removal of devices >+ * and binding/unbinding of drivers to devices. >+ * In the long run, it should be a replacement for the platform >+ * notify hooks. >+ */ >+struct notifier_block; >+ >+extern int bus_register_notifier(struct bus_type *bus, >+ struct notifier_block *nb); >+extern int bus_unregister_notifier(struct bus_type *bus, >+ struct notifier_block *nb); >+ >+/* All 4 notifers below get called with the target struct device * >+ * as an argument. Note that those functions are likely to be called >+ * with the device semaphore held in the core, so be careful. >+ */ >+#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */ >+#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */ >+#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ >+#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* about to be unbound */ >+ > /* driverfs interface for exporting bus attributes */ > > struct bus_attribute {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 438761
: 314153 |
314154
|
314155
|
314156
|
314157
|
314158
|
314159
|
314160
|
314161
|
314162
|
314163
|
314339
|
314426
|
314828
|
314829
|
316641