]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.0-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2013 20:56:12 +0000 (13:56 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 20 Jun 2013 20:56:12 +0000 (13:56 -0700)
added patches:
alsa-usb-audio-work-around-android-accessory-firmware-bug.patch
arm-7755-1-handle-user-space-mapped-pages-in-flush_kernel_dcache_page.patch
tilepro-work-around-module-link-error-with-gcc-4.7.patch

queue-3.0/alsa-usb-audio-work-around-android-accessory-firmware-bug.patch [new file with mode: 0644]
queue-3.0/arm-7755-1-handle-user-space-mapped-pages-in-flush_kernel_dcache_page.patch [new file with mode: 0644]
queue-3.0/series [new file with mode: 0644]
queue-3.0/tilepro-work-around-module-link-error-with-gcc-4.7.patch [new file with mode: 0644]

diff --git a/queue-3.0/alsa-usb-audio-work-around-android-accessory-firmware-bug.patch b/queue-3.0/alsa-usb-audio-work-around-android-accessory-firmware-bug.patch
new file mode 100644 (file)
index 0000000..83e990c
--- /dev/null
@@ -0,0 +1,67 @@
+From 342cda29343a6272c630f94ed56810a76740251b Mon Sep 17 00:00:00 2001
+From: Clemens Ladisch <clemens@ladisch.de>
+Date: Sat, 15 Jun 2013 11:21:09 +0200
+Subject: ALSA: usb-audio: work around Android accessory firmware bug
+
+From: Clemens Ladisch <clemens@ladisch.de>
+
+commit 342cda29343a6272c630f94ed56810a76740251b upstream.
+
+When the Android firmware enables the audio interfaces in accessory
+mode, it always declares in the control interface's baInterfaceNr array
+that interfaces 0 and 1 belong to the audio function.  However, the
+accessory interface itself, if also enabled, already is at index 0 and
+shifts the actual audio interface numbers to 1 and 2, which prevents the
+PCM streaming interface from being seen by the host driver.
+
+To get the PCM interface interface to work, detect when the descriptors
+point to the (for this driver useless) accessory interface, and redirect
+to the correct one.
+
+Reported-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
+Tested-by: Jeremy Rosen <jeremy.rosen@openwide.fr>
+Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
+Signed-off-by: Takashi Iwai <tiwai@suse.de>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ sound/usb/card.c |   22 ++++++++++++++++++++--
+ 1 file changed, 20 insertions(+), 2 deletions(-)
+
+--- a/sound/usb/card.c
++++ b/sound/usb/card.c
+@@ -148,14 +148,32 @@ static int snd_usb_create_stream(struct
+               return -EINVAL;
+       }
++      alts = &iface->altsetting[0];
++      altsd = get_iface_desc(alts);
++
++      /*
++       * Android with both accessory and audio interfaces enabled gets the
++       * interface numbers wrong.
++       */
++      if ((chip->usb_id == USB_ID(0x18d1, 0x2d04) ||
++           chip->usb_id == USB_ID(0x18d1, 0x2d05)) &&
++          interface == 0 &&
++          altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC &&
++          altsd->bInterfaceSubClass == USB_SUBCLASS_VENDOR_SPEC) {
++              interface = 2;
++              iface = usb_ifnum_to_if(dev, interface);
++              if (!iface)
++                      return -EINVAL;
++              alts = &iface->altsetting[0];
++              altsd = get_iface_desc(alts);
++      }
++
+       if (usb_interface_claimed(iface)) {
+               snd_printdd(KERN_INFO "%d:%d:%d: skipping, already claimed\n",
+                                               dev->devnum, ctrlif, interface);
+               return -EINVAL;
+       }
+-      alts = &iface->altsetting[0];
+-      altsd = get_iface_desc(alts);
+       if ((altsd->bInterfaceClass == USB_CLASS_AUDIO ||
+            altsd->bInterfaceClass == USB_CLASS_VENDOR_SPEC) &&
+           altsd->bInterfaceSubClass == USB_SUBCLASS_MIDISTREAMING) {
diff --git a/queue-3.0/arm-7755-1-handle-user-space-mapped-pages-in-flush_kernel_dcache_page.patch b/queue-3.0/arm-7755-1-handle-user-space-mapped-pages-in-flush_kernel_dcache_page.patch
new file mode 100644 (file)
index 0000000..16b7843
--- /dev/null
@@ -0,0 +1,82 @@
+From 1bc39742aab09248169ef9d3727c9def3528b3f3 Mon Sep 17 00:00:00 2001
+From: Simon Baatz <gmbnomis@gmail.com>
+Date: Mon, 10 Jun 2013 21:10:12 +0100
+Subject: ARM: 7755/1: handle user space mapped pages in flush_kernel_dcache_page
+
+From: Simon Baatz <gmbnomis@gmail.com>
+
+commit 1bc39742aab09248169ef9d3727c9def3528b3f3 upstream.
+
+Commit f8b63c1 made flush_kernel_dcache_page a no-op assuming that
+the pages it needs to handle are kernel mapped only.  However, for
+example when doing direct I/O, pages with user space mappings may
+occur.
+
+Thus, continue to do lazy flushing if there are no user space
+mappings.  Otherwise, flush the kernel cache lines directly.
+
+Signed-off-by: Simon Baatz <gmbnomis@gmail.com>
+Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
+Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/arm/include/asm/cacheflush.h |    4 +---
+ arch/arm/mm/flush.c               |   33 +++++++++++++++++++++++++++++++++
+ 2 files changed, 34 insertions(+), 3 deletions(-)
+
+--- a/arch/arm/include/asm/cacheflush.h
++++ b/arch/arm/include/asm/cacheflush.h
+@@ -305,9 +305,7 @@ static inline void flush_anon_page(struc
+ }
+ #define ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE
+-static inline void flush_kernel_dcache_page(struct page *page)
+-{
+-}
++extern void flush_kernel_dcache_page(struct page *);
+ #define flush_dcache_mmap_lock(mapping) \
+       spin_lock_irq(&(mapping)->tree_lock)
+--- a/arch/arm/mm/flush.c
++++ b/arch/arm/mm/flush.c
+@@ -304,6 +304,39 @@ void flush_dcache_page(struct page *page
+ EXPORT_SYMBOL(flush_dcache_page);
+ /*
++ * Ensure cache coherency for the kernel mapping of this page. We can
++ * assume that the page is pinned via kmap.
++ *
++ * If the page only exists in the page cache and there are no user
++ * space mappings, this is a no-op since the page was already marked
++ * dirty at creation.  Otherwise, we need to flush the dirty kernel
++ * cache lines directly.
++ */
++void flush_kernel_dcache_page(struct page *page)
++{
++      if (cache_is_vivt() || cache_is_vipt_aliasing()) {
++              struct address_space *mapping;
++
++              mapping = page_mapping(page);
++
++              if (!mapping || mapping_mapped(mapping)) {
++                      void *addr;
++
++                      addr = page_address(page);
++                      /*
++                       * kmap_atomic() doesn't set the page virtual
++                       * address for highmem pages, and
++                       * kunmap_atomic() takes care of cache
++                       * flushing already.
++                       */
++                      if (!IS_ENABLED(CONFIG_HIGHMEM) || addr)
++                              __cpuc_flush_dcache_area(addr, PAGE_SIZE);
++              }
++      }
++}
++EXPORT_SYMBOL(flush_kernel_dcache_page);
++
++/*
+  * Flush an anonymous page so that users of get_user_pages()
+  * can safely access the data.  The expected sequence is:
+  *
diff --git a/queue-3.0/series b/queue-3.0/series
new file mode 100644 (file)
index 0000000..88625d5
--- /dev/null
@@ -0,0 +1,3 @@
+arm-7755-1-handle-user-space-mapped-pages-in-flush_kernel_dcache_page.patch
+alsa-usb-audio-work-around-android-accessory-firmware-bug.patch
+tilepro-work-around-module-link-error-with-gcc-4.7.patch
diff --git a/queue-3.0/tilepro-work-around-module-link-error-with-gcc-4.7.patch b/queue-3.0/tilepro-work-around-module-link-error-with-gcc-4.7.patch
new file mode 100644 (file)
index 0000000..33d91e3
--- /dev/null
@@ -0,0 +1,31 @@
+From 3cb3f839d306443f3d1e79b0bde1a2ad2c12b555 Mon Sep 17 00:00:00 2001
+From: Chris Metcalf <cmetcalf@tilera.com>
+Date: Sat, 15 Jun 2013 16:47:47 -0400
+Subject: tilepro: work around module link error with gcc 4.7
+
+From: Chris Metcalf <cmetcalf@tilera.com>
+
+commit 3cb3f839d306443f3d1e79b0bde1a2ad2c12b555 upstream.
+
+gcc 4.7.x is emitting calls to __ffsdi2 where previously
+it used to inline the appropriate ctz instructions.
+While this needs to be fixed in gcc, it's also easy to avoid
+having it cause build failures when building with those
+compilers by exporting __ffsdi2 to modules.
+
+Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ arch/tile/lib/exports.c |    2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/arch/tile/lib/exports.c
++++ b/arch/tile/lib/exports.c
+@@ -89,4 +89,6 @@ uint64_t __ashrdi3(uint64_t, unsigned in
+ EXPORT_SYMBOL(__ashrdi3);
+ uint64_t __ashldi3(uint64_t, unsigned int);
+ EXPORT_SYMBOL(__ashldi3);
++int __ffsdi2(uint64_t);
++EXPORT_SYMBOL(__ffsdi2);
+ #endif