The nvhe hyp saves the SPE context, flushing any unwritten
data before we switch to the guest. But this operation is
performed way too late, because :
- The ownership of the SPE is transferred to EL2. i.e,
using EL2 translations. (MDCR_EL2_E2PB == 0)
- The guest Stage1 is loaded.
Thus the flush could use the host EL1 virtual address,
but use the EL2 translations instead. Fix this by
moving the SPE context save early.
i.e, Save the context before we load the guest stage1
and before we change the ownership to EL2.
The restore path is doing the right thing.
Fixes: 014c4c77aad7 ("KVM: arm64: Improve debug register save/restore flow")
Cc: stable(a)vger.kernel.org
Cc: Christoffer Dall <christoffer.dall(a)arm.com>
Cc: Marc Zyngier <maz(a)kernel.org>
Cc: Will Deacon <will(a)kernel.org>
Cc: Catalin Marinas <catalin.marinas(a)arm.com>
Cc: Mark Rutland <mark.rutland(a)arm.com>
Cc: Alexandru Elisei <alexandru.elisei(a)arm.com>
Signed-off-by: Suzuki K Poulose <suzuki.poulose(a)arm.com>
---
New patch.
---
arch/arm64/include/asm/kvm_hyp.h | 5 +++++
arch/arm64/kvm/hyp/nvhe/debug-sr.c | 12 ++++++++++--
arch/arm64/kvm/hyp/nvhe/switch.c | 12 +++++++++++-
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h
index c0450828378b..385bd7dd3d39 100644
--- a/arch/arm64/include/asm/kvm_hyp.h
+++ b/arch/arm64/include/asm/kvm_hyp.h
@@ -83,6 +83,11 @@ void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt);
void __debug_switch_to_guest(struct kvm_vcpu *vcpu);
void __debug_switch_to_host(struct kvm_vcpu *vcpu);
+#ifdef __KVM_NVHE_HYPERVISOR__
+void __debug_save_host_buffers_nvhe(struct kvm_vcpu *vcpu);
+void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu);
+#endif
+
void __fpsimd_save_state(struct user_fpsimd_state *fp_regs);
void __fpsimd_restore_state(struct user_fpsimd_state *fp_regs);
diff --git a/arch/arm64/kvm/hyp/nvhe/debug-sr.c b/arch/arm64/kvm/hyp/nvhe/debug-sr.c
index 91a711aa8382..f401724f12ef 100644
--- a/arch/arm64/kvm/hyp/nvhe/debug-sr.c
+++ b/arch/arm64/kvm/hyp/nvhe/debug-sr.c
@@ -58,16 +58,24 @@ static void __debug_restore_spe(u64 pmscr_el1)
write_sysreg_s(pmscr_el1, SYS_PMSCR_EL1);
}
-void __debug_switch_to_guest(struct kvm_vcpu *vcpu)
+void __debug_save_host_buffers_nvhe(struct kvm_vcpu *vcpu)
{
/* Disable and flush SPE data generation */
__debug_save_spe(&vcpu->arch.host_debug_state.pmscr_el1);
+}
+
+void __debug_switch_to_guest(struct kvm_vcpu *vcpu)
+{
__debug_switch_to_guest_common(vcpu);
}
-void __debug_switch_to_host(struct kvm_vcpu *vcpu)
+void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu)
{
__debug_restore_spe(vcpu->arch.host_debug_state.pmscr_el1);
+}
+
+void __debug_switch_to_host(struct kvm_vcpu *vcpu)
+{
__debug_switch_to_host_common(vcpu);
}
diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c
index f3d0e9eca56c..10eed66136a0 100644
--- a/arch/arm64/kvm/hyp/nvhe/switch.c
+++ b/arch/arm64/kvm/hyp/nvhe/switch.c
@@ -192,6 +192,15 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
pmu_switch_needed = __pmu_switch_to_guest(host_ctxt);
__sysreg_save_state_nvhe(host_ctxt);
+ /*
+ * For nVHE, we must save and disable any SPE
+ * buffers, as the translation regime is going
+ * to be loaded with that of the guest. And we must
+ * save host context for SPE, before we change the
+ * ownership to EL2 (via MDCR_EL2_E2PB == 0) and before
+ * we load guest Stage1.
+ */
+ __debug_save_host_buffers_nvhe(vcpu);
__adjust_pc(vcpu);
@@ -234,11 +243,12 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu)
if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED)
__fpsimd_save_fpexc32(vcpu);
+ __debug_switch_to_host(vcpu);
/*
* This must come after restoring the host sysregs, since a non-VHE
* system may enable SPE here and make use of the TTBRs.
*/
- __debug_switch_to_host(vcpu);
+ __debug_restore_host_buffers_nvhe(vcpu);
if (pmu_switch_needed)
__pmu_switch_to_host(host_ctxt);
--
2.24.1
USB devices cannot perform DMA and hence have no dma_mask set in their
device structure. Therefore importing dmabuf into a USB-based driver
fails, which breaks joining and mirroring of display in X11.
For USB devices, pick the associated USB controller as attachment device.
This allows the DRM import helpers to perform the DMA setup. If the DMA
controller does not support DMA transfers, we're out of luck and cannot
import. Our current USB-based DRM drivers don't use DMA, so the actual
DMA device is not important.
Drivers should use DRM_GEM_SHMEM_DROVER_OPS_USB to initialize their
instance of struct drm_driver.
Tested by joining/mirroring displays of udl and radeon un der Gnome/X11.
v6:
* implement workaround in DRM drivers and hold reference to
DMA device while USB device is in use
* remove dev_is_usb() (Greg)
* collapse USB helper into usb_intf_get_dma_device() (Alan)
* integrate Daniel's TODO statement (Daniel)
* fix typos (Greg)
v5:
* provide a helper for USB interfaces (Alan)
* add FIXME item to documentation and TODO list (Daniel)
v4:
* implement workaround with USB helper functions (Greg)
* use struct usb_device->bus->sysdev as DMA device (Takashi)
v3:
* drop gem_create_object
* use DMA mask of USB controller, if any (Daniel, Christian, Noralf)
v2:
* move fix to importer side (Christian, Daniel)
* update SHMEM and CMA helpers for new PRIME callbacks
Signed-off-by: Thomas Zimmermann <tzimmermann(a)suse.de>
Fixes: 6eb0233ec2d0 ("usb: don't inherity DMA properties for USB devices")
Tested-by: Pavel Machek <pavel(a)ucw.cz>
Acked-by: Christian König <christian.koenig(a)amd.com>
Acked-by: Daniel Vetter <daniel.vetter(a)ffwll.ch>
Cc: Christoph Hellwig <hch(a)lst.de>
Cc: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Cc: <stable(a)vger.kernel.org> # v5.10+
Signed-off-by: Thomas Zimmermann <tzimmermann(a)suse.de>
---
Documentation/gpu/todo.rst | 21 +++++++++++++++++++++
drivers/gpu/drm/tiny/gm12u320.c | 25 +++++++++++++++++++++++++
drivers/gpu/drm/udl/udl_drv.c | 17 +++++++++++++++++
drivers/gpu/drm/udl/udl_drv.h | 1 +
drivers/gpu/drm/udl/udl_main.c | 9 +++++++++
drivers/usb/core/usb.c | 32 ++++++++++++++++++++++++++++++++
include/linux/usb.h | 2 ++
7 files changed, 107 insertions(+)
diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 0631b9b323d5..fdfd6a1081ec 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -571,6 +571,27 @@ Contact: Daniel Vetter
Level: Intermediate
+Remove automatic page mapping from dma-buf importing
+----------------------------------------------------
+
+When importing dma-bufs, the dma-buf and PRIME frameworks automatically map
+imported pages into the importer's DMA area. drm_gem_prime_fd_to_handle() and
+drm_gem_prime_handle_to_fd() require that importers call dma_buf_attach()
+even if they never do actual device DMA, but only CPU access through
+dma_buf_vmap(). This is a problem for USB devices, which do not support DMA
+operations.
+
+To fix the issue, automatic page mappings should be removed from the
+buffer-sharing code. Fixing this is a bit more involved, since the import/export
+cache is also tied to &drm_gem_object.import_attach. Meanwhile we paper over
+this problem for USB devices by fishing out the USB host controller device, as
+long as that supports DMA. Otherwise importing can still needlessly fail.
+
+Contact: Thomas Zimmermann <tzimmermann(a)suse.de>, Daniel Vetter
+
+Level: Advanced
+
+
Better Testing
==============
diff --git a/drivers/gpu/drm/tiny/gm12u320.c b/drivers/gpu/drm/tiny/gm12u320.c
index 0b4f4f2af1ef..48b5b06f70e8 100644
--- a/drivers/gpu/drm/tiny/gm12u320.c
+++ b/drivers/gpu/drm/tiny/gm12u320.c
@@ -84,6 +84,7 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)");
struct gm12u320_device {
struct drm_device dev;
+ struct device *dmadev;
struct drm_simple_display_pipe pipe;
struct drm_connector conn;
unsigned char *cmd_buf;
@@ -599,6 +600,22 @@ static const uint64_t gm12u320_pipe_modifiers[] = {
DRM_FORMAT_MOD_INVALID
};
+/*
+ * FIXME: Dma-buf sharing requires DMA support by the importing device.
+ * This function is a workaround to make USB devices work as well.
+ * See todo.rst for how to fix the issue in the dma-buf framework.
+ */
+static struct drm_gem_object *gm12u320_gem_prime_import(struct drm_device *dev,
+ struct dma_buf *dma_buf)
+{
+ struct gm12u320_device *gm12u320 = to_gm12u320(dev);
+
+ if (!gm12u320->dmadev)
+ return ERR_PTR(-ENODEV);
+
+ return drm_gem_prime_import_dev(dev, dma_buf, gm12u320->dmadev);
+}
+
DEFINE_DRM_GEM_FOPS(gm12u320_fops);
static const struct drm_driver gm12u320_drm_driver = {
@@ -612,6 +629,7 @@ static const struct drm_driver gm12u320_drm_driver = {
.fops = &gm12u320_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
+ .gem_prime_import = gm12u320_gem_prime_import,
};
static const struct drm_mode_config_funcs gm12u320_mode_config_funcs = {
@@ -639,6 +657,10 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
if (IS_ERR(gm12u320))
return PTR_ERR(gm12u320);
+ gm12u320->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev));
+ if (!gm12u320->dmadev)
+ drm_warn(dev, "buffer sharing not supported"); /* not an error */
+
INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work);
mutex_init(&gm12u320->fb_update.lock);
@@ -691,7 +713,10 @@ static int gm12u320_usb_probe(struct usb_interface *interface,
static void gm12u320_usb_disconnect(struct usb_interface *interface)
{
struct drm_device *dev = usb_get_intfdata(interface);
+ struct gm12u320_device *gm12u320 = to_gm12u320(dev);
+ put_device(gm12u320->dmadev);
+ gm12u320->dmadev = NULL;
drm_dev_unplug(dev);
drm_atomic_helper_shutdown(dev);
}
diff --git a/drivers/gpu/drm/udl/udl_drv.c b/drivers/gpu/drm/udl/udl_drv.c
index 9269092697d8..5703277c6f52 100644
--- a/drivers/gpu/drm/udl/udl_drv.c
+++ b/drivers/gpu/drm/udl/udl_drv.c
@@ -32,6 +32,22 @@ static int udl_usb_resume(struct usb_interface *interface)
return drm_mode_config_helper_resume(dev);
}
+/*
+ * FIXME: Dma-buf sharing requires DMA support by the importing device.
+ * This function is a workaround to make USB devices work as well.
+ * See todo.rst for how to fix the issue in the dma-buf framework.
+ */
+static struct drm_gem_object *udl_driver_gem_prime_import(struct drm_device *dev,
+ struct dma_buf *dma_buf)
+{
+ struct udl_device *udl = to_udl(dev);
+
+ if (!udl->dmadev)
+ return ERR_PTR(-ENODEV);
+
+ return drm_gem_prime_import_dev(dev, dma_buf, udl->dmadev);
+}
+
DEFINE_DRM_GEM_FOPS(udl_driver_fops);
static const struct drm_driver driver = {
@@ -40,6 +56,7 @@ static const struct drm_driver driver = {
/* GEM hooks */
.fops = &udl_driver_fops,
DRM_GEM_SHMEM_DRIVER_OPS,
+ .gem_prime_import = udl_driver_gem_prime_import,
.name = DRIVER_NAME,
.desc = DRIVER_DESC,
diff --git a/drivers/gpu/drm/udl/udl_drv.h b/drivers/gpu/drm/udl/udl_drv.h
index 875e73551ae9..cc16a13316e4 100644
--- a/drivers/gpu/drm/udl/udl_drv.h
+++ b/drivers/gpu/drm/udl/udl_drv.h
@@ -50,6 +50,7 @@ struct urb_list {
struct udl_device {
struct drm_device drm;
struct device *dev;
+ struct device *dmadev;
struct drm_simple_display_pipe display_pipe;
diff --git a/drivers/gpu/drm/udl/udl_main.c b/drivers/gpu/drm/udl/udl_main.c
index 0e2a376cb075..7c0338bcadea 100644
--- a/drivers/gpu/drm/udl/udl_main.c
+++ b/drivers/gpu/drm/udl/udl_main.c
@@ -315,6 +315,10 @@ int udl_init(struct udl_device *udl)
DRM_DEBUG("\n");
+ udl->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev));
+ if (!udl->dmadev)
+ drm_warn(dev, "buffer sharing not supported"); /* not an error */
+
mutex_init(&udl->gem_lock);
if (!udl_parse_vendor_descriptor(udl)) {
@@ -349,6 +353,11 @@ int udl_init(struct udl_device *udl)
int udl_drop_usb(struct drm_device *dev)
{
+ struct udl_device *udl = to_udl(dev);
+
udl_free_urb_list(dev);
+ put_device(udl->dmadev);
+ udl->dmadev = NULL;
+
return 0;
}
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
index 8f07b0516100..a566bb494e24 100644
--- a/drivers/usb/core/usb.c
+++ b/drivers/usb/core/usb.c
@@ -748,6 +748,38 @@ void usb_put_intf(struct usb_interface *intf)
}
EXPORT_SYMBOL_GPL(usb_put_intf);
+/**
+ * usb_intf_get_dma_device - acquire a reference on the usb interface's DMA endpoint
+ * @intf: the usb interface
+ *
+ * While a USB device cannot perform DMA operations by itself, many USB
+ * controllers can. A call to usb_intf_get_dma_device() returns the DMA endpoint
+ * for the given USB interface, if any. The returned device structure must be
+ * released with put_device().
+ *
+ * See also usb_get_dma_device().
+ *
+ * Returns: A reference to the usb interface's DMA endpoint; or NULL if none
+ * exists.
+ */
+struct device *usb_intf_get_dma_device(struct usb_interface *intf)
+{
+ struct usb_device *udev = interface_to_usbdev(intf);
+ struct device *dmadev;
+
+ if (!udev->bus)
+ return NULL;
+
+ dmadev = get_device(udev->bus->sysdev);
+ if (!dmadev || !dmadev->dma_mask) {
+ put_device(dmadev);
+ return NULL;
+ }
+
+ return dmadev;
+}
+EXPORT_SYMBOL_GPL(usb_intf_get_dma_device);
+
/* USB device locking
*
* USB devices and interfaces are locked using the semaphore in their
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 7d72c4e0713c..d6a41841b93e 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -746,6 +746,8 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
extern int usb_reset_device(struct usb_device *dev);
extern void usb_queue_reset_device(struct usb_interface *dev);
+extern struct device *usb_intf_get_dma_device(struct usb_interface *intf);
+
#ifdef CONFIG_ACPI
extern int usb_acpi_set_power_state(struct usb_device *hdev, int index,
bool enable);
--
2.30.1
This is the start of the stable review cycle for the 4.9.259 release.
There are 134 patches in this series, all will be posted as a response
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Wed, 03 Mar 2021 16:09:49 +0000.
Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v4.x/stable-review/patch-4.9.259-rc…
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.9.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
Linux 4.9.259-rc1
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Update in-core bitset after committing the metadata
Jason A. Donenfeld <Jason(a)zx2c4.com>
net: icmp: pass zeroed opts from icmp{,v6}_ndo_send before sending
Leon Romanovsky <leonro(a)nvidia.com>
ipv6: silence compilation warning for non-IPV6 builds
Eric Dumazet <edumazet(a)google.com>
ipv6: icmp6: avoid indirect call for icmpv6_send()
Jason A. Donenfeld <Jason(a)zx2c4.com>
sunvnet: use icmp_ndo_send helper
Jason A. Donenfeld <Jason(a)zx2c4.com>
gtp: use icmp_ndo_send helper
Jason A. Donenfeld <Jason(a)zx2c4.com>
icmp: introduce helper for nat'd source address in network device context
Thomas Gleixner <tglx(a)linutronix.de>
futex: fix dead code in attach_to_pi_owner()
Peter Zijlstra <peterz(a)infradead.org>
futex: Fix OWNER_DEAD fixup
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: only resize metadata in preresume
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Reinitialize bitset cache before digesting a new writeset
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Use correct value size in equality function of writeset tree
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Fix bitset memory leaks
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Verify the data block size hasn't changed
Nikos Tsironis <ntsironis(a)arrikto.com>
dm era: Recover committed writeset after crash
Bob Peterson <rpeterso(a)redhat.com>
gfs2: Don't skip dlm unlock if glock has an lvb
Al Viro <viro(a)zeniv.linux.org.uk>
sparc32: fix a user-triggerable oops in clear_user()
Chao Yu <yuchao0(a)huawei.com>
f2fs: fix out-of-repair __setattr_copy()
Maxim Kiselev <bigunclemax(a)gmail.com>
gpio: pcf857x: Fix missing first interrupt
Frank Li <Frank.Li(a)nxp.com>
mmc: sdhci-esdhc-imx: fix kernel panic when remove module
Fangrui Song <maskray(a)google.com>
module: Ignore _GLOBAL_OFFSET_TABLE_ when warning for undefined symbols
Dan Williams <dan.j.williams(a)intel.com>
libnvdimm/dimm: Avoid race between probe and available_slots_show()
Yoshihiro Shimoda <yoshihiro.shimoda.uh(a)renesas.com>
usb: renesas_usbhs: Clear pipe running flag in usbhs_pkt_pop()
Muchun Song <songmuchun(a)bytedance.com>
mm: hugetlb: fix a race between freeing and dissolving the page
Pan Bian <bianpan2016(a)163.com>
mtd: spi-nor: hisi-sfc: Put child node np on error path
Jiri Kosina <jkosina(a)suse.cz>
floppy: reintroduce O_NDELAY fix
Sean Christopherson <seanjc(a)google.com>
x86/reboot: Force all cpus to exit VMX root if VMX is supported
Martin Kaiser <martin(a)kaiser.cx>
staging: rtl8188eu: Add Edimax EW-7811UN V2 to device table
Sabyrzhan Tasbolatov <snovitoll(a)gmail.com>
drivers/misc/vmw_vmci: restrict too big queue size in qp_host_alloc_queue
Paul Cercueil <paul(a)crapouillou.net>
seccomp: Add missing return in non-void function
Filipe Manana <fdmanana(a)suse.com>
btrfs: fix extent buffer leak on failure to copy root
Josef Bacik <josef(a)toxicpanda.com>
btrfs: fix reloc root leak with 0 ref reloc roots on recovery
Josef Bacik <josef(a)toxicpanda.com>
btrfs: abort the transaction if we fail to inc ref in btrfs_copy_root
Jarkko Sakkinen <jarkko(a)kernel.org>
KEYS: trusted: Fix migratable=1 failing
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Fix dep->interval for fullspeed interrupt
Thinh Nguyen <Thinh.Nguyen(a)synopsys.com>
usb: dwc3: gadget: Fix setting of DEPCFG.bInterval_m1
Dan Carpenter <dan.carpenter(a)oracle.com>
USB: serial: mos7720: fix error code in mos7720_write()
Dan Carpenter <dan.carpenter(a)oracle.com>
USB: serial: mos7840: fix error code in mos7840_write()
Paul Cercueil <paul(a)crapouillou.net>
usb: musb: Fix runtime PM race in musb_queue_resume_work
Lech Perczak <lech.perczak(a)gmail.com>
USB: serial: option: update interface mapping for ZTE P685M
Marcos Paulo de Souza <mpdesouza(a)suse.com>
Input: i8042 - add ASUS Zenbook Flip to noselftest list
Dan Carpenter <dan.carpenter(a)oracle.com>
Input: joydev - prevent potential read overflow in ioctl
Olivier Crête <olivier.crete(a)ocrete.ca>
Input: xpad - add support for PowerA Enhanced Wired Controller for Xbox Series X|S
jeffrey.lin <jeffrey.lin(a)rad-ic.com>
Input: raydium_ts_i2c - do not send zero length
Qinglang Miao <miaoqinglang(a)huawei.com>
ACPI: configfs: add missing check after configfs_register_default_group()
Mikulas Patocka <mpatocka(a)redhat.com>
blk-settings: align max_sectors on "logical_block_size" boundary
Randy Dunlap <rdunlap(a)infradead.org>
scsi: bnx2fc: Fix Kconfig warning & CNIC build errors
Maxime Ripard <maxime(a)cerno.tech>
i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
Marc Zyngier <maz(a)kernel.org>
arm64: Add missing ISB after invalidating TLB in __primary_switch
Miaohe Lin <linmiaohe(a)huawei.com>
mm/hugetlb: fix potential double free in hugetlb_register_node() error path
Miaohe Lin <linmiaohe(a)huawei.com>
mm/memory.c: fix potential pte_unmap_unlock pte error
Dan Carpenter <dan.carpenter(a)oracle.com>
ocfs2: fix a use after free on error
Chuhong Yuan <hslester96(a)gmail.com>
net/mlx4_core: Add missed mlx4_free_cmd_mailbox()
Jann Horn <jannh(a)google.com>
Take mmap lock in cacheflush syscall
Slawomir Laba <slawomirx.laba(a)intel.com>
i40e: Fix flow for IPv6 next header (extension header)
Konrad Dybcio <konrad.dybcio(a)somainline.org>
drm/msm/dsi: Correct io_start for MSM8994 (20nm PHY)
Heiner Kallweit <hkallweit1(a)gmail.com>
PCI: Align checking of syscall user config accessors
Jorgen Hansen <jhansen(a)vmware.com>
VMCI: Use set_page_dirty_lock() when unregistering guest memory
Simon South <simon(a)simonsouth.net>
pwm: rockchip: rockchip_pwm_probe(): Remove superfluous clk_unprepare()
Aswath Govindraju <a-govindraju(a)ti.com>
misc: eeprom_93xx46: Add module alias to avoid breaking support for non device tree users
Aswath Govindraju <a-govindraju(a)ti.com>
misc: eeprom_93xx46: Fix module alias to enable module autoprobe
Randy Dunlap <rdunlap(a)infradead.org>
sparc64: only select COMPAT_BINFMT_ELF if BINFMT_ELF is set
Dan Carpenter <dan.carpenter(a)oracle.com>
Input: elo - fix an error code in elo_connect()
Namhyung Kim <namhyung(a)kernel.org>
perf test: Fix unaligned access in sample parsing test
Adrian Hunter <adrian.hunter(a)intel.com>
perf intel-pt: Fix missing CYC processing in PSB
Andy Shevchenko <andriy.shevchenko(a)linux.intel.com>
spi: pxa2xx: Fix the controller numbering for Wildcat Point
Nathan Lynch <nathanl(a)linux.ibm.com>
powerpc/pseries/dlpar: handle ibm, configure-connector delay status
Dan Carpenter <dan.carpenter(a)oracle.com>
mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()
Bob Pearson <rpearsonhpe(a)gmail.com>
RDMA/rxe: Fix coding error in rxe_recv.c
Arnaldo Carvalho de Melo <acme(a)redhat.com>
perf tools: Fix DSO filtering when not finding a map for a sampled address
Steven Rostedt (VMware) <rostedt(a)goodmis.org>
tracepoint: Do not fail unregistering a probe due to memory failure
Uwe Kleine-König <u.kleine-koenig(a)pengutronix.de>
amba: Fix resource leak for drivers without .remove
Vladimir Murzin <vladimir.murzin(a)arm.com>
ARM: 9046/1: decompressor: Do not clear SCTLR.nTLSMD for ARMv7+ cores
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
mmc: usdhi6rol0: Fix a resource leak in the error handling path of the probe
Christophe Leroy <christophe.leroy(a)csgroup.eu>
powerpc/47x: Disable 256k page size
Shay Drory <shayd(a)nvidia.com>
IB/umad: Return EIO in case of when device disassociated
Pan Bian <bianpan2016(a)163.com>
isofs: release buffer head before return
Pan Bian <bianpan2016(a)163.com>
regulator: axp20x: Fix reference cout leak
Tom Rix <trix(a)redhat.com>
clocksource/drivers/mxs_timer: Add missing semicolon when DEBUG is defined
Claudiu Beznea <claudiu.beznea(a)microchip.com>
power: reset: at91-sama5d2_shdwc: fix wkupdbc mask
Nicolas Boichat <drinkcat(a)chromium.org>
of/fdt: Make sure no-map does not remove already reserved regions
KarimAllah Ahmed <karahmed(a)amazon.de>
fdt: Properly handle "no-map" field in the memory region
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
dmaengine: fsldma: Fix a resource leak in an error handling path of the probe function
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
dmaengine: fsldma: Fix a resource leak in the remove function
Randy Dunlap <rdunlap(a)infradead.org>
HID: core: detect and skip invalid inputs to snto32()
Pratyush Yadav <p.yadav(a)ti.com>
spi: cadence-quadspi: Abort read if dummy cycles required are too many
Martin Blumenstingl <martin.blumenstingl(a)googlemail.com>
clk: meson: clk-pll: fix initializing the old rate (fallback) for a PLL
Tom Rix <trix(a)redhat.com>
jffs2: fix use after free in jffs2_sum_write_data()
Colin Ian King <colin.king(a)canonical.com>
fs/jfs: fix potential integer overflow on shift of a int
Daniele Alessandrelli <daniele.alessandrelli(a)intel.com>
crypto: ecdh_helper - Ensure 'len >= secret.len' in decode_key()
Zhihao Cheng <chengzhihao1(a)huawei.com>
btrfs: clarify error returns values in __load_free_space_cache
Florian Fainelli <f.fainelli(a)gmail.com>
ata: ahci_brcm: Add back regulators management
Laurent Pinchart <laurent.pinchart(a)ideasonboard.com>
media: uvcvideo: Accept invalid bFormatIndex and bFrameIndex values
Tom Rix <trix(a)redhat.com>
media: pxa_camera: declare variable when DEBUG is defined
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
media: cx25821: Fix a bug when reallocating some dma memory
Luo Meng <luomeng12(a)huawei.com>
media: qm1d1c0042: fix error return code in qm1d1c0042_init()
Joe Perches <joe(a)perches.com>
media: lmedm04: Fix misuse of comma
Dan Carpenter <dan.carpenter(a)oracle.com>
ASoC: cs42l56: fix up error handling in probe
Dinghao Liu <dinghao.liu(a)zju.edu.cn>
media: tm6000: Fix memleak in tm6000_start_stream
Dinghao Liu <dinghao.liu(a)zju.edu.cn>
media: media/pci: Fix memleak in empress_init
Christophe JAILLET <christophe.jaillet(a)wanadoo.fr>
media: vsp1: Fix an error handling path in the probe function
Nathan Chancellor <natechancellor(a)gmail.com>
MIPS: lantiq: Explicitly compare LTQ_EBU_PCC_ISTAT against 0
Nathan Chancellor <natechancellor(a)gmail.com>
MIPS: c-r4k: Fix section mismatch for loongson2_sc_init
Dan Carpenter <dan.carpenter(a)oracle.com>
gma500: clean up error handling in init
Jialin Zhang <zhangjialin11(a)huawei.com>
drm/gma500: Fix error return code in psb_driver_load()
Randy Dunlap <rdunlap(a)infradead.org>
fbdev: aty: SPARC64 requires FB_ATY_CT
Colin Ian King <colin.king(a)canonical.com>
b43: N-PHY: Fix the update of coef for the PHY revision >= 3case
Colin Ian King <colin.king(a)canonical.com>
mac80211: fix potential overflow when multiplying to u32 integers
Juergen Gross <jgross(a)suse.com>
xen/netback: fix spurious event detection for common event case
Edwin Peer <edwin.peer(a)broadcom.com>
bnxt_en: reverse order of TX disable and carrier off
Arnd Bergmann <arnd(a)arndb.de>
ARM: s3c: fix fiq for clang IAS
Vincent Knecht <vincent.knecht(a)mailoo.org>
arm64: dts: msm8916: Fix reserved and rfsa nodes unit address
Guenter Roeck <linux(a)roeck-us.net>
usb: dwc2: Make "trimming xfer length" a debug message
Guenter Roeck <linux(a)roeck-us.net>
usb: dwc2: Abort transaction after errors with unknown reason
Guenter Roeck <linux(a)roeck-us.net>
usb: dwc2: Do not update data length if it is 0 on inbound transfers
Tony Lindgren <tony(a)atomide.com>
ARM: dts: Configure missing thermal interrupt for 4430
Pan Bian <bianpan2016(a)163.com>
Bluetooth: Put HCI device if inquiry procedure interrupts
Pan Bian <bianpan2016(a)163.com>
Bluetooth: drop HCI device reference before return
Krzysztof Kozlowski <krzk(a)kernel.org>
arm64: dts: exynos: correct PMIC interrupt trigger level on Espresso
Krzysztof Kozlowski <krzk(a)kernel.org>
ARM: dts: exynos: correct PMIC interrupt trigger level on Arndale Octa
Krzysztof Kozlowski <krzk(a)kernel.org>
ARM: dts: exynos: correct PMIC interrupt trigger level on Spring
Christopher William Snowhill <chris(a)kode54.net>
Bluetooth: Fix initializing response id after clearing struct
Vlastimil Babka <vbabka(a)suse.cz>
mm, thp: make do_huge_pmd_wp_page() lock page for testing mapcount
Eric Biggers <ebiggers(a)google.com>
random: fix the RNDRESEEDCRNG ioctl
Alexander Lobakin <alobakin(a)pm.me>
MIPS: vmlinux.lds.S: add missing PAGE_ALIGNED_DATA() section
Sumit Garg <sumit.garg(a)linaro.org>
kdb: Make memory allocations more robust
Rong Chen <rong.a.chen(a)intel.com>
scripts/recordmcount.pl: support big endian for ARCH sh
Shyam Prasad N <sprasad(a)microsoft.com>
cifs: Set CIFS_MOUNT_USE_PREFIX_PATH flag on setting cifs_sb->prepath.
Christoph Schemmel <christoph.schemmel(a)gmail.com>
NET: usb: qmi_wwan: Adding support for Cinterion MV31
Sameer Pujar <spujar(a)nvidia.com>
arm64: tegra: Add power-domain for Tegra210 HDA
Corinna Vinschen <vinschen(a)redhat.com>
igb: Remove incorrect "unexpected SYS WRAP" log message
Rustam Kovhaev <rkovhaev(a)gmail.com>
ntfs: check for valid standard information attribute
Stefan Ursella <stefan.ursella(a)wolfvision.net>
usb: quirks: add quirk to start video capture on ELMO L-12F document camera reliable
Will McVicker <willmcvicker(a)google.com>
HID: make arrays usage and value to be the same
-------------
Diffstat:
Makefile | 4 +-
arch/arm/boot/compressed/head.S | 4 +-
arch/arm/boot/dts/exynos5250-spring.dts | 2 +-
arch/arm/boot/dts/exynos5420-arndale-octa.dts | 2 +-
arch/arm/boot/dts/omap443x.dtsi | 2 +
arch/arm64/boot/dts/exynos/exynos7-espresso.dts | 2 +-
arch/arm64/boot/dts/nvidia/tegra210.dtsi | 1 +
arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 +-
arch/arm64/kernel/head.S | 1 +
arch/mips/kernel/vmlinux.lds.S | 1 +
arch/mips/lantiq/irq.c | 2 +-
arch/mips/mm/c-r4k.c | 2 +-
arch/nios2/kernel/sys_nios2.c | 11 ++-
arch/powerpc/Kconfig | 2 +-
arch/powerpc/platforms/pseries/dlpar.c | 7 +-
arch/sparc/Kconfig | 2 +-
arch/sparc/lib/memset.S | 1 +
arch/x86/kernel/reboot.c | 29 +++----
block/blk-settings.c | 12 +++
crypto/ecdh_helper.c | 3 +
drivers/acpi/acpi_configfs.c | 7 +-
drivers/amba/bus.c | 20 +++--
drivers/ata/ahci_brcm.c | 14 +++-
drivers/block/floppy.c | 27 ++++---
drivers/char/random.c | 2 +-
drivers/clk/meson/clk-pll.c | 2 +-
drivers/clocksource/mxs_timer.c | 5 +-
drivers/dma/fsldma.c | 6 ++
drivers/gpio/gpio-pcf857x.c | 2 +-
drivers/gpu/drm/gma500/oaktrail_hdmi_i2c.c | 22 ++---
drivers/gpu/drm/gma500/psb_drv.c | 2 +
drivers/gpu/drm/msm/dsi/phy/dsi_phy_20nm.c | 2 +-
drivers/hid/hid-core.c | 9 ++-
drivers/i2c/busses/i2c-brcmstb.c | 2 +-
drivers/infiniband/core/user_mad.c | 7 +-
drivers/infiniband/sw/rxe/rxe_recv.c | 11 ++-
drivers/input/joydev.c | 7 +-
drivers/input/joystick/xpad.c | 1 +
drivers/input/serio/i8042-x86ia64io.h | 4 +
drivers/input/touchscreen/elo.c | 4 +-
drivers/input/touchscreen/raydium_i2c_ts.c | 3 +-
drivers/md/dm-era-target.c | 93 ++++++++++++++--------
drivers/media/pci/cx25821/cx25821-core.c | 4 +-
drivers/media/pci/saa7134/saa7134-empress.c | 5 +-
drivers/media/platform/pxa_camera.c | 3 +
drivers/media/platform/vsp1/vsp1_drv.c | 4 +-
drivers/media/tuners/qm1d1c0042.c | 4 +-
drivers/media/usb/dvb-usb-v2/lmedm04.c | 2 +-
drivers/media/usb/tm6000/tm6000-dvb.c | 4 +
drivers/media/usb/uvc/uvc_v4l2.c | 18 ++---
drivers/mfd/wm831x-auxadc.c | 3 +-
drivers/misc/eeprom/eeprom_93xx46.c | 1 +
drivers/misc/vmw_vmci/vmci_queue_pair.c | 5 +-
drivers/mmc/host/sdhci-esdhc-imx.c | 3 +-
drivers/mmc/host/usdhi6rol0.c | 4 +-
drivers/mtd/spi-nor/cadence-quadspi.c | 2 +-
drivers/mtd/spi-nor/hisi-sfc.c | 4 +-
drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 +-
drivers/net/ethernet/intel/i40e/i40e_txrx.c | 9 ++-
drivers/net/ethernet/intel/igb/igb_main.c | 2 -
.../net/ethernet/mellanox/mlx4/resource_tracker.c | 1 +
drivers/net/ethernet/sun/sunvnet_common.c | 24 +-----
drivers/net/gtp.c | 5 +-
drivers/net/usb/qmi_wwan.c | 1 +
drivers/net/wireless/broadcom/b43/phy_n.c | 2 +-
drivers/net/xen-netback/interface.c | 8 +-
drivers/nvdimm/dimm_devs.c | 18 ++++-
drivers/of/fdt.c | 12 ++-
drivers/pci/syscall.c | 10 +--
drivers/power/reset/at91-sama5d2_shdwc.c | 2 +-
drivers/pwm/pwm-rockchip.c | 1 -
drivers/regulator/axp20x-regulator.c | 7 +-
drivers/scsi/bnx2fc/Kconfig | 1 +
drivers/spi/spi-pxa2xx-pci.c | 27 +++++--
drivers/spi/spi-s3c24xx-fiq.S | 9 +--
drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
drivers/usb/core/quirks.c | 3 +
drivers/usb/dwc2/hcd.c | 15 ++--
drivers/usb/dwc2/hcd_intr.c | 14 +++-
drivers/usb/dwc3/gadget.c | 19 ++++-
drivers/usb/musb/musb_core.c | 31 ++++----
drivers/usb/renesas_usbhs/fifo.c | 2 +
drivers/usb/serial/mos7720.c | 4 +-
drivers/usb/serial/mos7840.c | 4 +-
drivers/usb/serial/option.c | 3 +-
drivers/video/fbdev/Kconfig | 2 +-
fs/btrfs/ctree.c | 7 +-
fs/btrfs/free-space-cache.c | 6 +-
fs/btrfs/relocation.c | 4 +-
fs/cifs/connect.c | 1 +
fs/f2fs/file.c | 3 +-
fs/gfs2/lock_dlm.c | 8 +-
fs/isofs/dir.c | 1 +
fs/isofs/namei.c | 1 +
fs/jffs2/summary.c | 3 +
fs/jfs/jfs_dmap.c | 2 +-
fs/ntfs/inode.c | 6 ++
fs/ocfs2/cluster/heartbeat.c | 8 +-
include/linux/icmpv6.h | 44 +++++++++-
include/linux/ipv6.h | 2 +-
include/net/icmp.h | 10 +++
kernel/debug/kdb/kdb_private.h | 2 +-
kernel/futex.c | 12 +--
kernel/module.c | 21 ++++-
kernel/seccomp.c | 2 +
kernel/tracepoint.c | 80 +++++++++++++++----
mm/huge_memory.c | 15 ++++
mm/hugetlb.c | 43 +++++++++-
mm/memory.c | 6 +-
net/bluetooth/a2mp.c | 3 +-
net/bluetooth/hci_core.c | 6 +-
net/ipv4/icmp.c | 34 ++++++++
net/ipv6/icmp.c | 19 ++---
net/ipv6/ip6_icmp.c | 46 +++++++++--
net/mac80211/mesh_hwmp.c | 2 +-
scripts/recordmcount.pl | 6 +-
security/keys/trusted.c | 2 +-
sound/soc/codecs/cs42l56.c | 3 +-
tools/perf/tests/sample-parsing.c | 2 +-
tools/perf/util/event.c | 2 +
.../perf/util/intel-pt-decoder/intel-pt-decoder.c | 3 +
121 files changed, 763 insertions(+), 304 deletions(-)
This is a note to let you know that I've just added the patch titled
usb: gadget: f_uac1: stop playback on function disable
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 466b4bed6798e912264325bb4d90dfcd3a8a9128 Mon Sep 17 00:00:00 2001
From: Ruslan Bilovol <ruslan.bilovol(a)gmail.com>
Date: Mon, 1 Mar 2021 13:49:32 +0200
Subject: usb: gadget: f_uac1: stop playback on function disable
There is missing playback stop/cleanup in case of
gadget's ->disable callback that happens on
events like USB host resetting or gadget disconnection
Fixes: 0591bc236015 ("usb: gadget: add f_uac1 variant based on a new u_audio api")
Cc: <stable(a)vger.kernel.org> # 4.13+
Signed-off-by: Ruslan Bilovol <ruslan.bilovol(a)gmail.com>
Link: https://lore.kernel.org/r/1614599375-8803-3-git-send-email-ruslan.bilovol@g…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/gadget/function/f_uac1.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/usb/gadget/function/f_uac1.c b/drivers/usb/gadget/function/f_uac1.c
index 00d346965f7a..560382e0a8f3 100644
--- a/drivers/usb/gadget/function/f_uac1.c
+++ b/drivers/usb/gadget/function/f_uac1.c
@@ -499,6 +499,7 @@ static void f_audio_disable(struct usb_function *f)
uac1->as_out_alt = 0;
uac1->as_in_alt = 0;
+ u_audio_stop_playback(&uac1->g_audio);
u_audio_stop_capture(&uac1->g_audio);
}
--
2.30.1
This is a note to let you know that I've just added the patch titled
usb: gadget: f_uac2: always increase endpoint max_packet_size by one
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 089a8b8c66349bc065ea9e865c68872e7cac8bf1 Mon Sep 17 00:00:00 2001
From: Ruslan Bilovol <ruslan.bilovol(a)gmail.com>
Date: Mon, 1 Mar 2021 13:49:31 +0200
Subject: usb: gadget: f_uac2: always increase endpoint max_packet_size by one
audio slot
As per UAC2 Audio Data Formats spec (2.3.1.1 USB Packets),
if the sampling rate is a constant, the allowable variation
of number of audio slots per virtual frame is +/- 1 audio slot.
It means that endpoint should be able to accept/send +1 audio
slot.
Previous endpoint max_packet_size calculation code
was adding sometimes +1 audio slot due to DIV_ROUND_UP
behaviour which was rounding up to closest integer.
However this doesn't work if the numbers are divisible.
It had no any impact with Linux hosts which ignore
this issue, but in case of more strict Windows it
caused rejected enumeration
Thus always add +1 audio slot to endpoint's max packet size
Fixes: 913e4a90b6f9 ("usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth")
Cc: Peter Chen <peter.chen(a)freescale.com>
Cc: <stable(a)vger.kernel.org> #v4.3+
Signed-off-by: Ruslan Bilovol <ruslan.bilovol(a)gmail.com>
Link: https://lore.kernel.org/r/1614599375-8803-2-git-send-email-ruslan.bilovol@g…
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/gadget/function/f_uac2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/usb/gadget/function/f_uac2.c b/drivers/usb/gadget/function/f_uac2.c
index 5d960b6603b6..6f03e944e0e3 100644
--- a/drivers/usb/gadget/function/f_uac2.c
+++ b/drivers/usb/gadget/function/f_uac2.c
@@ -478,7 +478,7 @@ static int set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
}
max_size_bw = num_channels(chmask) * ssize *
- DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1)));
+ ((srate / (factor / (1 << (ep_desc->bInterval - 1)))) + 1);
ep_desc->wMaxPacketSize = cpu_to_le16(min_t(u16, max_size_bw,
max_size_ep));
--
2.30.1
This is a note to let you know that I've just added the patch titled
USB: gadget: u_ether: Fix a configfs return code
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-linus branch.
The patch will show up in the next release of the linux-next tree
(usually sometime within the next 24 hours during the week.)
The patch will hopefully also be merged in Linus's tree for the
next -rc kernel release.
If you have any questions about this process, please let me know.
>From 1236c1d95c99e9f34cd7547e53af71142a3854ea Mon Sep 17 00:00:00 2001
From: Dan Carpenter <dan.carpenter(a)oracle.com>
Date: Mon, 15 Feb 2021 15:57:16 +0000
Subject: USB: gadget: u_ether: Fix a configfs return code
If the string is invalid, this should return -EINVAL instead of 0.
Fixes: 73517cf49bd4 ("usb: gadget: add RNDIS configfs options for class/subclass/protocol")
Cc: stable <stable(a)vger.kernel.org>
Acked-by: Lorenzo Colitti <lorenzo(a)google.com>
Signed-off-by: Dan Carpenter <dan.carpenter(a)oracle.com>
Link: https://lore.kernel.org/r/YCqZ3P53yyIg5cn7@mwanda
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/usb/gadget/function/u_ether_configfs.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/gadget/function/u_ether_configfs.h b/drivers/usb/gadget/function/u_ether_configfs.h
index 3dfb460908fa..f558c3139ebe 100644
--- a/drivers/usb/gadget/function/u_ether_configfs.h
+++ b/drivers/usb/gadget/function/u_ether_configfs.h
@@ -182,12 +182,11 @@ out: \
size_t len) \
{ \
struct f_##_f_##_opts *opts = to_f_##_f_##_opts(item); \
- int ret; \
+ int ret = -EINVAL; \
u8 val; \
\
mutex_lock(&opts->lock); \
- ret = sscanf(page, "%02hhx", &val); \
- if (ret > 0) { \
+ if (sscanf(page, "%02hhx", &val) > 0) { \
opts->_n_ = val; \
ret = len; \
} \
--
2.30.1