summaryrefslogtreecommitdiff
path: root/drivers
AgeCommit message (Collapse)Author
2021-01-09iio: adc: ab8500-gpadc: Support non-hw-conversionLinus Walleij
The hardware conversion mode only exists in the AB8500 version of the chip, as it is lacking in the AB8505 it will not be in the device tree and we should just not even try to obtain it. The driver already contains code to avoid using a non-existing hardware conversion IRQ at conversion time. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Link: https://lore.kernel.org/r/20201218222013.383704-1-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: sc27xx_adc: Use DIV_ROUND_CLOSEST() instead of open-coding itLars-Peter Clausen
Use DIV_ROUND_CLOSEST() instead of open-coding it. This makes it more clear what is going on for the casual reviewer. Generated using the following the Coccinelle semantic patch. // <smpl> @@ expression x, y; @@ -((x) + ((y) / 2)) / (y) +DIV_ROUND_CLOSEST(x, y) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Chunyan Zhang <zhang.lyra@gmail.com> Link: https://lore.kernel.org/r/20201222191618.3433-1-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: magnetometer: Add driver for Yamaha YAS530Linus Walleij
This adds an IIO magnetometer driver for the Yamaha YAS530 family of magnetometer/compass chips YAS530, YAS532 and YAS533. A quick survey of the source code released by different vendors reveal that we have these variants in the family with some deployments listed: * YAS529 MS-3C (2005 Samsung Aries) * YAS530 MS-3E (2011 Samsung Galaxy S Advance) * YAS532 MS-3R (2011 Samsung Galaxy S4) * YAS533 MS-3F (Vivo 1633, 1707, V3, Y21L) * (YAS534 is a magnetic switch) * YAS535 MS-6C * YAS536 MS-3W * YAS537 MS-3T (2015 Samsung Galaxy S6, Note 5) * YAS539 MS-3S (2018 Samsung Galaxy A7 SM-A750FN) The YAS529 is so significantly different from the YAS53x variants that it will require its own driver. The YAS537 and YAS539 have slightly different register sets but have strong similarities so a common driver patching this one will probably be reasonable. The source code for Samsung Galaxy A7's YAS539 is not that is significantly different from the YAS530 in the Galaxy S Advance, so I believe we will only need this one driver with quirks to handle all of them. The YAS539 is actively announced on Yamaha's devices site: https://device.yamaha.com/en/lsi/products/e_compass/ This is a driver written from scratch using buffered IIO and runtime PM handling regulators and reset. Thanks to Andy Shevchenko for great help in finding all the special kernel infrastructure functions and quirks during review of this driver. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Cc: phone-devel@vger.kernel.org Cc: Jonathan Bakker <xc-racer2@live.ca> Link: https://lore.kernel.org/r/20201224120820.1120099-2-linus.walleij@linaro.org Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: tsl2583: Use DIV_ROUND_CLOSEST() instead of open-coding itLars-Peter Clausen
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent and makes it more clear what is going on for the casual reviewer. Generated using the following the Coccinelle semantic patch. // <smpl> @r1@ expression x; constant C1; constant C2; @@ ((x) + C1) / C2 @script:python@ C1 << r1.C1; C2 << r1.C2; @@ try: if int(C1) * 2 != int(C2): cocci.include_match(False) except: cocci.include_match(False) @@ expression r1.x; constant r1.C1; constant r1.C2; @@ -(((x) + C1) / C2) +DIV_ROUND_CLOSEST(x, C2) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20201227171126.28216-3-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: bme680: Use DIV_ROUND_CLOSEST() instead of open-coding itLars-Peter Clausen
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent and makes it more clear what is going on for the casual reviewer. Generated using the following the Coccinelle semantic patch. // <smpl> @r1@ expression x; constant C1; constant C2; @@ ((x) + C1) / C2 @script:python@ C1 << r1.C1; C2 << r1.C2; @@ try: if int(C1) * 2 != int(C2): cocci.include_match(False) except: cocci.include_match(False) @@ expression r1.x; constant r1.C1; constant r1.C2; @@ -(((x) + C1) / C2) +DIV_ROUND_CLOSEST(x, C2) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20201227171126.28216-2-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: vl6180: Use DIV_ROUND_CLOSEST() instead of open-coding itLars-Peter Clausen
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent and makes it more clear what is going on for the casual reviewer. Generated using the following the Coccinelle semantic patch. // <smpl> @r1@ expression x; constant C1; constant C2; @@ ((x) + C1) / C2 @script:python@ C1 << r1.C1; C2 << r1.C2; @@ try: if int(C1) * 2 != int(C2): cocci.include_match(False) except: cocci.include_match(False) @@ expression r1.x; constant r1.C1; constant r1.C2; @@ -(((x) + C1) / C2) +DIV_ROUND_CLOSEST(x, C2) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Link: https://lore.kernel.org/r/20201227171126.28216-1-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio:light:apds9960 add detection for MSHW0184 ACPI device in apds9960 driverMax Leiter
The device is used in the Microsoft Surface Book 3 and Surface Pro 7 Signed-off-by: Max Leiter <maxwell.leiter@gmail.com> Reviewed-by: Matt Ranostay <matt.ranostay@konsulko.com> Link: https://lore.kernel.org/r/20201220015057.107246-1-maxwell.leiter@gmail.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: imu: inv_mpu6050: Add support for MPU-6880Stephan Gerhold
MPU-6880 seems to be very similar to MPU-6500 and it works fine with some minor additions for the mpu6050 driver. Add the necessary defines for it and make it use the same registers as MPU-6500 but with a FIFO size of 4096. Signed-off-by: Stephan Gerhold <stephan@gerhold.net> Acked-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Cc: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> Link: https://lore.kernel.org/r/20201202104656.5119-2-stephan@gerhold.net Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: chemical: pms7003: convert comma to semicolonZheng Yongjun
Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201211085700.3037-1-zhengyongjun3@huawei.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: core: Copy iio_info.attrs->is_visible into ↵Hans de Goede
iio_dev_opaque.chan_attr_group.is_visible The iio-core extends the attr_group provided by the driver with its own attributes. To be able to do this it: 1. Has its own (non const) io_dev_opaque.chan_attr_group attr_group struct 2. It allocates a new attrs array with room for both the drivers and its own attributes 3. It copies over the driver provided attributes into the newly allocated attrs array. But the drivers attr_group may contain more then just the attrs array, it may also contain an is_visible callback and at least the adi-axi-adc.c is currently defining such a callback. Change the attr_group copying code to also copy over the is_visible callback, so that drivers can define one and have it workins as is normal for attr_group-s all over the kernel. Note that the is_visible callback takes an index into the array as argument, so that indices of the driver's attributes must not change, this is not a problem as the driver's own attributes are added first to the newly allocated attrs array and the attributes handled by the core are appended after the driver's attributes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Alexandru Ardelean <alexandru.ardelean@analog.com> Cc: Michael Hennerich <michael.hennerich@analog.com> Link: https://lore.kernel.org/r/20201125084606.11404-2-hdegoede@redhat.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: adc: xilinx: use more devres helpers and remove remove()Bartosz Golaszewski
In order to simplify resource management and error paths in probe() and entirely drop the remove() callback - use devres helpers wherever possible. Define devm actions for cancelling the delayed work and disabling the clock. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Tested-by: Anand Ashok Dumbre <anandash@xilinx.com> Reviewed-by: Anand Ashok Dumbre <anandash@xilinx.com> Link: https://lore.kernel.org/r/20201130142759.28216-4-brgl@bgdev.pl Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: adc: xilinx: use devm_krealloc() instead of kfree() + kcalloc()Bartosz Golaszewski
We now have devm_krealloc() in the kernel Use it indstead of calling kfree() and kcalloc() separately. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Tested-by: Anand Ashok Dumbre <anandash@xilinx.com> Reviewed-by: Anand Ashok Dumbre <anandash@xilinx.com> Link: https://lore.kernel.org/r/20201130142759.28216-3-brgl@bgdev.pl Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: adc: xilinx: use helper variable for &pdev->devBartosz Golaszewski
It's more elegant to use a helper local variable to store the address of the underlying struct device than to dereference pdev everywhere. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Tested-by: Anand Ashok Dumbre <anandash@xilinx.com> Reviewed-by: Anand Ashok Dumbre <anandash@xilinx.com> Link: https://lore.kernel.org/r/20201130142759.28216-2-brgl@bgdev.pl Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-09iio: xilinx-xadc: Add basic support for Ultrascale System MonitorLars-Peter Clausen
The xilinx-xadc IIO driver currently has support for the XADC in the Xilinx 7 series FPGAs. The system-monitor is the equivalent to the XADC in the Xilinx UltraScale and UltraScale+ FPGAs. The IP designers did a good job at maintaining backwards compatibility and only minor changes are required to add basic support for the system-monitor core. The non backwards compatible changes are: * Register map offset was moved from 0x200 to 0x400 * Only one ADC compared to two in the XADC * 10 bit ADC instead of 12 bit ADC * Two of the channels monitor different supplies Add the necessary logic to accommodate these changes to support the system-monitor in the XADC driver. Note that this patch does not include support for some new features found in the system-monitor like additional alarms, user supply monitoring and secondary system-monitor access. This might be added at a later time. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Tested-by: Anand Ashok Dumbre <anandash@xilinx.com> Reviewed-by: Anand Ashok Dumbre <anandash@xilinx.com> Link: https://lore.kernel.org/r/20200922134624.13191-2-lars@metafoo.de Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
2021-01-07staging: unisys: visorhba: enhance visorhba to use channel_interruptSong Chen
visorhba uses kthread to obtain the responses from the IO Service Partition periodically, on the other hand, visorbus provides periodic work to serve such request, therefore, kthread should be replaced by channel_interrupt. Signed-off-by: Song Chen <chensong_2000@189.cn> Link: https://lore.kernel.org/r/1609923863-6650-1-git-send-email-chensong_2000@189.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07staging: vchiq: fix uninitialized variable copyArnd Bergmann
Smatch found a local variable that can get copied to another local variable without an initializion in the error case: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1056 vchiq_get_user_ptr() error: uninitialized symbol 'ptr'. This seems harmless, as the function should normally get inlined, with the output directly written or not. In any case, the uninitialized data is never used after get_user() fails. As Dan mentions, it could still trigger an UBSAN runtime error, and it is of course a bad idea to copy uninitialized variables, so just bail out early. Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210105135256.1810337-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07staging: vc04_services: Add a note to the TODOPhil Elwell
Record in the TODO file that the address of "&waiter->bulk_waiter" should never be returned to userspace. Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phil Elwell <phil@raspberrypi.com> Link: https://lore.kernel.org/r/20210105162030.1415213-4-phil@raspberrypi.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07staging: vchiq: Fix bulk transfers on 64-bit buildsPhil Elwell
The recent change to the bulk transfer compat function missed the fact the relevant ioctl command is VCHIQ_IOC_QUEUE_BULK_TRANSMIT32, not VCHIQ_IOC_QUEUE_BULK_TRANSMIT, as any attempt to send a bulk block to the VPU would have shown. Fixes: a4367cd2b231 ("staging: vchiq: convert compat bulk transfer") Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phil Elwell <phil@raspberrypi.com> Link: https://lore.kernel.org/r/20210105162030.1415213-3-phil@raspberrypi.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-07staging: vchiq: Fix bulk userdata handlingPhil Elwell
The addition of the local 'userdata' pointer to vchiq_irq_queue_bulk_tx_rx omitted the case where neither BLOCKING nor WAITING modes are used, in which case the value provided by the caller is not returned to them as expected, but instead it is replaced with a NULL. This lack of a suitable context may cause the application to crash or otherwise malfunction. Fixes: 4184da4f316a ("staging: vchiq: fix __user annotations") Tested-by: Stefan Wahren <stefan.wahren@i2se.com> Acked-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Phil Elwell <phil@raspberrypi.com> Link: https://lore.kernel.org/r/20210105162030.1415213-2-phil@raspberrypi.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05staging: rtl819x: select CONFIG_CRC32Arnd Bergmann
Without crc32 support, the drivers fail to link: ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_wep.ko] undefined! ERROR: modpost: "crc32_le" [drivers/staging/rtl8192e/rtllib_crypt_tkip.ko] undefined! ERROR: modpost: "crc32_le" [drivers/staging/rtl8192u/r8192u_usb.ko] undefined! Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20210103214034.1995821-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05staging: mt7621-dts: match pinctrl nodes with its binding documentationSergio Paracuellos
According to the binding documentation pinctrl related nodes must use '-pins$' and ''^(.*-)?pinmux$'' as names. Change all to properly match them. Also default state is for consumer nodes and shall be removed from here. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Link: https://lore.kernel.org/r/20210104150651.32083-1-sergio.paracuellos@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05staging: vchiq: delete obselete commentDan Carpenter
This comment describes a security problem which was fixed in commit 1c954540c0eb ("staging: vchiq: avoid mixing kernel and user pointers"). The bug is fixed now so the FIXME can be removed. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/X/RnUjY3XkZohk7w@mwanda Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-05staging: greybus: light: Use kzalloc for allocating only one thingZheng Yongjun
Use kzalloc rather than kcalloc(1,...) The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ @@ - kcalloc(1, + kzalloc( ...) // </smpl> Reviewed-by: Alex Elder <elder@linaro.org> Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com> Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201230013706.28698-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-01-04Revert "staging: board: Remove macro board_staging"Greg Kroah-Hartman
This reverts commit 850c35bb28ecd80bdbecc5cc4d47d0c6941d6d83 as it breaks the build. Cc: Song Chen <chensong_2000@189.cn> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Link: https://lore.kernel.org/r/20210104122653.6f35b9bb@canb.auug.org.au Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: rtl8192e: fix bool comparison in expressionsAditya Srivastava
There are certain conditional expressions in rtl8192e, where a boolean variable is compared with true/false, in forms such as (foo == true) or (false != bar), which does not comply with checkpatch.pl (CHECK: BOOL_COMPARISON), according to which boolean variables should be themselves used in the condition, rather than comparing with true/false E.g. in drivers/staging/rtl8192e/rtl8192e/r8192E_dev.c, "if (Type == true)" can be replaced with: "if (Type)" Replace all such expressions with the bool variables appropriately Signed-off-by: Aditya Srivastava <yashsri421@gmail.com> Link: https://lore.kernel.org/r/20201220194224.12835-1-yashsri421@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: fwserial: Fix error handling in fwserial_createDinghao Liu
When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20201221122437.10274-1-dinghao.liu@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: rtl8192u: Add null check in rtl8192_usb_initendpointsDinghao Liu
There is an allocation for priv->rx_urb[16] has no null check, which may lead to a null pointer dereference. Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Link: https://lore.kernel.org/r/20201226080258.6576-1-dinghao.liu@zju.edu.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: board: Remove macro board_stagingSong Chen
Macro is not supposed to have flow control in it's statement, remove. Signed-off-by: Song Chen <chensong_2000@189.cn> Link: https://lore.kernel.org/r/1608890085-1267-1-git-send-email-chensong_2000@189.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: board: description for CONFIG_STAGING_BOARDSong Chen
A paragraph to describe what CONFIG_STAGING_BOARD is for, to help developers have better understanding. Signed-off-by: Song Chen <chensong_2000@189.cn> Link: https://lore.kernel.org/r/1608889958-32118-1-git-send-email-chensong_2000@189.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: vc04_services: use DEFINE_MUTEX() for mutex lockZheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201224132528.31558-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28staging: most: net: use DEFINE_MUTEX() for mutex lockZheng Yongjun
mutex lock can be initialized automatically with DEFINE_MUTEX() rather than explicitly calling mutex_init(). Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Link: https://lore.kernel.org/r/20201224132519.31504-1-zhengyongjun3@huawei.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28Staging: rtl8723bs/core: fix braces coding style issuesBrother Matthew De Angelis
Fix all the braces coding style issues found by checkpatch.pl in rtw_security.c. Signed-off-by: Brother Matthew De Angelis <matthew.v.deangelis@gmail.com> Link: https://lore.kernel.org/r/20201211222845.GA543167@a Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-28driver: staging: count ashmem_range into SLAB_RECLAIMBLEZhaoyang Huang
Add SLAB_RECLAIM_ACCOUNT to ashmem_range cache since it has registered shrinker, which make memAvailable more presiced. Acked-by: Todd Kjos <tkjos@google.com> Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com> Link: https://lore.kernel.org/r/1608277668-3740-1-git-send-email-huangzhaoyang@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-12-27Merge tag 'ntb-5.11' of git://github.com/jonmason/ntbLinus Torvalds
Pull NTB fixes from Jon Mason: "Bug fix for IDT NTB and Intel NTB LTR management support" * tag 'ntb-5.11' of git://github.com/jonmason/ntb: ntb: intel: add Intel NTB LTR vendor support for gen4 NTB ntb: idt: fix error check in ntb_hw_idt.c
2020-12-27Merge branch 'linus' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "Fix a number of autobuild failures due to missing Kconfig dependencies" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: qat - add CRYPTO_AES to Kconfig dependencies crypto: keembay - Add dependency on HAS_IOMEM crypto: keembay - CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 should depend on ARCH_KEEMBAY
2020-12-26mfd: ab8500-debugfs: Remove extraneous seq_putcLinus Torvalds
Commit c9a3c4e637ac ("mfd: ab8500-debugfs: Remove extraneous curly brace") removed a left-over curly brace that caused build failures, but Joe Perches points out that the subsequent 'seq_putc()' should also be removed, because the commit that caused all these problems already added the final '\n' to the seq_printf() above it. Reported-by: Joe Perches <joe@perches.com> Fixes: 886c8121659d ("mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc") Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-12-25Merge tag 'pci-v5.11-fixes-1' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci Pull PCI fixes from Bjorn Helgaas: - Fix a tegra enumeration regression (Rob Herring) - Fix a designware-host check that warned on *success*, not failure (Alexander Lobakin) * tag 'pci-v5.11-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: PCI: dwc: Fix inverted condition of DMA mask setup warning PCI: tegra: Fix host link initialization
2020-12-25mfd: ab8500-debugfs: Remove extraneous curly braceNathan Chancellor
Clang errors: drivers/mfd/ab8500-debugfs.c:1526:2: error: non-void function does not return a value [-Werror,-Wreturn-type] } ^ drivers/mfd/ab8500-debugfs.c:1528:2: error: expected identifier or '(' return 0; ^ drivers/mfd/ab8500-debugfs.c:1529:1: error: extraneous closing brace ('}') } ^ 3 errors generated. The cleanup in ab8500_interrupts_show left a curly brace around, remove it to fix the error. Fixes: 886c8121659d ("mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-12-25PCI: dwc: Fix inverted condition of DMA mask setup warningAlexander Lobakin
Commit 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address allocation") added dma_mask_set() call to explicitly set 32-bit DMA mask for MSI message mapping, but for now it throws a warning on ret == 0, while dma_set_mask() returns 0 in case of success. Fix this by inverting the condition. [bhelgaas: join string to make it greppable] Fixes: 660c486590aa ("PCI: dwc: Set 32-bit DMA mask for MSI target address allocation") Link: https://lore.kernel.org/r/20201222150708.67983-1-alobakin@pm.me Signed-off-by: Alexander Lobakin <alobakin@pm.me> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
2020-12-25PCI: tegra: Fix host link initializationRob Herring
Commit b9ac0f9dc8ea ("PCI: dwc: Move dw_pcie_setup_rc() to DWC common code") broke enumeration of downstream devices on Tegra: In non-working case (next-20201211): 0001:00:00.0 PCI bridge: NVIDIA Corporation Device 1ad2 (rev a1) 0001:01:00.0 SATA controller: Marvell Technology Group Ltd. Device 9171 (rev 13) 0005:00:00.0 PCI bridge: NVIDIA Corporation Device 1ad0 (rev a1) In working case (v5.10-rc7): 0001:00:00.0 PCI bridge: Molex Incorporated Device 1ad2 (rev a1) 0001:01:00.0 SATA controller: Marvell Technology Group Ltd. Device 9171 (rev 13) 0005:00:00.0 PCI bridge: Molex Incorporated Device 1ad0 (rev a1) 0005:01:00.0 PCI bridge: PLX Technology, Inc. Device 3380 (rev ab) 0005:02:02.0 PCI bridge: PLX Technology, Inc. Device 3380 (rev ab) 0005:03:00.0 USB controller: PLX Technology, Inc. Device 3380 (rev ab) The problem seems to be dw_pcie_setup_rc() is now called twice before and after the link up handling. The fix is to move Tegra's link up handling to .start_link() function like other DWC drivers. Tegra is a bit more complicated than others as it re-inits the whole DWC controller to retry the link. With this, the initialization ordering is restored to match the prior sequence. Fixes: b9ac0f9dc8ea ("PCI: dwc: Move dw_pcie_setup_rc() to DWC common code") Link: https://lore.kernel.org/r/20201218143905.1614098-1-robh@kernel.org Reported-by: Mian Yousaf Kaukab <ykaukab@suse.de> Tested-by: Mian Yousaf Kaukab <ykaukab@suse.de> Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Jonathan Hunter <jonathanh@nvidia.com> Cc: Vidya Sagar <vidyas@nvidia.com>
2020-12-25drm/amd/display: avoid uninitialized variable warningLinus Torvalds
clang (quite rightly) complains fairly loudly about the newly added mpc1_get_mpc_out_mux() function returning an uninitialized value if the 'opp_id' checks don't pass. This may not happen in practice, but the code really shouldn't return garbage if the sanity checks don't pass. So just initialize 'val' to zero to avoid the issue. Fixes: 110b055b2827 ("drm/amd/display: add getter routine to retrieve mpcc mux") Cc: Josip Pavic <Josip.Pavic@amd.com> Cc: Bindu Ramamurthy <bindu.r@amd.com> Cc: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-12-24Merge tag 'irq-core-2020-12-23' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull irq updates from Thomas Gleixner: "This is the second attempt after the first one failed miserably and got zapped to unblock the rest of the interrupt related patches. A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy accesses, inefficient and disfunctional code. The goal is to remove the export of irq_to_desc() to prevent these things from creeping up again" * tag 'irq-core-2020-12-23' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (30 commits) genirq: Restrict export of irq_to_desc() xen/events: Implement irq distribution xen/events: Reduce irq_info:: Spurious_cnt storage size xen/events: Only force affinity mask for percpu interrupts xen/events: Use immediate affinity setting xen/events: Remove disfunct affinity spreading xen/events: Remove unused bind_evtchn_to_irq_lateeoi() net/mlx5: Use effective interrupt affinity net/mlx5: Replace irq_to_desc() abuse net/mlx4: Use effective interrupt affinity net/mlx4: Replace irq_to_desc() abuse PCI: mobiveil: Use irq_data_get_irq_chip_data() PCI: xilinx-nwl: Use irq_data_get_irq_chip_data() NTB/msi: Use irq_has_action() mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc pinctrl: nomadik: Use irq_has_action() drm/i915/pmu: Replace open coded kstat_irqs() copy drm/i915/lpe_audio: Remove pointless irq_to_desc() usage s390/irq: Use irq_desc_kstat_cpu() in show_msi_interrupt() parisc/irq: Use irq_desc_kstat_cpu() in show_interrupts() ...
2020-12-24Merge tag 'efi_updates_for_v5.11' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip Pull EFI updates from Borislav Petkov: "These got delayed due to a last minute ia64 build issue which got fixed in the meantime. EFI updates collected by Ard Biesheuvel: - Don't move BSS section around pointlessly in the x86 decompressor - Refactor helper for discovering the EFI secure boot mode - Wire up EFI secure boot to IMA for arm64 - Some fixes for the capsule loader - Expose the RT_PROP table via the EFI test module - Relax DT and kernel placement restrictions on ARM with a few followup fixes: - fix the build breakage on IA64 caused by recent capsule loader changes - suppress a type mismatch build warning in the expansion of EFI_PHYS_ALIGN on ARM" * tag 'efi_updates_for_v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: efi: arm: force use of unsigned type for EFI_PHYS_ALIGN efi: ia64: disable the capsule loader efi: stub: get rid of efi_get_max_fdt_addr() efi/efi_test: read RuntimeServicesSupported efi: arm: reduce minimum alignment of uncompressed kernel efi: capsule: clean scatter-gather entries from the D-cache efi: capsule: use atomic kmap for transient sglist mappings efi: x86/xen: switch to efi_get_secureboot_mode helper arm64/ima: add ima_arch support ima: generalize x86/EFI arch glue for other EFI architectures efi: generalize efi_get_secureboot efi/libstub: EFI_GENERIC_STUB_INITRD_CMDLINE_LOADER should not default to yes efi/x86: Only copy the compressed kernel image in efi_relocate_kernel() efi/libstub/x86: simplify efi_is_native()
2020-12-24Merge tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-blockLinus Torvalds
Pull block fixes from Jens Axboe: "A few stragglers in here, but mostly just straight fixes. In particular: - Set of rnbd fixes for issues around changes for the merge window (Gioh, Jack, Md Haris Iqbal) - iocost tracepoint addition (Baolin) - Copyright/maintainers update (Christoph) - Remove old blk-mq fast path CPU warning (Daniel) - loop max_part fix (Josh) - Remote IPI threaded IRQ fix (Sebastian) - dasd stable fixes (Stefan) - bcache merge window fixup and style fixup (Yi, Zheng)" * tag 'block-5.11-2020-12-23' of git://git.kernel.dk/linux-block: md/bcache: convert comma to semicolon bcache:remove a superfluous check in register_bcache block: update some copyrights block: remove a pointless self-reference in block_dev.c MAINTAINERS: add fs/block_dev.c to the block section blk-mq: Don't complete on a remote CPU in force threaded mode s390/dasd: fix list corruption of lcu list s390/dasd: fix list corruption of pavgroup group list s390/dasd: prevent inconsistent LCU device data s390/dasd: fix hanging device offline processing blk-iocost: Add iocg idle state tracepoint nbd: Respect max_part for all partition scans block/rnbd-clt: Does not request pdu to rtrs-clt block/rnbd-clt: Dynamically allocate sglist for rnbd_iu block/rnbd: Set write-back cache and fua same to the target device block/rnbd: Fix typos block/rnbd-srv: Protect dev session sysfs removal block/rnbd-clt: Fix possible memleak block/rnbd-clt: Get rid of warning regarding size argument in strlcpy blk-mq: Remove 'running from the wrong CPU' warning
2020-12-24Merge tag 'libnvdimm-for-5.11' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm Pull libnvdimm updates from Dan Williams: "Twas the day before Christmas and the only thing stirring in libnvdimm / device-dax land is a pile of miscellaneous fixups and cleanups. The bulk of it has appeared in -next save the last two patches to device-dax that have passed my build and unit tests. - Fix a long standing block-window-namespace issue surfaced by the ndctl change to attempt to preserve the kernel device name over a 'reconfigure' - Fix a few error path memory leaks in nfit and device-dax - Silence a smatch warning in the ioctl path - Miscellaneous cleanups" * tag 'libnvdimm-for-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm: device-dax: Avoid an unnecessary check in alloc_dev_dax_range() device-dax: Fix range release device-dax: delete a redundancy check in dev_dax_validate_align() libnvdimm/label: Return -ENXIO for no slot in __blk_label_update device-dax/core: Fix memory leak when rmmod dax.ko device-dax/pmem: Convert comma to semicolon libnvdimm: Cleanup include of badblocks.h ACPI: NFIT: Fix input validation of bus-family libnvdimm/namespace: Fix reaping of invalidated block-window-namespace labels ACPI/nfit: avoid accessing uninitialized memory in acpi_nfit_ctl()
2020-12-24Merge tag 'drm-next-2020-12-24' of git://anongit.freedesktop.org/drm/drmLinus Torvalds
Pull drm fixes from Dave Airlie: "Xmas eve pull request present. Just some fixes that trickled in this past week: Mostly amdgpu fixes, with a dma-buf/mips build fix and some misc komeda fixes. dma-buf: - fix build on mips komeda: - fix commit tail operation order - NULL pointer fix - out of bounds access fix ttm: - remove an unused function amdgpu: - Vangogh SMU fixes - Arcturus gfx9 fixes - Misc display fixes - Sienna Cichlid SMU update - Fix S3 display memory leak - Fix regression caused by DP sub-connector support amdkfd: - Properly require pcie atomics for gfx10" * tag 'drm-next-2020-12-24' of git://anongit.freedesktop.org/drm/drm: (31 commits) drm/amd/display: Fix memory leaks in S3 resume drm/amdgpu: Fix a copy-pasta comment drm/amdgpu: only set DP subconnector type on DP and eDP connectors drm/amd/pm: bump Sienna Cichlid smu_driver_if version to match latest pmfw drm/amd/display: add getter routine to retrieve mpcc mux drm/amd/display: always program DPPDTO unless not safe to lower drm/amd/display: [FW Promotion] Release 0.0.47 drm/amd/display: updated wm table for Renoir drm/amd/display: Acquire DSC during split stream for ODM only if top_pipe drm/amd/display: Multi-display underflow observed drm/amd/display: Remove unnecessary NULL check drm/amd/display: Update RN/VGH active display count workaround drm/amd/display: change SMU repsonse timeout to 2s. drm/amd/display: gradually ramp ABM intensity drm/amd/display: To modify the condition in indicating branch device drm/amd/display: Modify the hdcp device count check condition drm/amd/display: Interfaces for hubp blank and soft reset drm/amd/display: handler not correctly checked at remove_irq_handler drm/amdgpu: check gfx pipe availability before toggling its interrupts drm/amdgpu: remove unnecessary asic type check ...
2020-12-24Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhostLinus Torvalds
Pull virtio updates from Michael Tsirkin: - vdpa sim refactoring - virtio mem: Big Block Mode support - misc cleanus, fixes * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost: (61 commits) vdpa: Use simpler version of ida allocation vdpa: Add missing comment for virtqueue count uapi: virtio_ids: add missing device type IDs from OASIS spec uapi: virtio_ids.h: consistent indentions vhost scsi: fix error return code in vhost_scsi_set_endpoint() virtio_ring: Fix two use after free bugs virtio_net: Fix error code in probe() virtio_ring: Cut and paste bugs in vring_create_virtqueue_packed() tools/virtio: add barrier for aarch64 tools/virtio: add krealloc_array tools/virtio: include asm/bug.h vdpa/mlx5: Use write memory barrier after updating CQ index vdpa: split vdpasim to core and net modules vdpa_sim: split vdpasim_virtqueue's iov field in out_iov and in_iov vdpa_sim: make vdpasim->buffer size configurable vdpa_sim: use kvmalloc to allocate vdpasim->buffer vdpa_sim: set vringh notify callback vdpa_sim: add set_config callback in vdpasim_dev_attr vdpa_sim: add get_config callback in vdpasim_dev_attr vdpa_sim: make 'config' generic and usable for any device type ...
2020-12-24Merge branch 'for-5.11/dax' into for-5.11/libnvdimmDan Williams
Pull in miscellaneous device-dax fixups and cleanups for v5.11.
2020-12-24device-dax: Avoid an unnecessary check in alloc_dev_dax_range()Zhen Lei
Swap the calling sequence of krealloc() and __request_region(), call the latter first. In this way, the value of dev_dax->nr_range does not need to be considered when __request_region() failed. Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/20201219081840.1149-2-thunder.leizhen@huawei.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2020-12-24device-dax: Fix range releaseDan Williams
There are multiple locations that open-code the release of the last range in a device-dax instance. Consolidate this into a new dev_dax_trim_range() helper. This also addresses a kmemleak report: # cat /sys/kernel/debug/kmemleak [..] unreferenced object 0xffff976bd46f6240 (size 64): comm "ndctl", pid 23556, jiffies 4299514316 (age 5406.733s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 20 c3 37 00 00 00 .......... .7... ff ff ff 7f 38 00 00 00 00 00 00 00 00 00 00 00 ....8........... backtrace: [<00000000064003cf>] __kmalloc_track_caller+0x136/0x379 [<00000000d85e3c52>] krealloc+0x67/0x92 [<00000000d7d3ba8a>] __alloc_dev_dax_range+0x73/0x25c [<0000000027d58626>] devm_create_dev_dax+0x27d/0x416 [<00000000434abd43>] __dax_pmem_probe+0x1c9/0x1000 [dax_pmem_core] [<0000000083726c1c>] dax_pmem_probe+0x10/0x1f [dax_pmem] [<00000000b5f2319c>] nvdimm_bus_probe+0x9d/0x340 [libnvdimm] [<00000000c055e544>] really_probe+0x230/0x48d [<000000006cabd38e>] driver_probe_device+0x122/0x13b [<0000000029c7b95a>] device_driver_attach+0x5b/0x60 [<0000000053e5659b>] bind_store+0xb7/0xc3 [<00000000d3bdaadc>] drv_attr_store+0x27/0x31 [<00000000949069c5>] sysfs_kf_write+0x4a/0x57 [<000000004a8b5adf>] kernfs_fop_write+0x150/0x1e5 [<00000000bded60f0>] __vfs_write+0x1b/0x34 [<00000000b92900f0>] vfs_write+0xd8/0x1d1 Reported-by: Jane Chu <jane.chu@oracle.com> Cc: Zhen Lei <thunder.leizhen@huawei.com> Link: https://lore.kernel.org/r/160834570161.1791850.14911670304441510419.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com>