diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 10:31:17 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-02-01 10:31:17 -0800 |
commit | f6cff79f1d122f78a4b35bf4b2f0112afcd89ea4 (patch) | |
tree | cf3a38576f9adbb3860982c25f72aebed2bb541a /drivers/hv | |
parent | 47fcc0360cfb3fe82e4daddacad3c1cd80b0b75d (diff) | |
parent | 9ff6576e124b1227c27c1da43fe5f8ee908263e0 (diff) | |
download | linux-f6cff79f1d122f78a4b35bf4b2f0112afcd89ea4.tar.bz2 |
Merge tag 'char-misc-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the big pull request for char/misc drivers for 4.16-rc1.
There's a lot of stuff in here. Three new driver subsystems were added
for various types of hardware busses:
- siox
- slimbus
- soundwire
as well as a new vboxguest subsystem for the VirtualBox hypervisor
drivers.
There's also big updates from the FPGA subsystem, lots of Android
binder fixes, the usual handful of hyper-v updates, and lots of other
smaller driver updates.
All of these have been in linux-next for a long time, with no reported
issues"
* tag 'char-misc-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (155 commits)
char: lp: use true or false for boolean values
android: binder: use VM_ALLOC to get vm area
android: binder: Use true and false for boolean values
lkdtm: fix handle_irq_event symbol for INT_HW_IRQ_EN
EISA: Delete error message for a failed memory allocation in eisa_probe()
EISA: Whitespace cleanup
misc: remove AVR32 dependencies
virt: vbox: Add error mapping for VERR_INVALID_NAME and VERR_NO_MORE_FILES
soundwire: Fix a signedness bug
uio_hv_generic: fix new type mismatch warnings
uio_hv_generic: fix type mismatch warnings
auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
uio_hv_generic: add rescind support
uio_hv_generic: check that host supports monitor page
uio_hv_generic: create send and receive buffers
uio: document uio_hv_generic regions
doc: fix documentation about uio_hv_generic
vmbus: add monitor_id and subchannel_id to sysfs per channel
vmbus: fix ABI documentation
uio_hv_generic: use ISR callback method
...
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/hv.c | 3 | ||||
-rw-r--r-- | drivers/hv/vmbus_drv.c | 40 |
2 files changed, 28 insertions, 15 deletions
diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c index 8267439dd1ee..fe96aab9e794 100644 --- a/drivers/hv/hv.c +++ b/drivers/hv/hv.c @@ -49,9 +49,6 @@ struct hv_context hv_context = { */ int hv_init(void) { - if (!hv_is_hypercall_page_setup()) - return -ENOTSUPP; - hv_context.cpu_context = alloc_percpu(struct hv_per_cpu_context); if (!hv_context.cpu_context) return -ENOMEM; diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 610223f0e945..bc65c4d79c1f 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -37,7 +37,6 @@ #include <linux/sched/task_stack.h> #include <asm/hyperv.h> -#include <asm/hypervisor.h> #include <asm/mshyperv.h> #include <linux/notifier.h> #include <linux/ptrace.h> @@ -1053,7 +1052,7 @@ static int vmbus_bus_init(void) * Initialize the per-cpu interrupt state and * connect to the host. */ - ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/hyperv:online", + ret = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "hyperv/vmbus:online", hv_synic_init, hv_synic_cleanup); if (ret < 0) goto err_alloc; @@ -1193,7 +1192,7 @@ static ssize_t out_mask_show(const struct vmbus_channel *channel, char *buf) return sprintf(buf, "%u\n", rbi->ring_buffer->interrupt_mask); } -VMBUS_CHAN_ATTR_RO(out_mask); +static VMBUS_CHAN_ATTR_RO(out_mask); static ssize_t in_mask_show(const struct vmbus_channel *channel, char *buf) { @@ -1201,7 +1200,7 @@ static ssize_t in_mask_show(const struct vmbus_channel *channel, char *buf) return sprintf(buf, "%u\n", rbi->ring_buffer->interrupt_mask); } -VMBUS_CHAN_ATTR_RO(in_mask); +static VMBUS_CHAN_ATTR_RO(in_mask); static ssize_t read_avail_show(const struct vmbus_channel *channel, char *buf) { @@ -1209,7 +1208,7 @@ static ssize_t read_avail_show(const struct vmbus_channel *channel, char *buf) return sprintf(buf, "%u\n", hv_get_bytes_to_read(rbi)); } -VMBUS_CHAN_ATTR_RO(read_avail); +static VMBUS_CHAN_ATTR_RO(read_avail); static ssize_t write_avail_show(const struct vmbus_channel *channel, char *buf) { @@ -1217,13 +1216,13 @@ static ssize_t write_avail_show(const struct vmbus_channel *channel, char *buf) return sprintf(buf, "%u\n", hv_get_bytes_to_write(rbi)); } -VMBUS_CHAN_ATTR_RO(write_avail); +static VMBUS_CHAN_ATTR_RO(write_avail); static ssize_t show_target_cpu(const struct vmbus_channel *channel, char *buf) { return sprintf(buf, "%u\n", channel->target_cpu); } -VMBUS_CHAN_ATTR(cpu, S_IRUGO, show_target_cpu, NULL); +static VMBUS_CHAN_ATTR(cpu, S_IRUGO, show_target_cpu, NULL); static ssize_t channel_pending_show(const struct vmbus_channel *channel, char *buf) @@ -1232,7 +1231,7 @@ static ssize_t channel_pending_show(const struct vmbus_channel *channel, channel_pending(channel, vmbus_connection.monitor_pages[1])); } -VMBUS_CHAN_ATTR(pending, S_IRUGO, channel_pending_show, NULL); +static VMBUS_CHAN_ATTR(pending, S_IRUGO, channel_pending_show, NULL); static ssize_t channel_latency_show(const struct vmbus_channel *channel, char *buf) @@ -1241,19 +1240,34 @@ static ssize_t channel_latency_show(const struct vmbus_channel *channel, channel_latency(channel, vmbus_connection.monitor_pages[1])); } -VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL); +static VMBUS_CHAN_ATTR(latency, S_IRUGO, channel_latency_show, NULL); static ssize_t channel_interrupts_show(const struct vmbus_channel *channel, char *buf) { return sprintf(buf, "%llu\n", channel->interrupts); } -VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL); +static VMBUS_CHAN_ATTR(interrupts, S_IRUGO, channel_interrupts_show, NULL); static ssize_t channel_events_show(const struct vmbus_channel *channel, char *buf) { return sprintf(buf, "%llu\n", channel->sig_events); } -VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL); +static VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL); + +static ssize_t subchannel_monitor_id_show(const struct vmbus_channel *channel, + char *buf) +{ + return sprintf(buf, "%u\n", channel->offermsg.monitorid); +} +static VMBUS_CHAN_ATTR(monitor_id, S_IRUGO, subchannel_monitor_id_show, NULL); + +static ssize_t subchannel_id_show(const struct vmbus_channel *channel, + char *buf) +{ + return sprintf(buf, "%u\n", + channel->offermsg.offer.sub_channel_index); +} +static VMBUS_CHAN_ATTR_RO(subchannel_id); static struct attribute *vmbus_chan_attrs[] = { &chan_attr_out_mask.attr, @@ -1265,6 +1279,8 @@ static struct attribute *vmbus_chan_attrs[] = { &chan_attr_latency.attr, &chan_attr_interrupts.attr, &chan_attr_events.attr, + &chan_attr_monitor_id.attr, + &chan_attr_subchannel_id.attr, NULL }; @@ -1717,7 +1733,7 @@ static int __init hv_acpi_init(void) { int ret, t; - if (x86_hyper_type != X86_HYPER_MS_HYPERV) + if (!hv_is_hyperv_initialized()) return -ENODEV; init_completion(&probe_event); |