From: Greg Kroah-Hartman Date: Wed, 16 Dec 2009 00:54:47 +0000 (-0800) Subject: more .31 patches X-Git-Tag: v2.6.27.42~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c1f276abffa5902a494d9dbd6b482dbab585b08;p=thirdparty%2Fkernel%2Fstable-queue.git more .31 patches --- diff --git a/queue-2.6.31/drm-radeon-kms-add-quirk-for-his-x1300-board.patch b/queue-2.6.31/drm-radeon-kms-add-quirk-for-his-x1300-board.patch new file mode 100644 index 00000000000..0ca7602ff6b --- /dev/null +++ b/queue-2.6.31/drm-radeon-kms-add-quirk-for-his-x1300-board.patch @@ -0,0 +1,36 @@ +From 4e3f9b78ff917cc5c833858fdb5d96bc262e0bf3 Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Tue, 1 Dec 2009 14:49:50 -0500 +Subject: drm/radeon/kms: Add quirk for HIS X1300 board + +From: Alex Deucher + +commit 4e3f9b78ff917cc5c833858fdb5d96bc262e0bf3 upstream. + +Board is DVI+VGA, not DVI+DVI + +Signed-off-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_atombios.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +--- a/drivers/gpu/drm/radeon/radeon_atombios.c ++++ b/drivers/gpu/drm/radeon/radeon_atombios.c +@@ -134,6 +134,14 @@ static bool radeon_atom_apply_quirks(str + } + } + ++ /* HIS X1300 is DVI+VGA, not DVI+DVI */ ++ if ((dev->pdev->device == 0x7146) && ++ (dev->pdev->subsystem_vendor == 0x17af) && ++ (dev->pdev->subsystem_device == 0x2058)) { ++ if (supported_device == ATOM_DEVICE_DFP1_SUPPORT) ++ return false; ++ } ++ + /* Funky macbooks */ + if ((dev->pdev->device == 0x71C5) && + (dev->pdev->subsystem_vendor == 0x106b) && diff --git a/queue-2.6.31/drm-radeon-kms-fix-legacy-crtc2-dpms.patch b/queue-2.6.31/drm-radeon-kms-fix-legacy-crtc2-dpms.patch new file mode 100644 index 00000000000..6a06bcb4f43 --- /dev/null +++ b/queue-2.6.31/drm-radeon-kms-fix-legacy-crtc2-dpms.patch @@ -0,0 +1,49 @@ +From 8de21525439e6b5bb8d8c81e49094d867bf82f6d Mon Sep 17 00:00:00 2001 +From: Alex Deucher +Date: Thu, 3 Dec 2009 12:15:54 -0500 +Subject: drm/radeon/kms: fix legacy crtc2 dpms + +From: Alex Deucher + +commit 8de21525439e6b5bb8d8c81e49094d867bf82f6d upstream. + +noticed by Matthijs Kooijman on fdo bug 22140 + +Signed-off-by: Alex Deucher +Signed-off-by: Dave Airlie +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/radeon/radeon_legacy_crtc.c | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +--- a/drivers/gpu/drm/radeon/radeon_legacy_crtc.c ++++ b/drivers/gpu/drm/radeon/radeon_legacy_crtc.c +@@ -291,8 +291,7 @@ void radeon_crtc_dpms(struct drm_crtc *c + uint32_t mask; + + if (radeon_crtc->crtc_id) +- mask = (RADEON_CRTC2_EN | +- RADEON_CRTC2_DISP_DIS | ++ mask = (RADEON_CRTC2_DISP_DIS | + RADEON_CRTC2_VSYNC_DIS | + RADEON_CRTC2_HSYNC_DIS | + RADEON_CRTC2_DISP_REQ_EN_B); +@@ -304,7 +303,7 @@ void radeon_crtc_dpms(struct drm_crtc *c + switch (mode) { + case DRM_MODE_DPMS_ON: + if (radeon_crtc->crtc_id) +- WREG32_P(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_EN, ~mask); ++ WREG32_P(RADEON_CRTC2_GEN_CNTL, RADEON_CRTC2_EN, ~(RADEON_CRTC2_EN | mask)); + else { + WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_EN, ~(RADEON_CRTC_EN | + RADEON_CRTC_DISP_REQ_EN_B)); +@@ -318,7 +317,7 @@ void radeon_crtc_dpms(struct drm_crtc *c + case DRM_MODE_DPMS_OFF: + drm_vblank_pre_modeset(dev, radeon_crtc->crtc_id); + if (radeon_crtc->crtc_id) +- WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~mask); ++ WREG32_P(RADEON_CRTC2_GEN_CNTL, mask, ~(RADEON_CRTC2_EN | mask)); + else { + WREG32_P(RADEON_CRTC_GEN_CNTL, RADEON_CRTC_DISP_REQ_EN_B, ~(RADEON_CRTC_EN | + RADEON_CRTC_DISP_REQ_EN_B)); diff --git a/queue-2.6.31/mac80211-fix-bug-in-computing-crc-over-dynamic-ies-in-beacon.patch b/queue-2.6.31/mac80211-fix-bug-in-computing-crc-over-dynamic-ies-in-beacon.patch new file mode 100644 index 00000000000..92e8ccf1e8b --- /dev/null +++ b/queue-2.6.31/mac80211-fix-bug-in-computing-crc-over-dynamic-ies-in-beacon.patch @@ -0,0 +1,37 @@ +From 1814077fd12a9cdf478c10076e9c42094e9d9250 Mon Sep 17 00:00:00 2001 +From: Vasanthakumar Thiagarajan +Date: Fri, 4 Dec 2009 17:41:34 +0530 +Subject: mac80211: Fix bug in computing crc over dynamic IEs in beacon + +From: Vasanthakumar Thiagarajan + +commit 1814077fd12a9cdf478c10076e9c42094e9d9250 upstream. + +On a 32-bit machine, BIT() macro does not give the required +bit value if the bit is mroe than 31. In ieee802_11_parse_elems_crc(), +BIT() is suppossed to get the bit value more than 31 (42 (id of ERP_INFO_IE), +37 (CHANNEL_SWITCH_IE), (42), 32 (POWER_CONSTRAINT_IE), 45 (HT_CAP_IE), +61 (HT_INFO_IE)). As we do not get the required bit value for the above +IEs, crc over these IEs are never calculated, so any dynamic change in these +IEs after the association is not really handled on 32-bit platforms. +This patch fixes this issue. + +Signed-off-by: Vasanthakumar Thiagarajan +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/util.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/util.c ++++ b/net/mac80211/util.c +@@ -537,7 +537,7 @@ u32 ieee802_11_parse_elems_crc(u8 *start + if (elen > left) + break; + +- if (calc_crc && id < 64 && (filter & BIT(id))) ++ if (calc_crc && id < 64 && (filter & (1ULL << id))) + crc = crc32_be(crc, pos - 2, elen + 2); + + switch (id) { diff --git a/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-mincore.patch b/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-mincore.patch new file mode 100644 index 00000000000..bd46246bff8 --- /dev/null +++ b/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-mincore.patch @@ -0,0 +1,152 @@ +From 4f16fc107d9c9b8a72aa19b189a9216e90a7aaef Mon Sep 17 00:00:00 2001 +From: Naoya Horiguchi +Date: Mon, 14 Dec 2009 17:59:58 -0800 +Subject: mm: hugetlb: fix hugepage memory leak in mincore() + +From: Naoya Horiguchi + +commit 4f16fc107d9c9b8a72aa19b189a9216e90a7aaef upstream. + +Most callers of pmd_none_or_clear_bad() check whether the target page is +in a hugepage or not, but mincore() and walk_page_range() do not check it. + So if we use mincore() on a hugepage on x86 machine, the hugepage memory +is leaked as shown below. This patch fixes it by extending mincore() +system call to support hugepages. + +Details +======= +My test program (leak_mincore) works as follows: + - creat() and mmap() a file on hugetlbfs (file size is 200MB == 100 hugepages,) + - read()/write() something on it, + - call mincore() for first ten pages and printf() the values of *vec + - munmap() and unlink() the file on hugetlbfs + +Without my patch +---------------- +$ cat /proc/meminfo| grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ./leak_mincore +vec[0] 0 +vec[1] 0 +vec[2] 0 +vec[3] 0 +vec[4] 0 +vec[5] 0 +vec[6] 0 +vec[7] 0 +vec[8] 0 +vec[9] 0 +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 999 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ls /hugetlbfs/ +$ + +Return values in *vec from mincore() are set to 0, while the hugepage +should be in memory, and 1 hugepage is still accounted as used while +there is no file on hugetlbfs. + +With my patch +------------- +$ cat /proc/meminfo| grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ./leak_mincore +vec[0] 1 +vec[1] 1 +vec[2] 1 +vec[3] 1 +vec[4] 1 +vec[5] 1 +vec[6] 1 +vec[7] 1 +vec[8] 1 +vec[9] 1 +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ls /hugetlbfs/ +$ + +Return value in *vec set to 1 and no memory leaks. + +[akpm@linux-foundation.org: cleanup] +[akpm@linux-foundation.org: build fix] +Signed-off-by: Naoya Horiguchi +Cc: Andi Kleen +Cc: Wu Fengguang +Cc: Hugh Dickins +Cc: Mel Gorman +Cc: Lee Schermerhorn +Cc: Andy Whitcroft +Cc: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/mincore.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 37 insertions(+) + +--- a/mm/mincore.c ++++ b/mm/mincore.c +@@ -14,6 +14,7 @@ + #include + #include + #include ++#include + + #include + #include +@@ -72,6 +73,42 @@ static long do_mincore(unsigned long add + if (!vma || addr < vma->vm_start) + return -ENOMEM; + ++#ifdef CONFIG_HUGETLB_PAGE ++ if (is_vm_hugetlb_page(vma)) { ++ struct hstate *h; ++ unsigned long nr_huge; ++ unsigned char present; ++ ++ i = 0; ++ nr = min(pages, (vma->vm_end - addr) >> PAGE_SHIFT); ++ h = hstate_vma(vma); ++ nr_huge = ((addr + pages * PAGE_SIZE - 1) >> huge_page_shift(h)) ++ - (addr >> huge_page_shift(h)) + 1; ++ nr_huge = min(nr_huge, ++ (vma->vm_end - addr) >> huge_page_shift(h)); ++ while (1) { ++ /* hugepage always in RAM for now, ++ * but generally it needs to be check */ ++ ptep = huge_pte_offset(current->mm, ++ addr & huge_page_mask(h)); ++ present = !!(ptep && ++ !huge_pte_none(huge_ptep_get(ptep))); ++ while (1) { ++ vec[i++] = present; ++ addr += PAGE_SIZE; ++ /* reach buffer limit */ ++ if (i == nr) ++ return nr; ++ /* check hugepage border */ ++ if (!((addr & ~huge_page_mask(h)) ++ >> PAGE_SHIFT)) ++ break; ++ } ++ } ++ return nr; ++ } ++#endif ++ + /* + * Calculate how many pages there are left in the last level of the + * PTE array for our address. diff --git a/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-walk_page_range.patch b/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-walk_page_range.patch new file mode 100644 index 00000000000..e457391de47 --- /dev/null +++ b/queue-2.6.31/mm-hugetlb-fix-hugepage-memory-leak-in-walk_page_range.patch @@ -0,0 +1,127 @@ +From d33b9f45bd24a6391bc05e2b5a13c1b5787ca9c2 Mon Sep 17 00:00:00 2001 +From: Naoya Horiguchi +Date: Mon, 14 Dec 2009 17:59:59 -0800 +Subject: mm: hugetlb: fix hugepage memory leak in walk_page_range() + +From: Naoya Horiguchi + +commit d33b9f45bd24a6391bc05e2b5a13c1b5787ca9c2 upstream. + +Most callers of pmd_none_or_clear_bad() check whether the target page is +in a hugepage or not, but walk_page_range() do not check it. So if we +read /proc/pid/pagemap for the hugepage on x86 machine, the hugepage +memory is leaked as shown below. This patch fixes it. + +Details +======= +My test program (leak_pagemap) works as follows: + - creat() and mmap() a file on hugetlbfs (file size is 200MB == 100 hugepages,) + - read()/write() something on it, + - call page-types with option -p (walk around the page tables), + - munmap() and unlink() the file on hugetlbfs + +Without my patches +------------------ +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ./leak_pagemap +[snip output] +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 900 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ls /hugetlbfs/ +$ + +100 hugepages are accounted as used while there is no file on hugetlbfs. + +With my patches +--------------- +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ./leak_pagemap +[snip output] +$ cat /proc/meminfo |grep "HugePage" +HugePages_Total: 1000 +HugePages_Free: 1000 +HugePages_Rsvd: 0 +HugePages_Surp: 0 +$ ls /hugetlbfs +$ + +No memory leaks. + +Signed-off-by: Naoya Horiguchi +Cc: Andi Kleen +Cc: Wu Fengguang +Cc: Hugh Dickins +Cc: Mel Gorman +Cc: Lee Schermerhorn +Cc: Andy Whitcroft +Cc: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + mm/pagewalk.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +--- a/mm/pagewalk.c ++++ b/mm/pagewalk.c +@@ -1,6 +1,7 @@ + #include + #include + #include ++#include + + static int walk_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, + struct mm_walk *walk) +@@ -107,6 +108,7 @@ int walk_page_range(unsigned long addr, + pgd_t *pgd; + unsigned long next; + int err = 0; ++ struct vm_area_struct *vma; + + if (addr >= end) + return err; +@@ -117,11 +119,22 @@ int walk_page_range(unsigned long addr, + pgd = pgd_offset(walk->mm, addr); + do { + next = pgd_addr_end(addr, end); ++ ++ /* skip hugetlb vma to avoid hugepage PMD being cleared ++ * in pmd_none_or_clear_bad(). */ ++ vma = find_vma(walk->mm, addr); ++ if (vma && is_vm_hugetlb_page(vma)) { ++ if (vma->vm_end < next) ++ next = vma->vm_end; ++ continue; ++ } ++ + if (pgd_none_or_clear_bad(pgd)) { + if (walk->pte_hole) + err = walk->pte_hole(addr, next, walk); + if (err) + break; ++ pgd++; + continue; + } + if (walk->pgd_entry) +@@ -131,7 +144,8 @@ int walk_page_range(unsigned long addr, + err = walk_pud_range(pgd, addr, next, walk); + if (err) + break; +- } while (pgd++, addr = next, addr != end); ++ pgd++; ++ } while (addr = next, addr != end); + + return err; + } diff --git a/queue-2.6.31/powerpc-fix-usage-of-64-bit-instruction-in-32-bit-altivec-code.patch b/queue-2.6.31/powerpc-fix-usage-of-64-bit-instruction-in-32-bit-altivec-code.patch new file mode 100644 index 00000000000..bac5eff6802 --- /dev/null +++ b/queue-2.6.31/powerpc-fix-usage-of-64-bit-instruction-in-32-bit-altivec-code.patch @@ -0,0 +1,34 @@ +From e090aa80321b64c3b793f3b047e31ecf1af9538d Mon Sep 17 00:00:00 2001 +From: Benjamin Herrenschmidt +Date: Tue, 8 Dec 2009 18:45:45 +0000 +Subject: powerpc: Fix usage of 64-bit instruction in 32-bit altivec code + +From: Benjamin Herrenschmidt + +commit e090aa80321b64c3b793f3b047e31ecf1af9538d upstream. + +e821ea70f3b4873b50056a1e0f74befed1014c09 introduced a bug by copying +some 64-bit originated code as-is to be used by both 32 and 64-bit +but this code contains a 64-bit ony "cmpdi" instruction. + +This changes it to cmpwi, which is fine since VRSAVE can only contains +a 32-bit value anyway. + +Signed-off-by: Benjamin Herrenschmidt +Signed-off-by: Greg Kroah-Hartman + +--- + arch/powerpc/kernel/vector.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/arch/powerpc/kernel/vector.S ++++ b/arch/powerpc/kernel/vector.S +@@ -58,7 +58,7 @@ _GLOBAL(load_up_altivec) + * all 1's + */ + mfspr r4,SPRN_VRSAVE +- cmpdi 0,r4,0 ++ cmpwi 0,r4,0 + bne+ 1f + li r4,-1 + mtspr SPRN_VRSAVE,r4 diff --git a/queue-2.6.31/serial-do-not-read-iir-in-serial8250_start_tx-when-uart_bug_txen.patch b/queue-2.6.31/serial-do-not-read-iir-in-serial8250_start_tx-when-uart_bug_txen.patch new file mode 100644 index 00000000000..8f0c421b566 --- /dev/null +++ b/queue-2.6.31/serial-do-not-read-iir-in-serial8250_start_tx-when-uart_bug_txen.patch @@ -0,0 +1,45 @@ +From 68cb4f8e246bbbc649980be0628cae9265870a91 Mon Sep 17 00:00:00 2001 +From: Ian Jackson +Date: Wed, 18 Nov 2009 11:08:11 +0100 +Subject: Serial: Do not read IIR in serial8250_start_tx when UART_BUG_TXEN + +From: Ian Jackson + +commit 68cb4f8e246bbbc649980be0628cae9265870a91 upstream. + +Do not read IIR in serial8250_start_tx when UART_BUG_TXEN + +Reading the IIR clears some oustanding interrupts so it is not safe. +Instead, simply transmit immediately if the buffer is empty without +regard to IIR. + +Signed-off-by: Ian Jackson +Reviewed-by: Markus Armbruster +Reviewed-by: Jiri Kosina +Cc: Alan Cox +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/serial/8250.c | 8 +++----- + 1 file changed, 3 insertions(+), 5 deletions(-) + +--- a/drivers/serial/8250.c ++++ b/drivers/serial/8250.c +@@ -1337,14 +1337,12 @@ static void serial8250_start_tx(struct u + serial_out(up, UART_IER, up->ier); + + if (up->bugs & UART_BUG_TXEN) { +- unsigned char lsr, iir; ++ unsigned char lsr; + lsr = serial_in(up, UART_LSR); + up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS; +- iir = serial_in(up, UART_IIR) & 0x0f; + if ((up->port.type == PORT_RM9000) ? +- (lsr & UART_LSR_THRE && +- (iir == UART_IIR_NO_INT || iir == UART_IIR_THRI)) : +- (lsr & UART_LSR_TEMT && iir & UART_IIR_NO_INT)) ++ (lsr & UART_LSR_THRE) : ++ (lsr & UART_LSR_TEMT)) + transmit_chars(up); + } + } diff --git a/queue-2.6.31/series b/queue-2.6.31/series index f5523aea37c..6f2b71b3413 100644 --- a/queue-2.6.31/series +++ b/queue-2.6.31/series @@ -33,3 +33,10 @@ x86-calgary-iommu-quirk-find-nearest-matching-calgary-while-walking-up-the-pci-t x86-fix-iommu-nodac-parameter-handling.patch x86-fix-typo-in-intel-cpu-cache-size-descriptor.patch x86-gart-pci-gart_64.c-use-correct-length-in-strncmp.patch +drm-radeon-kms-add-quirk-for-his-x1300-board.patch +drm-radeon-kms-fix-legacy-crtc2-dpms.patch +mac80211-fix-bug-in-computing-crc-over-dynamic-ies-in-beacon.patch +mm-hugetlb-fix-hugepage-memory-leak-in-mincore.patch +mm-hugetlb-fix-hugepage-memory-leak-in-walk_page_range.patch +powerpc-fix-usage-of-64-bit-instruction-in-32-bit-altivec-code.patch +serial-do-not-read-iir-in-serial8250_start_tx-when-uart_bug_txen.patch