summaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2015-06-12char:xilinx_hwicap:buffer_icap - change 1/0 to true/false for bool type ↵Shailendra Verma1-3/+3
variable in function buffer_icap_set_configuration(). The variable dirty is bool type. Hence assign the variable with bool value true/false instead of 1/0. Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com> Tested-by: Michal Simek <michal.simek@xilinx.com> Acked-by: Moritz Fischer <moritz.fischer@ettus.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12Drivers: hv: vmbus: Allocate ring buffer memory in NUMA aware fashionK. Y. Srinivasan1-2/+12
Allocate ring buffer memory from the NUMA node assigned to the channel. Since this is a performance and not a correctness issue, if the node specific allocation were to fail, fall back and allocate without specifying the node. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12parport: check exclusive access before registerSudip Mukherjee1-0/+28
As of now we were starting the registration process and after the device is registered we were checking if the device can be used by the parport. Now lets check it first so that we do not need to go through the registration process only to fail at the end. The original exclusive access check at the end is still there so that we do not get any surprises if two different process registers its device with same parport and with exclusive access at the same time. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12w1: use correct lock on error in w1_seq_show()Dan Carpenter1-2/+2
I noticed there was a problem here because Smatch complained: drivers/w1/slaves/w1_therm.c:416 w1_seq_show() warn: inconsistent returns 'mutex:&sl->master->mutex'. Locked on: line 416 Unlocked on: line 413 The problem is that we lock ->mutex but we unlock ->bus_mutex on error. David Fries says that ->bus_mutex is correct and ->mutex is incorrect. Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-12w1: fix for loop exit condition in w1_seq_show()Dan Carpenter1-1/+1
The W1_42_FINISHED_BYTE is 0xFF so the cast means the condition is never true. Fixes: d9411e57dc7f ('w1: Add support for DS28EA00 sequence to w1-therm') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08drivers/hwtracing: fix coresight-etm4x implicit <module.h> usagePaul Gortmaker1-0/+1
In commit 2e1cdfe184b5202d51e0611d7a051e2bea303946 ("coresight-etm4x: Adding CoreSight ETM4x driver") this driver was added. It uses module_amba_driver() to register itself with the system, which is just an alias for module_driver. This currently works by relying on getting that via init.h but we are planning to move that code[1] to module.h -- at which time this will fail to compile since it does not include module.h currently, resulting in: drivers/hwtracing/coresight/coresight-etm4x.c:2701:1: note: in expansion of macro ‘module_amba_driver’ module_amba_driver(etm4x_driver); ^ include/linux/device.h:1296:1: error: type defaults to ‘int’ in declaration of ‘module_init’ [-Werror=implicit-int] module_init(__driver##_init); \ ^ In the future, the amba support may want to create another alias that uses builtin_driver[2] for cases like this which are using bool Kconfig triggers, but for now we just fix the implicit include. [1] https://lkml.kernel.org/r/1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com [2] https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com Cc: Pratik Patel <pratikp@codeaurora.org> Cc: Kaixu Xia <xiakaixu@huawei.com> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-08drivers/hwtracing: fix coresight-replicator-qcom implicit <module.h> usagePaul Gortmaker1-0/+1
In commit 620cf787c121f39b5223e43bad3d1b7c66ecead5 ("coresight: replicator: Add Qualcomm CoreSight Replicator driver") this driver was added. It uses module_amba_driver(replicator_driver) to register itself with the system -- which is just an alias for module_driver. This currently works by relying on getting that via init.h but we are planning to move that code[1] to module.h -- at which time this will fail to compile since it does not include module.h currently, resulting in: drivers/hwtracing/coresight/coresight-replicator-qcom.c:214:1: error: type defaults to 'int' in declaration of 'module_init' [-Werror=implicit-int] drivers/hwtracing/coresight/coresight-replicator-qcom.c:214:1: error: type defaults to 'int' in declaration of 'module_exit' [-Werror=implicit-int] In the future, the amba support may want to create another alias that uses builtin_driver[2] for cases like this which are using bool Kconfig triggers, but for now we just fix the implicit include. [1] https://lkml.kernel.org/r/1433276168-21550-1-git-send-email-paul.gortmaker@windriver.com [2] https://lkml.kernel.org/r/1431287385-1526-1-git-send-email-paul.gortmaker@windriver.com Cc: Pratik Patel <pratikp@codeaurora.org> Cc: Ivan T. Ivanov <ivan.ivanov@linaro.org> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Acked-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-03Merge tag 'extcon-next-for-4.2' of ↵Greg Kroah-Hartman22-613/+885
git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for v4.2 This patchset include the huge update of extcon core and add the new one extcon driver and fix minor isseu of extcon drivers. Detailed description for patchset: 1. Update the extcon core. - Modify the extcon device name on sysfs from device name name to 'extcon[X]' as following because if same extcon device are included in H/W development board, the one of the two device driver might be failed on the probe(). : /sys/class/extcon/[device name] -> /sys/class/extcon/extcon[X] - Use the unique id for external connectors instead of legacy string name. Previously, extcon used the string name to identify the type of external connectors. This way have the many potential issues. So, extcon core define the unique id for each external connectors as following: enum extcon { EXTCON_NONE = 0x0, /* USB external connector */ EXTCON_USB = 0x1, EXTCON_USB_HOST = 0x2, /* Charger external connector */ EXTCON_TA = 0x10, EXTCON_FAST_CHARGER = 0x11, EXTCON_SLOW_CHARGER = 0x12, EXTCON_CHARGE_DOWNSTREAM = 0x13, /* Audio and video external connector */ EXTCON_LINE_IN = 0x20, EXTCON_LINE_OUT = 0x21, EXTCON_MICROPHONE = 0x22, EXTCON_HEADPHONE = 0x23, ... }; - Update tye prototype of extcon_register_notifier() by using the unique id (enum extcon) of external connectors. - Add extcon_get_edev_name() API to get the name of extcon device on extcon client driver because the name is included in 'struct extcon_dev' and 'struct extcon_dev' should be handled in only drivers/extcon directory. So. if extcon client need the name of extcon device, they could use this function. - Unify the jig/dock and MHL-TA cable name on extcon driver. : JIG-{USB-ON|USB-OFF|UART-ON|UART-OFF} -> JIG : Dock-{Smart|Desk|Audio|Card} -> DOCK : MHL-TA -> TA - Use the capital letter for the name of all external connectors. - Remove the optional print_name() function pointer from struct extcon_dev to maintain the consistent name of extcon device. 2. Add the new extcon-axp288.c extcon driver. - The extcon-axp288.c driver support for AXP288 PMIC which has the BC1.2 charger detection capability. So this extcon driver can detect the EXTCON_SLOW_CHARGER, EXTCON_CHARGE_DOWNSTREAM and EXTCON_FAST_CHARGER. 3. Update the extcon-arizona.c driver. - Add support for selective detection mode when headphone detection. - Apply HP clamps for WM8280 4. Clean-up the extcon core and drivers. - Add manufactor information of each extcon device. - Fix checkpatch warning and minor coding style on extcon.c.c - Fix build break if GPIOLIB is not enabled on extcon-usb-gpiio.c. - Set the direction of gpio when calling devm_gpiod_get() on extcon-usb-gpio.c
2015-06-01Drivers: hv: vmbus: Implement NUMA aware CPU affinity for channelsK. Y. Srinivasan2-29/+48
Channels/sub-channels can be affinitized to VCPUs in the guest. Implement this affinity in a way that is NUMA aware. The current protocol distributed the primary channels uniformly across all available CPUs. The new protocol is NUMA aware: primary channels are distributed across the available NUMA nodes while the sub-channels within a primary channel are distributed amongst CPUs within the NUMA node assigned to the primary channel. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01Drivers: hv: vmbus: Use the vp_index map even for channels bound to CPU 0K. Y. Srinivasan1-1/+1
Map target_cpu to target_vcpu using the mapping table. We should use the mapping table to transform guest CPU ID to VP Index as is done for the non-performance critical channels. While the value CPU 0 is special and will map to VP index 0, it is good to be consistent. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01w1: ds2482: Add i2c module alias nameLudek Hlavacek1-0/+1
Add i2c alias to enable autoloading of the module for device specified in device-tree. Signed-off-by: Ludek Hlavacek <ludek_h@seznam.cz> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01snsc: pass timeout as HZ independent valueNicholas Mc Guire1-2/+2
schedule_timeout takes a timeout in jiffies but the code currently is passing in a constant SCDRV_TIMEOUT which makes this timeout HZ dependent, so pass it through msecs_to_jiffies() to fix this up. patch was compile tested with generic_defconfig (implies CONFIG_SGI_SNSC=y) Patch is against 4.0-rc5 (localversion-next is -next-20150527) Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01MAINTAINERS: Fix typo in Android drivers git pathLee Campbell1-1/+1
Fix typo in staging git location for the ANDROID DRIVERS secion. Signed-off-by: Lee Campbell <leecam@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01MAINTAINERS: maintain parportSudip Mukherjee1-2/+5
Lets give the parport subsystem a proper name and start maintaining the files. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01paride: use new parport device modelSudip Mukherjee7-7/+96
Modify paride driver to use the new parallel port device model. Tested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01i2c-parport: use new parport device modelSudip Mukherjee1-5/+10
Modify i2c-parport driver to use the new parallel port device model. Tested-by: Jean Delvare <jdelvare@suse.de> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01i2c-parport: define ports to connectSudip Mukherjee1-0/+23
As of now i2c-parport was connecting to all the available parallel ports. Lets limit that to maximum of 4 instances and at the same time define which instance connects to which parallel port. Tested-by: Jean Delvare <jdelvare@suse.de> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Acked-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01staging: panel: use new parport device modelSudip Mukherjee1-5/+9
Converted to use the new device-model parallel port. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01parport: add device-model to parport subsystemSudip Mukherjee4-28/+379
parport subsystem starts using the device-model. Drivers using the device-model has to define devmodel as true and should register the device with parport using parport_register_dev_model(). Tested-by: Jean Delvare <jdelvare@suse.de> Tested-by: Alan Cox <gnomes@lxorguk.ukuu.org.uk> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01char:pcmcia:synclink_cs - Do not initialise statics to 0.Shailendra Verma1-1/+1
Static variables are initialised to 0 by GCC. Fixes the following checkpatch error: ERROR: do not initialise statics to 0 or NULL FILE: drivers/char/pcmcia/synclink_cs.c:440: static bool break_on_load = 0; Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01Drivers: hv: balloon: check if ha_region_mutex was acquired in ↵Vitaly Kuznetsov1-1/+3
MEM_CANCEL_ONLINE case Memory notifiers are being executed in a sequential order and when one of them fails returning something different from NOTIFY_OK the remainder of the notification chain is not being executed. When a memory block is being onlined in online_pages() we do memory_notify(MEM_GOING_ONLINE, ) and if one of the notifiers in the chain fails we end up doing memory_notify(MEM_CANCEL_ONLINE, ) so it is possible for a notifier to see MEM_CANCEL_ONLINE without seeing the corresponding MEM_GOING_ONLINE event. E.g. when CONFIG_KASAN is enabled the kasan_mem_notifier() is being used to prevent memory hotplug, it returns NOTIFY_BAD for all MEM_GOING_ONLINE events. As kasan_mem_notifier() comes before the hv_memory_notifier() in the notification chain we don't see the MEM_GOING_ONLINE event and we do not take the ha_region_mutex. We, however, see the MEM_CANCEL_ONLINE event and unconditionally try to release the lock, the following is observed: [ 110.850927] ===================================== [ 110.850927] [ BUG: bad unlock balance detected! ] [ 110.850927] 4.1.0-rc3_bugxxxxxxx_test_xxxx #595 Not tainted [ 110.850927] ------------------------------------- [ 110.850927] systemd-udevd/920 is trying to release lock (&dm_device.ha_region_mutex) at: [ 110.850927] [<ffffffff81acda0e>] mutex_unlock+0xe/0x10 [ 110.850927] but there are no more locks to release! At the same time we can have the ha_region_mutex taken when we get the MEM_CANCEL_ONLINE event in case one of the memory notifiers after the hv_memory_notifier() in the notification chain failed so we need to add the mutex_is_locked() check. In case of MEM_ONLINE we are always supposed to have the mutex locked. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01Drivers: hv: vmbus:Update preferred vmbus protocol version to windows 10.Keith Mange2-4/+8
Add support for Windows 10. Signed-off-by: Keith Mange <keith.mange@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-01char: misc: restore MISC_DYNAMIC_MINOR on device_create() failureVladimir Zapolskiy1-4/+9
On attempt to register a dynamic minor misc device its minor number is updated to a virtual minor number prior to device_create() call, however on error path misc->minor == MISC_DYNAMIC_MINOR is not restored. Following the rule of thumb that a function returning an error must not change the state of the caller, assign MISC_DYNAMIC_MINOR back. The problem is met in a sutuation, when subsys_initcall(misc_init) is not yet called and misc_class is not created, but misc_register() modifies statically defined ".minor = MISC_DYNAMIC_MINOR", therefore implicitly changing the client's logic on next attempt (e.g. retrying from deferred list) to register a misc device, whose minor number is converted from dynamic to some unknown static one. Signed-off-by: Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31mei: fix up uuid matchingGreg Kroah-Hartman4-11/+9
A previous commit, c93b76b34b4d ("mei: bus: report also uuid in module alias") caused a build error as I missed applying a needed patch to add some macros to uapi/linux/uuid.h. Instead of those additional macros, change the mei code to use the existing uuid structure directly. Fixes: c93b76b34b4d Cc: Tomas Winkler <tomas.winkler@intel.com> Cc: Samuel Ortiz <sameo@linux.intel.com> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-29extcon: Remove optional print_name() function pointer of extcon_devChanwoo Choi2-11/+0
This patch removes the optional print_name() function pointer included in 'struct extcon_dev' because the extcon must maintain the consistent name of extcon device on sysfs instead of inconsistent name. After merged patch[1], extcon can maintain the consistent name of extcon device without any hard-coded device name. [1] https://lkml.org/lkml/2015/4/27/258 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2015-05-24hwmon: Allow to compile dell-smm-hwmon driver without /proc/i8kPali Rohár4-82/+106
This patch splits CONFIG_I8K compile option to SENSORS_DELL_SMM and CONFIG_I8K. Option SENSORS_DELL_SMM is now used to enable compilation of dell-smm-hwmon driver and old CONFIG_I8K option to enable /proc/i8k interface in driver. So this change allows to compile dell-smm-hwmon driver without legacy /proc/i8k interface which is needed only for old Dell Inspirion models or for userspace i8kutils package. For backward compatibility when CONFIG_I8K is enabled then also SENSORS_DELL_SMM is enabled and so driver dell-smm-hwmon (with /proc/i8k) is compiled. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24hwmon: Rename i8k driver to dell-smm-hwmon and move it to hwmon treePali Rohár4-5/+7
This commit moves i8k driver to hwmon tree under name dell-smm-hwmon which is better name then abbreviation i8k. For backward compatibility is added macro MODULE_ALIAS("i8k") so modprobe will load driver also old name i8k. CONFIG_I8K compile option was not changed. This commit also adds me as maintainer of this new dell-smm-hwmon driver and remove Guenter Roeck from list who is implicit maintainer all hwmon drivers. Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24virtio_console: silence a static checker warningDan Carpenter1-2/+2
My static checker complains that this sprintf() can overflow but really it can't. Just silence the warning by using snprintf(). Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Amit Shah <amit.shah@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24xillybus: XILLYBUS_OF should depend on HAS_DMAGeert Uytterhoeven1-1/+1
If NO_DMA=y: drivers/built-in.o: In function `xilly_of_unmap': xillybus_of.c:(.text+0xa860e): undefined reference to `dma_unmap_single' drivers/built-in.o: In function `xilly_map_single_of': xillybus_of.c:(.text+0xa8668): undefined reference to `dma_map_single' xillybus_of.c:(.text+0xa8676): undefined reference to `dma_mapping_error' xillybus_of.c:(.text+0xa86ca): undefined reference to `dma_unmap_single' drivers/built-in.o: In function `xilly_dma_sync_single_for_device_of': xillybus_of.c:(.text+0xa8700): undefined reference to `dma_sync_single_for_cpu' drivers/built-in.o: In function `xilly_dma_sync_single_for_cpu_of': xillybus_of.c:(.text+0xa8726): undefined reference to `dma_sync_single_for_cpu' Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Acked-by: Eli Billauer <eli.billauer@gmail.com> -- v2: - Add Acked-by, send to char and misc drivers maintainers. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24goldfish_pipe: Fix unlikely() misuseJoe Perches1-1/+1
Move the close parenthesis. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24pcmcia: fix a boot time warning in pcmcia cs codeDmitry Eremin-Solenikov1-4/+6
During bootup pcmcia (pccardd) code enforces the following warning backtrace: do not call blocking ops when !TASK_RUNNING; state=1 set at [<c0319e74>] pccardd+0xb8/0x3fc Modules linked in: CPU: 0 PID: 14 Comm: pccardd Not tainted 4.0.0-rc6+ #11 Hardware name: Sharp-Collie [<c0105cd8>] (unwind_backtrace) from [<c0103ef8>] (show_stack+0x10/0x14) [<c0103ef8>] (show_stack) from [<c010e9b8>] (warn_slowpath_common+0x74/0xac) [<c010e9b8>] (warn_slowpath_common) from [<c010ea20>] (warn_slowpath_fmt+0x30/0x40) [<c010ea20>] (warn_slowpath_fmt) from [<c012b1b4>] (__might_sleep+0x84/0xa0) [<c012b1b4>] (__might_sleep) from [<c040fbb0>] (mutex_lock_nested+0x24/0x388) [<c040fbb0>] (mutex_lock_nested) from [<c0319eb4>] (pccardd+0xf8/0x3fc) [<c0319eb4>] (pccardd) from [<c0127370>] (kthread+0xdc/0xfc) [<c0127370>] (kthread) from [<c01013a8>] (ret_from_fork+0x14/0x2c) ---[ end trace fd94911637eed4ba ]--- This happens due to kthread trying to lock mutex in a TASK_INTERRUPTIBLE state. Limit TASK_INTERRUPTIBLE task state to the schedule() call only, so that the rest of the code runs in TASK_RUNNING state. Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24um,ethertap: use strncpyAlan1-1/+1
[um maintainers appear to be vanished] I can't prove the case pointed out in https://bugzilla.kernel.org/show_bug.cgi?id=82341 is correct so let us play safe. Signed-off-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24drivers/char: Remove msm_smd_pkt driverStephen Boyd3-474/+0
This code is no longer used now that mach-msm has been removed. Delete it. Cc: David Brown <davidb@codeaurora.org> Cc: Bryan Huntsman <bryanh@codeaurora.org> Cc: Daniel Walker <dwalker@fifo99.com> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: distribute subchannels among all vcpusVitaly Kuznetsov1-1/+28
Primary channels are distributed evenly across all vcpus we have. When the host asks us to create subchannels it usually makes us num_cpus-1 offers and we are supposed to distribute the work evenly among the channel itself and all its subchannels. Make sure they are all assigned to different vcpus. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: move init_vp_index() call to vmbus_process_offer()Vitaly Kuznetsov1-2/+5
We need to call init_vp_index() after we added the channel to the appropriate list (global or subchannel) to be able to use this information when assigning the channel to the particular vcpu. To do so we need to move a couple of functions around. The only real change is the init_vp_index() call. This is a small refactoring without a functional change. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: decrease num_sc on subchannel removalVitaly Kuznetsov1-1/+2
It is unlikely that that host will ask us to close only one subchannel for a device but let's be consistent. Do both num_sc++ and num_sc-- with channel->lock to be on the safe side. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: briefly comment num_sc and next_ocVitaly Kuznetsov1-3/+9
next_oc and num_sc fields of struct vmbus_channel deserve a description. Move them closer to sc_list as these fields are related to it. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: unify calls to percpu_channel_enq()Vitaly Kuznetsov1-33/+18
Remove some code duplication, no functional change intended. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: kill tasklets on module unloadVitaly Kuznetsov1-1/+4
Explicitly kill tasklets we create on module unload. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: do cleanup on all vmbus_open() failure pathsVitaly Kuznetsov1-7/+6
In case there was an error reported in the response to the CHANNELMSG_OPENCHANNEL call we need to do the cleanup as a vmbus_open() user won't be doing it after receiving an error. The cleanup should be done on all failure paths. We also need to avoid returning open_info->response.open_result.status as the return value as all other errors we return from vmbus_open() are -EXXX and vmbus_open() callers are not supposed to analyze host error codes. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: Implement the protocol for tearing down vmbus stateK. Y. Srinivasan5-1/+34
Implement the protocol for tearing down the monitor state established with the host. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Tested-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24drivers: hv: vmbus: Get rid of some unused definitionsK. Y. Srinivasan1-19/+0
Get rid of some unused definitions. Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24hv: vmbus_free_channels(): remove the redundant free_channel()Dexuan Cui1-3/+8
free_channel() has been invoked in vmbus_remove() -> hv_process_channel_removal(), or vmbus_remove() -> ... -> vmbus_close_internal() -> hv_process_channel_removal(). We also change to use list_for_each_entry_safe(), because the entry is removed in hv_process_channel_removal(). This patch fixes a bug in the vmbus unload path. Thank Dan Carpenter for finding the issue! Signed-off-by: Dexuan Cui <decui@microsoft.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: unregister panic notifier on module unloadVitaly Kuznetsov1-0/+4
Commit 96c1d0581d00f7abe033350edb021a9d947d8d81 ("Drivers: hv: vmbus: Add support for VMBus panic notifier handler") introduced atomic_notifier_chain_register() call on module load. We also need to call atomic_notifier_chain_unregister() on module unload as otherwise the following crash is observed when we bring hv_vmbus back: [ 39.788877] BUG: unable to handle kernel paging request at ffffffffa00078a8 [ 39.788877] IP: [<ffffffff8109d63f>] notifier_call_chain+0x3f/0x80 ... [ 39.788877] Call Trace: [ 39.788877] [<ffffffff8109de7d>] __atomic_notifier_call_chain+0x5d/0x90 ... [ 39.788877] [<ffffffff8109d788>] ? atomic_notifier_chain_register+0x38/0x70 [ 39.788877] [<ffffffff8109d767>] ? atomic_notifier_chain_register+0x17/0x70 [ 39.788877] [<ffffffffa002814f>] hv_acpi_init+0x14f/0x1000 [hv_vmbus] [ 39.788877] [<ffffffff81002144>] do_one_initcall+0xd4/0x210 Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vmbus: introduce vmbus_acpi_removeVitaly Kuznetsov1-0/+10
In case we do request_resource() in vmbus_acpi_add() we need to tear it down to be able to load the driver again. Otherwise the following crash in observed when hv_vmbus unload/load sequence is performed on a Generation2 instance: [ 38.165701] BUG: unable to handle kernel paging request at ffffffffa00075a0 [ 38.166315] IP: [<ffffffff8107dc5f>] __request_resource+0x2f/0x50 [ 38.166315] PGD 1f34067 PUD 1f35063 PMD 3f723067 PTE 0 [ 38.166315] Oops: 0000 [#1] SMP [ 38.166315] Modules linked in: hv_vmbus(+) [last unloaded: hv_vmbus] [ 38.166315] CPU: 0 PID: 267 Comm: modprobe Not tainted 3.19.0-rc5_bug923184+ #486 [ 38.166315] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine, BIOS Hyper-V UEFI Release v1.0 11/26/2012 [ 38.166315] task: ffff88003f401cb0 ti: ffff88003f60c000 task.ti: ffff88003f60c000 [ 38.166315] RIP: 0010:[<ffffffff8107dc5f>] [<ffffffff8107dc5f>] __request_resource+0x2f/0x50 [ 38.166315] RSP: 0018:ffff88003f60fb58 EFLAGS: 00010286 Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: utils: unify driver registration reportingVitaly Kuznetsov3-4/+4
Unify driver registration reporting and move it to debug level as normally daemons write to syslog themselves and these kernel messages are useless. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: fcopy: full handshake supportVitaly Kuznetsov3-2/+32
Introduce FCOPY_VERSION_1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Drivers: hv: vss: full handshake supportVitaly Kuznetsov3-12/+56
Introduce VSS_OP_REGISTER1 to support kernel replying to the negotiation message with its own version. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Tools: hv: vss: use misc char device to communicate with kernelVitaly Kuznetsov1-114/+25
Use /dev/vmbus/hv_vss instead of netlink. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-24Tools: hv: kvp: use misc char device to communicate with kernelVitaly Kuznetsov1-135/+31
Use /dev/vmbus/hv_kvp instead of netlink. Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Tested-by: Alex Ng <alexng@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>