Commit graph

881,956 commits

Author SHA1 Message Date
Max Gurtovoy
010f93079a nvme-rdma: assign completion vector correctly
[ Upstream commit 032a9966a22a3596addf81dacf0c1736dfedc32a ]

The completion vector index that is given during CQ creation can't
exceed the number of support vectors by the underlying RDMA device. This
violation currently can accure, for example, in case one will try to
connect with N regular read/write queues and M poll queues and the sum
of N + M > num_supported_vectors. This will lead to failure in establish
a connection to remote target. Instead, in that case, share a completion
vector between queues.

Signed-off-by: Max Gurtovoy <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:36 +02:00
Chengguang Xu
074ae0cd84 block: release bip in a right way in error path
[ Upstream commit 0b8eb629a700c0ef15a437758db8255f8444e76c ]

Release bip using kfree() in error path when that was allocated
by kmalloc().

Signed-off-by: Chengguang Xu <[email protected]>
Reviewed-by: Christoph Hellwig <[email protected]>
Acked-by: Martin K. Petersen <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:36 +02:00
Aditya Pakki
b1b252d8d9 usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work
[ Upstream commit 2655971ad4b34e97dd921df16bb0b08db9449df7 ]

dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments
the reference counter. In case of failure, decrement the reference
before returning.

Signed-off-by: Aditya Pakki <[email protected]>
Signed-off-by: Felipe Balbi <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:36 +02:00
Tomas Henzl
2485b6afad scsi: mptscsih: Fix read sense data size
[ Upstream commit afe89f115e84edbc76d316759e206580a06c6973 ]

The sense data buffer in sense_buf_pool is allocated with size of
MPT_SENSE_BUFFER_ALLOC(64) (multiplied by req_depth) while SNS_LEN(sc)(96)
is used when reading the data.  That may lead to a read from unallocated
area, sometimes from another (unallocated) page.  To fix this, limit the
read size to MPT_SENSE_BUFFER_ALLOC.

Link: https://lore.kernel.org/r/[email protected]
Co-developed-by: Stanislav Saner <[email protected]>
Signed-off-by: Stanislav Saner <[email protected]>
Signed-off-by: Tomas Henzl <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:36 +02:00
yu kuai
10533390da ARM: imx6: add missing put_device() call in imx6q_suspend_init()
[ Upstream commit 4845446036fc9c13f43b54a65c9b757c14f5141b ]

if of_find_device_by_node() succeed, imx6q_suspend_init() doesn't have a
corresponding put_device(). Thus add a jump target to fix the exception
handling for this function implementation.

Signed-off-by: yu kuai <[email protected]>
Signed-off-by: Shawn Guo <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Zhang Xiaoxu
15fa5dfaa4 cifs: update ctime and mtime during truncate
[ Upstream commit 5618303d8516f8ac5ecfe53ee8e8bc9a40eaf066 ]

As the man description of the truncate, if the size changed,
then the st_ctime and st_mtime fields should be updated. But
in cifs, we doesn't do it.

It lead the xfstests generic/313 failed.

So, add the ATTR_MTIME|ATTR_CTIME flags on attrs when change
the file size

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zhang Xiaoxu <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Vasily Gorbik
9c732cccb0 s390/kasan: fix early pgm check handler execution
[ Upstream commit 998f5bbe3dbdab81c1cfb1aef7c3892f5d24f6c7 ]

Currently if early_pgm_check_handler is called it ends up in pgm check
loop. The problem is that early_pgm_check_handler is instrumented by
KASAN but executed without DAT flag enabled which leads to addressing
exception when KASAN checks try to access shadow memory.

Fix that by executing early handlers with DAT flag on under KASAN as
expected.

Reported-and-tested-by: Alexander Egorenkov <[email protected]>
Reviewed-by: Heiko Carstens <[email protected]>
Signed-off-by: Vasily Gorbik <[email protected]>
Signed-off-by: Heiko Carstens <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Hans de Goede
a9c816494d drm: panel-orientation-quirks: Use generic orientation-data for Acer S1003
[ Upstream commit a05caf9e62a85d12da27e814ac13195f4683f21c ]

The Acer S1003 has proper DMI strings for sys-vendor and product-name,
so we do not need to match by BIOS-date.

This means that the Acer S1003 can use the generic lcd800x1280_rightside_up
drm_dmi_panel_orientation_data struct which is also used by other quirks.

Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Hans de Goede
fcab0d2f1b drm: panel-orientation-quirks: Add quirk for Asus T101HA panel
[ Upstream commit 6c22bc18a3b93a38018844636557ad02e588e055 ]

Like the Asus T100HA the Asus T101HA also uses a panel which has been
mounted 90 degrees rotated, albeit in the opposite direction.
Add a quirk for this.

Reviewed-by: Emil Velikov <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Rajat Jain
b7556e7ca3 iommu/vt-d: Don't apply gfx quirks to untrusted devices
[ Upstream commit 67e8a5b18d41af9298db5c17193f671f235cce01 ]

Currently, an external malicious PCI device can masquerade the VID:PID
of faulty gfx devices, and thus apply iommu quirks to effectively
disable the IOMMU restrictions for itself.

Thus we need to ensure that the device we are applying quirks to, is
indeed an internal trusted device.

Signed-off-by: Rajat Jain <[email protected]>
Reviewed-by: Ashok Raj <[email protected]>
Reviewed-by: Mika Westerberg <[email protected]>
Acked-by: Lu Baolu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Joerg Roedel <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Aneesh Kumar K.V
1a570b8fae powerpc/kvm/book3s64: Fix kernel crash with nested kvm & DEBUG_VIRTUAL
[ Upstream commit c1ed1754f271f6b7acb1bfdc8cfb62220fbed423 ]

With CONFIG_DEBUG_VIRTUAL=y, __pa() checks for addr value and if it's
less than PAGE_OFFSET it leads to a BUG().

  #define __pa(x)
  ({
  	VIRTUAL_BUG_ON((unsigned long)(x) < PAGE_OFFSET);
  	(unsigned long)(x) & 0x0fffffffffffffffUL;
  })

  kernel BUG at arch/powerpc/kvm/book3s_64_mmu_radix.c:43!
  cpu 0x70: Vector: 700 (Program Check) at [c0000018a2187360]
      pc: c000000000161b30: __kvmhv_copy_tofrom_guest_radix+0x130/0x1f0
      lr: c000000000161d5c: kvmhv_copy_from_guest_radix+0x3c/0x80
  ...
  kvmhv_copy_from_guest_radix+0x3c/0x80
  kvmhv_load_from_eaddr+0x48/0xc0
  kvmppc_ld+0x98/0x1e0
  kvmppc_load_last_inst+0x50/0x90
  kvmppc_hv_emulate_mmio+0x288/0x2b0
  kvmppc_book3s_radix_page_fault+0xd8/0x2b0
  kvmppc_book3s_hv_page_fault+0x37c/0x1050
  kvmppc_vcpu_run_hv+0xbb8/0x1080
  kvmppc_vcpu_run+0x34/0x50
  kvm_arch_vcpu_ioctl_run+0x2fc/0x410
  kvm_vcpu_ioctl+0x2b4/0x8f0
  ksys_ioctl+0xf4/0x150
  sys_ioctl+0x28/0x80
  system_call_exception+0x104/0x1d0
  system_call_common+0xe8/0x214

kvmhv_copy_tofrom_guest_radix() uses a NULL value for to/from to
indicate direction of copy.

Avoid calling __pa() if the value is NULL to avoid the BUG().

Signed-off-by: Aneesh Kumar K.V <[email protected]>
[mpe: Massage change log a bit to mention CONFIG_DEBUG_VIRTUAL]
Signed-off-by: Michael Ellerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:35 +02:00
Dany Madden
4e4ddeee7a ibmvnic: continue to init in CRQ reset returns H_CLOSED
[ Upstream commit 8b40eb73509f5704a0e8cd25de0163876299f1a7 ]

Continue the reset path when partner adapter is not ready or H_CLOSED is
returned from reset crq. This patch allows the CRQ init to proceed to
establish a valid CRQ for traffic to flow after reset.

Signed-off-by: Dany Madden <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Ciara Loftus
ce4a93b9e6 i40e: protect ring accesses with READ- and WRITE_ONCE
[ Upstream commit d59e267912cd90b0adf33b4659050d831e746317 ]

READ_ONCE should be used when reading rings prior to accessing the
statistics pointer. Introduce this as well as the corresponding WRITE_ONCE
usage when allocating and freeing the rings, to ensure protected access.

Signed-off-by: Ciara Loftus <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Ciara Loftus
2e5a3586ca ixgbe: protect ring accesses with READ- and WRITE_ONCE
[ Upstream commit f140ad9fe2ae16f385f8fe4dc9cf67bb4c51d794 ]

READ_ONCE should be used when reading rings prior to accessing the
statistics pointer. Introduce this as well as the corresponding WRITE_ONCE
usage when allocating and freeing the rings, to ensure protected access.

Signed-off-by: Ciara Loftus <[email protected]>
Tested-by: Andrew Bowers <[email protected]>
Signed-off-by: Jeff Kirsher <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Sascha Hauer
203cfe694e net: ethernet: mvneta: Add 2500BaseX support for SoCs without comphy
[ Upstream commit 1a642ca7f38992b086101fe204a1ae3c90ed8016 ]

The older SoCs like Armada XP support a 2500BaseX mode in the datasheets
referred to as DR-SGMII (Double rated SGMII) or HS-SGMII (High Speed
SGMII). This is an upclocked 1000BaseX mode, thus
PHY_INTERFACE_MODE_2500BASEX is the appropriate mode define for it.
adding support for it merely means writing the correct magic value into
the MVNETA_SERDES_CFG register.

Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Sascha Hauer
996bd0778a net: ethernet: mvneta: Fix Serdes configuration for SoCs without comphy
[ Upstream commit b4748553f53f2971e07d2619f13d461daac0f3bb ]

The MVNETA_SERDES_CFG register is only available on older SoCs like the
Armada XP. On newer SoCs like the Armada 38x the fields are moved to
comphy. This patch moves the writes to this register next to the comphy
initialization, so that depending on the SoC either comphy or
MVNETA_SERDES_CFG is configured.
With this we no longer write to the MVNETA_SERDES_CFG on SoCs where it
doesn't exist.

Suggested-by: Russell King <[email protected]>
Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Zhenzhong Duan
8f23c0dcd0 spi: spidev: fix a potential use-after-free in spidev_release()
[ Upstream commit 06096cc6c5a84ced929634b0d79376b94c65a4bd ]

If an spi device is unbounded from the driver before the release
process, there will be an NULL pointer reference when it's
referenced in spi_slave_abort().

Fix it by checking it's already freed before reference.

Signed-off-by: Zhenzhong Duan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:34 +02:00
Zhenzhong Duan
010de57181 spi: spidev: fix a race between spidev_release and spidev_remove
[ Upstream commit abd42781c3d2155868821f1b947ae45bbc33330d ]

Imagine below scene, spidev is referenced after it's freed.

spidev_release()                spidev_remove()
...
                                spin_lock_irq(&spidev->spi_lock);
                                    spidev->spi = NULL;
                                spin_unlock_irq(&spidev->spi_lock);
mutex_lock(&device_list_lock);
dofree = (spidev->spi == NULL);
if (dofree)
    kfree(spidev);
mutex_unlock(&device_list_lock);
                                mutex_lock(&device_list_lock);
                                list_del(&spidev->device_entry);
                                device_destroy(spidev_class, spidev->devt);
                                clear_bit(MINOR(spidev->devt), minors);
                                if (spidev->users == 0)
                                    kfree(spidev);
                                mutex_unlock(&device_list_lock);

Fix it by resetting spidev->spi in device_list_lock's protection.

Signed-off-by: Zhenzhong Duan <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Pierre-Louis Bossart
44b6e192e0 ALSA: hda: Intel: add missing PCI IDs for ICL-H, TGL-H and EKL
[ Upstream commit d50313a5a0d803bcf55121a2b82086633060d05e ]

Mirror PCI ids used for SOF.

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Guennadi Liakhovetski <[email protected]>
Reviewed-by: Kai Vehmanen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Pierre-Louis Bossart
04197a8184 ASoC: SOF: Intel: add PCI ID for CometLake-S
[ Upstream commit 258fb4f4c34a0db9d3834aba6784d7b322176bb9 ]

Mirror ID added for legacy HDaudio

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Reviewed-by: Guennadi Liakhovetski <[email protected]>
Reviewed-by: Kai Vehmanen <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Linus Walleij
b1589bb5b0 drm: mcde: Fix display initialization problem
[ Upstream commit b984b6d8b52372b98cce0a6ff6c2787f50665b87 ]

The following bug appeared in the MCDE driver/display
initialization during the recent merge window.

First the place we call drm_fbdev_generic_setup() in the
wrong place: this needs to be called AFTER calling
drm_dev_register() else we get this splat:

 ------------[ cut here ]------------
WARNING: CPU: 0 PID: 1 at ../drivers/gpu/drm/drm_fb_helper.c:2198 drm_fbdev_generic_setup+0x164/0x1a8
mcde a0350000.mcde: Device has not been registered.
Modules linked in:
Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
[<c010e704>] (unwind_backtrace) from [<c010a86c>] (show_stack+0x10/0x14)
[<c010a86c>] (show_stack) from [<c0414f38>] (dump_stack+0x9c/0xb0)
[<c0414f38>] (dump_stack) from [<c0121c8c>] (__warn+0xb8/0xd0)
[<c0121c8c>] (__warn) from [<c0121d18>] (warn_slowpath_fmt+0x74/0xb8)
[<c0121d18>] (warn_slowpath_fmt) from [<c04b154c>] (drm_fbdev_generic_setup+0x164/0x1a8)
[<c04b154c>] (drm_fbdev_generic_setup) from [<c04ed278>] (mcde_drm_bind+0xc4/0x160)
[<c04ed278>] (mcde_drm_bind) from [<c04f06b8>] (try_to_bring_up_master+0x15c/0x1a4)
(...)

Signed-off-by: Linus Walleij <[email protected]>
Reviewed-by: Sam Ravnborg <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Thierry Reding
408ddca5c7 gpu: host1x: Detach driver on unregister
[ Upstream commit d9a0a05bf8c76e6dc79230669a8b5d685b168c30 ]

Currently when a host1x device driver is unregistered, it is not
detached from the host1x controller, which means that the device
will stay around and when the driver is registered again, it may
bind to the old, stale device rather than the new one that was
created from scratch upon driver registration. This in turn can
cause various weird crashes within the driver core because it is
confronted with a device that was already deleted.

Fix this by detaching the driver from the host1x controller when
it is unregistered. This ensures that the deleted device also is
no longer present in the device list that drivers will bind to.

Reported-by: Sowjanya Komatineni <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Tested-by: Sowjanya Komatineni <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Nicolin Chen
d78a975525 drm/tegra: hub: Do not enable orphaned window group
[ Upstream commit ef4e417eb3ec7fe657928f10ac1d2154d8a5fb38 ]

Though the unconditional enable/disable code is not a final solution,
we don't want to run into a NULL pointer situation when window group
doesn't link to its DC parent if the DC is disabled in Device Tree.

So this patch simply adds a check to make sure that window group has
a valid parent before running into tegra_windowgroup_enable/disable.

Signed-off-by: Nicolin Chen <[email protected]>
Signed-off-by: Thierry Reding <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Xiyu Yang
dbe5fef1c2 drm/ttm: Fix dma_fence refcnt leak when adding move fence
[ Upstream commit 11425c4519e2c974a100fc984867046d905b9380 ]

ttm_bo_add_move_fence() invokes dma_fence_get(), which returns a
reference of the specified dma_fence object to "fence" with increased
refcnt.

When ttm_bo_add_move_fence() returns, local variable "fence" becomes
invalid, so the refcount should be decreased to keep refcount balanced.

The reference counting issue happens in one exception handling path of
ttm_bo_add_move_fence(). When no_wait_gpu flag is equals to true, the
function forgets to decrease the refcnt increased by dma_fence_get(),
causing a refcnt leak.

Fix this issue by calling dma_fence_put() when no_wait_gpu flag is
equals to true.

Signed-off-by: Xiyu Yang <[email protected]>
Signed-off-by: Xin Tan <[email protected]>
Reviewed-by: Christian König <[email protected]>
Link: https://patchwork.freedesktop.org/patch/370221/
Signed-off-by: Christian König <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:33 +02:00
Tony Lindgren
6bfa3b616c ARM: dts: omap4-droid4: Fix spi configuration and increase rate
[ Upstream commit 0df12a01f4857495816b05f048c4c31439446e35 ]

We can currently sometimes get "RXS timed out" errors and "EOT timed out"
errors with spi transfers.

These errors can be made easy to reproduce by reading the cpcap iio
values in a loop while keeping the CPUs busy by also reading /dev/urandom.

The "RXS timed out" errors we can fix by adding spi-cpol and spi-cpha
in addition to the spi-cs-high property we already have.

The "EOT timed out" errors we can fix by increasing the spi clock rate
to 9.6 MHz. Looks similar MC13783 PMIC says it works at spi clock rates
up to 20 MHz, so let's assume we can pick any rate up to 20 MHz also
for cpcap.

Cc: [email protected]
Cc: Merlijn Wajer <[email protected]>
Cc: Pavel Machek <[email protected]>
Cc: Sebastian Reichel <[email protected]>
Signed-off-by: Tony Lindgren <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Stephane Eranian
3965fe7c0a perf/x86/rapl: Fix RAPL config variable bug
[ Upstream commit 16accae3d97f97d7f61c4ee5d0002bccdef59088 ]

This patch fixes a bug introduced by:

  fd3ae1e1587d6 ("perf/x86/rapl: Move RAPL support to common x86 code")

The Kconfig variable name was wrong. It was missing the CONFIG_ prefix.

Signed-off-by: Stephane Eranian <eraniangoogle.com>
Signed-off-by: Ingo Molnar <[email protected]>
Tested-by: Kim Phillips <[email protected]>
Acked-by: Peter Zijlstra <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Stephane Eranian
5f121ba6b6 perf/x86/rapl: Move RAPL support to common x86 code
[ Upstream commit fd3ae1e1587d64ef8cc8e361903d33625458073e ]

To prepare for support of both Intel and AMD RAPL.

As per the AMD PPR, Fam17h support Package RAPL counters to monitor power usage.
The RAPL counter operates as with Intel RAPL, and as such it is beneficial
to share the code.

No change in functionality.

Signed-off-by: Stephane Eranian <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Jens Thoms Toerring
14e8708fff regmap: fix alignment issue
[ Upstream commit 53d860952c8215cf9ae1ea33409c8cb71ad6ad3d ]

The assembly and disassembly of data to be sent to or received from
a device invoke functions regmap_format_XX() and regmap_parse_XX()
that extract or insert data items from or into a buffer, using
assignments. In some cases the functions are called with a buffer
pointer with an odd address. On architectures with strict alignment
requirements this can result in a kernel crash. The assignments
have been replaced by functions that take alignment into account.

Signed-off-by: Jens Thoms Toerring <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Krzysztof Kozlowski
2ec3c8329a spi: spi-fsl-dspi: Fix lockup if device is removed during SPI transfer
[ Upstream commit 7684580d45bd3d84ed9b453a4cadf7a9a5605a3f ]

During device removal, the driver should unregister the SPI controller
and stop the hardware.  Otherwise the dspi_transfer_one_message() could
wait on completion infinitely.

Additionally, calling spi_unregister_controller() first in device
removal reverse-matches the probe function, where SPI controller is
registered at the end.

Fixes: 05209f4570 ("spi: fsl-dspi: add missing clk_disable_unprepare() in dspi_remove()")
Reported-by: Vladimir Oltean <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
Cc: <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Peng Ma
6b64220baf spi: spi-fsl-dspi: Adding shutdown hook
[ Upstream commit dc234825997ec6ff05980ca9e2204f4ac3f8d695 ]

We need to ensure dspi controller could be stopped in order for kexec
to start the next kernel.
So add the shutdown operation support.

Signed-off-by: Peng Ma <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Christian Borntraeger
eb676bef02 KVM: s390: reduce number of IO pins to 1
[ Upstream commit 774911290c589e98e3638e73b24b0a4d4530e97c ]

The current number of KVM_IRQCHIP_NUM_PINS results in an order 3
allocation (32kb) for each guest start/restart. This can result in OOM
killer activity even with free swap when the memory is fragmented
enough:

kernel: qemu-system-s39 invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0
kernel: CPU: 1 PID: 357274 Comm: qemu-system-s39 Kdump: loaded Not tainted 5.4.0-29-generic #33-Ubuntu
kernel: Hardware name: IBM 8562 T02 Z06 (LPAR)
kernel: Call Trace:
kernel: ([<00000001f848fe2a>] show_stack+0x7a/0xc0)
kernel:  [<00000001f8d3437a>] dump_stack+0x8a/0xc0
kernel:  [<00000001f8687032>] dump_header+0x62/0x258
kernel:  [<00000001f8686122>] oom_kill_process+0x172/0x180
kernel:  [<00000001f8686abe>] out_of_memory+0xee/0x580
kernel:  [<00000001f86e66b8>] __alloc_pages_slowpath+0xd18/0xe90
kernel:  [<00000001f86e6ad4>] __alloc_pages_nodemask+0x2a4/0x320
kernel:  [<00000001f86b1ab4>] kmalloc_order+0x34/0xb0
kernel:  [<00000001f86b1b62>] kmalloc_order_trace+0x32/0xe0
kernel:  [<00000001f84bb806>] kvm_set_irq_routing+0xa6/0x2e0
kernel:  [<00000001f84c99a4>] kvm_arch_vm_ioctl+0x544/0x9e0
kernel:  [<00000001f84b8936>] kvm_vm_ioctl+0x396/0x760
kernel:  [<00000001f875df66>] do_vfs_ioctl+0x376/0x690
kernel:  [<00000001f875e304>] ksys_ioctl+0x84/0xb0
kernel:  [<00000001f875e39a>] __s390x_sys_ioctl+0x2a/0x40
kernel:  [<00000001f8d55424>] system_call+0xd8/0x2c8

As far as I can tell s390x does not use the iopins as we bail our for
anything other than KVM_IRQ_ROUTING_S390_ADAPTER and the chip/pin is
only used for KVM_IRQ_ROUTING_IRQCHIP. So let us use a small number to
reduce the memory footprint.

Signed-off-by: Christian Borntraeger <[email protected]>
Reviewed-by: Cornelia Huck <[email protected]>
Reviewed-by: David Hildenbrand <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Sasha Levin <[email protected]>
2020-07-16 08:16:32 +02:00
Liangcai Fan
a09184d0f3 ANDROID: ABI: add already existing symbols of ufs_* to unisoc
Bug: 160255258
Change-Id: I040c03b07c6bca793458509b9082c22e76b5510e
Signed-off-by: Liangcai Fan <[email protected]>
2020-07-16 09:29:51 +08:00
Liangcai Fan
40fcc4a406 ANDROID: ABI: add nf_* symbols to unisoc
Update the unisoc for ABI and updates the ABI representation accordingly.

Leaf changes summary: 6 artifacts changed
Changed leaf types summary: 0 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 0 Changed, 6 Added functions
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

6 Added functions:

  [A] 'function nf_conntrack_tuple_hash* nf_conntrack_find_get(net*, const nf_conntrack_zone*, const nf_conntrack_tuple*)'
  [A] 'function bool nf_ct_get_tuplepr(const sk_buff*, unsigned int, unsigned short int, net*, nf_conntrack_tuple*)'
  [A] 'function bool nf_ct_invert_tuple(nf_conntrack_tuple*, const nf_conntrack_tuple*)'
  [A] 'function const nf_conntrack_l4proto* nf_ct_l4proto_find(unsigned char)'
  [A] 'function int nf_register_net_hooks(net*, const nf_hook_ops*, unsigned int)'
  [A] 'function void nf_unregister_net_hooks(net*, const nf_hook_ops*, unsigned int)'

Bug: 158423839
Change-Id: I5131dc370dd5da4286d931ddd02d94652bb6754d
Signed-off-by: Liangcai Fan <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-15 15:14:44 +02:00
Greg Kroah-Hartman
491a9b1306 ANDROID: GKI: update abi xml file
Lots of symbols have now been removed from our tracking, so update the
.xml file to notice this so that if we need to track them in the future,
we will see it.

This is primarily due to the building in more Bluetooth protocols.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: Ic3a12af18fb8583e6d7bf21b28758d0d6e194f98
2020-07-15 14:55:39 +02:00
Greg Kroah-Hartman
44f1c9eb75 ANDROID: GKI: build in more Bluetooth drivers
Multiple platforms need these, so build them in so we don't need to
support an api we don't really need to.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: Icc99311bd349e226cf61deba98414d5e48750c54
2020-07-15 12:05:12 +02:00
Greg Kroah-Hartman
39ca1eadb7 ANDROID: GKI: update abi xml file
Lots of symbols have now been removed from our tracking, so update the
.xml file to notice this so that if we need to track them in the future,
we will see it.

This is primarily due to the building in of one Bluetooth protocol
driver, which was pulling in a lot of things.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I1681acd4840dccc3c5f04a0356819b1ab3aae3ad
2020-07-15 10:19:31 +02:00
Greg Kroah-Hartman
649f7740b6 ANDROID: GKI: Enable CONFIG_BT_HIDP as it is needed by some platforms
Might as well build it in so we don't have to worry about ABI issues
over time.

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I285bf3e3bf4bb9c649c3ac667834c6d12c7e1f4a
2020-07-15 09:43:20 +02:00
Greg Kroah-Hartman
f8b7edc4ec ANDROID: GKI: add CONFIG_BT to x86 gki_defconfig
It was enabled for arm64, but for some reason disabled for x86, which
led to lots of confusion when trying to do some build testing...

Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: Ic8e295c4d1f1cb368d386f2ba5ee1a5edbb83a96
2020-07-15 09:38:58 +02:00
Suren Baghdasaryan
ff8a1bae44 ANDROID: GKI: update abi definitions
ABI changes as a result of SPF padding additions for GKI 1.0.

Leaf changes summary: 3072 artifacts changed (34 filtered out)
Changed leaf types summary: 3 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 3026 Changed (34 filtered out), 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 43 Changed, 0 Added variable

3026 functions with some sub-type change:
...

'struct mm_struct at mm_types.h:383:1' changed:
  type size changed from 7040 to 7104 (in bits)
  there are data member changes:
...
  2847 impacted interfaces

'struct vm_area_struct at mm_types.h:293:1' changed:
  type size changed from 1728 to 1792 (in bits)
  1 data member insertion:
    'u64 vm_area_struct::android_vendor_data1', at offset 1728 (in bits) at mm_types.h:370:1
  2847 impacted interfaces

'struct vm_fault at mm.h:418:1' changed:
  type size changed from 960 to 1088 (in bits)
  2 data member insertions:
    'u64 vm_fault::android_vendor_data1', at offset 960 (in bits) at mm.h:457:1
    'u64 vm_fault::android_vendor_data2', at offset 1024 (in bits) at mm.h:458:1
  2847 impacted interfaces

Bug: 155842923
Signed-off-by: Suren Baghdasaryan <[email protected]>
Change-Id: Ieb63c9897da176c75215c60dcbe72d2022203caa
2020-07-14 20:36:08 +00:00
Hyesoo Yu
9411d27783 ANDROID: mm: add vendor padding for SPECULATIVE_PAGE_FAULTS
Fields are added on mm_struct, vm_area_struct and vm_fault
to support vendor feature, speculative page fault.

Bug: 155842923
Change-Id: Iedda086d6f83f1353da5a2ed1e24f7ba7dde43f2
Merged-In: Iedda086d6f83f1353da5a2ed1e24f7ba7dde43f2
Signed-off-by: Hyesoo Yu <[email protected]>
2020-07-14 20:36:00 +00:00
Greg Kroah-Hartman
7121ba12e2 ANDROID: GKI: enable usb storage drivers
This enables both CONFIG_USB_STORAGE=y and CONFIG_USB_UAS=y so that
systems that want to support usb storage devices will work with the GKI
base kernel image.

Bug: 161091250
Bug: 161190032
Cc: zhang sanshan <[email protected]>
Cc: JaeHun Jung <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: Ibda9ad03aea3f192c057fd3e479742d52d060f7b
2020-07-14 19:01:23 +02:00
Satya Tangirala
6561560c01 ANDROID: fscrypt: fix DUN contiguity with inline encryption + IV_INO_LBLK_32 policies
IV_INO_LBLK_32 policies introduced the possibility that logically
contiguous data blocks might not have contiguous DUNs (because of
potential DUN wraparound). As such, whenever a page is merged into a
bio, fscrypt_mergeable_bio() must be called to check DUN contiguity.

Further, fscrypt inline encryption does not handle the case when the DUN
wraps around within a page (which can happen when the data unit size !=
PAGE_SIZE). For now, we handle that by disallowing inline encryption
with IV_INO_LBLK_32 policies when the data unit size != PAGE_SIZE (and
dropping the now redundant check for this in fscrypt_dio_supported()).

Bug: 144046242
Change-Id: I9cb414fcc284b197b9d3d1b9643029c6b875df5a
Signed-off-by: Satya Tangirala <[email protected]>
2020-07-14 15:48:10 +00:00
Todd Kjos
cfed4cb19a ANDROID: GKI: set CONFIG_STATIC_USERMODEHELPER_PATH
The android.security.cts.KernelConfigTest#testConfigDisableUsermodehelper
test is failing because CONFIG_STATIC_USERMODEHELPER_PATH is set to
an invalid value ("/sbin/usermode-helper") for the test. Setting to ""
instead.

Bug: 160949257
Signed-off-by: Todd Kjos <[email protected]>
Change-Id: I1d9f003c15a6b1d9a7f47804e50661a44a0725d5
2020-07-13 18:33:24 +00:00
JaeHun Jung
e265d59708 ANDROID: sound: usb: Add vendor's hooking interface
In mobile, a co-processor can be used with USB audio to improve power
consumption.  To support this type of hardware, hooks need to be added
to the USB audio subsystem to be able to call into the hardware when
needed.

The main operation of the call-backs are:
  - Initialize the co-processor by transmitting data when initializing.
  - Change the co-processor setting value through the interface
    function.
  - Configure sampling rate
  - pcm open/close
  - other housekeeping

Known issues:
  - This only supports one set of callback hooks, meaning that this only
    works if there is one type of USB controller in the system.  This
    should be changed to be a per-host-controller interface instead of
    one global set of callbacks.

Bug: 156315379
Change-Id: I32e1dd408e64aaef68ee06c480c4b4d4c95546dc
Signed-off-by: JaeHun Jung <[email protected]>
[rework api to be a bit more self-contained and obvious - gregkh]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-07-13 17:24:54 +02:00
Saravana Kannan
bb0ed73573 UPSTREAM: slimbus: core: Set fwnode for a device when setting of_node
When setting the of_node for a newly created device, also set the
fwnode. This allows fw_devlink feature to work for slimbus devices.

Also, remove some unnecessary NULL checks. The functions in question
already do NULL checks.

Signed-off-by: Saravana Kannan <[email protected]>
[Srini: removed unnecessary NULL check from other patch]
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
(cherry picked from commit dbf4d13382be7b272417025f5f6687641eb7dd21)
Bug: 152464107
Signed-off-by: Saravana Kannan <[email protected]>
Change-Id: I09bb28a12a020615bd79f8d4c989862c1429513a
2020-07-10 23:29:03 +00:00
Eric Biggers
9950b5db5b ANDROID: f2fs: add back compress inode check
f2fs_force_buffered_io() originally had two checks of
f2fs_compressed_file(), when only one was needed.  The one via
f2fs_post_read_required() got removed by ANDROID commit 403731b15a
("ANDROID: ext4, f2fs: enable direct I/O with inline encryption").  Then
more recently, the second was removed by upstream commit 39430f72f0
("f2fs: remove redundant compress inode check"), but this wasn't fixed
up during the merge resolution.

This incorrectly left no checks remaining, so add one back.

Reported at
https://lkml.kernel.org/r/[email protected]

Fixes: 5ad12102f2 ("Merge remote-tracking branch 'aosp/upstream-f2fs-stable-linux-5.4.y' into android-5.4-stable")
Change-Id: I3f6afdd221b6e44f1caa5a92d3c751a573e284df
Signed-off-by: Eric Biggers <[email protected]>
2020-07-10 14:02:20 -07:00
Sandeep Patil
1e2677dc69 ANDROID: abi: update abi dump for CONFIG_KPROBES
Short summary
  Leaf changes summary: 2251 artifacts changed (24 filtered out)
  Changed leaf types summary: 1 leaf type changed
  Removed/Changed/Added functions summary: 0 Removed, 2215 Changed (24 filtered out), 0 Added function
  Removed/Changed/Added variables summary: 0 Removed, 35 Changed, 0 Added variable

  2215 functions with some sub-type change:
  ...
  'struct module at module.h:349:1' changed:
    type size hasn't changed
    2 data member insertions:
      'error_injection_entry* module::ei_funcs', at offset 6720 (in bits) at module.h:515:1
      'unsigned int module::num_ei_funcs', at offset 6784 (in bits) at module.h:516:1
    there are data member changes:
      'u64 module::android_kabi_reserved1' offset changed from 6720 to 6848 (in bits) (by +128 bits)
      'u64 module::android_kabi_reserved2' offset changed from 6784 to 6912 (in bits) (by +128 bits)
      'u64 module::android_kabi_reserved3' offset changed from 6848 to 6976 (in bits) (by +128 bits)
      'u64 module::android_kabi_reserved4' offset changed from 6912 to 7040 (in bits) (by +128 bits)
    2844 impacted interfaces

Bug: 149659981
Signed-off-by: Sandeep Patil <[email protected]>
Change-Id: I54a678ff969f0e37f63d6bc7da40683c39a1326e
2020-07-10 08:37:22 +00:00
Sandeep Patil
7eeea07674 ANDROID: gki_defconfig: Enable Kprobes
This commit effectively reverts commmit
   2f7f6ce2cf ("ANDROID: gki_defconfig: disable KPROBES, update ABI")

The change at https://android-review.googlesource.com/1328978 restricts
access to kprobes enough to mitigate potential issues with it.

Bug: 149659981

Signed-off-by: Sandeep Patil <[email protected]>
Change-Id: I3772b7683e7844017bff4b388e74d52698f896f9
2020-07-09 17:46:09 -07:00
Matthias Maennich
f631956032 ANDROID: Correct branch name after rename
Bug: 160880893
Bug: 158856685
Signed-off-by: Matthias Maennich <[email protected]>
Change-Id: If302b007ff595ad8b5d42450138da78cc9409b6f
2020-07-09 23:55:25 +02:00
Greg Kroah-Hartman
e2b40b8f2b ANDROID: GKI: update ABI due to power supply changes
Leaf changes summary: 20 artifacts changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 19 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable

19 functions with some sub-type change:

  [C] 'function power_supply* devm_power_supply_get_by_phandle(device*, const char*)' at power_supply_core.c:541:1 has some sub-type changes:
  [C] 'function power_supply* devm_power_supply_register(device*, const power_supply_desc*, const power_supply_config*)' at power_supply.h:433:1 has some sub-type changes:
  [C] 'function int hid_add_device(hid_device*)' at hid.h:848:1 has some sub-type changes:
  [C] 'function hid_device* hid_allocate_device()' at hid.h:888:1 has some sub-type changes:
  [C] 'function void hid_destroy_device(hid_device*)' at hid.h:849:1 has some sub-type changes:
  [C] 'function bool hid_ignore(hid_device*)' at hid.h:847:1 has some sub-type changes:
  [C] 'function int hid_input_report(hid_device*, int, unsigned char*, unsigned int, int)' at hid.h:880:1 has some sub-type changes:
  [C] 'function int hid_parse_report(hid_device*, unsigned char*, unsigned int)' at hid.h:892:1 has some sub-type changes:
  [C] 'function void power_supply_changed(power_supply*)' at power_supply.h:402:1 has some sub-type changes:
  [C] 'function int power_supply_get_battery_info(power_supply*, power_supply_battery_info*)' at power_supply_core.c:565:1 has some sub-type changes:
  [C] 'function power_supply* power_supply_get_by_name(const char*)' at power_supply_core.c:451:1 has some sub-type changes:
  [C] 'function void* power_supply_get_drvdata(power_supply*)' at power_supply.h:445:1 has some sub-type changes:
  [C] 'function int power_supply_get_property(power_supply*, power_supply_property, power_supply_propval*)' at power_supply_core.c:837:1 has some sub-type changes:
  [C] 'function int power_supply_powers(power_supply*, device*)' at power_supply.h:441:1 has some sub-type changes:
  [C] 'function void power_supply_put(power_supply*)' at power_supply_core.c:473:1 has some sub-type changes:
  [C] 'function void power_supply_put_battery_info(power_supply*, power_supply_battery_info*)' at power_supply_core.c:708:1 has some sub-type changes:
  [C] 'function power_supply* power_supply_register(device*, const power_supply_desc*, const power_supply_config*)' at power_supply.h:425:1 has some sub-type changes:
  [C] 'function int power_supply_set_property(power_supply*, power_supply_property, const power_supply_propval*)' at power_supply_core.c:851:1 has some sub-type changes:
  [C] 'function void power_supply_unregister(power_supply*)' at power_supply.h:440:1 has some sub-type changes:

'enum power_supply_property at power_supply.h:94:1' changed:
  type size hasn't changed
  4 enumerator insertions:
    'power_supply_property::POWER_SUPPLY_PROP_CAPACITY_ERROR_MARGIN' value '49'
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURE_YEAR' value '69'
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURE_MONTH' value '70'
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURE_DAY' value '71'
  22 enumerator changes:
    'power_supply_property::POWER_SUPPLY_PROP_CAPACITY_LEVEL' from value '49' to '50' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP' from value '50' to '51' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_MAX' from value '51' to '52' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_MIN' from value '52' to '53' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_ALERT_MIN' from value '53' to '54' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_ALERT_MAX' from value '54' to '55' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_AMBIENT' from value '55' to '56' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MIN' from value '56' to '57' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TEMP_AMBIENT_ALERT_MAX' from value '57' to '58' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW' from value '58' to '59' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG' from value '59' to '60' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TIME_TO_FULL_NOW' from value '60' to '61' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TIME_TO_FULL_AVG' from value '61' to '62' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_TYPE' from value '62' to '63' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_USB_TYPE' from value '63' to '64' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_SCOPE' from value '64' to '65' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_PRECHARGE_CURRENT' from value '65' to '66' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_CHARGE_TERM_CURRENT' from value '66' to '67' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_CALIBRATE' from value '67' to '68' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_MODEL_NAME' from value '68' to '72' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_MANUFACTURER' from value '69' to '73' at power_supply.h:95:1
    'power_supply_property::POWER_SUPPLY_PROP_SERIAL_NUMBER' from value '70' to '74' at power_supply.h:95:1
  19 impacted interfaces

Bug: 160867814
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Change-Id: I140f91dd18eabca8c8cd69dbe2ba1da06970666e
2020-07-09 17:27:13 +02:00