From: Greg Kroah-Hartman Date: Sat, 5 Dec 2009 23:05:17 +0000 (-0800) Subject: some .27 patches X-Git-Tag: v2.6.31.7~7 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1affed5d4fb4daeda6df7d9656f17072e708d76b;p=thirdparty%2Fkernel%2Fstable-queue.git some .27 patches --- 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 index 00000000000..459daa90a9f --- /dev/null +++ b/queue-2.6.27/enable-acpi-pdc-handshake-for-via-centaur-cpus.patch @@ -0,0 +1,44 @@ +From d77b81974521c82fa6fda38dfff1b491dcc62a32 Mon Sep 17 00:00:00 2001 +From: Harald Welte +Date: Tue, 24 Nov 2009 16:53:00 +0100 +Subject: [CPUFREQ] Enable ACPI PDC handshake for VIA/Centaur CPUs + +From: Harald Welte + +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 +Signed-off-by: Dave Jones +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..ab63366f868 --- /dev/null +++ b/queue-2.6.27/fuse-prevent-fuse_put_request-on-invalid-pointer.patch @@ -0,0 +1,33 @@ +From f60311d5f7670d9539b424e4ed8b5c0872fc9e83 Mon Sep 17 00:00:00 2001 +From: Anand V. Avati +Date: Thu, 22 Oct 2009 06:24:52 -0700 +Subject: fuse: prevent fuse_put_request on invalid pointer + +From: Anand V. Avati + +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 +Signed-off-by: Miklos Szeredi +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..bae5056c889 --- /dev/null +++ b/queue-2.6.27/fuse-reject-o_direct-flag-also-in-fuse_create.patch @@ -0,0 +1,43 @@ +From 1b7323965a8c6eee9dc4e345a7ae4bff1dc93149 Mon Sep 17 00:00:00 2001 +From: Csaba Henk +Date: Fri, 27 Nov 2009 19:30:14 +0530 +Subject: fuse: reject O_DIRECT flag also in fuse_create + +From: Csaba Henk + +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 +Signed-off-by: Miklos Szeredi +Cc: Harshavardhana +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..d34b73afdb3 --- /dev/null +++ b/queue-2.6.27/isdn-hfc_usb-fix-read-buffer-overflow.patch @@ -0,0 +1,34 @@ +From 286e633ef0ff5bb63c07b4516665da8004966fec Mon Sep 17 00:00:00 2001 +From: Roel Kluin +Date: Wed, 4 Nov 2009 08:31:59 -0800 +Subject: isdn: hfc_usb: Fix read buffer overflow + +From: Roel Kluin + +commit 286e633ef0ff5bb63c07b4516665da8004966fec upstream. + +Check whether index is within bounds before testing the element. + +Signed-off-by: Roel Kluin +Cc: Karsten Keil +Signed-off-by: Andrew Morton +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + 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, diff --git a/queue-2.6.27/series b/queue-2.6.27/series index 2bd673df5c8..afeaa0b3701 100644 --- a/queue-2.6.27/series +++ b/queue-2.6.27/series @@ -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 index 00000000000..9e442ceeea5 --- /dev/null +++ b/queue-2.6.27/thinkpad-acpi-fix-sign-of-erestartsys-return.patch @@ -0,0 +1,32 @@ +From 80a8d1228e90349b4514e8c925c061fa5cbcea75 Mon Sep 17 00:00:00 2001 +From: Roel Kluin +Date: Fri, 20 Nov 2009 19:48:23 +0100 +Subject: thinkpad-acpi: fix sign of ERESTARTSYS return + +From: Roel Kluin + +commit 80a8d1228e90349b4514e8c925c061fa5cbcea75 upstream. + +The returned error should be negative + +Signed-off-by: Roel Kluin +Acked-by: Henrique de Moraes Holschuh +Signed-off-by: Andrew Morton +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + 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 index 00000000000..1cb07bbea2f --- /dev/null +++ b/queue-2.6.27/usb-ohci-quirk-amd-prefetch-for-usb-1.1-iso-transfer.patch @@ -0,0 +1,149 @@ +From a1f17a872bc7b1cb7efdd5486a2963e88a536e61 Mon Sep 17 00:00:00 2001 +From: Libin Yang +Date: Wed, 4 Nov 2009 14:55:18 +0800 +Subject: USB: ohci: quirk AMD prefetch for USB 1.1 ISO transfer + +From: Libin Yang + +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 +Cc: David Brownell +Cc: Alan Stern +Signed-off-by: Greg Kroah-Hartman + +--- + 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 */