summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2018-01-10uio_hv_generic: fix type mismatch warningsArnd Bergmann
I moved the virt_to_phys() conversion into hv_uio_probe() as part of a warning fix. Stephen's cleanup to remove the private mmap() function seems reasonable, but part of it reverted the change that I did to hide the warnings, so they are back now: drivers/uio/uio_hv_generic.c: In function 'hv_uio_probe': drivers/uio/uio_hv_generic.c:123:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] drivers/uio/uio_hv_generic.c:130:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] drivers/uio/uio_hv_generic.c:136:5: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] The type mismatch is now the result of the uio_mmap() definition, and the best way I see from here is to shut them up with a uintptr_t cast. Fixes: 9c40546c012c ("uio_hv_generic: use standard mmap for resources") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10auxdisplay: img-ascii-lcd: add missing MODULE_DESCRIPTION/AUTHOR/LICENSEJesse Chan
This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/auxdisplay/img-ascii-lcd.o see include/linux/module.h for more information This adds the license as "GPL", which matches the header of the file. MODULE_DESCRIPTION and MODULE_AUTHOR are also added. Signed-off-by: Jesse Chan <jc@linux.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10uio_hv_generic: add rescind supportStephen Hemminger
When host rescinds the device, the UIO driver will clear the interrupt state and notify application. The read (or write) on the interrupt FD will then fail with -EIO. This is simpler than adding lots extra uevent stuff inside UIO. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10uio_hv_generic: check that host supports monitor pageStephen Hemminger
In order for userspace application to signal host, it needs the host to support the monitor page property. Check for the flag and fail if this is not supported. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10uio_hv_generic: create send and receive buffersStephen Hemminger
Map in receive and send buffers for networking in UIO device. These buffers are special and need to be setup by kernel API's; userspace can not do it. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10uio: document uio_hv_generic regionsStephen Hemminger
Describe the regions present with uio_hv_generic in documentation for driver API. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-10doc: fix documentation about uio_hv_genericStephen Hemminger
The vmbus sysfs file names changed in commit f6b2db084b65 ("vmbus: make sysfs names consistent with PCI") and the uio documenatation does not match the current names. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09vmbus: add monitor_id and subchannel_id to sysfs per channelStephen Hemminger
Useful to identify which network queue is associated with which vmbus channel. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09vmbus: fix ABI documentationStephen Hemminger
Fixes to vmbus ABI document including: - make it clear that relid is numeric value in sub directory - clarify interrupt mask description - spelling fixes - document regions Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09uio_hv_generic: use ISR callback methodStephen Hemminger
The UIO IRQ handler doesn't need to be called from a tasklet. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09uio_hv_generic: use standard mmap for resourcesStephen Hemminger
The generic UIO mmap should work for us. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09uio_hv_generic: fix configuration commentsStephen Hemminger
The suggested method for configuration does not work with current kernels. Paths and ids changed. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09vmbus: make channel attributes staticStephen Hemminger
These channel attribute data structures are only used by vmbus_drv sysfs routines. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09android: binder: Use octal permissionsHarsh Shandilya
checkpatch warns against the use of symbolic permissions, this patch migrates all symbolic permissions in the binder driver to octal permissions. Test: debugfs nodes created by binder have the same unix permissions prior to and after this patch was applied. Signed-off-by: Harsh Shandilya <harsh@prjkt.io> Cc: "Arve Hjønnevåg" <arve@android.com> Cc: Todd Kjos <tkjos@android.com> Cc: Martijn Coenen <maco@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09char: xillybus: remove direct dependency on DT functionsRob Herring
Drivers generally should not need to depend directly on OF_ADDRESS or OF_IRQ. Convert xillybus to use the preferred platform_get_resource() and platform_get_irq() functions to remove this dependency. Cc: Eli Billauer <eli.billauer@gmail.com> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09ANDROID: binder: Remove obsolete proc waitqueue.Martijn Coenen
It was no longer being used. Signed-off-by: Martijn Coenen <maco@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09Drivers: hv: vmbus: Remove x86-isms from arch independent driversMichael Kelley
hv_is_hypercall_page_setup() is used to check if Hyper-V is initialized, but a 'hypercall page' is an x86 implementation detail that isn't necessarily present on other architectures. Rename to the architecture independent hv_is_hyperv_initialized() and add check that x86_hyper is pointing to Hyper-V. Use this function instead of direct references to x86-specific data structures in vmbus_drv.c, and remove now redundant call in hv_init(). Also remove 'x86' from the string name passed to cpuhp_setup_state(). Signed-off-by: Michael Kelley <mikelley@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09ANDROID: binder: remove waitqueue when thread exits.Martijn Coenen
binder_poll() passes the thread->wait waitqueue that can be slept on for work. When a thread that uses epoll explicitly exits using BINDER_THREAD_EXIT, the waitqueue is freed, but it is never removed from the corresponding epoll data structure. When the process subsequently exits, the epoll cleanup code tries to access the waitlist, which results in a use-after-free. Prevent this by using POLLFREE when the thread exits. Signed-off-by: Martijn Coenen <maco@android.com> Reported-by: syzbot <syzkaller@googlegroups.com> Cc: stable <stable@vger.kernel.org> # 4.14 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09mei: fix an && vs || typoDan Carpenter
->dev_state can't be both MEI_DEV_RESETTING and MEI_DEV_POWER_DOWN at the same time. && was clearing intended here. Fixes: 8d52af6795c0 ("mei: speed up the power down flow") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09android: binder: Prefer __func__ to using hardcoded function nameElad Wexler
Coding style fixup Signed-off-by: Elad Wexler <elad.wexler@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09misc: ds1682: Ignore update-in-progress ETC readsThomas VanSelus
The Elapsed Time Counter (ETC) registers are not buffered for reading. If a 250ms tick occurs while data is being read out, the result can be a combination of old and new values. This can occur at the byte level (giving a time in the future) or the individual bit level (giving a time in the past). We catch both these cases by reading until we get two equal or consecutive values. After five unsuccessful attempts we give up. Signed-off-by: Thomas VanSelus <tvanselus@xes-inc.com> Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09misc: ds1682: Show device registers as unsignedAaron Sierra
This patch leverages the fact that all DS1682 registers are unsigned to merge two return paths into one. It also introduces val_le as used in ds1682_store() to merge two endianness conversions into one. Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09misc: fsa9480: Add blank line after declarations.Tejas Upadhyay
Resolved missing a blank line after declarations checkpatch warnings. Issue found by checkpatch. Signed-off-by: Tejas Upadhyay <tejas.upadhyay@softnautics.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09soundwire: select REGMAP_SOUNDWIREVinod Koul
SoundWire bus needs to select the regmap support. So, add it Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09soundwire: Fix incorrect return value checkShreyas NC
pm_runtime_get_sync will return negative values for error and 0 or 1 for success. Update the error check accordingly. Signed-off-by: Shreyas NC <shreyas.nc@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Fixes: 9d715fa005eb: ("soundwire: Add IO transfer") Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09soundwire: Add Pierre as reviewerVinod Koul
Pierre was MIPI chair for SoundWire spec and we could use his help in code reviews, so add him as a reviewer. Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: qcom: add HAS_IOMEM dependencySrinivas Kandagatla
Below build failure was reported on UML, ERROR: "devm_ioremap_resource" [drivers/slimbus/slim-qcom-ctrl.ko] undefined! ERROR: "__ioread32_copy" [drivers/slimbus/slim-qcom-ctrl.ko] undefined! ERROR: "__iowrite32_copy" [drivers/slimbus/slim-qcom-ctrl.ko] undefined! ERROR: "devm_ioremap" [drivers/slimbus/slim-qcom-ctrl.ko] undefined! This patch fixes it by making qcom slimbus depend on HAS_IOMEM, as these are only defined when HAS_IOMEM is selected. Reported-by: Thomas Meyer <thomas@m3y3r.de> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: qcom: Fix return value check in qcom_slim_probe()Wei Yongjun
In case of error, the function devm_ioremap_resource() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: Fix missing unlock on error in slim_msg_response()Wei Yongjun
Add the missing unlock before return from function slim_msg_response() in the error handling case. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: Use GFP_ATOMIC under spin lockWei Yongjun
A spin lock is taken here so we should use GFP_ATOMIC. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: make functions slim_ack_txn and slim_alloc_txbuf staticColin Ian King
The functions slim_ack_txn and slim_alloc_txbuf are local to the source and do not need to be in global scope, so make them static. Cleans up sparse warnings: symbol 'slim_ack_txn' was not declared. Should it be static? symbol 'slim_alloc_txbuf' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: fix retries comparison to correctly identify failed allocationColin Ian King
Currently the check for too many retries fails because retries is actually -1 when the retry loop terminates if no pbuf can be allocated because of the post decrement on retries. Fix this by not comparing retries with zero but instead check if it is negative. Detected by CoverityScan, CID#1463143 ("Logically dead code") and CID#1463144 ("Dereference after null check") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09slimbus: avoid null pointer dereference on msgColin Ian King
The pointer msg is checked to see if it is null at the start of the function and jumps to the error exit label reterr that then dereferences msg when it prints a dev_err error message. Avoid this potential null pointer dereference by only printing the error message if msg is not null. Detected by CoverityScan, CID#1463141 ("Dereference after null check") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-09mux: add SPDX identifiers to all mux source filesPeter Rosin
Remove all free-text license texts. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. No copyright headers or other non-license-description text was removed. Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Peter Rosin <peda@axentia.se> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08soundwire: Fix typo in return value check of sdw_read()Wei Yongjun
Fix the typo, 'status' should be instead of 'status2'. Fixes: b0a9c37b0178 ("soundwire: Add slave status handling") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08soundwire: intel: fix missing assignment to retColin Ian King
Currently the return status ret is being checked but it has not been updated since the previous check on ret. It appears that assignment of ret from return status of the call to sdw_cdns_enable_interrupt was accidentally ommited. Fix this. Detected by CoverityScan, CID#1463148 ("Logically dead code") Fixes: 71bb8a1b059e ("soundwire: intel: Add Intel Master driver") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08soundwire: fix sign extension when shifting buf[2] 24 placesColin Ian King
The buf[2] left shift by 24 bits is promoted to int (32 bit signed) and then signed-extended to unsigned long long. Hence if the upper bit to buf[2] is set then all the upper bits of addr end up as 1. Fix this by casting it to u64 before shifting it. Also replace the unsigned long long casts to u64 casts to match the same type of addr. Detected by CoverityScan, CID#1463147 ("Unintended sign extension") Fixes: d52d7a1be02c ("soundwire: Add Slave status handling helpers") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08Merge tag 'extcon-next-for-4.16' of ↵Greg Kroah-Hartman
git://git.kernel.org/pub/scm/linux/kernel/git/chanwoo/extcon into char-misc-next Chanwoo writes: Update extcon for 4.16 Detailed description for this pull request: 1. Add support to notify USB connector for "ChromeOS Embedded Controller". - extcon-usbc-cros-ec driver detects the EXTCON_USB and EXTCON_USB_HOST connector type and then notify the state/properties to the consumer device. 2. Update the detection on probe time and clean-up code for "X-Power AXP288". - Detect the state of connector after a couple of seconds after probe() becasue extcon-axp288.c driver depends on other device driver like mux. In order to guarantee the correct state, the extcon-axp288.c uses the delayed_work. - Set EXTCON_CHG_USB_SDP type as the safe default type if unknown connector is attached because the data sheet of axp288 doesn't handle the all exception cases. - Remove unused code 3. Fix the minor issue of extcon driver - Fix platform get_irq's error checking for extcon-adc-jack. - Delete unneeded initialization for extcon-max8997/max77693.
2018-01-03extcon: axp288: Handle reserved charger-type values betterHans de Goede
According to the data sheets all the values not handled in the switch-case are "reserved". Update the dev_warn message to reflect this and set the cable-type to EXTCON_CHG_USB_SDP (so max 500mA current draw) as safe default. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2018-01-03extcon: axp288: Redo charger type detection a couple of seconds after probe()Hans de Goede
The axp288 extcon code depends on other drivers to do things like mux the data lines, enable/disable vbus based on the id-pin, etc. Sometimes the BIOS has not set these things up correctly resulting in the initial charger cable type detection giving a wrong result and we end up not charging or charging at only 0.5A. This commit starts a second charger-detection cycle a couple of seconds after the first one finishes, giving the other drivers time to load and do their thing. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2018-01-03Merge branch 'ib-extcon-mfd-4.16' into extcon-nextChanwoo Choi
2018-01-03extcon: axp288: Remove unused platform dataHans de Goede
This is not used / set anywhere in the tree. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com> Acked-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2018-01-03extcon: axp288: Remove unused extcon_nb struct memberHans de Goede
Remove the unused extcon_nb struct member. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2018-01-03extcon: axp288:: Handle return value of platform_get_irqArvind Yadav
platform_get_irq() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
2018-01-02i7300_idle: remove unused fileSinan Kaya
i7300_idle.h is not being called by any source file and contains calls to pci_get_bus_and_slot() that we are trying to deprecate. Remove unused file. Signed-off-by: Sinan Kaya <okaya@codeaurora.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-02mei: fix incorrect logical operator in if statementColin Ian King
The current expression using the || operator is always true because dev->dev_state cannot be equal to two different values at the same time. Fix this by replacing the || with &&. Detected by CoverityScan, CID#1463042 ("Constant expression result") Fixes: 8d52af6795c0 ("mei: speed up the power down flow") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-02mei: me: allow runtime pm for platform with D0i3Tomas Winkler
>From the pci power documentation: "The driver itself should not call pm_runtime_allow(), though. Instead, it should let user space or some platform-specific code do that (user space can do it via sysfs as stated above)..." However, the S0ix residency cannot be reached without MEI device getting into low power state. Hence, for mei devices that support D0i3, it's better to make runtime power management mandatory and not rely on the system integration such as udev rules. This policy cannot be applied globally as some older platforms were found to have broken power management. Cc: <stable@vger.kernel.org> v4.13+ Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Reviewed-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-02slimbus: qcom-ctrl: use normal allocationArnd Bergmann
The previous patch addressed a warning but not the cause: drivers/slimbus/qcom-ctrl.c: In function 'qcom_slim_probe': drivers/slimbus/qcom-ctrl.c:584:9: error: passing argument 3 of 'dmam_alloc_coherent' from incompatible pointer type [-Werror=incompatible-pointer-types] There are two things wrong here: - The naming is very confusing, we now have a member named 'phys' that doesn't refer to a phys_addr_t but a dma_addr_t. If we needed a dma address, it should be named 'dma' to avoid confusion, and to make it less likely that someone passes it into a function that expects a physical address. - The dma address is not used at all at this point. It may have been designed to support DMA in the future, but today it doesn't, so the only effect right now is to make transfers artificially slower by using uncached memory instead of cached memory for a temporary buffer. This removes the unused structure member and instead changes the code to call devm_kcalloc(), which matches the usage of the 'base' pointer as an array of temporary buffers. Fixes: db809859c8ce ("slimbus: qcom: fix incompatible pointer warning") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-02Merge 4.15-rc6 into char-misc-nextGreg Kroah-Hartman
We want the fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-31Linux 4.15-rc6Linus Torvalds