Skip to content

Commit

Permalink
Merge tag 'hyperv-fixes-4.20-rc6' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/hyperv/linux into char-misc-linus

Sasha writes:

hyperv-fixes-4.20-rc6

* tag 'hyperv-fixes-4.20-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
  Drivers: hv: vmbus: Return -EINVAL for the sys files for unopened channels
  x86, hyperv: remove PCI dependency
  • Loading branch information
gregkh committed Dec 14, 2018
2 parents cb4f131 + fc96df1 commit 55449af
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/hv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menu "Microsoft Hyper-V guest support"

config HYPERV
tristate "Microsoft Hyper-V client drivers"
depends on X86 && ACPI && PCI && X86_LOCAL_APIC && HYPERVISOR_GUEST
depends on X86 && ACPI && X86_LOCAL_APIC && HYPERVISOR_GUEST
select PARAVIRT
help
Select this option to run Linux as a Hyper-V client operating
Expand Down
20 changes: 20 additions & 0 deletions drivers/hv/vmbus_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,8 @@ static ssize_t out_intr_mask_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
return sprintf(buf, "%d\n", outbound.current_interrupt_mask);
}
Expand All @@ -329,6 +331,8 @@ static ssize_t out_read_index_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
return sprintf(buf, "%d\n", outbound.current_read_index);
}
Expand All @@ -343,6 +347,8 @@ static ssize_t out_write_index_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
return sprintf(buf, "%d\n", outbound.current_write_index);
}
Expand All @@ -357,6 +363,8 @@ static ssize_t out_read_bytes_avail_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
return sprintf(buf, "%d\n", outbound.bytes_avail_toread);
}
Expand All @@ -371,6 +379,8 @@ static ssize_t out_write_bytes_avail_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->outbound, &outbound);
return sprintf(buf, "%d\n", outbound.bytes_avail_towrite);
}
Expand All @@ -384,6 +394,8 @@ static ssize_t in_intr_mask_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
return sprintf(buf, "%d\n", inbound.current_interrupt_mask);
}
Expand All @@ -397,6 +409,8 @@ static ssize_t in_read_index_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
return sprintf(buf, "%d\n", inbound.current_read_index);
}
Expand All @@ -410,6 +424,8 @@ static ssize_t in_write_index_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
return sprintf(buf, "%d\n", inbound.current_write_index);
}
Expand All @@ -424,6 +440,8 @@ static ssize_t in_read_bytes_avail_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
return sprintf(buf, "%d\n", inbound.bytes_avail_toread);
}
Expand All @@ -438,6 +456,8 @@ static ssize_t in_write_bytes_avail_show(struct device *dev,

if (!hv_dev->channel)
return -ENODEV;
if (hv_dev->channel->state != CHANNEL_OPENED_STATE)
return -EINVAL;
hv_ringbuffer_get_debuginfo(&hv_dev->channel->inbound, &inbound);
return sprintf(buf, "%d\n", inbound.bytes_avail_towrite);
}
Expand Down

0 comments on commit 55449af

Please sign in to comment.