]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
some .27 patches
authorGreg Kroah-Hartman <gregkh@suse.de>
Sat, 5 Dec 2009 23:05:17 +0000 (15:05 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 5 Dec 2009 23:05:17 +0000 (15:05 -0800)
queue-2.6.27/enable-acpi-pdc-handshake-for-via-centaur-cpus.patch [new file with mode: 0644]
queue-2.6.27/fuse-prevent-fuse_put_request-on-invalid-pointer.patch [new file with mode: 0644]
queue-2.6.27/fuse-reject-o_direct-flag-also-in-fuse_create.patch [new file with mode: 0644]
queue-2.6.27/isdn-hfc_usb-fix-read-buffer-overflow.patch [new file with mode: 0644]
queue-2.6.27/series
queue-2.6.27/thinkpad-acpi-fix-sign-of-erestartsys-return.patch [new file with mode: 0644]
queue-2.6.27/usb-ohci-quirk-amd-prefetch-for-usb-1.1-iso-transfer.patch [new file with mode: 0644]

diff --git a/queue-2.6.27/enable-acpi-pdc-handshake-for-via-centaur-cpus.patch b/queue-2.6.27/enable-acpi-pdc-handshake-for-via-centaur-cpus.patch
new file mode 100644 (file)
index 0000000..459daa9
--- /dev/null
@@ -0,0 +1,44 @@
+From d77b81974521c82fa6fda38dfff1b491dcc62a32 Mon Sep 17 00:00:00 2001
+From: Harald Welte <HaraldWelte@viatech.com>
+Date: Tue, 24 Nov 2009 16:53:00 +0100
+Subject: [CPUFREQ] Enable ACPI PDC handshake for VIA/Centaur CPUs
+
+From: Harald Welte <HaraldWelte@viatech.com>
+
+commit d77b81974521c82fa6fda38dfff1b491dcc62a32 upstream.
+
+In commit 0de51088e6a82bc8413d3ca9e28bbca2788b5b53, we introduced the
+use of acpi-cpufreq on VIA/Centaur CPU's by removing a vendor check for
+VENDOR_INTEL.  However, as it turns out, at least the Nano CPU's also
+need the PDC (processor driver capabilities) handshake in order to
+activate the methods required for acpi-cpufreq.
+
+Since arch_acpi_processor_init_pdc() contains another vendor check for
+Intel, the PDC is not initialized on VIA CPU's.  The resulting behavior
+of a current mainline kernel on such systems is:  acpi-cpufreq
+loads and it indicates CPU frequency changes.  However, the CPU stays at
+a single frequency
+
+This trivial patch ensures that init_intel_pdc() is called on Intel and
+VIA/Centaur CPU's alike.
+
+Signed-off-by: Harald Welte <HaraldWelte@viatech.com>
+Signed-off-by: Dave Jones <davej@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ arch/x86/kernel/acpi/processor.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/arch/x86/kernel/acpi/processor.c
++++ b/arch/x86/kernel/acpi/processor.c
+@@ -78,7 +78,8 @@ void arch_acpi_processor_init_pdc(struct
+       struct cpuinfo_x86 *c = &cpu_data(pr->id);
+       pr->pdc = NULL;
+-      if (c->x86_vendor == X86_VENDOR_INTEL)
++      if (c->x86_vendor == X86_VENDOR_INTEL ||
++          c->x86_vendor == X86_VENDOR_CENTAUR)
+               init_intel_pdc(pr, c);
+       return;
diff --git a/queue-2.6.27/fuse-prevent-fuse_put_request-on-invalid-pointer.patch b/queue-2.6.27/fuse-prevent-fuse_put_request-on-invalid-pointer.patch
new file mode 100644 (file)
index 0000000..ab63366
--- /dev/null
@@ -0,0 +1,33 @@
+From f60311d5f7670d9539b424e4ed8b5c0872fc9e83 Mon Sep 17 00:00:00 2001
+From: Anand V. Avati <avati@gluster.com>
+Date: Thu, 22 Oct 2009 06:24:52 -0700
+Subject: fuse: prevent fuse_put_request on invalid pointer
+
+From: Anand V. Avati <avati@gluster.com>
+
+commit f60311d5f7670d9539b424e4ed8b5c0872fc9e83 upstream.
+
+fuse_direct_io() has a loop where requests are allocated in each
+iteration. if allocation fails, the loop is broken out and follows
+into an unconditional fuse_put_request() on that invalid pointer.
+
+Signed-off-by: Anand V. Avati <avati@gluster.com>
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/fuse/file.c |    3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/fs/fuse/file.c
++++ b/fs/fuse/file.c
+@@ -1005,7 +1005,8 @@ static ssize_t fuse_direct_io(struct fil
+                               break;
+               }
+       }
+-      fuse_put_request(fc, req);
++      if (!IS_ERR(req))
++              fuse_put_request(fc, req);
+       if (res > 0) {
+               if (write)
+                       fuse_write_update_size(inode, pos);
diff --git a/queue-2.6.27/fuse-reject-o_direct-flag-also-in-fuse_create.patch b/queue-2.6.27/fuse-reject-o_direct-flag-also-in-fuse_create.patch
new file mode 100644 (file)
index 0000000..bae5056
--- /dev/null
@@ -0,0 +1,43 @@
+From 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 Mon Sep 17 00:00:00 2001
+From: Csaba Henk <csaba@gluster.com>
+Date: Fri, 27 Nov 2009 19:30:14 +0530
+Subject: fuse: reject O_DIRECT flag also in fuse_create
+
+From: Csaba Henk <csaba@gluster.com>
+
+commit 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 upstream.
+
+The comment in fuse_open about O_DIRECT:
+
+  "VFS checks this, but only _after_ ->open()"
+
+also holds for fuse_create, however, the same kind of check was missing there.
+
+As an impact of this bug, open(newfile, O_RDWR|O_CREAT|O_DIRECT) fails, but a
+stub newfile will remain if the fuse server handled the implied FUSE_CREATE
+request appropriately.
+
+Other impact: in the above situation ima_file_free() will complain to open/free
+imbalance if CONFIG_IMA is set.
+
+Signed-off-by: Csaba Henk <csaba@gluster.com>
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+Cc: Harshavardhana <harsha@gluster.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ fs/fuse/dir.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/fs/fuse/dir.c
++++ b/fs/fuse/dir.c
+@@ -398,6 +398,9 @@ static int fuse_create_open(struct inode
+       if (fc->no_create)
+               return -ENOSYS;
++      if (flags & O_DIRECT)
++              return -EINVAL;
++
+       forget_req = fuse_get_req(fc);
+       if (IS_ERR(forget_req))
+               return PTR_ERR(forget_req);
diff --git a/queue-2.6.27/isdn-hfc_usb-fix-read-buffer-overflow.patch b/queue-2.6.27/isdn-hfc_usb-fix-read-buffer-overflow.patch
new file mode 100644 (file)
index 0000000..d34b73a
--- /dev/null
@@ -0,0 +1,34 @@
+From 286e633ef0ff5bb63c07b4516665da8004966fec Mon Sep 17 00:00:00 2001
+From: Roel Kluin <roel.kluin@gmail.com>
+Date: Wed, 4 Nov 2009 08:31:59 -0800
+Subject: isdn: hfc_usb: Fix read buffer overflow
+
+From: Roel Kluin <roel.kluin@gmail.com>
+
+commit 286e633ef0ff5bb63c07b4516665da8004966fec upstream.
+
+Check whether index is within bounds before testing the element.
+
+Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
+Cc: Karsten Keil <isdn@linux-pingi.de>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/isdn/hisax/hfc_usb.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/isdn/hisax/hfc_usb.c
++++ b/drivers/isdn/hisax/hfc_usb.c
+@@ -818,8 +818,8 @@ collect_rx_frame(usb_fifo * fifo, __u8 *
+       }
+       /* we have a complete hdlc packet */
+       if (finish) {
+-              if ((!fifo->skbuff->data[fifo->skbuff->len - 1])
+-                  && (fifo->skbuff->len > 3)) {
++              if (fifo->skbuff->len > 3 &&
++                              !fifo->skbuff->data[fifo->skbuff->len - 1]) {
+                       if (fifon == HFCUSB_D_RX) {
+                               DBG(HFCUSB_DBG_DCHANNEL,
index 2bd673df5c885a4b1cee9eb9df0b08259dc49e14..afeaa0b3701fa4adbea220131b32513d379913fe 100644 (file)
@@ -8,3 +8,9 @@ v4l-dvb-13107-tda18271-fix-overflow-in-fm-radio-frequency-calculation.patch
 v4l-dvb-13109-tda18271-fix-signedness-issue-in-tda18271_rf_tracking_filters_init.patch
 v4l-dvb-13190-em28xx-fix-panic-that-can-occur-when-starting-audio-streaming.patch
 v4l-dvb-13230-s2255drv-don-t-conditionalize-video-buffer-completion-on-waiting-processes.patch
+enable-acpi-pdc-handshake-for-via-centaur-cpus.patch
+fuse-reject-o_direct-flag-also-in-fuse_create.patch
+fuse-prevent-fuse_put_request-on-invalid-pointer.patch
+isdn-hfc_usb-fix-read-buffer-overflow.patch
+thinkpad-acpi-fix-sign-of-erestartsys-return.patch
+usb-ohci-quirk-amd-prefetch-for-usb-1.1-iso-transfer.patch
diff --git a/queue-2.6.27/thinkpad-acpi-fix-sign-of-erestartsys-return.patch b/queue-2.6.27/thinkpad-acpi-fix-sign-of-erestartsys-return.patch
new file mode 100644 (file)
index 0000000..9e442ce
--- /dev/null
@@ -0,0 +1,32 @@
+From 80a8d1228e90349b4514e8c925c061fa5cbcea75 Mon Sep 17 00:00:00 2001
+From: Roel Kluin <roel.kluin@gmail.com>
+Date: Fri, 20 Nov 2009 19:48:23 +0100
+Subject: thinkpad-acpi: fix sign of ERESTARTSYS return
+
+From: Roel Kluin <roel.kluin@gmail.com>
+
+commit 80a8d1228e90349b4514e8c925c061fa5cbcea75 upstream.
+
+The returned error should be negative
+
+Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
+Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Len Brown <len.brown@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/misc/thinkpad_acpi.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/misc/thinkpad_acpi.c
++++ b/drivers/misc/thinkpad_acpi.c
+@@ -5042,7 +5042,7 @@ static int brightness_write(char *buf)
+        * Doing it this way makes the syscall restartable in case of EINTR
+        */
+       rc = brightness_set(level);
+-      return (rc == -EINTR)? ERESTARTSYS : rc;
++      return (rc == -EINTR)? -ERESTARTSYS : rc;
+ }
+ static struct ibm_struct brightness_driver_data = {
diff --git a/queue-2.6.27/usb-ohci-quirk-amd-prefetch-for-usb-1.1-iso-transfer.patch b/queue-2.6.27/usb-ohci-quirk-amd-prefetch-for-usb-1.1-iso-transfer.patch
new file mode 100644 (file)
index 0000000..1cb07bb
--- /dev/null
@@ -0,0 +1,149 @@
+From a1f17a872bc7b1cb7efdd5486a2963e88a536e61 Mon Sep 17 00:00:00 2001
+From: Libin Yang <libin.yang@amd.com>
+Date: Wed, 4 Nov 2009 14:55:18 +0800
+Subject: USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer
+
+From: Libin Yang <libin.yang@amd.com>
+
+commit a1f17a872bc7b1cb7efdd5486a2963e88a536e61 upstream.
+
+The following patch in the driver is required to avoid USB 1.1 device
+failures that may occur due to requests from USB OHCI controllers may
+be overwritten if the latency for any pending request by the USB
+controller is very long (in the range of milliseconds).
+
+Signed-off-by: Libin Yang <libin.yang@amd.com>
+Cc: David Brownell <dbrownell@users.sourceforge.net>
+Cc: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/usb/host/ohci-hcd.c |    5 +++++
+ drivers/usb/host/ohci-pci.c |   20 ++++++++++++++++++++
+ drivers/usb/host/ohci-q.c   |   18 ++++++++++++------
+ drivers/usb/host/ohci.h     |    9 +++++++++
+ 4 files changed, 46 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/host/ohci-hcd.c
++++ b/drivers/usb/host/ohci-hcd.c
+@@ -89,6 +89,7 @@ static int ohci_restart (struct ohci_hcd
+ #ifdef CONFIG_PCI
+ static void quirk_amd_pll(int state);
+ static void amd_iso_dev_put(void);
++static void sb800_prefetch(struct ohci_hcd *ohci, int on);
+ #else
+ static inline void quirk_amd_pll(int state)
+ {
+@@ -98,6 +99,10 @@ static inline void amd_iso_dev_put(void)
+ {
+       return;
+ }
++static inline void sb800_prefetch(struct ohci_hcd *ohci, int on)
++{
++      return;
++}
+ #endif
+--- a/drivers/usb/host/ohci-pci.c
++++ b/drivers/usb/host/ohci-pci.c
+@@ -177,6 +177,13 @@ static int ohci_quirk_amd700(struct usb_
+               return 0;
+       pci_read_config_byte(amd_smbus_dev, PCI_REVISION_ID, &rev);
++
++      /* SB800 needs pre-fetch fix */
++      if ((rev >= 0x40) && (rev <= 0x4f)) {
++              ohci->flags |= OHCI_QUIRK_AMD_PREFETCH;
++              ohci_dbg(ohci, "enabled AMD prefetch quirk\n");
++      }
++
+       if ((rev > 0x3b) || (rev < 0x30)) {
+               pci_dev_put(amd_smbus_dev);
+               amd_smbus_dev = NULL;
+@@ -262,6 +269,19 @@ static void amd_iso_dev_put(void)
+ }
++static void sb800_prefetch(struct ohci_hcd *ohci, int on)
++{
++      struct pci_dev *pdev;
++      u16 misc;
++
++      pdev = to_pci_dev(ohci_to_hcd(ohci)->self.controller);
++      pci_read_config_word(pdev, 0x50, &misc);
++      if (on == 0)
++              pci_write_config_word(pdev, 0x50, misc & 0xfcff);
++      else
++              pci_write_config_word(pdev, 0x50, misc | 0x0300);
++}
++
+ /* List of quirks for OHCI */
+ static const struct pci_device_id ohci_pci_quirks[] = {
+       {
+--- a/drivers/usb/host/ohci-q.c
++++ b/drivers/usb/host/ohci-q.c
+@@ -49,9 +49,12 @@ __acquires(ohci->lock)
+       switch (usb_pipetype (urb->pipe)) {
+       case PIPE_ISOCHRONOUS:
+               ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--;
+-              if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0
+-                              && quirk_amdiso(ohci))
+-                      quirk_amd_pll(1);
++              if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) {
++                      if (quirk_amdiso(ohci))
++                              quirk_amd_pll(1);
++                      if (quirk_amdprefetch(ohci))
++                              sb800_prefetch(ohci, 0);
++              }
+               break;
+       case PIPE_INTERRUPT:
+               ohci_to_hcd(ohci)->self.bandwidth_int_reqs--;
+@@ -680,9 +683,12 @@ static void td_submit_urb (
+                               data + urb->iso_frame_desc [cnt].offset,
+                               urb->iso_frame_desc [cnt].length, urb, cnt);
+               }
+-              if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0
+-                              && quirk_amdiso(ohci))
+-                      quirk_amd_pll(0);
++              if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) {
++                      if (quirk_amdiso(ohci))
++                              quirk_amd_pll(0);
++                      if (quirk_amdprefetch(ohci))
++                              sb800_prefetch(ohci, 1);
++              }
+               periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0
+                       && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0;
+               break;
+--- a/drivers/usb/host/ohci.h
++++ b/drivers/usb/host/ohci.h
+@@ -402,6 +402,7 @@ struct ohci_hcd {
+ #define       OHCI_QUIRK_FRAME_NO     0x80                    /* no big endian frame_no shift */
+ #define       OHCI_QUIRK_HUB_POWER    0x100                   /* distrust firmware power/oc setup */
+ #define       OHCI_QUIRK_AMD_ISO      0x200                   /* ISO transfers*/
++#define       OHCI_QUIRK_AMD_PREFETCH 0x400                   /* pre-fetch for ISO transfer */
+       // there are also chip quirks/bugs in init logic
+       struct work_struct      nec_work;       /* Worker for NEC quirk */
+@@ -433,6 +434,10 @@ static inline int quirk_amdiso(struct oh
+ {
+       return ohci->flags & OHCI_QUIRK_AMD_ISO;
+ }
++static inline int quirk_amdprefetch(struct ohci_hcd *ohci)
++{
++      return ohci->flags & OHCI_QUIRK_AMD_PREFETCH;
++}
+ #else
+ static inline int quirk_nec(struct ohci_hcd *ohci)
+ {
+@@ -446,6 +451,10 @@ static inline int quirk_amdiso(struct oh
+ {
+       return 0;
+ }
++static inline int quirk_amdprefetch(struct ohci_hcd *ohci)
++{
++      return 0;
++}
+ #endif
+ /* convert between an hcd pointer and the corresponding ohci_hcd */