diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-04 17:26:39 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-09-04 17:26:39 -0700 |
commit | 1d0da63c6781741b6e9cc9558b13918c09445903 (patch) | |
tree | 069426fd313f3a6758c1ece7c74e63530796d481 | |
parent | f2a4447ad2255b39ebc3de81bf020ea667fdf983 (diff) | |
download | patches-1d0da63c6781741b6e9cc9558b13918c09445903.tar.gz |
more patches added to clean up dev_attrs
-rw-r--r-- | f01.patch | 88 | ||||
-rw-r--r-- | f02.patch | 81 | ||||
-rw-r--r-- | f03.patch | 85 | ||||
-rw-r--r-- | f04.patch | 55 | ||||
-rw-r--r-- | f05.patch | 97 | ||||
-rw-r--r-- | f06.patch | 97 | ||||
-rw-r--r-- | f07.patch | 94 | ||||
-rw-r--r-- | f08.patch | 158 | ||||
-rw-r--r-- | f09.patch | 142 | ||||
-rw-r--r-- | f10.patch | 146 | ||||
-rw-r--r-- | f11.patch | 95 | ||||
-rw-r--r-- | f12.patch | 127 | ||||
-rw-r--r-- | f13.patch | 282 | ||||
-rw-r--r-- | i01.patch | 108 | ||||
-rw-r--r-- | i02.patch | 42 | ||||
-rw-r--r-- | s01.patch | 49 | ||||
-rw-r--r-- | s02.patch | 98 | ||||
-rw-r--r-- | series | 19 |
18 files changed, 1862 insertions, 1 deletions
diff --git a/f01.patch b/f01.patch new file mode 100644 index 00000000000000..cb285aa67315cb --- /dev/null +++ b/f01.patch @@ -0,0 +1,88 @@ +--- + drivers/hv/channel.c | 1 - + drivers/hv/vmbus_drv.c | 23 ++++++++++++++++++----- + include/linux/hyperv.h | 1 - + 3 files changed, 18 insertions(+), 7 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -69,7 +69,6 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_group = (u8)channel->offermsg.monitorid / 32; + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + +- debuginfo->relid = channel->offermsg.child_relid; + debuginfo->state = channel->state; + memcpy(&debuginfo->interfacetype, + &channel->offermsg.offer.if_type, sizeof(uuid_le)); +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,7 +47,6 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- u32 chn_id; + u32 chn_state; + uuid_le chn_type; + uuid_le chn_instance; +@@ -83,7 +82,6 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- info->chn_id = debug_info.relid; + info->chn_state = debug_info.state; + memcpy(&info->chn_type, &debug_info.interfacetype, + sizeof(uuid_le)); +@@ -156,8 +154,6 @@ static ssize_t vmbus_show_device_attr(st + ret = sprintf(buf, "vmbus:%s\n", alias_name); + } else if (!strcmp(dev_attr->attr.name, "state")) { + ret = sprintf(buf, "%d\n", device_info->chn_state); +- } else if (!strcmp(dev_attr->attr.name, "id")) { +- ret = sprintf(buf, "%d\n", device_info->chn_id); + } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { + ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); + } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { +@@ -204,9 +200,25 @@ static ssize_t vmbus_show_device_attr(st + return ret; + } + ++static ssize_t id_show(struct device *dev, struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", hv_dev->channel->offermsg.child_relid); ++} ++static DEVICE_ATTR_RO(id); ++ ++static struct attribute *vmbus_attrs[] = { ++ &dev_attr_id.attr, ++ NULL, ++}; ++ATTRIBUTE_GROUPS(vmbus); ++ + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(state, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), +@@ -384,6 +396,7 @@ static struct bus_type hv_bus = { + .probe = vmbus_probe, + .uevent = vmbus_uevent, + .dev_attrs = vmbus_device_attrs, ++ .dev_groups = vmbus_groups, + }; + + static const char *driver_name = "hyperv"; +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,7 +900,6 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- u32 relid; + enum vmbus_channel_state state; + uuid_le interfacetype; + uuid_le interface_instance; diff --git a/f02.patch b/f02.patch new file mode 100644 index 00000000000000..dfa1cb0854bab8 --- /dev/null +++ b/f02.patch @@ -0,0 +1,81 @@ +--- + drivers/hv/channel.c | 1 - + drivers/hv/vmbus_drv.c | 17 ++++++++++++----- + include/linux/hyperv.h | 1 - + 3 files changed, 12 insertions(+), 7 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -69,7 +69,6 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_group = (u8)channel->offermsg.monitorid / 32; + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + +- debuginfo->state = channel->state; + memcpy(&debuginfo->interfacetype, + &channel->offermsg.offer.if_type, sizeof(uuid_le)); + memcpy(&debuginfo->interface_instance, +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,7 +47,6 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- u32 chn_state; + uuid_le chn_type; + uuid_le chn_instance; + +@@ -82,7 +81,6 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- info->chn_state = debug_info.state; + memcpy(&info->chn_type, &debug_info.interfacetype, + sizeof(uuid_le)); + memcpy(&info->chn_instance, &debug_info.interface_instance, +@@ -152,8 +150,6 @@ static ssize_t vmbus_show_device_attr(st + } else if (!strcmp(dev_attr->attr.name, "modalias")) { + print_alias_name(hv_dev, alias_name); + ret = sprintf(buf, "vmbus:%s\n", alias_name); +- } else if (!strcmp(dev_attr->attr.name, "state")) { +- ret = sprintf(buf, "%d\n", device_info->chn_state); + } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { + ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); + } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { +@@ -211,15 +207,26 @@ static ssize_t id_show(struct device *de + } + static DEVICE_ATTR_RO(id); + ++static ssize_t state_show(struct device *dev, struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", hv_dev->channel->state); ++} ++static DEVICE_ATTR_RO(state); ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, ++ &dev_attr_state.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(state, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(monitor_id, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,7 +900,6 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- enum vmbus_channel_state state; + uuid_le interfacetype; + uuid_le interface_instance; + u32 monitorid; diff --git a/f03.patch b/f03.patch new file mode 100644 index 00000000000000..a2720f574d4966 --- /dev/null +++ b/f03.patch @@ -0,0 +1,85 @@ +--- + drivers/hv/channel.c | 2 -- + drivers/hv/vmbus_drv.c | 18 ++++++++++++------ + include/linux/hyperv.h | 1 - + 3 files changed, 12 insertions(+), 9 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -77,8 +77,6 @@ void vmbus_get_debug_info(struct vmbus_c + + monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages; + +- debuginfo->monitorid = channel->offermsg.monitorid; +- + debuginfo->servermonitor_pending = + monitorpage->trigger_group[monitor_group].pending; + debuginfo->servermonitor_latency = +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -50,7 +50,6 @@ struct hv_device_info { + uuid_le chn_type; + uuid_le chn_instance; + +- u32 monitor_id; + u32 server_monitor_pending; + u32 server_monitor_latency; + u32 server_monitor_conn_id; +@@ -86,8 +85,6 @@ static void get_channel_info(struct hv_d + memcpy(&info->chn_instance, &debug_info.interface_instance, + sizeof(uuid_le)); + +- info->monitor_id = debug_info.monitorid; +- + info->server_monitor_pending = debug_info.servermonitor_pending; + info->server_monitor_latency = debug_info.servermonitor_latency; + info->server_monitor_conn_id = debug_info.servermonitor_connectionid; +@@ -174,8 +171,6 @@ static ssize_t vmbus_show_device_attr(st + } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->inbound.bytes_avail_towrite); +- } else if (!strcmp(dev_attr->attr.name, "monitor_id")) { +- ret = sprintf(buf, "%d\n", device_info->monitor_id); + } else if (!strcmp(dev_attr->attr.name, "server_monitor_pending")) { + ret = sprintf(buf, "%d\n", device_info->server_monitor_pending); + } else if (!strcmp(dev_attr->attr.name, "server_monitor_latency")) { +@@ -218,9 +213,21 @@ static ssize_t state_show(struct device + } + static DEVICE_ATTR_RO(state); + ++static ssize_t monitor_id_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", hv_dev->channel->offermsg.monitorid); ++} ++static DEVICE_ATTR_RO(monitor_id); ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, ++ &dev_attr_monitor_id.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); +@@ -229,7 +236,6 @@ ATTRIBUTE_GROUPS(vmbus); + static struct device_attribute vmbus_device_attrs[] = { + __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(monitor_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(modalias, S_IRUGO, vmbus_show_device_attr, NULL), + + __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -902,7 +902,6 @@ enum vmbus_channel_state { + struct vmbus_channel_debug_info { + uuid_le interfacetype; + uuid_le interface_instance; +- u32 monitorid; + u32 servermonitor_pending; + u32 servermonitor_latency; + u32 servermonitor_connectionid; diff --git a/f04.patch b/f04.patch new file mode 100644 index 00000000000000..706af61fa2a1ab --- /dev/null +++ b/f04.patch @@ -0,0 +1,55 @@ +--- + drivers/hv/vmbus_drv.c | 17 ++++++++++++----- + 1 file changed, 12 insertions(+), 5 deletions(-) + +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -131,7 +131,6 @@ static ssize_t vmbus_show_device_attr(st + { + struct hv_device *hv_dev = device_to_hv_device(dev); + struct hv_device_info *device_info; +- char alias_name[VMBUS_ALIAS_LEN + 1]; + int ret = 0; + + device_info = kzalloc(sizeof(struct hv_device_info), GFP_KERNEL); +@@ -144,9 +143,6 @@ static ssize_t vmbus_show_device_attr(st + ret = sprintf(buf, "{%pUl}\n", device_info->chn_type.b); + } else if (!strcmp(dev_attr->attr.name, "device_id")) { + ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b); +- } else if (!strcmp(dev_attr->attr.name, "modalias")) { +- print_alias_name(hv_dev, alias_name); +- ret = sprintf(buf, "vmbus:%s\n", alias_name); + } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { + ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); + } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { +@@ -224,10 +220,22 @@ static ssize_t monitor_id_show(struct de + } + static DEVICE_ATTR_RO(monitor_id); + ++static ssize_t modalias_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ char alias_name[VMBUS_ALIAS_LEN + 1]; ++ ++ print_alias_name(hv_dev, alias_name); ++ return sprintf(buf, "vmbus:%s\n", alias_name); ++} ++static DEVICE_ATTR_RO(modalias); ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, + &dev_attr_monitor_id.attr, ++ &dev_attr_modalias.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); +@@ -236,7 +244,6 @@ ATTRIBUTE_GROUPS(vmbus); + static struct device_attribute vmbus_device_attrs[] = { + __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(modalias, S_IRUGO, vmbus_show_device_attr, NULL), + + __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), diff --git a/f05.patch b/f05.patch new file mode 100644 index 00000000000000..f77e0239e38971 --- /dev/null +++ b/f05.patch @@ -0,0 +1,97 @@ +--- + drivers/hv/channel.c | 2 -- + drivers/hv/vmbus_drv.c | 22 +++++++++++++++------- + include/linux/hyperv.h | 1 - + 3 files changed, 15 insertions(+), 10 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -69,8 +69,6 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_group = (u8)channel->offermsg.monitorid / 32; + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + +- memcpy(&debuginfo->interfacetype, +- &channel->offermsg.offer.if_type, sizeof(uuid_le)); + memcpy(&debuginfo->interface_instance, + &channel->offermsg.offer.if_instance, + sizeof(uuid_le)); +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,7 +47,6 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- uuid_le chn_type; + uuid_le chn_instance; + + u32 server_monitor_pending; +@@ -80,8 +79,6 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- memcpy(&info->chn_type, &debug_info.interfacetype, +- sizeof(uuid_le)); + memcpy(&info->chn_instance, &debug_info.interface_instance, + sizeof(uuid_le)); + +@@ -139,9 +136,7 @@ static ssize_t vmbus_show_device_attr(st + + get_channel_info(hv_dev, device_info); + +- if (!strcmp(dev_attr->attr.name, "class_id")) { +- ret = sprintf(buf, "{%pUl}\n", device_info->chn_type.b); +- } else if (!strcmp(dev_attr->attr.name, "device_id")) { ++ if (!strcmp(dev_attr->attr.name, "device_id")) { + ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b); + } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { + ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); +@@ -220,6 +215,18 @@ static ssize_t monitor_id_show(struct de + } + static DEVICE_ATTR_RO(monitor_id); + ++static ssize_t class_id_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "{%pUl}\n", ++ hv_dev->channel->offermsg.offer.if_type.b); ++} ++static DEVICE_ATTR_RO(class_id); ++ + static ssize_t modalias_show(struct device *dev, + struct device_attribute *dev_attr, char *buf) + { +@@ -231,10 +238,12 @@ static ssize_t modalias_show(struct devi + } + static DEVICE_ATTR_RO(modalias); + ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, + &dev_attr_monitor_id.attr, ++ &dev_attr_class_id.attr, + &dev_attr_modalias.attr, + NULL, + }; +@@ -242,7 +251,6 @@ ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(class_id, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), + + __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,7 +900,6 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- uuid_le interfacetype; + uuid_le interface_instance; + u32 servermonitor_pending; + u32 servermonitor_latency; diff --git a/f06.patch b/f06.patch new file mode 100644 index 00000000000000..1140c4aee2e17e --- /dev/null +++ b/f06.patch @@ -0,0 +1,97 @@ +--- + drivers/hv/channel.c | 4 ---- + drivers/hv/vmbus_drv.c | 24 ++++++++++++++---------- + include/linux/hyperv.h | 1 - + 3 files changed, 14 insertions(+), 15 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -69,10 +69,6 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_group = (u8)channel->offermsg.monitorid / 32; + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + +- memcpy(&debuginfo->interface_instance, +- &channel->offermsg.offer.if_instance, +- sizeof(uuid_le)); +- + monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages; + + debuginfo->servermonitor_pending = +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,8 +47,6 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- uuid_le chn_instance; +- + u32 server_monitor_pending; + u32 server_monitor_latency; + u32 server_monitor_conn_id; +@@ -79,9 +77,6 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- memcpy(&info->chn_instance, &debug_info.interface_instance, +- sizeof(uuid_le)); +- + info->server_monitor_pending = debug_info.servermonitor_pending; + info->server_monitor_latency = debug_info.servermonitor_latency; + info->server_monitor_conn_id = debug_info.servermonitor_connectionid; +@@ -136,9 +131,7 @@ static ssize_t vmbus_show_device_attr(st + + get_channel_info(hv_dev, device_info); + +- if (!strcmp(dev_attr->attr.name, "device_id")) { +- ret = sprintf(buf, "{%pUl}\n", device_info->chn_instance.b); +- } else if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { ++ if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { + ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); + } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { + ret = sprintf(buf, "%d\n", device_info->outbound.read_idx); +@@ -227,6 +220,18 @@ static ssize_t class_id_show(struct devi + } + static DEVICE_ATTR_RO(class_id); + ++static ssize_t device_id_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "{%pUl}\n", ++ hv_dev->channel->offermsg.offer.if_instance.b); ++} ++static DEVICE_ATTR_RO(device_id); ++ + static ssize_t modalias_show(struct device *dev, + struct device_attribute *dev_attr, char *buf) + { +@@ -244,6 +249,7 @@ static struct attribute *vmbus_attrs[] = + &dev_attr_state.attr, + &dev_attr_monitor_id.attr, + &dev_attr_class_id.attr, ++ &dev_attr_device_id.attr, + &dev_attr_modalias.attr, + NULL, + }; +@@ -251,8 +257,6 @@ ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(device_id, S_IRUGO, vmbus_show_device_attr, NULL), +- + __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,7 +900,6 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- uuid_le interface_instance; + u32 servermonitor_pending; + u32 servermonitor_latency; + u32 servermonitor_connectionid; diff --git a/f07.patch b/f07.patch new file mode 100644 index 00000000000000..4deced3d2168e0 --- /dev/null +++ b/f07.patch @@ -0,0 +1,94 @@ +--- + drivers/hv/channel.c | 10 ++++------ + drivers/hv/connection.c | 21 ++++++++++----------- + drivers/hv/hyperv_vmbus.h | 2 +- + 3 files changed, 15 insertions(+), 18 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -47,8 +47,8 @@ static void vmbus_setevent(struct vmbus_ + (unsigned long *) vmbus_connection.send_int_page + + (channel->offermsg.child_relid >> 5)); + +- monitorpage = vmbus_connection.monitor_pages; +- monitorpage++; /* Get the child to parent monitor page */ ++ /* Get the child to parent monitor page */ ++ monitorpage = vmbus_connection.monitor_pages[1]; + + sync_set_bit(channel->monitor_bit, + (unsigned long *)&monitorpage->trigger_group +@@ -69,8 +69,7 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_group = (u8)channel->offermsg.monitorid / 32; + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + +- monitorpage = (struct hv_monitor_page *)vmbus_connection.monitor_pages; +- ++ monitorpage = vmbus_connection.monitor_pages[0]; + debuginfo->servermonitor_pending = + monitorpage->trigger_group[monitor_group].pending; + debuginfo->servermonitor_latency = +@@ -79,8 +78,7 @@ void vmbus_get_debug_info(struct vmbus_c + monitorpage->parameter[monitor_group] + [monitor_offset].connectionid.u.id; + +- monitorpage++; +- ++ monitorpage = vmbus_connection.monitor_pages[1]; + debuginfo->clientmonitor_pending = + monitorpage->trigger_group[monitor_group].pending; + debuginfo->clientmonitor_latency = +--- a/drivers/hv/connection.c ++++ b/drivers/hv/connection.c +@@ -76,10 +76,8 @@ static int vmbus_negotiate_version(struc + msg->header.msgtype = CHANNELMSG_INITIATE_CONTACT; + msg->vmbus_version_requested = version; + msg->interrupt_page = virt_to_phys(vmbus_connection.int_page); +- msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages); +- msg->monitor_page2 = virt_to_phys( +- (void *)((unsigned long)vmbus_connection.monitor_pages + +- PAGE_SIZE)); ++ msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]); ++ msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]); + + /* + * Add to list before we send the request since we may +@@ -169,9 +167,10 @@ int vmbus_connect(void) + * Setup the monitor notification facility. The 1st page for + * parent->child and the 2nd page for child->parent + */ +- vmbus_connection.monitor_pages = +- (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 1); +- if (vmbus_connection.monitor_pages == NULL) { ++ vmbus_connection.monitor_pages[0] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0); ++ vmbus_connection.monitor_pages[1] = (void *)__get_free_pages((GFP_KERNEL|__GFP_ZERO), 0); ++ if ((vmbus_connection.monitor_pages[0] == NULL) || ++ (vmbus_connection.monitor_pages[1] == NULL)) { + ret = -ENOMEM; + goto cleanup; + } +@@ -229,10 +228,10 @@ cleanup: + vmbus_connection.int_page = NULL; + } + +- if (vmbus_connection.monitor_pages) { +- free_pages((unsigned long)vmbus_connection.monitor_pages, 1); +- vmbus_connection.monitor_pages = NULL; +- } ++ free_pages((unsigned long)vmbus_connection.monitor_pages[0], 1); ++ free_pages((unsigned long)vmbus_connection.monitor_pages[1], 1); ++ vmbus_connection.monitor_pages[0] = NULL; ++ vmbus_connection.monitor_pages[1] = NULL; + + kfree(msginfo); + +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -612,7 +612,7 @@ struct vmbus_connection { + * 2 pages - 1st page for parent->child notification and 2nd + * is child->parent notification + */ +- void *monitor_pages; ++ struct hv_monitor_page *monitor_pages[2]; + struct list_head chn_msg_list; + spinlock_t channelmsg_lock; + diff --git a/f08.patch b/f08.patch new file mode 100644 index 00000000000000..4b356a194b0739 --- /dev/null +++ b/f08.patch @@ -0,0 +1,158 @@ +--- + drivers/hv/channel.c | 4 --- + drivers/hv/vmbus_drv.c | 56 ++++++++++++++++++++++++++++++++++++++++--------- + include/linux/hyperv.h | 2 - + 3 files changed, 46 insertions(+), 16 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -70,8 +70,6 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + + monitorpage = vmbus_connection.monitor_pages[0]; +- debuginfo->servermonitor_pending = +- monitorpage->trigger_group[monitor_group].pending; + debuginfo->servermonitor_latency = + monitorpage->latency[monitor_group][monitor_offset]; + debuginfo->servermonitor_connectionid = +@@ -79,8 +77,6 @@ void vmbus_get_debug_info(struct vmbus_c + [monitor_offset].connectionid.u.id; + + monitorpage = vmbus_connection.monitor_pages[1]; +- debuginfo->clientmonitor_pending = +- monitorpage->trigger_group[monitor_group].pending; + debuginfo->clientmonitor_latency = + monitorpage->latency[monitor_group][monitor_offset]; + debuginfo->clientmonitor_connectionid = +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,10 +47,8 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- u32 server_monitor_pending; + u32 server_monitor_latency; + u32 server_monitor_conn_id; +- u32 client_monitor_pending; + u32 client_monitor_latency; + u32 client_monitor_conn_id; + +@@ -77,11 +75,9 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- info->server_monitor_pending = debug_info.servermonitor_pending; + info->server_monitor_latency = debug_info.servermonitor_latency; + info->server_monitor_conn_id = debug_info.servermonitor_connectionid; + +- info->client_monitor_pending = debug_info.clientmonitor_pending; + info->client_monitor_latency = debug_info.clientmonitor_latency; + info->client_monitor_conn_id = debug_info.clientmonitor_connectionid; + +@@ -155,15 +151,11 @@ static ssize_t vmbus_show_device_attr(st + } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->inbound.bytes_avail_towrite); +- } else if (!strcmp(dev_attr->attr.name, "server_monitor_pending")) { +- ret = sprintf(buf, "%d\n", device_info->server_monitor_pending); + } else if (!strcmp(dev_attr->attr.name, "server_monitor_latency")) { + ret = sprintf(buf, "%d\n", device_info->server_monitor_latency); + } else if (!strcmp(dev_attr->attr.name, "server_monitor_conn_id")) { + ret = sprintf(buf, "%d\n", + device_info->server_monitor_conn_id); +- } else if (!strcmp(dev_attr->attr.name, "client_monitor_pending")) { +- ret = sprintf(buf, "%d\n", device_info->client_monitor_pending); + } else if (!strcmp(dev_attr->attr.name, "client_monitor_latency")) { + ret = sprintf(buf, "%d\n", device_info->client_monitor_latency); + } else if (!strcmp(dev_attr->attr.name, "client_monitor_conn_id")) { +@@ -175,6 +167,23 @@ static ssize_t vmbus_show_device_attr(st + return ret; + } + ++static u8 channel_monitor_group(struct vmbus_channel *channel) ++{ ++ return (u8)channel->offermsg.monitorid / 32; ++} ++ ++static u8 channel_monitor_offset(struct vmbus_channel *channel) ++{ ++ return (u8)channel->offermsg.monitorid % 32; ++} ++ ++static u32 channel_pending(struct vmbus_channel *channel, ++ struct hv_monitor_page *monitor_page) ++{ ++ u8 monitor_group = channel_monitor_group(channel); ++ return monitor_page->trigger_group[monitor_group].pending; ++} ++ + static ssize_t id_show(struct device *dev, struct device_attribute *dev_attr, + char *buf) + { +@@ -243,6 +252,33 @@ static ssize_t modalias_show(struct devi + } + static DEVICE_ATTR_RO(modalias); + ++static ssize_t server_monitor_pending_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_pending(hv_dev->channel, ++ vmbus_connection.monitor_pages[1])); ++} ++static DEVICE_ATTR_RO(server_monitor_pending); ++ ++static ssize_t client_monitor_pending_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_pending(hv_dev->channel, ++ vmbus_connection.monitor_pages[1])); ++} ++static DEVICE_ATTR_RO(client_monitor_pending); + + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, +@@ -251,17 +287,17 @@ static struct attribute *vmbus_attrs[] = + &dev_attr_class_id.attr, + &dev_attr_device_id.attr, + &dev_attr_modalias.attr, ++ &dev_attr_server_monitor_pending.attr, ++ &dev_attr_client_monitor_pending.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(server_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), + +- __ATTR(client_monitor_pending, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(client_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(client_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), + +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,10 +900,8 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- u32 servermonitor_pending; + u32 servermonitor_latency; + u32 servermonitor_connectionid; +- u32 clientmonitor_pending; + u32 clientmonitor_latency; + u32 clientmonitor_connectionid; + diff --git a/f09.patch b/f09.patch new file mode 100644 index 00000000000000..d6d3bf8cb734a1 --- /dev/null +++ b/f09.patch @@ -0,0 +1,142 @@ +--- + drivers/hv/channel.c | 4 ---- + drivers/hv/vmbus_drv.c | 48 ++++++++++++++++++++++++++++++++++++++---------- + include/linux/hyperv.h | 2 -- + 3 files changed, 38 insertions(+), 16 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -70,15 +70,11 @@ void vmbus_get_debug_info(struct vmbus_c + u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; + + monitorpage = vmbus_connection.monitor_pages[0]; +- debuginfo->servermonitor_latency = +- monitorpage->latency[monitor_group][monitor_offset]; + debuginfo->servermonitor_connectionid = + monitorpage->parameter[monitor_group] + [monitor_offset].connectionid.u.id; + + monitorpage = vmbus_connection.monitor_pages[1]; +- debuginfo->clientmonitor_latency = +- monitorpage->latency[monitor_group][monitor_offset]; + debuginfo->clientmonitor_connectionid = + monitorpage->parameter[monitor_group] + [monitor_offset].connectionid.u.id; +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,9 +47,7 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- u32 server_monitor_latency; + u32 server_monitor_conn_id; +- u32 client_monitor_latency; + u32 client_monitor_conn_id; + + struct hv_dev_port_info inbound; +@@ -75,10 +73,8 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- info->server_monitor_latency = debug_info.servermonitor_latency; + info->server_monitor_conn_id = debug_info.servermonitor_connectionid; + +- info->client_monitor_latency = debug_info.clientmonitor_latency; + info->client_monitor_conn_id = debug_info.clientmonitor_connectionid; + + info->inbound.int_mask = debug_info.inbound.current_interrupt_mask; +@@ -151,13 +147,9 @@ static ssize_t vmbus_show_device_attr(st + } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->inbound.bytes_avail_towrite); +- } else if (!strcmp(dev_attr->attr.name, "server_monitor_latency")) { +- ret = sprintf(buf, "%d\n", device_info->server_monitor_latency); + } else if (!strcmp(dev_attr->attr.name, "server_monitor_conn_id")) { + ret = sprintf(buf, "%d\n", + device_info->server_monitor_conn_id); +- } else if (!strcmp(dev_attr->attr.name, "client_monitor_latency")) { +- ret = sprintf(buf, "%d\n", device_info->client_monitor_latency); + } else if (!strcmp(dev_attr->attr.name, "client_monitor_conn_id")) { + ret = sprintf(buf, "%d\n", + device_info->client_monitor_conn_id); +@@ -184,6 +176,14 @@ static u32 channel_pending(struct vmbus_ + return monitor_page->trigger_group[monitor_group].pending; + } + ++static u32 channel_latency(struct vmbus_channel *channel, ++ struct hv_monitor_page *monitor_page) ++{ ++ u8 monitor_group = channel_monitor_group(channel); ++ u8 monitor_offset = channel_monitor_offset(channel); ++ return monitor_page->latency[monitor_group][monitor_offset]; ++} ++ + static ssize_t id_show(struct device *dev, struct device_attribute *dev_attr, + char *buf) + { +@@ -280,6 +280,34 @@ static ssize_t client_monitor_pending_sh + } + static DEVICE_ATTR_RO(client_monitor_pending); + ++static ssize_t server_monitor_latency_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_latency(hv_dev->channel, ++ vmbus_connection.monitor_pages[0])); ++} ++static DEVICE_ATTR_RO(server_monitor_latency); ++ ++static ssize_t client_monitor_latency_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_latency(hv_dev->channel, ++ vmbus_connection.monitor_pages[1])); ++} ++static DEVICE_ATTR_RO(client_monitor_latency); ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, +@@ -289,16 +317,16 @@ static struct attribute *vmbus_attrs[] = + &dev_attr_modalias.attr, + &dev_attr_server_monitor_pending.attr, + &dev_attr_client_monitor_pending.attr, ++ &dev_attr_server_monitor_latency.attr, ++ &dev_attr_client_monitor_latency.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(server_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(server_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), + +- __ATTR(client_monitor_latency, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(client_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), + + __ATTR(out_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,9 +900,7 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- u32 servermonitor_latency; + u32 servermonitor_connectionid; +- u32 clientmonitor_latency; + u32 clientmonitor_connectionid; + + struct hv_ring_buffer_debug_info inbound; diff --git a/f10.patch b/f10.patch new file mode 100644 index 00000000000000..fbec91955f004f --- /dev/null +++ b/f10.patch @@ -0,0 +1,146 @@ +--- + drivers/hv/channel.c | 14 ------------ + drivers/hv/vmbus_drv.c | 55 +++++++++++++++++++++++++++++++++---------------- + include/linux/hyperv.h | 3 -- + 3 files changed, 38 insertions(+), 34 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -65,20 +65,6 @@ static void vmbus_setevent(struct vmbus_ + void vmbus_get_debug_info(struct vmbus_channel *channel, + struct vmbus_channel_debug_info *debuginfo) + { +- struct hv_monitor_page *monitorpage; +- u8 monitor_group = (u8)channel->offermsg.monitorid / 32; +- u8 monitor_offset = (u8)channel->offermsg.monitorid % 32; +- +- monitorpage = vmbus_connection.monitor_pages[0]; +- debuginfo->servermonitor_connectionid = +- monitorpage->parameter[monitor_group] +- [monitor_offset].connectionid.u.id; +- +- monitorpage = vmbus_connection.monitor_pages[1]; +- debuginfo->clientmonitor_connectionid = +- monitorpage->parameter[monitor_group] +- [monitor_offset].connectionid.u.id; +- + hv_ringbuffer_get_debuginfo(&channel->inbound, &debuginfo->inbound); + hv_ringbuffer_get_debuginfo(&channel->outbound, &debuginfo->outbound); + } +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,9 +47,6 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- u32 server_monitor_conn_id; +- u32 client_monitor_conn_id; +- + struct hv_dev_port_info inbound; + struct hv_dev_port_info outbound; + }; +@@ -73,10 +70,6 @@ static void get_channel_info(struct hv_d + + vmbus_get_debug_info(device->channel, &debug_info); + +- info->server_monitor_conn_id = debug_info.servermonitor_connectionid; +- +- info->client_monitor_conn_id = debug_info.clientmonitor_connectionid; +- + info->inbound.int_mask = debug_info.inbound.current_interrupt_mask; + info->inbound.read_idx = debug_info.inbound.current_read_index; + info->inbound.write_idx = debug_info.inbound.current_write_index; +@@ -147,12 +140,6 @@ static ssize_t vmbus_show_device_attr(st + } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->inbound.bytes_avail_towrite); +- } else if (!strcmp(dev_attr->attr.name, "server_monitor_conn_id")) { +- ret = sprintf(buf, "%d\n", +- device_info->server_monitor_conn_id); +- } else if (!strcmp(dev_attr->attr.name, "client_monitor_conn_id")) { +- ret = sprintf(buf, "%d\n", +- device_info->client_monitor_conn_id); + } + + kfree(device_info); +@@ -184,6 +171,14 @@ static u32 channel_latency(struct vmbus_ + return monitor_page->latency[monitor_group][monitor_offset]; + } + ++static u32 channel_conn_id(struct vmbus_channel *channel, ++ struct hv_monitor_page *monitor_page) ++{ ++ u8 monitor_group = channel_monitor_group(channel); ++ u8 monitor_offset = channel_monitor_offset(channel); ++ return monitor_page->parameter[monitor_group][monitor_offset].connectionid.u.id; ++} ++ + static ssize_t id_show(struct device *dev, struct device_attribute *dev_attr, + char *buf) + { +@@ -308,6 +303,34 @@ static ssize_t client_monitor_latency_sh + } + static DEVICE_ATTR_RO(client_monitor_latency); + ++static ssize_t server_monitor_conn_id_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_conn_id(hv_dev->channel, ++ vmbus_connection.monitor_pages[0])); ++} ++static DEVICE_ATTR_RO(server_monitor_conn_id); ++ ++static ssize_t client_monitor_conn_id_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ return sprintf(buf, "%d\n", ++ channel_conn_id(hv_dev->channel, ++ vmbus_connection.monitor_pages[1])); ++} ++static DEVICE_ATTR_RO(client_monitor_conn_id); ++ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, +@@ -319,16 +342,14 @@ static struct attribute *vmbus_attrs[] = + &dev_attr_client_monitor_pending.attr, + &dev_attr_server_monitor_latency.attr, + &dev_attr_client_monitor_latency.attr, ++ &dev_attr_server_monitor_conn_id.attr, ++ &dev_attr_client_monitor_conn_id.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); + + /* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(server_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), +- +- __ATTR(client_monitor_conn_id, S_IRUGO, vmbus_show_device_attr, NULL), +- + __ATTR(out_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(out_read_index, S_IRUGO, vmbus_show_device_attr, NULL), + __ATTR(out_write_index, S_IRUGO, vmbus_show_device_attr, NULL), +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -900,9 +900,6 @@ enum vmbus_channel_state { + }; + + struct vmbus_channel_debug_info { +- u32 servermonitor_connectionid; +- u32 clientmonitor_connectionid; +- + struct hv_ring_buffer_debug_info inbound; + struct hv_ring_buffer_debug_info outbound; + }; diff --git a/f11.patch b/f11.patch new file mode 100644 index 00000000000000..c0727f56f70fc4 --- /dev/null +++ b/f11.patch @@ -0,0 +1,95 @@ +--- + drivers/hv/channel.c | 10 ---------- + drivers/hv/vmbus_drv.c | 31 ++++++++++++++----------------- + include/linux/hyperv.h | 8 -------- + 3 files changed, 14 insertions(+), 35 deletions(-) + +--- a/drivers/hv/channel.c ++++ b/drivers/hv/channel.c +@@ -60,16 +60,6 @@ static void vmbus_setevent(struct vmbus_ + } + + /* +- * vmbus_get_debug_info -Retrieve various channel debug info +- */ +-void vmbus_get_debug_info(struct vmbus_channel *channel, +- struct vmbus_channel_debug_info *debuginfo) +-{ +- hv_ringbuffer_get_debuginfo(&channel->inbound, &debuginfo->inbound); +- hv_ringbuffer_get_debuginfo(&channel->outbound, &debuginfo->outbound); +-} +- +-/* + * vmbus_open - Open the specified channel. + */ + int vmbus_open(struct vmbus_channel *newchannel, u32 send_ringbuffer_size, +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -63,29 +63,26 @@ static int vmbus_exists(void) + static void get_channel_info(struct hv_device *device, + struct hv_device_info *info) + { +- struct vmbus_channel_debug_info debug_info; ++ struct hv_ring_buffer_debug_info inbound; ++ struct hv_ring_buffer_debug_info outbound; + + if (!device->channel) + return; + +- vmbus_get_debug_info(device->channel, &debug_info); ++ hv_ringbuffer_get_debuginfo(&device->channel->inbound, &inbound); ++ hv_ringbuffer_get_debuginfo(&device->channel->outbound, &outbound); + +- info->inbound.int_mask = debug_info.inbound.current_interrupt_mask; +- info->inbound.read_idx = debug_info.inbound.current_read_index; +- info->inbound.write_idx = debug_info.inbound.current_write_index; +- info->inbound.bytes_avail_toread = +- debug_info.inbound.bytes_avail_toread; +- info->inbound.bytes_avail_towrite = +- debug_info.inbound.bytes_avail_towrite; ++ info->inbound.int_mask = inbound.current_interrupt_mask; ++ info->inbound.read_idx = inbound.current_read_index; ++ info->inbound.write_idx = inbound.current_write_index; ++ info->inbound.bytes_avail_toread = inbound.bytes_avail_toread; ++ info->inbound.bytes_avail_towrite = inbound.bytes_avail_towrite; + +- info->outbound.int_mask = +- debug_info.outbound.current_interrupt_mask; +- info->outbound.read_idx = debug_info.outbound.current_read_index; +- info->outbound.write_idx = debug_info.outbound.current_write_index; +- info->outbound.bytes_avail_toread = +- debug_info.outbound.bytes_avail_toread; +- info->outbound.bytes_avail_towrite = +- debug_info.outbound.bytes_avail_towrite; ++ info->outbound.int_mask = outbound.current_interrupt_mask; ++ info->outbound.read_idx = outbound.current_read_index; ++ info->outbound.write_idx = outbound.current_write_index; ++ info->outbound.bytes_avail_toread = outbound.bytes_avail_toread; ++ info->outbound.bytes_avail_towrite = outbound.bytes_avail_towrite; + } + + #define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2) +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -899,11 +899,6 @@ enum vmbus_channel_state { + CHANNEL_OPENED_STATE, + }; + +-struct vmbus_channel_debug_info { +- struct hv_ring_buffer_debug_info inbound; +- struct hv_ring_buffer_debug_info outbound; +-}; +- + /* + * Represents each channel msg on the vmbus connection This is a + * variable-size data structure depending on the msg type itself +@@ -1169,9 +1164,6 @@ extern int vmbus_recvpacket_raw(struct v + u64 *requestid); + + +-extern void vmbus_get_debug_info(struct vmbus_channel *channel, +- struct vmbus_channel_debug_info *debug); +- + extern void vmbus_ontimer(unsigned long data); + + struct hv_dev_port_info { diff --git a/f12.patch b/f12.patch new file mode 100644 index 00000000000000..415f8f72ea2b79 --- /dev/null +++ b/f12.patch @@ -0,0 +1,127 @@ +--- + drivers/hv/hyperv_vmbus.h | 7 +++++++ + drivers/hv/vmbus_drv.c | 35 ++++++++++------------------------- + include/linux/hyperv.h | 17 ----------------- + 3 files changed, 17 insertions(+), 42 deletions(-) + +--- a/drivers/hv/hyperv_vmbus.h ++++ b/drivers/hv/hyperv_vmbus.h +@@ -514,6 +514,13 @@ struct hv_context { + + extern struct hv_context hv_context; + ++struct hv_ring_buffer_debug_info { ++ u32 current_interrupt_mask; ++ u32 current_read_index; ++ u32 current_write_index; ++ u32 bytes_avail_toread; ++ u32 bytes_avail_towrite; ++}; + + /* Hv Interface */ + +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -47,8 +47,8 @@ static struct completion probe_event; + static int irq; + + struct hv_device_info { +- struct hv_dev_port_info inbound; +- struct hv_dev_port_info outbound; ++ struct hv_ring_buffer_debug_info inbound; ++ struct hv_ring_buffer_debug_info outbound; + }; + + static int vmbus_exists(void) +@@ -63,26 +63,11 @@ static int vmbus_exists(void) + static void get_channel_info(struct hv_device *device, + struct hv_device_info *info) + { +- struct hv_ring_buffer_debug_info inbound; +- struct hv_ring_buffer_debug_info outbound; +- + if (!device->channel) + return; + +- hv_ringbuffer_get_debuginfo(&device->channel->inbound, &inbound); +- hv_ringbuffer_get_debuginfo(&device->channel->outbound, &outbound); +- +- info->inbound.int_mask = inbound.current_interrupt_mask; +- info->inbound.read_idx = inbound.current_read_index; +- info->inbound.write_idx = inbound.current_write_index; +- info->inbound.bytes_avail_toread = inbound.bytes_avail_toread; +- info->inbound.bytes_avail_towrite = inbound.bytes_avail_towrite; +- +- info->outbound.int_mask = outbound.current_interrupt_mask; +- info->outbound.read_idx = outbound.current_read_index; +- info->outbound.write_idx = outbound.current_write_index; +- info->outbound.bytes_avail_toread = outbound.bytes_avail_toread; +- info->outbound.bytes_avail_towrite = outbound.bytes_avail_towrite; ++ hv_ringbuffer_get_debuginfo(&device->channel->inbound, &info->inbound); ++ hv_ringbuffer_get_debuginfo(&device->channel->outbound, &info->outbound); + } + + #define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2) +@@ -114,11 +99,11 @@ static ssize_t vmbus_show_device_attr(st + get_channel_info(hv_dev, device_info); + + if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.int_mask); ++ ret = sprintf(buf, "%d\n", device_info->outbound.current_interrupt_mask); + } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.read_idx); ++ ret = sprintf(buf, "%d\n", device_info->outbound.current_read_index); + } else if (!strcmp(dev_attr->attr.name, "out_write_index")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.write_idx); ++ ret = sprintf(buf, "%d\n", device_info->outbound.current_write_index); + } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->outbound.bytes_avail_toread); +@@ -126,11 +111,11 @@ static ssize_t vmbus_show_device_attr(st + ret = sprintf(buf, "%d\n", + device_info->outbound.bytes_avail_towrite); + } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.int_mask); ++ ret = sprintf(buf, "%d\n", device_info->inbound.current_interrupt_mask); + } else if (!strcmp(dev_attr->attr.name, "in_read_index")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.read_idx); ++ ret = sprintf(buf, "%d\n", device_info->inbound.current_read_index); + } else if (!strcmp(dev_attr->attr.name, "in_write_index")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.write_idx); ++ ret = sprintf(buf, "%d\n", device_info->inbound.current_write_index); + } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) { + ret = sprintf(buf, "%d\n", + device_info->inbound.bytes_avail_toread); +--- a/include/linux/hyperv.h ++++ b/include/linux/hyperv.h +@@ -429,15 +429,6 @@ struct hv_ring_buffer_info { + u32 ring_data_startoffset; + }; + +-struct hv_ring_buffer_debug_info { +- u32 current_interrupt_mask; +- u32 current_read_index; +- u32 current_write_index; +- u32 bytes_avail_toread; +- u32 bytes_avail_towrite; +-}; +- +- + /* + * + * hv_get_ringbuffer_availbytes() +@@ -1166,14 +1157,6 @@ extern int vmbus_recvpacket_raw(struct v + + extern void vmbus_ontimer(unsigned long data); + +-struct hv_dev_port_info { +- u32 int_mask; +- u32 read_idx; +- u32 write_idx; +- u32 bytes_avail_toread; +- u32 bytes_avail_towrite; +-}; +- + /* Base driver object */ + struct hv_driver { + const char *name; diff --git a/f13.patch b/f13.patch new file mode 100644 index 00000000000000..b99e9601acee35 --- /dev/null +++ b/f13.patch @@ -0,0 +1,282 @@ +--- + drivers/hv/vmbus_drv.c | 230 +++++++++++++++++++++++++++++++------------------ + 1 file changed, 146 insertions(+), 84 deletions(-) + +--- a/drivers/hv/vmbus_drv.c ++++ b/drivers/hv/vmbus_drv.c +@@ -46,11 +46,6 @@ static struct tasklet_struct msg_dpc; + static struct completion probe_event; + static int irq; + +-struct hv_device_info { +- struct hv_ring_buffer_debug_info inbound; +- struct hv_ring_buffer_debug_info outbound; +-}; +- + static int vmbus_exists(void) + { + if (hv_acpi_dev == NULL) +@@ -59,17 +54,6 @@ static int vmbus_exists(void) + return 0; + } + +- +-static void get_channel_info(struct hv_device *device, +- struct hv_device_info *info) +-{ +- if (!device->channel) +- return; +- +- hv_ringbuffer_get_debuginfo(&device->channel->inbound, &info->inbound); +- hv_ringbuffer_get_debuginfo(&device->channel->outbound, &info->outbound); +-} +- + #define VMBUS_ALIAS_LEN ((sizeof((struct hv_vmbus_device_id *)0)->guid) * 2) + static void print_alias_name(struct hv_device *hv_dev, char *alias_name) + { +@@ -78,56 +62,6 @@ static void print_alias_name(struct hv_d + sprintf(&alias_name[i], "%02x", hv_dev->dev_type.b[i/2]); + } + +-/* +- * vmbus_show_device_attr - Show the device attribute in sysfs. +- * +- * This is invoked when user does a +- * "cat /sys/bus/vmbus/devices/<busdevice>/<attr name>" +- */ +-static ssize_t vmbus_show_device_attr(struct device *dev, +- struct device_attribute *dev_attr, +- char *buf) +-{ +- struct hv_device *hv_dev = device_to_hv_device(dev); +- struct hv_device_info *device_info; +- int ret = 0; +- +- device_info = kzalloc(sizeof(struct hv_device_info), GFP_KERNEL); +- if (!device_info) +- return ret; +- +- get_channel_info(hv_dev, device_info); +- +- if (!strcmp(dev_attr->attr.name, "out_intr_mask")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.current_interrupt_mask); +- } else if (!strcmp(dev_attr->attr.name, "out_read_index")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.current_read_index); +- } else if (!strcmp(dev_attr->attr.name, "out_write_index")) { +- ret = sprintf(buf, "%d\n", device_info->outbound.current_write_index); +- } else if (!strcmp(dev_attr->attr.name, "out_read_bytes_avail")) { +- ret = sprintf(buf, "%d\n", +- device_info->outbound.bytes_avail_toread); +- } else if (!strcmp(dev_attr->attr.name, "out_write_bytes_avail")) { +- ret = sprintf(buf, "%d\n", +- device_info->outbound.bytes_avail_towrite); +- } else if (!strcmp(dev_attr->attr.name, "in_intr_mask")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.current_interrupt_mask); +- } else if (!strcmp(dev_attr->attr.name, "in_read_index")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.current_read_index); +- } else if (!strcmp(dev_attr->attr.name, "in_write_index")) { +- ret = sprintf(buf, "%d\n", device_info->inbound.current_write_index); +- } else if (!strcmp(dev_attr->attr.name, "in_read_bytes_avail")) { +- ret = sprintf(buf, "%d\n", +- device_info->inbound.bytes_avail_toread); +- } else if (!strcmp(dev_attr->attr.name, "in_write_bytes_avail")) { +- ret = sprintf(buf, "%d\n", +- device_info->inbound.bytes_avail_towrite); +- } +- +- kfree(device_info); +- return ret; +-} +- + static u8 channel_monitor_group(struct vmbus_channel *channel) + { + return (u8)channel->offermsg.monitorid / 32; +@@ -313,6 +247,142 @@ static ssize_t client_monitor_conn_id_sh + } + static DEVICE_ATTR_RO(client_monitor_conn_id); + ++static ssize_t out_intr_mask_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info outbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); ++ return sprintf(buf, "%d\n", outbound.current_interrupt_mask); ++} ++static DEVICE_ATTR_RO(out_intr_mask); ++ ++static ssize_t out_read_index_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info outbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); ++ return sprintf(buf, "%d\n", outbound.current_read_index); ++} ++static DEVICE_ATTR_RO(out_read_index); ++ ++static ssize_t out_write_index_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info outbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); ++ return sprintf(buf, "%d\n", outbound.current_write_index); ++} ++static DEVICE_ATTR_RO(out_write_index); ++ ++static ssize_t out_read_bytes_avail_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info outbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); ++ return sprintf(buf, "%d\n", outbound.bytes_avail_toread); ++} ++static DEVICE_ATTR_RO(out_read_bytes_avail); ++ ++static ssize_t out_write_bytes_avail_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info outbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound); ++ return sprintf(buf, "%d\n", outbound.bytes_avail_towrite); ++} ++static DEVICE_ATTR_RO(out_write_bytes_avail); ++ ++static ssize_t in_intr_mask_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info inbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); ++ return sprintf(buf, "%d\n", inbound.current_interrupt_mask); ++} ++static DEVICE_ATTR_RO(in_intr_mask); ++ ++static ssize_t in_read_index_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info inbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); ++ return sprintf(buf, "%d\n", inbound.current_read_index); ++} ++static DEVICE_ATTR_RO(in_read_index); ++ ++static ssize_t in_write_index_show(struct device *dev, ++ struct device_attribute *dev_attr, char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info inbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); ++ return sprintf(buf, "%d\n", inbound.current_write_index); ++} ++static DEVICE_ATTR_RO(in_write_index); ++ ++static ssize_t in_read_bytes_avail_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info inbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); ++ return sprintf(buf, "%d\n", inbound.bytes_avail_toread); ++} ++static DEVICE_ATTR_RO(in_read_bytes_avail); ++ ++static ssize_t in_write_bytes_avail_show(struct device *dev, ++ struct device_attribute *dev_attr, ++ char *buf) ++{ ++ struct hv_device *hv_dev = device_to_hv_device(dev); ++ struct hv_ring_buffer_debug_info inbound; ++ ++ if (!hv_dev->channel) ++ return -ENODEV; ++ hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound); ++ return sprintf(buf, "%d\n", inbound.bytes_avail_towrite); ++} ++static DEVICE_ATTR_RO(in_write_bytes_avail); ++ ++/* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ + static struct attribute *vmbus_attrs[] = { + &dev_attr_id.attr, + &dev_attr_state.attr, +@@ -326,27 +396,20 @@ static struct attribute *vmbus_attrs[] = + &dev_attr_client_monitor_latency.attr, + &dev_attr_server_monitor_conn_id.attr, + &dev_attr_client_monitor_conn_id.attr, ++ &dev_attr_out_intr_mask.attr, ++ &dev_attr_out_read_index.attr, ++ &dev_attr_out_write_index.attr, ++ &dev_attr_out_read_bytes_avail.attr, ++ &dev_attr_out_write_bytes_avail.attr, ++ &dev_attr_in_intr_mask.attr, ++ &dev_attr_in_read_index.attr, ++ &dev_attr_in_write_index.attr, ++ &dev_attr_in_read_bytes_avail.attr, ++ &dev_attr_in_write_bytes_avail.attr, + NULL, + }; + ATTRIBUTE_GROUPS(vmbus); + +-/* Set up per device attributes in /sys/bus/vmbus/devices/<bus device> */ +-static struct device_attribute vmbus_device_attrs[] = { +- __ATTR(out_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(out_read_index, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(out_write_index, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(out_read_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(out_write_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), +- +- __ATTR(in_intr_mask, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(in_read_index, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(in_write_index, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(in_read_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR(in_write_bytes_avail, S_IRUGO, vmbus_show_device_attr, NULL), +- __ATTR_NULL +-}; +- +- + /* + * vmbus_uevent - add uevent for our device + * +@@ -494,7 +557,6 @@ static struct bus_type hv_bus = { + .remove = vmbus_remove, + .probe = vmbus_probe, + .uevent = vmbus_uevent, +- .dev_attrs = vmbus_device_attrs, + .dev_groups = vmbus_groups, + }; + diff --git a/i01.patch b/i01.patch new file mode 100644 index 00000000000000..900b59e42b45ba --- /dev/null +++ b/i01.patch @@ -0,0 +1,108 @@ +--- + drivers/ide/ide-sysfs.c | 35 ++++++++++++++++++++++++++--------- + drivers/ide/ide.c | 2 +- + include/linux/ide.h | 2 +- + 3 files changed, 28 insertions(+), 11 deletions(-) + +--- a/drivers/ide/ide-sysfs.c ++++ b/drivers/ide/ide-sysfs.c +@@ -25,6 +25,7 @@ static ssize_t media_show(struct device + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", ide_media_string(drive)); + } ++static DEVICE_ATTR_RO(media); + + static ssize_t drivename_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -32,6 +33,7 @@ static ssize_t drivename_show(struct dev + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", drive->name); + } ++static DEVICE_ATTR_RO(drivename); + + static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -39,6 +41,7 @@ static ssize_t modalias_show(struct devi + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "ide:m-%s\n", ide_media_string(drive)); + } ++static DEVICE_ATTR_RO(modalias); + + static ssize_t model_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -46,6 +49,7 @@ static ssize_t model_show(struct device + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_PROD]); + } ++static DEVICE_ATTR_RO(model); + + static ssize_t firmware_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -53,6 +57,7 @@ static ssize_t firmware_show(struct devi + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_FW_REV]); + } ++static DEVICE_ATTR_RO(firmware); + + static ssize_t serial_show(struct device *dev, struct device_attribute *attr, + char *buf) +@@ -60,16 +65,28 @@ static ssize_t serial_show(struct device + ide_drive_t *drive = to_ide_device(dev); + return sprintf(buf, "%s\n", (char *)&drive->id[ATA_ID_SERNO]); + } ++static DEVICE_ATTR(serial, 0400, serial_show, NULL); + +-struct device_attribute ide_dev_attrs[] = { +- __ATTR_RO(media), +- __ATTR_RO(drivename), +- __ATTR_RO(modalias), +- __ATTR_RO(model), +- __ATTR_RO(firmware), +- __ATTR(serial, 0400, serial_show, NULL), +- __ATTR(unload_heads, 0644, ide_park_show, ide_park_store), +- __ATTR_NULL ++static DEVICE_ATTR(unload_heads, 0644, ide_park_show, ide_park_store); ++ ++static struct attribute *ide_attrs[] = { ++ &dev_attr_media.attr, ++ &dev_attr_drivename.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_model.attr, ++ &dev_attr_firmware.attr, ++ &dev_attr_serial.attr, ++ &dev_attr_unload_heads.attr, ++ NULL, ++}; ++ ++static const struct attribute_group ide_attr_group = { ++ .attrs = ide_attrs, ++}; ++ ++const struct attribute_group *ide_attr_groups[] = { ++ &ide_attr_group, ++ NULL, + }; + + static ssize_t store_delete_devices(struct device *portdev, +--- a/drivers/ide/ide.c ++++ b/drivers/ide/ide.c +@@ -158,7 +158,7 @@ struct bus_type ide_bus_type = { + .probe = generic_ide_probe, + .remove = generic_ide_remove, + .shutdown = generic_ide_shutdown, +- .dev_attrs = ide_dev_attrs, ++ .dev_groups = ide_dev_groups, + .suspend = generic_ide_suspend, + .resume = generic_ide_resume, + }; +--- a/include/linux/ide.h ++++ b/include/linux/ide.h +@@ -1514,7 +1514,7 @@ static inline void ide_set_max_pio(ide_d + + char *ide_media_string(ide_drive_t *); + +-extern struct device_attribute ide_dev_attrs[]; ++extern const struct attribute_group *ide_dev_groups[]; + extern struct bus_type ide_bus_type; + extern struct class *ide_port_class; + diff --git a/i02.patch b/i02.patch new file mode 100644 index 00000000000000..bf333e9fbea1a7 --- /dev/null +++ b/i02.patch @@ -0,0 +1,42 @@ +--- + drivers/ipack/ipack.c | 22 +++++++++++++++------- + 1 file changed, 15 insertions(+), 7 deletions(-) + +--- a/drivers/ipack/ipack.c ++++ b/drivers/ipack/ipack.c +@@ -180,20 +180,28 @@ static ssize_t modalias_show(struct devi + + ipack_device_attr(id_format, "0x%hhu\n"); + +-static struct device_attribute ipack_dev_attrs[] = { +- __ATTR_RO(id), +- __ATTR_RO(id_device), +- __ATTR_RO(id_format), +- __ATTR_RO(id_vendor), +- __ATTR_RO(modalias), ++static DEVICE_ATTR_RO(id); ++static DEVICE_ATTR_RO(id_device); ++static DEVICE_ATTR_RO(id_format); ++static DEVICE_ATTR_RO(id_vendor); ++static DEVICE_ATTR_RO(modalias); ++ ++static struct attribute *ipack_attrs[] = { ++ &dev_attr_id.attr, ++ &dev_attr_id_device.attr, ++ &dev_attr_id_format.attr, ++ &dev_attr_id_vendor.attr, ++ &dev_attr_modalias.attr, ++ NULL, + }; ++ATTRIBUTE_GROUPS(ipack); + + static struct bus_type ipack_bus_type = { + .name = "ipack", + .probe = ipack_bus_probe, + .match = ipack_bus_match, + .remove = ipack_bus_remove, +- .dev_attrs = ipack_dev_attrs, ++ .dev_groups = ipack_groups, + .uevent = ipack_uevent, + }; + diff --git a/s01.patch b/s01.patch new file mode 100644 index 00000000000000..f7359d9eacde92 --- /dev/null +++ b/s01.patch @@ -0,0 +1,49 @@ +--- + drivers/input/serio/serio.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +--- a/drivers/input/serio/serio.c ++++ b/drivers/input/serio/serio.c +@@ -373,34 +373,34 @@ static ssize_t serio_show_modalias(struc + serio->id.type, serio->id.proto, serio->id.id, serio->id.extra); + } + +-static ssize_t serio_show_id_type(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t type_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct serio *serio = to_serio_port(dev); + return sprintf(buf, "%02x\n", serio->id.type); + } + +-static ssize_t serio_show_id_proto(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t proto_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct serio *serio = to_serio_port(dev); + return sprintf(buf, "%02x\n", serio->id.proto); + } + +-static ssize_t serio_show_id_id(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t id_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct serio *serio = to_serio_port(dev); + return sprintf(buf, "%02x\n", serio->id.id); + } + +-static ssize_t serio_show_id_extra(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t extra_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct serio *serio = to_serio_port(dev); + return sprintf(buf, "%02x\n", serio->id.extra); + } + +-static DEVICE_ATTR(type, S_IRUGO, serio_show_id_type, NULL); +-static DEVICE_ATTR(proto, S_IRUGO, serio_show_id_proto, NULL); +-static DEVICE_ATTR(id, S_IRUGO, serio_show_id_id, NULL); +-static DEVICE_ATTR(extra, S_IRUGO, serio_show_id_extra, NULL); ++static DEVICE_ATTR_RO(type); ++static DEVICE_ATTR_RO(proto); ++static DEVICE_ATTR_RO(id); ++static DEVICE_ATTR_RO(extra); + + static struct attribute *serio_device_id_attrs[] = { + &dev_attr_type.attr, diff --git a/s02.patch b/s02.patch new file mode 100644 index 00000000000000..039036af77b865 --- /dev/null +++ b/s02.patch @@ -0,0 +1,98 @@ +--- + drivers/input/serio/serio.c | 62 +++++++++++++++++++++----------------------- + 1 file changed, 30 insertions(+), 32 deletions(-) + +--- a/drivers/input/serio/serio.c ++++ b/drivers/input/serio/serio.c +@@ -365,7 +365,7 @@ static ssize_t serio_show_description(st + return sprintf(buf, "%s\n", serio->name); + } + +-static ssize_t serio_show_modalias(struct device *dev, struct device_attribute *attr, char *buf) ++static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, char *buf) + { + struct serio *serio = to_serio_port(dev); + +@@ -397,30 +397,7 @@ static ssize_t extra_show(struct device + return sprintf(buf, "%02x\n", serio->id.extra); + } + +-static DEVICE_ATTR_RO(type); +-static DEVICE_ATTR_RO(proto); +-static DEVICE_ATTR_RO(id); +-static DEVICE_ATTR_RO(extra); +- +-static struct attribute *serio_device_id_attrs[] = { +- &dev_attr_type.attr, +- &dev_attr_proto.attr, +- &dev_attr_id.attr, +- &dev_attr_extra.attr, +- NULL +-}; +- +-static struct attribute_group serio_id_attr_group = { +- .name = "id", +- .attrs = serio_device_id_attrs, +-}; +- +-static const struct attribute_group *serio_device_attr_groups[] = { +- &serio_id_attr_group, +- NULL +-}; +- +-static ssize_t serio_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) ++static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) + { + struct serio *serio = to_serio_port(dev); + struct device_driver *drv; +@@ -474,14 +451,36 @@ static ssize_t serio_set_bind_mode(struc + return retval; + } + +-static struct device_attribute serio_device_attrs[] = { +- __ATTR(description, S_IRUGO, serio_show_description, NULL), +- __ATTR(modalias, S_IRUGO, serio_show_modalias, NULL), +- __ATTR(drvctl, S_IWUSR, NULL, serio_rebind_driver), +- __ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode), +- __ATTR_NULL ++static DEVICE_ATTR_RO(type); ++static DEVICE_ATTR_RO(proto); ++static DEVICE_ATTR_RO(id); ++static DEVICE_ATTR_RO(extra); ++static DEVICE_ATTR_RO(modalias); ++static DEVICE_ATTR_WO(drvctl); ++static DEVICE_ATTR(description, S_IRUGO, serio_show_description, NULL); ++static DEVICE_ATTR(bind_mode, S_IWUSR | S_IRUGO, serio_show_bind_mode, serio_set_bind_mode); ++ ++static struct attribute *serio_device_id_attrs[] = { ++ &dev_attr_type.attr, ++ &dev_attr_proto.attr, ++ &dev_attr_id.attr, ++ &dev_attr_extra.attr, ++ &dev_attr_modalias.attr, ++ &dev_attr_description.attr, ++ &dev_attr_drvctl.attr, ++ &dev_attr_bind_mode.attr, ++ NULL ++}; ++ ++static struct attribute_group serio_id_attr_group = { ++ .name = "id", ++ .attrs = serio_device_id_attrs, + }; + ++static const struct attribute_group *serio_device_attr_groups[] = { ++ &serio_id_attr_group, ++ NULL ++}; + + static void serio_release_port(struct device *dev) + { +@@ -996,7 +995,6 @@ EXPORT_SYMBOL(serio_interrupt); + + static struct bus_type serio_bus = { + .name = "serio", +- .dev_attrs = serio_device_attrs, + .drv_groups = serio_driver_groups, + .match = serio_bus_match, + .uevent = serio_uevent, @@ -36,9 +36,26 @@ pmu_bus-convert-bus-code-to-use-dev_groups.patch driver-core-remove-dev_attrs-from-struct-class.patch driver-core-remove-dev_bin_attrs-from-struct-class.patch - +f01.patch + +f02.patch +f03.patch +f04.patch +f05.patch +f06.patch +f07.patch +f08.patch +f09.patch +f10.patch +f11.patch +f12.patch +f13.patch driver-core-remove-struct-bus_type.bus_attrs.patch driver-core-remove-struct-bus_type.drv_attrs.patch driver-core-remove-struct-bus_type.dev_attrs.patch +s01.patch +s02.patch +i01.patch +i02.patch qlcnic_sysfs.patch |