summaryrefslogtreecommitdiffstats
path: root/debian/patches/bugfix/all
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-06 01:02:38 +0000
commit08b74a000942a380fe028845f92cd3a0dee827d5 (patch)
treeaa78b4e12607c3e1fcce8d5cc42df4330792f118 /debian/patches/bugfix/all
parentAdding upstream version 4.19.249. (diff)
downloadlinux-08b74a000942a380fe028845f92cd3a0dee827d5.tar.xz
linux-08b74a000942a380fe028845f92cd3a0dee827d5.zip
Adding debian version 4.19.249-2.debian/4.19.249-2debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/patches/bugfix/all')
-rw-r--r--debian/patches/bugfix/all/PCI-ACPI-Evaluate-PCI-Boot-Configuration-_DSM.patch80
-rw-r--r--debian/patches/bugfix/all/PCI-Don-t-auto-realloc-if-we-re-preserving-firmware-.patch35
-rw-r--r--debian/patches/bugfix/all/USB-drop-HDC_LOCAL_MEM-flag.patch191
-rw-r--r--debian/patches/bugfix/all/USB-ohci-sm501-fix-error-return-code-in-ohci_hcd_sm5.patch33
-rw-r--r--debian/patches/bugfix/all/USB-use-genalloc-for-USB-HCs-with-local-memory.patch280
-rw-r--r--debian/patches/bugfix/all/cpupower-bump-soname-version.patch29
-rw-r--r--debian/patches/bugfix/all/cpupower-fix-checks-for-cpu-existence.patch51
-rw-r--r--debian/patches/bugfix/all/disable-some-marvell-phys.patch93
-rw-r--r--debian/patches/bugfix/all/documentation-media-uapi-explicitly-say-there-are-no-invariant-sections.patch52
-rw-r--r--debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch2895
-rw-r--r--debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch70
-rw-r--r--debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch66
-rw-r--r--debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch25
-rw-r--r--debian/patches/bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch42
-rw-r--r--debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch91
-rw-r--r--debian/patches/bugfix/all/lib-genalloc-add-gen_pool_dma_zalloc-for-zeroed-DMA.patch77
-rw-r--r--debian/patches/bugfix/all/libbpf-add-soname-to-shared-object.patch56
-rw-r--r--debian/patches/bugfix/all/libbpf-generate-pkg-config.patch90
-rw-r--r--debian/patches/bugfix/all/libbpf-link-shared-object-with-libelf.patch22
-rw-r--r--debian/patches/bugfix/all/libcpupower-hide-private-function.patch22
-rw-r--r--debian/patches/bugfix/all/module-disable-matching-missing-version-crc.patch25
-rw-r--r--debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch30
-rw-r--r--debian/patches/bugfix/all/net_sched-let-qdisc_put-accept-null-pointer.patch50
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-event_anal.patch153
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-.patch214
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-ebf6c5c181ab.patch85
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-failed-sys.patch76
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-futex-cont.patch57
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-intel-pt-e.patch133
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-mem-phys-a.patch76
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-net_dropmo.patch59
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-netdev-tim.patch180
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-powerpc-hc.patch87
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-sctop.py.patch69
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stackcolla.patch45
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stat-cpi.p.patch61
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co-de667cce7f4f.patch74
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co.patch65
-rw-r--r--debian/patches/bugfix/all/perf-script-python-Remove-mixed-indentation.patch511
-rw-r--r--debian/patches/bugfix/all/perf-script-python-add-Python3-support-to-check-perf.patch104
-rw-r--r--debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch135
-rw-r--r--debian/patches/bugfix/all/rtc-s35390a-set-uie_unsupported.patch40
-rw-r--r--debian/patches/bugfix/all/swiotlb-skip-swiotlb_bounce-when-orig_addr-is-zero.patch47
-rw-r--r--debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch29
-rw-r--r--debian/patches/bugfix/all/tools-lib-traceevent-use-ldflags.patch29
-rw-r--r--debian/patches/bugfix/all/tools-perf-man-date.patch37
-rw-r--r--debian/patches/bugfix/all/tools-perf-remove-shebangs.patch47
-rw-r--r--debian/patches/bugfix/all/usb-add-a-hcd_uses_dma-helper.patch110
-rw-r--r--debian/patches/bugfix/all/usb-dont-create-dma-pools-for-HCD.patch31
-rw-r--r--debian/patches/bugfix/all/usb-hcd-Fix-a-NULL-vs-IS_ERR-bug-in-usb_hcd_setup_lo.patch35
-rw-r--r--debian/patches/bugfix/all/usb-host-ohci-sm501-init-genalloc-for-local-memory.patch105
-rw-r--r--debian/patches/bugfix/all/usbip-document-tcp-wrappers.patch31
-rw-r--r--debian/patches/bugfix/all/usbip-fix-misuse-of-strncpy.patch61
53 files changed, 7191 insertions, 0 deletions
diff --git a/debian/patches/bugfix/all/PCI-ACPI-Evaluate-PCI-Boot-Configuration-_DSM.patch b/debian/patches/bugfix/all/PCI-ACPI-Evaluate-PCI-Boot-Configuration-_DSM.patch
new file mode 100644
index 000000000..2172fa43d
--- /dev/null
+++ b/debian/patches/bugfix/all/PCI-ACPI-Evaluate-PCI-Boot-Configuration-_DSM.patch
@@ -0,0 +1,80 @@
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Sat, 15 Jun 2019 10:23:57 +1000
+Subject: [PATCH 1/4] PCI/ACPI: Evaluate PCI Boot Configuration _DSM
+Origin: https://git.kernel.org/linus/a78cf9657ba5426f54aa93a067c10d097944c082
+
+Evaluate _DSM Function #5, the "PCI Boot Configuration" function. If the
+result is 0, the OS should preserve any resource assignments made by the
+firmware.
+
+Link: https://lore.kernel.org/r/20190615002359.29577-2-benh@kernel.crashing.org
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+[bhelgaas: commit log]
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+---
+ drivers/acpi/pci_root.c | 12 ++++++++++++
+ include/linux/pci-acpi.h | 7 ++++---
+ include/linux/pci.h | 2 ++
+ 3 files changed, 18 insertions(+), 3 deletions(-)
+
+Index: linux/drivers/acpi/pci_root.c
+===================================================================
+--- linux.orig/drivers/acpi/pci_root.c
++++ linux/drivers/acpi/pci_root.c
+@@ -884,6 +884,7 @@ struct pci_bus *acpi_pci_root_create(str
+ int node = acpi_get_node(device->handle);
+ struct pci_bus *bus;
+ struct pci_host_bridge *host_bridge;
++ union acpi_object *obj;
+
+ info->root = root;
+ info->bridge = device;
+@@ -920,6 +921,17 @@ struct pci_bus *acpi_pci_root_create(str
+ if (!(root->osc_control_set & OSC_PCI_EXPRESS_LTR_CONTROL))
+ host_bridge->native_ltr = 0;
+
++ /*
++ * Evaluate the "PCI Boot Configuration" _DSM Function. If it
++ * exists and returns 0, we must preserve any PCI resource
++ * assignments made by firmware for this host bridge.
++ */
++ obj = acpi_evaluate_dsm(ACPI_HANDLE(bus->bridge), &pci_acpi_dsm_guid, 1,
++ IGNORE_PCI_BOOT_CONFIG_DSM, NULL);
++ if (obj && obj->type == ACPI_TYPE_INTEGER && obj->integer.value == 0)
++ host_bridge->preserve_config = 1;
++ ACPI_FREE(obj);
++
+ pci_scan_child_bus(bus);
+ pci_set_host_bridge_release(host_bridge, acpi_pci_root_release_info,
+ info);
+Index: linux/include/linux/pci-acpi.h
+===================================================================
+--- linux.orig/include/linux/pci-acpi.h
++++ linux/include/linux/pci-acpi.h
+@@ -107,9 +107,10 @@ static inline void acpiphp_check_host_br
+ #endif
+
+ extern const guid_t pci_acpi_dsm_guid;
+-#define DEVICE_LABEL_DSM 0x07
+-#define RESET_DELAY_DSM 0x08
+-#define FUNCTION_DELAY_DSM 0x09
++#define IGNORE_PCI_BOOT_CONFIG_DSM 0x05
++#define DEVICE_LABEL_DSM 0x07
++#define RESET_DELAY_DSM 0x08
++#define FUNCTION_DELAY_DSM 0x09
+
+ #else /* CONFIG_ACPI */
+ static inline void acpi_pci_add_bus(struct pci_bus *bus) { }
+Index: linux/include/linux/pci.h
+===================================================================
+--- linux.orig/include/linux/pci.h
++++ linux/include/linux/pci.h
+@@ -486,6 +486,8 @@ struct pci_host_bridge {
+ unsigned int native_shpc_hotplug:1; /* OS may use SHPC hotplug */
+ unsigned int native_pme:1; /* OS may use PCIe PME */
+ unsigned int native_ltr:1; /* OS may use PCIe LTR */
++ unsigned int preserve_config:1; /* Preserve FW resource setup */
++
+ /* Resource alignment requirements */
+ resource_size_t (*align_resource)(struct pci_dev *dev,
+ const struct resource *res,
diff --git a/debian/patches/bugfix/all/PCI-Don-t-auto-realloc-if-we-re-preserving-firmware-.patch b/debian/patches/bugfix/all/PCI-Don-t-auto-realloc-if-we-re-preserving-firmware-.patch
new file mode 100644
index 000000000..04fa61629
--- /dev/null
+++ b/debian/patches/bugfix/all/PCI-Don-t-auto-realloc-if-we-re-preserving-firmware-.patch
@@ -0,0 +1,35 @@
+From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Date: Sat, 15 Jun 2019 10:23:58 +1000
+Subject: [PATCH 2/4] PCI: Don't auto-realloc if we're preserving firmware config
+Origin: https://git.kernel.org/linus/7ac0d094fbe95bf7cc96b3066a97e1090ddc734a
+
+Prevent auto-enabling of bridges reallocation when the FW tells us that the
+initial configuration must be preserved for a given host bridge.
+
+Link: https://lore.kernel.org/r/20190615002359.29577-3-benh@kernel.crashing.org
+Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
+Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
+---
+ drivers/pci/setup-bus.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+Index: linux/drivers/pci/setup-bus.c
+===================================================================
+--- linux.orig/drivers/pci/setup-bus.c
++++ linux/drivers/pci/setup-bus.c
+@@ -1724,10 +1724,15 @@ static enum enable_type pci_realloc_dete
+ enum enable_type enable_local)
+ {
+ bool unassigned = false;
++ struct pci_host_bridge *host;
+
+ if (enable_local != undefined)
+ return enable_local;
+
++ host = pci_find_host_bridge(bus);
++ if (host->preserve_config)
++ return auto_disabled;
++
+ pci_walk_bus(bus, iov_resources_unassigned, &unassigned);
+ if (unassigned)
+ return auto_enabled;
diff --git a/debian/patches/bugfix/all/USB-drop-HDC_LOCAL_MEM-flag.patch b/debian/patches/bugfix/all/USB-drop-HDC_LOCAL_MEM-flag.patch
new file mode 100644
index 000000000..727419539
--- /dev/null
+++ b/debian/patches/bugfix/all/USB-drop-HDC_LOCAL_MEM-flag.patch
@@ -0,0 +1,191 @@
+From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Date: Wed, 29 May 2019 13:28:43 +0300
+Subject: USB: drop HCD_LOCAL_MEM flag
+Origin: https://git.kernel.org/linus/2d7a3dc3e24f43504b1f25eae8195e600f4cce8b
+
+With the addition of the local memory allocator, the HCD_LOCAL_MEM
+flag can be dropped and the checks against it replaced with a check
+for the localmem_pool ptr being initialized.
+
+Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Tested-by: Fredrik Noring <noring@nocrew.org>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ drivers/usb/core/buffer.c | 8 +++-----
+ drivers/usb/core/hcd.c | 15 ++++++---------
+ drivers/usb/host/ehci-hcd.c | 2 +-
+ drivers/usb/host/fotg210-hcd.c | 2 +-
+ drivers/usb/host/ohci-hcd.c | 2 +-
+ drivers/usb/host/ohci-sm501.c | 5 +++--
+ drivers/usb/host/ohci-tmio.c | 2 +-
+ drivers/usb/host/uhci-hcd.c | 2 +-
+ include/linux/usb/hcd.h | 1 -
+ 9 files changed, 17 insertions(+), 22 deletions(-)
+
+--- a/drivers/usb/core/buffer.c
++++ b/drivers/usb/core/buffer.c
+@@ -68,7 +68,7 @@
+
+ if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+ (!is_device_dma_capable(hcd->self.sysdev) &&
+- !(hcd->driver->flags & HCD_LOCAL_MEM)))
++ !hcd->localmem_pool))
+ return 0;
+
+ for (i = 0; i < HCD_BUFFER_POOLS; i++) {
+@@ -134,8 +134,7 @@
+
+ /* some USB hosts just use PIO */
+ if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+- (!is_device_dma_capable(bus->sysdev) &&
+- !(hcd->driver->flags & HCD_LOCAL_MEM))) {
++ !is_device_dma_capable(bus->sysdev)) {
+ *dma = ~(dma_addr_t) 0;
+ return kmalloc(size, mem_flags);
+ }
+@@ -166,8 +165,7 @@
+ }
+
+ if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+- (!is_device_dma_capable(bus->sysdev) &&
+- !(hcd->driver->flags & HCD_LOCAL_MEM))) {
++ !is_device_dma_capable(bus->sysdev)) {
+ kfree(addr);
+ return;
+ }
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -1346,14 +1346,14 @@
+ * using regular system memory - like pci devices doing bus mastering.
+ *
+ * To support host controllers with limited dma capabilities we provide dma
+- * bounce buffers. This feature can be enabled using the HCD_LOCAL_MEM flag.
++ * bounce buffers. This feature can be enabled by initializing
++ * hcd->localmem_pool using usb_hcd_setup_local_mem().
+ * For this to work properly the host controller code must first use the
+ * function dma_declare_coherent_memory() to point out which memory area
+ * that should be used for dma allocations.
+ *
+- * The HCD_LOCAL_MEM flag then tells the usb code to allocate all data for
+- * dma using dma_alloc_coherent() which in turn allocates from the memory
+- * area pointed out with dma_declare_coherent_memory().
++ * The initialized hcd->localmem_pool then tells the usb code to allocate all
++ * data for dma using the genalloc API.
+ *
+ * So, to summarize...
+ *
+@@ -1363,9 +1363,6 @@
+ * (a) "normal" kernel memory is no good, and
+ * (b) there's not enough to share
+ *
+- * - The only *portable* hook for such stuff in the
+- * DMA framework is dma_declare_coherent_memory()
+- *
+ * - So we use that, even though the primary requirement
+ * is that the memory be "local" (hence addressable
+ * by that device), not "coherent".
+@@ -1532,7 +1529,7 @@
+ urb->setup_dma))
+ return -EAGAIN;
+ urb->transfer_flags |= URB_SETUP_MAP_SINGLE;
+- } else if (hcd->driver->flags & HCD_LOCAL_MEM) {
++ } else if (hcd->localmem_pool) {
+ ret = hcd_alloc_coherent(
+ urb->dev->bus, mem_flags,
+ &urb->setup_dma,
+@@ -1602,7 +1599,7 @@
+ else
+ urb->transfer_flags |= URB_DMA_MAP_SINGLE;
+ }
+- } else if (hcd->driver->flags & HCD_LOCAL_MEM) {
++ } else if (hcd->localmem_pool) {
+ ret = hcd_alloc_coherent(
+ urb->dev->bus, mem_flags,
+ &urb->transfer_dma,
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -560,7 +560,7 @@
+ ehci->command = temp;
+
+ /* Accept arbitrarily long scatter-gather lists */
+- if (!(hcd->driver->flags & HCD_LOCAL_MEM))
++ if (!hcd->localmem_pool)
+ hcd->self.sg_tablesize = ~0;
+
+ /* Prepare for unlinking active QHs */
+--- a/drivers/usb/host/fotg210-hcd.c
++++ b/drivers/usb/host/fotg210-hcd.c
+@@ -4998,7 +4998,7 @@
+ fotg210->command = temp;
+
+ /* Accept arbitrarily long scatter-gather lists */
+- if (!(hcd->driver->flags & HCD_LOCAL_MEM))
++ if (!hcd->localmem_pool)
+ hcd->self.sg_tablesize = ~0;
+ return 0;
+ }
+--- a/drivers/usb/host/ohci-hcd.c
++++ b/drivers/usb/host/ohci-hcd.c
+@@ -457,7 +457,7 @@
+ struct usb_hcd *hcd = ohci_to_hcd(ohci);
+
+ /* Accept arbitrarily long scatter-gather lists */
+- if (!(hcd->driver->flags & HCD_LOCAL_MEM))
++ if (!hcd->localmem_pool)
+ hcd->self.sg_tablesize = ~0;
+
+ if (distrust_firmware)
+--- a/drivers/usb/host/ohci-sm501.c
++++ b/drivers/usb/host/ohci-sm501.c
+@@ -49,7 +49,7 @@
+ * generic hardware linkage
+ */
+ .irq = ohci_irq,
+- .flags = HCD_USB11 | HCD_MEMORY | HCD_LOCAL_MEM,
++ .flags = HCD_USB11 | HCD_MEMORY,
+
+ /*
+ * basic lifecycle operations
+@@ -153,7 +153,8 @@
+ * fine. This is however not always the case - buffers may be allocated
+ * using kmalloc() - so the usb core needs to be told that it must copy
+ * data into our local memory if the buffers happen to be placed in
+- * regular memory. The HCD_LOCAL_MEM flag does just that.
++ * regular memory. A non-null hcd->localmem_pool initialized by the
++ * the call to usb_hcd_setup_local_mem() below does just that.
+ */
+
+ retval = usb_hcd_setup_local_mem(hcd, mem->start,
+--- a/drivers/usb/host/ohci-tmio.c
++++ b/drivers/usb/host/ohci-tmio.c
+@@ -153,7 +153,7 @@
+
+ /* generic hardware linkage */
+ .irq = ohci_irq,
+- .flags = HCD_USB11 | HCD_MEMORY | HCD_LOCAL_MEM,
++ .flags = HCD_USB11 | HCD_MEMORY,
+
+ /* basic lifecycle operations */
+ .start = ohci_tmio_start,
+--- a/drivers/usb/host/uhci-hcd.c
++++ b/drivers/usb/host/uhci-hcd.c
+@@ -581,7 +581,7 @@
+
+ hcd->uses_new_polling = 1;
+ /* Accept arbitrarily long scatter-gather lists */
+- if (!(hcd->driver->flags & HCD_LOCAL_MEM))
++ if (!hcd->localmem_pool)
+ hcd->self.sg_tablesize = ~0;
+
+ spin_lock_init(&uhci->lock);
+--- a/include/linux/usb/hcd.h
++++ b/include/linux/usb/hcd.h
+@@ -256,7 +256,6 @@
+
+ int flags;
+ #define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
+-#define HCD_LOCAL_MEM 0x0002 /* HC needs local memory */
+ #define HCD_SHARED 0x0004 /* Two (or more) usb_hcds share HW */
+ #define HCD_USB11 0x0010 /* USB 1.1 */
+ #define HCD_USB2 0x0020 /* USB 2.0 */
diff --git a/debian/patches/bugfix/all/USB-ohci-sm501-fix-error-return-code-in-ohci_hcd_sm5.patch b/debian/patches/bugfix/all/USB-ohci-sm501-fix-error-return-code-in-ohci_hcd_sm5.patch
new file mode 100644
index 000000000..08a838c66
--- /dev/null
+++ b/debian/patches/bugfix/all/USB-ohci-sm501-fix-error-return-code-in-ohci_hcd_sm5.patch
@@ -0,0 +1,33 @@
+From: Wei Yongjun <weiyongjun1@huawei.com>
+Date: Wed, 6 May 2020 13:56:25 +0000
+Subject: USB: ohci-sm501: fix error return code in ohci_hcd_sm501_drv_probe()
+Origin: https://git.kernel.org/linus/b919e077cccfbb77beb98809568b2fb0b4d113ec
+
+Fix to return a negative error code from the error handling
+case instead of 0, as done elsewhere in this function.
+
+Fixes: 7d9e6f5aebe8 ("usb: host: ohci-sm501: init genalloc for local memory")
+Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Link: https://lore.kernel.org/r/20200506135625.106910-1-weiyongjun1@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/ohci-sm501.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/host/ohci-sm501.c
++++ b/drivers/usb/host/ohci-sm501.c
+@@ -156,9 +156,10 @@
+ * regular memory. The HCD_LOCAL_MEM flag does just that.
+ */
+
+- if (usb_hcd_setup_local_mem(hcd, mem->start,
+- mem->start - mem->parent->start,
+- resource_size(mem)) < 0)
++ retval = usb_hcd_setup_local_mem(hcd, mem->start,
++ mem->start - mem->parent->start,
++ resource_size(mem));
++ if (retval < 0)
+ goto err5;
+ retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
+ if (retval)
diff --git a/debian/patches/bugfix/all/USB-use-genalloc-for-USB-HCs-with-local-memory.patch b/debian/patches/bugfix/all/USB-use-genalloc-for-USB-HCs-with-local-memory.patch
new file mode 100644
index 000000000..88caafd5a
--- /dev/null
+++ b/debian/patches/bugfix/all/USB-use-genalloc-for-USB-HCs-with-local-memory.patch
@@ -0,0 +1,280 @@
+From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Date: Wed, 29 May 2019 13:28:40 +0300
+Subject: USB: use genalloc for USB HCs with local memory
+Origin: https://git.kernel.org/linus/b0310c2f09bbe8aebefb97ed67949a3a7092aca6
+
+For HCs that have local memory, replace the current DMA API usage with
+a genalloc generic allocator to manage the mappings for these devices.
+To help users, introduce a new HCD API, usb_hcd_setup_local_mem() that
+will setup up the genalloc backing up the device local memory. It will
+be used in subsequent patches. This is in preparation for dropping
+the existing "coherent" dma mem declaration APIs. The current
+implementation was relying on a short circuit in the DMA API that in
+the end, was acting as an allocator for these type of devices.
+
+Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Tested-by: Fredrik Noring <noring@nocrew.org>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ drivers/usb/Kconfig | 1 +
+ drivers/usb/core/buffer.c | 9 +++++++++
+ drivers/usb/core/hcd.c | 36 ++++++++++++++++++++++++++++++++++++
+ drivers/usb/host/ohci-hcd.c | 23 ++++++++++++++++++-----
+ drivers/usb/host/ohci-mem.c | 35 +++++++++++++++++++++++++++++++----
+ drivers/usb/host/ohci.h | 2 ++
+ include/linux/usb/hcd.h | 5 +++++
+ 7 files changed, 102 insertions(+), 9 deletions(-)
+
+--- a/drivers/usb/Kconfig
++++ b/drivers/usb/Kconfig
+@@ -44,6 +44,7 @@
+ config USB
+ tristate "Support for Host-side USB"
+ depends on USB_ARCH_HAS_HCD
++ select GENERIC_ALLOCATOR
+ select USB_COMMON
+ select NLS # for UTF-8 strings
+ ---help---
+--- a/drivers/usb/core/buffer.c
++++ b/drivers/usb/core/buffer.c
+@@ -16,6 +16,7 @@
+ #include <linux/io.h>
+ #include <linux/dma-mapping.h>
+ #include <linux/dmapool.h>
++#include <linux/genalloc.h>
+ #include <linux/usb.h>
+ #include <linux/usb/hcd.h>
+
+@@ -128,6 +129,9 @@
+ if (size == 0)
+ return NULL;
+
++ if (hcd->localmem_pool)
++ return gen_pool_dma_alloc(hcd->localmem_pool, size, dma);
++
+ /* some USB hosts just use PIO */
+ if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+ (!is_device_dma_capable(bus->sysdev) &&
+@@ -156,6 +160,11 @@
+ if (!addr)
+ return;
+
++ if (hcd->localmem_pool) {
++ gen_pool_free(hcd->localmem_pool, (unsigned long)addr, size);
++ return;
++ }
++
+ if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+ (!is_device_dma_capable(bus->sysdev) &&
+ !(hcd->driver->flags & HCD_LOCAL_MEM))) {
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -29,6 +29,8 @@
+ #include <linux/workqueue.h>
+ #include <linux/pm_runtime.h>
+ #include <linux/types.h>
++#include <linux/genalloc.h>
++#include <linux/io.h>
+
+ #include <linux/phy/phy.h>
+ #include <linux/usb.h>
+@@ -3025,6 +3027,40 @@
+ }
+ EXPORT_SYMBOL_GPL(usb_hcd_platform_shutdown);
+
++int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr,
++ dma_addr_t dma, size_t size)
++{
++ int err;
++ void *local_mem;
++
++ hcd->localmem_pool = devm_gen_pool_create(hcd->self.sysdev, PAGE_SHIFT,
++ dev_to_node(hcd->self.sysdev),
++ dev_name(hcd->self.sysdev));
++ if (IS_ERR(hcd->localmem_pool))
++ return PTR_ERR(hcd->localmem_pool);
++
++ local_mem = devm_memremap(hcd->self.sysdev, phys_addr,
++ size, MEMREMAP_WC);
++ if (!local_mem)
++ return -ENOMEM;
++
++ /*
++ * Here we pass a dma_addr_t but the arg type is a phys_addr_t.
++ * It's not backed by system memory and thus there's no kernel mapping
++ * for it.
++ */
++ err = gen_pool_add_virt(hcd->localmem_pool, (unsigned long)local_mem,
++ dma, size, dev_to_node(hcd->self.sysdev));
++ if (err < 0) {
++ dev_err(hcd->self.sysdev, "gen_pool_add_virt failed with %d\n",
++ err);
++ return err;
++ }
++
++ return 0;
++}
++EXPORT_SYMBOL_GPL(usb_hcd_setup_local_mem);
++
+ /*-------------------------------------------------------------------------*/
+
+ #if IS_ENABLED(CONFIG_USB_MON)
+--- a/drivers/usb/host/ohci-hcd.c
++++ b/drivers/usb/host/ohci-hcd.c
+@@ -40,6 +40,7 @@
+ #include <linux/dmapool.h>
+ #include <linux/workqueue.h>
+ #include <linux/debugfs.h>
++#include <linux/genalloc.h>
+
+ #include <asm/io.h>
+ #include <asm/irq.h>
+@@ -514,8 +515,15 @@
+ timer_setup(&ohci->io_watchdog, io_watchdog_func, 0);
+ ohci->prev_frame_no = IO_WATCHDOG_OFF;
+
+- ohci->hcca = dma_alloc_coherent (hcd->self.controller,
+- sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
++ if (hcd->localmem_pool)
++ ohci->hcca = gen_pool_dma_alloc(hcd->localmem_pool,
++ sizeof(*ohci->hcca),
++ &ohci->hcca_dma);
++ else
++ ohci->hcca = dma_alloc_coherent(hcd->self.controller,
++ sizeof(*ohci->hcca),
++ &ohci->hcca_dma,
++ GFP_KERNEL);
+ if (!ohci->hcca)
+ return -ENOMEM;
+
+@@ -999,9 +1007,14 @@
+ remove_debug_files (ohci);
+ ohci_mem_cleanup (ohci);
+ if (ohci->hcca) {
+- dma_free_coherent (hcd->self.controller,
+- sizeof *ohci->hcca,
+- ohci->hcca, ohci->hcca_dma);
++ if (hcd->localmem_pool)
++ gen_pool_free(hcd->localmem_pool,
++ (unsigned long)ohci->hcca,
++ sizeof(*ohci->hcca));
++ else
++ dma_free_coherent(hcd->self.controller,
++ sizeof(*ohci->hcca),
++ ohci->hcca, ohci->hcca_dma);
+ ohci->hcca = NULL;
+ ohci->hcca_dma = 0;
+ }
+--- a/drivers/usb/host/ohci-mem.c
++++ b/drivers/usb/host/ohci-mem.c
+@@ -36,6 +36,13 @@
+
+ static int ohci_mem_init (struct ohci_hcd *ohci)
+ {
++ /*
++ * HCs with local memory allocate from localmem_pool so there's
++ * no need to create the below dma pools.
++ */
++ if (ohci_to_hcd(ohci)->localmem_pool)
++ return 0;
++
+ ohci->td_cache = dma_pool_create ("ohci_td",
+ ohci_to_hcd(ohci)->self.controller,
+ sizeof (struct td),
+@@ -88,8 +95,12 @@
+ {
+ dma_addr_t dma;
+ struct td *td;
++ struct usb_hcd *hcd = ohci_to_hcd(hc);
+
+- td = dma_pool_zalloc (hc->td_cache, mem_flags, &dma);
++ if (hcd->localmem_pool)
++ td = gen_pool_dma_zalloc(hcd->localmem_pool, sizeof(*td), &dma);
++ else
++ td = dma_pool_zalloc(hc->td_cache, mem_flags, &dma);
+ if (td) {
+ /* in case hc fetches it, make it look dead */
+ td->hwNextTD = cpu_to_hc32 (hc, dma);
+@@ -103,6 +114,7 @@
+ td_free (struct ohci_hcd *hc, struct td *td)
+ {
+ struct td **prev = &hc->td_hash [TD_HASH_FUNC (td->td_dma)];
++ struct usb_hcd *hcd = ohci_to_hcd(hc);
+
+ while (*prev && *prev != td)
+ prev = &(*prev)->td_hash;
+@@ -110,7 +122,12 @@
+ *prev = td->td_hash;
+ else if ((td->hwINFO & cpu_to_hc32(hc, TD_DONE)) != 0)
+ ohci_dbg (hc, "no hash for td %p\n", td);
+- dma_pool_free (hc->td_cache, td, td->td_dma);
++
++ if (hcd->localmem_pool)
++ gen_pool_free(hcd->localmem_pool, (unsigned long)td,
++ sizeof(*td));
++ else
++ dma_pool_free(hc->td_cache, td, td->td_dma);
+ }
+
+ /*-------------------------------------------------------------------------*/
+@@ -121,8 +138,12 @@
+ {
+ dma_addr_t dma;
+ struct ed *ed;
++ struct usb_hcd *hcd = ohci_to_hcd(hc);
+
+- ed = dma_pool_zalloc (hc->ed_cache, mem_flags, &dma);
++ if (hcd->localmem_pool)
++ ed = gen_pool_dma_zalloc(hcd->localmem_pool, sizeof(*ed), &dma);
++ else
++ ed = dma_pool_zalloc(hc->ed_cache, mem_flags, &dma);
+ if (ed) {
+ INIT_LIST_HEAD (&ed->td_list);
+ ed->dma = dma;
+@@ -133,6 +154,12 @@
+ static void
+ ed_free (struct ohci_hcd *hc, struct ed *ed)
+ {
+- dma_pool_free (hc->ed_cache, ed, ed->dma);
++ struct usb_hcd *hcd = ohci_to_hcd(hc);
++
++ if (hcd->localmem_pool)
++ gen_pool_free(hcd->localmem_pool, (unsigned long)ed,
++ sizeof(*ed));
++ else
++ dma_pool_free(hc->ed_cache, ed, ed->dma);
+ }
+
+--- a/drivers/usb/host/ohci.h
++++ b/drivers/usb/host/ohci.h
+@@ -385,6 +385,8 @@
+
+ /*
+ * memory management for queue data structures
++ *
++ * @td_cache and @ed_cache are %NULL if &usb_hcd.localmem_pool is used.
+ */
+ struct dma_pool *td_cache;
+ struct dma_pool *ed_cache;
+--- a/include/linux/usb/hcd.h
++++ b/include/linux/usb/hcd.h
+@@ -211,6 +211,9 @@
+ #define HC_IS_RUNNING(state) ((state) & __ACTIVE)
+ #define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
+
++ /* memory pool for HCs having local memory, or %NULL */
++ struct gen_pool *localmem_pool;
++
+ /* more shared queuing code would be good; it should support
+ * smarter scheduling, handle transaction translators, etc;
+ * input size of periodic table to an interrupt scheduler.
+@@ -461,6 +464,8 @@
+ unsigned int irqnum, unsigned long irqflags);
+ extern void usb_remove_hcd(struct usb_hcd *hcd);
+ extern int usb_hcd_find_raw_port_number(struct usb_hcd *hcd, int port1);
++int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr,
++ dma_addr_t dma, size_t size);
+
+ struct platform_device;
+ extern void usb_hcd_platform_shutdown(struct platform_device *dev);
diff --git a/debian/patches/bugfix/all/cpupower-bump-soname-version.patch b/debian/patches/bugfix/all/cpupower-bump-soname-version.patch
new file mode 100644
index 000000000..5691bd454
--- /dev/null
+++ b/debian/patches/bugfix/all/cpupower-bump-soname-version.patch
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Thu, 9 Jun 2016 23:35:08 +0100
+Subject: cpupower: Bump soname version
+Forwarded: http://mid.gmane.org/20160610005619.GQ7555@decadent.org.uk
+
+Several functions in the libcpupower API are renamed or removed in
+Linux 4.7. This is an backward-incompatible ABI change, so the
+library soname should change from libcpupower.so.0 to
+libcpupower.so.1.
+
+Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library")
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+ tools/power/cpupower/Makefile | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux/tools/power/cpupower/Makefile
+===================================================================
+--- linux.orig/tools/power/cpupower/Makefile
++++ linux/tools/power/cpupower/Makefile
+@@ -66,7 +66,7 @@ DESTDIR ?=
+
+ VERSION= $(shell ./utils/version-gen.sh)
+ LIB_MAJ= 0.0.1
+-LIB_MIN= 0
++LIB_MIN= 1
+
+ PACKAGE = cpupower
+ PACKAGE_BUGREPORT = linux-pm@vger.kernel.org
diff --git a/debian/patches/bugfix/all/cpupower-fix-checks-for-cpu-existence.patch b/debian/patches/bugfix/all/cpupower-fix-checks-for-cpu-existence.patch
new file mode 100644
index 000000000..0ad8fc6cd
--- /dev/null
+++ b/debian/patches/bugfix/all/cpupower-fix-checks-for-cpu-existence.patch
@@ -0,0 +1,51 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Thu, 03 Nov 2016 15:25:26 -0600
+Subject: cpupower: Fix checks for CPU existence
+Forwarded: https://marc.info/?l=linux-pm&m=149248268214265
+
+Calls to cpufreq_cpu_exists(cpu) were converted to
+cpupower_is_cpu_online(cpu) when libcpupower was introduced and the
+former function was deleted. However, cpupower_is_cpu_online() does
+not distinguish physically absent and offline CPUs, and does not set
+errno.
+
+cpufreq-set has already been fixed (commit c25badc9ceb6).
+
+In cpufreq-bench, which prints an error message for offline CPUs,
+properly distinguish and report the zero and negative cases.
+
+Fixes: ac5a181d065d ("cpupower: Add cpuidle parts into library")
+Fixes: 53d1cd6b125f ("cpupowerutils: bench - Fix cpu online check")
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+[carnil: Update/Refresh patch for 4.14.17: The issue with the
+incorrect check has been fixed with upstream commit 53d1cd6b125f.
+Keep in the patch the distinction and report for the zero and
+negative cases.]
+---
+Index: linux/tools/power/cpupower/bench/system.c
+===================================================================
+--- linux.orig/tools/power/cpupower/bench/system.c
++++ linux/tools/power/cpupower/bench/system.c
+@@ -58,12 +58,19 @@ long long int get_time()
+
+ int set_cpufreq_governor(char *governor, unsigned int cpu)
+ {
++ int rc;
+
+ dprintf("set %s as cpufreq governor\n", governor);
+
+- if (cpupower_is_cpu_online(cpu) != 1) {
+- perror("cpufreq_cpu_exists");
+- fprintf(stderr, "error: cpu %u does not exist\n", cpu);
++ rc = cpupower_is_cpu_online(cpu);
++ if (rc != 1) {
++ if (rc < 0)
++ fprintf(stderr, "cpupower_is_cpu_online: %s\n",
++ strerror(-rc));
++ else
++ fprintf(stderr,
++ "error: cpu %u is offline or does not exist\n",
++ cpu);
+ return -1;
+ }
+
diff --git a/debian/patches/bugfix/all/disable-some-marvell-phys.patch b/debian/patches/bugfix/all/disable-some-marvell-phys.patch
new file mode 100644
index 000000000..297b38c56
--- /dev/null
+++ b/debian/patches/bugfix/all/disable-some-marvell-phys.patch
@@ -0,0 +1,93 @@
+From: Ian Campbell <ijc@hellion.org.uk>
+Subject: phy/marvell: disable 4-port phys
+Date: Wed, 20 Nov 2013 08:30:14 +0000
+Bug-Debian: https://bugs.debian.org/723177
+Forwarded: http://thread.gmane.org/gmane.linux.debian.devel.bugs.general/1107774/
+
+The Marvell PHY was originally disabled because it can cause networking
+failures on some systems. According to Lennert Buytenhek this is because some
+of the variants added did not share the same register layout. Since the known
+cases are all 4-ports disable those variants (indicated by a 4 in the
+penultimate position of the model name) until they can be audited for
+correctness.
+
+[bwh: Also #if-out the init functions for these PHYs to avoid
+ compiler warnings]
+
+Index: linux/drivers/net/phy/marvell.c
+===================================================================
+--- linux.orig/drivers/net/phy/marvell.c
++++ linux/drivers/net/phy/marvell.c
+@@ -950,6 +950,7 @@ static int m88e1118_config_init(struct p
+ return genphy_soft_reset(phydev);
+ }
+
++#if 0
+ static int m88e1149_config_init(struct phy_device *phydev)
+ {
+ int err;
+@@ -975,7 +976,9 @@ static int m88e1149_config_init(struct p
+
+ return genphy_soft_reset(phydev);
+ }
++#endif
+
++#if 0
+ static int m88e1145_config_init_rgmii(struct phy_device *phydev)
+ {
+ int err;
+@@ -1050,6 +1053,7 @@ static int m88e1145_config_init(struct p
+
+ return 0;
+ }
++#endif
+
+ /* The VOD can be out of specification on link up. Poke an
+ * undocumented register, in an undocumented page, with a magic value
+@@ -2165,6 +2169,7 @@ static struct phy_driver marvell_drivers
+ .get_strings = marvell_get_strings,
+ .get_stats = marvell_get_stats,
+ },
++#if 0
+ {
+ .phy_id = MARVELL_PHY_ID_88E1145,
+ .phy_id_mask = MARVELL_PHY_ID_MASK,
+@@ -2185,6 +2190,8 @@ static struct phy_driver marvell_drivers
+ .get_strings = marvell_get_strings,
+ .get_stats = marvell_get_stats,
+ },
++#endif
++#if 0
+ {
+ .phy_id = MARVELL_PHY_ID_88E1149R,
+ .phy_id_mask = MARVELL_PHY_ID_MASK,
+@@ -2204,6 +2211,8 @@ static struct phy_driver marvell_drivers
+ .get_strings = marvell_get_strings,
+ .get_stats = marvell_get_stats,
+ },
++#endif
++#if 0
+ {
+ .phy_id = MARVELL_PHY_ID_88E1240,
+ .phy_id_mask = MARVELL_PHY_ID_MASK,
+@@ -2223,6 +2232,7 @@ static struct phy_driver marvell_drivers
+ .get_strings = marvell_get_strings,
+ .get_stats = marvell_get_stats,
+ },
++#endif
+ {
+ .phy_id = MARVELL_PHY_ID_88E1116R,
+ .phy_id_mask = MARVELL_PHY_ID_MASK,
+@@ -2359,9 +2369,9 @@ static struct mdio_device_id __maybe_unu
+ { MARVELL_PHY_ID_88E1111, MARVELL_PHY_ID_MASK },
+ { MARVELL_PHY_ID_88E1118, MARVELL_PHY_ID_MASK },
+ { MARVELL_PHY_ID_88E1121R, MARVELL_PHY_ID_MASK },
+- { MARVELL_PHY_ID_88E1145, MARVELL_PHY_ID_MASK },
+- { MARVELL_PHY_ID_88E1149R, MARVELL_PHY_ID_MASK },
+- { MARVELL_PHY_ID_88E1240, MARVELL_PHY_ID_MASK },
++/* { MARVELL_PHY_ID_88E1145, MARVELL_PHY_ID_MASK }, */
++/* { MARVELL_PHY_ID_88E1149R, MARVELL_PHY_ID_MASK }, */
++/* { MARVELL_PHY_ID_88E1240, MARVELL_PHY_ID_MASK }, */
+ { MARVELL_PHY_ID_88E1318S, MARVELL_PHY_ID_MASK },
+ { MARVELL_PHY_ID_88E1116R, MARVELL_PHY_ID_MASK },
+ { MARVELL_PHY_ID_88E1510, MARVELL_PHY_ID_MASK },
diff --git a/debian/patches/bugfix/all/documentation-media-uapi-explicitly-say-there-are-no-invariant-sections.patch b/debian/patches/bugfix/all/documentation-media-uapi-explicitly-say-there-are-no-invariant-sections.patch
new file mode 100644
index 000000000..97e5d0a64
--- /dev/null
+++ b/debian/patches/bugfix/all/documentation-media-uapi-explicitly-say-there-are-no-invariant-sections.patch
@@ -0,0 +1,52 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 23 Nov 2018 13:38:34 -0500
+Subject: media: Documentation/media: uapi: Explicitly say there are no
+ Invariant Sections
+Origin: https://git.kernel.org/linus/861c56c13d817b76e802d664e6ce7edb09cb9417
+Bug-Debian: https://bugs.debian.org/698668
+
+The GNU Free Documentation License allows for a work to specify
+Invariant Sections that are not allowed to be modified. (Debian
+considers that this makes such works non-free.)
+
+The Linux Media Infrastructure userspace API documentation does not
+specify any such sections, but it also doesn't say there are none (as
+is recommended by the license text). Make it explicit that there are
+none.
+
+Signed-off-by: Aaro Koskinen <aaro.koskinen@nokia.com>
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
+Signed-off-by: Johannes Stezenbach <js@linuxtv.org>
+Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
+Signed-off-by: Marcus Metzler <mocm@metzlerbros.de>
+Signed-off-by: Michael Ira Krufky <mkrufky@gmail.com>
+Signed-off-by: Ralph Metzler <rjkm@metzlerbros.de>
+Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
+Signed-off-by: Sean Young <sean@mess.org>
+Signed-off-by: Sylwester Nawrocki <snawrocki@kernel.org>
+Cc: Thomas Gleixner <tglx@linutronix.de>
+Cc: Kate Stewart <kstewart@linuxfoundation.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
+---
+ Documentation/media/media_uapi.rst | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+Index: linux/Documentation/media/media_uapi.rst
+===================================================================
+--- linux.orig/Documentation/media/media_uapi.rst
++++ linux/Documentation/media/media_uapi.rst
+@@ -10,9 +10,9 @@ Linux Media Infrastructure userspace API
+
+ Permission is granted to copy, distribute and/or modify this document
+ under the terms of the GNU Free Documentation License, Version 1.1 or
+-any later version published by the Free Software Foundation. A copy of
+-the license is included in the chapter entitled "GNU Free Documentation
+-License".
++any later version published by the Free Software Foundation, with no
++Invariant Sections. A copy of the license is included in the chapter
++entitled "GNU Free Documentation License".
+
+ .. only:: html
+
diff --git a/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch b/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
new file mode 100644
index 000000000..633c5c34c
--- /dev/null
+++ b/debian/patches/bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
@@ -0,0 +1,2895 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: firmware: Remove redundant log messages from drivers
+Date: Sun, 09 Dec 2012 16:40:31 +0000
+Forwarded: no
+
+Now that firmware_class logs every success and failure consistently,
+many other log messages can be removed from drivers.
+
+This will probably need to be split up into multiple patches prior to
+upstream submission.
+
+Index: linux/arch/arm/mach-netx/xc.c
+===================================================================
+--- linux.orig/arch/arm/mach-netx/xc.c
++++ linux/arch/arm/mach-netx/xc.c
+@@ -127,10 +127,8 @@ int xc_request_firmware(struct xc *x)
+
+ ret = request_firmware(&fw, name, x->dev);
+
+- if (ret < 0) {
+- dev_err(x->dev, "request_firmware failed\n");
++ if (ret)
+ return ret;
+- }
+
+ head = (struct fw_header *)fw->data;
+ if (head->magic != 0x4e657458) {
+Index: linux/arch/x86/kernel/cpu/microcode/amd.c
+===================================================================
+--- linux.orig/arch/x86/kernel/cpu/microcode/amd.c
++++ linux/arch/x86/kernel/cpu/microcode/amd.c
+@@ -755,10 +755,8 @@ static enum ucode_state request_microcod
+ if (c->x86 >= 0x15)
+ snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
+
+- if (request_firmware_direct(&fw, (const char *)fw_name, device)) {
+- pr_debug("failed to load file %s\n", fw_name);
++ if (request_firmware_direct(&fw, (const char *)fw_name, device))
+ goto out;
+- }
+
+ ret = UCODE_ERROR;
+ if (*(u32 *)fw->data != UCODE_MAGIC) {
+Index: linux/drivers/atm/ambassador.c
+===================================================================
+--- linux.orig/drivers/atm/ambassador.c
++++ linux/drivers/atm/ambassador.c
+@@ -1929,10 +1929,8 @@ static int ucode_init(loader_block *lb,
+ int res;
+
+ res = request_ihex_firmware(&fw, "atmsar11.fw", &dev->pci_dev->dev);
+- if (res) {
+- PRINTK (KERN_ERR, "Cannot load microcode data");
++ if (res)
+ return res;
+- }
+
+ /* First record contains just the start address */
+ rec = (const struct ihex_binrec *)fw->data;
+Index: linux/drivers/atm/fore200e.c
+===================================================================
+--- linux.orig/drivers/atm/fore200e.c
++++ linux/drivers/atm/fore200e.c
+@@ -2505,10 +2505,9 @@ static int fore200e_load_and_start_fw(st
+ return err;
+
+ sprintf(buf, "%s%s", fore200e->bus->proc_name, FW_EXT);
+- if ((err = request_firmware(&firmware, buf, device)) < 0) {
+- printk(FORE200E "problem loading firmware image %s\n", fore200e->bus->model_name);
++ err = request_firmware(&firmware, buf, device);
++ if (err)
+ return err;
+- }
+
+ fw_data = (const __le32 *)firmware->data;
+ fw_size = firmware->size / sizeof(u32);
+Index: linux/drivers/bluetooth/ath3k.c
+===================================================================
+--- linux.orig/drivers/bluetooth/ath3k.c
++++ linux/drivers/bluetooth/ath3k.c
+@@ -430,10 +430,8 @@ static int ath3k_load_patch(struct usb_d
+ le32_to_cpu(fw_version.rom_version));
+
+ ret = request_firmware(&firmware, filename, &udev->dev);
+- if (ret < 0) {
+- BT_ERR("Patch file not found %s", filename);
++ if (ret)
+ return ret;
+- }
+
+ pt_rom_version = get_unaligned_le32(firmware->data +
+ firmware->size - 8);
+@@ -493,10 +491,8 @@ static int ath3k_load_syscfg(struct usb_
+ le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
+
+ ret = request_firmware(&firmware, filename, &udev->dev);
+- if (ret < 0) {
+- BT_ERR("Configuration file not found %s", filename);
++ if (ret)
+ return ret;
+- }
+
+ ret = ath3k_load_fwfile(udev, firmware);
+ release_firmware(firmware);
+Index: linux/drivers/bluetooth/bcm203x.c
+===================================================================
+--- linux.orig/drivers/bluetooth/bcm203x.c
++++ linux/drivers/bluetooth/bcm203x.c
+@@ -189,7 +189,6 @@ static int bcm203x_probe(struct usb_inte
+ return -ENOMEM;
+
+ if (request_firmware(&firmware, "BCM2033-MD.hex", &udev->dev) < 0) {
+- BT_ERR("Mini driver request failed");
+ usb_free_urb(data->urb);
+ return -EIO;
+ }
+@@ -214,7 +213,6 @@ static int bcm203x_probe(struct usb_inte
+ release_firmware(firmware);
+
+ if (request_firmware(&firmware, "BCM2033-FW.bin", &udev->dev) < 0) {
+- BT_ERR("Firmware request failed");
+ usb_free_urb(data->urb);
+ kfree(data->buffer);
+ return -EIO;
+Index: linux/drivers/bluetooth/bfusb.c
+===================================================================
+--- linux.orig/drivers/bluetooth/bfusb.c
++++ linux/drivers/bluetooth/bfusb.c
+@@ -652,10 +652,8 @@ static int bfusb_probe(struct usb_interf
+ skb_queue_head_init(&data->pending_q);
+ skb_queue_head_init(&data->completed_q);
+
+- if (request_firmware(&firmware, "bfubase.frm", &udev->dev) < 0) {
+- BT_ERR("Firmware request failed");
++ if (request_firmware(&firmware, "bfubase.frm", &udev->dev))
+ goto done;
+- }
+
+ BT_DBG("firmware data %p size %zu", firmware->data, firmware->size);
+
+Index: linux/drivers/bluetooth/bt3c_cs.c
+===================================================================
+--- linux.orig/drivers/bluetooth/bt3c_cs.c
++++ linux/drivers/bluetooth/bt3c_cs.c
+@@ -566,10 +566,8 @@ static int bt3c_open(struct bt3c_info *i
+
+ /* Load firmware */
+ err = request_firmware(&firmware, "BT3CPCC.bin", &info->p_dev->dev);
+- if (err < 0) {
+- BT_ERR("Firmware request failed");
++ if (err)
+ goto error;
+- }
+
+ err = bt3c_load_firmware(info, firmware->data, firmware->size);
+
+Index: linux/drivers/bluetooth/btmrvl_sdio.c
+===================================================================
+--- linux.orig/drivers/bluetooth/btmrvl_sdio.c
++++ linux/drivers/bluetooth/btmrvl_sdio.c
+@@ -455,8 +455,6 @@ static int btmrvl_sdio_download_helper(s
+ ret = request_firmware(&fw_helper, card->helper,
+ &card->func->dev);
+ if ((ret < 0) || !fw_helper) {
+- BT_ERR("request_firmware(helper) failed, error code = %d",
+- ret);
+ ret = -ENOENT;
+ goto done;
+ }
+@@ -555,8 +553,6 @@ static int btmrvl_sdio_download_fw_w_hel
+ ret = request_firmware(&fw_firmware, card->firmware,
+ &card->func->dev);
+ if ((ret < 0) || !fw_firmware) {
+- BT_ERR("request_firmware(firmware) failed, error code = %d",
+- ret);
+ ret = -ENOENT;
+ goto done;
+ }
+Index: linux/drivers/char/dsp56k.c
+===================================================================
+--- linux.orig/drivers/char/dsp56k.c
++++ linux/drivers/char/dsp56k.c
+@@ -140,11 +140,8 @@ static int dsp56k_upload(u_char __user *
+ }
+ err = request_firmware(&fw, fw_name, &pdev->dev);
+ platform_device_unregister(pdev);
+- if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fw_name, err);
++ if (err)
+ return err;
+- }
+ if (fw->size % 3) {
+ printk(KERN_ERR "Bogus length %d in image \"%s\"\n",
+ fw->size, fw_name);
+Index: linux/drivers/dma/imx-sdma.c
+===================================================================
+--- linux.orig/drivers/dma/imx-sdma.c
++++ linux/drivers/dma/imx-sdma.c
+@@ -1674,11 +1674,8 @@ static void sdma_load_firmware(const str
+ const struct sdma_script_start_addrs *addr;
+ unsigned short *ram_code;
+
+- if (!fw) {
+- dev_info(sdma->dev, "external firmware not found, using ROM firmware\n");
+- /* In this case we just use the ROM firmware. */
++ if (!fw)
+ return;
+- }
+
+ if (fw->size < sizeof(*header))
+ goto err_firmware;
+Index: linux/drivers/gpu/drm/mga/mga_warp.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/mga/mga_warp.c
++++ linux/drivers/gpu/drm/mga/mga_warp.c
+@@ -79,11 +79,8 @@ int mga_warp_install_microcode(drm_mga_p
+ }
+ rc = request_ihex_firmware(&fw, firmware_name, &pdev->dev);
+ platform_device_unregister(pdev);
+- if (rc) {
+- DRM_ERROR("mga: Failed to load microcode \"%s\"\n",
+- firmware_name);
++ if (rc)
+ return rc;
+- }
+
+ size = 0;
+ where = 0;
+Index: linux/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
++++ linux/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
+@@ -1920,10 +1920,8 @@ gf100_gr_ctor_fw_legacy(struct gf100_gr
+ if (ret) {
+ snprintf(f, sizeof(f), "nouveau/%s", fwname);
+ ret = request_firmware(&fw, f, device->dev);
+- if (ret) {
+- nvkm_error(subdev, "failed to load %s\n", fwname);
++ if (ret)
+ return ret;
+- }
+ }
+
+ fuc->size = fw->size;
+Index: linux/drivers/gpu/drm/r128/r128_cce.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/r128/r128_cce.c
++++ linux/drivers/gpu/drm/r128/r128_cce.c
+@@ -154,11 +154,8 @@ static int r128_cce_load_microcode(drm_r
+ }
+ rc = request_firmware(&fw, FIRMWARE_NAME, &pdev->dev);
+ platform_device_unregister(pdev);
+- if (rc) {
+- pr_err("r128_cce: Failed to load firmware \"%s\"\n",
+- FIRMWARE_NAME);
++ if (rc)
+ return rc;
+- }
+
+ if (fw->size != 256 * 8) {
+ pr_err("r128_cce: Bogus length %zu in firmware \"%s\"\n",
+Index: linux/drivers/gpu/drm/radeon/ni.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/radeon/ni.c
++++ linux/drivers/gpu/drm/radeon/ni.c
+@@ -830,9 +830,6 @@ int ni_init_microcode(struct radeon_devi
+
+ out:
+ if (err) {
+- if (err != -EINVAL)
+- pr_err("ni_cp: Failed to load firmware \"%s\"\n",
+- fw_name);
+ release_firmware(rdev->pfp_fw);
+ rdev->pfp_fw = NULL;
+ release_firmware(rdev->me_fw);
+Index: linux/drivers/gpu/drm/radeon/r100.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/radeon/r100.c
++++ linux/drivers/gpu/drm/radeon/r100.c
+@@ -1041,9 +1041,7 @@ static int r100_cp_init_microcode(struct
+ }
+
+ err = request_firmware(&rdev->me_fw, fw_name, rdev->dev);
+- if (err) {
+- pr_err("radeon_cp: Failed to load firmware \"%s\"\n", fw_name);
+- } else if (rdev->me_fw->size % 8) {
++ if (err == 0 && rdev->me_fw->size % 8) {
+ pr_err("radeon_cp: Bogus length %zu in firmware \"%s\"\n",
+ rdev->me_fw->size, fw_name);
+ err = -EINVAL;
+Index: linux/drivers/gpu/drm/radeon/r600.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/radeon/r600.c
++++ linux/drivers/gpu/drm/radeon/r600.c
+@@ -2593,9 +2593,6 @@ int r600_init_microcode(struct radeon_de
+
+ out:
+ if (err) {
+- if (err != -EINVAL)
+- pr_err("r600_cp: Failed to load firmware \"%s\"\n",
+- fw_name);
+ release_firmware(rdev->pfp_fw);
+ rdev->pfp_fw = NULL;
+ release_firmware(rdev->me_fw);
+Index: linux/drivers/infiniband/hw/qib/qib_sd7220.c
+===================================================================
+--- linux.orig/drivers/infiniband/hw/qib/qib_sd7220.c
++++ linux/drivers/infiniband/hw/qib/qib_sd7220.c
+@@ -406,10 +406,8 @@ int qib_sd7220_init(struct qib_devdata *
+ }
+
+ ret = request_firmware(&fw, SD7220_FW_NAME, &dd->pcidev->dev);
+- if (ret) {
+- qib_dev_err(dd, "Failed to load IB SERDES image\n");
++ if (ret)
+ goto done;
+- }
+
+ /* Substitute our deduced value for was_reset */
+ ret = qib_ibsd_ucode_loaded(dd->pport, fw);
+Index: linux/drivers/input/touchscreen/atmel_mxt_ts.c
+===================================================================
+--- linux.orig/drivers/input/touchscreen/atmel_mxt_ts.c
++++ linux/drivers/input/touchscreen/atmel_mxt_ts.c
+@@ -2783,10 +2783,8 @@ static int mxt_load_fw(struct device *de
+ int ret;
+
+ ret = request_firmware(&fw, fn, dev);
+- if (ret) {
+- dev_err(dev, "Unable to open firmware %s\n", fn);
++ if (ret)
+ return ret;
+- }
+
+ /* Check for incorrect enc file */
+ ret = mxt_check_firmware_format(dev, fw);
+Index: linux/drivers/isdn/hardware/mISDN/speedfax.c
+===================================================================
+--- linux.orig/drivers/isdn/hardware/mISDN/speedfax.c
++++ linux/drivers/isdn/hardware/mISDN/speedfax.c
+@@ -392,11 +392,8 @@ setup_instance(struct sfax_hw *card)
+ card->isar.owner = THIS_MODULE;
+
+ err = request_firmware(&firmware, "isdn/ISAR.BIN", &card->pdev->dev);
+- if (err < 0) {
+- pr_info("%s: firmware request failed %d\n",
+- card->name, err);
++ if (err)
+ goto error_fw;
+- }
+ if (debug & DEBUG_HW)
+ pr_notice("%s: got firmware %zu bytes\n",
+ card->name, firmware->size);
+Index: linux/drivers/media/tuners/tuner-xc2028.c
+===================================================================
+--- linux.orig/drivers/media/tuners/tuner-xc2028.c
++++ linux/drivers/media/tuners/tuner-xc2028.c
+@@ -1367,7 +1367,6 @@ static void load_firmware_cb(const struc
+
+ tuner_dbg("request_firmware_nowait(): %s\n", fw ? "OK" : "error");
+ if (!fw) {
+- tuner_err("Could not load firmware %s.\n", priv->fname);
+ priv->state = XC2028_NODEV;
+ return;
+ }
+Index: linux/drivers/media/usb/dvb-usb/dib0700_devices.c
+===================================================================
+--- linux.orig/drivers/media/usb/dvb-usb/dib0700_devices.c
++++ linux/drivers/media/usb/dvb-usb/dib0700_devices.c
+@@ -2416,12 +2416,9 @@ static int stk9090m_frontend_attach(stru
+
+ dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80);
+
+- if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) {
+- deb_info("%s: Upload failed. (file not found?)\n", __func__);
++ if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev))
+ return -ENODEV;
+- } else {
+- deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size);
+- }
++ deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size);
+ stk9090m_config.microcode_B_fe_size = state->frontend_firmware->size;
+ stk9090m_config.microcode_B_fe_buffer = state->frontend_firmware->data;
+
+@@ -2486,12 +2483,9 @@ static int nim9090md_frontend_attach(str
+ msleep(20);
+ dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
+
+- if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev)) {
+- deb_info("%s: Upload failed. (file not found?)\n", __func__);
++ if (request_firmware(&state->frontend_firmware, "dib9090.fw", &adap->dev->udev->dev))
+ return -EIO;
+- } else {
+- deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size);
+- }
++ deb_info("%s: firmware read %zu bytes.\n", __func__, state->frontend_firmware->size);
+ nim9090md_config[0].microcode_B_fe_size = state->frontend_firmware->size;
+ nim9090md_config[0].microcode_B_fe_buffer = state->frontend_firmware->data;
+ nim9090md_config[1].microcode_B_fe_size = state->frontend_firmware->size;
+Index: linux/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
+===================================================================
+--- linux.orig/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
++++ linux/drivers/media/usb/dvb-usb/dvb-usb-firmware.c
+@@ -89,13 +89,9 @@ int dvb_usb_download_firmware(struct usb
+ int ret;
+ const struct firmware *fw = NULL;
+
+- if ((ret = request_firmware(&fw, props->firmware, &udev->dev)) != 0) {
+- err("did not find the firmware file '%s' (status %d). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware",
+- props->firmware,ret);
++ ret = request_firmware(&fw, props->firmware, &udev->dev);
++ if (ret)
+ return ret;
+- }
+-
+- info("downloading firmware from file '%s'",props->firmware);
+
+ switch (props->usb_ctrl) {
+ case CYPRESS_AN2135:
+Index: linux/drivers/media/usb/dvb-usb/gp8psk.c
+===================================================================
+--- linux.orig/drivers/media/usb/dvb-usb/gp8psk.c
++++ linux/drivers/media/usb/dvb-usb/gp8psk.c
+@@ -134,19 +134,14 @@ static int gp8psk_load_bcm4500fw(struct
+ const u8 *ptr;
+ u8 *buf;
+ if ((ret = request_firmware(&fw, bcm4500_firmware,
+- &d->udev->dev)) != 0) {
+- err("did not find the bcm4500 firmware file '%s' (status %d). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware",
+- bcm4500_firmware,ret);
++ &d->udev->dev)) != 0)
+ return ret;
+- }
+
+ ret = -EINVAL;
+
+ if (gp8psk_usb_out_op(d, LOAD_BCM4500,1,0,NULL, 0))
+ goto out_rel_fw;
+
+- info("downloading bcm4500 firmware from file '%s'",bcm4500_firmware);
+-
+ ptr = fw->data;
+ buf = kmalloc(64, GFP_KERNEL);
+ if (!buf) {
+Index: linux/drivers/media/usb/dvb-usb/opera1.c
+===================================================================
+--- linux.orig/drivers/media/usb/dvb-usb/opera1.c
++++ linux/drivers/media/usb/dvb-usb/opera1.c
+@@ -453,8 +453,6 @@ static int opera1_xilinx_load_firmware(s
+ info("start downloading fpga firmware %s",filename);
+
+ if ((ret = request_firmware(&fw, filename, &dev->dev)) != 0) {
+- err("did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware",
+- filename);
+ return ret;
+ } else {
+ p = kmalloc(fw->size, GFP_KERNEL);
+Index: linux/drivers/media/dvb-frontends/af9013.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/af9013.c
++++ linux/drivers/media/dvb-frontends/af9013.c
+@@ -1059,14 +1059,8 @@ static int af9013_download_firmware(stru
+
+ /* Request the firmware, will block and timeout */
+ ret = request_firmware(&firmware, name, &client->dev);
+- if (ret) {
+- dev_info(&client->dev, "firmware file '%s' not found %d\n",
+- name, ret);
++ if (ret)
+ goto err;
+- }
+-
+- dev_info(&client->dev, "downloading firmware from file '%s'\n",
+- name);
+
+ /* Write firmware checksum & size */
+ for (i = 0; i < firmware->size; i++)
+Index: linux/drivers/media/dvb-frontends/bcm3510.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/bcm3510.c
++++ linux/drivers/media/dvb-frontends/bcm3510.c
+@@ -636,10 +636,9 @@ static int bcm3510_download_firmware(str
+ int ret,i;
+
+ deb_info("requesting firmware\n");
+- if ((ret = st->config->request_firmware(fe, &fw, BCM3510_DEFAULT_FIRMWARE)) < 0) {
+- err("could not load firmware (%s): %d",BCM3510_DEFAULT_FIRMWARE,ret);
++ ret = st->config->request_firmware(fe, &fw, BCM3510_DEFAULT_FIRMWARE);
++ if (ret)
+ return ret;
+- }
+ deb_info("got firmware: %zu\n", fw->size);
+
+ b = fw->data;
+Index: linux/drivers/media/dvb-frontends/cx24116.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/cx24116.c
++++ linux/drivers/media/dvb-frontends/cx24116.c
+@@ -491,13 +491,8 @@ static int cx24116_firmware_ondemand(str
+ __func__, CX24116_DEFAULT_FIRMWARE);
+ ret = request_firmware(&fw, CX24116_DEFAULT_FIRMWARE,
+ state->i2c->dev.parent);
+- printk(KERN_INFO "%s: Waiting for firmware upload(2)...\n",
+- __func__);
+- if (ret) {
+- printk(KERN_ERR "%s: No firmware uploaded (timeout or file not found?)\n",
+- __func__);
++ if (ret)
+ return ret;
+- }
+
+ /* Make sure we don't recurse back through here
+ * during loading */
+Index: linux/drivers/media/dvb-frontends/drxd_hard.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/drxd_hard.c
++++ linux/drivers/media/dvb-frontends/drxd_hard.c
+@@ -903,10 +903,8 @@ static int load_firmware(struct drxd_sta
+ {
+ const struct firmware *fw;
+
+- if (request_firmware(&fw, fw_name, state->dev) < 0) {
+- printk(KERN_ERR "drxd: firmware load failure [%s]\n", fw_name);
++ if (request_firmware(&fw, fw_name, state->dev))
+ return -EIO;
+- }
+
+ state->microcode = kmemdup(fw->data, fw->size, GFP_KERNEL);
+ if (!state->microcode) {
+Index: linux/drivers/media/dvb-frontends/drxk_hard.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/drxk_hard.c
++++ linux/drivers/media/dvb-frontends/drxk_hard.c
+@@ -6281,10 +6281,6 @@ static void load_firmware_cb(const struc
+
+ dprintk(1, ": %s\n", fw ? "firmware loaded" : "firmware not loaded");
+ if (!fw) {
+- pr_err("Could not load firmware file %s.\n",
+- state->microcode_name);
+- pr_info("Copy %s to your hotplug directory!\n",
+- state->microcode_name);
+ state->microcode_name = NULL;
+
+ /*
+Index: linux/drivers/media/dvb-frontends/ds3000.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/ds3000.c
++++ linux/drivers/media/dvb-frontends/ds3000.c
+@@ -360,12 +360,8 @@ static int ds3000_firmware_ondemand(stru
+ DS3000_DEFAULT_FIRMWARE);
+ ret = request_firmware(&fw, DS3000_DEFAULT_FIRMWARE,
+ state->i2c->dev.parent);
+- printk(KERN_INFO "%s: Waiting for firmware upload(2)...\n", __func__);
+- if (ret) {
+- printk(KERN_ERR "%s: No firmware uploaded (timeout or file not found?)\n",
+- __func__);
++ if (ret)
+ return ret;
+- }
+
+ ret = ds3000_load_firmware(fe, fw);
+ if (ret)
+Index: linux/drivers/media/dvb-frontends/nxt200x.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/nxt200x.c
++++ linux/drivers/media/dvb-frontends/nxt200x.c
+@@ -886,12 +886,8 @@ static int nxt2002_init(struct dvb_front
+ __func__, NXT2002_DEFAULT_FIRMWARE);
+ ret = request_firmware(&fw, NXT2002_DEFAULT_FIRMWARE,
+ state->i2c->dev.parent);
+- pr_debug("%s: Waiting for firmware upload(2)...\n", __func__);
+- if (ret) {
+- pr_err("%s: No firmware uploaded (timeout or file not found?)\n",
+- __func__);
++ if (ret)
+ return ret;
+- }
+
+ ret = nxt2002_load_firmware(fe, fw);
+ release_firmware(fw);
+@@ -953,12 +949,8 @@ static int nxt2004_init(struct dvb_front
+ __func__, NXT2004_DEFAULT_FIRMWARE);
+ ret = request_firmware(&fw, NXT2004_DEFAULT_FIRMWARE,
+ state->i2c->dev.parent);
+- pr_debug("%s: Waiting for firmware upload(2)...\n", __func__);
+- if (ret) {
+- pr_err("%s: No firmware uploaded (timeout or file not found?)\n",
+- __func__);
++ if (ret)
+ return ret;
+- }
+
+ ret = nxt2004_load_firmware(fe, fw);
+ release_firmware(fw);
+Index: linux/drivers/media/dvb-frontends/or51132.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/or51132.c
++++ linux/drivers/media/dvb-frontends/or51132.c
+@@ -337,10 +337,8 @@ static int or51132_set_parameters(struct
+ printk("or51132: Waiting for firmware upload(%s)...\n",
+ fwname);
+ ret = request_firmware(&fw, fwname, state->i2c->dev.parent);
+- if (ret) {
+- printk(KERN_WARNING "or51132: No firmware uploaded(timeout or file not found?)\n");
++ if (ret)
+ return ret;
+- }
+ ret = or51132_load_firmware(fe, fw);
+ release_firmware(fw);
+ if (ret) {
+Index: linux/drivers/media/dvb-frontends/or51211.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/or51211.c
++++ linux/drivers/media/dvb-frontends/or51211.c
+@@ -371,11 +371,8 @@ static int or51211_init(struct dvb_front
+ OR51211_DEFAULT_FIRMWARE);
+ ret = config->request_firmware(fe, &fw,
+ OR51211_DEFAULT_FIRMWARE);
+- pr_info("Got Hotplug firmware\n");
+- if (ret) {
+- pr_warn("No firmware uploaded (timeout or file not found?)\n");
++ if (ret)
+ return ret;
+- }
+
+ ret = or51211_load_firmware(fe, fw);
+ release_firmware(fw);
+Index: linux/drivers/media/dvb-frontends/sp8870.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/sp8870.c
++++ linux/drivers/media/dvb-frontends/sp8870.c
+@@ -315,10 +315,8 @@ static int sp8870_init (struct dvb_front
+
+ /* request the firmware, this will block until someone uploads it */
+ printk("sp8870: waiting for firmware upload (%s)...\n", SP8870_DEFAULT_FIRMWARE);
+- if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE)) {
+- printk("sp8870: no firmware upload (timeout or file not found?)\n");
++ if (state->config->request_firmware(fe, &fw, SP8870_DEFAULT_FIRMWARE))
+ return -EIO;
+- }
+
+ if (sp8870_firmware_upload(state, fw)) {
+ printk("sp8870: writing firmware to device failed\n");
+Index: linux/drivers/media/dvb-frontends/sp887x.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/sp887x.c
++++ linux/drivers/media/dvb-frontends/sp887x.c
+@@ -526,10 +526,8 @@ static int sp887x_init(struct dvb_fronte
+ /* request the firmware, this will block until someone uploads it */
+ printk("sp887x: waiting for firmware upload (%s)...\n", SP887X_DEFAULT_FIRMWARE);
+ ret = state->config->request_firmware(fe, &fw, SP887X_DEFAULT_FIRMWARE);
+- if (ret) {
+- printk("sp887x: no firmware upload (timeout or file not found?)\n");
++ if (ret)
+ return ret;
+- }
+
+ ret = sp887x_initial_setup(fe, fw);
+ release_firmware(fw);
+Index: linux/drivers/media/dvb-frontends/tda10048.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/tda10048.c
++++ linux/drivers/media/dvb-frontends/tda10048.c
+@@ -495,8 +495,6 @@ static int tda10048_firmware_upload(stru
+ ret = request_firmware(&fw, TDA10048_DEFAULT_FIRMWARE,
+ state->i2c->dev.parent);
+ if (ret) {
+- printk(KERN_ERR "%s: Upload failed. (file not found?)\n",
+- __func__);
+ return -EIO;
+ } else {
+ printk(KERN_INFO "%s: firmware read %zu bytes.\n",
+Index: linux/drivers/media/dvb-frontends/tda1004x.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/tda1004x.c
++++ linux/drivers/media/dvb-frontends/tda1004x.c
+@@ -401,10 +401,8 @@ static int tda10045_fwupload(struct dvb_
+ /* request the firmware, this will block until someone uploads it */
+ printk(KERN_INFO "tda1004x: waiting for firmware upload (%s)...\n", TDA10045_DEFAULT_FIRMWARE);
+ ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE);
+- if (ret) {
+- printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");
++ if (ret)
+ return ret;
+- }
+
+ /* reset chip */
+ tda1004x_write_mask(state, TDA1004X_CONFC4, 0x10, 0);
+@@ -545,7 +543,6 @@ static int tda10046_fwupload(struct dvb_
+ /* remain compatible to old bug: try to load with tda10045 image name */
+ ret = state->config->request_firmware(fe, &fw, TDA10045_DEFAULT_FIRMWARE);
+ if (ret) {
+- printk(KERN_ERR "tda1004x: no firmware upload (timeout or file not found?)\n");
+ return ret;
+ } else {
+ printk(KERN_INFO "tda1004x: please rename the firmware file to %s\n",
+Index: linux/drivers/media/dvb-frontends/tda10071.c
+===================================================================
+--- linux.orig/drivers/media/dvb-frontends/tda10071.c
++++ linux/drivers/media/dvb-frontends/tda10071.c
+@@ -850,12 +850,8 @@ static int tda10071_init(struct dvb_fron
+
+ /* request the firmware, this will block and timeout */
+ ret = request_firmware(&fw, fw_file, &client->dev);
+- if (ret) {
+- dev_err(&client->dev,
+- "did not find the firmware file '%s' (status %d). You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware\n",
+- fw_file, ret);
++ if (ret)
+ goto error;
+- }
+
+ /* init */
+ for (i = 0; i < ARRAY_SIZE(tab2); i++) {
+Index: linux/drivers/media/pci/ngene/ngene-core.c
+===================================================================
+--- linux.orig/drivers/media/pci/ngene/ngene-core.c
++++ linux/drivers/media/pci/ngene/ngene-core.c
+@@ -1253,19 +1253,14 @@ static int ngene_load_firm(struct ngene
+ break;
+ }
+
+- if (request_firmware(&fw, fw_name, &dev->pci_dev->dev) < 0) {
+- dev_err(pdev, "Could not load firmware file %s.\n", fw_name);
+- dev_info(pdev, "Copy %s to your hotplug directory!\n",
+- fw_name);
++ if (request_firmware(&fw, fw_name, &dev->pci_dev->dev))
+ return -1;
+- }
+ if (size == 0)
+ size = fw->size;
+ if (size != fw->size) {
+ dev_err(pdev, "Firmware %s has invalid size!", fw_name);
+ err = -1;
+ } else {
+- dev_info(pdev, "Loading firmware file %s.\n", fw_name);
+ ngene_fw = (u8 *) fw->data;
+ err = ngene_command_load_firmware(dev, ngene_fw, size);
+ }
+Index: linux/drivers/media/common/siano/smscoreapi.c
+===================================================================
+--- linux.orig/drivers/media/common/siano/smscoreapi.c
++++ linux/drivers/media/common/siano/smscoreapi.c
+@@ -1164,10 +1164,8 @@ static int smscore_load_firmware_from_fi
+ return -EINVAL;
+
+ rc = request_firmware(&fw, fw_filename, coredev->device);
+- if (rc < 0) {
+- pr_err("failed to open firmware file '%s'\n", fw_filename);
++ if (rc < 0)
+ return rc;
+- }
+ pr_debug("read fw %s, buffer size=0x%zx\n", fw_filename, fw->size);
+ fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware),
+ SMS_ALLOC_ALIGNMENT), GFP_KERNEL | coredev->gfp_buf_flags);
+Index: linux/drivers/media/pci/ttpci/av7110.c
+===================================================================
+--- linux.orig/drivers/media/pci/ttpci/av7110.c
++++ linux/drivers/media/pci/ttpci/av7110.c
+@@ -1516,13 +1516,8 @@ static int get_firmware(struct av7110* a
+ /* request the av7110 firmware, this will block until someone uploads it */
+ ret = request_firmware(&fw, "dvb-ttpci-01.fw", &av7110->dev->pci->dev);
+ if (ret) {
+- if (ret == -ENOENT) {
+- printk(KERN_ERR "dvb-ttpci: could not load firmware, file not found: dvb-ttpci-01.fw\n");
+- printk(KERN_ERR "dvb-ttpci: usually this should be in /usr/lib/hotplug/firmware or /lib/firmware\n");
+- printk(KERN_ERR "dvb-ttpci: and can be downloaded from https://linuxtv.org/download/dvb/firmware/\n");
+- } else
+- printk(KERN_ERR "dvb-ttpci: cannot request firmware (error %i)\n",
+- ret);
++ if (ret == -ENOENT)
++ printk(KERN_ERR "dvb-ttpci: firmware can be downloaded from https://linuxtv.org/download/dvb/firmware/\n");
+ return -EINVAL;
+ }
+
+Index: linux/drivers/media/pci/ttpci/av7110_hw.c
+===================================================================
+--- linux.orig/drivers/media/pci/ttpci/av7110_hw.c
++++ linux/drivers/media/pci/ttpci/av7110_hw.c
+@@ -247,11 +247,8 @@ int av7110_bootarm(struct av7110 *av7110
+ //saa7146_setgpio(dev, 3, SAA7146_GPIO_INPUT);
+
+ ret = request_firmware(&fw, fw_name, &dev->pci->dev);
+- if (ret) {
+- printk(KERN_ERR "dvb-ttpci: Failed to load firmware \"%s\"\n",
+- fw_name);
++ if (ret)
+ return ret;
+- }
+
+ mwdebi(av7110, DEBISWAB, DPRAM_BASE, fw->data, fw->size);
+ release_firmware(fw);
+Index: linux/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
+===================================================================
+--- linux.orig/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
++++ linux/drivers/media/usb/ttusb-budget/dvb-ttusb-budget.c
+@@ -295,10 +295,8 @@ static int ttusb_boot_dsp(struct ttusb *
+
+ err = request_firmware(&fw, "ttusb-budget/dspbootcode.bin",
+ &ttusb->dev->dev);
+- if (err) {
+- printk(KERN_ERR "ttusb-budget: failed to request firmware\n");
++ if (err)
+ return err;
+- }
+
+ /* BootBlock */
+ b[0] = 0xaa;
+Index: linux/drivers/media/usb/ttusb-dec/ttusb_dec.c
+===================================================================
+--- linux.orig/drivers/media/usb/ttusb-dec/ttusb_dec.c
++++ linux/drivers/media/usb/ttusb-dec/ttusb_dec.c
+@@ -1334,11 +1334,8 @@ static int ttusb_dec_boot_dsp(struct ttu
+ dprintk("%s\n", __func__);
+
+ result = request_firmware(&fw_entry, dec->firmware_name, &dec->udev->dev);
+- if (result) {
+- printk(KERN_ERR "%s: Firmware (%s) unavailable.\n",
+- __func__, dec->firmware_name);
++ if (result)
+ return result;
+- }
+
+ firmware = fw_entry->data;
+ firmware_size = fw_entry->size;
+Index: linux/drivers/media/radio/radio-wl1273.c
+===================================================================
+--- linux.orig/drivers/media/radio/radio-wl1273.c
++++ linux/drivers/media/radio/radio-wl1273.c
+@@ -510,11 +510,8 @@ static int wl1273_fm_upload_firmware_pat
+ * Uploading the firmware patch is not always necessary,
+ * so we only print an info message.
+ */
+- if (request_firmware(&fw_p, fw_name, dev)) {
+- dev_info(dev, "%s - %s not found\n", __func__, fw_name);
+-
++ if (request_firmware(&fw_p, fw_name, dev))
+ return 0;
+- }
+
+ ptr = (__u8 *) fw_p->data;
+ packet_num = ptr[0];
+Index: linux/drivers/media/radio/wl128x/fmdrv_common.c
+===================================================================
+--- linux.orig/drivers/media/radio/wl128x/fmdrv_common.c
++++ linux/drivers/media/radio/wl128x/fmdrv_common.c
+@@ -1245,10 +1245,8 @@ static int fm_download_firmware(struct f
+
+ ret = request_firmware(&fw_entry, fw_name,
+ &fmdev->radio_dev->dev);
+- if (ret < 0) {
+- fmerr("Unable to read firmware(%s) content\n", fw_name);
++ if (ret)
+ return ret;
+- }
+ fmdbg("Firmware(%s) length : %zu bytes\n", fw_name, fw_entry->size);
+
+ fw_data = (void *)fw_entry->data;
+Index: linux/drivers/media/pci/bt8xx/bttv-cards.c
+===================================================================
+--- linux.orig/drivers/media/pci/bt8xx/bttv-cards.c
++++ linux/drivers/media/pci/bt8xx/bttv-cards.c
+@@ -3916,10 +3916,8 @@ static int pvr_boot(struct bttv *btv)
+ int rc;
+
+ rc = request_firmware(&fw_entry, "hcwamc.rbf", &btv->c.pci->dev);
+- if (rc != 0) {
+- pr_warn("%d: no altera firmware [via hotplug]\n", btv->c.nr);
++ if (rc != 0)
+ return rc;
+- }
+ rc = pvr_altera_load(btv, fw_entry->data, fw_entry->size);
+ pr_info("%d: altera firmware upload %s\n",
+ btv->c.nr, (rc < 0) ? "failed" : "ok");
+Index: linux/drivers/media/usb/cpia2/cpia2_core.c
+===================================================================
+--- linux.orig/drivers/media/usb/cpia2/cpia2_core.c
++++ linux/drivers/media/usb/cpia2/cpia2_core.c
+@@ -921,11 +921,8 @@ static int apply_vp_patch(struct camera_
+ struct cpia2_command cmd;
+
+ ret = request_firmware(&fw, fw_name, &cam->dev->dev);
+- if (ret) {
+- printk(KERN_ERR "cpia2: failed to load VP patch \"%s\"\n",
+- fw_name);
++ if (ret)
+ return ret;
+- }
+
+ cmd.req_mode = CAMERAACCESS_TYPE_REPEAT | CAMERAACCESS_VP;
+ cmd.direction = TRANSFER_WRITE;
+Index: linux/drivers/media/pci/cx18/cx18-av-firmware.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx18/cx18-av-firmware.c
++++ linux/drivers/media/pci/cx18/cx18-av-firmware.c
+@@ -79,10 +79,8 @@ int cx18_av_loadfw(struct cx18 *cx)
+ int i;
+ int retries1 = 0;
+
+- if (request_firmware(&fw, FWFILE, &cx->pci_dev->dev) != 0) {
+- CX18_ERR_DEV(sd, "unable to open firmware %s\n", FWFILE);
++ if (request_firmware(&fw, FWFILE, &cx->pci_dev->dev) != 0)
+ return -EINVAL;
+- }
+
+ /* The firmware load often has byte errors, so allow for several
+ retries, both at byte level and at the firmware load level. */
+Index: linux/drivers/media/pci/cx18/cx18-dvb.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx18/cx18-dvb.c
++++ linux/drivers/media/pci/cx18/cx18-dvb.c
+@@ -137,9 +137,7 @@ static int yuan_mpc718_mt352_reqfw(struc
+ int ret;
+
+ ret = request_firmware(fw, fn, &cx->pci_dev->dev);
+- if (ret)
+- CX18_ERR("Unable to open firmware file %s\n", fn);
+- else {
++ if (!ret) {
+ size_t sz = (*fw)->size;
+ if (sz < 2 || sz > 64 || (sz % 2) != 0) {
+ CX18_ERR("Firmware %s has a bad size: %lu bytes\n",
+Index: linux/drivers/media/pci/cx18/cx18-firmware.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx18/cx18-firmware.c
++++ linux/drivers/media/pci/cx18/cx18-firmware.c
+@@ -101,11 +101,8 @@ static int load_cpu_fw_direct(const char
+ u32 __iomem *dst = (u32 __iomem *)mem;
+ const u32 *src;
+
+- if (request_firmware(&fw, fn, &cx->pci_dev->dev)) {
+- CX18_ERR("Unable to open firmware %s\n", fn);
+- CX18_ERR("Did you put the firmware in the hotplug firmware directory?\n");
++ if (request_firmware(&fw, fn, &cx->pci_dev->dev))
+ return -ENOMEM;
+- }
+
+ src = (const u32 *)fw->data;
+
+@@ -146,8 +143,6 @@ static int load_apu_fw_direct(const char
+ int sz;
+
+ if (request_firmware(&fw, fn, &cx->pci_dev->dev)) {
+- CX18_ERR("unable to open firmware %s\n", fn);
+- CX18_ERR("did you put the firmware in the hotplug firmware directory?\n");
+ cx18_setup_page(cx, 0);
+ return -ENOMEM;
+ }
+Index: linux/drivers/media/usb/cx231xx/cx231xx-417.c
+===================================================================
+--- linux.orig/drivers/media/usb/cx231xx/cx231xx-417.c
++++ linux/drivers/media/usb/cx231xx/cx231xx-417.c
+@@ -996,11 +996,6 @@ static int cx231xx_load_firmware(struct
+ dev->dev);
+
+ if (retval != 0) {
+- dev_err(dev->dev,
+- "ERROR: Hotplug firmware request failed (%s).\n",
+- CX231xx_FIRM_IMAGE_NAME);
+- dev_err(dev->dev,
+- "Please fix your hotplug setup, the board will not work without firmware loaded!\n");
+ vfree(p_current_fw);
+ vfree(p_buffer);
+ return retval;
+Index: linux/drivers/media/pci/cx23885/cx23885-417.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx23885/cx23885-417.c
++++ linux/drivers/media/pci/cx23885/cx23885-417.c
+@@ -929,12 +929,8 @@ static int cx23885_load_firmware(struct
+ retval = request_firmware(&firmware, CX23885_FIRM_IMAGE_NAME,
+ &dev->pci->dev);
+
+- if (retval != 0) {
+- pr_err("ERROR: Hotplug firmware request failed (%s).\n",
+- CX23885_FIRM_IMAGE_NAME);
+- pr_err("Please fix your hotplug setup, the board will not work without firmware loaded!\n");
++ if (retval != 0)
+ return -1;
+- }
+
+ if (firmware->size != CX23885_FIRM_IMAGE_SIZE) {
+ pr_err("ERROR: Firmware size mismatch (have %zu, expected %d)\n",
+Index: linux/drivers/media/pci/cx23885/cx23885-cards.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx23885/cx23885-cards.c
++++ linux/drivers/media/pci/cx23885/cx23885-cards.c
+@@ -2425,10 +2425,7 @@ void cx23885_card_setup(struct cx23885_d
+ cinfo.rev, filename);
+
+ ret = request_firmware(&fw, filename, &dev->pci->dev);
+- if (ret != 0)
+- pr_err("did not find the firmware file '%s'. You can use <kernel_dir>/scripts/get_dvb_firmware to get the firmware.",
+- filename);
+- else
++ if (ret == 0)
+ altera_init(&netup_config, fw);
+
+ release_firmware(fw);
+Index: linux/drivers/media/i2c/cx25840/cx25840-firmware.c
+===================================================================
+--- linux.orig/drivers/media/i2c/cx25840/cx25840-firmware.c
++++ linux/drivers/media/i2c/cx25840/cx25840-firmware.c
+@@ -122,10 +122,8 @@ int cx25840_loadfw(struct i2c_client *cl
+ if (is_cx231xx(state) && max_buf_size > 16)
+ max_buf_size = 16;
+
+- if (request_firmware(&fw, fwname, FWDEV(client)) != 0) {
+- v4l_err(client, "unable to open firmware %s\n", fwname);
++ if (request_firmware(&fw, fwname, FWDEV(client)) != 0)
+ return -EINVAL;
+- }
+
+ start_fw_load(client);
+
+Index: linux/drivers/media/pci/cx88/cx88-blackbird.c
+===================================================================
+--- linux.orig/drivers/media/pci/cx88/cx88-blackbird.c
++++ linux/drivers/media/pci/cx88/cx88-blackbird.c
+@@ -471,12 +471,8 @@ static int blackbird_load_firmware(struc
+ retval = request_firmware(&firmware, CX2341X_FIRM_ENC_FILENAME,
+ &dev->pci->dev);
+
+- if (retval != 0) {
+- pr_err("Hotplug firmware request failed (%s).\n",
+- CX2341X_FIRM_ENC_FILENAME);
+- pr_err("Please fix your hotplug setup, the board will not work without firmware loaded!\n");
++ if (retval != 0)
+ return -EIO;
+- }
+
+ if (firmware->size != BLACKBIRD_FIRM_IMAGE_SIZE) {
+ pr_err("Firmware size mismatch (have %zd, expected %d)\n",
+Index: linux/drivers/media/usb/gspca/vicam.c
+===================================================================
+--- linux.orig/drivers/media/usb/gspca/vicam.c
++++ linux/drivers/media/usb/gspca/vicam.c
+@@ -239,10 +239,8 @@ static int sd_init(struct gspca_dev *gsp
+
+ ret = request_ihex_firmware(&fw, VICAM_FIRMWARE,
+ &gspca_dev->dev->dev);
+- if (ret) {
+- pr_err("Failed to load \"vicam/firmware.fw\": %d\n", ret);
++ if (ret)
+ return ret;
+- }
+
+ firmware_buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
+ if (!firmware_buf) {
+Index: linux/drivers/media/pci/ivtv/ivtv-firmware.c
+===================================================================
+--- linux.orig/drivers/media/pci/ivtv/ivtv-firmware.c
++++ linux/drivers/media/pci/ivtv/ivtv-firmware.c
+@@ -80,8 +80,6 @@ retry:
+ release_firmware(fw);
+ return size;
+ }
+- IVTV_ERR("Unable to open firmware %s (must be %ld bytes)\n", fn, size);
+- IVTV_ERR("Did you put the firmware in the hotplug firmware directory?\n");
+ return -ENOMEM;
+ }
+
+Index: linux/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+===================================================================
+--- linux.orig/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
++++ linux/drivers/media/usb/pvrusb2/pvrusb2-hdw.c
+@@ -1379,25 +1379,6 @@ static int pvr2_locate_firmware(struct p
+ "request_firmware fatal error with code=%d",ret);
+ return ret;
+ }
+- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+- "***WARNING*** Device %s firmware seems to be missing.",
+- fwtypename);
+- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+- "Did you install the pvrusb2 firmware files in their proper location?");
+- if (fwcount == 1) {
+- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+- "request_firmware unable to locate %s file %s",
+- fwtypename,fwnames[0]);
+- } else {
+- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+- "request_firmware unable to locate one of the following %s files:",
+- fwtypename);
+- for (idx = 0; idx < fwcount; idx++) {
+- pvr2_trace(PVR2_TRACE_ERROR_LEGS,
+- "request_firmware: Failed to find %s",
+- fwnames[idx]);
+- }
+- }
+ return ret;
+ }
+
+Index: linux/drivers/media/usb/s2255/s2255drv.c
+===================================================================
+--- linux.orig/drivers/media/usb/s2255/s2255drv.c
++++ linux/drivers/media/usb/s2255/s2255drv.c
+@@ -2298,10 +2298,8 @@ static int s2255_probe(struct usb_interf
+ }
+ /* load the first chunk */
+ if (request_firmware(&dev->fw_data->fw,
+- FIRMWARE_FILE_NAME, &dev->udev->dev)) {
+- dev_err(&interface->dev, "sensoray 2255 failed to get firmware\n");
++ FIRMWARE_FILE_NAME, &dev->udev->dev))
+ goto errorREQFW;
+- }
+ /* check the firmware is valid */
+ fw_size = dev->fw_data->fw->size;
+ pdata = (__le32 *) &dev->fw_data->fw->data[fw_size - 8];
+Index: linux/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
+===================================================================
+--- linux.orig/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
++++ linux/drivers/media/platform/s5p-mfc/s5p_mfc_ctrl.c
+@@ -69,10 +69,8 @@ int s5p_mfc_load_firmware(struct s5p_mfc
+ }
+ }
+
+- if (err != 0) {
+- mfc_err("Firmware is not present in the /lib/firmware directory nor compiled in kernel\n");
++ if (err != 0)
+ return -EINVAL;
+- }
+ if (fw_blob->size > dev->fw_buf.size) {
+ mfc_err("MFC firmware is too big to be loaded\n");
+ release_firmware(fw_blob);
+Index: linux/drivers/media/pci/saa7164/saa7164-fw.c
+===================================================================
+--- linux.orig/drivers/media/pci/saa7164/saa7164-fw.c
++++ linux/drivers/media/pci/saa7164/saa7164-fw.c
+@@ -416,11 +416,8 @@ int saa7164_downloadfirmware(struct saa7
+ __func__, fwname);
+
+ ret = request_firmware(&fw, fwname, &dev->pci->dev);
+- if (ret) {
+- printk(KERN_ERR "%s() Upload failed. (file not found?)\n",
+- __func__);
++ if (ret)
+ return -ENOMEM;
+- }
+
+ printk(KERN_INFO "%s() firmware read %zu bytes.\n",
+ __func__, fw->size);
+Index: linux/drivers/misc/ti-st/st_kim.c
+===================================================================
+--- linux.orig/drivers/misc/ti-st/st_kim.c
++++ linux/drivers/misc/ti-st/st_kim.c
+@@ -301,11 +301,8 @@ static long download_firmware(struct kim
+ request_firmware(&kim_gdata->fw_entry, bts_scr_name,
+ &kim_gdata->kim_pdev->dev);
+ if (unlikely((err != 0) || (kim_gdata->fw_entry->data == NULL) ||
+- (kim_gdata->fw_entry->size == 0))) {
+- pr_err(" request_firmware failed(errno %ld) for %s", err,
+- bts_scr_name);
++ (kim_gdata->fw_entry->size == 0)))
+ return -EINVAL;
+- }
+ ptr = (void *)kim_gdata->fw_entry->data;
+ len = kim_gdata->fw_entry->size;
+ /* bts_header to remove out magic number and
+Index: linux/drivers/net/can/softing/softing_fw.c
+===================================================================
+--- linux.orig/drivers/net/can/softing/softing_fw.c
++++ linux/drivers/net/can/softing/softing_fw.c
+@@ -237,11 +237,8 @@ int softing_load_app_fw(const char *file
+ int8_t type_end = 0, type_entrypoint = 0;
+
+ ret = request_firmware(&fw, file, &card->pdev->dev);
+- if (ret) {
+- dev_alert(&card->pdev->dev, "request_firmware(%s) got %i\n",
+- file, ret);
++ if (ret)
+ return ret;
+- }
+ dev_dbg(&card->pdev->dev, "firmware(%s) got %lu bytes\n",
+ file, (unsigned long)fw->size);
+ /* parse the firmware */
+Index: linux/drivers/net/ethernet/3com/typhoon.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/3com/typhoon.c
++++ linux/drivers/net/ethernet/3com/typhoon.c
+@@ -1283,11 +1283,8 @@ typhoon_request_firmware(struct typhoon
+ return 0;
+
+ err = request_firmware(&typhoon_fw, FIRMWARE_NAME, &tp->pdev->dev);
+- if (err) {
+- netdev_err(tp->dev, "Failed to load firmware \"%s\"\n",
+- FIRMWARE_NAME);
++ if (err)
+ return err;
+- }
+
+ image_data = typhoon_fw->data;
+ remaining = typhoon_fw->size;
+Index: linux/drivers/net/ethernet/adaptec/starfire.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/adaptec/starfire.c
++++ linux/drivers/net/ethernet/adaptec/starfire.c
+@@ -1015,11 +1015,8 @@ static int netdev_open(struct net_device
+ #endif /* VLAN_SUPPORT */
+
+ retval = request_firmware(&fw_rx, FIRMWARE_RX, &np->pci_dev->dev);
+- if (retval) {
+- printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n",
+- FIRMWARE_RX);
++ if (retval)
+ goto out_init;
+- }
+ if (fw_rx->size % 4) {
+ printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n",
+ fw_rx->size, FIRMWARE_RX);
+@@ -1027,11 +1024,8 @@ static int netdev_open(struct net_device
+ goto out_rx;
+ }
+ retval = request_firmware(&fw_tx, FIRMWARE_TX, &np->pci_dev->dev);
+- if (retval) {
+- printk(KERN_ERR "starfire: Failed to load firmware \"%s\"\n",
+- FIRMWARE_TX);
++ if (retval)
+ goto out_rx;
+- }
+ if (fw_tx->size % 4) {
+ printk(KERN_ERR "starfire: bogus length %zu in \"%s\"\n",
+ fw_tx->size, FIRMWARE_TX);
+Index: linux/drivers/net/ethernet/alteon/acenic.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/alteon/acenic.c
++++ linux/drivers/net/ethernet/alteon/acenic.c
+@@ -2890,11 +2890,8 @@ static int ace_load_firmware(struct net_
+ fw_name = "acenic/tg1.bin";
+
+ ret = request_firmware(&fw, fw_name, &ap->pdev->dev);
+- if (ret) {
+- printk(KERN_ERR "%s: Failed to load firmware \"%s\"\n",
+- ap->name, fw_name);
++ if (ret)
+ return ret;
+- }
+
+ fw_data = (void *)fw->data;
+
+Index: linux/drivers/net/ethernet/broadcom/bnx2.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/broadcom/bnx2.c
++++ linux/drivers/net/ethernet/broadcom/bnx2.c
+@@ -3720,16 +3720,13 @@ static int bnx2_request_uncached_firmwar
+ }
+
+ rc = request_firmware(&bp->mips_firmware, mips_fw_file, &bp->pdev->dev);
+- if (rc) {
+- pr_err("Can't load firmware file \"%s\"\n", mips_fw_file);
++ if (rc)
+ goto out;
+- }
+
+ rc = request_firmware(&bp->rv2p_firmware, rv2p_fw_file, &bp->pdev->dev);
+- if (rc) {
+- pr_err("Can't load firmware file \"%s\"\n", rv2p_fw_file);
++ if (rc)
+ goto err_release_mips_firmware;
+- }
++
+ mips_fw = (const struct bnx2_mips_fw_file *) bp->mips_firmware->data;
+ rv2p_fw = (const struct bnx2_rv2p_fw_file *) bp->rv2p_firmware->data;
+ if (bp->mips_firmware->size < sizeof(*mips_fw) ||
+Index: linux/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
++++ linux/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+@@ -13557,11 +13557,8 @@ static int bnx2x_init_firmware(struct bn
+ BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
+
+ rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
+- if (rc) {
+- BNX2X_ERR("Can't load firmware file %s\n",
+- fw_file_name);
++ if (rc)
+ goto request_firmware_exit;
+- }
+
+ rc = bnx2x_check_firmware(bp);
+ if (rc) {
+Index: linux/drivers/net/ethernet/broadcom/tg3.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/broadcom/tg3.c
++++ linux/drivers/net/ethernet/broadcom/tg3.c
+@@ -11408,11 +11408,8 @@ static int tg3_request_firmware(struct t
+ {
+ const struct tg3_firmware_hdr *fw_hdr;
+
+- if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev)) {
+- netdev_err(tp->dev, "Failed to load firmware \"%s\"\n",
+- tp->fw_needed);
++ if (request_firmware(&tp->fw, tp->fw_needed, &tp->pdev->dev))
+ return -ENOENT;
+- }
+
+ fw_hdr = (struct tg3_firmware_hdr *)tp->fw->data;
+
+Index: linux/drivers/net/ethernet/brocade/bna/cna_fwimg.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/brocade/bna/cna_fwimg.c
++++ linux/drivers/net/ethernet/brocade/bna/cna_fwimg.c
+@@ -32,10 +32,8 @@ cna_read_firmware(struct pci_dev *pdev,
+ const struct firmware *fw;
+ u32 n;
+
+- if (request_firmware(&fw, fw_name, &pdev->dev)) {
+- dev_alert(&pdev->dev, "can't load firmware %s\n", fw_name);
++ if (request_firmware(&fw, fw_name, &pdev->dev))
+ goto error;
+- }
+
+ *bfi_image = (u32 *)fw->data;
+ *bfi_image_size = fw->size/sizeof(u32);
+Index: linux/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
++++ linux/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+@@ -1038,12 +1038,8 @@ int t3_get_edc_fw(struct cphy *phy, int
+ fw_name = get_edc_fw_name(edc_idx);
+ if (fw_name)
+ ret = request_firmware(&fw, fw_name, &adapter->pdev->dev);
+- if (ret < 0) {
+- dev_err(&adapter->pdev->dev,
+- "could not upgrade firmware: unable to load %s\n",
+- fw_name);
++ if (ret)
+ return ret;
+- }
+
+ /* check size, take checksum in account */
+ if (fw->size > size + 4) {
+@@ -1080,11 +1076,8 @@ static int upgrade_fw(struct adapter *ad
+ struct device *dev = &adap->pdev->dev;
+
+ ret = request_firmware(&fw, FW_FNAME, dev);
+- if (ret < 0) {
+- dev_err(dev, "could not upgrade firmware: unable to load %s\n",
+- FW_FNAME);
++ if (ret)
+ return ret;
+- }
+ ret = t3_load_fw(adap, fw->data, fw->size);
+ release_firmware(fw);
+
+@@ -1129,11 +1122,8 @@ static int update_tpsram(struct adapter
+ snprintf(buf, sizeof(buf), TPSRAM_NAME, rev);
+
+ ret = request_firmware(&tpsram, buf, dev);
+- if (ret < 0) {
+- dev_err(dev, "could not load TP SRAM: unable to load %s\n",
+- buf);
++ if (ret)
+ return ret;
+- }
+
+ ret = t3_check_tpsram(adap, tpsram->data, tpsram->size);
+ if (ret)
+Index: linux/drivers/net/ethernet/intel/e100.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/intel/e100.c
++++ linux/drivers/net/ethernet/intel/e100.c
+@@ -1265,9 +1265,6 @@ static const struct firmware *e100_reque
+
+ if (err) {
+ if (required) {
+- netif_err(nic, probe, nic->netdev,
+- "Failed to load firmware \"%s\": %d\n",
+- fw_name, err);
+ return ERR_PTR(err);
+ } else {
+ netif_info(nic, probe, nic->netdev,
+Index: linux/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
++++ linux/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+@@ -581,8 +581,6 @@ static int myri10ge_load_hotplug_firmwar
+ unsigned i;
+
+ if ((status = request_firmware(&fw, mgp->fw_name, dev)) < 0) {
+- dev_err(dev, "Unable to load %s firmware image via hotplug\n",
+- mgp->fw_name);
+ status = -EINVAL;
+ goto abort_with_nothing;
+ }
+Index: linux/drivers/net/ethernet/smsc/smc91c92_cs.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/smsc/smc91c92_cs.c
++++ linux/drivers/net/ethernet/smsc/smc91c92_cs.c
+@@ -647,10 +647,8 @@ static int osi_load_firmware(struct pcmc
+ int i, err;
+
+ err = request_firmware(&fw, FIRMWARE_NAME, &link->dev);
+- if (err) {
+- pr_err("Failed to load firmware \"%s\"\n", FIRMWARE_NAME);
++ if (err)
+ return err;
+- }
+
+ /* Download the Seven of Diamonds firmware */
+ for (i = 0; i < fw->size; i++) {
+Index: linux/drivers/net/ethernet/sun/cassini.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/sun/cassini.c
++++ linux/drivers/net/ethernet/sun/cassini.c
+@@ -805,11 +805,8 @@ static void cas_saturn_firmware_init(str
+ return;
+
+ err = request_firmware(&fw, fw_name, &cp->pdev->dev);
+- if (err) {
+- pr_err("Failed to load firmware \"%s\"\n",
+- fw_name);
++ if (err)
+ return;
+- }
+ if (fw->size < 2) {
+ pr_err("bogus length %zu in \"%s\"\n",
+ fw->size, fw_name);
+Index: linux/drivers/net/hamradio/yam.c
+===================================================================
+--- linux.orig/drivers/net/hamradio/yam.c
++++ linux/drivers/net/hamradio/yam.c
+@@ -372,11 +372,8 @@ static unsigned char *add_mcs(unsigned c
+ }
+ err = request_firmware(&fw, fw_name[predef], &pdev->dev);
+ platform_device_unregister(pdev);
+- if (err) {
+- printk(KERN_ERR "Failed to load firmware \"%s\"\n",
+- fw_name[predef]);
++ if (err)
+ return NULL;
+- }
+ if (fw->size != YAM_FPGA_SIZE) {
+ printk(KERN_ERR "Bogus length %zu in firmware \"%s\"\n",
+ fw->size, fw_name[predef]);
+Index: linux/drivers/net/usb/kaweth.c
+===================================================================
+--- linux.orig/drivers/net/usb/kaweth.c
++++ linux/drivers/net/usb/kaweth.c
+@@ -390,10 +390,8 @@ static int kaweth_download_firmware(stru
+ int ret;
+
+ ret = request_firmware(&fw, fwname, &kaweth->dev->dev);
+- if (ret) {
+- dev_err(&kaweth->intf->dev, "Firmware request failed\n");
++ if (ret)
+ return ret;
+- }
+
+ if (fw->size > KAWETH_FIRMWARE_BUF_SIZE) {
+ dev_err(&kaweth->intf->dev, "Firmware too big: %zu\n",
+Index: linux/drivers/net/wimax/i2400m/fw.c
+===================================================================
+--- linux.orig/drivers/net/wimax/i2400m/fw.c
++++ linux/drivers/net/wimax/i2400m/fw.c
+@@ -1583,11 +1583,8 @@ int i2400m_dev_bootstrap(struct i2400m *
+ }
+ d_printf(1, dev, "trying firmware %s (%d)\n", fw_name, itr);
+ ret = request_firmware(&fw, fw_name, dev);
+- if (ret < 0) {
+- dev_err(dev, "fw %s: cannot load file: %d\n",
+- fw_name, ret);
++ if (ret)
+ continue;
+- }
+ i2400m->fw_name = fw_name;
+ ret = i2400m_fw_bootstrap(i2400m, fw, flags);
+ release_firmware(fw);
+@@ -1630,8 +1627,6 @@ void i2400m_fw_cache(struct i2400m *i240
+ kref_init(&i2400m_fw->kref);
+ result = request_firmware(&i2400m_fw->fw, i2400m->fw_name, dev);
+ if (result < 0) {
+- dev_err(dev, "firmware %s: failed to cache: %d\n",
+- i2400m->fw_name, result);
+ kfree(i2400m_fw);
+ i2400m_fw = (void *) ~0;
+ } else
+Index: linux/drivers/net/wireless/atmel/at76c50x-usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/atmel/at76c50x-usb.c
++++ linux/drivers/net/wireless/atmel/at76c50x-usb.c
+@@ -1622,13 +1622,8 @@ static struct fwentry *at76_load_firmwar
+
+ at76_dbg(DBG_FW, "downloading firmware %s", fwe->fwname);
+ ret = request_firmware(&fwe->fw, fwe->fwname, &udev->dev);
+- if (ret < 0) {
+- dev_err(&udev->dev, "firmware %s not found!\n",
+- fwe->fwname);
+- dev_err(&udev->dev,
+- "you may need to download the firmware from http://developer.berlios.de/projects/at76c503a/\n");
++ if (ret)
+ goto exit;
+- }
+
+ at76_dbg(DBG_FW, "got it.");
+ fwh = (struct at76_fw_header *)(fwe->fw->data);
+Index: linux/drivers/net/wireless/ath/ath9k/hif_usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/ath/ath9k/hif_usb.c
++++ linux/drivers/net/wireless/ath/ath9k/hif_usb.c
+@@ -1164,9 +1164,6 @@ static void ath9k_hif_usb_firmware_cb(co
+ if (!ret)
+ return;
+
+- dev_err(&hif_dev->udev->dev,
+- "ath9k_htc: Failed to get firmware %s\n",
+- hif_dev->fw_name);
+ goto err_fw;
+ }
+
+Index: linux/drivers/net/wireless/ath/carl9170/usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/ath/carl9170/usb.c
++++ linux/drivers/net/wireless/ath/carl9170/usb.c
+@@ -1029,7 +1029,6 @@ static void carl9170_usb_firmware_step2(
+ return;
+ }
+
+- dev_err(&ar->udev->dev, "firmware not found.\n");
+ carl9170_usb_firmware_failed(ar);
+ }
+
+Index: linux/drivers/net/wireless/atmel/atmel.c
+===================================================================
+--- linux.orig/drivers/net/wireless/atmel/atmel.c
++++ linux/drivers/net/wireless/atmel/atmel.c
+@@ -3893,12 +3893,8 @@ static int reset_atmel_card(struct net_d
+ strcpy(priv->firmware_id, "atmel_at76c502.bin");
+ }
+ err = request_firmware(&fw_entry, priv->firmware_id, priv->sys_dev);
+- if (err != 0) {
+- printk(KERN_ALERT
+- "%s: firmware %s is missing, cannot continue.\n",
+- dev->name, priv->firmware_id);
++ if (err != 0)
+ return err;
+- }
+ } else {
+ int fw_index = 0;
+ int success = 0;
+Index: linux/drivers/net/wireless/broadcom/b43/main.c
+===================================================================
+--- linux.orig/drivers/net/wireless/broadcom/b43/main.c
++++ linux/drivers/net/wireless/broadcom/b43/main.c
+@@ -2263,19 +2263,8 @@ int b43_do_request_fw(struct b43_request
+ }
+ err = request_firmware(&ctx->blob, ctx->fwname,
+ ctx->dev->dev->dev);
+- if (err == -ENOENT) {
+- snprintf(ctx->errors[ctx->req_type],
+- sizeof(ctx->errors[ctx->req_type]),
+- "Firmware file \"%s\" not found\n",
+- ctx->fwname);
++ if (err)
+ return err;
+- } else if (err) {
+- snprintf(ctx->errors[ctx->req_type],
+- sizeof(ctx->errors[ctx->req_type]),
+- "Firmware file \"%s\" request failed (err=%d)\n",
+- ctx->fwname, err);
+- return err;
+- }
+ fw_ready:
+ if (ctx->blob->size < sizeof(struct b43_fw_header))
+ goto err_format;
+Index: linux/drivers/net/wireless/broadcom/b43legacy/main.c
+===================================================================
+--- linux.orig/drivers/net/wireless/broadcom/b43legacy/main.c
++++ linux/drivers/net/wireless/broadcom/b43legacy/main.c
+@@ -1554,11 +1554,8 @@ static int do_request_fw(struct b43legac
+ } else {
+ err = request_firmware(fw, path, dev->dev->dev);
+ }
+- if (err) {
+- b43legacyerr(dev->wl, "Firmware file \"%s\" not found "
+- "or load failed.\n", path);
++ if (err)
+ return err;
+- }
+ if ((*fw)->size < sizeof(struct b43legacy_fw_header))
+ goto err_format;
+ hdr = (struct b43legacy_fw_header *)((*fw)->data);
+Index: linux/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+===================================================================
+--- linux.orig/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
++++ linux/drivers/net/wireless/broadcom/brcm80211/brcmsmac/mac80211_if.c
+@@ -378,19 +378,13 @@ static int brcms_request_fw(struct brcms
+ sprintf(fw_name, "%s-%d.fw", brcms_firmwares[i],
+ UCODE_LOADER_API_VER);
+ status = request_firmware(&wl->fw.fw_bin[i], fw_name, device);
+- if (status) {
+- wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
+- KBUILD_MODNAME, fw_name);
++ if (status)
+ return status;
+- }
+ sprintf(fw_name, "%s_hdr-%d.fw", brcms_firmwares[i],
+ UCODE_LOADER_API_VER);
+ status = request_firmware(&wl->fw.fw_hdr[i], fw_name, device);
+- if (status) {
+- wiphy_err(wl->wiphy, "%s: fail to load firmware %s\n",
+- KBUILD_MODNAME, fw_name);
++ if (status)
+ return status;
+- }
+ wl->fw.hdr_num_entries[i] =
+ wl->fw.fw_hdr[i]->size / (sizeof(struct firmware_hdr));
+ }
+Index: linux/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intel/ipw2x00/ipw2100.c
++++ linux/drivers/net/wireless/intel/ipw2x00/ipw2100.c
+@@ -8410,12 +8410,8 @@ static int ipw2100_get_firmware(struct i
+
+ rc = request_firmware(&fw->fw_entry, fw_name, &priv->pci_dev->dev);
+
+- if (rc < 0) {
+- printk(KERN_ERR DRV_NAME ": "
+- "%s: Firmware '%s' not available or load failed.\n",
+- priv->net_dev->name, fw_name);
++ if (rc)
+ return rc;
+- }
+ IPW_DEBUG_INFO("firmware data %p size %zd\n", fw->fw_entry->data,
+ fw->fw_entry->size);
+
+Index: linux/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intel/ipw2x00/ipw2200.c
++++ linux/drivers/net/wireless/intel/ipw2x00/ipw2200.c
+@@ -3410,10 +3410,8 @@ static int ipw_get_fw(struct ipw_priv *p
+
+ /* ask firmware_class module to get the boot firmware off disk */
+ rc = request_firmware(raw, name, &priv->pci_dev->dev);
+- if (rc < 0) {
+- IPW_ERROR("%s request_firmware failed: Reason %d\n", name, rc);
++ if (rc)
+ return rc;
+- }
+
+ if ((*raw)->size < sizeof(*fw)) {
+ IPW_ERROR("%s is too small (%zd)\n", name, (*raw)->size);
+Index: linux/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intel/iwlegacy/3945-mac.c
++++ linux/drivers/net/wireless/intel/iwlegacy/3945-mac.c
+@@ -1854,7 +1854,6 @@ il3945_read_ucode(struct il_priv *il)
+ sprintf(buf, "%s%u%s", name_pre, idx, ".ucode");
+ ret = request_firmware(&ucode_raw, buf, &il->pci_dev->dev);
+ if (ret < 0) {
+- IL_ERR("%s firmware file req failed: %d\n", buf, ret);
+ if (ret == -ENOENT)
+ continue;
+ else
+Index: linux/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
++++ linux/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
+@@ -236,8 +236,6 @@ static int iwl_request_firmware(struct i
+ }
+
+ if (drv->fw_index < cfg->ucode_api_min) {
+- IWL_ERR(drv, "no suitable firmware found!\n");
+-
+ if (cfg->ucode_api_min == cfg->ucode_api_max) {
+ IWL_ERR(drv, "%s%d is required\n", fw_pre_name,
+ cfg->ucode_api_max);
+Index: linux/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/marvell/libertas_tf/if_usb.c
++++ linux/drivers/net/wireless/marvell/libertas_tf/if_usb.c
+@@ -817,8 +817,6 @@ static int if_usb_prog_firmware(struct i
+ kernel_param_lock(THIS_MODULE);
+ ret = request_firmware(&cardp->fw, lbtf_fw_name, &cardp->udev->dev);
+ if (ret < 0) {
+- pr_err("request_firmware() failed with %#x\n", ret);
+- pr_err("firmware %s not found\n", lbtf_fw_name);
+ kernel_param_unlock(THIS_MODULE);
+ goto done;
+ }
+Index: linux/drivers/net/wireless/marvell/mwifiex/main.c
+===================================================================
+--- linux.orig/drivers/net/wireless/marvell/mwifiex/main.c
++++ linux/drivers/net/wireless/marvell/mwifiex/main.c
+@@ -528,11 +528,8 @@ static int _mwifiex_fw_dpc(const struct
+ struct wireless_dev *wdev;
+ struct completion *fw_done = adapter->fw_done;
+
+- if (!firmware) {
+- mwifiex_dbg(adapter, ERROR,
+- "Failed to get firmware %s\n", adapter->fw_name);
++ if (!firmware)
+ goto err_dnld_fw;
+- }
+
+ memset(&fw, 0, sizeof(struct mwifiex_fw_image));
+ adapter->firmware = firmware;
+Index: linux/drivers/net/wireless/marvell/mwl8k.c
+===================================================================
+--- linux.orig/drivers/net/wireless/marvell/mwl8k.c
++++ linux/drivers/net/wireless/marvell/mwl8k.c
+@@ -5724,16 +5724,12 @@ static int mwl8k_firmware_load_success(s
+ static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
+ {
+ struct mwl8k_priv *priv = context;
+- struct mwl8k_device_info *di = priv->device_info;
+ int rc;
+
+ switch (priv->fw_state) {
+ case FW_STATE_INIT:
+- if (!fw) {
+- printk(KERN_ERR "%s: Error requesting helper fw %s\n",
+- pci_name(priv->pdev), di->helper_image);
++ if (!fw)
+ goto fail;
+- }
+ priv->fw_helper = fw;
+ rc = mwl8k_request_fw(priv, priv->fw_pref, &priv->fw_ucode,
+ true);
+@@ -5768,11 +5764,8 @@ static void mwl8k_fw_state_machine(const
+ break;
+
+ case FW_STATE_LOADING_ALT:
+- if (!fw) {
+- printk(KERN_ERR "%s: Error requesting alt fw %s\n",
+- pci_name(priv->pdev), di->helper_image);
++ if (!fw)
+ goto fail;
+- }
+ priv->fw_ucode = fw;
+ rc = mwl8k_firmware_load_success(priv);
+ if (rc)
+@@ -5810,10 +5803,8 @@ retry:
+
+ /* Ask userland hotplug daemon for the device firmware */
+ rc = mwl8k_request_firmware(priv, fw_image, nowait);
+- if (rc) {
+- wiphy_err(hw->wiphy, "Firmware files not found\n");
++ if (rc)
+ return rc;
+- }
+
+ if (nowait)
+ return rc;
+Index: linux/drivers/net/wireless/intersil/orinoco/fw.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/orinoco/fw.c
++++ linux/drivers/net/wireless/intersil/orinoco/fw.c
+@@ -132,7 +132,6 @@ orinoco_dl_firmware(struct orinoco_priva
+ err = request_firmware(&fw_entry, firmware, priv->dev);
+
+ if (err) {
+- dev_err(dev, "Cannot find firmware %s\n", firmware);
+ err = -ENOENT;
+ goto free;
+ }
+@@ -292,10 +291,8 @@ symbol_dl_firmware(struct orinoco_privat
+ const struct firmware *fw_entry;
+
+ if (!orinoco_cached_fw_get(priv, true)) {
+- if (request_firmware(&fw_entry, fw->pri_fw, priv->dev) != 0) {
+- dev_err(dev, "Cannot find firmware: %s\n", fw->pri_fw);
++ if (request_firmware(&fw_entry, fw->pri_fw, priv->dev) != 0)
+ return -ENOENT;
+- }
+ } else
+ fw_entry = orinoco_cached_fw_get(priv, true);
+
+@@ -311,10 +308,8 @@ symbol_dl_firmware(struct orinoco_privat
+ }
+
+ if (!orinoco_cached_fw_get(priv, false)) {
+- if (request_firmware(&fw_entry, fw->sta_fw, priv->dev) != 0) {
+- dev_err(dev, "Cannot find firmware: %s\n", fw->sta_fw);
++ if (request_firmware(&fw_entry, fw->sta_fw, priv->dev) != 0)
+ return -ENOENT;
+- }
+ } else
+ fw_entry = orinoco_cached_fw_get(priv, false);
+
+Index: linux/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
++++ linux/drivers/net/wireless/intersil/orinoco/orinoco_usb.c
+@@ -1677,7 +1677,6 @@ static int ezusb_probe(struct usb_interf
+ if (ezusb_firmware_download(upriv, &firmware) < 0)
+ goto error;
+ } else {
+- err("No firmware to download");
+ goto error;
+ }
+
+Index: linux/drivers/net/wireless/intersil/p54/p54pci.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/p54/p54pci.c
++++ linux/drivers/net/wireless/intersil/p54/p54pci.c
+@@ -499,7 +499,6 @@ static void p54p_firmware_step2(const st
+ int err;
+
+ if (!fw) {
+- dev_err(&pdev->dev, "Cannot find firmware (isl3886pci)\n");
+ err = -ENOENT;
+ goto out;
+ }
+Index: linux/drivers/net/wireless/intersil/p54/p54spi.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/p54/p54spi.c
++++ linux/drivers/net/wireless/intersil/p54/p54spi.c
+@@ -170,10 +170,8 @@ static int p54spi_request_firmware(struc
+ /* FIXME: should driver use it's own struct device? */
+ ret = request_firmware(&priv->firmware, "3826.arm", &priv->spi->dev);
+
+- if (ret < 0) {
+- dev_err(&priv->spi->dev, "request_firmware() failed: %d", ret);
++ if (ret)
+ return ret;
+- }
+
+ ret = p54_parse_firmware(dev, priv->firmware);
+ if (ret) {
+Index: linux/drivers/net/wireless/intersil/p54/p54usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/p54/p54usb.c
++++ linux/drivers/net/wireless/intersil/p54/p54usb.c
+@@ -931,7 +931,6 @@ static void p54u_load_firmware_cb(const
+ err = p54u_start_ops(priv);
+ } else {
+ err = -ENOENT;
+- dev_err(&udev->dev, "Firmware not found.\n");
+ }
+
+ complete(&priv->fw_wait_load);
+Index: linux/drivers/net/wireless/intersil/prism54/islpci_dev.c
+===================================================================
+--- linux.orig/drivers/net/wireless/intersil/prism54/islpci_dev.c
++++ linux/drivers/net/wireless/intersil/prism54/islpci_dev.c
+@@ -92,12 +92,9 @@ isl_upload_firmware(islpci_private *priv
+ const u32 *fw_ptr;
+
+ rc = request_firmware(&fw_entry, priv->firmware, PRISM_FW_PDEV);
+- if (rc) {
+- printk(KERN_ERR
+- "%s: request_firmware() failed for '%s'\n",
+- "prism54", priv->firmware);
++ if (rc)
+ return rc;
+- }
++
+ /* prepare the Direct Memory Base register */
+ reg = ISL38XX_DEV_FIRMWARE_ADDRES;
+
+Index: linux/drivers/net/wireless/ralink/rt2x00/rt2x00firmware.c
+===================================================================
+--- linux.orig/drivers/net/wireless/ralink/rt2x00/rt2x00firmware.c
++++ linux/drivers/net/wireless/ralink/rt2x00/rt2x00firmware.c
+@@ -49,10 +49,8 @@ static int rt2x00lib_request_firmware(st
+ rt2x00_info(rt2x00dev, "Loading firmware file '%s'\n", fw_name);
+
+ retval = request_firmware(&fw, fw_name, device);
+- if (retval) {
+- rt2x00_err(rt2x00dev, "Failed to request Firmware\n");
++ if (retval)
+ return retval;
+- }
+
+ if (!fw || !fw->size || !fw->data) {
+ rt2x00_err(rt2x00dev, "Failed to read Firmware\n");
+Index: linux/drivers/net/wireless/realtek/rtlwifi/core.c
+===================================================================
+--- linux.orig/drivers/net/wireless/realtek/rtlwifi/core.c
++++ linux/drivers/net/wireless/realtek/rtlwifi/core.c
+@@ -111,7 +111,6 @@ static void rtl_fw_do_work(const struct
+ if (!err)
+ goto found_alt;
+ }
+- pr_err("Selected firmware is not available\n");
+ rtlpriv->max_fw_size = 0;
+ return;
+ }
+Index: linux/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
+===================================================================
+--- linux.orig/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
++++ linux/drivers/net/wireless/realtek/rtlwifi/rtl8192se/sw.c
+@@ -86,13 +86,11 @@ static void rtl92se_fw_cb(const struct f
+ struct ieee80211_hw *hw = context;
+ struct rtl_priv *rtlpriv = rtl_priv(hw);
+ struct rt_firmware *pfirmware = NULL;
+- char *fw_name = "rtlwifi/rtl8192sefw.bin";
+
+ RT_TRACE(rtlpriv, COMP_ERR, DBG_LOUD,
+ "Firmware callback routine entered!\n");
+ complete(&rtlpriv->firmware_loading_complete);
+ if (!firmware) {
+- pr_err("Firmware %s not available\n", fw_name);
+ rtlpriv->max_fw_size = 0;
+ return;
+ }
+Index: linux/drivers/net/wireless/ti/wl1251/main.c
+===================================================================
+--- linux.orig/drivers/net/wireless/ti/wl1251/main.c
++++ linux/drivers/net/wireless/ti/wl1251/main.c
+@@ -71,10 +71,8 @@ static int wl1251_fetch_firmware(struct
+
+ ret = request_firmware(&fw, WL1251_FW_NAME, dev);
+
+- if (ret < 0) {
+- wl1251_error("could not get firmware: %d", ret);
++ if (ret)
+ return ret;
+- }
+
+ if (fw->size % 4) {
+ wl1251_error("firmware size is not multiple of 32 bits: %zu",
+@@ -110,10 +108,8 @@ static int wl1251_fetch_nvs(struct wl125
+
+ ret = request_firmware(&fw, WL1251_NVS_NAME, dev);
+
+- if (ret < 0) {
+- wl1251_error("could not get nvs file: %d", ret);
++ if (ret)
+ return ret;
+- }
+
+ if (fw->size % 4) {
+ wl1251_error("nvs size is not multiple of 32 bits: %zu",
+Index: linux/drivers/net/wireless/ti/wlcore/main.c
+===================================================================
+--- linux.orig/drivers/net/wireless/ti/wlcore/main.c
++++ linux/drivers/net/wireless/ti/wlcore/main.c
+@@ -768,10 +768,8 @@ static int wl12xx_fetch_firmware(struct
+
+ ret = request_firmware(&fw, fw_name, wl->dev);
+
+- if (ret < 0) {
+- wl1271_error("could not get firmware %s: %d", fw_name, ret);
++ if (ret)
+ return ret;
+- }
+
+ if (fw->size % 4) {
+ wl1271_error("firmware size is not multiple of 32 bits: %zu",
+Index: linux/drivers/net/wireless/zydas/zd1201.c
+===================================================================
+--- linux.orig/drivers/net/wireless/zydas/zd1201.c
++++ linux/drivers/net/wireless/zydas/zd1201.c
+@@ -65,8 +65,6 @@ static int zd1201_fw_upload(struct usb_d
+
+ err = request_firmware(&fw_entry, fwfile, &dev->dev);
+ if (err) {
+- dev_err(&dev->dev, "Failed to load %s firmware file!\n", fwfile);
+- dev_err(&dev->dev, "Make sure the hotplug firmware loader is installed.\n");
+ dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info.\n");
+ return err;
+ }
+Index: linux/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
+===================================================================
+--- linux.orig/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
++++ linux/drivers/net/wireless/zydas/zd1211rw/zd_usb.c
+@@ -120,16 +120,9 @@ static void int_urb_complete(struct urb
+ static int request_fw_file(
+ const struct firmware **fw, const char *name, struct device *device)
+ {
+- int r;
+-
+ dev_dbg_f(device, "fw name %s\n", name);
+
+- r = request_firmware(fw, name, device);
+- if (r)
+- dev_err(device,
+- "Could not load firmware file %s. Error number %d\n",
+- name, r);
+- return r;
++ return request_firmware(fw, name, device);
+ }
+
+ static inline u16 get_bcdDevice(const struct usb_device *udev)
+Index: linux/drivers/scsi/advansys.c
+===================================================================
+--- linux.orig/drivers/scsi/advansys.c
++++ linux/drivers/scsi/advansys.c
+@@ -4107,8 +4107,6 @@ static int AscInitAsc1000Driver(ASC_DVC_
+
+ err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
+ if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
+ asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM;
+ return err;
+ }
+@@ -4473,8 +4471,6 @@ static int AdvInitAsc3550Driver(ADV_DVC_
+
+ err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
+ if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
+ asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
+ return err;
+ }
+@@ -4973,8 +4969,6 @@ static int AdvInitAsc38C0800Driver(ADV_D
+
+ err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
+ if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
+ asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
+ return err;
+ }
+@@ -5461,8 +5455,6 @@ static int AdvInitAsc38C1600Driver(ADV_D
+
+ err = request_firmware(&fw, fwname, asc_dvc->drv_ptr->dev);
+ if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
+ asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM;
+ return err;
+ }
+Index: linux/drivers/scsi/aic94xx/aic94xx_init.c
+===================================================================
+--- linux.orig/drivers/scsi/aic94xx/aic94xx_init.c
++++ linux/drivers/scsi/aic94xx/aic94xx_init.c
+@@ -384,8 +384,6 @@ static ssize_t asd_store_update_bios(str
+ filename_ptr,
+ &asd_ha->pcidev->dev);
+ if (err) {
+- asd_printk("Failed to load bios image file %s, error %d\n",
+- filename_ptr, err);
+ err = FAIL_OPEN_BIOS_FILE;
+ goto out1;
+ }
+Index: linux/drivers/scsi/aic94xx/aic94xx_seq.c
+===================================================================
+--- linux.orig/drivers/scsi/aic94xx/aic94xx_seq.c
++++ linux/drivers/scsi/aic94xx/aic94xx_seq.c
+@@ -1317,11 +1317,8 @@ int asd_init_seqs(struct asd_ha_struct *
+
+ err = asd_request_firmware(asd_ha);
+
+- if (err) {
+- asd_printk("Failed to load sequencer firmware file %s, error %d\n",
+- SAS_RAZOR_SEQUENCER_FW_FILE, err);
++ if (err)
+ return err;
+- }
+
+ err = asd_seq_download_seqs(asd_ha);
+ if (err) {
+Index: linux/drivers/scsi/bfa/bfad.c
+===================================================================
+--- linux.orig/drivers/scsi/bfa/bfad.c
++++ linux/drivers/scsi/bfa/bfad.c
+@@ -1755,7 +1755,6 @@ bfad_read_firmware(struct pci_dev *pdev,
+ const struct firmware *fw;
+
+ if (request_firmware(&fw, fw_name, &pdev->dev)) {
+- printk(KERN_ALERT "Can't locate firmware %s\n", fw_name);
+ *bfi_image = NULL;
+ goto out;
+ }
+Index: linux/drivers/scsi/ipr.c
+===================================================================
+--- linux.orig/drivers/scsi/ipr.c
++++ linux/drivers/scsi/ipr.c
+@@ -4102,10 +4102,8 @@ static ssize_t ipr_store_update_fw(struc
+ if (endline)
+ *endline = '\0';
+
+- if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev)) {
+- dev_err(&ioa_cfg->pdev->dev, "Firmware file %s not found\n", fname);
++ if (request_firmware(&fw_entry, fname, &ioa_cfg->pdev->dev))
+ return -EIO;
+- }
+
+ image_hdr = (struct ipr_ucode_image_header *)fw_entry->data;
+
+Index: linux/drivers/scsi/pm8001/pm8001_ctl.c
+===================================================================
+--- linux.orig/drivers/scsi/pm8001/pm8001_ctl.c
++++ linux/drivers/scsi/pm8001/pm8001_ctl.c
+@@ -737,10 +737,6 @@ static ssize_t pm8001_store_update_fw(st
+ pm8001_ha->dev);
+
+ if (ret) {
+- PM8001_FAIL_DBG(pm8001_ha,
+- pm8001_printk(
+- "Failed to load firmware image file %s, error %d\n",
+- filename_ptr, ret));
+ pm8001_ha->fw_status = FAIL_OPEN_BIOS_FILE;
+ goto out;
+ }
+Index: linux/drivers/scsi/qla1280.c
+===================================================================
+--- linux.orig/drivers/scsi/qla1280.c
++++ linux/drivers/scsi/qla1280.c
+@@ -1552,8 +1552,6 @@ qla1280_request_firmware(struct scsi_qla
+ err = request_firmware(&fw, fwname, &ha->pdev->dev);
+
+ if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
+ fw = ERR_PTR(err);
+ goto unlock;
+ }
+Index: linux/drivers/scsi/qla2xxx/qla_init.c
+===================================================================
+--- linux.orig/drivers/scsi/qla2xxx/qla_init.c
++++ linux/drivers/scsi/qla2xxx/qla_init.c
+@@ -7470,8 +7470,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
+ /* Load firmware blob. */
+ blob = qla2x00_request_firmware(vha);
+ if (!blob) {
+- ql_log(ql_log_info, vha, 0x0083,
+- "Firmware image unavailable.\n");
+ ql_log(ql_log_info, vha, 0x0084,
+ "Firmware images can be retrieved from: "QLA_FW_URL ".\n");
+ return QLA_FUNCTION_FAILED;
+@@ -7573,8 +7571,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
+ /* Load firmware blob. */
+ blob = qla2x00_request_firmware(vha);
+ if (!blob) {
+- ql_log(ql_log_warn, vha, 0x0090,
+- "Firmware image unavailable.\n");
+ ql_log(ql_log_warn, vha, 0x0091,
+ "Firmware images can be retrieved from: "
+ QLA_FW_URL ".\n");
+Index: linux/drivers/scsi/qla2xxx/qla_nx.c
+===================================================================
+--- linux.orig/drivers/scsi/qla2xxx/qla_nx.c
++++ linux/drivers/scsi/qla2xxx/qla_nx.c
+@@ -2464,11 +2464,8 @@ try_blob_fw:
+
+ /* Load firmware blob. */
+ blob = ha->hablob = qla2x00_request_firmware(vha);
+- if (!blob) {
+- ql_log(ql_log_fatal, vha, 0x00a3,
+- "Firmware image not present.\n");
++ if (!blob)
+ goto fw_load_failed;
+- }
+
+ /* Validating firmware blob */
+ if (qla82xx_validate_firmware_blob(vha,
+Index: linux/drivers/scsi/qla2xxx/qla_os.c
+===================================================================
+--- linux.orig/drivers/scsi/qla2xxx/qla_os.c
++++ linux/drivers/scsi/qla2xxx/qla_os.c
+@@ -6543,8 +6543,6 @@ qla2x00_request_firmware(scsi_qla_host_t
+ goto out;
+
+ if (request_firmware(&blob->fw, blob->name, &ha->pdev->dev)) {
+- ql_log(ql_log_warn, vha, 0x0063,
+- "Failed to load firmware image (%s).\n", blob->name);
+ blob->fw = NULL;
+ blob = NULL;
+ goto out;
+Index: linux/drivers/scsi/qlogicpti.c
+===================================================================
+--- linux.orig/drivers/scsi/qlogicpti.c
++++ linux/drivers/scsi/qlogicpti.c
+@@ -475,11 +475,8 @@ static int qlogicpti_load_firmware(struc
+ int i, timeout;
+
+ err = request_firmware(&fw, fwname, &qpti->op->dev);
+- if (err) {
+- printk(KERN_ERR "Failed to load image \"%s\" err %d\n",
+- fwname, err);
++ if (err)
+ return err;
+- }
+ if (fw->size % 2) {
+ printk(KERN_ERR "Bogus length %zu in image \"%s\"\n",
+ fw->size, fwname);
+Index: linux/drivers/media/usb/go7007/go7007-driver.c
+===================================================================
+--- linux.orig/drivers/media/usb/go7007/go7007-driver.c
++++ linux/drivers/media/usb/go7007/go7007-driver.c
+@@ -92,10 +92,8 @@ static int go7007_load_encoder(struct go
+ u16 intr_val, intr_data;
+
+ if (go->boot_fw == NULL) {
+- if (request_firmware(&fw_entry, fw_name, go->dev)) {
+- v4l2_err(go, "unable to load firmware from file \"%s\"\n", fw_name);
++ if (request_firmware(&fw_entry, fw_name, go->dev))
+ return -1;
+- }
+ if (fw_entry->size < 16 || memcmp(fw_entry->data, "WISGO7007FW", 11)) {
+ v4l2_err(go, "file \"%s\" does not appear to be go7007 firmware\n", fw_name);
+ release_firmware(fw_entry);
+Index: linux/drivers/media/usb/go7007/go7007-fw.c
+===================================================================
+--- linux.orig/drivers/media/usb/go7007/go7007-fw.c
++++ linux/drivers/media/usb/go7007/go7007-fw.c
+@@ -1573,12 +1573,8 @@ int go7007_construct_fw_image(struct go7
+ default:
+ return -1;
+ }
+- if (request_firmware(&fw_entry, GO7007_FW_NAME, go->dev)) {
+- dev_err(go->dev,
+- "unable to load firmware from file \"%s\"\n",
+- GO7007_FW_NAME);
++ if (request_firmware(&fw_entry, GO7007_FW_NAME, go->dev))
+ return -1;
+- }
+ code = kcalloc(codespace, 2, GFP_KERNEL);
+ if (code == NULL)
+ goto fw_failed;
+Index: linux/drivers/media/usb/go7007/go7007-loader.c
+===================================================================
+--- linux.orig/drivers/media/usb/go7007/go7007-loader.c
++++ linux/drivers/media/usb/go7007/go7007-loader.c
+@@ -75,11 +75,8 @@ static int go7007_loader_probe(struct us
+
+ dev_info(&interface->dev, "loading firmware %s\n", fw1);
+
+- if (request_firmware(&fw, fw1, &usbdev->dev)) {
+- dev_err(&interface->dev,
+- "unable to load firmware from file \"%s\"\n", fw1);
++ if (request_firmware(&fw, fw1, &usbdev->dev))
+ goto failed2;
+- }
+ ret = cypress_load_firmware(usbdev, fw, CYPRESS_FX2);
+ release_firmware(fw);
+ if (0 != ret) {
+@@ -90,11 +87,8 @@ static int go7007_loader_probe(struct us
+ if (fw2 == NULL)
+ return 0;
+
+- if (request_firmware(&fw, fw2, &usbdev->dev)) {
+- dev_err(&interface->dev,
+- "unable to load firmware from file \"%s\"\n", fw2);
++ if (request_firmware(&fw, fw2, &usbdev->dev))
+ goto failed2;
+- }
+ ret = cypress_load_firmware(usbdev, fw, CYPRESS_FX2);
+ release_firmware(fw);
+ if (0 != ret) {
+Index: linux/drivers/staging/rtl8192u/r819xU_firmware.c
+===================================================================
+--- linux.orig/drivers/staging/rtl8192u/r819xU_firmware.c
++++ linux/drivers/staging/rtl8192u/r819xU_firmware.c
+@@ -245,10 +245,8 @@ bool init_firmware(struct net_device *de
+ */
+ if (rst_opt == OPT_SYSTEM_RESET) {
+ rc = request_firmware(&fw_entry, fw_name[init_step], &priv->udev->dev);
+- if (rc < 0) {
+- RT_TRACE(COMP_ERR, "request firmware fail!\n");
++ if (rc)
+ goto download_firmware_fail;
+- }
+
+ if (fw_entry->size > sizeof(pfirmware->firmware_buf)) {
+ RT_TRACE(COMP_ERR, "img file size exceed the container buffer fail!\n");
+Index: linux/drivers/staging/rtl8712/hal_init.c
+===================================================================
+--- linux.orig/drivers/staging/rtl8712/hal_init.c
++++ linux/drivers/staging/rtl8712/hal_init.c
+@@ -67,8 +67,6 @@ int rtl871x_load_fw(struct _adapter *pad
+ dev_info(dev, "r8712u: Loading firmware from \"%s\"\n", firmware_file);
+ rc = request_firmware_nowait(THIS_MODULE, 1, firmware_file, dev,
+ GFP_KERNEL, padapter, rtl871x_load_fw_cb);
+- if (rc)
+- dev_err(dev, "r8712u: Firmware request error %d\n", rc);
+ return rc;
+ }
+ MODULE_FIRMWARE("rtlwifi/rtl8712u.bin");
+Index: linux/drivers/net/ethernet/alacritech/slicoss.c
+===================================================================
+--- linux.orig/drivers/net/ethernet/alacritech/slicoss.c
++++ linux/drivers/net/ethernet/alacritech/slicoss.c
+@@ -1063,11 +1063,8 @@ static int slic_load_rcvseq_firmware(str
+ file = (sdev->model == SLIC_MODEL_OASIS) ? SLIC_RCV_FIRMWARE_OASIS :
+ SLIC_RCV_FIRMWARE_MOJAVE;
+ err = request_firmware(&fw, file, &sdev->pdev->dev);
+- if (err) {
+- dev_err(&sdev->pdev->dev,
+- "failed to load receive sequencer firmware %s\n", file);
++ if (err)
+ return err;
+- }
+ /* Do an initial sanity check concerning firmware size now. A further
+ * check follows below.
+ */
+@@ -1138,10 +1135,8 @@ static int slic_load_firmware(struct sli
+ file = (sdev->model == SLIC_MODEL_OASIS) ? SLIC_FIRMWARE_OASIS :
+ SLIC_FIRMWARE_MOJAVE;
+ err = request_firmware(&fw, file, &sdev->pdev->dev);
+- if (err) {
+- dev_err(&sdev->pdev->dev, "failed to load firmware %s\n", file);
++ if (err)
+ return err;
+- }
+ /* Do an initial sanity check concerning firmware size now. A further
+ * check follows below.
+ */
+Index: linux/drivers/staging/vt6656/firmware.c
+===================================================================
+--- linux.orig/drivers/staging/vt6656/firmware.c
++++ linux/drivers/staging/vt6656/firmware.c
+@@ -39,11 +39,8 @@ int vnt_download_firmware(struct vnt_pri
+ dev_dbg(dev, "---->Download firmware\n");
+
+ rc = request_firmware(&fw, FIRMWARE_NAME, dev);
+- if (rc) {
+- dev_err(dev, "firmware file %s request failed (%d)\n",
+- FIRMWARE_NAME, rc);
+- goto out;
+- }
++ if (rc)
++ goto out;
+
+ buffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
+ if (!buffer)
+Index: linux/drivers/tty/cyclades.c
+===================================================================
+--- linux.orig/drivers/tty/cyclades.c
++++ linux/drivers/tty/cyclades.c
+@@ -3489,10 +3489,8 @@ static int cyz_load_fw(struct pci_dev *p
+ int retval;
+
+ retval = request_firmware(&fw, "cyzfirm.bin", &pdev->dev);
+- if (retval) {
+- dev_err(&pdev->dev, "can't get firmware\n");
++ if (retval)
+ goto err;
+- }
+
+ /* Check whether the firmware is already loaded and running. If
+ positive, skip this board */
+Index: linux/drivers/tty/moxa.c
+===================================================================
+--- linux.orig/drivers/tty/moxa.c
++++ linux/drivers/tty/moxa.c
+@@ -862,13 +862,8 @@ static int moxa_init_board(struct moxa_b
+ }
+
+ ret = request_firmware(&fw, file, dev);
+- if (ret) {
+- printk(KERN_ERR "MOXA: request_firmware failed. Make sure "
+- "you've placed '%s' file into your firmware "
+- "loader directory (e.g. /lib/firmware)\n",
+- file);
++ if (ret)
+ goto err_free;
+- }
+
+ ret = moxa_load_fw(brd, fw);
+
+Index: linux/drivers/tty/serial/icom.c
+===================================================================
+--- linux.orig/drivers/tty/serial/icom.c
++++ linux/drivers/tty/serial/icom.c
+@@ -360,7 +360,6 @@ static void load_code(struct icom_port *
+
+ /* Load Call Setup into Adapter */
+ if (request_firmware(&fw, "icom_call_setup.bin", &dev->dev) < 0) {
+- dev_err(&dev->dev,"Unable to load icom_call_setup.bin firmware image\n");
+ status = -1;
+ goto load_code_exit;
+ }
+@@ -380,7 +379,6 @@ static void load_code(struct icom_port *
+
+ /* Load Resident DCE portion of Adapter */
+ if (request_firmware(&fw, "icom_res_dce.bin", &dev->dev) < 0) {
+- dev_err(&dev->dev,"Unable to load icom_res_dce.bin firmware image\n");
+ status = -1;
+ goto load_code_exit;
+ }
+@@ -425,7 +423,6 @@ static void load_code(struct icom_port *
+ }
+
+ if (request_firmware(&fw, "icom_asc.bin", &dev->dev) < 0) {
+- dev_err(&dev->dev,"Unable to load icom_asc.bin firmware image\n");
+ status = -1;
+ goto load_code_exit;
+ }
+Index: linux/drivers/tty/serial/ucc_uart.c
+===================================================================
+--- linux.orig/drivers/tty/serial/ucc_uart.c
++++ linux/drivers/tty/serial/ucc_uart.c
+@@ -1165,10 +1165,8 @@ static void uart_firmware_cont(const str
+ struct device *dev = context;
+ int ret;
+
+- if (!fw) {
+- dev_err(dev, "firmware not found\n");
++ if (!fw)
+ return;
+- }
+
+ firmware = (struct qe_firmware *) fw->data;
+
+Index: linux/drivers/usb/atm/cxacru.c
+===================================================================
+--- linux.orig/drivers/usb/atm/cxacru.c
++++ linux/drivers/usb/atm/cxacru.c
+@@ -1080,8 +1080,6 @@ static int cxacru_find_firmware(struct c
+ return -ENOENT;
+ }
+
+- usb_info(usbatm, "found firmware %s\n", buf);
+-
+ return 0;
+ }
+
+Index: linux/drivers/usb/atm/ueagle-atm.c
+===================================================================
+--- linux.orig/drivers/usb/atm/ueagle-atm.c
++++ linux/drivers/usb/atm/ueagle-atm.c
+@@ -650,10 +650,8 @@ static void uea_upload_pre_firmware(cons
+ int ret, size;
+
+ uea_enters(usb);
+- if (!fw_entry) {
+- uea_err(usb, "firmware is not available\n");
++ if (!fw_entry)
+ goto err;
+- }
+
+ pfw = fw_entry->data;
+ size = fw_entry->size;
+@@ -748,10 +746,6 @@ static int uea_load_firmware(struct usb_
+ ret = request_firmware_nowait(THIS_MODULE, 1, fw_name, &usb->dev,
+ GFP_KERNEL, usb,
+ uea_upload_pre_firmware);
+- if (ret)
+- uea_err(usb, "firmware %s is not available\n", fw_name);
+- else
+- uea_info(usb, "loading firmware %s\n", fw_name);
+
+ uea_leaves(usb);
+ return ret;
+@@ -913,12 +907,8 @@ static int request_dsp(struct uea_softc
+ }
+
+ ret = request_firmware(&sc->dsp_firm, dsp_name, &sc->usb_dev->dev);
+- if (ret < 0) {
+- uea_err(INS_TO_USBDEV(sc),
+- "requesting firmware %s failed with error %d\n",
+- dsp_name, ret);
++ if (ret)
+ return ret;
+- }
+
+ if (UEA_CHIP_VERSION(sc) == EAGLE_IV)
+ ret = check_dsp_e4(sc->dsp_firm->data, sc->dsp_firm->size);
+@@ -1631,12 +1621,8 @@ static int request_cmvs_old(struct uea_s
+
+ cmvs_file_name(sc, cmv_name, 1);
+ ret = request_firmware(fw, cmv_name, &sc->usb_dev->dev);
+- if (ret < 0) {
+- uea_err(INS_TO_USBDEV(sc),
+- "requesting firmware %s failed with error %d\n",
+- cmv_name, ret);
++ if (ret)
+ return ret;
+- }
+
+ data = (u8 *) (*fw)->data;
+ size = (*fw)->size;
+@@ -1673,9 +1659,6 @@ static int request_cmvs(struct uea_softc
+ "try to get older cmvs\n", cmv_name);
+ return request_cmvs_old(sc, cmvs, fw);
+ }
+- uea_err(INS_TO_USBDEV(sc),
+- "requesting firmware %s failed with error %d\n",
+- cmv_name, ret);
+ return ret;
+ }
+
+@@ -1958,11 +1941,8 @@ static int load_XILINX_firmware(struct u
+ uea_enters(INS_TO_USBDEV(sc));
+
+ ret = request_firmware(&fw_entry, fw_name, &sc->usb_dev->dev);
+- if (ret) {
+- uea_err(INS_TO_USBDEV(sc), "firmware %s is not available\n",
+- fw_name);
++ if (ret)
+ goto err0;
+- }
+
+ pfw = fw_entry->data;
+ size = fw_entry->size;
+Index: linux/drivers/usb/misc/emi26.c
+===================================================================
+--- linux.orig/drivers/usb/misc/emi26.c
++++ linux/drivers/usb/misc/emi26.c
+@@ -85,21 +85,17 @@ static int emi26_load_firmware (struct u
+
+ err = request_ihex_firmware(&loader_fw, "emi26/loader.fw", &dev->dev);
+ if (err)
+- goto nofw;
++ goto wraperr;
+
+ err = request_ihex_firmware(&bitstream_fw, "emi26/bitstream.fw",
+ &dev->dev);
+ if (err)
+- goto nofw;
++ goto wraperr;
+
+ err = request_ihex_firmware(&firmware_fw, "emi26/firmware.fw",
+ &dev->dev);
+- if (err) {
+- nofw:
+- dev_err(&dev->dev, "%s - request_firmware() failed\n",
+- __func__);
++ if (err)
+ goto wraperr;
+- }
+
+ /* Assert reset (stop the CPU in the EMI) */
+ err = emi26_set_reset(dev,1);
+Index: linux/drivers/usb/misc/ezusb.c
+===================================================================
+--- linux.orig/drivers/usb/misc/ezusb.c
++++ linux/drivers/usb/misc/ezusb.c
+@@ -76,12 +76,8 @@ static int ezusb_ihex_firmware_download(
+ const struct ihex_binrec *record;
+
+ if (request_ihex_firmware(&firmware, firmware_path,
+- &dev->dev)) {
+- dev_err(&dev->dev,
+- "%s - request \"%s\" failed\n",
+- __func__, firmware_path);
++ &dev->dev))
+ goto out;
+- }
+
+ ret = ezusb_set_reset(dev, fx.cpucs_reg, 0);
+ if (ret < 0)
+Index: linux/drivers/usb/misc/isight_firmware.c
+===================================================================
+--- linux.orig/drivers/usb/misc/isight_firmware.c
++++ linux/drivers/usb/misc/isight_firmware.c
+@@ -45,7 +45,6 @@ static int isight_firmware_load(struct u
+ return -ENOMEM;
+
+ if (request_firmware(&firmware, "isight.fw", &dev->dev) != 0) {
+- printk(KERN_ERR "Unable to load isight firmware\n");
+ ret = -ENODEV;
+ goto out;
+ }
+Index: linux/drivers/usb/serial/io_edgeport.c
+===================================================================
+--- linux.orig/drivers/usb/serial/io_edgeport.c
++++ linux/drivers/usb/serial/io_edgeport.c
+@@ -375,11 +375,8 @@ static void update_edgeport_E2PROM(struc
+
+ response = request_ihex_firmware(&fw, fw_name,
+ &edge_serial->serial->dev->dev);
+- if (response) {
+- dev_err(dev, "Failed to load image \"%s\" err %d\n",
+- fw_name, response);
++ if (response)
+ return;
+- }
+
+ rec = (const struct ihex_binrec *)fw->data;
+ BootMajorVersion = rec->data[0];
+Index: linux/drivers/usb/serial/io_ti.c
+===================================================================
+--- linux.orig/drivers/usb/serial/io_ti.c
++++ linux/drivers/usb/serial/io_ti.c
+@@ -1010,8 +1010,6 @@ static int download_fw(struct edgeport_s
+
+ status = request_firmware(&fw, fw_name, dev);
+ if (status) {
+- dev_err(dev, "Failed to load image \"%s\" err %d\n",
+- fw_name, status);
+ return status;
+ }
+
+Index: linux/drivers/usb/serial/ti_usb_3410_5052.c
+===================================================================
+--- linux.orig/drivers/usb/serial/ti_usb_3410_5052.c
++++ linux/drivers/usb/serial/ti_usb_3410_5052.c
+@@ -1689,10 +1689,8 @@ static int ti_download_firmware(struct t
+ }
+
+ check_firmware:
+- if (status) {
+- dev_err(&dev->dev, "%s - firmware not found\n", __func__);
++ if (status)
+ return -ENOENT;
+- }
+ if (fw_p->size > TI_FIRMWARE_BUF_SIZE) {
+ dev_err(&dev->dev, "%s - firmware too large %zu\n", __func__, fw_p->size);
+ release_firmware(fw_p);
+Index: linux/drivers/video/fbdev/broadsheetfb.c
+===================================================================
+--- linux.orig/drivers/video/fbdev/broadsheetfb.c
++++ linux/drivers/video/fbdev/broadsheetfb.c
+@@ -743,10 +743,8 @@ static ssize_t broadsheet_loadstore_wave
+ return -EINVAL;
+
+ err = request_firmware(&fw_entry, "broadsheet.wbf", dev);
+- if (err < 0) {
+- dev_err(dev, "Failed to get broadsheet waveform\n");
++ if (err)
+ goto err_failed;
+- }
+
+ /* try to enforce reasonable min max on waveform */
+ if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
+Index: linux/drivers/video/fbdev/metronomefb.c
+===================================================================
+--- linux.orig/drivers/video/fbdev/metronomefb.c
++++ linux/drivers/video/fbdev/metronomefb.c
+@@ -679,10 +679,8 @@ static int metronomefb_probe(struct plat
+ a) request the waveform file from userspace
+ b) process waveform and decode into metromem */
+ retval = request_firmware(&fw_entry, "metronome.wbf", &dev->dev);
+- if (retval < 0) {
+- dev_err(&dev->dev, "Failed to get waveform\n");
++ if (retval)
+ goto err_csum_table;
+- }
+
+ retval = load_waveform((u8 *) fw_entry->data, fw_entry->size, 3, 31,
+ par);
+Index: linux/sound/drivers/vx/vx_hwdep.c
+===================================================================
+--- linux.orig/sound/drivers/vx/vx_hwdep.c
++++ linux/sound/drivers/vx/vx_hwdep.c
+@@ -71,10 +71,8 @@ int snd_vx_setup_firmware(struct vx_core
+ if (! fw_files[chip->type][i])
+ continue;
+ sprintf(path, "vx/%s", fw_files[chip->type][i]);
+- if (request_firmware(&fw, path, chip->dev)) {
+- snd_printk(KERN_ERR "vx: can't load firmware %s\n", path);
++ if (request_firmware(&fw, path, chip->dev))
+ return -ENOENT;
+- }
+ err = chip->ops->load_dsp(chip, i, fw);
+ if (err < 0) {
+ release_firmware(fw);
+Index: linux/sound/isa/msnd/msnd_pinnacle.c
+===================================================================
+--- linux.orig/sound/isa/msnd/msnd_pinnacle.c
++++ linux/sound/isa/msnd/msnd_pinnacle.c
+@@ -390,15 +390,11 @@ static int upload_dsp_code(struct snd_ca
+ outb(HPBLKSEL_0, chip->io + HP_BLKS);
+
+ err = request_firmware(&init_fw, INITCODEFILE, card->dev);
+- if (err < 0) {
+- printk(KERN_ERR LOGNAME ": Error loading " INITCODEFILE);
++ if (err)
+ goto cleanup1;
+- }
+ err = request_firmware(&perm_fw, PERMCODEFILE, card->dev);
+- if (err < 0) {
+- printk(KERN_ERR LOGNAME ": Error loading " PERMCODEFILE);
++ if (err)
+ goto cleanup;
+- }
+
+ memcpy_toio(chip->mappedbase, perm_fw->data, perm_fw->size);
+ if (snd_msnd_upload_host(chip, init_fw->data, init_fw->size) < 0) {
+Index: linux/sound/isa/sscape.c
+===================================================================
+--- linux.orig/sound/isa/sscape.c
++++ linux/sound/isa/sscape.c
+@@ -544,10 +544,8 @@ static int sscape_upload_bootblock(struc
+ int ret;
+
+ ret = request_firmware(&init_fw, "scope.cod", card->dev);
+- if (ret < 0) {
+- snd_printk(KERN_ERR "sscape: Error loading scope.cod");
++ if (ret)
+ return ret;
+- }
+ ret = upload_dma_data(sscape, init_fw->data, init_fw->size);
+
+ release_firmware(init_fw);
+@@ -584,11 +582,8 @@ static int sscape_upload_microcode(struc
+ snprintf(name, sizeof(name), "sndscape.co%d", version);
+
+ err = request_firmware(&init_fw, name, card->dev);
+- if (err < 0) {
+- snd_printk(KERN_ERR "sscape: Error loading sndscape.co%d",
+- version);
++ if (err)
+ return err;
+- }
+ err = upload_dma_data(sscape, init_fw->data, init_fw->size);
+ if (err == 0)
+ snd_printk(KERN_INFO "sscape: MIDI firmware loaded %zu KBs\n",
+Index: linux/sound/isa/wavefront/wavefront_synth.c
+===================================================================
+--- linux.orig/sound/isa/wavefront/wavefront_synth.c
++++ linux/sound/isa/wavefront/wavefront_synth.c
+@@ -1957,10 +1957,8 @@ wavefront_download_firmware (snd_wavefro
+ const struct firmware *firmware;
+
+ err = request_firmware(&firmware, path, dev->card->dev);
+- if (err < 0) {
+- snd_printk(KERN_ERR "firmware (%s) download failed!!!\n", path);
++ if (err)
+ return 1;
+- }
+
+ len = 0;
+ buf = firmware->data;
+Index: linux/sound/pci/asihpi/hpidspcd.c
+===================================================================
+--- linux.orig/sound/pci/asihpi/hpidspcd.c
++++ linux/sound/pci/asihpi/hpidspcd.c
+@@ -46,8 +46,6 @@ short hpi_dsp_code_open(u32 adapter, voi
+ err = request_firmware(&firmware, fw_name, &dev->dev);
+
+ if (err || !firmware) {
+- dev_err(&dev->dev, "%d, request_firmware failed for %s\n",
+- err, fw_name);
+ goto error1;
+ }
+ if (firmware->size < sizeof(header)) {
+Index: linux/sound/pci/echoaudio/echoaudio.c
+===================================================================
+--- linux.orig/sound/pci/echoaudio/echoaudio.c
++++ linux/sound/pci/echoaudio/echoaudio.c
+@@ -60,11 +60,8 @@ static int get_firmware(const struct fir
+ "firmware requested: %s\n", card_fw[fw_index].data);
+ snprintf(name, sizeof(name), "ea/%s", card_fw[fw_index].data);
+ err = request_firmware(fw_entry, name, &chip->pci->dev);
+- if (err < 0)
+- dev_err(chip->card->dev,
+- "get_firmware(): Firmware not available (%d)\n", err);
+ #ifdef CONFIG_PM_SLEEP
+- else
++ if (!err)
+ chip->fw_cache[fw_index] = *fw_entry;
+ #endif
+ return err;
+Index: linux/sound/pci/emu10k1/emu10k1_main.c
+===================================================================
+--- linux.orig/sound/pci/emu10k1/emu10k1_main.c
++++ linux/sound/pci/emu10k1/emu10k1_main.c
+@@ -888,10 +888,8 @@ static int snd_emu10k1_emu1010_init(stru
+ dev_info(emu->card->dev, "emu1010: EMU_HANA_ID = 0x%x\n", reg);
+
+ err = snd_emu1010_load_firmware(emu, 0, &emu->firmware);
+- if (err < 0) {
+- dev_info(emu->card->dev, "emu1010: Loading Firmware failed\n");
++ if (err < 0)
+ return err;
+- }
+
+ /* ID, should read & 0x7f = 0x55 when FPGA programmed. */
+ snd_emu1010_fpga_read(emu, EMU_HANA_ID, &reg);
+Index: linux/sound/pci/hda/hda_intel.c
+===================================================================
+--- linux.orig/sound/pci/hda/hda_intel.c
++++ linux/sound/pci/hda/hda_intel.c
+@@ -2079,8 +2079,6 @@ static void azx_firmware_cb(const struct
+
+ if (fw)
+ chip->fw = fw;
+- else
+- dev_err(card->dev, "Cannot load firmware, continue without patching\n");
+ if (!chip->disabled) {
+ /* continue probing */
+ azx_probe_continue(chip);
+Index: linux/sound/pci/korg1212/korg1212.c
+===================================================================
+--- linux.orig/sound/pci/korg1212/korg1212.c
++++ linux/sound/pci/korg1212/korg1212.c
+@@ -2348,7 +2348,6 @@ static int snd_korg1212_create(struct sn
+
+ err = request_firmware(&dsp_code, "korg/k1212.dsp", &pci->dev);
+ if (err < 0) {
+- snd_printk(KERN_ERR "firmware not available\n");
+ snd_korg1212_free(korg1212);
+ return err;
+ }
+Index: linux/sound/pci/mixart/mixart_hwdep.c
+===================================================================
+--- linux.orig/sound/pci/mixart/mixart_hwdep.c
++++ linux/sound/pci/mixart/mixart_hwdep.c
+@@ -571,11 +571,8 @@ int snd_mixart_setup_firmware(struct mix
+
+ for (i = 0; i < 3; i++) {
+ sprintf(path, "mixart/%s", fw_files[i]);
+- if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
+- dev_err(&mgr->pci->dev,
+- "miXart: can't load firmware %s\n", path);
++ if (request_firmware(&fw_entry, path, &mgr->pci->dev))
+ return -ENOENT;
+- }
+ /* fake hwdep dsp record */
+ err = mixart_dsp_load(mgr, i, fw_entry);
+ release_firmware(fw_entry);
+Index: linux/sound/pci/pcxhr/pcxhr_hwdep.c
+===================================================================
+--- linux.orig/sound/pci/pcxhr/pcxhr_hwdep.c
++++ linux/sound/pci/pcxhr/pcxhr_hwdep.c
+@@ -385,12 +385,8 @@ int pcxhr_setup_firmware(struct pcxhr_mg
+ if (!fw_files[fw_set][i])
+ continue;
+ sprintf(path, "pcxhr/%s", fw_files[fw_set][i]);
+- if (request_firmware(&fw_entry, path, &mgr->pci->dev)) {
+- dev_err(&mgr->pci->dev,
+- "pcxhr: can't load firmware %s\n",
+- path);
++ if (request_firmware(&fw_entry, path, &mgr->pci->dev))
+ return -ENOENT;
+- }
+ /* fake hwdep dsp record */
+ err = pcxhr_dsp_load(mgr, i, fw_entry);
+ release_firmware(fw_entry);
+Index: linux/sound/pci/riptide/riptide.c
+===================================================================
+--- linux.orig/sound/pci/riptide/riptide.c
++++ linux/sound/pci/riptide/riptide.c
+@@ -1231,11 +1231,8 @@ static int try_to_load_firmware(struct c
+ if (!chip->fw_entry) {
+ err = request_firmware(&chip->fw_entry, "riptide.hex",
+ &chip->pci->dev);
+- if (err) {
+- snd_printk(KERN_ERR
+- "Riptide: Firmware not available %d\n", err);
++ if (err)
+ return -EIO;
+- }
+ }
+ err = loadfirmware(cif, chip->fw_entry->data, chip->fw_entry->size);
+ if (err) {
+Index: linux/sound/pci/rme9652/hdsp.c
+===================================================================
+--- linux.orig/sound/pci/rme9652/hdsp.c
++++ linux/sound/pci/rme9652/hdsp.c
+@@ -5134,11 +5134,8 @@ static int hdsp_request_fw_loader(struct
+ return -EINVAL;
+ }
+
+- if (request_firmware(&fw, fwfile, &hdsp->pci->dev)) {
+- dev_err(hdsp->card->dev,
+- "cannot load firmware %s\n", fwfile);
++ if (request_firmware(&fw, fwfile, &hdsp->pci->dev))
+ return -ENOENT;
+- }
+ if (fw->size < HDSP_FIRMWARE_SIZE) {
+ dev_err(hdsp->card->dev,
+ "too short firmware size %d (expected %d)\n",
+Index: linux/sound/soc/codecs/wm2000.c
+===================================================================
+--- linux.orig/sound/soc/codecs/wm2000.c
++++ linux/sound/soc/codecs/wm2000.c
+@@ -891,10 +891,8 @@ static int wm2000_i2c_probe(struct i2c_c
+ }
+
+ ret = request_firmware(&fw, filename, &i2c->dev);
+- if (ret != 0) {
+- dev_err(&i2c->dev, "Failed to acquire ANC data: %d\n", ret);
++ if (ret != 0)
+ goto err_supplies;
+- }
+
+ /* Pre-cook the concatenation of the register address onto the image */
+ wm2000->anc_download_size = fw->size + 2;
+Index: linux/sound/usb/6fire/firmware.c
+===================================================================
+--- linux.orig/sound/usb/6fire/firmware.c
++++ linux/sound/usb/6fire/firmware.c
+@@ -219,8 +219,6 @@ static int usb6fire_fw_ezusb_upload(
+ ret = request_firmware(&fw, fwname, &device->dev);
+ if (ret < 0) {
+ kfree(rec);
+- dev_err(&intf->dev,
+- "error requesting ezusb firmware %s.\n", fwname);
+ return ret;
+ }
+ ret = usb6fire_fw_ihex_init(fw, rec);
+@@ -296,8 +294,6 @@ static int usb6fire_fw_fpga_upload(
+
+ ret = request_firmware(&fw, fwname, &device->dev);
+ if (ret < 0) {
+- dev_err(&intf->dev, "unable to get fpga firmware %s.\n",
+- fwname);
+ kfree(buffer);
+ return -EIO;
+ }
+Index: linux/sound/pci/cs46xx/cs46xx_lib.c
+===================================================================
+--- linux.orig/sound/pci/cs46xx/cs46xx_lib.c
++++ linux/sound/pci/cs46xx/cs46xx_lib.c
+@@ -3253,11 +3253,8 @@ int snd_cs46xx_start_dsp(struct snd_cs46
+ #ifdef CONFIG_SND_CS46XX_NEW_DSP
+ for (i = 0; i < CS46XX_DSP_MODULES; i++) {
+ err = load_firmware(chip, &chip->modules[i], module_names[i]);
+- if (err < 0) {
+- dev_err(chip->card->dev, "firmware load error [%s]\n",
+- module_names[i]);
++ if (err < 0)
+ return err;
+- }
+ err = cs46xx_dsp_load_module(chip, chip->modules[i]);
+ if (err < 0) {
+ dev_err(chip->card->dev, "image download error [%s]\n",
diff --git a/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch b/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch
new file mode 100644
index 000000000..266688652
--- /dev/null
+++ b/debian/patches/bugfix/all/firmware_class-log-every-success-and-failure.patch
@@ -0,0 +1,70 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: firmware_class: Log every success and failure against given device
+Date: Sun, 09 Dec 2012 16:02:00 +0000
+Forwarded: no
+
+The hundreds of users of request_firmware() have nearly as many
+different log formats for reporting failures. They also have only the
+vaguest hint as to what went wrong; only firmware_class really knows
+that. Therefore, add specific log messages for the failure modes that
+aren't currently logged.
+
+In case of a driver that tries multiple names, this may result in the
+impression that it failed to initialise. Therefore, also log successes.
+
+This makes many error messages in drivers redundant, which will be
+removed in later patches.
+
+This does not cover the case where we fall back to a user-mode helper
+(which is no longer enabled in Debian).
+
+NOTE: hw-detect will depend on the "firmware: failed to load %s (%d)\n"
+format to detect missing firmware.
+---
+Index: linux/drivers/base/firmware_loader/main.c
+===================================================================
+--- linux.orig/drivers/base/firmware_loader/main.c
++++ linux/drivers/base/firmware_loader/main.c
+@@ -328,21 +328,22 @@ fw_get_filesystem_firmware(struct device
+ rc = kernel_read_file_from_path(path, &fw_priv->data, &size,
+ msize, id);
+ if (rc) {
+- if (rc == -ENOENT)
+- dev_dbg(device, "loading %s failed with error %d\n",
+- path, rc);
+- else
+- dev_warn(device, "loading %s failed with error %d\n",
+- path, rc);
++ dev_dbg(device, "loading %s failed with error %d\n",
++ path, rc);
+ continue;
+ }
+- dev_dbg(device, "direct-loading %s\n", fw_priv->fw_name);
++ dev_info(device, "firmware: direct-loading firmware %s\n",
++ fw_priv->fw_name);
+ fw_priv->size = size;
+ fw_state_done(fw_priv);
+ break;
+ }
+ __putname(path);
+
++ if (rc)
++ dev_err(device, "firmware: failed to load %s (%d)\n",
++ fw_priv->fw_name, rc);
++
+ return rc;
+ }
+
+Index: linux/drivers/base/firmware_loader/fallback.c
+===================================================================
+--- linux.orig/drivers/base/firmware_loader/fallback.c
++++ linux/drivers/base/firmware_loader/fallback.c
+@@ -604,7 +604,7 @@ static int fw_load_from_user_helper(stru
+ if (opt_flags & FW_OPT_NOWAIT) {
+ timeout = usermodehelper_read_lock_wait(timeout);
+ if (!timeout) {
+- dev_dbg(device, "firmware: %s loading timed out\n",
++ dev_err(device, "firmware: %s loading timed out\n",
+ name);
+ return -EBUSY;
+ }
diff --git a/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch b/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
new file mode 100644
index 000000000..d6cb0ffac
--- /dev/null
+++ b/debian/patches/bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
@@ -0,0 +1,66 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Wed, 13 Apr 2016 21:48:06 +0100
+Subject: fs: Add MODULE_SOFTDEP declarations for hard-coded crypto drivers
+Bug-Debian: https://bugs.debian.org/819725
+Forwarded: http://mid.gmane.org/20160517133631.GF7555@decadent.org.uk
+
+This helps initramfs builders and other tools to find the full
+dependencies of a module.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+[Lukas Wunner: Forward-ported to 4.11: drop parts applied upstream]
+---
+--- a/fs/btrfs/super.c
++++ b/fs/btrfs/super.c
+@@ -2536,3 +2536,4 @@ late_initcall(init_btrfs_fs);
+ module_exit(exit_btrfs_fs)
+
+ MODULE_LICENSE("GPL");
++MODULE_SOFTDEP("pre: crypto-crc32c");
+--- a/fs/crypto/crypto.c
++++ b/fs/crypto/crypto.c
+@@ -504,3 +504,4 @@ static void __exit fscrypt_exit(void)
+ module_exit(fscrypt_exit);
+
+ MODULE_LICENSE("GPL");
++MODULE_SOFTDEP("pre: crypto-aes crypto-ecb");
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -6200,6 +6200,6 @@ static void __exit ext4_exit_fs(void)
+ MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
+ MODULE_DESCRIPTION("Fourth Extended Filesystem");
+ MODULE_LICENSE("GPL");
+-MODULE_SOFTDEP("pre: crc32c");
++MODULE_SOFTDEP("pre: crypto-crc32c");
+ module_init(ext4_init_fs)
+ module_exit(ext4_exit_fs)
+--- a/fs/f2fs/super.c
++++ b/fs/f2fs/super.c
+@@ -3373,5 +3373,5 @@ module_exit(exit_f2fs_fs)
+ MODULE_AUTHOR("Samsung Electronics's Praesto Team");
+ MODULE_DESCRIPTION("Flash Friendly File System");
+ MODULE_LICENSE("GPL");
+-MODULE_SOFTDEP("pre: crc32");
++MODULE_SOFTDEP("pre: crypto-crc32");
+
+--- a/fs/jbd2/journal.c
++++ b/fs/jbd2/journal.c
+@@ -2744,6 +2744,7 @@ static void __exit journal_exit(void)
+ }
+
+ MODULE_LICENSE("GPL");
++MODULE_SOFTDEP("pre: crypto-crc32c");
+ module_init(journal_init);
+ module_exit(journal_exit);
+
+--- a/fs/nfsd/nfsctl.c
++++ b/fs/nfsd/nfsctl.c
+@@ -1337,5 +1337,8 @@ static void __exit exit_nfsd(void)
+
+ MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>");
+ MODULE_LICENSE("GPL");
++#ifdef CONFIG_NFSD_V4
++MODULE_SOFTDEP("pre: crypto-md5");
++#endif
+ module_init(init_nfsd)
+ module_exit(exit_nfsd)
diff --git a/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch b/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch
new file mode 100644
index 000000000..8e942af28
--- /dev/null
+++ b/debian/patches/bugfix/all/kbuild-fix-recordmcount-dependency.patch
@@ -0,0 +1,25 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: kbuild: Fix recordmcount dependency for OOT modules
+Date: Mon, 08 Sep 2014 18:31:24 +0100
+Forwarded: no
+
+We never rebuild anything in-tree when building an out-of-tree
+modules, so external modules should not depend on the recordmcount
+sources.
+
+Index: linux/scripts/Makefile.build
+===================================================================
+--- linux.orig/scripts/Makefile.build
++++ linux/scripts/Makefile.build
+@@ -232,6 +232,11 @@ cmd_record_mcount = \
+ endif # CC_USING_RECORD_MCOUNT
+ endif # CONFIG_FTRACE_MCOUNT_RECORD
+
++# Don't require recordmcount source for an OOT build.
++ifdef KBUILD_EXTMOD
++recordmcount_source :=
++endif
++
+ ifdef CONFIG_STACK_VALIDATION
+ ifneq ($(SKIP_STACK_VALIDATION),1)
+
diff --git a/debian/patches/bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch b/debian/patches/bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch
new file mode 100644
index 000000000..22ef11a3b
--- /dev/null
+++ b/debian/patches/bugfix/all/kbuild-include-addtree-remove-quotes-before-matching-path.patch
@@ -0,0 +1,42 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 04 Mar 2017 01:44:15 +0000
+Subject: Kbuild.include: addtree: Remove quotes before matching path
+Bug-Debian: https://bugs.debian.org/856474
+Forwarded: https://marc.info/?l=linux-kbuild&m=148987677205629
+
+systemtap currently fails to build modules when the kernel source and
+object trees are separate.
+
+systemtap adds something like -I"/usr/share/systemtap/runtime" to
+EXTRA_CFLAGS, and addtree should not adjust this as it's specifying an
+absolute directory. But since make has no understanding of shell
+quoting, it does anyway.
+
+For a long time this didn't matter, because addtree would still emit
+the original -I option after the adjusted one. However, commit
+db547ef19064 ("Kbuild: don't add obj tree in additional includes")
+changed it to remove the original -I option.
+
+Remove quotes (both double and single) before matching against the
+excluded patterns.
+
+References: https://bugs.debian.org/856474
+Reported-by: Jack Henschel <jackdev@mailbox.org>
+Reported-by: Ritesh Raj Sarraf <rrs@debian.org>
+Fixes: db547ef19064 ("Kbuild: don't add obj tree in additional includes")
+Cc: stable@vger.kernel.org # 4.8+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/scripts/Kbuild.include
+===================================================================
+--- linux.orig/scripts/Kbuild.include
++++ linux/scripts/Kbuild.include
+@@ -211,7 +211,7 @@ hdr-inst := -f $(srctree)/scripts/Makefi
+ # Prefix -I with $(srctree) if it is not an absolute path.
+ # skip if -I has no parameter
+ addtree = $(if $(patsubst -I%,%,$(1)), \
+-$(if $(filter-out -I/% -I./% -I../%,$(1)),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1))
++$(if $(filter-out -I/% -I./% -I../%,$(subst $(quote),,$(subst $(squote),,$(1)))),$(patsubst -I%,-I$(srctree)/%,$(1)),$(1)),$(1))
+
+ # Find all -I options and call addtree
+ flags = $(foreach o,$($(1)),$(if $(filter -I%,$(o)),$(call addtree,$(o)),$(o)))
diff --git a/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
new file mode 100644
index 000000000..61a4628a4
--- /dev/null
+++ b/debian/patches/bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
@@ -0,0 +1,91 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 19 Oct 2013 19:43:35 +0100
+Subject: kbuild: Use -nostdinc in compile tests
+Bug-Debian: https://bugs.debian.org/726861
+Bug-Debian: https://bugs.debian.org/717557
+Forwarded: https://marc.info/?l=linux-kbuild&m=141523555023625
+
+gcc 4.8 and later include <stdc-predef.h> by default. In some
+versions of eglibc that includes <bits/predefs.h>, but that may be
+missing when building with a biarch compiler. Also <stdc-predef.h>
+itself could be missing as we are only trying to build a kernel, not
+userland.
+
+The -nostdinc option disables this, though it isn't explicitly
+documented. This option is already used when actually building
+the kernel, but not by cc-option and other tests. This can result
+in silently miscompiling the kernel.
+
+References: https://bugs.debian.org/717557
+References: https://bugs.debian.org/726861
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+--- a/scripts/Kbuild.include
++++ b/scripts/Kbuild.include
+@@ -121,7 +121,7 @@ CC_OPTION_CFLAGS = $(filter-out $(GCC_PL
+ # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586)
+
+ cc-option = $(call __cc-option, $(CC),\
+- $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2))
++ $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS),$(1),$(2))
+
+ # hostcc-option
+ # Usage: cflags-y += $(call hostcc-option,-march=winchip-c6,-march=i586)
+@@ -131,23 +131,24 @@ hostcc-option = $(call __cc-option, $(HO
+ # cc-option-yn
+ # Usage: flag := $(call cc-option-yn,-march=winchip-c6)
+ cc-option-yn = $(call try-run,\
+- $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
++ $(CC) -Werror $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n)
+
+ # cc-disable-warning
+ # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable)
+ cc-disable-warning = $(call try-run,\
+- $(CC) -Werror $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
++ $(CC) -Werror $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1)))
+
+ # cc-name
+ # Expands to either gcc or clang
+ cc-name = $(shell $(CC) -v 2>&1 | grep -q "clang version" && echo clang || echo gcc)
+
+ # cc-version
+-cc-version = $(shell $(CONFIG_SHELL) $(srctree)/scripts/gcc-version.sh $(CC))
++cc-version = $(shell $(CONFIG_SHELL) \
++ $(srctree)/scripts/gcc-version.sh $(CC) $(NOSTDINC_FLAGS))
+
+ # cc-fullversion
+ cc-fullversion = $(shell $(CONFIG_SHELL) \
+- $(srctree)/scripts/gcc-version.sh -p $(CC))
++ $(srctree)/scripts/gcc-version.sh -p $(CC) $(NOSTDINC_FLAGS))
+
+ # cc-ifversion
+ # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
+@@ -156,7 +157,7 @@ cc-ifversion = $(shell [ $(cc-version) $
+ # cc-ldoption
+ # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both)
+ cc-ldoption = $(call try-run,\
+- $(CC) $(1) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
++ $(CC) $(1) $(NOSTDINC_FLAGS) $(KBUILD_CPPFLAGS) $(CC_OPTION_CFLAGS) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2))
+
+ # ld-option
+ # Usage: KBUILD_LDFLAGS += $(call ld-option, -X, -Y)
+--- a/Makefile
++++ b/Makefile
+@@ -661,6 +661,8 @@ else
+ KBUILD_CFLAGS += -O2
+ endif
+
++NOSTDINC_FLAGS += -nostdinc
++
+ # Tell gcc to never replace conditional load with a non-conditional one
+ KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0)
+ KBUILD_CFLAGS += $(call cc-option,-fno-allow-store-data-races)
+@@ -781,7 +783,7 @@ LDFLAGS_vmlinux += --gc-sections
+ endif
+
+ # arch Makefile may override CC so keep this after arch Makefile is included
+-NOSTDINC_FLAGS += -nostdinc -isystem $(shell $(CC) -print-file-name=include)
++NOSTDINC_FLAGS += -isystem $(shell $(CC) -print-file-name=include)
+
+ # warn about C99 declaration after statement
+ KBUILD_CFLAGS += $(call cc-option,-Wdeclaration-after-statement,)
diff --git a/debian/patches/bugfix/all/lib-genalloc-add-gen_pool_dma_zalloc-for-zeroed-DMA.patch b/debian/patches/bugfix/all/lib-genalloc-add-gen_pool_dma_zalloc-for-zeroed-DMA.patch
new file mode 100644
index 000000000..360a16aa5
--- /dev/null
+++ b/debian/patches/bugfix/all/lib-genalloc-add-gen_pool_dma_zalloc-for-zeroed-DMA.patch
@@ -0,0 +1,77 @@
+From: Fredrik Noring <noring@nocrew.org>
+Date: Wed, 29 May 2019 13:28:39 +0300
+Subject: lib/genalloc: add gen_pool_dma_zalloc() for zeroed DMA allocations
+Origin: https://git.kernel.org/linus/da83a722959a82733c3ca60030cc364ca2318c5a
+
+gen_pool_dma_zalloc() is a zeroed memory variant of
+gen_pool_dma_alloc(). Also document the return values of both, and
+indicate NULL as a "%NULL" constant.
+
+Signed-off-by: Fredrik Noring <noring@nocrew.org>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ include/linux/genalloc.h | 1 +
+ lib/genalloc.c | 29 ++++++++++++++++++++++++++++-
+ 2 files changed, 29 insertions(+), 1 deletion(-)
+
+--- a/include/linux/genalloc.h
++++ b/include/linux/genalloc.h
+@@ -121,6 +121,7 @@
+ genpool_algo_t algo, void *data);
+ extern void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size,
+ dma_addr_t *dma);
++void *gen_pool_dma_zalloc(struct gen_pool *pool, size_t size, dma_addr_t *dma);
+ extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
+ extern void gen_pool_for_each_chunk(struct gen_pool *,
+ void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
+--- a/lib/genalloc.c
++++ b/lib/genalloc.c
+@@ -337,12 +337,14 @@
+ * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage
+ * @pool: pool to allocate from
+ * @size: number of bytes to allocate from the pool
+- * @dma: dma-view physical address return value. Use NULL if unneeded.
++ * @dma: dma-view physical address return value. Use %NULL if unneeded.
+ *
+ * Allocate the requested number of bytes from the specified pool.
+ * Uses the pool allocation function (with first-fit algorithm by default).
+ * Can not be used in NMI handler on architectures without
+ * NMI-safe cmpxchg implementation.
++ *
++ * Return: virtual address of the allocated memory, or %NULL on failure
+ */
+ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma)
+ {
+@@ -363,6 +365,31 @@
+ EXPORT_SYMBOL(gen_pool_dma_alloc);
+
+ /**
++ * gen_pool_dma_zalloc - allocate special zeroed memory from the pool for
++ * DMA usage
++ * @pool: pool to allocate from
++ * @size: number of bytes to allocate from the pool
++ * @dma: dma-view physical address return value. Use %NULL if unneeded.
++ *
++ * Allocate the requested number of zeroed bytes from the specified pool.
++ * Uses the pool allocation function (with first-fit algorithm by default).
++ * Can not be used in NMI handler on architectures without
++ * NMI-safe cmpxchg implementation.
++ *
++ * Return: virtual address of the allocated zeroed memory, or %NULL on failure
++ */
++void *gen_pool_dma_zalloc(struct gen_pool *pool, size_t size, dma_addr_t *dma)
++{
++ void *vaddr = gen_pool_dma_alloc(pool, size, dma);
++
++ if (vaddr)
++ memset(vaddr, 0, size);
++
++ return vaddr;
++}
++EXPORT_SYMBOL(gen_pool_dma_zalloc);
++
++/**
+ * gen_pool_free - free allocated special memory back to the pool
+ * @pool: pool to free to
+ * @addr: starting address of memory to free back to pool
diff --git a/debian/patches/bugfix/all/libbpf-add-soname-to-shared-object.patch b/debian/patches/bugfix/all/libbpf-add-soname-to-shared-object.patch
new file mode 100644
index 000000000..40f2bcc1d
--- /dev/null
+++ b/debian/patches/bugfix/all/libbpf-add-soname-to-shared-object.patch
@@ -0,0 +1,56 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sun, 02 Dec 2018 23:26:03 +0000
+Subject: libbpf: add SONAME to shared object
+
+tools/lib/bpf/libbpf: Add proper version to the shared object.
+
+Add versioning to the shared object to make it easier on distros to
+distribute the library without having to watch for API/ABI versioning.
+
+This is similar to the change made to tools/lib/lockdep/Makefile in
+be227b45fb228adff4371b8de9e3989904209ff4.
+
+Signed-off-by: Hilko Bengen <bengen@debian.org>
+[bwh: Drop unnecessary changes]
+---
+Index: linux/tools/lib/bpf/Makefile
+===================================================================
+--- linux.orig/tools/lib/bpf/Makefile
++++ linux/tools/lib/bpf/Makefile
+@@ -94,7 +94,7 @@ export prefix libdir src obj
+ libdir_SQ = $(subst ','\'',$(libdir))
+ libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
+
+-LIB_FILE = libbpf.a libbpf.so
++LIB_FILE = libbpf.a libbpf.so.$(LIBBPF_VERSION)
+
+ VERSION = $(BPF_VERSION)
+ PATCHLEVEL = $(BPF_PATCHLEVEL)
+@@ -103,7 +103,7 @@ EXTRAVERSION = $(BPF_EXTRAVERSION)
+ OBJ = $@
+ N =
+
+-LIBBPF_VERSION = $(BPF_VERSION).$(BPF_PATCHLEVEL).$(BPF_EXTRAVERSION)
++LIBBPF_VERSION = $(shell make --no-print-directory -sC ../../.. kernelversion | cut -d. -f1,2)
+
+ # Set compile option CFLAGS
+ ifdef EXTRA_CFLAGS
+@@ -169,8 +169,8 @@ $(BPF_IN): force elfdep bpfdep
+ echo "Warning: Kernel ABI header at 'tools/include/uapi/linux/if_link.h' differs from latest version at 'include/uapi/linux/if_link.h'" >&2 )) || true
+ $(Q)$(MAKE) $(build)=libbpf
+
+-$(OUTPUT)libbpf.so: $(BPF_IN)
+- $(QUIET_LINK)$(CC) --shared $^ -o $@
++$(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
++ $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,$(@F) -o $@
+
+ $(OUTPUT)libbpf.a: $(BPF_IN)
+ $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
+@@ -185,6 +185,7 @@ endef
+ install_lib: all_cmd
+ $(call QUIET_INSTALL, $(LIB_FILE)) \
+ $(call do_install,$(LIB_FILE),$(libdir_SQ))
++ $(Q)ln -sf libbpf.so.$(LIBBPF_VERSION) $(DESTDIR_SQ)$(libdir_SQ)/libbpf.so
+
+ install_headers:
+ $(call QUIET_INSTALL, headers) \
diff --git a/debian/patches/bugfix/all/libbpf-generate-pkg-config.patch b/debian/patches/bugfix/all/libbpf-generate-pkg-config.patch
new file mode 100644
index 000000000..63ecffe5f
--- /dev/null
+++ b/debian/patches/bugfix/all/libbpf-generate-pkg-config.patch
@@ -0,0 +1,90 @@
+Author: Luca Boccassi <bluca@debian.org>
+Description: generate pkg-config file for libbpf
+ Generate a libbpf.pc file at build time so that users can rely
+ on pkg-config to find the library, its CFLAGS and LDFLAGS.
+Origin: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=dd399ac9e343c7573c47d6820e4a23013c54749d
+Applied-Upstream: yes
+Index: linux/tools/lib/bpf/.gitignore
+===================================================================
+--- linux.orig/tools/lib/bpf/.gitignore
++++ linux/tools/lib/bpf/.gitignore
+@@ -1,2 +1,3 @@
+ libbpf_version.h
++libbpf.pc
+ FEATURE-DUMP.libbpf
+Index: linux/tools/lib/bpf/Makefile
+===================================================================
+--- linux.orig/tools/lib/bpf/Makefile
++++ linux/tools/lib/bpf/Makefile
+@@ -95,6 +95,7 @@ libdir_SQ = $(subst ','\'',$(libdir))
+ libdir_relative_SQ = $(subst ','\'',$(libdir_relative))
+
+ LIB_FILE = libbpf.a libbpf.so.$(LIBBPF_VERSION)
++PC_FILE = libbpf.pc
+
+ VERSION = $(BPF_VERSION)
+ PATCHLEVEL = $(BPF_PATCHLEVEL)
+@@ -144,8 +145,9 @@ include $(srctree)/tools/build/Makefile.
+
+ BPF_IN := $(OUTPUT)libbpf-in.o
+ LIB_FILE := $(addprefix $(OUTPUT),$(LIB_FILE))
++PC_FILE := $(addprefix $(OUTPUT),$(PC_FILE))
+
+-CMD_TARGETS = $(LIB_FILE)
++CMD_TARGETS = $(LIB_FILE) $(PC_FILE)
+
+ TARGETS = $(CMD_TARGETS)
+
+@@ -175,6 +177,12 @@ $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(
+ $(OUTPUT)libbpf.a: $(BPF_IN)
+ $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
+
++$(OUTPUT)libbpf.pc:
++ $(QUIET_GEN)sed -e "s|@PREFIX@|$(prefix)|" \
++ -e "s|@LIBDIR@|$(libdir_SQ)|" \
++ -e "s|@VERSION@|$(LIBBPF_VERSION)|" \
++ < libbpf.pc.template > $@
++
+ define do_install
+ if [ ! -d '$(DESTDIR_SQ)$2' ]; then \
+ $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$2'; \
+@@ -193,7 +201,12 @@ install_headers:
+ $(call do_install,libbpf.h,$(prefix)/include/bpf,644);
+ $(call do_install,btf.h,$(prefix)/include/bpf,644);
+
+-install: install_lib
++install_pkgconfig: $(PC_FILE)
++ $(call QUIET_INSTALL, $(PC_FILE)) \
++ $(call do_install,$(PC_FILE),$(libdir_SQ)/pkgconfig,644)
++
++
++install: install_lib install_pkgconfig
+
+ ### Cleaning rules
+
+@@ -202,7 +215,7 @@ config-clean:
+ $(Q)$(MAKE) -C $(srctree)/tools/build/feature/ clean >/dev/null
+
+ clean:
+- $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so .*.d .*.cmd \
++ $(call QUIET_CLEAN, libbpf) $(RM) *.o *~ $(TARGETS) *.a *.so .*.d .*.cmd *.pc \
+ $(RM) LIBBPF-CFLAGS
+ $(call QUIET_CLEAN, core-gen) $(RM) $(OUTPUT)FEATURE-DUMP.libbpf
+
+Index: linux/tools/lib/bpf/libbpf.pc.template
+===================================================================
+--- /dev/null
++++ linux/tools/lib/bpf/libbpf.pc.template
+@@ -0,0 +1,12 @@
++# SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause)
++
++prefix=@PREFIX@
++libdir=@LIBDIR@
++includedir=${prefix}/include
++
++Name: libbpf
++Description: BPF library
++Version: @VERSION@
++Libs: -L${libdir} -lbpf
++Requires.private: libelf
++Cflags: -I${includedir}
diff --git a/debian/patches/bugfix/all/libbpf-link-shared-object-with-libelf.patch b/debian/patches/bugfix/all/libbpf-link-shared-object-with-libelf.patch
new file mode 100644
index 000000000..f02cb07e2
--- /dev/null
+++ b/debian/patches/bugfix/all/libbpf-link-shared-object-with-libelf.patch
@@ -0,0 +1,22 @@
+From: Hilko Bengen <bengen@debian.org>
+Date: Sun, 02 Dec 2018 23:26:03 +0000
+Subject: libbpf: link shared object with libelf
+
+libbpf.so needs to be linked against libelf to avoid missing symbols.
+
+Signed-off-by: Hilko Bengen <bengen@debian.org>
+
+---
+Index: linux/tools/lib/bpf/Makefile
+===================================================================
+--- linux.orig/tools/lib/bpf/Makefile
++++ linux/tools/lib/bpf/Makefile
+@@ -170,7 +170,7 @@ $(BPF_IN): force elfdep bpfdep
+ $(Q)$(MAKE) $(build)=libbpf
+
+ $(OUTPUT)libbpf.so.$(LIBBPF_VERSION): $(BPF_IN)
+- $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,$(@F) -o $@
++ $(QUIET_LINK)$(CC) --shared $^ -lelf -Wl,-soname,$(@F) -o $@
+
+ $(OUTPUT)libbpf.a: $(BPF_IN)
+ $(QUIET_LINK)$(RM) $@; $(AR) rcs $@ $^
diff --git a/debian/patches/bugfix/all/libcpupower-hide-private-function.patch b/debian/patches/bugfix/all/libcpupower-hide-private-function.patch
new file mode 100644
index 000000000..dba71b64e
--- /dev/null
+++ b/debian/patches/bugfix/all/libcpupower-hide-private-function.patch
@@ -0,0 +1,22 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sat, 01 Dec 2018 19:22:50 +0000
+Subject: libcpupower: Hide private function
+
+cpupower_read_sysfs() (previously known as sysfs_read_file()) is an
+internal function in libcpupower and should not be exported when
+libcpupower is a shared library. Change its visibility to "hidden".
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/power/cpupower/lib/cpupower.c
+===================================================================
+--- linux.orig/tools/power/cpupower/lib/cpupower.c
++++ linux/tools/power/cpupower/lib/cpupower.c
+@@ -15,6 +15,7 @@
+ #include "cpupower.h"
+ #include "cpupower_intern.h"
+
++__attribute__((visibility("hidden")))
+ unsigned int cpupower_read_sysfs(const char *path, char *buf, size_t buflen)
+ {
+ int fd;
diff --git a/debian/patches/bugfix/all/module-disable-matching-missing-version-crc.patch b/debian/patches/bugfix/all/module-disable-matching-missing-version-crc.patch
new file mode 100644
index 000000000..9c3461019
--- /dev/null
+++ b/debian/patches/bugfix/all/module-disable-matching-missing-version-crc.patch
@@ -0,0 +1,25 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 02 Dec 2016 23:06:18 +0000
+Subject: module: Disable matching missing version CRC
+Forwarded: not-needed
+
+This partly reverts commit cd3caefb4663e3811d37cc2afad3cce642d60061.
+We want to fail closed if a symbol version CRC is missing, as the
+alternative may allow subverting module signing.
+---
+Index: linux/kernel/module.c
+===================================================================
+--- linux.orig/kernel/module.c
++++ linux/kernel/module.c
+@@ -1317,9 +1317,8 @@ static int check_version(const struct lo
+ goto bad_version;
+ }
+
+- /* Broken toolchain. Warn once, then let it go.. */
+- pr_warn_once("%s: no symbol version for %s\n", info->name, symname);
+- return 1;
++ pr_warn("%s: no symbol version for %s\n", info->name, symname);
++ return 0;
+
+ bad_version:
+ pr_warn("%s: disagrees about version of symbol %s\n",
diff --git a/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch b/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch
new file mode 100644
index 000000000..ce3b63af3
--- /dev/null
+++ b/debian/patches/bugfix/all/mt76-use-the-correct-hweight8-function.patch
@@ -0,0 +1,30 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Tue, 12 Feb 2019 15:20:48 +0000
+Subject: mt76: Use the correct hweight8() function
+Forwarded: https://marc.info/?l=linux-wireless&m=154998579614180&w=2
+
+mt76_init_stream_cap() and mt76_get_txpower() call __sw_hweight8()
+directly, but that's only defined if CONFIG_GENERIC_HWEIGHT is
+enabled. The function that works on all architectures is hweight8().
+
+Fixes: 551e1ef4d291 ("mt76: add mt76_init_stream_cap routine")
+Fixes: 9313faacbb4e ("mt76: move mt76x02_get_txpower to mt76 core")
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+[bwh: For 4.19, drop change in mt76_get_txpower()]
+---
+ drivers/net/wireless/mediatek/mt76/mac80211.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux/drivers/net/wireless/mediatek/mt76/mac80211.c
+===================================================================
+--- linux.orig/drivers/net/wireless/mediatek/mt76/mac80211.c
++++ linux/drivers/net/wireless/mediatek/mt76/mac80211.c
+@@ -124,7 +124,7 @@ static void mt76_init_stream_cap(struct
+ bool vht)
+ {
+ struct ieee80211_sta_ht_cap *ht_cap = &sband->ht_cap;
+- int i, nstream = __sw_hweight8(dev->antenna_mask);
++ int i, nstream = hweight8(dev->antenna_mask);
+ struct ieee80211_sta_vht_cap *vht_cap;
+ u16 mcs_map = 0;
+
diff --git a/debian/patches/bugfix/all/net_sched-let-qdisc_put-accept-null-pointer.patch b/debian/patches/bugfix/all/net_sched-let-qdisc_put-accept-null-pointer.patch
new file mode 100644
index 000000000..3f259ac4c
--- /dev/null
+++ b/debian/patches/bugfix/all/net_sched-let-qdisc_put-accept-null-pointer.patch
@@ -0,0 +1,50 @@
+From: Diederik de Haas <didi.debian@cknow.org>
+Date: Wed, 22 Jun 2022 11:44:05 +0200
+Subject: net_sched: let qdisc_put() accept NULL pointer
+Bug-Debian: https://bugs.debian.org/1013299
+
+In commit 92833e8b5db6c209e9311ac8c6a44d3bf1856659 titled
+"net: sched: rename qdisc_destroy() to qdisc_put()" part of the
+functionality of qdisc_destroy() was moved into a (for linux-4.19.y)
+new function qdisk_put(), and the previous calls to qdisc_destroy()
+were changed to qdisk_put().
+This made it similar to f.e. 5.10.y and current master.
+
+There was one part of qdisc_destroy() not moved over to qdisc_put() and
+that was the check for a NULL value, causing oopses.
+(See upstream commit: 6efb971ba8edfbd80b666f29de12882852f095ae)
+This patch fixes that.
+
+Fixes: 92833e8b5db6c209e9311ac8c6a44d3bf1856659
+Reported-by: Thorsten Glaser <tg@mirbsd.de>
+Link: https://bugs.debian.org/1013299
+---
+ net/sched/sch_generic.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
+index 7c1b1eff84f4..cad2586c3473 100644
+--- a/net/sched/sch_generic.c
++++ b/net/sched/sch_generic.c
+@@ -970,8 +970,6 @@ static void qdisc_destroy(struct Qdisc *qdisc)
+ const struct Qdisc_ops *ops;
+ struct sk_buff *skb, *tmp;
+
+- if (!qdisc)
+- return;
+ ops = qdisc->ops;
+
+ #ifdef CONFIG_NET_SCHED
+@@ -1003,6 +1001,9 @@ static void qdisc_destroy(struct Qdisc *qdisc)
+
+ void qdisc_put(struct Qdisc *qdisc)
+ {
++ if (!qdisc)
++ return;
++
+ if (qdisc->flags & TCQ_F_BUILTIN ||
+ !refcount_dec_and_test(&qdisc->refcnt))
+ return;
+--
+2.36.1
+
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-event_anal.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-event_anal.patch
new file mode 100644
index 000000000..d50476bca
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-event_anal.patch
@@ -0,0 +1,153 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 1 Mar 2019 17:19:00 -0800
+Subject: perf script python: Add Python3 support to event_analyzing_sample.py
+Origin: https://git.kernel.org/linus/c253c72e9d6723c8b078beb362f050059ef5de39
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the event_analyzing_sample.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Feng Tang <feng.tang@intel.com>
+Link: http://lkml.kernel.org/r/20190302011903.2416-5-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/event_analyzing_sample.py | 48 ++++++++++----------
+ 1 file changed, 25 insertions(+), 23 deletions(-)
+
+--- a/tools/perf/scripts/python/event_analyzing_sample.py
++++ b/tools/perf/scripts/python/event_analyzing_sample.py
+@@ -15,6 +15,8 @@
+ # for a x86 HW PMU event: PEBS with load latency data.
+ #
+
++from __future__ import print_function
++
+ import os
+ import sys
+ import math
+@@ -37,7 +39,7 @@ con = sqlite3.connect("/dev/shm/perf.db"
+ con.isolation_level = None
+
+ def trace_begin():
+- print "In trace_begin:\n"
++ print("In trace_begin:\n")
+
+ #
+ # Will create several tables at the start, pebs_ll is for PEBS data with
+@@ -76,12 +78,12 @@ def process_event(param_dict):
+ name = param_dict["ev_name"]
+
+ # Symbol and dso info are not always resolved
+- if (param_dict.has_key("dso")):
++ if ("dso" in param_dict):
+ dso = param_dict["dso"]
+ else:
+ dso = "Unknown_dso"
+
+- if (param_dict.has_key("symbol")):
++ if ("symbol" in param_dict):
+ symbol = param_dict["symbol"]
+ else:
+ symbol = "Unknown_symbol"
+@@ -102,7 +104,7 @@ def insert_db(event):
+ event.ip, event.status, event.dse, event.dla, event.lat))
+
+ def trace_end():
+- print "In trace_end:\n"
++ print("In trace_end:\n")
+ # We show the basic info for the 2 type of event classes
+ show_general_events()
+ show_pebs_ll()
+@@ -123,29 +125,29 @@ def show_general_events():
+ # Check the total record number in the table
+ count = con.execute("select count(*) from gen_events")
+ for t in count:
+- print "There is %d records in gen_events table" % t[0]
++ print("There is %d records in gen_events table" % t[0])
+ if t[0] == 0:
+ return
+
+- print "Statistics about the general events grouped by thread/symbol/dso: \n"
++ print("Statistics about the general events grouped by thread/symbol/dso: \n")
+
+ # Group by thread
+ commq = con.execute("select comm, count(comm) from gen_events group by comm order by -count(comm)")
+- print "\n%16s %8s %16s\n%s" % ("comm", "number", "histogram", "="*42)
++ print("\n%16s %8s %16s\n%s" % ("comm", "number", "histogram", "="*42))
+ for row in commq:
+- print "%16s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%16s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ # Group by symbol
+- print "\n%32s %8s %16s\n%s" % ("symbol", "number", "histogram", "="*58)
++ print("\n%32s %8s %16s\n%s" % ("symbol", "number", "histogram", "="*58))
+ symbolq = con.execute("select symbol, count(symbol) from gen_events group by symbol order by -count(symbol)")
+ for row in symbolq:
+- print "%32s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%32s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ # Group by dso
+- print "\n%40s %8s %16s\n%s" % ("dso", "number", "histogram", "="*74)
++ print("\n%40s %8s %16s\n%s" % ("dso", "number", "histogram", "="*74))
+ dsoq = con.execute("select dso, count(dso) from gen_events group by dso order by -count(dso)")
+ for row in dsoq:
+- print "%40s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%40s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ #
+ # This function just shows the basic info, and we could do more with the
+@@ -156,35 +158,35 @@ def show_pebs_ll():
+
+ count = con.execute("select count(*) from pebs_ll")
+ for t in count:
+- print "There is %d records in pebs_ll table" % t[0]
++ print("There is %d records in pebs_ll table" % t[0])
+ if t[0] == 0:
+ return
+
+- print "Statistics about the PEBS Load Latency events grouped by thread/symbol/dse/latency: \n"
++ print("Statistics about the PEBS Load Latency events grouped by thread/symbol/dse/latency: \n")
+
+ # Group by thread
+ commq = con.execute("select comm, count(comm) from pebs_ll group by comm order by -count(comm)")
+- print "\n%16s %8s %16s\n%s" % ("comm", "number", "histogram", "="*42)
++ print("\n%16s %8s %16s\n%s" % ("comm", "number", "histogram", "="*42))
+ for row in commq:
+- print "%16s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%16s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ # Group by symbol
+- print "\n%32s %8s %16s\n%s" % ("symbol", "number", "histogram", "="*58)
++ print("\n%32s %8s %16s\n%s" % ("symbol", "number", "histogram", "="*58))
+ symbolq = con.execute("select symbol, count(symbol) from pebs_ll group by symbol order by -count(symbol)")
+ for row in symbolq:
+- print "%32s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%32s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ # Group by dse
+ dseq = con.execute("select dse, count(dse) from pebs_ll group by dse order by -count(dse)")
+- print "\n%32s %8s %16s\n%s" % ("dse", "number", "histogram", "="*58)
++ print("\n%32s %8s %16s\n%s" % ("dse", "number", "histogram", "="*58))
+ for row in dseq:
+- print "%32s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%32s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ # Group by latency
+ latq = con.execute("select lat, count(lat) from pebs_ll group by lat order by lat")
+- print "\n%32s %8s %16s\n%s" % ("latency", "number", "histogram", "="*58)
++ print("\n%32s %8s %16s\n%s" % ("latency", "number", "histogram", "="*58))
+ for row in latq:
+- print "%32s %8d %s" % (row[0], row[1], num2sym(row[1]))
++ print("%32s %8d %s" % (row[0], row[1], num2sym(row[1])))
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+- print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
++ print (' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())]))
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-.patch
new file mode 100644
index 000000000..25633c098
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-.patch
@@ -0,0 +1,214 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 8 Mar 2019 16:05:16 -0800
+Subject: perf script python: Add Python3 support to export-to-postgresql.py
+Origin: https://git.kernel.org/linus/1937b0560c3ea43b1b0f7d3617949ca50de8f8c0
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the export-to-postgresql.py script.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190309000518.2438-3-tonyj@suse.de
+Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/export-to-postgresql.py | 58 +++++++++++++++-------
+ 1 file changed, 41 insertions(+), 17 deletions(-)
+
+--- a/tools/perf/scripts/python/export-to-postgresql.py
++++ b/tools/perf/scripts/python/export-to-postgresql.py
+@@ -10,6 +10,8 @@
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ # more details.
+
++from __future__ import print_function
++
+ import os
+ import sys
+ import struct
+@@ -199,6 +201,18 @@ import datetime
+
+ from PySide.QtSql import *
+
++if sys.version_info < (3, 0):
++ def toserverstr(str):
++ return str
++ def toclientstr(str):
++ return str
++else:
++ # Assume UTF-8 server_encoding and client_encoding
++ def toserverstr(str):
++ return bytes(str, "UTF_8")
++ def toclientstr(str):
++ return bytes(str, "UTF_8")
++
+ # Need to access PostgreSQL C library directly to use COPY FROM STDIN
+ from ctypes import *
+ libpq = CDLL("libpq.so.5")
+@@ -234,12 +248,14 @@ perf_db_export_mode = True
+ perf_db_export_calls = False
+ perf_db_export_callchains = False
+
++def printerr(*args, **kw_args):
++ print(*args, file=sys.stderr, **kw_args)
+
+ def usage():
+- print >> sys.stderr, "Usage is: export-to-postgresql.py <database name> [<columns>] [<calls>] [<callchains>]"
+- print >> sys.stderr, "where: columns 'all' or 'branches'"
+- print >> sys.stderr, " calls 'calls' => create calls and call_paths table"
+- print >> sys.stderr, " callchains 'callchains' => create call_paths table"
++ printerr("Usage is: export-to-postgresql.py <database name> [<columns>] [<calls>] [<callchains>]")
++ printerr("where: columns 'all' or 'branches'")
++ printerr(" calls 'calls' => create calls and call_paths table")
++ printerr(" callchains 'callchains' => create call_paths table")
+ raise Exception("Too few arguments")
+
+ if (len(sys.argv) < 2):
+@@ -273,7 +289,7 @@ def do_query(q, s):
+ return
+ raise Exception("Query failed: " + q.lastError().text())
+
+-print datetime.datetime.today(), "Creating database..."
++print(datetime.datetime.today(), "Creating database...")
+
+ db = QSqlDatabase.addDatabase('QPSQL')
+ query = QSqlQuery(db)
+@@ -504,12 +520,12 @@ do_query(query, 'CREATE VIEW samples_vie
+ ' FROM samples')
+
+
+-file_header = struct.pack("!11sii", "PGCOPY\n\377\r\n\0", 0, 0)
+-file_trailer = "\377\377"
++file_header = struct.pack("!11sii", b"PGCOPY\n\377\r\n\0", 0, 0)
++file_trailer = b"\377\377"
+
+ def open_output_file(file_name):
+ path_name = output_dir_name + "/" + file_name
+- file = open(path_name, "w+")
++ file = open(path_name, "wb+")
+ file.write(file_header)
+ return file
+
+@@ -524,13 +540,13 @@ def copy_output_file_direct(file, table_
+
+ # Use COPY FROM STDIN because security may prevent postgres from accessing the files directly
+ def copy_output_file(file, table_name):
+- conn = PQconnectdb("dbname = " + dbname)
++ conn = PQconnectdb(toclientstr("dbname = " + dbname))
+ if (PQstatus(conn)):
+ raise Exception("COPY FROM STDIN PQconnectdb failed")
+ file.write(file_trailer)
+ file.seek(0)
+ sql = "COPY " + table_name + " FROM STDIN (FORMAT 'binary')"
+- res = PQexec(conn, sql)
++ res = PQexec(conn, toclientstr(sql))
+ if (PQresultStatus(res) != 4):
+ raise Exception("COPY FROM STDIN PQexec failed")
+ data = file.read(65536)
+@@ -564,7 +580,7 @@ if perf_db_export_calls:
+ call_file = open_output_file("call_table.bin")
+
+ def trace_begin():
+- print datetime.datetime.today(), "Writing to intermediate files..."
++ print(datetime.datetime.today(), "Writing to intermediate files...")
+ # id == 0 means unknown. It is easier to create records for them than replace the zeroes with NULLs
+ evsel_table(0, "unknown")
+ machine_table(0, 0, "unknown")
+@@ -579,7 +595,7 @@ def trace_begin():
+ unhandled_count = 0
+
+ def trace_end():
+- print datetime.datetime.today(), "Copying to database..."
++ print(datetime.datetime.today(), "Copying to database...")
+ copy_output_file(evsel_file, "selected_events")
+ copy_output_file(machine_file, "machines")
+ copy_output_file(thread_file, "threads")
+@@ -594,7 +610,7 @@ def trace_end():
+ if perf_db_export_calls:
+ copy_output_file(call_file, "calls")
+
+- print datetime.datetime.today(), "Removing intermediate files..."
++ print(datetime.datetime.today(), "Removing intermediate files...")
+ remove_output_file(evsel_file)
+ remove_output_file(machine_file)
+ remove_output_file(thread_file)
+@@ -609,7 +625,7 @@ def trace_end():
+ if perf_db_export_calls:
+ remove_output_file(call_file)
+ os.rmdir(output_dir_name)
+- print datetime.datetime.today(), "Adding primary keys"
++ print(datetime.datetime.today(), "Adding primary keys")
+ do_query(query, 'ALTER TABLE selected_events ADD PRIMARY KEY (id)')
+ do_query(query, 'ALTER TABLE machines ADD PRIMARY KEY (id)')
+ do_query(query, 'ALTER TABLE threads ADD PRIMARY KEY (id)')
+@@ -624,7 +640,7 @@ def trace_end():
+ if perf_db_export_calls:
+ do_query(query, 'ALTER TABLE calls ADD PRIMARY KEY (id)')
+
+- print datetime.datetime.today(), "Adding foreign keys"
++ print(datetime.datetime.today(), "Adding foreign keys")
+ do_query(query, 'ALTER TABLE threads '
+ 'ADD CONSTRAINT machinefk FOREIGN KEY (machine_id) REFERENCES machines (id),'
+ 'ADD CONSTRAINT processfk FOREIGN KEY (process_id) REFERENCES threads (id)')
+@@ -659,8 +675,8 @@ def trace_end():
+ do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)')
+
+ if (unhandled_count):
+- print datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events"
+- print datetime.datetime.today(), "Done"
++ print(datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events")
++ print(datetime.datetime.today(), "Done")
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+ global unhandled_count
+@@ -670,12 +686,14 @@ def sched__sched_switch(*x):
+ pass
+
+ def evsel_table(evsel_id, evsel_name, *x):
++ evsel_name = toserverstr(evsel_name)
+ n = len(evsel_name)
+ fmt = "!hiqi" + str(n) + "s"
+ value = struct.pack(fmt, 2, 8, evsel_id, n, evsel_name)
+ evsel_file.write(value)
+
+ def machine_table(machine_id, pid, root_dir, *x):
++ root_dir = toserverstr(root_dir)
+ n = len(root_dir)
+ fmt = "!hiqiii" + str(n) + "s"
+ value = struct.pack(fmt, 3, 8, machine_id, 4, pid, n, root_dir)
+@@ -686,6 +704,7 @@ def thread_table(thread_id, machine_id,
+ thread_file.write(value)
+
+ def comm_table(comm_id, comm_str, *x):
++ comm_str = toserverstr(comm_str)
+ n = len(comm_str)
+ fmt = "!hiqi" + str(n) + "s"
+ value = struct.pack(fmt, 2, 8, comm_id, n, comm_str)
+@@ -697,6 +716,9 @@ def comm_thread_table(comm_thread_id, co
+ comm_thread_file.write(value)
+
+ def dso_table(dso_id, machine_id, short_name, long_name, build_id, *x):
++ short_name = toserverstr(short_name)
++ long_name = toserverstr(long_name)
++ build_id = toserverstr(build_id)
+ n1 = len(short_name)
+ n2 = len(long_name)
+ n3 = len(build_id)
+@@ -705,12 +727,14 @@ def dso_table(dso_id, machine_id, short_
+ dso_file.write(value)
+
+ def symbol_table(symbol_id, dso_id, sym_start, sym_end, binding, symbol_name, *x):
++ symbol_name = toserverstr(symbol_name)
+ n = len(symbol_name)
+ fmt = "!hiqiqiqiqiii" + str(n) + "s"
+ value = struct.pack(fmt, 6, 8, symbol_id, 8, dso_id, 8, sym_start, 8, sym_end, 4, binding, n, symbol_name)
+ symbol_file.write(value)
+
+ def branch_type_table(branch_type, name, *x):
++ name = toserverstr(name)
+ n = len(name)
+ fmt = "!hiii" + str(n) + "s"
+ value = struct.pack(fmt, 2, 4, branch_type, n, name)
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-ebf6c5c181ab.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-ebf6c5c181ab.patch
new file mode 100644
index 000000000..4301e54b6
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-export-to-ebf6c5c181ab.patch
@@ -0,0 +1,85 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 8 Mar 2019 16:05:17 -0800
+Subject: perf script python: Add Python3 support to export-to-sqlite.py
+Origin: https://git.kernel.org/linus/ebf6c5c181abe9309788c6241d39602a1ce18723
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the export-to-sqlite.py script
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: http://lkml.kernel.org/r/20190309000518.2438-4-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/export-to-sqlite.py | 23 ++++++++++++++---------
+ 1 file changed, 14 insertions(+), 9 deletions(-)
+
+--- a/tools/perf/scripts/python/export-to-sqlite.py
++++ b/tools/perf/scripts/python/export-to-sqlite.py
+@@ -10,6 +10,8 @@
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ # more details.
+
++from __future__ import print_function
++
+ import os
+ import sys
+ import struct
+@@ -60,11 +62,14 @@ perf_db_export_mode = True
+ perf_db_export_calls = False
+ perf_db_export_callchains = False
+
++def printerr(*args, **keyword_args):
++ print(*args, file=sys.stderr, **keyword_args)
++
+ def usage():
+- print >> sys.stderr, "Usage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>]"
+- print >> sys.stderr, "where: columns 'all' or 'branches'"
+- print >> sys.stderr, " calls 'calls' => create calls and call_paths table"
+- print >> sys.stderr, " callchains 'callchains' => create call_paths table"
++ printerr("Usage is: export-to-sqlite.py <database name> [<columns>] [<calls>] [<callchains>]");
++ printerr("where: columns 'all' or 'branches'");
++ printerr(" calls 'calls' => create calls and call_paths table");
++ printerr(" callchains 'callchains' => create call_paths table");
+ raise Exception("Too few arguments")
+
+ if (len(sys.argv) < 2):
+@@ -100,7 +105,7 @@ def do_query_(q):
+ return
+ raise Exception("Query failed: " + q.lastError().text())
+
+-print datetime.datetime.today(), "Creating database..."
++print(datetime.datetime.today(), "Creating database ...")
+
+ db_exists = False
+ try:
+@@ -376,7 +381,7 @@ if perf_db_export_calls:
+ call_query.prepare("INSERT INTO calls VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)")
+
+ def trace_begin():
+- print datetime.datetime.today(), "Writing records..."
++ print(datetime.datetime.today(), "Writing records...")
+ do_query(query, 'BEGIN TRANSACTION')
+ # id == 0 means unknown. It is easier to create records for them than replace the zeroes with NULLs
+ evsel_table(0, "unknown")
+@@ -394,13 +399,13 @@ unhandled_count = 0
+ def trace_end():
+ do_query(query, 'END TRANSACTION')
+
+- print datetime.datetime.today(), "Adding indexes"
++ print(datetime.datetime.today(), "Adding indexes")
+ if perf_db_export_calls:
+ do_query(query, 'CREATE INDEX pcpid_idx ON calls (parent_call_path_id)')
+
+ if (unhandled_count):
+- print datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events"
+- print datetime.datetime.today(), "Done"
++ print(datetime.datetime.today(), "Warning: ", unhandled_count, " unhandled events")
++ print(datetime.datetime.today(), "Done")
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+ global unhandled_count
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-failed-sys.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-failed-sys.patch
new file mode 100644
index 000000000..617145de6
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-failed-sys.patch
@@ -0,0 +1,76 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:08 -0800
+Subject: perf script python: Add Python3 support to
+ failed-syscalls-by-pid.py
+Origin: https://git.kernel.org/linus/9b2700efc57f46fe63beee5f64fcfe2746936b4e
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the failed-syscalls-by-pid.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Tom Zanussi <tzanussi@gmail.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-5-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/failed-syscalls-by-pid.py | 21 ++++++++++----------
+ 1 file changed, 11 insertions(+), 10 deletions(-)
+
+--- a/tools/perf/scripts/python/failed-syscalls-by-pid.py
++++ b/tools/perf/scripts/python/failed-syscalls-by-pid.py
+@@ -5,6 +5,8 @@
+ # Displays system-wide failed system call totals, broken down by pid.
+ # If a [comm] arg is specified, only syscalls called by [comm] are displayed.
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -32,7 +34,7 @@ if len(sys.argv) > 1:
+ syscalls = autodict()
+
+ def trace_begin():
+- print "Press control+C to stop and show the summary"
++ print("Press control+C to stop and show the summary")
+
+ def trace_end():
+ print_error_totals()
+@@ -57,22 +59,21 @@ def syscalls__sys_exit(event_name, conte
+
+ def print_error_totals():
+ if for_comm is not None:
+- print "\nsyscall errors for %s:\n\n" % (for_comm),
++ print("\nsyscall errors for %s:\n" % (for_comm))
+ else:
+- print "\nsyscall errors:\n\n",
++ print("\nsyscall errors:\n")
+
+- print "%-30s %10s\n" % ("comm [pid]", "count"),
+- print "%-30s %10s\n" % ("------------------------------", \
+- "----------"),
++ print("%-30s %10s" % ("comm [pid]", "count"))
++ print("%-30s %10s" % ("------------------------------", "----------"))
+
+ comm_keys = syscalls.keys()
+ for comm in comm_keys:
+ pid_keys = syscalls[comm].keys()
+ for pid in pid_keys:
+- print "\n%s [%d]\n" % (comm, pid),
++ print("\n%s [%d]" % (comm, pid))
+ id_keys = syscalls[comm][pid].keys()
+ for id in id_keys:
+- print " syscall: %-16s\n" % syscall_name(id),
++ print(" syscall: %-16s" % syscall_name(id))
+ ret_keys = syscalls[comm][pid][id].keys()
+- for ret, val in sorted(syscalls[comm][pid][id].iteritems(), key = lambda(k, v): (v, k), reverse = True):
+- print " err = %-20s %10d\n" % (strerror(ret), val),
++ for ret, val in sorted(syscalls[comm][pid][id].items(), key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print(" err = %-20s %10d" % (strerror(ret), val))
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-futex-cont.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-futex-cont.patch
new file mode 100644
index 000000000..3fb8f1baf
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-futex-cont.patch
@@ -0,0 +1,57 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 1 Mar 2019 17:18:58 -0800
+Subject: perf script python: Add Python3 support to futex-contention.py
+Origin: https://git.kernel.org/linus/de2ec16bd438945813198d4de2339a396904c206
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the futex-contention.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190302011903.2416-3-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/futex-contention.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/tools/perf/scripts/python/futex-contention.py
++++ b/tools/perf/scripts/python/futex-contention.py
+@@ -10,6 +10,8 @@
+ #
+ # Measures futex contention
+
++from __future__ import print_function
++
+ import os, sys
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+ from Util import *
+@@ -33,18 +35,18 @@ def syscalls__sys_enter_futex(event, ctx
+
+ def syscalls__sys_exit_futex(event, ctxt, cpu, s, ns, tid, comm, callchain,
+ nr, ret):
+- if thread_blocktime.has_key(tid):
++ if tid in thread_blocktime:
+ elapsed = nsecs(s, ns) - thread_blocktime[tid]
+ add_stats(lock_waits, (tid, thread_thislock[tid]), elapsed)
+ del thread_blocktime[tid]
+ del thread_thislock[tid]
+
+ def trace_begin():
+- print "Press control+C to stop and show the summary"
++ print("Press control+C to stop and show the summary")
+
+ def trace_end():
+ for (tid, lock) in lock_waits:
+ min, max, avg, count = lock_waits[tid, lock]
+- print "%s[%d] lock %x contended %d times, %d avg ns" % \
+- (process_names[tid], tid, lock, count, avg)
++ print("%s[%d] lock %x contended %d times, %d avg ns" %
++ (process_names[tid], tid, lock, count, avg))
+
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-intel-pt-e.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-intel-pt-e.patch
new file mode 100644
index 000000000..c9dd3a189
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-intel-pt-e.patch
@@ -0,0 +1,133 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Tue, 5 Mar 2019 08:19:02 -0800
+Subject: perf script python: Add Python3 support to intel-pt-events.py
+Origin: https://git.kernel.org/linus/fdf2460c297f1bb2f3bd20b3b52903b267af9050
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the intel-pt-events.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Acked-by: Adrian Hunter <adrian.hunter@intel.com>
+Link: http://lkml.kernel.org/r/fd26acf9-0c0f-717f-9664-a3c33043ce19@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/intel-pt-events.py | 32 ++++++++++++++++-----------
+ 1 file changed, 19 insertions(+), 13 deletions(-)
+
+--- a/tools/perf/scripts/python/intel-pt-events.py
++++ b/tools/perf/scripts/python/intel-pt-events.py
+@@ -10,6 +10,8 @@
+ # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
+ # more details.
+
++from __future__ import print_function
++
+ import os
+ import sys
+ import struct
+@@ -22,34 +24,34 @@ sys.path.append(os.environ['PERF_EXEC_PA
+ #from Core import *
+
+ def trace_begin():
+- print "Intel PT Power Events and PTWRITE"
++ print("Intel PT Power Events and PTWRITE")
+
+ def trace_end():
+- print "End"
++ print("End")
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+- print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
++ print(' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())]))
+
+ def print_ptwrite(raw_buf):
+ data = struct.unpack_from("<IQ", raw_buf)
+ flags = data[0]
+ payload = data[1]
+ exact_ip = flags & 1
+- print "IP: %u payload: %#x" % (exact_ip, payload),
++ print("IP: %u payload: %#x" % (exact_ip, payload), end=' ')
+
+ def print_cbr(raw_buf):
+ data = struct.unpack_from("<BBBBII", raw_buf)
+ cbr = data[0]
+ f = (data[4] + 500) / 1000
+ p = ((cbr * 1000 / data[2]) + 5) / 10
+- print "%3u freq: %4u MHz (%3u%%)" % (cbr, f, p),
++ print("%3u freq: %4u MHz (%3u%%)" % (cbr, f, p), end=' ')
+
+ def print_mwait(raw_buf):
+ data = struct.unpack_from("<IQ", raw_buf)
+ payload = data[1]
+ hints = payload & 0xff
+ extensions = (payload >> 32) & 0x3
+- print "hints: %#x extensions: %#x" % (hints, extensions),
++ print("hints: %#x extensions: %#x" % (hints, extensions), end=' ')
+
+ def print_pwre(raw_buf):
+ data = struct.unpack_from("<IQ", raw_buf)
+@@ -57,13 +59,14 @@ def print_pwre(raw_buf):
+ hw = (payload >> 7) & 1
+ cstate = (payload >> 12) & 0xf
+ subcstate = (payload >> 8) & 0xf
+- print "hw: %u cstate: %u sub-cstate: %u" % (hw, cstate, subcstate),
++ print("hw: %u cstate: %u sub-cstate: %u" % (hw, cstate, subcstate),
++ end=' ')
+
+ def print_exstop(raw_buf):
+ data = struct.unpack_from("<I", raw_buf)
+ flags = data[0]
+ exact_ip = flags & 1
+- print "IP: %u" % (exact_ip),
++ print("IP: %u" % (exact_ip), end=' ')
+
+ def print_pwrx(raw_buf):
+ data = struct.unpack_from("<IQ", raw_buf)
+@@ -71,18 +74,21 @@ def print_pwrx(raw_buf):
+ deepest_cstate = payload & 0xf
+ last_cstate = (payload >> 4) & 0xf
+ wake_reason = (payload >> 8) & 0xf
+- print "deepest cstate: %u last cstate: %u wake reason: %#x" % (deepest_cstate, last_cstate, wake_reason),
++ print("deepest cstate: %u last cstate: %u wake reason: %#x" %
++ (deepest_cstate, last_cstate, wake_reason), end=' ')
+
+ def print_common_start(comm, sample, name):
+ ts = sample["time"]
+ cpu = sample["cpu"]
+ pid = sample["pid"]
+ tid = sample["tid"]
+- print "%16s %5u/%-5u [%03u] %9u.%09u %7s:" % (comm, pid, tid, cpu, ts / 1000000000, ts %1000000000, name),
++ print("%16s %5u/%-5u [%03u] %9u.%09u %7s:" %
++ (comm, pid, tid, cpu, ts / 1000000000, ts %1000000000, name),
++ end=' ')
+
+ def print_common_ip(sample, symbol, dso):
+ ip = sample["ip"]
+- print "%16x %s (%s)" % (ip, symbol, dso)
++ print("%16x %s (%s)" % (ip, symbol, dso))
+
+ def process_event(param_dict):
+ event_attr = param_dict["attr"]
+@@ -92,12 +98,12 @@ def process_event(param_dict):
+ name = param_dict["ev_name"]
+
+ # Symbol and dso info are not always resolved
+- if (param_dict.has_key("dso")):
++ if "dso" in param_dict:
+ dso = param_dict["dso"]
+ else:
+ dso = "[unknown]"
+
+- if (param_dict.has_key("symbol")):
++ if "symbol" in param_dict:
+ symbol = param_dict["symbol"]
+ else:
+ symbol = "[unknown]"
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-mem-phys-a.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-mem-phys-a.patch
new file mode 100644
index 000000000..3b9e39cc9
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-mem-phys-a.patch
@@ -0,0 +1,76 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:11 -0800
+Subject: perf script python: Add Python3 support to mem-phys-addr.py
+Origin: https://git.kernel.org/linus/e4d053ddb4c48cbde27b4c5edd3cc8f957684e4f
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the mem-phys-addr.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190222230619.17887-8-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/mem-phys-addr.py | 24 ++++++++++++++----------
+ 1 file changed, 14 insertions(+), 10 deletions(-)
+
+--- a/tools/perf/scripts/python/mem-phys-addr.py
++++ b/tools/perf/scripts/python/mem-phys-addr.py
+@@ -4,6 +4,8 @@
+ # Copyright (c) 2018, Intel Corporation.
+
+ from __future__ import division
++from __future__ import print_function
++
+ import os
+ import sys
+ import struct
+@@ -31,21 +33,23 @@ def parse_iomem():
+ for i, j in enumerate(f):
+ m = re.split('-|:',j,2)
+ if m[2].strip() == 'System RAM':
+- system_ram.append(long(m[0], 16))
+- system_ram.append(long(m[1], 16))
++ system_ram.append(int(m[0], 16))
++ system_ram.append(int(m[1], 16))
+ if m[2].strip() == 'Persistent Memory':
+- pmem.append(long(m[0], 16))
+- pmem.append(long(m[1], 16))
++ pmem.append(int(m[0], 16))
++ pmem.append(int(m[1], 16))
+
+ def print_memory_type():
+- print "Event: %s" % (event_name)
+- print "%-40s %10s %10s\n" % ("Memory type", "count", "percentage"),
+- print "%-40s %10s %10s\n" % ("----------------------------------------", \
++ print("Event: %s" % (event_name))
++ print("%-40s %10s %10s\n" % ("Memory type", "count", "percentage"), end='')
++ print("%-40s %10s %10s\n" % ("----------------------------------------",
+ "-----------", "-----------"),
++ end='');
+ total = sum(load_mem_type_cnt.values())
+ for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
+- key = lambda(k, v): (v, k), reverse = True):
+- print "%-40s %10d %10.1f%%\n" % (mem_type, count, 100 * count / total),
++ key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print("%-40s %10d %10.1f%%\n" % (mem_type, count, 100 * count / total),
++ end='')
+
+ def trace_begin():
+ parse_iomem()
+@@ -80,7 +84,7 @@ def find_memory_type(phys_addr):
+ f.seek(0, 0)
+ for j in f:
+ m = re.split('-|:',j,2)
+- if long(m[0], 16) <= phys_addr <= long(m[1], 16):
++ if int(m[0], 16) <= phys_addr <= int(m[1], 16):
+ return m[2]
+ return "N/A"
+
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-net_dropmo.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-net_dropmo.patch
new file mode 100644
index 000000000..631a94449
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-net_dropmo.patch
@@ -0,0 +1,59 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:12 -0800
+Subject: perf script python: Add Python3 support to net_dropmonitor.py
+Origin: https://git.kernel.org/linus/8c42b9600e561666233b9c557a5209d0dc853ba1
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the net_dropmonitor.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Acked-by: Neil Horman <nhorman@tuxdriver.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-9-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/net_dropmonitor.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/tools/perf/scripts/python/net_dropmonitor.py
++++ b/tools/perf/scripts/python/net_dropmonitor.py
+@@ -1,6 +1,8 @@
+ # Monitor the system for dropped packets and proudce a report of drop locations and counts
+ # SPDX-License-Identifier: GPL-2.0
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -50,19 +52,19 @@ def get_sym(sloc):
+ return (None, 0)
+
+ def print_drop_table():
+- print "%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT")
++ print("%25s %25s %25s" % ("LOCATION", "OFFSET", "COUNT"))
+ for i in drop_log.keys():
+ (sym, off) = get_sym(i)
+ if sym == None:
+ sym = i
+- print "%25s %25s %25s" % (sym, off, drop_log[i])
++ print("%25s %25s %25s" % (sym, off, drop_log[i]))
+
+
+ def trace_begin():
+- print "Starting trace (Ctrl-C to dump results)"
++ print("Starting trace (Ctrl-C to dump results)")
+
+ def trace_end():
+- print "Gathering kallsyms data"
++ print("Gathering kallsyms data")
+ get_kallsyms_table()
+ print_drop_table()
+
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-netdev-tim.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-netdev-tim.patch
new file mode 100644
index 000000000..2d501dd4c
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-netdev-tim.patch
@@ -0,0 +1,180 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:05 -0800
+Subject: perf script python: Add Python3 support to netdev-times.py
+Origin: https://git.kernel.org/linus/02b03ec383e0c79d73aa4b402b3427a8b490ef9f
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the netdev-times.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2
+version is now v2.6.
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Sanagi Koki <sanagi.koki@jp.fujitsu.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-2-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/netdev-times.py | 82 +++++++++++++++---------------
+ 1 file changed, 42 insertions(+), 40 deletions(-)
+
+--- a/tools/perf/scripts/python/netdev-times.py
++++ b/tools/perf/scripts/python/netdev-times.py
+@@ -8,6 +8,8 @@
+ # dev=: show only thing related to specified device
+ # debug: work with debug mode. It shows buffer status.
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -17,6 +19,7 @@ sys.path.append(os.environ['PERF_EXEC_PA
+ from perf_trace_context import *
+ from Core import *
+ from Util import *
++from functools import cmp_to_key
+
+ all_event_list = []; # insert all tracepoint event related with this script
+ irq_dic = {}; # key is cpu and value is a list which stacks irqs
+@@ -61,12 +64,12 @@ def diff_msec(src, dst):
+ def print_transmit(hunk):
+ if dev != 0 and hunk['dev'].find(dev) < 0:
+ return
+- print "%7s %5d %6d.%06dsec %12.3fmsec %12.3fmsec" % \
++ print("%7s %5d %6d.%06dsec %12.3fmsec %12.3fmsec" %
+ (hunk['dev'], hunk['len'],
+ nsecs_secs(hunk['queue_t']),
+ nsecs_nsecs(hunk['queue_t'])/1000,
+ diff_msec(hunk['queue_t'], hunk['xmit_t']),
+- diff_msec(hunk['xmit_t'], hunk['free_t']))
++ diff_msec(hunk['xmit_t'], hunk['free_t'])))
+
+ # Format for displaying rx packet processing
+ PF_IRQ_ENTRY= " irq_entry(+%.3fmsec irq=%d:%s)"
+@@ -98,55 +101,55 @@ def print_receive(hunk):
+ if show_hunk == 0:
+ return
+
+- print "%d.%06dsec cpu=%d" % \
+- (nsecs_secs(base_t), nsecs_nsecs(base_t)/1000, cpu)
++ print("%d.%06dsec cpu=%d" %
++ (nsecs_secs(base_t), nsecs_nsecs(base_t)/1000, cpu))
+ for i in range(len(irq_list)):
+- print PF_IRQ_ENTRY % \
++ print(PF_IRQ_ENTRY %
+ (diff_msec(base_t, irq_list[i]['irq_ent_t']),
+- irq_list[i]['irq'], irq_list[i]['name'])
+- print PF_JOINT
++ irq_list[i]['irq'], irq_list[i]['name']))
++ print(PF_JOINT)
+ irq_event_list = irq_list[i]['event_list']
+ for j in range(len(irq_event_list)):
+ irq_event = irq_event_list[j]
+ if irq_event['event'] == 'netif_rx':
+- print PF_NET_RX % \
++ print(PF_NET_RX %
+ (diff_msec(base_t, irq_event['time']),
+- irq_event['skbaddr'])
+- print PF_JOINT
+- print PF_SOFT_ENTRY % \
+- diff_msec(base_t, hunk['sirq_ent_t'])
+- print PF_JOINT
++ irq_event['skbaddr']))
++ print(PF_JOINT)
++ print(PF_SOFT_ENTRY %
++ diff_msec(base_t, hunk['sirq_ent_t']))
++ print(PF_JOINT)
+ event_list = hunk['event_list']
+ for i in range(len(event_list)):
+ event = event_list[i]
+ if event['event_name'] == 'napi_poll':
+- print PF_NAPI_POLL % \
+- (diff_msec(base_t, event['event_t']), event['dev'])
++ print(PF_NAPI_POLL %
++ (diff_msec(base_t, event['event_t']), event['dev']))
+ if i == len(event_list) - 1:
+- print ""
++ print("")
+ else:
+- print PF_JOINT
++ print(PF_JOINT)
+ else:
+- print PF_NET_RECV % \
++ print(PF_NET_RECV %
+ (diff_msec(base_t, event['event_t']), event['skbaddr'],
+- event['len'])
++ event['len']))
+ if 'comm' in event.keys():
+- print PF_WJOINT
+- print PF_CPY_DGRAM % \
++ print(PF_WJOINT)
++ print(PF_CPY_DGRAM %
+ (diff_msec(base_t, event['comm_t']),
+- event['pid'], event['comm'])
++ event['pid'], event['comm']))
+ elif 'handle' in event.keys():
+- print PF_WJOINT
++ print(PF_WJOINT)
+ if event['handle'] == "kfree_skb":
+- print PF_KFREE_SKB % \
++ print(PF_KFREE_SKB %
+ (diff_msec(base_t,
+ event['comm_t']),
+- event['location'])
++ event['location']))
+ elif event['handle'] == "consume_skb":
+- print PF_CONS_SKB % \
++ print(PF_CONS_SKB %
+ diff_msec(base_t,
+- event['comm_t'])
+- print PF_JOINT
++ event['comm_t']))
++ print(PF_JOINT)
+
+ def trace_begin():
+ global show_tx
+@@ -172,8 +175,7 @@ def trace_begin():
+
+ def trace_end():
+ # order all events in time
+- all_event_list.sort(lambda a,b :cmp(a[EINFO_IDX_TIME],
+- b[EINFO_IDX_TIME]))
++ all_event_list.sort(key=cmp_to_key(lambda a,b :a[EINFO_IDX_TIME] < b[EINFO_IDX_TIME]))
+ # process all events
+ for i in range(len(all_event_list)):
+ event_info = all_event_list[i]
+@@ -210,19 +212,19 @@ def trace_end():
+ print_receive(receive_hunk_list[i])
+ # display transmit hunks
+ if show_tx:
+- print " dev len Qdisc " \
+- " netdevice free"
++ print(" dev len Qdisc "
++ " netdevice free")
+ for i in range(len(tx_free_list)):
+ print_transmit(tx_free_list[i])
+ if debug:
+- print "debug buffer status"
+- print "----------------------------"
+- print "xmit Qdisc:remain:%d overflow:%d" % \
+- (len(tx_queue_list), of_count_tx_queue_list)
+- print "xmit netdevice:remain:%d overflow:%d" % \
+- (len(tx_xmit_list), of_count_tx_xmit_list)
+- print "receive:remain:%d overflow:%d" % \
+- (len(rx_skb_list), of_count_rx_skb_list)
++ print("debug buffer status")
++ print("----------------------------")
++ print("xmit Qdisc:remain:%d overflow:%d" %
++ (len(tx_queue_list), of_count_tx_queue_list))
++ print("xmit netdevice:remain:%d overflow:%d" %
++ (len(tx_xmit_list), of_count_tx_xmit_list))
++ print("receive:remain:%d overflow:%d" %
++ (len(rx_skb_list), of_count_rx_skb_list))
+
+ # called from perf, when it finds a correspoinding event
+ def irq__softirq_entry(name, context, cpu, sec, nsec, pid, comm, callchain, vec):
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-powerpc-hc.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-powerpc-hc.patch
new file mode 100644
index 000000000..1c8fdc5a1
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-powerpc-hc.patch
@@ -0,0 +1,87 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:13 -0800
+Subject: perf script python: Add Python3 support to powerpc-hcalls.py
+Origin: https://git.kernel.org/linus/118af5bf799bd1876c3999766d1d2f845d45f019
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the powerpc-hcalls.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Ravi Bangoria <ravi.bangoria@linux.ibm.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-10-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/powerpc-hcalls.py | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+--- a/tools/perf/scripts/python/powerpc-hcalls.py
++++ b/tools/perf/scripts/python/powerpc-hcalls.py
+@@ -4,6 +4,8 @@
+ #
+ # Hypervisor call statisics
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -149,7 +151,7 @@ hcall_table = {
+ }
+
+ def hcall_table_lookup(opcode):
+- if (hcall_table.has_key(opcode)):
++ if (opcode in hcall_table):
+ return hcall_table[opcode]
+ else:
+ return opcode
+@@ -157,8 +159,8 @@ def hcall_table_lookup(opcode):
+ print_ptrn = '%-28s%10s%10s%10s%10s'
+
+ def trace_end():
+- print print_ptrn % ('hcall', 'count', 'min(ns)', 'max(ns)', 'avg(ns)')
+- print '-' * 68
++ print(print_ptrn % ('hcall', 'count', 'min(ns)', 'max(ns)', 'avg(ns)'))
++ print('-' * 68)
+ for opcode in output:
+ h_name = hcall_table_lookup(opcode)
+ time = output[opcode]['time']
+@@ -166,14 +168,14 @@ def trace_end():
+ min_t = output[opcode]['min']
+ max_t = output[opcode]['max']
+
+- print print_ptrn % (h_name, cnt, min_t, max_t, time/cnt)
++ print(print_ptrn % (h_name, cnt, min_t, max_t, time//cnt))
+
+ def powerpc__hcall_exit(name, context, cpu, sec, nsec, pid, comm, callchain,
+ opcode, retval):
+- if (d_enter.has_key(cpu) and d_enter[cpu].has_key(opcode)):
++ if (cpu in d_enter and opcode in d_enter[cpu]):
+ diff = nsecs(sec, nsec) - d_enter[cpu][opcode]
+
+- if (output.has_key(opcode)):
++ if (opcode in output):
+ output[opcode]['time'] += diff
+ output[opcode]['cnt'] += 1
+ if (output[opcode]['min'] > diff):
+@@ -190,11 +192,11 @@ def powerpc__hcall_exit(name, context, c
+
+ del d_enter[cpu][opcode]
+ # else:
+-# print "Can't find matching hcall_enter event. Ignoring sample"
++# print("Can't find matching hcall_enter event. Ignoring sample")
+
+ def powerpc__hcall_entry(event_name, context, cpu, sec, nsec, pid, comm,
+ callchain, opcode):
+- if (d_enter.has_key(cpu)):
++ if (cpu in d_enter):
+ d_enter[cpu][opcode] = nsecs(sec, nsec)
+ else:
+ d_enter[cpu] = {opcode: nsecs(sec, nsec)}
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-sctop.py.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-sctop.py.patch
new file mode 100644
index 000000000..fa90ed99a
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-sctop.py.patch
@@ -0,0 +1,69 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:14 -0800
+Subject: perf script python: Add Python3 support to sctop.py
+Origin: https://git.kernel.org/linus/ee75a896ae535d4219a82cc361be96394536f3ba
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the sctop.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Tom Zanussi <tzanussi@gmail.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-11-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/sctop.py | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+--- a/tools/perf/scripts/python/sctop.py
++++ b/tools/perf/scripts/python/sctop.py
+@@ -8,7 +8,14 @@
+ # will be refreshed every [interval] seconds. The default interval is
+ # 3 seconds.
+
+-import os, sys, thread, time
++from __future__ import print_function
++
++import os, sys, time
++
++try:
++ import thread
++except ImportError:
++ import _thread as thread
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+@@ -62,18 +69,19 @@ def print_syscall_totals(interval):
+ while 1:
+ clear_term()
+ if for_comm is not None:
+- print "\nsyscall events for %s:\n\n" % (for_comm),
++ print("\nsyscall events for %s:\n" % (for_comm))
+ else:
+- print "\nsyscall events:\n\n",
++ print("\nsyscall events:\n")
+
+- print "%-40s %10s\n" % ("event", "count"),
+- print "%-40s %10s\n" % ("----------------------------------------", \
+- "----------"),
++ print("%-40s %10s" % ("event", "count"))
++ print("%-40s %10s" %
++ ("----------------------------------------",
++ "----------"))
+
+- for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \
++ for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
+ reverse = True):
+ try:
+- print "%-40s %10d\n" % (syscall_name(id), val),
++ print("%-40s %10d" % (syscall_name(id), val))
+ except TypeError:
+ pass
+ syscalls.clear()
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stackcolla.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stackcolla.patch
new file mode 100644
index 000000000..ff41b4a20
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stackcolla.patch
@@ -0,0 +1,45 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:15 -0800
+Subject: perf script python: Add Python3 support to stackcollapse.py
+Origin: https://git.kernel.org/linus/6d22d9991cf37edfe861569e2433342ad56206a7
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the stackcollapse.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Paolo Bonzini <pbonzini@redhat.com> <pbonzini@redhat.com>
+Link: http://lkml.kernel.org/r/20190222230619.17887-12-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/stackcollapse.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/tools/perf/scripts/python/stackcollapse.py
++++ b/tools/perf/scripts/python/stackcollapse.py
+@@ -19,6 +19,8 @@
+ # Written by Paolo Bonzini <pbonzini@redhat.com>
+ # Based on Brendan Gregg's stackcollapse-perf.pl script.
+
++from __future__ import print_function
++
+ import os
+ import sys
+ from collections import defaultdict
+@@ -120,7 +122,6 @@ def process_event(param_dict):
+ lines[stack_string] = lines[stack_string] + 1
+
+ def trace_end():
+- list = lines.keys()
+- list.sort()
++ list = sorted(lines)
+ for stack in list:
+- print "%s %d" % (stack, lines[stack])
++ print("%s %d" % (stack, lines[stack]))
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stat-cpi.p.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stat-cpi.p.patch
new file mode 100644
index 000000000..8ef6fa8b5
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-stat-cpi.p.patch
@@ -0,0 +1,61 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:16 -0800
+Subject: perf script python: Add Python3 support to stat-cpi.py
+Origin: https://git.kernel.org/linus/e985bf761db7646cebcd236249da08bd264069de
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the stat-cpi.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Cc: Jiri Olsa <jolsa@kernel.org>
+Link: http://lkml.kernel.org/r/20190222230619.17887-13-tonyj@suse.de
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/stat-cpi.py | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
+
+--- a/tools/perf/scripts/python/stat-cpi.py
++++ b/tools/perf/scripts/python/stat-cpi.py
+@@ -1,6 +1,8 @@
+ #!/usr/bin/env python
+ # SPDX-License-Identifier: GPL-2.0
+
++from __future__ import print_function
++
+ data = {}
+ times = []
+ threads = []
+@@ -20,8 +22,8 @@ def store_key(time, cpu, thread):
+ threads.append(thread)
+
+ def store(time, event, cpu, thread, val, ena, run):
+- #print "event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" % \
+- # (event, cpu, thread, time, val, ena, run)
++ #print("event %s cpu %d, thread %d, time %d, val %d, ena %d, run %d" %
++ # (event, cpu, thread, time, val, ena, run))
+
+ store_key(time, cpu, thread)
+ key = get_key(time, event, cpu, thread)
+@@ -59,7 +61,7 @@ def stat__interval(time):
+ if ins != 0:
+ cpi = cyc/float(ins)
+
+- print "%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins)
++ print("%15f: cpu %d, thread %d -> cpi %f (%d/%d)" % (time/(float(1000000000)), cpu, thread, cpi, cyc, ins))
+
+ def trace_end():
+ pass
+@@ -75,4 +77,4 @@ def trace_end():
+ # if ins != 0:
+ # cpi = cyc/float(ins)
+ #
+-# print "time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi)
++# print("time %.9f, cpu %d, thread %d -> cpi %f" % (time/(float(1000000000)), cpu, thread, cpi))
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co-de667cce7f4f.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co-de667cce7f4f.patch
new file mode 100644
index 000000000..9dc84ceac
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co-de667cce7f4f.patch
@@ -0,0 +1,74 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:18 -0800
+Subject: perf script python: Add Python3 support to
+ syscall-counts-by-pid.py
+Origin: https://git.kernel.org/linus/de667cce7f4f96b6e22da8fd9c065b961f355080
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the syscall-counts-by-pid.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190222230619.17887-15-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/syscall-counts-by-pid.py | 22 +++++++++++----------
+ 1 file changed, 12 insertions(+), 10 deletions(-)
+
+--- a/tools/perf/scripts/python/syscall-counts-by-pid.py
++++ b/tools/perf/scripts/python/syscall-counts-by-pid.py
+@@ -5,6 +5,8 @@
+ # Displays system-wide system call totals, broken down by syscall.
+ # If a [comm] arg is specified, only syscalls called by [comm] are displayed.
+
++from __future__ import print_function
++
+ import os, sys
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+@@ -31,7 +33,7 @@ if len(sys.argv) > 1:
+ syscalls = autodict()
+
+ def trace_begin():
+- print "Press control+C to stop and show the summary"
++ print("Press control+C to stop and show the summary")
+
+ def trace_end():
+ print_syscall_totals()
+@@ -55,20 +57,20 @@ def syscalls__sys_enter(event_name, cont
+
+ def print_syscall_totals():
+ if for_comm is not None:
+- print "\nsyscall events for %s:\n\n" % (for_comm),
++ print("\nsyscall events for %s:\n" % (for_comm))
+ else:
+- print "\nsyscall events by comm/pid:\n\n",
++ print("\nsyscall events by comm/pid:\n")
+
+- print "%-40s %10s\n" % ("comm [pid]/syscalls", "count"),
+- print "%-40s %10s\n" % ("----------------------------------------", \
+- "----------"),
++ print("%-40s %10s" % ("comm [pid]/syscalls", "count"))
++ print("%-40s %10s" % ("----------------------------------------",
++ "----------"))
+
+ comm_keys = syscalls.keys()
+ for comm in comm_keys:
+ pid_keys = syscalls[comm].keys()
+ for pid in pid_keys:
+- print "\n%s [%d]\n" % (comm, pid),
++ print("\n%s [%d]" % (comm, pid))
+ id_keys = syscalls[comm][pid].keys()
+- for id, val in sorted(syscalls[comm][pid].iteritems(), \
+- key = lambda(k, v): (v, k), reverse = True):
+- print " %-38s %10d\n" % (syscall_name(id), val),
++ for id, val in sorted(syscalls[comm][pid].items(), \
++ key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print(" %-38s %10d" % (syscall_name(id), val))
diff --git a/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co.patch b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co.patch
new file mode 100644
index 000000000..59c654479
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Add-Python3-support-to-syscall-co.patch
@@ -0,0 +1,65 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 22 Feb 2019 15:06:17 -0800
+Subject: perf script python: Add Python3 support to syscall-counts.py
+Origin: https://git.kernel.org/linus/1d1b0dbb859d175eb512a9f0e1ca7e44bd0192cd
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python2 and Python3 in the syscall-counts.py script
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of 'from __future__' implies the minimum supported Python2 version
+is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190222230619.17887-14-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/syscall-counts.py | 18 ++++++++++--------
+ 1 file changed, 10 insertions(+), 8 deletions(-)
+
+--- a/tools/perf/scripts/python/syscall-counts.py
++++ b/tools/perf/scripts/python/syscall-counts.py
+@@ -5,6 +5,8 @@
+ # Displays system-wide system call totals, broken down by syscall.
+ # If a [comm] arg is specified, only syscalls called by [comm] are displayed.
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -28,7 +30,7 @@ if len(sys.argv) > 1:
+ syscalls = autodict()
+
+ def trace_begin():
+- print "Press control+C to stop and show the summary"
++ print("Press control+C to stop and show the summary")
+
+ def trace_end():
+ print_syscall_totals()
+@@ -51,14 +53,14 @@ def syscalls__sys_enter(event_name, cont
+
+ def print_syscall_totals():
+ if for_comm is not None:
+- print "\nsyscall events for %s:\n\n" % (for_comm),
++ print("\nsyscall events for %s:\n" % (for_comm))
+ else:
+- print "\nsyscall events:\n\n",
++ print("\nsyscall events:\n")
+
+- print "%-40s %10s\n" % ("event", "count"),
+- print "%-40s %10s\n" % ("----------------------------------------", \
+- "-----------"),
++ print("%-40s %10s" % ("event", "count"))
++ print("%-40s %10s" % ("----------------------------------------",
++ "-----------"))
+
+- for id, val in sorted(syscalls.iteritems(), key = lambda(k, v): (v, k), \
++ for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
+ reverse = True):
+- print "%-40s %10d\n" % (syscall_name(id), val),
++ print("%-40s %10d" % (syscall_name(id), val))
diff --git a/debian/patches/bugfix/all/perf-script-python-Remove-mixed-indentation.patch b/debian/patches/bugfix/all/perf-script-python-Remove-mixed-indentation.patch
new file mode 100644
index 000000000..b18ceaea8
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-Remove-mixed-indentation.patch
@@ -0,0 +1,511 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 1 Mar 2019 17:18:57 -0800
+Subject: perf script python: Remove mixed indentation
+Origin: https://git.kernel.org/linus/b504d7f6876515b74c8e27a44ccdb22372616d97
+Bug-Debian: https://bugs.debian.org/944641
+
+Remove mixed indentation in Python scripts. Revert to either all tabs
+(most common form) or all spaces (4 or 8) depending on what was the
+intent of the original commit. This is necessary to complete Python3
+support as it will flag an error if it encounters mixed indentation.
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Link: http://lkml.kernel.org/r/20190302011903.2416-2-tonyj@suse.de
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/check-perf-trace.py | 69 +++++++++-----------
+ tools/perf/scripts/python/compaction-times.py | 8 +-
+ tools/perf/scripts/python/event_analyzing_sample.py | 6 -
+ tools/perf/scripts/python/failed-syscalls-by-pid.py | 34 ++++-----
+ tools/perf/scripts/python/futex-contention.py | 2
+ tools/perf/scripts/python/intel-pt-events.py | 28 ++++----
+ tools/perf/scripts/python/mem-phys-addr.py | 7 +-
+ tools/perf/scripts/python/net_dropmonitor.py | 2
+ tools/perf/scripts/python/netdev-times.py | 12 ++-
+ tools/perf/scripts/python/sched-migration.py | 6 -
+ tools/perf/scripts/python/sctop.py | 13 ++-
+ tools/perf/scripts/python/stackcollapse.py | 2
+ tools/perf/scripts/python/syscall-counts-by-pid.py | 47 ++++++-------
+ tools/perf/scripts/python/syscall-counts.py | 27 +++----
+ 14 files changed, 132 insertions(+), 131 deletions(-)
+
+--- a/tools/perf/scripts/python/check-perf-trace.py
++++ b/tools/perf/scripts/python/check-perf-trace.py
+@@ -23,60 +23,59 @@ def trace_begin():
+ pass
+
+ def trace_end():
+- print_unhandled()
++ print_unhandled()
+
+ def irq__softirq_entry(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, vec):
+- print_header(event_name, common_cpu, common_secs, common_nsecs,
+- common_pid, common_comm)
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, vec):
++ print_header(event_name, common_cpu, common_secs, common_nsecs,
++ common_pid, common_comm)
+
+- print_uncommon(context)
++ print_uncommon(context)
+
+- print "vec=%s\n" % \
+- (symbol_str("irq__softirq_entry", "vec", vec)),
++ print "vec=%s\n" % (symbol_str("irq__softirq_entry", "vec", vec)),
+
+ def kmem__kmalloc(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, call_site, ptr, bytes_req, bytes_alloc,
+- gfp_flags):
+- print_header(event_name, common_cpu, common_secs, common_nsecs,
+- common_pid, common_comm)
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, call_site, ptr, bytes_req, bytes_alloc,
++ gfp_flags):
++ print_header(event_name, common_cpu, common_secs, common_nsecs,
++ common_pid, common_comm)
+
+- print_uncommon(context)
++ print_uncommon(context)
+
+- print "call_site=%u, ptr=%u, bytes_req=%u, " \
++ print "call_site=%u, ptr=%u, bytes_req=%u, " \
+ "bytes_alloc=%u, gfp_flags=%s\n" % \
+ (call_site, ptr, bytes_req, bytes_alloc,
+-
+ flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+- try:
+- unhandled[event_name] += 1
+- except TypeError:
+- unhandled[event_name] = 1
++ try:
++ unhandled[event_name] += 1
++ except TypeError:
++ unhandled[event_name] = 1
+
+ def print_header(event_name, cpu, secs, nsecs, pid, comm):
+ print "%-20s %5u %05u.%09u %8u %-20s " % \
+- (event_name, cpu, secs, nsecs, pid, comm),
++ (event_name, cpu, secs, nsecs, pid, comm),
+
+ # print trace fields not included in handler args
+ def print_uncommon(context):
+- print "common_preempt_count=%d, common_flags=%s, common_lock_depth=%d, " \
+- % (common_pc(context), trace_flag_str(common_flags(context)), \
+- common_lock_depth(context))
++ print "common_preempt_count=%d, common_flags=%s, " \
++ "common_lock_depth=%d, " % \
++ (common_pc(context), trace_flag_str(common_flags(context)),
++ common_lock_depth(context))
+
+ def print_unhandled():
+- keys = unhandled.keys()
+- if not keys:
+- return
+-
+- print "\nunhandled events:\n\n",
+-
+- print "%-40s %10s\n" % ("event", "count"),
+- print "%-40s %10s\n" % ("----------------------------------------", \
+- "-----------"),
++ keys = unhandled.keys()
++ if not keys:
++ return
++
++ print "\nunhandled events:\n\n",
++
++ print "%-40s %10s\n" % ("event", "count"),
++ print "%-40s %10s\n" % ("----------------------------------------", \
++ "-----------"),
+
+- for event_name in keys:
+- print "%-40s %10d\n" % (event_name, unhandled[event_name])
++ for event_name in keys:
++ print "%-40s %10d\n" % (event_name, unhandled[event_name])
+--- a/tools/perf/scripts/python/compaction-times.py
++++ b/tools/perf/scripts/python/compaction-times.py
+@@ -216,15 +216,15 @@ def compaction__mm_compaction_migratepag
+ pair(nr_migrated, nr_failed), None, None)
+
+ def compaction__mm_compaction_isolate_freepages(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, start_pfn, end_pfn, nr_scanned, nr_taken):
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, start_pfn, end_pfn, nr_scanned, nr_taken):
+
+ chead.increment_pending(common_pid,
+ None, pair(nr_scanned, nr_taken), None)
+
+ def compaction__mm_compaction_isolate_migratepages(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, start_pfn, end_pfn, nr_scanned, nr_taken):
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, start_pfn, end_pfn, nr_scanned, nr_taken):
+
+ chead.increment_pending(common_pid,
+ None, None, pair(nr_scanned, nr_taken))
+--- a/tools/perf/scripts/python/event_analyzing_sample.py
++++ b/tools/perf/scripts/python/event_analyzing_sample.py
+@@ -37,7 +37,7 @@ con = sqlite3.connect("/dev/shm/perf.db"
+ con.isolation_level = None
+
+ def trace_begin():
+- print "In trace_begin:\n"
++ print "In trace_begin:\n"
+
+ #
+ # Will create several tables at the start, pebs_ll is for PEBS data with
+@@ -102,7 +102,7 @@ def insert_db(event):
+ event.ip, event.status, event.dse, event.dla, event.lat))
+
+ def trace_end():
+- print "In trace_end:\n"
++ print "In trace_end:\n"
+ # We show the basic info for the 2 type of event classes
+ show_general_events()
+ show_pebs_ll()
+@@ -187,4 +187,4 @@ def show_pebs_ll():
+ print "%32s %8d %s" % (row[0], row[1], num2sym(row[1]))
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+- print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
++ print ' '.join(['%s=%s'%(k,str(v))for k,v in sorted(event_fields_dict.items())])
+--- a/tools/perf/scripts/python/failed-syscalls-by-pid.py
++++ b/tools/perf/scripts/python/failed-syscalls-by-pid.py
+@@ -58,22 +58,22 @@ def syscalls__sys_exit(event_name, conte
+ raw_syscalls__sys_exit(**locals())
+
+ def print_error_totals():
+- if for_comm is not None:
+- print("\nsyscall errors for %s:\n" % (for_comm))
+- else:
+- print("\nsyscall errors:\n")
++ if for_comm is not None:
++ print("\nsyscall errors for %s:\n" % (for_comm))
++ else:
++ print("\nsyscall errors:\n")
+
+- print("%-30s %10s" % ("comm [pid]", "count"))
+- print("%-30s %10s" % ("------------------------------", "----------"))
++ print("%-30s %10s" % ("comm [pid]", "count"))
++ print("%-30s %10s" % ("------------------------------", "----------"))
+
+- comm_keys = syscalls.keys()
+- for comm in comm_keys:
+- pid_keys = syscalls[comm].keys()
+- for pid in pid_keys:
+- print("\n%s [%d]" % (comm, pid))
+- id_keys = syscalls[comm][pid].keys()
+- for id in id_keys:
+- print(" syscall: %-16s" % syscall_name(id))
+- ret_keys = syscalls[comm][pid][id].keys()
+- for ret, val in sorted(syscalls[comm][pid][id].items(), key = lambda kv: (kv[1], kv[0]), reverse = True):
+- print(" err = %-20s %10d" % (strerror(ret), val))
++ comm_keys = syscalls.keys()
++ for comm in comm_keys:
++ pid_keys = syscalls[comm].keys()
++ for pid in pid_keys:
++ print("\n%s [%d]" % (comm, pid))
++ id_keys = syscalls[comm][pid].keys()
++ for id in id_keys:
++ print(" syscall: %-16s" % syscall_name(id))
++ ret_keys = syscalls[comm][pid][id].keys()
++ for ret, val in sorted(syscalls[comm][pid][id].items(), key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print(" err = %-20s %10d" % (strerror(ret), val))
+--- a/tools/perf/scripts/python/futex-contention.py
++++ b/tools/perf/scripts/python/futex-contention.py
+@@ -46,5 +46,5 @@ def trace_end():
+ for (tid, lock) in lock_waits:
+ min, max, avg, count = lock_waits[tid, lock]
+ print "%s[%d] lock %x contended %d times, %d avg ns" % \
+- (process_names[tid], tid, lock, count, avg)
++ (process_names[tid], tid, lock, count, avg)
+
+--- a/tools/perf/scripts/python/intel-pt-events.py
++++ b/tools/perf/scripts/python/intel-pt-events.py
+@@ -85,22 +85,22 @@ def print_common_ip(sample, symbol, dso)
+ print "%16x %s (%s)" % (ip, symbol, dso)
+
+ def process_event(param_dict):
+- event_attr = param_dict["attr"]
+- sample = param_dict["sample"]
+- raw_buf = param_dict["raw_buf"]
+- comm = param_dict["comm"]
+- name = param_dict["ev_name"]
++ event_attr = param_dict["attr"]
++ sample = param_dict["sample"]
++ raw_buf = param_dict["raw_buf"]
++ comm = param_dict["comm"]
++ name = param_dict["ev_name"]
+
+- # Symbol and dso info are not always resolved
+- if (param_dict.has_key("dso")):
+- dso = param_dict["dso"]
+- else:
+- dso = "[unknown]"
++ # Symbol and dso info are not always resolved
++ if (param_dict.has_key("dso")):
++ dso = param_dict["dso"]
++ else:
++ dso = "[unknown]"
+
+- if (param_dict.has_key("symbol")):
+- symbol = param_dict["symbol"]
+- else:
+- symbol = "[unknown]"
++ if (param_dict.has_key("symbol")):
++ symbol = param_dict["symbol"]
++ else:
++ symbol = "[unknown]"
+
+ if name == "ptwrite":
+ print_common_start(comm, sample, name)
+--- a/tools/perf/scripts/python/mem-phys-addr.py
++++ b/tools/perf/scripts/python/mem-phys-addr.py
+@@ -44,12 +44,13 @@ def print_memory_type():
+ print("%-40s %10s %10s\n" % ("Memory type", "count", "percentage"), end='')
+ print("%-40s %10s %10s\n" % ("----------------------------------------",
+ "-----------", "-----------"),
+- end='');
++ end='');
+ total = sum(load_mem_type_cnt.values())
+ for mem_type, count in sorted(load_mem_type_cnt.most_common(), \
+ key = lambda kv: (kv[1], kv[0]), reverse = True):
+- print("%-40s %10d %10.1f%%\n" % (mem_type, count, 100 * count / total),
+- end='')
++ print("%-40s %10d %10.1f%%\n" %
++ (mem_type, count, 100 * count / total),
++ end='')
+
+ def trace_begin():
+ parse_iomem()
+--- a/tools/perf/scripts/python/net_dropmonitor.py
++++ b/tools/perf/scripts/python/net_dropmonitor.py
+@@ -7,7 +7,7 @@ import os
+ import sys
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+- '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
++ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+
+ from perf_trace_context import *
+ from Core import *
+--- a/tools/perf/scripts/python/netdev-times.py
++++ b/tools/perf/scripts/python/netdev-times.py
+@@ -124,14 +124,16 @@ def print_receive(hunk):
+ event = event_list[i]
+ if event['event_name'] == 'napi_poll':
+ print(PF_NAPI_POLL %
+- (diff_msec(base_t, event['event_t']), event['dev']))
++ (diff_msec(base_t, event['event_t']),
++ event['dev']))
+ if i == len(event_list) - 1:
+ print("")
+ else:
+ print(PF_JOINT)
+ else:
+ print(PF_NET_RECV %
+- (diff_msec(base_t, event['event_t']), event['skbaddr'],
++ (diff_msec(base_t, event['event_t']),
++ event['skbaddr'],
+ event['len']))
+ if 'comm' in event.keys():
+ print(PF_WJOINT)
+@@ -256,7 +258,7 @@ def irq__irq_handler_exit(name, context,
+ all_event_list.append(event_info)
+
+ def napi__napi_poll(name, context, cpu, sec, nsec, pid, comm, callchain, napi,
+- dev_name, work=None, budget=None):
++ dev_name, work=None, budget=None):
+ event_info = (name, context, cpu, nsecs(sec, nsec), pid, comm,
+ napi, dev_name, work, budget)
+ all_event_list.append(event_info)
+@@ -353,7 +355,7 @@ def handle_irq_softirq_exit(event_info):
+ if irq_list == [] or event_list == 0:
+ return
+ rec_data = {'sirq_ent_t':sirq_ent_t, 'sirq_ext_t':time,
+- 'irq_list':irq_list, 'event_list':event_list}
++ 'irq_list':irq_list, 'event_list':event_list}
+ # merge information realted to a NET_RX softirq
+ receive_hunk_list.append(rec_data)
+
+@@ -390,7 +392,7 @@ def handle_netif_receive_skb(event_info)
+ skbaddr, skblen, dev_name) = event_info
+ if cpu in net_rx_dic.keys():
+ rec_data = {'event_name':'netif_receive_skb',
+- 'event_t':time, 'skbaddr':skbaddr, 'len':skblen}
++ 'event_t':time, 'skbaddr':skbaddr, 'len':skblen}
+ event_list = net_rx_dic[cpu]['event_list']
+ event_list.append(rec_data)
+ rx_skb_list.insert(0, rec_data)
+--- a/tools/perf/scripts/python/sched-migration.py
++++ b/tools/perf/scripts/python/sched-migration.py
+@@ -16,10 +16,10 @@ import sys
+
+ from collections import defaultdict
+ try:
+- from UserList import UserList
++ from UserList import UserList
+ except ImportError:
+- # Python 3: UserList moved to the collections package
+- from collections import UserList
++ # Python 3: UserList moved to the collections package
++ from collections import UserList
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+--- a/tools/perf/scripts/python/sctop.py
++++ b/tools/perf/scripts/python/sctop.py
+@@ -13,9 +13,9 @@ from __future__ import print_function
+ import os, sys, time
+
+ try:
+- import thread
++ import thread
+ except ImportError:
+- import _thread as thread
++ import _thread as thread
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+@@ -75,11 +75,12 @@ def print_syscall_totals(interval):
+
+ print("%-40s %10s" % ("event", "count"))
+ print("%-40s %10s" %
+- ("----------------------------------------",
+- "----------"))
++ ("----------------------------------------",
++ "----------"))
+
+- for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
+- reverse = True):
++ for id, val in sorted(syscalls.items(),
++ key = lambda kv: (kv[1], kv[0]),
++ reverse = True):
+ try:
+ print("%-40s %10d" % (syscall_name(id), val))
+ except TypeError:
+--- a/tools/perf/scripts/python/stackcollapse.py
++++ b/tools/perf/scripts/python/stackcollapse.py
+@@ -27,7 +27,7 @@ from collections import defaultdict
+ from optparse import OptionParser, make_option
+
+ sys.path.append(os.environ['PERF_EXEC_PATH'] + \
+- '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
++ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace')
+
+ from perf_trace_context import *
+ from Core import *
+--- a/tools/perf/scripts/python/syscall-counts-by-pid.py
++++ b/tools/perf/scripts/python/syscall-counts-by-pid.py
+@@ -39,11 +39,10 @@ def trace_end():
+ print_syscall_totals()
+
+ def raw_syscalls__sys_enter(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, id, args):
+-
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, id, args):
+ if (for_comm and common_comm != for_comm) or \
+- (for_pid and common_pid != for_pid ):
++ (for_pid and common_pid != for_pid ):
+ return
+ try:
+ syscalls[common_comm][common_pid][id] += 1
+@@ -51,26 +50,26 @@ def raw_syscalls__sys_enter(event_name,
+ syscalls[common_comm][common_pid][id] = 1
+
+ def syscalls__sys_enter(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- id, args):
++ common_secs, common_nsecs, common_pid, common_comm,
++ id, args):
+ raw_syscalls__sys_enter(**locals())
+
+ def print_syscall_totals():
+- if for_comm is not None:
+- print("\nsyscall events for %s:\n" % (for_comm))
+- else:
+- print("\nsyscall events by comm/pid:\n")
+-
+- print("%-40s %10s" % ("comm [pid]/syscalls", "count"))
+- print("%-40s %10s" % ("----------------------------------------",
+- "----------"))
+-
+- comm_keys = syscalls.keys()
+- for comm in comm_keys:
+- pid_keys = syscalls[comm].keys()
+- for pid in pid_keys:
+- print("\n%s [%d]" % (comm, pid))
+- id_keys = syscalls[comm][pid].keys()
+- for id, val in sorted(syscalls[comm][pid].items(), \
+- key = lambda kv: (kv[1], kv[0]), reverse = True):
+- print(" %-38s %10d" % (syscall_name(id), val))
++ if for_comm is not None:
++ print("\nsyscall events for %s:\n" % (for_comm))
++ else:
++ print("\nsyscall events by comm/pid:\n")
++
++ print("%-40s %10s" % ("comm [pid]/syscalls", "count"))
++ print("%-40s %10s" % ("----------------------------------------",
++ "----------"))
++
++ comm_keys = syscalls.keys()
++ for comm in comm_keys:
++ pid_keys = syscalls[comm].keys()
++ for pid in pid_keys:
++ print("\n%s [%d]" % (comm, pid))
++ id_keys = syscalls[comm][pid].keys()
++ for id, val in sorted(syscalls[comm][pid].items(),
++ key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print(" %-38s %10d" % (syscall_name(id), val))
+--- a/tools/perf/scripts/python/syscall-counts.py
++++ b/tools/perf/scripts/python/syscall-counts.py
+@@ -36,8 +36,8 @@ def trace_end():
+ print_syscall_totals()
+
+ def raw_syscalls__sys_enter(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- common_callchain, id, args):
++ common_secs, common_nsecs, common_pid, common_comm,
++ common_callchain, id, args):
+ if for_comm is not None:
+ if common_comm != for_comm:
+ return
+@@ -47,20 +47,19 @@ def raw_syscalls__sys_enter(event_name,
+ syscalls[id] = 1
+
+ def syscalls__sys_enter(event_name, context, common_cpu,
+- common_secs, common_nsecs, common_pid, common_comm,
+- id, args):
++ common_secs, common_nsecs, common_pid, common_comm, id, args):
+ raw_syscalls__sys_enter(**locals())
+
+ def print_syscall_totals():
+- if for_comm is not None:
+- print("\nsyscall events for %s:\n" % (for_comm))
+- else:
+- print("\nsyscall events:\n")
++ if for_comm is not None:
++ print("\nsyscall events for %s:\n" % (for_comm))
++ else:
++ print("\nsyscall events:\n")
+
+- print("%-40s %10s" % ("event", "count"))
+- print("%-40s %10s" % ("----------------------------------------",
+- "-----------"))
++ print("%-40s %10s" % ("event", "count"))
++ print("%-40s %10s" % ("----------------------------------------",
++ "-----------"))
+
+- for id, val in sorted(syscalls.items(), key = lambda kv: (kv[1], kv[0]), \
+- reverse = True):
+- print("%-40s %10d" % (syscall_name(id), val))
++ for id, val in sorted(syscalls.items(),
++ key = lambda kv: (kv[1], kv[0]), reverse = True):
++ print("%-40s %10d" % (syscall_name(id), val))
diff --git a/debian/patches/bugfix/all/perf-script-python-add-Python3-support-to-check-perf.patch b/debian/patches/bugfix/all/perf-script-python-add-Python3-support-to-check-perf.patch
new file mode 100644
index 000000000..90c7aa835
--- /dev/null
+++ b/debian/patches/bugfix/all/perf-script-python-add-Python3-support-to-check-perf.patch
@@ -0,0 +1,104 @@
+From: Tony Jones <tonyj@suse.de>
+Date: Fri, 1 Mar 2019 17:18:59 -0800
+Subject: perf script python: add Python3 support to check-perf-trace.py
+Origin: https://git.kernel.org/linus/57e604b16362273af6a517abaa6cd1133a7fc732
+Bug-Debian: https://bugs.debian.org/944641
+
+Support both Python 2 and Python 3 in the check-perf-trace.py script.
+
+There may be differences in the ordering of output lines due to
+differences in dictionary ordering etc. However the format within lines
+should be unchanged.
+
+The use of from __future__ implies the minimum supported version of
+Python2 is now v2.6
+
+Signed-off-by: Tony Jones <tonyj@suse.de>
+Cc: Tom Zanussi <tzanussi@gmail.com>
+Link: http://lkml.kernel.org/r/20190302011903.2416-4-tonyj@suse.de
+Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
+Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
+---
+ tools/perf/scripts/python/check-perf-trace.py | 31 ++++++++++++++------------
+ 1 file changed, 17 insertions(+), 14 deletions(-)
+
+--- a/tools/perf/scripts/python/check-perf-trace.py
++++ b/tools/perf/scripts/python/check-perf-trace.py
+@@ -7,6 +7,8 @@
+ # events, etc. Basically, if this script runs successfully and
+ # displays expected results, Python scripting support should be ok.
+
++from __future__ import print_function
++
+ import os
+ import sys
+
+@@ -19,7 +21,7 @@ from perf_trace_context import *
+ unhandled = autodict()
+
+ def trace_begin():
+- print "trace_begin"
++ print("trace_begin")
+ pass
+
+ def trace_end():
+@@ -33,7 +35,7 @@ def irq__softirq_entry(event_name, conte
+
+ print_uncommon(context)
+
+- print "vec=%s\n" % (symbol_str("irq__softirq_entry", "vec", vec)),
++ print("vec=%s" % (symbol_str("irq__softirq_entry", "vec", vec)))
+
+ def kmem__kmalloc(event_name, context, common_cpu,
+ common_secs, common_nsecs, common_pid, common_comm,
+@@ -44,10 +46,10 @@ def kmem__kmalloc(event_name, context, c
+
+ print_uncommon(context)
+
+- print "call_site=%u, ptr=%u, bytes_req=%u, " \
+- "bytes_alloc=%u, gfp_flags=%s\n" % \
++ print("call_site=%u, ptr=%u, bytes_req=%u, "
++ "bytes_alloc=%u, gfp_flags=%s" %
+ (call_site, ptr, bytes_req, bytes_alloc,
+- flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)),
++ flag_str("kmem__kmalloc", "gfp_flags", gfp_flags)))
+
+ def trace_unhandled(event_name, context, event_fields_dict):
+ try:
+@@ -56,26 +58,27 @@ def trace_unhandled(event_name, context,
+ unhandled[event_name] = 1
+
+ def print_header(event_name, cpu, secs, nsecs, pid, comm):
+- print "%-20s %5u %05u.%09u %8u %-20s " % \
++ print("%-20s %5u %05u.%09u %8u %-20s " %
+ (event_name, cpu, secs, nsecs, pid, comm),
++ end=' ')
+
+ # print trace fields not included in handler args
+ def print_uncommon(context):
+- print "common_preempt_count=%d, common_flags=%s, " \
+- "common_lock_depth=%d, " % \
++ print("common_preempt_count=%d, common_flags=%s, "
++ "common_lock_depth=%d, " %
+ (common_pc(context), trace_flag_str(common_flags(context)),
+- common_lock_depth(context))
++ common_lock_depth(context)))
+
+ def print_unhandled():
+ keys = unhandled.keys()
+ if not keys:
+ return
+
+- print "\nunhandled events:\n\n",
++ print("\nunhandled events:\n")
+
+- print "%-40s %10s\n" % ("event", "count"),
+- print "%-40s %10s\n" % ("----------------------------------------", \
+- "-----------"),
++ print("%-40s %10s" % ("event", "count"))
++ print("%-40s %10s" % ("----------------------------------------",
++ "-----------"))
+
+ for event_name in keys:
+- print "%-40s %10d\n" % (event_name, unhandled[event_name])
++ print("%-40s %10d\n" % (event_name, unhandled[event_name]))
diff --git a/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch b/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch
new file mode 100644
index 000000000..cd2ba2e9e
--- /dev/null
+++ b/debian/patches/bugfix/all/radeon-amdgpu-firmware-is-required-for-drm-and-kms-on-r600-onward.patch
@@ -0,0 +1,135 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Subject: radeon, amdgpu: Firmware is required for DRM and KMS on R600 onward
+Date: Tue, 08 Jan 2013 03:25:52 +0000
+Bug-Debian: https://bugs.debian.org/607194
+Bug-Debian: https://bugs.debian.org/607471
+Bug-Debian: https://bugs.debian.org/610851
+Bug-Debian: https://bugs.debian.org/627497
+Bug-Debian: https://bugs.debian.org/632212
+Bug-Debian: https://bugs.debian.org/637943
+Bug-Debian: https://bugs.debian.org/649448
+Bug-Debian: https://bugs.debian.org/697229
+Forwarded: no
+
+radeon requires firmware/microcode for the GPU in all chips, but for
+newer chips (apparently R600 'Evergreen' onward) it also expects
+firmware for the memory controller and other sub-blocks.
+
+radeon attempts to gracefully fall back and disable some features if
+the firmware is not available, but becomes unstable - the framebuffer
+and/or system memory may be corrupted, or the display may stay black.
+
+Therefore, perform a basic check for the existence of
+/lib/firmware/{radeon,amdgpu} when a device is probed, and abort if it
+is missing, except for the pre-R600 case.
+
+---
+Index: linux/drivers/gpu/drm/radeon/radeon_drv.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/radeon/radeon_drv.c
++++ linux/drivers/gpu/drm/radeon/radeon_drv.c
+@@ -43,6 +43,8 @@
+ #include <drm/drm_fb_helper.h>
+
+ #include <drm/drm_crtc_helper.h>
++#include <linux/namei.h>
++#include <linux/path.h>
+
+ /*
+ * KMS wrapper.
+@@ -316,6 +318,28 @@ static struct drm_driver kms_driver;
+
+ bool radeon_device_is_virtual(void);
+
++/* Test that /lib/firmware/radeon is a directory (or symlink to a
++ * directory). We could try to match the udev search path, but let's
++ * keep it simple.
++ */
++static bool radeon_firmware_installed(void)
++{
++#if IS_BUILTIN(CONFIG_DRM_RADEON)
++ /* It may be too early to tell. Assume it's there. */
++ return true;
++#else
++ struct path path;
++
++ if (kern_path("/lib/firmware/radeon", LOOKUP_DIRECTORY | LOOKUP_FOLLOW,
++ &path) == 0) {
++ path_put(&path);
++ return true;
++ }
++
++ return false;
++#endif
++}
++
+ static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
+ {
+ struct apertures_struct *ap;
+@@ -376,6 +400,12 @@ static int radeon_pci_probe(struct pci_d
+ if (vga_switcheroo_client_probe_defer(pdev))
+ return -EPROBE_DEFER;
+
++ if ((ent->driver_data & RADEON_FAMILY_MASK) >= CHIP_R600 &&
++ !radeon_firmware_installed()) {
++ DRM_ERROR("radeon kernel modesetting for R600 or later requires firmware installed\n");
++ return -ENODEV;
++ }
++
+ /* Get rid of things like offb */
+ ret = radeon_kick_out_firmware_fb(pdev);
+ if (ret)
+Index: linux/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+===================================================================
+--- linux.orig/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
++++ linux/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+@@ -33,6 +33,8 @@
+ #include <linux/pm_runtime.h>
+ #include <linux/vga_switcheroo.h>
+ #include <drm/drm_crtc_helper.h>
++#include <linux/namei.h>
++#include <linux/path.h>
+
+ #include "amdgpu.h"
+ #include "amdgpu_irq.h"
+@@ -793,6 +795,28 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
+
+ static struct drm_driver kms_driver;
+
++/* Test that /lib/firmware/amdgpu is a directory (or symlink to a
++ * directory). We could try to match the udev search path, but let's
++ * keep it simple.
++ */
++static bool amdgpu_firmware_installed(void)
++{
++#if IS_BUILTIN(CONFIG_DRM_AMDGPU)
++ /* It may be too early to tell. Assume it's there. */
++ return true;
++#else
++ struct path path;
++
++ if (kern_path("/lib/firmware/amdgpu", LOOKUP_DIRECTORY | LOOKUP_FOLLOW,
++ &path) == 0) {
++ path_put(&path);
++ return true;
++ }
++
++ return false;
++#endif
++}
++
+ static int amdgpu_kick_out_firmware_fb(struct pci_dev *pdev)
+ {
+ struct apertures_struct *ap;
+@@ -833,6 +857,11 @@ static int amdgpu_pci_probe(struct pci_d
+ return -ENODEV;
+ }
+
++ if (!amdgpu_firmware_installed()) {
++ DRM_ERROR("amdgpu requires firmware installed\n");
++ return -ENODEV;
++ }
++
+ /*
+ * Initialize amdkfd before starting radeon. If it was not loaded yet,
+ * defer radeon probing
diff --git a/debian/patches/bugfix/all/rtc-s35390a-set-uie_unsupported.patch b/debian/patches/bugfix/all/rtc-s35390a-set-uie_unsupported.patch
new file mode 100644
index 000000000..b3261d952
--- /dev/null
+++ b/debian/patches/bugfix/all/rtc-s35390a-set-uie_unsupported.patch
@@ -0,0 +1,40 @@
+From: Richard Leitner <richard.leitner@skidata.com>
+Date: Thu, 23 May 2019 13:54:49 +0200
+Subject: [PATCH] rtc: s35390a: set uie_unsupported
+Origin: https://git.kernel.org/linus/c0e12848be091e8410fb427f080f2e0149123443
+Bug-Debian: https://bugs.debian.org/932845
+
+Alarms are only supported on a per minute basis. This is why
+uie_unsupported is set. Furthermore issue a warning when a second based
+alarm is requested.
+
+Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
+Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
+---
+ drivers/rtc/rtc-s35390a.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+Index: linux/drivers/rtc/rtc-s35390a.c
+===================================================================
+--- linux.orig/drivers/rtc/rtc-s35390a.c
++++ linux/drivers/rtc/rtc-s35390a.c
+@@ -288,6 +288,9 @@ static int s35390a_rtc_set_alarm(struct
+ alm->time.tm_min, alm->time.tm_hour, alm->time.tm_mday,
+ alm->time.tm_mon, alm->time.tm_year, alm->time.tm_wday);
+
++ if (alm->time.tm_sec != 0)
++ dev_warn(&client->dev, "Alarms are only supported on a per minute basis!\n");
++
+ /* disable interrupt (which deasserts the irq line) */
+ err = s35390a_set_reg(s35390a, S35390A_CMD_STATUS2, &sts, sizeof(sts));
+ if (err < 0)
+@@ -502,6 +505,9 @@ static int s35390a_probe(struct i2c_clie
+ goto exit_dummy;
+ }
+
++ /* supports per-minute alarms only, therefore set uie_unsupported */
++ s35390a->rtc->uie_unsupported = 1;
++
+ if (status1 & S35390A_FLAG_INT2)
+ rtc_update_irq(s35390a->rtc, 1, RTC_AF);
+
diff --git a/debian/patches/bugfix/all/swiotlb-skip-swiotlb_bounce-when-orig_addr-is-zero.patch b/debian/patches/bugfix/all/swiotlb-skip-swiotlb_bounce-when-orig_addr-is-zero.patch
new file mode 100644
index 000000000..df77ca0b2
--- /dev/null
+++ b/debian/patches/bugfix/all/swiotlb-skip-swiotlb_bounce-when-orig_addr-is-zero.patch
@@ -0,0 +1,47 @@
+From: Liu Shixin <liushixin2@huawei.com>
+Date: Thu, 30 Jun 2022 19:33:31 +0800
+Subject: swiotlb: skip swiotlb_bounce when orig_addr is zero
+Origin: https://lore.kernel.org/stable/20220630113331.1544886-1-liushixin2@huawei.com/
+
+After patch ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE"),
+swiotlb_bounce will be called in swiotlb_tbl_map_single unconditionally.
+This requires that the physical address must be valid, which is not always
+true on stable-4.19 or earlier version.
+On stable-4.19, swiotlb_alloc_buffer will call swiotlb_tbl_map_single with
+orig_addr equal to zero, which cause such a panic:
+
+Unable to handle kernel paging request at virtual address ffffb77a40000000
+...
+pc : __memcpy+0x100/0x180
+lr : swiotlb_bounce+0x74/0x88
+...
+Call trace:
+ __memcpy+0x100/0x180
+ swiotlb_tbl_map_single+0x2c8/0x338
+ swiotlb_alloc+0xb4/0x198
+ __dma_alloc+0x84/0x1d8
+ ...
+
+On stable-4.9 and stable-4.14, swiotlb_alloc_coherent wille call map_single
+with orig_addr equal to zero, which can cause same panic.
+
+Fix this by skipping swiotlb_bounce when orig_addr is zero.
+
+Fixes: ddbd89deb7d3 ("swiotlb: fix info leak with DMA_FROM_DEVICE")
+Signed-off-by: Liu Shixin <liushixin2@huawei.com>
+---
+ kernel/dma/swiotlb.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/kernel/dma/swiotlb.c
++++ b/kernel/dma/swiotlb.c
+@@ -594,7 +594,8 @@ found:
+ * unconditional bounce may prevent leaking swiotlb content (i.e.
+ * kernel memory) to user-space.
+ */
+- swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
++ if (orig_addr)
++ swiotlb_bounce(orig_addr, tlb_addr, size, DMA_TO_DEVICE);
+ return tlb_addr;
+ }
+
diff --git a/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
new file mode 100644
index 000000000..39044c390
--- /dev/null
+++ b/debian/patches/bugfix/all/tools-build-remove-bpf-run-time-check-at-build-time.patch
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sun, 21 Feb 2016 15:33:15 +0000
+Subject: tools/build: Remove bpf() run-time check at build time
+Forwarded: no
+
+It is not correct to test that a syscall works on the build system's
+kernel. We might be building on an earlier kernel version or with
+security restrictions that block bpf().
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/build/feature/test-bpf.c
+===================================================================
+--- linux.orig/tools/build/feature/test-bpf.c
++++ linux/tools/build/feature/test-bpf.c
+@@ -35,8 +35,10 @@ int main(void)
+ attr.prog_flags = 0;
+
+ /*
+- * Test existence of __NR_bpf and BPF_PROG_LOAD.
+- * This call should fail if we run the testcase.
++ * bwh: Don't use the bpf() syscall as we might be building on a
++ * much older kernel. Do "use" the attr structure here to avoid
++ * a "set but not used" warning.
+ */
+- return syscall(__NR_bpf, BPF_PROG_LOAD, &attr, sizeof(attr));
++ (void)&attr;
++ return 0;
+ }
diff --git a/debian/patches/bugfix/all/tools-lib-traceevent-use-ldflags.patch b/debian/patches/bugfix/all/tools-lib-traceevent-use-ldflags.patch
new file mode 100644
index 000000000..ae303f360
--- /dev/null
+++ b/debian/patches/bugfix/all/tools-lib-traceevent-use-ldflags.patch
@@ -0,0 +1,29 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 25 Sep 2015 21:26:48 +0100
+Subject: tools/lib/traceevent: Use LDFLAGS
+Forwarded: no
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/lib/traceevent/Makefile
+===================================================================
+--- linux.orig/tools/lib/traceevent/Makefile
++++ linux/tools/lib/traceevent/Makefile
+@@ -174,7 +174,7 @@ $(TE_IN): force
+ $(Q)$(MAKE) $(build)=libtraceevent
+
+ $(OUTPUT)libtraceevent.so.$(EVENT_PARSE_VERSION): $(TE_IN)
+- $(QUIET_LINK)$(CC) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
++ $(QUIET_LINK)$(CC) $(LDFLAGS) --shared $^ -Wl,-soname,libtraceevent.so.$(EP_VERSION) -o $@
+ @ln -sf $(@F) $(OUTPUT)libtraceevent.so
+ @ln -sf $(@F) $(OUTPUT)libtraceevent.so.$(EP_VERSION)
+
+@@ -193,7 +193,7 @@ $(PLUGINS_IN): force
+ $(Q)$(MAKE) $(build)=$(plugin_obj)
+
+ $(OUTPUT)%.so: $(OUTPUT)%-in.o
+- $(QUIET_LINK)$(CC) $(CFLAGS) -shared -nostartfiles -o $@ $^
++ $(QUIET_LINK)$(CC) $(CFLAGS) $(LDFLAGS) -shared -nostartfiles -o $@ $^
+
+ define make_version.h
+ (echo '/* This file is automatically generated. Do not modify. */'; \
diff --git a/debian/patches/bugfix/all/tools-perf-man-date.patch b/debian/patches/bugfix/all/tools-perf-man-date.patch
new file mode 100644
index 000000000..4515c703c
--- /dev/null
+++ b/debian/patches/bugfix/all/tools-perf-man-date.patch
@@ -0,0 +1,37 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Mon, 13 Jul 2015 20:29:20 +0100
+Subject: perf tools: Use $KBUILD_BUILD_TIMESTAMP as man page date
+Forwarded: http://mid.gmane.org/20160517132809.GE7555@decadent.org.uk
+
+This allows man pages to be built reproducibly.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/perf/Documentation/Makefile
+===================================================================
+--- linux.orig/tools/perf/Documentation/Makefile
++++ linux/tools/perf/Documentation/Makefile
+@@ -131,6 +131,9 @@ endif
+ ifdef DOCBOOK_SUPPRESS_SP
+ XMLTO_EXTRA += -m manpage-suppress-sp.xsl
+ endif
++ifdef KBUILD_BUILD_TIMESTAMP
++ASCIIDOC_EXTRA += -a revdate=$(shell date -u -d '$(KBUILD_BUILD_TIMESTAMP)' +%Y-%m-%d)
++endif
+
+ SHELL_PATH ?= $(SHELL)
+ # Shell quote;
+Index: linux/tools/perf/Documentation/asciidoc.conf
+===================================================================
+--- linux.orig/tools/perf/Documentation/asciidoc.conf
++++ linux/tools/perf/Documentation/asciidoc.conf
+@@ -71,6 +71,9 @@ ifdef::backend-docbook[]
+ [header]
+ template::[header-declarations]
+ <refentry>
++<refentryinfo>
++template::[docinfo]
++</refentryinfo>
+ <refmeta>
+ <refentrytitle>{mantitle}</refentrytitle>
+ <manvolnum>{manvolnum}</manvolnum>
diff --git a/debian/patches/bugfix/all/tools-perf-remove-shebangs.patch b/debian/patches/bugfix/all/tools-perf-remove-shebangs.patch
new file mode 100644
index 000000000..d01140709
--- /dev/null
+++ b/debian/patches/bugfix/all/tools-perf-remove-shebangs.patch
@@ -0,0 +1,47 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 25 Sep 2015 20:09:23 +0100
+Subject: tools/perf: Remove shebang lines from perf scripts
+Forwarded: no
+
+perf scripts need to be invoked through perf, not directly through
+perl (or other language interpreter). So including shebang lines in
+them is useless and possibly misleading.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/perf/scripts/perl/rw-by-file.pl
+===================================================================
+--- linux.orig/tools/perf/scripts/perl/rw-by-file.pl
++++ linux/tools/perf/scripts/perl/rw-by-file.pl
+@@ -1,4 +1,3 @@
+-#!/usr/bin/perl -w
+ # (c) 2009, Tom Zanussi <tzanussi@gmail.com>
+ # Licensed under the terms of the GNU GPL License version 2
+
+Index: linux/tools/perf/scripts/perl/rw-by-pid.pl
+===================================================================
+--- linux.orig/tools/perf/scripts/perl/rw-by-pid.pl
++++ linux/tools/perf/scripts/perl/rw-by-pid.pl
+@@ -1,4 +1,3 @@
+-#!/usr/bin/perl -w
+ # (c) 2009, Tom Zanussi <tzanussi@gmail.com>
+ # Licensed under the terms of the GNU GPL License version 2
+
+Index: linux/tools/perf/scripts/perl/rwtop.pl
+===================================================================
+--- linux.orig/tools/perf/scripts/perl/rwtop.pl
++++ linux/tools/perf/scripts/perl/rwtop.pl
+@@ -1,4 +1,3 @@
+-#!/usr/bin/perl -w
+ # (c) 2010, Tom Zanussi <tzanussi@gmail.com>
+ # Licensed under the terms of the GNU GPL License version 2
+
+Index: linux/tools/perf/scripts/perl/wakeup-latency.pl
+===================================================================
+--- linux.orig/tools/perf/scripts/perl/wakeup-latency.pl
++++ linux/tools/perf/scripts/perl/wakeup-latency.pl
+@@ -1,4 +1,3 @@
+-#!/usr/bin/perl -w
+ # (c) 2009, Tom Zanussi <tzanussi@gmail.com>
+ # Licensed under the terms of the GNU GPL License version 2
+
diff --git a/debian/patches/bugfix/all/usb-add-a-hcd_uses_dma-helper.patch b/debian/patches/bugfix/all/usb-add-a-hcd_uses_dma-helper.patch
new file mode 100644
index 000000000..341018e58
--- /dev/null
+++ b/debian/patches/bugfix/all/usb-add-a-hcd_uses_dma-helper.patch
@@ -0,0 +1,110 @@
+From: Christoph Hellwig <hch@lst.de>
+Date: Sun, 11 Aug 2019 10:05:16 +0200
+Subject: usb: add a hcd_uses_dma helper
+Origin: https://git.kernel.org/linus/edfbcb321faf07ca970e4191abe061deeb7d3788
+
+The USB buffer allocation code is the only place in the usb core (and in
+fact the whole kernel) that uses is_device_dma_capable, while the URB
+mapping code uses the uses_dma flag in struct usb_bus. Switch the buffer
+allocation to use the uses_dma flag used by the rest of the USB code,
+and create a helper in hcd.h that checks this flag as well as the
+CONFIG_HAS_DMA to simplify the caller a bit.
+
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Link: https://lore.kernel.org/r/20190811080520.21712-3-hch@lst.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/core/buffer.c | 10 +++-------
+ drivers/usb/core/hcd.c | 4 ++--
+ drivers/usb/dwc2/hcd.c | 2 +-
+ include/linux/usb.h | 2 +-
+ include/linux/usb/hcd.h | 3 +++
+ 5 files changed, 10 insertions(+), 11 deletions(-)
+
+--- a/drivers/usb/core/buffer.c
++++ b/drivers/usb/core/buffer.c
+@@ -66,9 +66,7 @@
+ char name[16];
+ int i, size;
+
+- if (hcd->localmem_pool ||
+- !IS_ENABLED(CONFIG_HAS_DMA) ||
+- !is_device_dma_capable(hcd->self.sysdev))
++ if (hcd->localmem_pool || !hcd_uses_dma(hcd))
+ return 0;
+
+ for (i = 0; i < HCD_BUFFER_POOLS; i++) {
+@@ -133,8 +131,7 @@
+ return gen_pool_dma_alloc(hcd->localmem_pool, size, dma);
+
+ /* some USB hosts just use PIO */
+- if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+- !is_device_dma_capable(bus->sysdev)) {
++ if (!hcd_uses_dma(hcd)) {
+ *dma = ~(dma_addr_t) 0;
+ return kmalloc(size, mem_flags);
+ }
+@@ -164,8 +161,7 @@
+ return;
+ }
+
+- if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+- !is_device_dma_capable(bus->sysdev)) {
++ if (!hcd_uses_dma(hcd)) {
+ kfree(addr);
+ return;
+ }
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -1511,7 +1511,7 @@
+ if (usb_endpoint_xfer_control(&urb->ep->desc)) {
+ if (hcd->self.uses_pio_for_control)
+ return ret;
+- if (IS_ENABLED(CONFIG_HAS_DMA) && hcd->self.uses_dma) {
++ if (hcd_uses_dma(hcd)) {
+ if (is_vmalloc_addr(urb->setup_packet)) {
+ WARN_ONCE(1, "setup packet is not dma capable\n");
+ return -EAGAIN;
+@@ -1545,7 +1545,7 @@
+ dir = usb_urb_dir_in(urb) ? DMA_FROM_DEVICE : DMA_TO_DEVICE;
+ if (urb->transfer_buffer_length != 0
+ && !(urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)) {
+- if (IS_ENABLED(CONFIG_HAS_DMA) && hcd->self.uses_dma) {
++ if (hcd_uses_dma(hcd)) {
+ if (urb->num_sgs) {
+ int n;
+
+--- a/drivers/usb/dwc2/hcd.c
++++ b/drivers/usb/dwc2/hcd.c
+@@ -4770,7 +4770,7 @@
+
+ buf = urb->transfer_buffer;
+
+- if (hcd->self.uses_dma) {
++ if (hcd_uses_dma(hcd)) {
+ if (!buf && (urb->transfer_dma & 3)) {
+ dev_err(hsotg->dev,
+ "%s: unaligned transfer with no transfer_buffer",
+--- a/include/linux/usb.h
++++ b/include/linux/usb.h
+@@ -1455,7 +1455,7 @@
+ * field rather than determining a dma address themselves.
+ *
+ * Note that transfer_buffer must still be set if the controller
+- * does not support DMA (as indicated by bus.uses_dma) and when talking
++ * does not support DMA (as indicated by hcd_uses_dma()) and when talking
+ * to root hub. If you have to trasfer between highmem zone and the device
+ * on such controller, create a bounce buffer or bail out with an error.
+ * If transfer_buffer cannot be set (is in highmem) and the controller is DMA
+--- a/include/linux/usb/hcd.h
++++ b/include/linux/usb/hcd.h
+@@ -422,6 +422,9 @@
+ return hcd->high_prio_bh.completing_ep == ep;
+ }
+
++#define hcd_uses_dma(hcd) \
++ (IS_ENABLED(CONFIG_HAS_DMA) && (hcd)->self.uses_dma)
++
+ extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
+ extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
+ int status);
diff --git a/debian/patches/bugfix/all/usb-dont-create-dma-pools-for-HCD.patch b/debian/patches/bugfix/all/usb-dont-create-dma-pools-for-HCD.patch
new file mode 100644
index 000000000..197a4fadb
--- /dev/null
+++ b/debian/patches/bugfix/all/usb-dont-create-dma-pools-for-HCD.patch
@@ -0,0 +1,31 @@
+From: Christoph Hellwig <hch@lst.de>
+Date: Sun, 11 Aug 2019 10:05:15 +0200
+Subject: usb: don't create dma pools for HCDs with a localmem_pool
+Origin: https://git.kernel.org/linus/dd3ecf17ba70a70d2c9ef9ba725281b84f8eef12
+
+If the HCD provides a localmem pool we will never use the DMA pools, so
+don't create them.
+
+Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory")
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+Link: https://lore.kernel.org/r/20190811080520.21712-2-hch@lst.de
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/core/buffer.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/core/buffer.c
++++ b/drivers/usb/core/buffer.c
+@@ -66,9 +66,9 @@
+ char name[16];
+ int i, size;
+
+- if (!IS_ENABLED(CONFIG_HAS_DMA) ||
+- (!is_device_dma_capable(hcd->self.sysdev) &&
+- !hcd->localmem_pool))
++ if (hcd->localmem_pool ||
++ !IS_ENABLED(CONFIG_HAS_DMA) ||
++ !is_device_dma_capable(hcd->self.sysdev))
+ return 0;
+
+ for (i = 0; i < HCD_BUFFER_POOLS; i++) {
diff --git a/debian/patches/bugfix/all/usb-hcd-Fix-a-NULL-vs-IS_ERR-bug-in-usb_hcd_setup_lo.patch b/debian/patches/bugfix/all/usb-hcd-Fix-a-NULL-vs-IS_ERR-bug-in-usb_hcd_setup_lo.patch
new file mode 100644
index 000000000..920b0b780
--- /dev/null
+++ b/debian/patches/bugfix/all/usb-hcd-Fix-a-NULL-vs-IS_ERR-bug-in-usb_hcd_setup_lo.patch
@@ -0,0 +1,35 @@
+From: Dan Carpenter <dan.carpenter@oracle.com>
+Date: Fri, 7 Jun 2019 16:57:09 +0300
+Subject: usb/hcd: Fix a NULL vs IS_ERR() bug in usb_hcd_setup_local_mem()
+Origin: https://git.kernel.org/linus/94b9a70d32db0d1e8eeaeb27d74a5ae712644da9
+
+The devm_memremap() function doesn't return NULL, it returns error
+pointers.
+
+Fixes: b0310c2f09bb ("USB: use genalloc for USB HCs with local memory")
+Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
+Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
+Link: https://lore.kernel.org/r/20190607135709.GC16718@mwanda
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/core/hcd.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
+index 8b8ec0c7325d..a84b201dd844 100644
+--- a/drivers/usb/core/hcd.c
++++ b/drivers/usb/core/hcd.c
+@@ -3038,8 +3038,8 @@ int usb_hcd_setup_local_mem(struct usb_hcd *hcd, phys_addr_t phys_addr,
+
+ local_mem = devm_memremap(hcd->self.sysdev, phys_addr,
+ size, MEMREMAP_WC);
+- if (!local_mem)
+- return -ENOMEM;
++ if (IS_ERR(local_mem))
++ return PTR_ERR(local_mem);
+
+ /*
+ * Here we pass a dma_addr_t but the arg type is a phys_addr_t.
+--
+2.26.2
+
diff --git a/debian/patches/bugfix/all/usb-host-ohci-sm501-init-genalloc-for-local-memory.patch b/debian/patches/bugfix/all/usb-host-ohci-sm501-init-genalloc-for-local-memory.patch
new file mode 100644
index 000000000..39d46e009
--- /dev/null
+++ b/debian/patches/bugfix/all/usb-host-ohci-sm501-init-genalloc-for-local-memory.patch
@@ -0,0 +1,105 @@
+From: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Date: Wed, 29 May 2019 13:28:41 +0300
+Subject: usb: host: ohci-sm501: init genalloc for local memory
+Origin: https://git.kernel.org/linus/7d9e6f5aebe8c03f1a5199ca5c30f0c53042af23
+
+In preparation for dropping the existing "coherent" dma mem declaration
+APIs, replace the current dma_declare_coherent_memory() based mechanism
+with the creation of a genalloc pool that will be used in the OHCI
+subsystem as replacement for the DMA APIs.
+
+Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ drivers/usb/host/ohci-sm501.c | 47 +++++++++++++++--------------------
+ 1 file changed, 20 insertions(+), 27 deletions(-)
+
+--- a/drivers/usb/host/ohci-sm501.c
++++ b/drivers/usb/host/ohci-sm501.c
+@@ -110,41 +110,18 @@
+ goto err0;
+ }
+
+- /* The sm501 chip is equipped with local memory that may be used
+- * by on-chip devices such as the video controller and the usb host.
+- * This driver uses dma_declare_coherent_memory() to make sure
+- * usb allocations with dma_alloc_coherent() allocate from
+- * this local memory. The dma_handle returned by dma_alloc_coherent()
+- * will be an offset starting from 0 for the first local memory byte.
+- *
+- * So as long as data is allocated using dma_alloc_coherent() all is
+- * fine. This is however not always the case - buffers may be allocated
+- * using kmalloc() - so the usb core needs to be told that it must copy
+- * data into our local memory if the buffers happen to be placed in
+- * regular memory. The HCD_LOCAL_MEM flag does just that.
+- */
+-
+- retval = dma_declare_coherent_memory(dev, mem->start,
+- mem->start - mem->parent->start,
+- resource_size(mem),
+- DMA_MEMORY_EXCLUSIVE);
+- if (retval) {
+- dev_err(dev, "cannot declare coherent memory\n");
+- goto err1;
+- }
+-
+ /* allocate, reserve and remap resources for registers */
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (res == NULL) {
+ dev_err(dev, "no resource definition for registers\n");
+ retval = -ENOENT;
+- goto err2;
++ goto err1;
+ }
+
+ hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev));
+ if (!hcd) {
+ retval = -ENOMEM;
+- goto err2;
++ goto err1;
+ }
+
+ hcd->rsrc_start = res->start;
+@@ -165,6 +142,24 @@
+
+ ohci_hcd_init(hcd_to_ohci(hcd));
+
++ /* The sm501 chip is equipped with local memory that may be used
++ * by on-chip devices such as the video controller and the usb host.
++ * This driver uses genalloc so that usb allocations with
++ * gen_pool_dma_alloc() allocate from this local memory. The dma_handle
++ * returned by gen_pool_dma_alloc() will be an offset starting from 0
++ * for the first local memory byte.
++ *
++ * So as long as data is allocated using gen_pool_dma_alloc() all is
++ * fine. This is however not always the case - buffers may be allocated
++ * using kmalloc() - so the usb core needs to be told that it must copy
++ * data into our local memory if the buffers happen to be placed in
++ * regular memory. The HCD_LOCAL_MEM flag does just that.
++ */
++
++ if (usb_hcd_setup_local_mem(hcd, mem->start,
++ mem->start - mem->parent->start,
++ resource_size(mem)) < 0)
++ goto err5;
+ retval = usb_add_hcd(hcd, irq, IRQF_SHARED);
+ if (retval)
+ goto err5;
+@@ -182,8 +177,6 @@
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ err3:
+ usb_put_hcd(hcd);
+-err2:
+- dma_release_declared_memory(dev);
+ err1:
+ release_mem_region(mem->start, resource_size(mem));
+ err0:
+@@ -199,7 +192,6 @@
+ iounmap(hcd->regs);
+ release_mem_region(hcd->rsrc_start, hcd->rsrc_len);
+ usb_put_hcd(hcd);
+- dma_release_declared_memory(&pdev->dev);
+ mem = platform_get_resource(pdev, IORESOURCE_MEM, 1);
+ if (mem)
+ release_mem_region(mem->start, resource_size(mem));
diff --git a/debian/patches/bugfix/all/usbip-document-tcp-wrappers.patch b/debian/patches/bugfix/all/usbip-document-tcp-wrappers.patch
new file mode 100644
index 000000000..0943df590
--- /dev/null
+++ b/debian/patches/bugfix/all/usbip-document-tcp-wrappers.patch
@@ -0,0 +1,31 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Sun, 24 Jun 2012 02:51:39 +0100
+Subject: usbip: Document TCP wrappers
+Forwarded: no
+
+Add references to TCP wrappers configuration in the manual page.
+
+Index: linux/tools/usb/usbip/doc/usbipd.8
+===================================================================
+--- linux.orig/tools/usb/usbip/doc/usbipd.8
++++ linux/tools/usb/usbip/doc/usbipd.8
+@@ -14,7 +14,8 @@ Devices have to explicitly be exported u
+ before usbipd makes them available to other hosts.
+
+ The daemon accepts connections from USB/IP clients
+-on TCP port 3240 by default.
++on TCP port 3240 by default. The clients authorised to connect may be
++configured as documented in hosts_access(5).
+
+ .SH OPTIONS
+ .HP
+@@ -69,7 +70,8 @@ Show version.
+
+ .B usbipd
+ offers no authentication or authorization for USB/IP. Any
+-USB/IP client can connect and use exported devices.
++USB/IP client running on an authorised host can connect and
++use exported devices.
+
+ .SH EXAMPLES
+
diff --git a/debian/patches/bugfix/all/usbip-fix-misuse-of-strncpy.patch b/debian/patches/bugfix/all/usbip-fix-misuse-of-strncpy.patch
new file mode 100644
index 000000000..b98025b8a
--- /dev/null
+++ b/debian/patches/bugfix/all/usbip-fix-misuse-of-strncpy.patch
@@ -0,0 +1,61 @@
+From: Ben Hutchings <ben@decadent.org.uk>
+Date: Fri, 20 Jul 2018 01:30:24 +0100
+Subject: usbip: Fix misuse of strncpy()
+Bug-Debian: https://bugs.debian.org/897802
+Forwarded: https://marc.info/?l=linux-usb&m=153213915806258
+
+gcc 8 reports:
+
+usbip_device_driver.c: In function ‘read_usb_vudc_device’:
+usbip_device_driver.c:106:2: error: ‘strncpy’ specified bound 256 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->path, path, SYSFS_PATH_MAX);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+usbip_device_driver.c:125:2: error: ‘strncpy’ specified bound 32 equals destination size [-Werror=stringop-truncation]
+ strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
+ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+I'm not convinced it makes sense to truncate the copied strings here,
+but since we're already doing so let's ensure they're still null-
+terminated. We can't easily use strlcpy() here, so use snprintf().
+
+usbip_common.c has the same problem.
+
+Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
+---
+Index: linux/tools/usb/usbip/libsrc/usbip_common.c
+===================================================================
+--- linux.orig/tools/usb/usbip/libsrc/usbip_common.c
++++ linux/tools/usb/usbip/libsrc/usbip_common.c
+@@ -226,8 +226,8 @@ int read_usb_device(struct udev_device *
+ path = udev_device_get_syspath(sdev);
+ name = udev_device_get_sysname(sdev);
+
+- strncpy(udev->path, path, SYSFS_PATH_MAX);
+- strncpy(udev->busid, name, SYSFS_BUS_ID_SIZE);
++ snprintf(udev->path, SYSFS_PATH_MAX, "%s", path);
++ snprintf(udev->busid, SYSFS_BUS_ID_SIZE, "%s", name);
+
+ sscanf(name, "%u-%u", &busnum, &devnum);
+ udev->busnum = busnum;
+Index: linux/tools/usb/usbip/libsrc/usbip_device_driver.c
+===================================================================
+--- linux.orig/tools/usb/usbip/libsrc/usbip_device_driver.c
++++ linux/tools/usb/usbip/libsrc/usbip_device_driver.c
+@@ -103,7 +103,7 @@ int read_usb_vudc_device(struct udev_dev
+ copy_descr_attr16(dev, &descr, idProduct);
+ copy_descr_attr16(dev, &descr, bcdDevice);
+
+- strncpy(dev->path, path, SYSFS_PATH_MAX);
++ snprintf(dev->path, SYSFS_PATH_MAX, "%s", path);
+
+ dev->speed = USB_SPEED_UNKNOWN;
+ speed = udev_device_get_sysattr_value(sdev, "current_speed");
+@@ -122,7 +122,7 @@ int read_usb_vudc_device(struct udev_dev
+ dev->busnum = 0;
+
+ name = udev_device_get_sysname(plat);
+- strncpy(dev->busid, name, SYSFS_BUS_ID_SIZE);
++ snprintf(dev->busid, SYSFS_BUS_ID_SIZE, "%s", name);
+ return 0;
+ err:
+ fclose(fd);