diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-23 13:25:27 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-23 13:25:27 -0700 |
commit | f2fea6a31b09a12fe4d9e9e3f9a8e2be017ad611 (patch) | |
tree | c16afc7b5e4b92cb361c6d2b3ec6f0e9a780a476 | |
parent | e930b8544abee8d7894d5f55af16cb5e7be25f9f (diff) | |
download | patches-f2fea6a31b09a12fe4d9e9e3f9a8e2be017ad611.tar.gz |
updates
-rw-r--r-- | applied/usb-adutux-remove-unneeded-tracing-macros.patch | 2 | ||||
-rw-r--r-- | driver-core-remove-dev_attrs-from-struct-class.patch | 6 | ||||
-rw-r--r-- | driver-core-remove-dev_bin_attrs-from-struct-class.patch | 8 | ||||
-rw-r--r-- | driver-core-remove-struct-bus_type.bus_attrs.patch (renamed from f1.patch) | 18 | ||||
-rw-r--r-- | f2.patch | 199 | ||||
-rw-r--r-- | pci-convert-bus-code-to-use-bus_groups.patch | 66 | ||||
-rw-r--r-- | ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch | 56 | ||||
-rw-r--r-- | ppc-vio-convert-bus-code-to-use-bus_groups.patch | 112 | ||||
-rw-r--r-- | rapidio-convert-bus-code-to-use-bus_groups.patch | 65 | ||||
-rw-r--r-- | rbd-convert-bus-code-to-use-bus_groups.patch | 46 | ||||
-rw-r--r-- | scsi-fcoe-convert-bus-code-to-use-bus_groups.patch | 46 | ||||
-rw-r--r-- | series | 12 | ||||
-rw-r--r-- | sysfs-add-sysfs_create-remove_groups.patch | 217 | ||||
-rw-r--r-- | xen-disable-clock-timer-when-shutting-down.patch | 30 |
14 files changed, 671 insertions, 212 deletions
diff --git a/applied/usb-adutux-remove-unneeded-tracing-macros.patch b/applied/usb-adutux-remove-unneeded-tracing-macros.patch index 8b26214ac16e42..b44db147c9ba90 100644 --- a/applied/usb-adutux-remove-unneeded-tracing-macros.patch +++ b/applied/usb-adutux-remove-unneeded-tracing-macros.patch @@ -183,7 +183,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> dev_err(&interface->dev, "udev is NULL.\n"); goto exit; @@ -833,8 +800,6 @@ static int adu_probe(struct usb_interfac - udev->descriptor.idProduct, dev->serial_number, + le16_to_cpu(udev->descriptor.idProduct), dev->serial_number, (dev->minor - ADU_MINOR_BASE)); exit: - dbg(2, " %s : leave, return value %p (dev)", __func__, dev); diff --git a/driver-core-remove-dev_attrs-from-struct-class.patch b/driver-core-remove-dev_attrs-from-struct-class.patch index ec54345270eba2..9a6ab2a13b9822 100644 --- a/driver-core-remove-dev_attrs-from-struct-class.patch +++ b/driver-core-remove-dev_attrs-from-struct-class.patch @@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> static int device_add_bin_attributes(struct device *dev, struct bin_attribute *attrs) { -@@ -530,12 +501,9 @@ static int device_add_attrs(struct devic +@@ -512,12 +483,9 @@ static int device_add_attrs(struct devic error = device_add_groups(dev, class->dev_groups); if (error) return error; @@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } if (type) { -@@ -562,9 +530,6 @@ static int device_add_attrs(struct devic +@@ -544,9 +512,6 @@ static int device_add_attrs(struct devic err_remove_class_bin_attrs: if (class) device_remove_bin_attributes(dev, class->dev_bin_attrs); @@ -75,7 +75,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> err_remove_class_groups: if (class) device_remove_groups(dev, class->dev_groups); -@@ -584,7 +549,6 @@ static void device_remove_attrs(struct d +@@ -566,7 +531,6 @@ static void device_remove_attrs(struct d device_remove_groups(dev, type->groups); if (class) { diff --git a/driver-core-remove-dev_bin_attrs-from-struct-class.patch b/driver-core-remove-dev_bin_attrs-from-struct-class.patch index b99ca8eb1363b4..8c83832c9f1393 100644 --- a/driver-core-remove-dev_bin_attrs-from-struct-class.patch +++ b/driver-core-remove-dev_bin_attrs-from-struct-class.patch @@ -52,8 +52,8 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> - int device_add_groups(struct device *dev, const struct attribute_group **groups) { - int error = 0; -@@ -501,15 +472,12 @@ static int device_add_attrs(struct devic + return sysfs_create_groups(&dev->kobj, groups); +@@ -483,15 +454,12 @@ static int device_add_attrs(struct devic error = device_add_groups(dev, class->dev_groups); if (error) return error; @@ -70,7 +70,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> } error = device_add_groups(dev, dev->groups); -@@ -527,9 +495,6 @@ static int device_add_attrs(struct devic +@@ -509,9 +477,6 @@ static int device_add_attrs(struct devic err_remove_type_groups: if (type) device_remove_groups(dev, type->groups); @@ -80,7 +80,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> err_remove_class_groups: if (class) device_remove_groups(dev, class->dev_groups); -@@ -548,10 +513,8 @@ static void device_remove_attrs(struct d +@@ -530,10 +495,8 @@ static void device_remove_attrs(struct d if (type) device_remove_groups(dev, type->groups); diff --git a/f1.patch b/driver-core-remove-struct-bus_type.bus_attrs.patch index a876248b348178..11b1e0c44ceb2b 100644 --- a/f1.patch +++ b/driver-core-remove-struct-bus_type.bus_attrs.patch @@ -1,3 +1,15 @@ +From foo@baz Fri Aug 23 13:10:49 PDT 2013 +Date: Fri, 23 Aug 2013 13:10:49 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: driver-core: remove struct bus_type.bus_attrs + +Now that all in-kernel users of bus_type.bus_attrs have been converted +to use bus_groups instead, the bus_attrs field, and logic surrounding +it, can be removed. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + --- drivers/base/bus.c | 42 ------------------------------------------ include/linux/device.h | 2 -- @@ -48,7 +60,7 @@ static int bus_add_groups(struct bus_type *bus, const struct attribute_group **groups) { -@@ -1001,9 +965,6 @@ int bus_register(struct bus_type *bus) +@@ -982,9 +946,6 @@ int bus_register(struct bus_type *bus) if (retval) goto bus_probe_files_fail; @@ -58,7 +70,7 @@ retval = bus_add_groups(bus, bus->bus_groups); if (retval) goto bus_groups_fail; -@@ -1012,8 +973,6 @@ int bus_register(struct bus_type *bus) +@@ -993,8 +954,6 @@ int bus_register(struct bus_type *bus) return 0; bus_groups_fail: @@ -67,7 +79,7 @@ remove_probe_files(bus); bus_probe_files_fail: kset_unregister(bus->p->drivers_kset); -@@ -1042,7 +1001,6 @@ void bus_unregister(struct bus_type *bus +@@ -1023,7 +982,6 @@ void bus_unregister(struct bus_type *bus pr_debug("bus: '%s': unregistering\n", bus->name); if (bus->dev_root) device_unregister(bus->dev_root); diff --git a/f2.patch b/f2.patch deleted file mode 100644 index d8eb2ce1a8b842..00000000000000 --- a/f2.patch +++ /dev/null @@ -1,199 +0,0 @@ ---- - arch/powerpc/kernel/ibmebus.c | 12 +++++++----- - drivers/block/rbd.c | 14 +++++++++----- - drivers/pci/pci-driver.c | 2 +- - drivers/pci/pci-sysfs.c | 16 +++++++++++++--- - drivers/pci/pci.h | 2 +- - drivers/rapidio/rio-driver.c | 2 +- - drivers/rapidio/rio-sysfs.c | 16 +++++++++++++--- - drivers/rapidio/rio.h | 2 +- - drivers/scsi/fcoe/fcoe_sysfs.c | 14 +++++++++----- - 9 files changed, 55 insertions(+), 25 deletions(-) - ---- a/arch/powerpc/kernel/ibmebus.c -+++ b/arch/powerpc/kernel/ibmebus.c -@@ -292,6 +292,7 @@ out: - return rc; - return count; - } -+static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove); - - static ssize_t ibmebus_store_remove(struct bus_type *bus, - const char *buf, size_t count) -@@ -317,13 +318,14 @@ static ssize_t ibmebus_store_remove(stru - return -ENODEV; - } - } -- -+static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove); - - static struct bus_attribute ibmebus_bus_attrs[] = { -- __ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe), -- __ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove), -- __ATTR_NULL -+ &bus_attr_probe.attr, -+ &bus_attr_probe.remove, -+ NULL, - }; -+ATTRIBUTE_GROUPS(ibmbus_bus); - - static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) - { -@@ -713,7 +715,7 @@ static struct dev_pm_ops ibmebus_bus_dev - struct bus_type ibmebus_bus_type = { - .name = "ibmebus", - .uevent = of_device_uevent_modalias, -- .bus_attrs = ibmebus_bus_attrs, -+ .bus_groups = ibmbus_bus_groups, - .match = ibmebus_bus_bus_match, - .probe = ibmebus_bus_device_probe, - .remove = ibmebus_bus_device_remove, ---- a/drivers/block/rbd.c -+++ b/drivers/block/rbd.c -@@ -397,15 +397,19 @@ static ssize_t rbd_remove(struct bus_typ - static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); - static void rbd_spec_put(struct rbd_spec *spec); - --static struct bus_attribute rbd_bus_attrs[] = { -- __ATTR(add, S_IWUSR, NULL, rbd_add), -- __ATTR(remove, S_IWUSR, NULL, rbd_remove), -- __ATTR_NULL -+static BUS_ATTR(add, S_IWUSR, NULL, rbd_add); -+static BUS_ATTR(remove, S_IWUSR, NULL, rbd_remove); -+ -+static struct attribute *rbd_bus_attrs[] = { -+ &bus_attr_add.attr, -+ &bus_attr_remove.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(rbd_bus); - - static struct bus_type rbd_bus_type = { - .name = "rbd", -- .bus_attrs = rbd_bus_attrs, -+ .bus_groups = rbd_bus_groups, - }; - - static void rbd_root_dev_release(struct device *dev) ---- a/drivers/pci/pci-driver.c -+++ b/drivers/pci/pci-driver.c -@@ -1274,7 +1274,7 @@ struct bus_type pci_bus_type = { - .remove = pci_device_remove, - .shutdown = pci_device_shutdown, - .dev_attrs = pci_dev_attrs, -- .bus_attrs = pci_bus_attrs, -+ .bus_groups = pci_bus_groups, - .drv_attrs = pci_drv_attrs, - .pm = PCI_PM_OPS_PTR, - }; ---- a/drivers/pci/pci-sysfs.c -+++ b/drivers/pci/pci-sysfs.c -@@ -302,10 +302,20 @@ static ssize_t bus_rescan_store(struct b - } - return count; - } -+static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store); - --struct bus_attribute pci_bus_attrs[] = { -- __ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store), -- __ATTR_NULL -+struct attribute *pci_bus_attrs[] = { -+ &bus_attr_rescan.attr, -+ NULL, -+}; -+ -+static const struct attribute_group pci_bus_group = { -+ .attrs = pci_bus_attrs, -+}; -+ -+const struct attribute_group *pci_bus_groups[] = { -+ &pci_bus_group, -+ NULL, - }; - - static ssize_t ---- a/drivers/pci/pci.h -+++ b/drivers/pci/pci.h -@@ -153,7 +153,7 @@ static inline int pci_no_d1d2(struct pci - extern struct device_attribute pci_dev_attrs[]; - extern const struct attribute_group *pcibus_groups[]; - extern struct device_type pci_dev_type; --extern struct bus_attribute pci_bus_attrs[]; -+extern const struct attribute_group *pci_bus_groups[]; - - - /** ---- a/drivers/rapidio/rio-driver.c -+++ b/drivers/rapidio/rio-driver.c -@@ -224,7 +224,7 @@ struct bus_type rio_bus_type = { - .name = "rapidio", - .match = rio_match_bus, - .dev_attrs = rio_dev_attrs, -- .bus_attrs = rio_bus_attrs, -+ .bus_groups = rio_bus_groups, - .probe = rio_device_probe, - .remove = rio_device_remove, - .uevent = rio_uevent, ---- a/drivers/rapidio/rio-sysfs.c -+++ b/drivers/rapidio/rio-sysfs.c -@@ -316,8 +316,18 @@ exit: - - return rc; - } -+static BUS_ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store); - --struct bus_attribute rio_bus_attrs[] = { -- __ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store), -- __ATTR_NULL -+static struct bus_attribute rio_bus_attrs[] = { -+ &bus_attr_scan.attr, -+ NULL, -+}; -+ -+static const struct attribute_group rio_bus_group = { -+ .attrs = rio_bus_attrs, -+}; -+ -+const struct attribute_group *rio_bus_groups[] = { -+ &rio_bus_group, -+ NULL, - }; ---- a/drivers/rapidio/rio.h -+++ b/drivers/rapidio/rio.h -@@ -49,7 +49,7 @@ extern int rio_mport_scan(int mport_id); - - /* Structures internal to the RIO core code */ - extern struct device_attribute rio_dev_attrs[]; --extern struct bus_attribute rio_bus_attrs[]; -+extern const struct attribute_group *rio_bus_groups[]; - - #define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16)) - #define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16)) ---- a/drivers/scsi/fcoe/fcoe_sysfs.c -+++ b/drivers/scsi/fcoe/fcoe_sysfs.c -@@ -553,16 +553,20 @@ static struct device_type fcoe_fcf_devic - .release = fcoe_fcf_device_release, - }; - --static struct bus_attribute fcoe_bus_attr_group[] = { -- __ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store), -- __ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store), -- __ATTR_NULL -+static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store); -+static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store); -+ -+static struct attribute *fcoe_bus_attrs[] = { -+ &bus_attr_ctlr_create.attr, -+ &bus_attr_ctrl_destroy.attr, -+ NULL, - }; -+ATTRIBUTE_GROUPS(fcoe_bus); - - static struct bus_type fcoe_bus_type = { - .name = "fcoe", - .match = &fcoe_bus_match, -- .bus_attrs = fcoe_bus_attr_group, -+ .bus_groups = fcoe_bus_groups, - }; - - /** diff --git a/pci-convert-bus-code-to-use-bus_groups.patch b/pci-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..7a3e0478564f9d --- /dev/null +++ b/pci-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,66 @@ +From foo@baz Fri Aug 23 13:13:27 PDT 2013 +Date: Fri, 23 Aug 2013 13:13:27 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: PCI: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the PCI bus code to use the +correct field. + +Cc: Bjorn Helgaas <bhelgaas@google.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/pci/pci-driver.c | 2 +- + drivers/pci/pci-sysfs.c | 16 +++++++++++++--- + drivers/pci/pci.h | 2 +- + 3 files changed, 15 insertions(+), 5 deletions(-) + +--- a/drivers/pci/pci-driver.c ++++ b/drivers/pci/pci-driver.c +@@ -1274,7 +1274,7 @@ struct bus_type pci_bus_type = { + .remove = pci_device_remove, + .shutdown = pci_device_shutdown, + .dev_attrs = pci_dev_attrs, +- .bus_attrs = pci_bus_attrs, ++ .bus_groups = pci_bus_groups, + .drv_attrs = pci_drv_attrs, + .pm = PCI_PM_OPS_PTR, + }; +--- a/drivers/pci/pci-sysfs.c ++++ b/drivers/pci/pci-sysfs.c +@@ -302,10 +302,20 @@ static ssize_t bus_rescan_store(struct b + } + return count; + } ++static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store); + +-struct bus_attribute pci_bus_attrs[] = { +- __ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store), +- __ATTR_NULL ++struct attribute *pci_bus_attrs[] = { ++ &bus_attr_rescan.attr, ++ NULL, ++}; ++ ++static const struct attribute_group pci_bus_group = { ++ .attrs = pci_bus_attrs, ++}; ++ ++const struct attribute_group *pci_bus_groups[] = { ++ &pci_bus_group, ++ NULL, + }; + + static ssize_t +--- a/drivers/pci/pci.h ++++ b/drivers/pci/pci.h +@@ -153,7 +153,7 @@ static inline int pci_no_d1d2(struct pci + extern struct device_attribute pci_dev_attrs[]; + extern const struct attribute_group *pcibus_groups[]; + extern struct device_type pci_dev_type; +-extern struct bus_attribute pci_bus_attrs[]; ++extern const struct attribute_group *pci_bus_groups[]; + + + /** diff --git a/ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch b/ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..7b6f87799b7277 --- /dev/null +++ b/ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,56 @@ +From foo@baz Fri Aug 23 13:21:43 PDT 2013 +Date: Fri, 23 Aug 2013 13:21:43 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: PPC: ibmebus: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the ibmebus bus code to use the +correct field. + +Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Cc: Paul Mackerras <paulus@samba.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/powerpc/kernel/ibmebus.c | 14 ++++++++------ + 1 file changed, 8 insertions(+), 6 deletions(-) + +--- a/arch/powerpc/kernel/ibmebus.c ++++ b/arch/powerpc/kernel/ibmebus.c +@@ -292,6 +292,7 @@ out: + return rc; + return count; + } ++static BUS_ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe); + + static ssize_t ibmebus_store_remove(struct bus_type *bus, + const char *buf, size_t count) +@@ -317,13 +318,14 @@ static ssize_t ibmebus_store_remove(stru + return -ENODEV; + } + } ++static BUS_ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove); + +- +-static struct bus_attribute ibmebus_bus_attrs[] = { +- __ATTR(probe, S_IWUSR, NULL, ibmebus_store_probe), +- __ATTR(remove, S_IWUSR, NULL, ibmebus_store_remove), +- __ATTR_NULL ++static struct attribute *ibmbus_bus_attrs[] = { ++ &bus_attr_probe.attr, ++ &bus_attr_remove.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ibmbus_bus); + + static int ibmebus_bus_bus_match(struct device *dev, struct device_driver *drv) + { +@@ -713,7 +715,7 @@ static struct dev_pm_ops ibmebus_bus_dev + struct bus_type ibmebus_bus_type = { + .name = "ibmebus", + .uevent = of_device_uevent_modalias, +- .bus_attrs = ibmebus_bus_attrs, ++ .bus_groups = ibmbus_bus_groups, + .match = ibmebus_bus_bus_match, + .probe = ibmebus_bus_device_probe, + .remove = ibmebus_bus_device_remove, diff --git a/ppc-vio-convert-bus-code-to-use-bus_groups.patch b/ppc-vio-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..9980809a102a98 --- /dev/null +++ b/ppc-vio-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,112 @@ +From foo@baz Fri Aug 23 13:21:48 PDT 2013 +Date: Fri, 23 Aug 2013 13:21:48 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: PPC: VIO: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the VIO bus code to use the +correct field. + +Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> +Cc: Paul Mackerras <paulus@samba.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + arch/powerpc/kernel/vio.c | 64 +++++++++++++++++++++++++--------------------- + 1 file changed, 35 insertions(+), 29 deletions(-) + +--- a/arch/powerpc/kernel/vio.c ++++ b/arch/powerpc/kernel/vio.c +@@ -997,21 +997,36 @@ static struct device_attribute vio_cmo_d + /* sysfs bus functions and data structures for CMO */ + + #define viobus_cmo_rd_attr(name) \ +-static ssize_t \ +-viobus_cmo_##name##_show(struct bus_type *bt, char *buf) \ ++static ssize_t cmo_##name##_show(struct bus_type *bt, char *buf) \ + { \ + return sprintf(buf, "%lu\n", vio_cmo.name); \ +-} ++} \ ++static BUS_ATTR_RO(cmo_##name) + + #define viobus_cmo_pool_rd_attr(name, var) \ + static ssize_t \ +-viobus_cmo_##name##_pool_show_##var(struct bus_type *bt, char *buf) \ ++cmo_##name##_##var##_show(struct bus_type *bt, char *buf) \ + { \ + return sprintf(buf, "%lu\n", vio_cmo.name.var); \ ++} \ ++static BUS_ATTR_RO(cmo_##name##_##var) ++ ++viobus_cmo_rd_attr(entitled); ++viobus_cmo_rd_attr(spare); ++viobus_cmo_rd_attr(min); ++viobus_cmo_rd_attr(desired); ++viobus_cmo_rd_attr(curr); ++viobus_cmo_pool_rd_attr(reserve, size); ++viobus_cmo_pool_rd_attr(excess, size); ++viobus_cmo_pool_rd_attr(excess, free); ++ ++static ssize_t cmo_high_show(struct bus_type *bt, char *buf) ++{ ++ return sprintf(buf, "%lu\n", vio_cmo.high); + } + +-static ssize_t viobus_cmo_high_reset(struct bus_type *bt, const char *buf, +- size_t count) ++static ssize_t cmo_high_store(struct bus_type *bt, const char *buf, ++ size_t count) + { + unsigned long flags; + +@@ -1021,35 +1036,26 @@ static ssize_t viobus_cmo_high_reset(str + + return count; + } ++static BUS_ATTR_RW(cmo_high); + +-viobus_cmo_rd_attr(entitled); +-viobus_cmo_pool_rd_attr(reserve, size); +-viobus_cmo_pool_rd_attr(excess, size); +-viobus_cmo_pool_rd_attr(excess, free); +-viobus_cmo_rd_attr(spare); +-viobus_cmo_rd_attr(min); +-viobus_cmo_rd_attr(desired); +-viobus_cmo_rd_attr(curr); +-viobus_cmo_rd_attr(high); +- +-static struct bus_attribute vio_cmo_bus_attrs[] = { +- __ATTR(cmo_entitled, S_IRUGO, viobus_cmo_entitled_show, NULL), +- __ATTR(cmo_reserve_size, S_IRUGO, viobus_cmo_reserve_pool_show_size, NULL), +- __ATTR(cmo_excess_size, S_IRUGO, viobus_cmo_excess_pool_show_size, NULL), +- __ATTR(cmo_excess_free, S_IRUGO, viobus_cmo_excess_pool_show_free, NULL), +- __ATTR(cmo_spare, S_IRUGO, viobus_cmo_spare_show, NULL), +- __ATTR(cmo_min, S_IRUGO, viobus_cmo_min_show, NULL), +- __ATTR(cmo_desired, S_IRUGO, viobus_cmo_desired_show, NULL), +- __ATTR(cmo_curr, S_IRUGO, viobus_cmo_curr_show, NULL), +- __ATTR(cmo_high, S_IWUSR|S_IRUSR|S_IWGRP|S_IRGRP|S_IROTH, +- viobus_cmo_high_show, viobus_cmo_high_reset), +- __ATTR_NULL ++static struct attribute *vio_bus_attrs[] = { ++ &bus_attr_cmo_entitled.attr, ++ &bus_attr_cmo_spare.attr, ++ &bus_attr_cmo_min.attr, ++ &bus_attr_cmo_desired.attr, ++ &bus_attr_cmo_curr.attr, ++ &bus_attr_cmo_high.attr, ++ &bus_attr_cmo_reserve_size.attr, ++ &bus_attr_cmo_excess_size.attr, ++ &bus_attr_cmo_excess_free.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(vio_bus); + + static void vio_cmo_sysfs_init(void) + { + vio_bus_type.dev_attrs = vio_cmo_dev_attrs; +- vio_bus_type.bus_attrs = vio_cmo_bus_attrs; ++ vio_bus_type.bus_groups = vio_bus_groups; + } + #else /* CONFIG_PPC_SMLPAR */ + int vio_cmo_entitlement_update(size_t new_entitlement) { return 0; } diff --git a/rapidio-convert-bus-code-to-use-bus_groups.patch b/rapidio-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..15790233ddeb21 --- /dev/null +++ b/rapidio-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,65 @@ +From foo@baz Fri Aug 23 13:18:15 PDT 2013 +Date: Fri, 23 Aug 2013 13:18:15 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: rapidio: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the rapidio bus code to use the +correct field. + +Cc: Matt Porter <mporter@kernel.crashing.org> +Cc: Alexandre Bounine <alexandre.bounine@idt.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/rapidio/rio-driver.c | 2 +- + drivers/rapidio/rio-sysfs.c | 16 +++++++++++++--- + drivers/rapidio/rio.h | 2 +- + 3 files changed, 15 insertions(+), 5 deletions(-) + +--- a/drivers/rapidio/rio-driver.c ++++ b/drivers/rapidio/rio-driver.c +@@ -224,7 +224,7 @@ struct bus_type rio_bus_type = { + .name = "rapidio", + .match = rio_match_bus, + .dev_attrs = rio_dev_attrs, +- .bus_attrs = rio_bus_attrs, ++ .bus_groups = rio_bus_groups, + .probe = rio_device_probe, + .remove = rio_device_remove, + .uevent = rio_uevent, +--- a/drivers/rapidio/rio-sysfs.c ++++ b/drivers/rapidio/rio-sysfs.c +@@ -316,8 +316,18 @@ exit: + + return rc; + } ++static BUS_ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store); + +-struct bus_attribute rio_bus_attrs[] = { +- __ATTR(scan, (S_IWUSR|S_IWGRP), NULL, bus_scan_store), +- __ATTR_NULL ++static struct attribute *rio_bus_attrs[] = { ++ &bus_attr_scan.attr, ++ NULL, ++}; ++ ++static const struct attribute_group rio_bus_group = { ++ .attrs = rio_bus_attrs, ++}; ++ ++const struct attribute_group *rio_bus_groups[] = { ++ &rio_bus_group, ++ NULL, + }; +--- a/drivers/rapidio/rio.h ++++ b/drivers/rapidio/rio.h +@@ -49,7 +49,7 @@ extern int rio_mport_scan(int mport_id); + + /* Structures internal to the RIO core code */ + extern struct device_attribute rio_dev_attrs[]; +-extern struct bus_attribute rio_bus_attrs[]; ++extern const struct attribute_group *rio_bus_groups[]; + + #define RIO_GET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x00ff0000) >> 16)) + #define RIO_SET_DID(size, x) (size ? (x & 0xffff) : ((x & 0x000000ff) << 16)) diff --git a/rbd-convert-bus-code-to-use-bus_groups.patch b/rbd-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..788c1bf82336dd --- /dev/null +++ b/rbd-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,46 @@ +From foo@baz Fri Aug 23 13:16:26 PDT 2013 +Date: Fri, 23 Aug 2013 13:16:26 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: rbd: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the RBD bus code to use the +correct field. + +Cc: Yehuda Sadeh <yehuda@inktank.com> +Cc: Sage Weil <sage@inktank.com> +Cc: Alex Elder <elder@inktank.com> +Cc: <ceph-devel@vger.kernel.org> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +--- + drivers/block/rbd.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/block/rbd.c ++++ b/drivers/block/rbd.c +@@ -397,15 +397,19 @@ static ssize_t rbd_remove(struct bus_typ + static int rbd_dev_image_probe(struct rbd_device *rbd_dev, bool mapping); + static void rbd_spec_put(struct rbd_spec *spec); + +-static struct bus_attribute rbd_bus_attrs[] = { +- __ATTR(add, S_IWUSR, NULL, rbd_add), +- __ATTR(remove, S_IWUSR, NULL, rbd_remove), +- __ATTR_NULL ++static BUS_ATTR(add, S_IWUSR, NULL, rbd_add); ++static BUS_ATTR(remove, S_IWUSR, NULL, rbd_remove); ++ ++static struct attribute *rbd_bus_attrs[] = { ++ &bus_attr_add.attr, ++ &bus_attr_remove.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(rbd_bus); + + static struct bus_type rbd_bus_type = { + .name = "rbd", +- .bus_attrs = rbd_bus_attrs, ++ .bus_groups = rbd_bus_groups, + }; + + static void rbd_root_dev_release(struct device *dev) diff --git a/scsi-fcoe-convert-bus-code-to-use-bus_groups.patch b/scsi-fcoe-convert-bus-code-to-use-bus_groups.patch new file mode 100644 index 00000000000000..5c8d4bf355d135 --- /dev/null +++ b/scsi-fcoe-convert-bus-code-to-use-bus_groups.patch @@ -0,0 +1,46 @@ +From foo@baz Fri Aug 23 13:21:55 PDT 2013 +Date: Fri, 23 Aug 2013 13:21:55 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: SCSI: fcoe: convert bus code to use bus_groups + +The bus_attrs field of struct bus_type is going away soon, dev_groups +should be used instead. This converts the fcoe bus code to use the +correct field. + +Cc: Robert Love <robert.w.love@intel.com> +Cc: "James E.J. Bottomley" <JBottomley@parallels.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/scsi/fcoe/fcoe_sysfs.c | 14 +++++++++----- + 1 file changed, 9 insertions(+), 5 deletions(-) + +--- a/drivers/scsi/fcoe/fcoe_sysfs.c ++++ b/drivers/scsi/fcoe/fcoe_sysfs.c +@@ -553,16 +553,20 @@ static struct device_type fcoe_fcf_devic + .release = fcoe_fcf_device_release, + }; + +-static struct bus_attribute fcoe_bus_attr_group[] = { +- __ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store), +- __ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store), +- __ATTR_NULL ++static BUS_ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store); ++static BUS_ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store); ++ ++static struct attribute *fcoe_bus_attrs[] = { ++ &bus_attr_ctlr_create.attr, ++ &bus_attr_ctrl_destroy.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(fcoe_bus); + + static struct bus_type fcoe_bus_type = { + .name = "fcoe", + .match = &fcoe_bus_match, +- .bus_attrs = fcoe_bus_attr_group, ++ .bus_groups = fcoe_bus_groups, + }; + + /** @@ -1,3 +1,4 @@ +xen-disable-clock-timer-when-shutting-down.patch serial-8250_pci-add-support-for-fintek-4-8-and-12-port-cards.patch # patches already in my git trees, but still here so I don't loose them. @@ -81,6 +82,7 @@ pwm-convert-class-code-to-use-dev_groups.patch driver-core-bus_type-add-dev_groups.patch driver-core-bus_type-add-drv_groups.patch driver-core-bus_type-add-bus_groups.patch +sysfs-add-sysfs_create-remove_groups.patch driver-core-remove-dev_attrs-from-struct-class.patch driver-core-remove-dev_bin_attrs-from-struct-class.patch @@ -93,9 +95,15 @@ driver-core-remove-dev_bin_attrs-from-struct-class.patch usb-serial-move-the-simple-drivers-into.patch +pci-convert-bus-code-to-use-bus_groups.patch +rbd-convert-bus-code-to-use-bus_groups.patch +rapidio-convert-bus-code-to-use-bus_groups.patch +ppc-ibmebus-convert-bus-code-to-use-bus_groups.patch +ppc-vio-convert-bus-code-to-use-bus_groups.patch +scsi-fcoe-convert-bus-code-to-use-bus_groups.patch +driver-core-remove-struct-bus_type.bus_attrs.patch + -f1.patch -f2.patch f3.patch f4.patch diff --git a/sysfs-add-sysfs_create-remove_groups.patch b/sysfs-add-sysfs_create-remove_groups.patch new file mode 100644 index 00000000000000..a47afd00a1c8f0 --- /dev/null +++ b/sysfs-add-sysfs_create-remove_groups.patch @@ -0,0 +1,217 @@ +From foo@baz Wed Aug 21 13:10:49 PDT 2013 +Date: Wed, 21 Aug 2013 13:10:49 -0700 +To: Greg KH <gregkh@linuxfoundation.org> +From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> +Subject: [PATCH] sysfs: add sysfs_create/remove_groups() + +These functions are being open-coded in 3 different places in the driver +core, and other driver subsystems will want to start doing this as well, +so move it to the sysfs core to keep it all in one place, where we know +it is written properly. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + drivers/base/bus.c | 23 +-------------------- + drivers/base/core.c | 22 +------------------- + drivers/base/driver.c | 22 +------------------- + fs/sysfs/group.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++ + include/linux/sysfs.h | 4 +++ + 5 files changed, 64 insertions(+), 61 deletions(-) + +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -884,32 +884,13 @@ static void bus_remove_attrs(struct bus_ + static int bus_add_groups(struct bus_type *bus, + const struct attribute_group **groups) + { +- int error = 0; +- int i; +- +- if (groups) { +- for (i = 0; groups[i]; i++) { +- error = sysfs_create_group(&bus->p->subsys.kobj, +- groups[i]); +- if (error) { +- while (--i >= 0) +- sysfs_remove_group(&bus->p->subsys.kobj, +- groups[i]); +- break; +- } +- } +- } +- return error; ++ return sysfs_create_groups(&bus->p->subsys.kobj, groups); + } + + static void bus_remove_groups(struct bus_type *bus, + const struct attribute_group **groups) + { +- int i; +- +- if (groups) +- for (i = 0; groups[i]; i++) +- sysfs_remove_group(&bus->p->subsys.kobj, groups[i]); ++ sysfs_remove_groups(&bus->p->subsys.kobj, groups); + } + + static void klist_devices_get(struct klist_node *n) +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -493,31 +493,13 @@ static void device_remove_bin_attributes + + int device_add_groups(struct device *dev, const struct attribute_group **groups) + { +- int error = 0; +- int i; +- +- if (groups) { +- for (i = 0; groups[i]; i++) { +- error = sysfs_create_group(&dev->kobj, groups[i]); +- if (error) { +- while (--i >= 0) +- sysfs_remove_group(&dev->kobj, +- groups[i]); +- break; +- } +- } +- } +- return error; ++ return sysfs_create_groups(&dev->kobj, groups); + } + + void device_remove_groups(struct device *dev, + const struct attribute_group **groups) + { +- int i; +- +- if (groups) +- for (i = 0; groups[i]; i++) +- sysfs_remove_group(&dev->kobj, groups[i]); ++ sysfs_remove_groups(&dev->kobj, groups); + } + + static int device_add_attrs(struct device *dev) +--- a/drivers/base/driver.c ++++ b/drivers/base/driver.c +@@ -126,31 +126,13 @@ EXPORT_SYMBOL_GPL(driver_remove_file); + int driver_add_groups(struct device_driver *drv, + const struct attribute_group **groups) + { +- int error = 0; +- int i; +- +- if (groups) { +- for (i = 0; groups[i]; i++) { +- error = sysfs_create_group(&drv->p->kobj, groups[i]); +- if (error) { +- while (--i >= 0) +- sysfs_remove_group(&drv->p->kobj, +- groups[i]); +- break; +- } +- } +- } +- return error; ++ return sysfs_create_groups(&drv->p->kobj, groups); + } + + void driver_remove_groups(struct device_driver *drv, + const struct attribute_group **groups) + { +- int i; +- +- if (groups) +- for (i = 0; groups[i]; i++) +- sysfs_remove_group(&drv->p->kobj, groups[i]); ++ sysfs_remove_groups(&drv->p->kobj, groups); + } + + /** +--- a/fs/sysfs/group.c ++++ b/fs/sysfs/group.c +@@ -131,6 +131,40 @@ int sysfs_create_group(struct kobject *k + } + + /** ++ * sysfs_create_groups - given a directory kobject, create a bunch of attribute groups ++ * @kobj: The kobject to create the group on ++ * @groups: The attribute groups to create, NULL terminated ++ * ++ * This function creates a bunch of attribute groups. If an error occurs when ++ * creating a group, all previously created groups will be removed, unwinding ++ * everything back to the original state when this function was called. ++ * It will explicitly warn and error if any of the attribute files being ++ * created already exist. ++ * ++ * Returns 0 on success or error code from sysfs_create_groups on error. ++ */ ++int sysfs_create_groups(struct kobject *kobj, ++ const struct attribute_group **groups) ++{ ++ int error = 0; ++ int i; ++ ++ if (!groups) ++ return 0; ++ ++ for (i = 0; groups[i]; i++) { ++ error = sysfs_create_group(kobj, groups[i]); ++ if (error) { ++ while (--i >= 0) ++ sysfs_remove_group(kobj, groups[i]); ++ break; ++ } ++ } ++ return error; ++} ++EXPORT_SYMBOL_GPL(sysfs_create_groups); ++ ++/** + * sysfs_update_group - given a directory kobject, update an attribute group + * @kobj: The kobject to update the group on + * @grp: The attribute group to update +@@ -179,6 +213,26 @@ void sysfs_remove_group(struct kobject * + } + + /** ++ * sysfs_remove_groups - remove a list of groups ++ * ++ * kobj: The kobject for the groups to be removed from ++ * groups: NULL terminated list of groups to be removed ++ * ++ * If groups is not NULL, the all groups will be removed from the kobject ++ */ ++void sysfs_remove_groups(struct kobject *kobj, ++ const struct attribute_group **groups) ++{ ++ int i; ++ ++ if (!groups) ++ return; ++ for (i = 0; groups[i]; i++) ++ sysfs_remove_group(kobj, groups[i]); ++} ++EXPORT_SYMBOL_GPL(sysfs_remove_groups); ++ ++/** + * sysfs_merge_group - merge files into a pre-existing attribute group. + * @kobj: The kobject containing the group. + * @grp: The files to create and the attribute group they belong to. +--- a/include/linux/sysfs.h ++++ b/include/linux/sysfs.h +@@ -215,10 +215,14 @@ void sysfs_delete_link(struct kobject *d + + int __must_check sysfs_create_group(struct kobject *kobj, + const struct attribute_group *grp); ++int __must_check sysfs_create_groups(struct kobject *kobj, ++ const struct attribute_group **groups); + int sysfs_update_group(struct kobject *kobj, + const struct attribute_group *grp); + void sysfs_remove_group(struct kobject *kobj, + const struct attribute_group *grp); ++void sysfs_remove_groups(struct kobject *kobj, ++ const struct attribute_group **groups); + int sysfs_add_file_to_group(struct kobject *kobj, + const struct attribute *attr, const char *group); + void sysfs_remove_file_from_group(struct kobject *kobj, diff --git a/xen-disable-clock-timer-when-shutting-down.patch b/xen-disable-clock-timer-when-shutting-down.patch new file mode 100644 index 00000000000000..c1c59384769016 --- /dev/null +++ b/xen-disable-clock-timer-when-shutting-down.patch @@ -0,0 +1,30 @@ +From: Daniel Kiper <dkiper@net-space.pl> +Subject: xen: disable clock timer when shutting down. + +This is needed as some Amazon EC2 machines can't restart the timer +properly in the kexec-ed kernel, as jiffies are not being incremented. + +Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> + +--- + arch/x86/xen/time.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/arch/x86/xen/time.c ++++ b/arch/x86/xen/time.c +@@ -289,7 +289,15 @@ static void xen_timerop_set_mode(enum cl + + case CLOCK_EVT_MODE_UNUSED: + case CLOCK_EVT_MODE_SHUTDOWN: ++#if 0 ++ /* ++ * Disabled due to some Amazon EC2 machines are not able to ++ * restart timer properly in crash kernel. If this happens then ++ * it hangs in loop in calibrate_delay_direct() because jiffies ++ * are not incremented. ++ */ + HYPERVISOR_set_timer_op(0); /* cancel timeout */ ++#endif + break; + } + } |