From 415f8b2c33cc3a7d2856fa0c6063f30fcbdad442 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 17 Apr 2012 14:47:44 +0200 Subject: linux-ti33x-psp 3.2: rebase onto latest PSP This fixes most PM operations: cpufreq, cpuidle and suspend. Resume does not work on beaglebone, but 3 out of 4 ain't bad :) The M3 firmware needed for suspend/resume is used as a binary, building it from source and including it from sysroots is planned for future commits. Beaglebone patches have been forward ported and runtime tested. Signed-off-by: Koen Kooi Signed-off-by: Denys Dmytriyenko --- conf/machine/include/ti33x.inc | 2 +- ...AP-correct-SYSC-register-offset-for-OMAP4.patch | 34 -- ...-new-UV2-hardware-by-using-native-UV2-bro.patch | 350 +++++++++++++ ...ix-BAU-destination-timeout-initialization.patch | 66 +++ ...-new-UV2-hardware-by-using-native-UV2-bro.patch | 350 ------------- ...ix-BAU-destination-timeout-initialization.patch | 66 --- .../3.2.2/0115-x86-UV2-Work-around-BAU-bug.patch | 570 +++++++++++++++++++++ ...fix-interpretation-of-the-rx-KeyMiss-flag.patch | 61 +++ .../3.2.2/0116-x86-UV2-Work-around-BAU-bug.patch | 570 --------------------- ...fix-interpretation-of-the-rx-KeyMiss-flag.patch | 61 --- ...800pci-fix-spurious-interrupts-generation.patch | 86 ++++ ...800pci-fix-spurious-interrupts-generation.patch | 86 ---- ...x-endian-conversion-issue-in-discard-code.patch | 45 ++ ...20t-modified-the-setting-of-transfer-rate.patch | 33 ++ ...x-endian-conversion-issue-in-discard-code.patch | 45 -- ...20t-modified-the-setting-of-transfer-rate.patch | 33 -- ...e-fix-off-by-one-index-into-syscall-table.patch | 46 ++ ...default-wsize-when-unix-extensions-are-no.patch | 67 +++ ...e-fix-off-by-one-index-into-syscall-table.patch | 46 -- ...default-wsize-when-unix-extensions-are-no.patch | 67 --- ...2-kprobes-initialize-before-using-a-hlist.patch | 49 ++ ...3-kprobes-initialize-before-using-a-hlist.patch | 49 -- ...oc-clear_refs-do-not-clear-reserved-pages.patch | 64 +++ ...-ptr-dereference-in-__count_immobile_page.patch | 91 ++++ ...oc-clear_refs-do-not-clear-reserved-pages.patch | 64 --- .../3.2.2/0125-iwlagn-check-for-SMPS-mode.patch | 50 ++ ...-ptr-dereference-in-__count_immobile_page.patch | 91 ---- .../3.2.2/0126-iwlagn-check-for-SMPS-mode.patch | 50 -- ...945-fix-hw-passive-scan-on-radar-channels.patch | 60 +++ ...SHM_UNLOCK-fix-long-unpreemptible-section.patch | 186 +++++++ ...945-fix-hw-passive-scan-on-radar-channels.patch | 60 --- ...fix-Unevictable-pages-stranded-after-swap.patch | 342 +++++++++++++ ...SHM_UNLOCK-fix-long-unpreemptible-section.patch | 186 ------- .../3.2.2/0129-Linux-3.2.2.patch | 24 + ...fix-Unevictable-pages-stranded-after-swap.patch | 342 ------------- .../3.2.2/0130-Linux-3.2.2.patch | 24 - .../linux-ti33x-psp-3.2/am335x-pm-firmware.bin | Bin 0 -> 10732 bytes ...1-f_rndis-HACK-around-undefined-variables.patch | 6 +- ...2-da8xx-fb-add-DVI-support-for-beaglebone.patch | 10 +- ...rebase-everything-onto-3.2-WARNING-MEGAPA.patch | 63 ++- .../beaglebone/0004-more-beaglebone-merges.patch | 48 +- .../beaglebone/0005-beaglebone-disable-tsadc.patch | 12 +- ...general-purpose-mode-untested-with-touchs.patch | 67 ++- ...dc-Add-board-file-mfd-support-fix-warning.patch | 14 +- ...AM335X-init-tsc-bone-style-for-new-boards.patch | 10 +- ...cadc-make-stepconfig-channel-configurable.patch | 14 +- .../0010-tscadc-Trigger-through-sysfs.patch | 28 +- ...meta-ti-Remove-debug-messages-for-meta-ti.patch | 10 +- ...c-switch-to-polling-instead-of-interrupts.patch | 14 +- .../beaglebone/0013-beaglebone-fix-ADC-init.patch | 16 +- .../beaglebone/0014-AM335x-MUX-add-ehrpwm1A.patch | 8 +- ...enable-PWM-for-lcd-backlight-backlight-is.patch | 80 +-- ...Set-dto-to-max-value-of-14-to-avoid-SD-Ca.patch | 14 +- ...set-default-brightness-to-50-for-pwm-back.patch | 12 +- ...P-framebuffer-driver-supporting-Adafruit-.patch | 6 +- ...019-beaglebone-use-P8_6-gpio1_3-as-w1-bus.patch | 20 +- ...add-support-for-Towertech-TT3201-CAN-cape.patch | 20 +- ...am33xx-fix-serial-mux-warnings-for-am33xx.patch | 40 -- ...add-more-beagleboardtoys-cape-partnumbers.patch | 53 ++ ...MAP2-am335x-correct-McASP0-pin-mux-detail.patch | 29 -- ...add-gpio-keys-for-lcd7-add-notes-for-miss.patch | 130 +++++ ...23-beaglebone-add-enter-key-for-lcd7-cape.patch | 40 ++ ...add-more-beagleboardtoys-cape-partnumbers.patch | 53 -- .../0024-beaglebone-add-gpio-keys-for-lcd.patch | 113 ++++ ...add-gpio-keys-for-lcd7-add-notes-for-miss.patch | 129 ----- ...25-beaglebone-add-enter-key-for-lcd7-cape.patch | 40 -- ...025-beaglebone-fix-direction-of-gpio-keys.patch | 107 ++++ .../0026-beaglebone-add-gpio-keys-for-lcd.patch | 113 ---- .../0026-beaglebone-fix-3.5-lcd-cape-support.patch | 109 ++++ ...027-beaglebone-fix-direction-of-gpio-keys.patch | 107 ---- .../0028-beaglebone-fix-3.5-lcd-cape-support.patch | 109 ---- .../linux/linux-ti33x-psp-3.2/beaglebone/defconfig | 30 +- recipes-kernel/linux/linux-ti33x-psp-3.2/patch.sh | 7 +- recipes-kernel/linux/linux-ti33x-psp_3.2.bb | 56 +- 74 files changed, 2999 insertions(+), 3154 deletions(-) delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-I2C-OMAP-correct-SYSC-register-offset-for-OMAP4.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-BAU-destination-timeout-initialization.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Fix-BAU-destination-timeout-initialization.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Work-around-BAU-bug.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-x86-UV2-Work-around-BAU-bug.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-rt2800pci-fix-spurious-interrupts-generation.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-rt2800pci-fix-spurious-interrupts-generation.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-xfs-fix-endian-conversion-issue-in-discard-code.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-i2c-eg20t-modified-the-setting-of-transfer-rate.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-xfs-fix-endian-conversion-issue-in-discard-code.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-i2c-eg20t-modified-the-setting-of-transfer-rate.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-score-fix-off-by-one-index-into-syscall-table.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-cifs-lower-default-wsize-when-unix-extensions-are-no.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-score-fix-off-by-one-index-into-syscall-table.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-kprobes-initialize-before-using-a-hlist.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-proc-clear_refs-do-not-clear-reserved-pages.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-iwlagn-check-for-SMPS-mode.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlagn-check-for-SMPS-mode.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-SHM_UNLOCK-fix-long-unpreemptible-section.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-long-unpreemptible-section.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-Linux-3.2.2.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0130-Linux-3.2.2.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/am335x-pm-firmware.bin delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0021-ARM-OMAP2-am33xx-fix-serial-mux-warnings-for-am33xx.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0021-beaglebone-add-more-beagleboardtoys-cape-partnumbers.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0022-ARM-OMAP2-am335x-correct-McASP0-pin-mux-detail.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0022-beaglebone-add-gpio-keys-for-lcd7-add-notes-for-miss.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0023-beaglebone-add-enter-key-for-lcd7-cape.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0023-beaglebone-add-more-beagleboardtoys-cape-partnumbers.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0024-beaglebone-add-gpio-keys-for-lcd.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0024-beaglebone-add-gpio-keys-for-lcd7-add-notes-for-miss.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0025-beaglebone-add-enter-key-for-lcd7-cape.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0025-beaglebone-fix-direction-of-gpio-keys.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0026-beaglebone-add-gpio-keys-for-lcd.patch create mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0026-beaglebone-fix-3.5-lcd-cape-support.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0027-beaglebone-fix-direction-of-gpio-keys.patch delete mode 100644 recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0028-beaglebone-fix-3.5-lcd-cape-support.patch diff --git a/conf/machine/include/ti33x.inc b/conf/machine/include/ti33x.inc index 1ede65c2..c5926a80 100644 --- a/conf/machine/include/ti33x.inc +++ b/conf/machine/include/ti33x.inc @@ -4,7 +4,7 @@ require conf/machine/include/soc-family.inc require conf/machine/include/tune-cortexa8.inc PREFERRED_PROVIDER_virtual/kernel = "linux-ti33x-psp" # Increase this everytime you change something in the kernel -MACHINE_KERNEL_PR = "r9" +MACHINE_KERNEL_PR = "r10" KERNEL_IMAGETYPE = "uImage" diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-I2C-OMAP-correct-SYSC-register-offset-for-OMAP4.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-I2C-OMAP-correct-SYSC-register-offset-for-OMAP4.patch deleted file mode 100644 index 3c2c1b4d..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-I2C-OMAP-correct-SYSC-register-offset-for-OMAP4.patch +++ /dev/null @@ -1,34 +0,0 @@ -From f7455ca607fd743b247e01c51d4558ff4f4b0e23 Mon Sep 17 00:00:00 2001 -From: Alexander Aring -Date: Thu, 8 Dec 2011 15:43:53 +0100 -Subject: [PATCH 113/130] I2C: OMAP: correct SYSC register offset for OMAP4 - -commit 2727b1753934e154931d6b3bdf20c9b2398457a2 upstream. - -Correct OMAP_I2C_SYSC_REG offset in omap4 register map. -Offset 0x20 is reserved and OMAP_I2C_SYSC_REG has 0x10 as offset. - -Signed-off-by: Alexander Aring -[khilman@ti.com: minor changelog edits] -Signed-off-by: Kevin Hilman -Signed-off-by: Greg Kroah-Hartman ---- - drivers/i2c/busses/i2c-omap.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c -index 82fff06..e0733b7 100644 ---- a/drivers/i2c/busses/i2c-omap.c -+++ b/drivers/i2c/busses/i2c-omap.c -@@ -235,7 +235,7 @@ static const u8 reg_map_ip_v2[] = { - [OMAP_I2C_BUF_REG] = 0x94, - [OMAP_I2C_CNT_REG] = 0x98, - [OMAP_I2C_DATA_REG] = 0x9c, -- [OMAP_I2C_SYSC_REG] = 0x20, -+ [OMAP_I2C_SYSC_REG] = 0x10, - [OMAP_I2C_CON_REG] = 0xa4, - [OMAP_I2C_OA_REG] = 0xa8, - [OMAP_I2C_SA_REG] = 0xac, --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch new file mode 100644 index 00000000..29557a49 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0113-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch @@ -0,0 +1,350 @@ +From ec2a416f6ce2e5b896074a6e8c86fda4d1d21466 Mon Sep 17 00:00:00 2001 +From: Cliff Wickman +Date: Mon, 16 Jan 2012 15:17:50 -0600 +Subject: [PATCH 113/129] x86/UV2: Fix new UV2 hardware by using native UV2 + broadcast mode + +commit da87c937e5a2374686edd58df06cfd5050b125fa upstream. + +Update the use of the Broadcast Assist Unit on SGI Altix UV2 to +the use of native UV2 mode on new hardware (not the legacy mode). + +UV2 native mode has a different format for a broadcast message. +We also need quick differentiaton between UV1 and UV2. + +Signed-off-by: Cliff Wickman +Link: http://lkml.kernel.org/r/20120116211750.GA5767@sgi.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/uv/uv_bau.h | 93 +++++++++++++++++++++++++++++++++++--- + arch/x86/platform/uv/tlb_uv.c | 88 ++++++++++++++++++++++++++---------- + 2 files changed, 151 insertions(+), 30 deletions(-) + +diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h +index 8e862aa..4a46b27 100644 +--- a/arch/x86/include/asm/uv/uv_bau.h ++++ b/arch/x86/include/asm/uv/uv_bau.h +@@ -65,7 +65,7 @@ + * UV2: Bit 19 selects between + * (0): 10 microsecond timebase and + * (1): 80 microseconds +- * we're using 655us, similar to UV1: 65 units of 10us ++ * we're using 560us, similar to UV1: 65 units of 10us + */ + #define UV1_INTD_SOFT_ACK_TIMEOUT_PERIOD (9UL) + #define UV2_INTD_SOFT_ACK_TIMEOUT_PERIOD (15UL) +@@ -235,10 +235,10 @@ struct bau_msg_payload { + + + /* +- * Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) ++ * UV1 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) + * see table 4.2.3.0.1 in broacast_assist spec. + */ +-struct bau_msg_header { ++struct uv1_bau_msg_header { + unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */ + /* bits 5:0 */ + unsigned int base_dest_nasid:15; /* nasid of the first bit */ +@@ -318,19 +318,87 @@ struct bau_msg_header { + }; + + /* ++ * UV2 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) ++ * see figure 9-2 of harp_sys.pdf ++ */ ++struct uv2_bau_msg_header { ++ unsigned int base_dest_nasid:15; /* nasid of the first bit */ ++ /* bits 14:0 */ /* in uvhub map */ ++ unsigned int dest_subnodeid:5; /* must be 0x10, for the LB */ ++ /* bits 19:15 */ ++ unsigned int rsvd_1:1; /* must be zero */ ++ /* bit 20 */ ++ /* Address bits 59:21 */ ++ /* bits 25:2 of address (44:21) are payload */ ++ /* these next 24 bits become bytes 12-14 of msg */ ++ /* bits 28:21 land in byte 12 */ ++ unsigned int replied_to:1; /* sent as 0 by the source to ++ byte 12 */ ++ /* bit 21 */ ++ unsigned int msg_type:3; /* software type of the ++ message */ ++ /* bits 24:22 */ ++ unsigned int canceled:1; /* message canceled, resource ++ is to be freed*/ ++ /* bit 25 */ ++ unsigned int payload_1:3; /* not currently used */ ++ /* bits 28:26 */ ++ ++ /* bits 36:29 land in byte 13 */ ++ unsigned int payload_2a:3; /* not currently used */ ++ unsigned int payload_2b:5; /* not currently used */ ++ /* bits 36:29 */ ++ ++ /* bits 44:37 land in byte 14 */ ++ unsigned int payload_3:8; /* not currently used */ ++ /* bits 44:37 */ ++ ++ unsigned int rsvd_2:7; /* reserved */ ++ /* bits 51:45 */ ++ unsigned int swack_flag:1; /* software acknowledge flag */ ++ /* bit 52 */ ++ unsigned int rsvd_3a:3; /* must be zero */ ++ unsigned int rsvd_3b:8; /* must be zero */ ++ unsigned int rsvd_3c:8; /* must be zero */ ++ unsigned int rsvd_3d:3; /* must be zero */ ++ /* bits 74:53 */ ++ unsigned int fairness:3; /* usually zero */ ++ /* bits 77:75 */ ++ ++ unsigned int sequence:16; /* message sequence number */ ++ /* bits 93:78 Suppl_A */ ++ unsigned int chaining:1; /* next descriptor is part of ++ this activation*/ ++ /* bit 94 */ ++ unsigned int multilevel:1; /* multi-level multicast ++ format */ ++ /* bit 95 */ ++ unsigned int rsvd_4:24; /* ordered / source node / ++ source subnode / aging ++ must be zero */ ++ /* bits 119:96 */ ++ unsigned int command:8; /* message type */ ++ /* bits 127:120 */ ++}; ++ ++/* + * The activation descriptor: + * The format of the message to send, plus all accompanying control + * Should be 64 bytes + */ + struct bau_desc { +- struct pnmask distribution; ++ struct pnmask distribution; + /* + * message template, consisting of header and payload: + */ +- struct bau_msg_header header; +- struct bau_msg_payload payload; ++ union bau_msg_header { ++ struct uv1_bau_msg_header uv1_hdr; ++ struct uv2_bau_msg_header uv2_hdr; ++ } header; ++ ++ struct bau_msg_payload payload; + }; +-/* ++/* UV1: + * -payload-- ---------header------ + * bytes 0-11 bits 41-56 bits 58-81 + * A B (2) C (3) +@@ -340,6 +408,16 @@ struct bau_desc { + * bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector) + * ------------payload queue----------- + */ ++/* UV2: ++ * -payload-- ---------header------ ++ * bytes 0-11 bits 70-78 bits 21-44 ++ * A B (2) C (3) ++ * ++ * A/B/C are moved to: ++ * A C B ++ * bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector) ++ * ------------payload queue----------- ++ */ + + /* + * The payload queue on the destination side is an array of these. +@@ -511,6 +589,7 @@ struct bau_control { + short osnode; + short uvhub_cpu; + short uvhub; ++ short uvhub_version; + short cpus_in_socket; + short cpus_in_uvhub; + short partition_base_pnode; +diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c +index 5b55219..1341a2e 100644 +--- a/arch/x86/platform/uv/tlb_uv.c ++++ b/arch/x86/platform/uv/tlb_uv.c +@@ -573,7 +573,7 @@ static int wait_completion(struct bau_desc *bau_desc, + right_shift = ((cpu - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); + } + +- if (is_uv1_hub()) ++ if (bcp->uvhub_version == 1) + return uv1_wait_completion(bau_desc, mmr_offset, right_shift, + bcp, try); + else +@@ -757,15 +757,22 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + { + int seq_number = 0; + int completion_stat = 0; ++ int uv1 = 0; + long try = 0; + unsigned long index; + cycles_t time1; + cycles_t time2; + struct ptc_stats *stat = bcp->statp; + struct bau_control *hmaster = bcp->uvhub_master; ++ struct uv1_bau_msg_header *uv1_hdr = NULL; ++ struct uv2_bau_msg_header *uv2_hdr = NULL; + +- if (is_uv1_hub()) ++ if (bcp->uvhub_version == 1) { ++ uv1 = 1; + uv1_throttle(hmaster, stat); ++ uv1_hdr = &bau_desc->header.uv1_hdr; ++ } else ++ uv2_hdr = &bau_desc->header.uv2_hdr; + + while (hmaster->uvhub_quiesce) + cpu_relax(); +@@ -773,14 +780,23 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + time1 = get_cycles(); + do { + if (try == 0) { +- bau_desc->header.msg_type = MSG_REGULAR; ++ if (uv1) ++ uv1_hdr->msg_type = MSG_REGULAR; ++ else ++ uv2_hdr->msg_type = MSG_REGULAR; + seq_number = bcp->message_number++; + } else { +- bau_desc->header.msg_type = MSG_RETRY; ++ if (uv1) ++ uv1_hdr->msg_type = MSG_RETRY; ++ else ++ uv2_hdr->msg_type = MSG_RETRY; + stat->s_retry_messages++; + } + +- bau_desc->header.sequence = seq_number; ++ if (uv1) ++ uv1_hdr->sequence = seq_number; ++ else ++ uv2_hdr->sequence = seq_number; + index = (1UL << AS_PUSH_SHIFT) | bcp->uvhub_cpu; + bcp->send_message = get_cycles(); + +@@ -967,7 +983,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, + stat->s_ntargself++; + + bau_desc = bcp->descriptor_base; +- bau_desc += ITEMS_PER_DESC * bcp->uvhub_cpu; ++ bau_desc += (ITEMS_PER_DESC * bcp->uvhub_cpu); + bau_uvhubs_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE); + if (set_distrib_bits(flush_mask, bcp, bau_desc, &locals, &remotes)) + return NULL; +@@ -1083,7 +1099,7 @@ static void __init enable_timeouts(void) + */ + mmr_image |= (1L << SOFTACK_MSHIFT); + if (is_uv2_hub()) { +- mmr_image |= (1L << UV2_LEG_SHFT); ++ mmr_image &= ~(1L << UV2_LEG_SHFT); + mmr_image |= (1L << UV2_EXT_SHFT); + } + write_mmr_misc_control(pnode, mmr_image); +@@ -1432,12 +1448,15 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) + { + int i; + int cpu; ++ int uv1 = 0; + unsigned long gpa; + unsigned long m; + unsigned long n; + size_t dsize; + struct bau_desc *bau_desc; + struct bau_desc *bd2; ++ struct uv1_bau_msg_header *uv1_hdr; ++ struct uv2_bau_msg_header *uv2_hdr; + struct bau_control *bcp; + + /* +@@ -1451,6 +1470,8 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) + gpa = uv_gpa(bau_desc); + n = uv_gpa_to_gnode(gpa); + m = uv_gpa_to_offset(gpa); ++ if (is_uv1_hub()) ++ uv1 = 1; + + /* the 14-bit pnode */ + write_mmr_descriptor_base(pnode, (n << UV_DESC_PSHIFT | m)); +@@ -1461,21 +1482,33 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) + */ + for (i = 0, bd2 = bau_desc; i < (ADP_SZ * ITEMS_PER_DESC); i++, bd2++) { + memset(bd2, 0, sizeof(struct bau_desc)); +- bd2->header.swack_flag = 1; +- /* +- * The base_dest_nasid set in the message header is the nasid +- * of the first uvhub in the partition. The bit map will +- * indicate destination pnode numbers relative to that base. +- * They may not be consecutive if nasid striding is being used. +- */ +- bd2->header.base_dest_nasid = UV_PNODE_TO_NASID(base_pnode); +- bd2->header.dest_subnodeid = UV_LB_SUBNODEID; +- bd2->header.command = UV_NET_ENDPOINT_INTD; +- bd2->header.int_both = 1; +- /* +- * all others need to be set to zero: +- * fairness chaining multilevel count replied_to +- */ ++ if (uv1) { ++ uv1_hdr = &bd2->header.uv1_hdr; ++ uv1_hdr->swack_flag = 1; ++ /* ++ * The base_dest_nasid set in the message header ++ * is the nasid of the first uvhub in the partition. ++ * The bit map will indicate destination pnode numbers ++ * relative to that base. They may not be consecutive ++ * if nasid striding is being used. ++ */ ++ uv1_hdr->base_dest_nasid = ++ UV_PNODE_TO_NASID(base_pnode); ++ uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; ++ uv1_hdr->command = UV_NET_ENDPOINT_INTD; ++ uv1_hdr->int_both = 1; ++ /* ++ * all others need to be set to zero: ++ * fairness chaining multilevel count replied_to ++ */ ++ } else { ++ uv2_hdr = &bd2->header.uv2_hdr; ++ uv2_hdr->swack_flag = 1; ++ uv2_hdr->base_dest_nasid = ++ UV_PNODE_TO_NASID(base_pnode); ++ uv2_hdr->dest_subnodeid = UV_LB_SUBNODEID; ++ uv2_hdr->command = UV_NET_ENDPOINT_INTD; ++ } + } + for_each_present_cpu(cpu) { + if (pnode != uv_blade_to_pnode(uv_cpu_to_blade_id(cpu))) +@@ -1728,6 +1761,14 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp, + bcp->cpus_in_socket = sdp->num_cpus; + bcp->socket_master = *smasterp; + bcp->uvhub = bdp->uvhub; ++ if (is_uv1_hub()) ++ bcp->uvhub_version = 1; ++ else if (is_uv2_hub()) ++ bcp->uvhub_version = 2; ++ else { ++ printk(KERN_EMERG "uvhub version not 1 or 2\n"); ++ return 1; ++ } + bcp->uvhub_master = *hmasterp; + bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->blade_processor_id; + if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { +@@ -1867,7 +1908,8 @@ static int __init uv_bau_init(void) + val = 1L << 63; + write_gmmr_activation(pnode, val); + mmr = 1; /* should be 1 to broadcast to both sockets */ +- write_mmr_data_broadcast(pnode, mmr); ++ if (!is_uv1_hub()) ++ write_mmr_data_broadcast(pnode, mmr); + } + } + +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-BAU-destination-timeout-initialization.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-BAU-destination-timeout-initialization.patch new file mode 100644 index 00000000..a7502511 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-BAU-destination-timeout-initialization.patch @@ -0,0 +1,66 @@ +From 0b3a1f5aefb71777fec89809de87c49b917a88e7 Mon Sep 17 00:00:00 2001 +From: Cliff Wickman +Date: Mon, 16 Jan 2012 15:18:48 -0600 +Subject: [PATCH 114/129] x86/UV2: Fix BAU destination timeout initialization + +commit d059f9fa84a30e04279c6ff615e9e2cf3b260191 upstream. + +Move the call to enable_timeouts() forward so that +BAU_MISC_CONTROL is initialized before using it in +calculate_destination_timeout(). + +Fix the calculation of a BAU destination timeout +for UV2 (in calculate_destination_timeout()). + +Signed-off-by: Cliff Wickman +Link: http://lkml.kernel.org/r/20120116211848.GB5767@sgi.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/platform/uv/tlb_uv.c | 13 +++++++------ + 1 file changed, 7 insertions(+), 6 deletions(-) + +diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c +index 1341a2e..c425ff1 100644 +--- a/arch/x86/platform/uv/tlb_uv.c ++++ b/arch/x86/platform/uv/tlb_uv.c +@@ -1617,14 +1617,14 @@ static int calculate_destination_timeout(void) + ts_ns = base * mult1 * mult2; + ret = ts_ns / 1000; + } else { +- /* 4 bits 0/1 for 10/80us, 3 bits of multiplier */ +- mmr_image = uv_read_local_mmr(UVH_AGING_PRESCALE_SEL); ++ /* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */ ++ mmr_image = uv_read_local_mmr(UVH_LB_BAU_MISC_CONTROL); + mmr_image = (mmr_image & UV_SA_MASK) >> UV_SA_SHFT; + if (mmr_image & (1L << UV2_ACK_UNITS_SHFT)) +- mult1 = 80; ++ base = 80; + else +- mult1 = 10; +- base = mmr_image & UV2_ACK_MASK; ++ base = 10; ++ mult1 = mmr_image & UV2_ACK_MASK; + ret = mult1 * base; + } + return ret; +@@ -1886,6 +1886,8 @@ static int __init uv_bau_init(void) + uv_base_pnode = uv_blade_to_pnode(uvhub); + } + ++ enable_timeouts(); ++ + if (init_per_cpu(nuvhubs, uv_base_pnode)) { + nobau = 1; + return 0; +@@ -1896,7 +1898,6 @@ static int __init uv_bau_init(void) + if (uv_blade_nr_possible_cpus(uvhub)) + init_uvhub(uvhub, vector, uv_base_pnode); + +- enable_timeouts(); + alloc_intr_gate(vector, uv_bau_message_intr1); + + for_each_possible_blade(uvhub) { +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch deleted file mode 100644 index bf54d90f..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0114-x86-UV2-Fix-new-UV2-hardware-by-using-native-UV2-bro.patch +++ /dev/null @@ -1,350 +0,0 @@ -From 15259eb18bbb73a316954965e66a8a85a9e12635 Mon Sep 17 00:00:00 2001 -From: Cliff Wickman -Date: Mon, 16 Jan 2012 15:17:50 -0600 -Subject: [PATCH 114/130] x86/UV2: Fix new UV2 hardware by using native UV2 - broadcast mode - -commit da87c937e5a2374686edd58df06cfd5050b125fa upstream. - -Update the use of the Broadcast Assist Unit on SGI Altix UV2 to -the use of native UV2 mode on new hardware (not the legacy mode). - -UV2 native mode has a different format for a broadcast message. -We also need quick differentiaton between UV1 and UV2. - -Signed-off-by: Cliff Wickman -Link: http://lkml.kernel.org/r/20120116211750.GA5767@sgi.com -Signed-off-by: Ingo Molnar -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/include/asm/uv/uv_bau.h | 93 +++++++++++++++++++++++++++++++++++--- - arch/x86/platform/uv/tlb_uv.c | 88 ++++++++++++++++++++++++++---------- - 2 files changed, 151 insertions(+), 30 deletions(-) - -diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h -index 8e862aa..4a46b27 100644 ---- a/arch/x86/include/asm/uv/uv_bau.h -+++ b/arch/x86/include/asm/uv/uv_bau.h -@@ -65,7 +65,7 @@ - * UV2: Bit 19 selects between - * (0): 10 microsecond timebase and - * (1): 80 microseconds -- * we're using 655us, similar to UV1: 65 units of 10us -+ * we're using 560us, similar to UV1: 65 units of 10us - */ - #define UV1_INTD_SOFT_ACK_TIMEOUT_PERIOD (9UL) - #define UV2_INTD_SOFT_ACK_TIMEOUT_PERIOD (15UL) -@@ -235,10 +235,10 @@ struct bau_msg_payload { - - - /* -- * Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) -+ * UV1 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) - * see table 4.2.3.0.1 in broacast_assist spec. - */ --struct bau_msg_header { -+struct uv1_bau_msg_header { - unsigned int dest_subnodeid:6; /* must be 0x10, for the LB */ - /* bits 5:0 */ - unsigned int base_dest_nasid:15; /* nasid of the first bit */ -@@ -318,19 +318,87 @@ struct bau_msg_header { - }; - - /* -+ * UV2 Message header: 16 bytes (128 bits) (bytes 0x30-0x3f of descriptor) -+ * see figure 9-2 of harp_sys.pdf -+ */ -+struct uv2_bau_msg_header { -+ unsigned int base_dest_nasid:15; /* nasid of the first bit */ -+ /* bits 14:0 */ /* in uvhub map */ -+ unsigned int dest_subnodeid:5; /* must be 0x10, for the LB */ -+ /* bits 19:15 */ -+ unsigned int rsvd_1:1; /* must be zero */ -+ /* bit 20 */ -+ /* Address bits 59:21 */ -+ /* bits 25:2 of address (44:21) are payload */ -+ /* these next 24 bits become bytes 12-14 of msg */ -+ /* bits 28:21 land in byte 12 */ -+ unsigned int replied_to:1; /* sent as 0 by the source to -+ byte 12 */ -+ /* bit 21 */ -+ unsigned int msg_type:3; /* software type of the -+ message */ -+ /* bits 24:22 */ -+ unsigned int canceled:1; /* message canceled, resource -+ is to be freed*/ -+ /* bit 25 */ -+ unsigned int payload_1:3; /* not currently used */ -+ /* bits 28:26 */ -+ -+ /* bits 36:29 land in byte 13 */ -+ unsigned int payload_2a:3; /* not currently used */ -+ unsigned int payload_2b:5; /* not currently used */ -+ /* bits 36:29 */ -+ -+ /* bits 44:37 land in byte 14 */ -+ unsigned int payload_3:8; /* not currently used */ -+ /* bits 44:37 */ -+ -+ unsigned int rsvd_2:7; /* reserved */ -+ /* bits 51:45 */ -+ unsigned int swack_flag:1; /* software acknowledge flag */ -+ /* bit 52 */ -+ unsigned int rsvd_3a:3; /* must be zero */ -+ unsigned int rsvd_3b:8; /* must be zero */ -+ unsigned int rsvd_3c:8; /* must be zero */ -+ unsigned int rsvd_3d:3; /* must be zero */ -+ /* bits 74:53 */ -+ unsigned int fairness:3; /* usually zero */ -+ /* bits 77:75 */ -+ -+ unsigned int sequence:16; /* message sequence number */ -+ /* bits 93:78 Suppl_A */ -+ unsigned int chaining:1; /* next descriptor is part of -+ this activation*/ -+ /* bit 94 */ -+ unsigned int multilevel:1; /* multi-level multicast -+ format */ -+ /* bit 95 */ -+ unsigned int rsvd_4:24; /* ordered / source node / -+ source subnode / aging -+ must be zero */ -+ /* bits 119:96 */ -+ unsigned int command:8; /* message type */ -+ /* bits 127:120 */ -+}; -+ -+/* - * The activation descriptor: - * The format of the message to send, plus all accompanying control - * Should be 64 bytes - */ - struct bau_desc { -- struct pnmask distribution; -+ struct pnmask distribution; - /* - * message template, consisting of header and payload: - */ -- struct bau_msg_header header; -- struct bau_msg_payload payload; -+ union bau_msg_header { -+ struct uv1_bau_msg_header uv1_hdr; -+ struct uv2_bau_msg_header uv2_hdr; -+ } header; -+ -+ struct bau_msg_payload payload; - }; --/* -+/* UV1: - * -payload-- ---------header------ - * bytes 0-11 bits 41-56 bits 58-81 - * A B (2) C (3) -@@ -340,6 +408,16 @@ struct bau_desc { - * bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector) - * ------------payload queue----------- - */ -+/* UV2: -+ * -payload-- ---------header------ -+ * bytes 0-11 bits 70-78 bits 21-44 -+ * A B (2) C (3) -+ * -+ * A/B/C are moved to: -+ * A C B -+ * bytes 0-11 bytes 12-14 bytes 16-17 (byte 15 filled in by hw as vector) -+ * ------------payload queue----------- -+ */ - - /* - * The payload queue on the destination side is an array of these. -@@ -511,6 +589,7 @@ struct bau_control { - short osnode; - short uvhub_cpu; - short uvhub; -+ short uvhub_version; - short cpus_in_socket; - short cpus_in_uvhub; - short partition_base_pnode; -diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c -index 5b55219..1341a2e 100644 ---- a/arch/x86/platform/uv/tlb_uv.c -+++ b/arch/x86/platform/uv/tlb_uv.c -@@ -573,7 +573,7 @@ static int wait_completion(struct bau_desc *bau_desc, - right_shift = ((cpu - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); - } - -- if (is_uv1_hub()) -+ if (bcp->uvhub_version == 1) - return uv1_wait_completion(bau_desc, mmr_offset, right_shift, - bcp, try); - else -@@ -757,15 +757,22 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - { - int seq_number = 0; - int completion_stat = 0; -+ int uv1 = 0; - long try = 0; - unsigned long index; - cycles_t time1; - cycles_t time2; - struct ptc_stats *stat = bcp->statp; - struct bau_control *hmaster = bcp->uvhub_master; -+ struct uv1_bau_msg_header *uv1_hdr = NULL; -+ struct uv2_bau_msg_header *uv2_hdr = NULL; - -- if (is_uv1_hub()) -+ if (bcp->uvhub_version == 1) { -+ uv1 = 1; - uv1_throttle(hmaster, stat); -+ uv1_hdr = &bau_desc->header.uv1_hdr; -+ } else -+ uv2_hdr = &bau_desc->header.uv2_hdr; - - while (hmaster->uvhub_quiesce) - cpu_relax(); -@@ -773,14 +780,23 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - time1 = get_cycles(); - do { - if (try == 0) { -- bau_desc->header.msg_type = MSG_REGULAR; -+ if (uv1) -+ uv1_hdr->msg_type = MSG_REGULAR; -+ else -+ uv2_hdr->msg_type = MSG_REGULAR; - seq_number = bcp->message_number++; - } else { -- bau_desc->header.msg_type = MSG_RETRY; -+ if (uv1) -+ uv1_hdr->msg_type = MSG_RETRY; -+ else -+ uv2_hdr->msg_type = MSG_RETRY; - stat->s_retry_messages++; - } - -- bau_desc->header.sequence = seq_number; -+ if (uv1) -+ uv1_hdr->sequence = seq_number; -+ else -+ uv2_hdr->sequence = seq_number; - index = (1UL << AS_PUSH_SHIFT) | bcp->uvhub_cpu; - bcp->send_message = get_cycles(); - -@@ -967,7 +983,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, - stat->s_ntargself++; - - bau_desc = bcp->descriptor_base; -- bau_desc += ITEMS_PER_DESC * bcp->uvhub_cpu; -+ bau_desc += (ITEMS_PER_DESC * bcp->uvhub_cpu); - bau_uvhubs_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE); - if (set_distrib_bits(flush_mask, bcp, bau_desc, &locals, &remotes)) - return NULL; -@@ -1083,7 +1099,7 @@ static void __init enable_timeouts(void) - */ - mmr_image |= (1L << SOFTACK_MSHIFT); - if (is_uv2_hub()) { -- mmr_image |= (1L << UV2_LEG_SHFT); -+ mmr_image &= ~(1L << UV2_LEG_SHFT); - mmr_image |= (1L << UV2_EXT_SHFT); - } - write_mmr_misc_control(pnode, mmr_image); -@@ -1432,12 +1448,15 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) - { - int i; - int cpu; -+ int uv1 = 0; - unsigned long gpa; - unsigned long m; - unsigned long n; - size_t dsize; - struct bau_desc *bau_desc; - struct bau_desc *bd2; -+ struct uv1_bau_msg_header *uv1_hdr; -+ struct uv2_bau_msg_header *uv2_hdr; - struct bau_control *bcp; - - /* -@@ -1451,6 +1470,8 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) - gpa = uv_gpa(bau_desc); - n = uv_gpa_to_gnode(gpa); - m = uv_gpa_to_offset(gpa); -+ if (is_uv1_hub()) -+ uv1 = 1; - - /* the 14-bit pnode */ - write_mmr_descriptor_base(pnode, (n << UV_DESC_PSHIFT | m)); -@@ -1461,21 +1482,33 @@ static void activation_descriptor_init(int node, int pnode, int base_pnode) - */ - for (i = 0, bd2 = bau_desc; i < (ADP_SZ * ITEMS_PER_DESC); i++, bd2++) { - memset(bd2, 0, sizeof(struct bau_desc)); -- bd2->header.swack_flag = 1; -- /* -- * The base_dest_nasid set in the message header is the nasid -- * of the first uvhub in the partition. The bit map will -- * indicate destination pnode numbers relative to that base. -- * They may not be consecutive if nasid striding is being used. -- */ -- bd2->header.base_dest_nasid = UV_PNODE_TO_NASID(base_pnode); -- bd2->header.dest_subnodeid = UV_LB_SUBNODEID; -- bd2->header.command = UV_NET_ENDPOINT_INTD; -- bd2->header.int_both = 1; -- /* -- * all others need to be set to zero: -- * fairness chaining multilevel count replied_to -- */ -+ if (uv1) { -+ uv1_hdr = &bd2->header.uv1_hdr; -+ uv1_hdr->swack_flag = 1; -+ /* -+ * The base_dest_nasid set in the message header -+ * is the nasid of the first uvhub in the partition. -+ * The bit map will indicate destination pnode numbers -+ * relative to that base. They may not be consecutive -+ * if nasid striding is being used. -+ */ -+ uv1_hdr->base_dest_nasid = -+ UV_PNODE_TO_NASID(base_pnode); -+ uv1_hdr->dest_subnodeid = UV_LB_SUBNODEID; -+ uv1_hdr->command = UV_NET_ENDPOINT_INTD; -+ uv1_hdr->int_both = 1; -+ /* -+ * all others need to be set to zero: -+ * fairness chaining multilevel count replied_to -+ */ -+ } else { -+ uv2_hdr = &bd2->header.uv2_hdr; -+ uv2_hdr->swack_flag = 1; -+ uv2_hdr->base_dest_nasid = -+ UV_PNODE_TO_NASID(base_pnode); -+ uv2_hdr->dest_subnodeid = UV_LB_SUBNODEID; -+ uv2_hdr->command = UV_NET_ENDPOINT_INTD; -+ } - } - for_each_present_cpu(cpu) { - if (pnode != uv_blade_to_pnode(uv_cpu_to_blade_id(cpu))) -@@ -1728,6 +1761,14 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp, - bcp->cpus_in_socket = sdp->num_cpus; - bcp->socket_master = *smasterp; - bcp->uvhub = bdp->uvhub; -+ if (is_uv1_hub()) -+ bcp->uvhub_version = 1; -+ else if (is_uv2_hub()) -+ bcp->uvhub_version = 2; -+ else { -+ printk(KERN_EMERG "uvhub version not 1 or 2\n"); -+ return 1; -+ } - bcp->uvhub_master = *hmasterp; - bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->blade_processor_id; - if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { -@@ -1867,7 +1908,8 @@ static int __init uv_bau_init(void) - val = 1L << 63; - write_gmmr_activation(pnode, val); - mmr = 1; /* should be 1 to broadcast to both sockets */ -- write_mmr_data_broadcast(pnode, mmr); -+ if (!is_uv1_hub()) -+ write_mmr_data_broadcast(pnode, mmr); - } - } - --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Fix-BAU-destination-timeout-initialization.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Fix-BAU-destination-timeout-initialization.patch deleted file mode 100644 index aa154c94..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Fix-BAU-destination-timeout-initialization.patch +++ /dev/null @@ -1,66 +0,0 @@ -From b92c8d886296debcaf5af9cceb74f02bbce4d83d Mon Sep 17 00:00:00 2001 -From: Cliff Wickman -Date: Mon, 16 Jan 2012 15:18:48 -0600 -Subject: [PATCH 115/130] x86/UV2: Fix BAU destination timeout initialization - -commit d059f9fa84a30e04279c6ff615e9e2cf3b260191 upstream. - -Move the call to enable_timeouts() forward so that -BAU_MISC_CONTROL is initialized before using it in -calculate_destination_timeout(). - -Fix the calculation of a BAU destination timeout -for UV2 (in calculate_destination_timeout()). - -Signed-off-by: Cliff Wickman -Link: http://lkml.kernel.org/r/20120116211848.GB5767@sgi.com -Signed-off-by: Ingo Molnar -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/platform/uv/tlb_uv.c | 13 +++++++------ - 1 file changed, 7 insertions(+), 6 deletions(-) - -diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c -index 1341a2e..c425ff1 100644 ---- a/arch/x86/platform/uv/tlb_uv.c -+++ b/arch/x86/platform/uv/tlb_uv.c -@@ -1617,14 +1617,14 @@ static int calculate_destination_timeout(void) - ts_ns = base * mult1 * mult2; - ret = ts_ns / 1000; - } else { -- /* 4 bits 0/1 for 10/80us, 3 bits of multiplier */ -- mmr_image = uv_read_local_mmr(UVH_AGING_PRESCALE_SEL); -+ /* 4 bits 0/1 for 10/80us base, 3 bits of multiplier */ -+ mmr_image = uv_read_local_mmr(UVH_LB_BAU_MISC_CONTROL); - mmr_image = (mmr_image & UV_SA_MASK) >> UV_SA_SHFT; - if (mmr_image & (1L << UV2_ACK_UNITS_SHFT)) -- mult1 = 80; -+ base = 80; - else -- mult1 = 10; -- base = mmr_image & UV2_ACK_MASK; -+ base = 10; -+ mult1 = mmr_image & UV2_ACK_MASK; - ret = mult1 * base; - } - return ret; -@@ -1886,6 +1886,8 @@ static int __init uv_bau_init(void) - uv_base_pnode = uv_blade_to_pnode(uvhub); - } - -+ enable_timeouts(); -+ - if (init_per_cpu(nuvhubs, uv_base_pnode)) { - nobau = 1; - return 0; -@@ -1896,7 +1898,6 @@ static int __init uv_bau_init(void) - if (uv_blade_nr_possible_cpus(uvhub)) - init_uvhub(uvhub, vector, uv_base_pnode); - -- enable_timeouts(); - alloc_intr_gate(vector, uv_bau_message_intr1); - - for_each_possible_blade(uvhub) { --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Work-around-BAU-bug.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Work-around-BAU-bug.patch new file mode 100644 index 00000000..bfcab134 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0115-x86-UV2-Work-around-BAU-bug.patch @@ -0,0 +1,570 @@ +From d1eaa067ea8545101d57f6d484519722ee8c3783 Mon Sep 17 00:00:00 2001 +From: Cliff Wickman +Date: Mon, 16 Jan 2012 15:19:47 -0600 +Subject: [PATCH 115/129] x86/UV2: Work around BAU bug + +commit c5d35d399e685acccc85a675e8765c26b2a9813a upstream. + +This patch implements a workaround for a UV2 hardware bug. +The bug is a non-atomic update of a memory-mapped register. When +hardware message delivery and software message acknowledge occur +simultaneously the pending message acknowledge for the arriving +message may be lost. This causes the sender's message status to +stay busy. + +Part of the workaround is to not acknowledge a completed message +until it is verified that no other message is actually using the +resource that is mistakenly recorded in the completed message. + +Part of the workaround is to test for long elapsed time in such +a busy condition, then handle it by using a spare sending +descriptor. The stay-busy condition is eventually timed out by +hardware, and then the original sending descriptor can be +re-used. Most of that logic change is in keeping track of the +current descriptor and the state of the spares. + +The occurrences of the workaround are added to the BAU +statistics. + +Signed-off-by: Cliff Wickman +Link: http://lkml.kernel.org/r/20120116211947.GC5767@sgi.com +Signed-off-by: Ingo Molnar +Signed-off-by: Greg Kroah-Hartman +--- + arch/x86/include/asm/uv/uv_bau.h | 13 +- + arch/x86/platform/uv/tlb_uv.c | 274 +++++++++++++++++++++++++++++++++----- + 2 files changed, 254 insertions(+), 33 deletions(-) + +diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h +index 4a46b27..1b82f7e 100644 +--- a/arch/x86/include/asm/uv/uv_bau.h ++++ b/arch/x86/include/asm/uv/uv_bau.h +@@ -167,6 +167,7 @@ + #define FLUSH_RETRY_TIMEOUT 2 + #define FLUSH_GIVEUP 3 + #define FLUSH_COMPLETE 4 ++#define FLUSH_RETRY_BUSYBUG 5 + + /* + * tuning the action when the numalink network is extremely delayed +@@ -463,7 +464,6 @@ struct bau_pq_entry { + struct msg_desc { + struct bau_pq_entry *msg; + int msg_slot; +- int swack_slot; + struct bau_pq_entry *queue_first; + struct bau_pq_entry *queue_last; + }; +@@ -517,6 +517,9 @@ struct ptc_stats { + unsigned long s_retry_messages; /* retry broadcasts */ + unsigned long s_bau_reenabled; /* for bau enable/disable */ + unsigned long s_bau_disabled; /* for bau enable/disable */ ++ unsigned long s_uv2_wars; /* uv2 workaround, perm. busy */ ++ unsigned long s_uv2_wars_hw; /* uv2 workaround, hiwater */ ++ unsigned long s_uv2_war_waits; /* uv2 workaround, long waits */ + /* destination statistics */ + unsigned long d_alltlb; /* times all tlb's on this + cpu were flushed */ +@@ -593,6 +596,8 @@ struct bau_control { + short cpus_in_socket; + short cpus_in_uvhub; + short partition_base_pnode; ++ short using_desc; /* an index, like uvhub_cpu */ ++ unsigned int inuse_map; + unsigned short message_number; + unsigned short uvhub_quiesce; + short socket_acknowledge_count[DEST_Q_SIZE]; +@@ -610,6 +615,7 @@ struct bau_control { + int cong_response_us; + int cong_reps; + int cong_period; ++ unsigned long clocks_per_100_usec; + cycles_t period_time; + long period_requests; + struct hub_and_pnode *thp; +@@ -670,6 +676,11 @@ static inline void write_mmr_sw_ack(unsigned long mr) + uv_write_local_mmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr); + } + ++static inline void write_gmmr_sw_ack(int pnode, unsigned long mr) ++{ ++ write_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr); ++} ++ + static inline unsigned long read_mmr_sw_ack(void) + { + return read_lmmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); +diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c +index c425ff1..9010ca7 100644 +--- a/arch/x86/platform/uv/tlb_uv.c ++++ b/arch/x86/platform/uv/tlb_uv.c +@@ -157,13 +157,14 @@ static int __init uvhub_to_first_apicid(int uvhub) + * clear of the Timeout bit (as well) will free the resource. No reply will + * be sent (the hardware will only do one reply per message). + */ +-static void reply_to_message(struct msg_desc *mdp, struct bau_control *bcp) ++static void reply_to_message(struct msg_desc *mdp, struct bau_control *bcp, ++ int do_acknowledge) + { + unsigned long dw; + struct bau_pq_entry *msg; + + msg = mdp->msg; +- if (!msg->canceled) { ++ if (!msg->canceled && do_acknowledge) { + dw = (msg->swack_vec << UV_SW_ACK_NPENDING) | msg->swack_vec; + write_mmr_sw_ack(dw); + } +@@ -212,8 +213,8 @@ static void bau_process_retry_msg(struct msg_desc *mdp, + if (mmr & (msg_res << UV_SW_ACK_NPENDING)) { + unsigned long mr; + /* +- * is the resource timed out? +- * make everyone ignore the cancelled message. ++ * Is the resource timed out? ++ * Make everyone ignore the cancelled message. + */ + msg2->canceled = 1; + stat->d_canceled++; +@@ -231,8 +232,8 @@ static void bau_process_retry_msg(struct msg_desc *mdp, + * Do all the things a cpu should do for a TLB shootdown message. + * Other cpu's may come here at the same time for this message. + */ +-static void bau_process_message(struct msg_desc *mdp, +- struct bau_control *bcp) ++static void bau_process_message(struct msg_desc *mdp, struct bau_control *bcp, ++ int do_acknowledge) + { + short socket_ack_count = 0; + short *sp; +@@ -284,8 +285,9 @@ static void bau_process_message(struct msg_desc *mdp, + if (msg_ack_count == bcp->cpus_in_uvhub) { + /* + * All cpus in uvhub saw it; reply ++ * (unless we are in the UV2 workaround) + */ +- reply_to_message(mdp, bcp); ++ reply_to_message(mdp, bcp, do_acknowledge); + } + } + +@@ -491,27 +493,138 @@ static int uv1_wait_completion(struct bau_desc *bau_desc, + /* + * UV2 has an extra bit of status in the ACTIVATION_STATUS_2 register. + */ +-static unsigned long uv2_read_status(unsigned long offset, int rshft, int cpu) ++static unsigned long uv2_read_status(unsigned long offset, int rshft, int desc) + { + unsigned long descriptor_status; + unsigned long descriptor_status2; + + descriptor_status = ((read_lmmr(offset) >> rshft) & UV_ACT_STATUS_MASK); +- descriptor_status2 = (read_mmr_uv2_status() >> cpu) & 0x1UL; ++ descriptor_status2 = (read_mmr_uv2_status() >> desc) & 0x1UL; + descriptor_status = (descriptor_status << 1) | descriptor_status2; + return descriptor_status; + } + ++/* ++ * Return whether the status of the descriptor that is normally used for this ++ * cpu (the one indexed by its hub-relative cpu number) is busy. ++ * The status of the original 32 descriptors is always reflected in the 64 ++ * bits of UVH_LB_BAU_SB_ACTIVATION_STATUS_0. ++ * The bit provided by the activation_status_2 register is irrelevant to ++ * the status if it is only being tested for busy or not busy. ++ */ ++int normal_busy(struct bau_control *bcp) ++{ ++ int cpu = bcp->uvhub_cpu; ++ int mmr_offset; ++ int right_shift; ++ ++ mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_0; ++ right_shift = cpu * UV_ACT_STATUS_SIZE; ++ return (((((read_lmmr(mmr_offset) >> right_shift) & ++ UV_ACT_STATUS_MASK)) << 1) == UV2H_DESC_BUSY); ++} ++ ++/* ++ * Entered when a bau descriptor has gone into a permanent busy wait because ++ * of a hardware bug. ++ * Workaround the bug. ++ */ ++int handle_uv2_busy(struct bau_control *bcp) ++{ ++ int busy_one = bcp->using_desc; ++ int normal = bcp->uvhub_cpu; ++ int selected = -1; ++ int i; ++ unsigned long descriptor_status; ++ unsigned long status; ++ int mmr_offset; ++ struct bau_desc *bau_desc_old; ++ struct bau_desc *bau_desc_new; ++ struct bau_control *hmaster = bcp->uvhub_master; ++ struct ptc_stats *stat = bcp->statp; ++ cycles_t ttm; ++ ++ stat->s_uv2_wars++; ++ spin_lock(&hmaster->uvhub_lock); ++ /* try for the original first */ ++ if (busy_one != normal) { ++ if (!normal_busy(bcp)) ++ selected = normal; ++ } ++ if (selected < 0) { ++ /* can't use the normal, select an alternate */ ++ mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_1; ++ descriptor_status = read_lmmr(mmr_offset); ++ ++ /* scan available descriptors 32-63 */ ++ for (i = 0; i < UV_CPUS_PER_AS; i++) { ++ if ((hmaster->inuse_map & (1 << i)) == 0) { ++ status = ((descriptor_status >> ++ (i * UV_ACT_STATUS_SIZE)) & ++ UV_ACT_STATUS_MASK) << 1; ++ if (status != UV2H_DESC_BUSY) { ++ selected = i + UV_CPUS_PER_AS; ++ break; ++ } ++ } ++ } ++ } ++ ++ if (busy_one != normal) ++ /* mark the busy alternate as not in-use */ ++ hmaster->inuse_map &= ~(1 << (busy_one - UV_CPUS_PER_AS)); ++ ++ if (selected >= 0) { ++ /* switch to the selected descriptor */ ++ if (selected != normal) { ++ /* set the selected alternate as in-use */ ++ hmaster->inuse_map |= ++ (1 << (selected - UV_CPUS_PER_AS)); ++ if (selected > stat->s_uv2_wars_hw) ++ stat->s_uv2_wars_hw = selected; ++ } ++ bau_desc_old = bcp->descriptor_base; ++ bau_desc_old += (ITEMS_PER_DESC * busy_one); ++ bcp->using_desc = selected; ++ bau_desc_new = bcp->descriptor_base; ++ bau_desc_new += (ITEMS_PER_DESC * selected); ++ *bau_desc_new = *bau_desc_old; ++ } else { ++ /* ++ * All are busy. Wait for the normal one for this cpu to ++ * free up. ++ */ ++ stat->s_uv2_war_waits++; ++ spin_unlock(&hmaster->uvhub_lock); ++ ttm = get_cycles(); ++ do { ++ cpu_relax(); ++ } while (normal_busy(bcp)); ++ spin_lock(&hmaster->uvhub_lock); ++ /* switch to the original descriptor */ ++ bcp->using_desc = normal; ++ bau_desc_old = bcp->descriptor_base; ++ bau_desc_old += (ITEMS_PER_DESC * bcp->using_desc); ++ bcp->using_desc = (ITEMS_PER_DESC * normal); ++ bau_desc_new = bcp->descriptor_base; ++ bau_desc_new += (ITEMS_PER_DESC * normal); ++ *bau_desc_new = *bau_desc_old; /* copy the entire descriptor */ ++ } ++ spin_unlock(&hmaster->uvhub_lock); ++ return FLUSH_RETRY_BUSYBUG; ++} ++ + static int uv2_wait_completion(struct bau_desc *bau_desc, + unsigned long mmr_offset, int right_shift, + struct bau_control *bcp, long try) + { + unsigned long descriptor_stat; + cycles_t ttm; +- int cpu = bcp->uvhub_cpu; ++ int desc = bcp->using_desc; ++ long busy_reps = 0; + struct ptc_stats *stat = bcp->statp; + +- descriptor_stat = uv2_read_status(mmr_offset, right_shift, cpu); ++ descriptor_stat = uv2_read_status(mmr_offset, right_shift, desc); + + /* spin on the status MMR, waiting for it to go idle */ + while (descriptor_stat != UV2H_DESC_IDLE) { +@@ -542,12 +655,23 @@ static int uv2_wait_completion(struct bau_desc *bau_desc, + bcp->conseccompletes = 0; + return FLUSH_RETRY_TIMEOUT; + } else { ++ busy_reps++; ++ if (busy_reps > 1000000) { ++ /* not to hammer on the clock */ ++ busy_reps = 0; ++ ttm = get_cycles(); ++ if ((ttm - bcp->send_message) > ++ (bcp->clocks_per_100_usec)) { ++ return handle_uv2_busy(bcp); ++ } ++ } + /* + * descriptor_stat is still BUSY + */ + cpu_relax(); + } +- descriptor_stat = uv2_read_status(mmr_offset, right_shift, cpu); ++ descriptor_stat = uv2_read_status(mmr_offset, right_shift, ++ desc); + } + bcp->conseccompletes++; + return FLUSH_COMPLETE; +@@ -563,14 +687,14 @@ static int wait_completion(struct bau_desc *bau_desc, + { + int right_shift; + unsigned long mmr_offset; +- int cpu = bcp->uvhub_cpu; ++ int desc = bcp->using_desc; + +- if (cpu < UV_CPUS_PER_AS) { ++ if (desc < UV_CPUS_PER_AS) { + mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_0; +- right_shift = cpu * UV_ACT_STATUS_SIZE; ++ right_shift = desc * UV_ACT_STATUS_SIZE; + } else { + mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_1; +- right_shift = ((cpu - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); ++ right_shift = ((desc - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); + } + + if (bcp->uvhub_version == 1) +@@ -752,8 +876,7 @@ static void handle_cmplt(int completion_status, struct bau_desc *bau_desc, + * Returns 1 if it gives up entirely and the original cpu mask is to be + * returned to the kernel. + */ +-int uv_flush_send_and_wait(struct bau_desc *bau_desc, +- struct cpumask *flush_mask, struct bau_control *bcp) ++int uv_flush_send_and_wait(struct cpumask *flush_mask, struct bau_control *bcp) + { + int seq_number = 0; + int completion_stat = 0; +@@ -766,20 +889,24 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + struct bau_control *hmaster = bcp->uvhub_master; + struct uv1_bau_msg_header *uv1_hdr = NULL; + struct uv2_bau_msg_header *uv2_hdr = NULL; ++ struct bau_desc *bau_desc; + +- if (bcp->uvhub_version == 1) { +- uv1 = 1; ++ if (bcp->uvhub_version == 1) + uv1_throttle(hmaster, stat); +- uv1_hdr = &bau_desc->header.uv1_hdr; +- } else +- uv2_hdr = &bau_desc->header.uv2_hdr; + + while (hmaster->uvhub_quiesce) + cpu_relax(); + + time1 = get_cycles(); + do { +- if (try == 0) { ++ bau_desc = bcp->descriptor_base; ++ bau_desc += (ITEMS_PER_DESC * bcp->using_desc); ++ if (bcp->uvhub_version == 1) { ++ uv1 = 1; ++ uv1_hdr = &bau_desc->header.uv1_hdr; ++ } else ++ uv2_hdr = &bau_desc->header.uv2_hdr; ++ if ((try == 0) || (completion_stat == FLUSH_RETRY_BUSYBUG)) { + if (uv1) + uv1_hdr->msg_type = MSG_REGULAR; + else +@@ -797,13 +924,14 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + uv1_hdr->sequence = seq_number; + else + uv2_hdr->sequence = seq_number; +- index = (1UL << AS_PUSH_SHIFT) | bcp->uvhub_cpu; ++ index = (1UL << AS_PUSH_SHIFT) | bcp->using_desc; + bcp->send_message = get_cycles(); + + write_mmr_activation(index); + + try++; + completion_stat = wait_completion(bau_desc, bcp, try); ++ /* UV2: wait_completion() may change the bcp->using_desc */ + + handle_cmplt(completion_stat, bau_desc, bcp, hmaster, stat); + +@@ -814,6 +942,7 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + } + cpu_relax(); + } while ((completion_stat == FLUSH_RETRY_PLUGGED) || ++ (completion_stat == FLUSH_RETRY_BUSYBUG) || + (completion_stat == FLUSH_RETRY_TIMEOUT)); + + time2 = get_cycles(); +@@ -828,6 +957,7 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, + record_send_stats(time1, time2, bcp, stat, completion_stat, try); + + if (completion_stat == FLUSH_GIVEUP) ++ /* FLUSH_GIVEUP will fall back to using IPI's for tlb flush */ + return 1; + return 0; + } +@@ -983,7 +1113,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, + stat->s_ntargself++; + + bau_desc = bcp->descriptor_base; +- bau_desc += (ITEMS_PER_DESC * bcp->uvhub_cpu); ++ bau_desc += (ITEMS_PER_DESC * bcp->using_desc); + bau_uvhubs_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE); + if (set_distrib_bits(flush_mask, bcp, bau_desc, &locals, &remotes)) + return NULL; +@@ -996,13 +1126,86 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, + * uv_flush_send_and_wait returns 0 if all cpu's were messaged, + * or 1 if it gave up and the original cpumask should be returned. + */ +- if (!uv_flush_send_and_wait(bau_desc, flush_mask, bcp)) ++ if (!uv_flush_send_and_wait(flush_mask, bcp)) + return NULL; + else + return cpumask; + } + + /* ++ * Search the message queue for any 'other' message with the same software ++ * acknowledge resource bit vector. ++ */ ++struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg, ++ struct bau_control *bcp, unsigned char swack_vec) ++{ ++ struct bau_pq_entry *msg_next = msg + 1; ++ ++ if (msg_next > bcp->queue_last) ++ msg_next = bcp->queue_first; ++ while ((msg_next->swack_vec != 0) && (msg_next != msg)) { ++ if (msg_next->swack_vec == swack_vec) ++ return msg_next; ++ msg_next++; ++ if (msg_next > bcp->queue_last) ++ msg_next = bcp->queue_first; ++ } ++ return NULL; ++} ++ ++/* ++ * UV2 needs to work around a bug in which an arriving message has not ++ * set a bit in the UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE register. ++ * Such a message must be ignored. ++ */ ++void process_uv2_message(struct msg_desc *mdp, struct bau_control *bcp) ++{ ++ unsigned long mmr_image; ++ unsigned char swack_vec; ++ struct bau_pq_entry *msg = mdp->msg; ++ struct bau_pq_entry *other_msg; ++ ++ mmr_image = read_mmr_sw_ack(); ++ swack_vec = msg->swack_vec; ++ ++ if ((swack_vec & mmr_image) == 0) { ++ /* ++ * This message was assigned a swack resource, but no ++ * reserved acknowlegment is pending. ++ * The bug has prevented this message from setting the MMR. ++ * And no other message has used the same sw_ack resource. ++ * Do the requested shootdown but do not reply to the msg. ++ * (the 0 means make no acknowledge) ++ */ ++ bau_process_message(mdp, bcp, 0); ++ return; ++ } ++ ++ /* ++ * Some message has set the MMR 'pending' bit; it might have been ++ * another message. Look for that message. ++ */ ++ other_msg = find_another_by_swack(msg, bcp, msg->swack_vec); ++ if (other_msg) { ++ /* There is another. Do not ack the current one. */ ++ bau_process_message(mdp, bcp, 0); ++ /* ++ * Let the natural processing of that message acknowledge ++ * it. Don't get the processing of sw_ack's out of order. ++ */ ++ return; ++ } ++ ++ /* ++ * There is no other message using this sw_ack, so it is safe to ++ * acknowledge it. ++ */ ++ bau_process_message(mdp, bcp, 1); ++ ++ return; ++} ++ ++/* + * The BAU message interrupt comes here. (registered by set_intr_gate) + * See entry_64.S + * +@@ -1038,9 +1241,11 @@ void uv_bau_message_interrupt(struct pt_regs *regs) + count++; + + msgdesc.msg_slot = msg - msgdesc.queue_first; +- msgdesc.swack_slot = ffs(msg->swack_vec) - 1; + msgdesc.msg = msg; +- bau_process_message(&msgdesc, bcp); ++ if (bcp->uvhub_version == 2) ++ process_uv2_message(&msgdesc, bcp); ++ else ++ bau_process_message(&msgdesc, bcp, 1); + + msg++; + if (msg > msgdesc.queue_last) +@@ -1158,7 +1363,7 @@ static int ptc_seq_show(struct seq_file *file, void *data) + seq_printf(file, + "all one mult none retry canc nocan reset rcan "); + seq_printf(file, +- "disable enable\n"); ++ "disable enable wars warshw warwaits\n"); + } + if (cpu < num_possible_cpus() && cpu_online(cpu)) { + stat = &per_cpu(ptcstats, cpu); +@@ -1189,8 +1394,10 @@ static int ptc_seq_show(struct seq_file *file, void *data) + stat->d_nomsg, stat->d_retries, stat->d_canceled, + stat->d_nocanceled, stat->d_resets, + stat->d_rcanceled); +- seq_printf(file, "%ld %ld\n", +- stat->s_bau_disabled, stat->s_bau_reenabled); ++ seq_printf(file, "%ld %ld %ld %ld %ld\n", ++ stat->s_bau_disabled, stat->s_bau_reenabled, ++ stat->s_uv2_wars, stat->s_uv2_wars_hw, ++ stat->s_uv2_war_waits); + } + return 0; + } +@@ -1564,6 +1771,7 @@ static void pq_init(int node, int pnode) + write_mmr_payload_first(pnode, pn_first); + write_mmr_payload_tail(pnode, first); + write_mmr_payload_last(pnode, last); ++ write_gmmr_sw_ack(pnode, 0xffffUL); + + /* in effect, all msg_type's are set to MSG_NOOP */ + memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); +@@ -1651,6 +1859,7 @@ static void __init init_per_cpu_tunables(void) + bcp->cong_response_us = congested_respns_us; + bcp->cong_reps = congested_reps; + bcp->cong_period = congested_period; ++ bcp->clocks_per_100_usec = usec_2_cycles(100); + } + } + +@@ -1771,6 +1980,7 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp, + } + bcp->uvhub_master = *hmasterp; + bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->blade_processor_id; ++ bcp->using_desc = bcp->uvhub_cpu; + if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { + printk(KERN_EMERG "%d cpus per uvhub invalid\n", + bcp->uvhub_cpu); +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch new file mode 100644 index 00000000..bde74d7f --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch @@ -0,0 +1,61 @@ +From 28cfb4fe93728e07bee3b360682f3a4b2ca6f1f0 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Sat, 14 Jan 2012 15:08:34 +0100 +Subject: [PATCH 116/129] ath9k_hw: fix interpretation of the rx KeyMiss flag + +commit 7a532fe7131216a02c81a6c1b1f8632da1195a58 upstream. + +Documentation states that the KeyMiss flag is only valid if RxFrameOK is +unset, however empirical evidence has shown that this is false. +When KeyMiss is set (and RxFrameOK is 1), the hardware passes a valid frame +which has not been decrypted. The driver then falsely marks the frame +as decrypted, and when using CCMP this corrupts the rx CCMP PN, leading +to connection hangs. + +Signed-off-by: Felix Fietkau +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/ath/ath9k/ar9003_mac.c | 5 +++-- + drivers/net/wireless/ath/ath9k/mac.c | 5 +++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c +index ccde784..f5ae3c6 100644 +--- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c ++++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c +@@ -526,10 +526,11 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, + rxs->rs_status |= ATH9K_RXERR_DECRYPT; + else if (rxsp->status11 & AR_MichaelErr) + rxs->rs_status |= ATH9K_RXERR_MIC; +- if (rxsp->status11 & AR_KeyMiss) +- rxs->rs_status |= ATH9K_RXERR_KEYMISS; + } + ++ if (rxsp->status11 & AR_KeyMiss) ++ rxs->rs_status |= ATH9K_RXERR_KEYMISS; ++ + return 0; + } + EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); +diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c +index ecdb6fd..bbcb777 100644 +--- a/drivers/net/wireless/ath/ath9k/mac.c ++++ b/drivers/net/wireless/ath/ath9k/mac.c +@@ -621,10 +621,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds, + rs->rs_status |= ATH9K_RXERR_DECRYPT; + else if (ads.ds_rxstatus8 & AR_MichaelErr) + rs->rs_status |= ATH9K_RXERR_MIC; +- if (ads.ds_rxstatus8 & AR_KeyMiss) +- rs->rs_status |= ATH9K_RXERR_KEYMISS; + } + ++ if (ads.ds_rxstatus8 & AR_KeyMiss) ++ rs->rs_status |= ATH9K_RXERR_KEYMISS; ++ + return 0; + } + EXPORT_SYMBOL(ath9k_hw_rxprocdesc); +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-x86-UV2-Work-around-BAU-bug.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-x86-UV2-Work-around-BAU-bug.patch deleted file mode 100644 index 387d19e3..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0116-x86-UV2-Work-around-BAU-bug.patch +++ /dev/null @@ -1,570 +0,0 @@ -From 67963c536b1b1f4304913ad0d1b32821510f690d Mon Sep 17 00:00:00 2001 -From: Cliff Wickman -Date: Mon, 16 Jan 2012 15:19:47 -0600 -Subject: [PATCH 116/130] x86/UV2: Work around BAU bug - -commit c5d35d399e685acccc85a675e8765c26b2a9813a upstream. - -This patch implements a workaround for a UV2 hardware bug. -The bug is a non-atomic update of a memory-mapped register. When -hardware message delivery and software message acknowledge occur -simultaneously the pending message acknowledge for the arriving -message may be lost. This causes the sender's message status to -stay busy. - -Part of the workaround is to not acknowledge a completed message -until it is verified that no other message is actually using the -resource that is mistakenly recorded in the completed message. - -Part of the workaround is to test for long elapsed time in such -a busy condition, then handle it by using a spare sending -descriptor. The stay-busy condition is eventually timed out by -hardware, and then the original sending descriptor can be -re-used. Most of that logic change is in keeping track of the -current descriptor and the state of the spares. - -The occurrences of the workaround are added to the BAU -statistics. - -Signed-off-by: Cliff Wickman -Link: http://lkml.kernel.org/r/20120116211947.GC5767@sgi.com -Signed-off-by: Ingo Molnar -Signed-off-by: Greg Kroah-Hartman ---- - arch/x86/include/asm/uv/uv_bau.h | 13 +- - arch/x86/platform/uv/tlb_uv.c | 274 +++++++++++++++++++++++++++++++++----- - 2 files changed, 254 insertions(+), 33 deletions(-) - -diff --git a/arch/x86/include/asm/uv/uv_bau.h b/arch/x86/include/asm/uv/uv_bau.h -index 4a46b27..1b82f7e 100644 ---- a/arch/x86/include/asm/uv/uv_bau.h -+++ b/arch/x86/include/asm/uv/uv_bau.h -@@ -167,6 +167,7 @@ - #define FLUSH_RETRY_TIMEOUT 2 - #define FLUSH_GIVEUP 3 - #define FLUSH_COMPLETE 4 -+#define FLUSH_RETRY_BUSYBUG 5 - - /* - * tuning the action when the numalink network is extremely delayed -@@ -463,7 +464,6 @@ struct bau_pq_entry { - struct msg_desc { - struct bau_pq_entry *msg; - int msg_slot; -- int swack_slot; - struct bau_pq_entry *queue_first; - struct bau_pq_entry *queue_last; - }; -@@ -517,6 +517,9 @@ struct ptc_stats { - unsigned long s_retry_messages; /* retry broadcasts */ - unsigned long s_bau_reenabled; /* for bau enable/disable */ - unsigned long s_bau_disabled; /* for bau enable/disable */ -+ unsigned long s_uv2_wars; /* uv2 workaround, perm. busy */ -+ unsigned long s_uv2_wars_hw; /* uv2 workaround, hiwater */ -+ unsigned long s_uv2_war_waits; /* uv2 workaround, long waits */ - /* destination statistics */ - unsigned long d_alltlb; /* times all tlb's on this - cpu were flushed */ -@@ -593,6 +596,8 @@ struct bau_control { - short cpus_in_socket; - short cpus_in_uvhub; - short partition_base_pnode; -+ short using_desc; /* an index, like uvhub_cpu */ -+ unsigned int inuse_map; - unsigned short message_number; - unsigned short uvhub_quiesce; - short socket_acknowledge_count[DEST_Q_SIZE]; -@@ -610,6 +615,7 @@ struct bau_control { - int cong_response_us; - int cong_reps; - int cong_period; -+ unsigned long clocks_per_100_usec; - cycles_t period_time; - long period_requests; - struct hub_and_pnode *thp; -@@ -670,6 +676,11 @@ static inline void write_mmr_sw_ack(unsigned long mr) - uv_write_local_mmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr); - } - -+static inline void write_gmmr_sw_ack(int pnode, unsigned long mr) -+{ -+ write_gmmr(pnode, UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE_ALIAS, mr); -+} -+ - static inline unsigned long read_mmr_sw_ack(void) - { - return read_lmmr(UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE); -diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c -index c425ff1..9010ca7 100644 ---- a/arch/x86/platform/uv/tlb_uv.c -+++ b/arch/x86/platform/uv/tlb_uv.c -@@ -157,13 +157,14 @@ static int __init uvhub_to_first_apicid(int uvhub) - * clear of the Timeout bit (as well) will free the resource. No reply will - * be sent (the hardware will only do one reply per message). - */ --static void reply_to_message(struct msg_desc *mdp, struct bau_control *bcp) -+static void reply_to_message(struct msg_desc *mdp, struct bau_control *bcp, -+ int do_acknowledge) - { - unsigned long dw; - struct bau_pq_entry *msg; - - msg = mdp->msg; -- if (!msg->canceled) { -+ if (!msg->canceled && do_acknowledge) { - dw = (msg->swack_vec << UV_SW_ACK_NPENDING) | msg->swack_vec; - write_mmr_sw_ack(dw); - } -@@ -212,8 +213,8 @@ static void bau_process_retry_msg(struct msg_desc *mdp, - if (mmr & (msg_res << UV_SW_ACK_NPENDING)) { - unsigned long mr; - /* -- * is the resource timed out? -- * make everyone ignore the cancelled message. -+ * Is the resource timed out? -+ * Make everyone ignore the cancelled message. - */ - msg2->canceled = 1; - stat->d_canceled++; -@@ -231,8 +232,8 @@ static void bau_process_retry_msg(struct msg_desc *mdp, - * Do all the things a cpu should do for a TLB shootdown message. - * Other cpu's may come here at the same time for this message. - */ --static void bau_process_message(struct msg_desc *mdp, -- struct bau_control *bcp) -+static void bau_process_message(struct msg_desc *mdp, struct bau_control *bcp, -+ int do_acknowledge) - { - short socket_ack_count = 0; - short *sp; -@@ -284,8 +285,9 @@ static void bau_process_message(struct msg_desc *mdp, - if (msg_ack_count == bcp->cpus_in_uvhub) { - /* - * All cpus in uvhub saw it; reply -+ * (unless we are in the UV2 workaround) - */ -- reply_to_message(mdp, bcp); -+ reply_to_message(mdp, bcp, do_acknowledge); - } - } - -@@ -491,27 +493,138 @@ static int uv1_wait_completion(struct bau_desc *bau_desc, - /* - * UV2 has an extra bit of status in the ACTIVATION_STATUS_2 register. - */ --static unsigned long uv2_read_status(unsigned long offset, int rshft, int cpu) -+static unsigned long uv2_read_status(unsigned long offset, int rshft, int desc) - { - unsigned long descriptor_status; - unsigned long descriptor_status2; - - descriptor_status = ((read_lmmr(offset) >> rshft) & UV_ACT_STATUS_MASK); -- descriptor_status2 = (read_mmr_uv2_status() >> cpu) & 0x1UL; -+ descriptor_status2 = (read_mmr_uv2_status() >> desc) & 0x1UL; - descriptor_status = (descriptor_status << 1) | descriptor_status2; - return descriptor_status; - } - -+/* -+ * Return whether the status of the descriptor that is normally used for this -+ * cpu (the one indexed by its hub-relative cpu number) is busy. -+ * The status of the original 32 descriptors is always reflected in the 64 -+ * bits of UVH_LB_BAU_SB_ACTIVATION_STATUS_0. -+ * The bit provided by the activation_status_2 register is irrelevant to -+ * the status if it is only being tested for busy or not busy. -+ */ -+int normal_busy(struct bau_control *bcp) -+{ -+ int cpu = bcp->uvhub_cpu; -+ int mmr_offset; -+ int right_shift; -+ -+ mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_0; -+ right_shift = cpu * UV_ACT_STATUS_SIZE; -+ return (((((read_lmmr(mmr_offset) >> right_shift) & -+ UV_ACT_STATUS_MASK)) << 1) == UV2H_DESC_BUSY); -+} -+ -+/* -+ * Entered when a bau descriptor has gone into a permanent busy wait because -+ * of a hardware bug. -+ * Workaround the bug. -+ */ -+int handle_uv2_busy(struct bau_control *bcp) -+{ -+ int busy_one = bcp->using_desc; -+ int normal = bcp->uvhub_cpu; -+ int selected = -1; -+ int i; -+ unsigned long descriptor_status; -+ unsigned long status; -+ int mmr_offset; -+ struct bau_desc *bau_desc_old; -+ struct bau_desc *bau_desc_new; -+ struct bau_control *hmaster = bcp->uvhub_master; -+ struct ptc_stats *stat = bcp->statp; -+ cycles_t ttm; -+ -+ stat->s_uv2_wars++; -+ spin_lock(&hmaster->uvhub_lock); -+ /* try for the original first */ -+ if (busy_one != normal) { -+ if (!normal_busy(bcp)) -+ selected = normal; -+ } -+ if (selected < 0) { -+ /* can't use the normal, select an alternate */ -+ mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_1; -+ descriptor_status = read_lmmr(mmr_offset); -+ -+ /* scan available descriptors 32-63 */ -+ for (i = 0; i < UV_CPUS_PER_AS; i++) { -+ if ((hmaster->inuse_map & (1 << i)) == 0) { -+ status = ((descriptor_status >> -+ (i * UV_ACT_STATUS_SIZE)) & -+ UV_ACT_STATUS_MASK) << 1; -+ if (status != UV2H_DESC_BUSY) { -+ selected = i + UV_CPUS_PER_AS; -+ break; -+ } -+ } -+ } -+ } -+ -+ if (busy_one != normal) -+ /* mark the busy alternate as not in-use */ -+ hmaster->inuse_map &= ~(1 << (busy_one - UV_CPUS_PER_AS)); -+ -+ if (selected >= 0) { -+ /* switch to the selected descriptor */ -+ if (selected != normal) { -+ /* set the selected alternate as in-use */ -+ hmaster->inuse_map |= -+ (1 << (selected - UV_CPUS_PER_AS)); -+ if (selected > stat->s_uv2_wars_hw) -+ stat->s_uv2_wars_hw = selected; -+ } -+ bau_desc_old = bcp->descriptor_base; -+ bau_desc_old += (ITEMS_PER_DESC * busy_one); -+ bcp->using_desc = selected; -+ bau_desc_new = bcp->descriptor_base; -+ bau_desc_new += (ITEMS_PER_DESC * selected); -+ *bau_desc_new = *bau_desc_old; -+ } else { -+ /* -+ * All are busy. Wait for the normal one for this cpu to -+ * free up. -+ */ -+ stat->s_uv2_war_waits++; -+ spin_unlock(&hmaster->uvhub_lock); -+ ttm = get_cycles(); -+ do { -+ cpu_relax(); -+ } while (normal_busy(bcp)); -+ spin_lock(&hmaster->uvhub_lock); -+ /* switch to the original descriptor */ -+ bcp->using_desc = normal; -+ bau_desc_old = bcp->descriptor_base; -+ bau_desc_old += (ITEMS_PER_DESC * bcp->using_desc); -+ bcp->using_desc = (ITEMS_PER_DESC * normal); -+ bau_desc_new = bcp->descriptor_base; -+ bau_desc_new += (ITEMS_PER_DESC * normal); -+ *bau_desc_new = *bau_desc_old; /* copy the entire descriptor */ -+ } -+ spin_unlock(&hmaster->uvhub_lock); -+ return FLUSH_RETRY_BUSYBUG; -+} -+ - static int uv2_wait_completion(struct bau_desc *bau_desc, - unsigned long mmr_offset, int right_shift, - struct bau_control *bcp, long try) - { - unsigned long descriptor_stat; - cycles_t ttm; -- int cpu = bcp->uvhub_cpu; -+ int desc = bcp->using_desc; -+ long busy_reps = 0; - struct ptc_stats *stat = bcp->statp; - -- descriptor_stat = uv2_read_status(mmr_offset, right_shift, cpu); -+ descriptor_stat = uv2_read_status(mmr_offset, right_shift, desc); - - /* spin on the status MMR, waiting for it to go idle */ - while (descriptor_stat != UV2H_DESC_IDLE) { -@@ -542,12 +655,23 @@ static int uv2_wait_completion(struct bau_desc *bau_desc, - bcp->conseccompletes = 0; - return FLUSH_RETRY_TIMEOUT; - } else { -+ busy_reps++; -+ if (busy_reps > 1000000) { -+ /* not to hammer on the clock */ -+ busy_reps = 0; -+ ttm = get_cycles(); -+ if ((ttm - bcp->send_message) > -+ (bcp->clocks_per_100_usec)) { -+ return handle_uv2_busy(bcp); -+ } -+ } - /* - * descriptor_stat is still BUSY - */ - cpu_relax(); - } -- descriptor_stat = uv2_read_status(mmr_offset, right_shift, cpu); -+ descriptor_stat = uv2_read_status(mmr_offset, right_shift, -+ desc); - } - bcp->conseccompletes++; - return FLUSH_COMPLETE; -@@ -563,14 +687,14 @@ static int wait_completion(struct bau_desc *bau_desc, - { - int right_shift; - unsigned long mmr_offset; -- int cpu = bcp->uvhub_cpu; -+ int desc = bcp->using_desc; - -- if (cpu < UV_CPUS_PER_AS) { -+ if (desc < UV_CPUS_PER_AS) { - mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_0; -- right_shift = cpu * UV_ACT_STATUS_SIZE; -+ right_shift = desc * UV_ACT_STATUS_SIZE; - } else { - mmr_offset = UVH_LB_BAU_SB_ACTIVATION_STATUS_1; -- right_shift = ((cpu - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); -+ right_shift = ((desc - UV_CPUS_PER_AS) * UV_ACT_STATUS_SIZE); - } - - if (bcp->uvhub_version == 1) -@@ -752,8 +876,7 @@ static void handle_cmplt(int completion_status, struct bau_desc *bau_desc, - * Returns 1 if it gives up entirely and the original cpu mask is to be - * returned to the kernel. - */ --int uv_flush_send_and_wait(struct bau_desc *bau_desc, -- struct cpumask *flush_mask, struct bau_control *bcp) -+int uv_flush_send_and_wait(struct cpumask *flush_mask, struct bau_control *bcp) - { - int seq_number = 0; - int completion_stat = 0; -@@ -766,20 +889,24 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - struct bau_control *hmaster = bcp->uvhub_master; - struct uv1_bau_msg_header *uv1_hdr = NULL; - struct uv2_bau_msg_header *uv2_hdr = NULL; -+ struct bau_desc *bau_desc; - -- if (bcp->uvhub_version == 1) { -- uv1 = 1; -+ if (bcp->uvhub_version == 1) - uv1_throttle(hmaster, stat); -- uv1_hdr = &bau_desc->header.uv1_hdr; -- } else -- uv2_hdr = &bau_desc->header.uv2_hdr; - - while (hmaster->uvhub_quiesce) - cpu_relax(); - - time1 = get_cycles(); - do { -- if (try == 0) { -+ bau_desc = bcp->descriptor_base; -+ bau_desc += (ITEMS_PER_DESC * bcp->using_desc); -+ if (bcp->uvhub_version == 1) { -+ uv1 = 1; -+ uv1_hdr = &bau_desc->header.uv1_hdr; -+ } else -+ uv2_hdr = &bau_desc->header.uv2_hdr; -+ if ((try == 0) || (completion_stat == FLUSH_RETRY_BUSYBUG)) { - if (uv1) - uv1_hdr->msg_type = MSG_REGULAR; - else -@@ -797,13 +924,14 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - uv1_hdr->sequence = seq_number; - else - uv2_hdr->sequence = seq_number; -- index = (1UL << AS_PUSH_SHIFT) | bcp->uvhub_cpu; -+ index = (1UL << AS_PUSH_SHIFT) | bcp->using_desc; - bcp->send_message = get_cycles(); - - write_mmr_activation(index); - - try++; - completion_stat = wait_completion(bau_desc, bcp, try); -+ /* UV2: wait_completion() may change the bcp->using_desc */ - - handle_cmplt(completion_stat, bau_desc, bcp, hmaster, stat); - -@@ -814,6 +942,7 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - } - cpu_relax(); - } while ((completion_stat == FLUSH_RETRY_PLUGGED) || -+ (completion_stat == FLUSH_RETRY_BUSYBUG) || - (completion_stat == FLUSH_RETRY_TIMEOUT)); - - time2 = get_cycles(); -@@ -828,6 +957,7 @@ int uv_flush_send_and_wait(struct bau_desc *bau_desc, - record_send_stats(time1, time2, bcp, stat, completion_stat, try); - - if (completion_stat == FLUSH_GIVEUP) -+ /* FLUSH_GIVEUP will fall back to using IPI's for tlb flush */ - return 1; - return 0; - } -@@ -983,7 +1113,7 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, - stat->s_ntargself++; - - bau_desc = bcp->descriptor_base; -- bau_desc += (ITEMS_PER_DESC * bcp->uvhub_cpu); -+ bau_desc += (ITEMS_PER_DESC * bcp->using_desc); - bau_uvhubs_clear(&bau_desc->distribution, UV_DISTRIBUTION_SIZE); - if (set_distrib_bits(flush_mask, bcp, bau_desc, &locals, &remotes)) - return NULL; -@@ -996,13 +1126,86 @@ const struct cpumask *uv_flush_tlb_others(const struct cpumask *cpumask, - * uv_flush_send_and_wait returns 0 if all cpu's were messaged, - * or 1 if it gave up and the original cpumask should be returned. - */ -- if (!uv_flush_send_and_wait(bau_desc, flush_mask, bcp)) -+ if (!uv_flush_send_and_wait(flush_mask, bcp)) - return NULL; - else - return cpumask; - } - - /* -+ * Search the message queue for any 'other' message with the same software -+ * acknowledge resource bit vector. -+ */ -+struct bau_pq_entry *find_another_by_swack(struct bau_pq_entry *msg, -+ struct bau_control *bcp, unsigned char swack_vec) -+{ -+ struct bau_pq_entry *msg_next = msg + 1; -+ -+ if (msg_next > bcp->queue_last) -+ msg_next = bcp->queue_first; -+ while ((msg_next->swack_vec != 0) && (msg_next != msg)) { -+ if (msg_next->swack_vec == swack_vec) -+ return msg_next; -+ msg_next++; -+ if (msg_next > bcp->queue_last) -+ msg_next = bcp->queue_first; -+ } -+ return NULL; -+} -+ -+/* -+ * UV2 needs to work around a bug in which an arriving message has not -+ * set a bit in the UVH_LB_BAU_INTD_SOFTWARE_ACKNOWLEDGE register. -+ * Such a message must be ignored. -+ */ -+void process_uv2_message(struct msg_desc *mdp, struct bau_control *bcp) -+{ -+ unsigned long mmr_image; -+ unsigned char swack_vec; -+ struct bau_pq_entry *msg = mdp->msg; -+ struct bau_pq_entry *other_msg; -+ -+ mmr_image = read_mmr_sw_ack(); -+ swack_vec = msg->swack_vec; -+ -+ if ((swack_vec & mmr_image) == 0) { -+ /* -+ * This message was assigned a swack resource, but no -+ * reserved acknowlegment is pending. -+ * The bug has prevented this message from setting the MMR. -+ * And no other message has used the same sw_ack resource. -+ * Do the requested shootdown but do not reply to the msg. -+ * (the 0 means make no acknowledge) -+ */ -+ bau_process_message(mdp, bcp, 0); -+ return; -+ } -+ -+ /* -+ * Some message has set the MMR 'pending' bit; it might have been -+ * another message. Look for that message. -+ */ -+ other_msg = find_another_by_swack(msg, bcp, msg->swack_vec); -+ if (other_msg) { -+ /* There is another. Do not ack the current one. */ -+ bau_process_message(mdp, bcp, 0); -+ /* -+ * Let the natural processing of that message acknowledge -+ * it. Don't get the processing of sw_ack's out of order. -+ */ -+ return; -+ } -+ -+ /* -+ * There is no other message using this sw_ack, so it is safe to -+ * acknowledge it. -+ */ -+ bau_process_message(mdp, bcp, 1); -+ -+ return; -+} -+ -+/* - * The BAU message interrupt comes here. (registered by set_intr_gate) - * See entry_64.S - * -@@ -1038,9 +1241,11 @@ void uv_bau_message_interrupt(struct pt_regs *regs) - count++; - - msgdesc.msg_slot = msg - msgdesc.queue_first; -- msgdesc.swack_slot = ffs(msg->swack_vec) - 1; - msgdesc.msg = msg; -- bau_process_message(&msgdesc, bcp); -+ if (bcp->uvhub_version == 2) -+ process_uv2_message(&msgdesc, bcp); -+ else -+ bau_process_message(&msgdesc, bcp, 1); - - msg++; - if (msg > msgdesc.queue_last) -@@ -1158,7 +1363,7 @@ static int ptc_seq_show(struct seq_file *file, void *data) - seq_printf(file, - "all one mult none retry canc nocan reset rcan "); - seq_printf(file, -- "disable enable\n"); -+ "disable enable wars warshw warwaits\n"); - } - if (cpu < num_possible_cpus() && cpu_online(cpu)) { - stat = &per_cpu(ptcstats, cpu); -@@ -1189,8 +1394,10 @@ static int ptc_seq_show(struct seq_file *file, void *data) - stat->d_nomsg, stat->d_retries, stat->d_canceled, - stat->d_nocanceled, stat->d_resets, - stat->d_rcanceled); -- seq_printf(file, "%ld %ld\n", -- stat->s_bau_disabled, stat->s_bau_reenabled); -+ seq_printf(file, "%ld %ld %ld %ld %ld\n", -+ stat->s_bau_disabled, stat->s_bau_reenabled, -+ stat->s_uv2_wars, stat->s_uv2_wars_hw, -+ stat->s_uv2_war_waits); - } - return 0; - } -@@ -1564,6 +1771,7 @@ static void pq_init(int node, int pnode) - write_mmr_payload_first(pnode, pn_first); - write_mmr_payload_tail(pnode, first); - write_mmr_payload_last(pnode, last); -+ write_gmmr_sw_ack(pnode, 0xffffUL); - - /* in effect, all msg_type's are set to MSG_NOOP */ - memset(pqp, 0, sizeof(struct bau_pq_entry) * DEST_Q_SIZE); -@@ -1651,6 +1859,7 @@ static void __init init_per_cpu_tunables(void) - bcp->cong_response_us = congested_respns_us; - bcp->cong_reps = congested_reps; - bcp->cong_period = congested_period; -+ bcp->clocks_per_100_usec = usec_2_cycles(100); - } - } - -@@ -1771,6 +1980,7 @@ static int scan_sock(struct socket_desc *sdp, struct uvhub_desc *bdp, - } - bcp->uvhub_master = *hmasterp; - bcp->uvhub_cpu = uv_cpu_hub_info(cpu)->blade_processor_id; -+ bcp->using_desc = bcp->uvhub_cpu; - if (bcp->uvhub_cpu >= MAX_CPUS_PER_UVHUB) { - printk(KERN_EMERG "%d cpus per uvhub invalid\n", - bcp->uvhub_cpu); --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch deleted file mode 100644 index b89b863e..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-ath9k_hw-fix-interpretation-of-the-rx-KeyMiss-flag.patch +++ /dev/null @@ -1,61 +0,0 @@ -From 414c945630702378c3477085517e8c24e2eb3a57 Mon Sep 17 00:00:00 2001 -From: Felix Fietkau -Date: Sat, 14 Jan 2012 15:08:34 +0100 -Subject: [PATCH 117/130] ath9k_hw: fix interpretation of the rx KeyMiss flag - -commit 7a532fe7131216a02c81a6c1b1f8632da1195a58 upstream. - -Documentation states that the KeyMiss flag is only valid if RxFrameOK is -unset, however empirical evidence has shown that this is false. -When KeyMiss is set (and RxFrameOK is 1), the hardware passes a valid frame -which has not been decrypted. The driver then falsely marks the frame -as decrypted, and when using CCMP this corrupts the rx CCMP PN, leading -to connection hangs. - -Signed-off-by: Felix Fietkau -Signed-off-by: John W. Linville -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/wireless/ath/ath9k/ar9003_mac.c | 5 +++-- - drivers/net/wireless/ath/ath9k/mac.c | 5 +++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/drivers/net/wireless/ath/ath9k/ar9003_mac.c b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -index ccde784..f5ae3c6 100644 ---- a/drivers/net/wireless/ath/ath9k/ar9003_mac.c -+++ b/drivers/net/wireless/ath/ath9k/ar9003_mac.c -@@ -526,10 +526,11 @@ int ath9k_hw_process_rxdesc_edma(struct ath_hw *ah, struct ath_rx_status *rxs, - rxs->rs_status |= ATH9K_RXERR_DECRYPT; - else if (rxsp->status11 & AR_MichaelErr) - rxs->rs_status |= ATH9K_RXERR_MIC; -- if (rxsp->status11 & AR_KeyMiss) -- rxs->rs_status |= ATH9K_RXERR_KEYMISS; - } - -+ if (rxsp->status11 & AR_KeyMiss) -+ rxs->rs_status |= ATH9K_RXERR_KEYMISS; -+ - return 0; - } - EXPORT_SYMBOL(ath9k_hw_process_rxdesc_edma); -diff --git a/drivers/net/wireless/ath/ath9k/mac.c b/drivers/net/wireless/ath/ath9k/mac.c -index ecdb6fd..bbcb777 100644 ---- a/drivers/net/wireless/ath/ath9k/mac.c -+++ b/drivers/net/wireless/ath/ath9k/mac.c -@@ -621,10 +621,11 @@ int ath9k_hw_rxprocdesc(struct ath_hw *ah, struct ath_desc *ds, - rs->rs_status |= ATH9K_RXERR_DECRYPT; - else if (ads.ds_rxstatus8 & AR_MichaelErr) - rs->rs_status |= ATH9K_RXERR_MIC; -- if (ads.ds_rxstatus8 & AR_KeyMiss) -- rs->rs_status |= ATH9K_RXERR_KEYMISS; - } - -+ if (ads.ds_rxstatus8 & AR_KeyMiss) -+ rs->rs_status |= ATH9K_RXERR_KEYMISS; -+ - return 0; - } - EXPORT_SYMBOL(ath9k_hw_rxprocdesc); --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-rt2800pci-fix-spurious-interrupts-generation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-rt2800pci-fix-spurious-interrupts-generation.patch new file mode 100644 index 00000000..2911cede --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0117-rt2800pci-fix-spurious-interrupts-generation.patch @@ -0,0 +1,86 @@ +From 021083c5844b20210ced59ad5b760d2a7cb97cd2 Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Fri, 13 Jan 2012 12:59:32 +0100 +Subject: [PATCH 117/129] rt2800pci: fix spurious interrupts generation + +commit dfd00c4c8f3dfa1fd7cec45f83d98b2a49743dcd upstream. + +Same devices can generate interrupt without properly setting bit in +INT_SOURCE_CSR register (spurious interrupt), what will cause IRQ line +will be disabled by interrupts controller driver. + +We discovered that clearing INT_MASK_CSR stops such behaviour. We +previously first read that register, and then clear all know interrupt +sources bits and do not touch reserved bits. After this patch, we write +to all register content (I believe writing to reserved bits on that +register will not cause any problems, I tested that on my rt2800pci +device). + +This fix very bad performance problem, practically making device +unusable (since worked without interrupts), reported in: +https://bugzilla.redhat.com/show_bug.cgi?id=658451 + +We previously tried to workaround that issue in commit +4ba7d9997869d25bd223dea7536fc1ce9fab3b3b "rt2800pci: handle spurious +interrupts", but it was reverted in commit +82e5fc2a34fa9ffea38f00c4066b7e600a0ca5e6 +as thing, that will prevent to detect real spurious interrupts. + +Reported-and-tested-by: Amir Hedayaty +Signed-off-by: Stanislaw Gruszka +Acked-by: Gertjan van Wingerde +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/rt2x00/rt2800pci.c | 28 ++++++++-------------------- + 1 file changed, 8 insertions(+), 20 deletions(-) + +diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c +index da48c8a..837b460 100644 +--- a/drivers/net/wireless/rt2x00/rt2800pci.c ++++ b/drivers/net/wireless/rt2x00/rt2800pci.c +@@ -422,7 +422,6 @@ static int rt2800pci_init_queues(struct rt2x00_dev *rt2x00dev) + static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, + enum dev_state state) + { +- int mask = (state == STATE_RADIO_IRQ_ON); + u32 reg; + unsigned long flags; + +@@ -436,25 +435,14 @@ static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, + } + + spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); +- rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); +- rt2x00_set_field32(®, INT_MASK_CSR_RXDELAYINT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TXDELAYINT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_AC0_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC1_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC2_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_AC3_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_HCCA_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_MGMT_DMA_DONE, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_MCU_COMMAND, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RXTX_COHERENT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TBTT, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, mask); +- rt2x00_set_field32(®, INT_MASK_CSR_GPTIMER, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_RX_COHERENT, 0); +- rt2x00_set_field32(®, INT_MASK_CSR_TX_COHERENT, 0); ++ reg = 0; ++ if (state == STATE_RADIO_IRQ_ON) { ++ rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_TBTT, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, 1); ++ rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, 1); ++ } + rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); + spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); + +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-rt2800pci-fix-spurious-interrupts-generation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-rt2800pci-fix-spurious-interrupts-generation.patch deleted file mode 100644 index 526265b9..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-rt2800pci-fix-spurious-interrupts-generation.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 5feb9896b1fbfcb0ccd73789f3deeef7a53e19c4 Mon Sep 17 00:00:00 2001 -From: Stanislaw Gruszka -Date: Fri, 13 Jan 2012 12:59:32 +0100 -Subject: [PATCH 118/130] rt2800pci: fix spurious interrupts generation - -commit dfd00c4c8f3dfa1fd7cec45f83d98b2a49743dcd upstream. - -Same devices can generate interrupt without properly setting bit in -INT_SOURCE_CSR register (spurious interrupt), what will cause IRQ line -will be disabled by interrupts controller driver. - -We discovered that clearing INT_MASK_CSR stops such behaviour. We -previously first read that register, and then clear all know interrupt -sources bits and do not touch reserved bits. After this patch, we write -to all register content (I believe writing to reserved bits on that -register will not cause any problems, I tested that on my rt2800pci -device). - -This fix very bad performance problem, practically making device -unusable (since worked without interrupts), reported in: -https://bugzilla.redhat.com/show_bug.cgi?id=658451 - -We previously tried to workaround that issue in commit -4ba7d9997869d25bd223dea7536fc1ce9fab3b3b "rt2800pci: handle spurious -interrupts", but it was reverted in commit -82e5fc2a34fa9ffea38f00c4066b7e600a0ca5e6 -as thing, that will prevent to detect real spurious interrupts. - -Reported-and-tested-by: Amir Hedayaty -Signed-off-by: Stanislaw Gruszka -Acked-by: Gertjan van Wingerde -Signed-off-by: John W. Linville -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/wireless/rt2x00/rt2800pci.c | 28 ++++++++-------------------- - 1 file changed, 8 insertions(+), 20 deletions(-) - -diff --git a/drivers/net/wireless/rt2x00/rt2800pci.c b/drivers/net/wireless/rt2x00/rt2800pci.c -index da48c8a..837b460 100644 ---- a/drivers/net/wireless/rt2x00/rt2800pci.c -+++ b/drivers/net/wireless/rt2x00/rt2800pci.c -@@ -422,7 +422,6 @@ static int rt2800pci_init_queues(struct rt2x00_dev *rt2x00dev) - static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, - enum dev_state state) - { -- int mask = (state == STATE_RADIO_IRQ_ON); - u32 reg; - unsigned long flags; - -@@ -436,25 +435,14 @@ static void rt2800pci_toggle_irq(struct rt2x00_dev *rt2x00dev, - } - - spin_lock_irqsave(&rt2x00dev->irqmask_lock, flags); -- rt2x00pci_register_read(rt2x00dev, INT_MASK_CSR, ®); -- rt2x00_set_field32(®, INT_MASK_CSR_RXDELAYINT, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_TXDELAYINT, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, mask); -- rt2x00_set_field32(®, INT_MASK_CSR_AC0_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_AC1_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_AC2_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_AC3_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_HCCA_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_MGMT_DMA_DONE, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_MCU_COMMAND, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_RXTX_COHERENT, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_TBTT, mask); -- rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, mask); -- rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, mask); -- rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, mask); -- rt2x00_set_field32(®, INT_MASK_CSR_GPTIMER, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_RX_COHERENT, 0); -- rt2x00_set_field32(®, INT_MASK_CSR_TX_COHERENT, 0); -+ reg = 0; -+ if (state == STATE_RADIO_IRQ_ON) { -+ rt2x00_set_field32(®, INT_MASK_CSR_RX_DONE, 1); -+ rt2x00_set_field32(®, INT_MASK_CSR_TBTT, 1); -+ rt2x00_set_field32(®, INT_MASK_CSR_PRE_TBTT, 1); -+ rt2x00_set_field32(®, INT_MASK_CSR_TX_FIFO_STATUS, 1); -+ rt2x00_set_field32(®, INT_MASK_CSR_AUTO_WAKEUP, 1); -+ } - rt2x00pci_register_write(rt2x00dev, INT_MASK_CSR, reg); - spin_unlock_irqrestore(&rt2x00dev->irqmask_lock, flags); - --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-xfs-fix-endian-conversion-issue-in-discard-code.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-xfs-fix-endian-conversion-issue-in-discard-code.patch new file mode 100644 index 00000000..fda910b7 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0118-xfs-fix-endian-conversion-issue-in-discard-code.patch @@ -0,0 +1,45 @@ +From 40713843ccb84ed06d4799763c3832376d6cd5cb Mon Sep 17 00:00:00 2001 +From: Dave Chinner +Date: Wed, 18 Jan 2012 14:41:45 -0600 +Subject: [PATCH 118/129] xfs: fix endian conversion issue in discard code + +commit b1c770c273a4787069306fc82aab245e9ac72e9d upstream + +When finding the longest extent in an AG, we read the value directly +out of the AGF buffer without endian conversion. This will give an +incorrect length, resulting in FITRIM operations potentially not +trimming everything that it should. + +Signed-off-by: Dave Chinner +Reviewed-by: Christoph Hellwig +Signed-off-by: Ben Myers +Signed-off-by: Greg Kroah-Hartman +--- + fs/xfs/xfs_discard.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c +index 8a24f0c..286a051 100644 +--- a/fs/xfs/xfs_discard.c ++++ b/fs/xfs/xfs_discard.c +@@ -68,7 +68,7 @@ xfs_trim_extents( + * Look up the longest btree in the AGF and start with it. + */ + error = xfs_alloc_lookup_le(cur, 0, +- XFS_BUF_TO_AGF(agbp)->agf_longest, &i); ++ be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest), &i); + if (error) + goto out_del_cursor; + +@@ -84,7 +84,7 @@ xfs_trim_extents( + if (error) + goto out_del_cursor; + XFS_WANT_CORRUPTED_GOTO(i == 1, out_del_cursor); +- ASSERT(flen <= XFS_BUF_TO_AGF(agbp)->agf_longest); ++ ASSERT(flen <= be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest)); + + /* + * Too small? Give up. +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-i2c-eg20t-modified-the-setting-of-transfer-rate.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-i2c-eg20t-modified-the-setting-of-transfer-rate.patch new file mode 100644 index 00000000..839253c1 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-i2c-eg20t-modified-the-setting-of-transfer-rate.patch @@ -0,0 +1,33 @@ +From 072d0e473d1a1d4adc67a7d39be9f71fea4fadad Mon Sep 17 00:00:00 2001 +From: Toshiharu Okada +Date: Mon, 26 Sep 2011 16:16:23 +0900 +Subject: [PATCH 119/129] i2c-eg20t: modified the setting of transfer rate. + +commit ff35e8b18984ad2a82cbd259fc07f0be4b34b1aa upstream. + +This patch modified the setting value of +I2C Bus Transfer Rate Setting Counter regisrer. + +Signed-off-by: Toshiharu Okada +Signed-off-by: Ben Dooks +Signed-off-by: Greg Kroah-Hartman +--- + drivers/i2c/busses/i2c-eg20t.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c +index 18936ac..730215e 100644 +--- a/drivers/i2c/busses/i2c-eg20t.c ++++ b/drivers/i2c/busses/i2c-eg20t.c +@@ -243,7 +243,7 @@ static void pch_i2c_init(struct i2c_algo_pch_data *adap) + if (pch_clk > PCH_MAX_CLK) + pch_clk = 62500; + +- pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / pch_i2c_speed * 8; ++ pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / (pch_i2c_speed * 8); + /* Set transfer speed in I2CBC */ + iowrite32(pch_i2cbc, p + PCH_I2CBC); + +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-xfs-fix-endian-conversion-issue-in-discard-code.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-xfs-fix-endian-conversion-issue-in-discard-code.patch deleted file mode 100644 index 6a7583d6..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0119-xfs-fix-endian-conversion-issue-in-discard-code.patch +++ /dev/null @@ -1,45 +0,0 @@ -From ddef510f3f47839e2c1c9498aba0ed5ef09fd792 Mon Sep 17 00:00:00 2001 -From: Dave Chinner -Date: Wed, 18 Jan 2012 14:41:45 -0600 -Subject: [PATCH 119/130] xfs: fix endian conversion issue in discard code - -commit b1c770c273a4787069306fc82aab245e9ac72e9d upstream - -When finding the longest extent in an AG, we read the value directly -out of the AGF buffer without endian conversion. This will give an -incorrect length, resulting in FITRIM operations potentially not -trimming everything that it should. - -Signed-off-by: Dave Chinner -Reviewed-by: Christoph Hellwig -Signed-off-by: Ben Myers -Signed-off-by: Greg Kroah-Hartman ---- - fs/xfs/xfs_discard.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/fs/xfs/xfs_discard.c b/fs/xfs/xfs_discard.c -index 8a24f0c..286a051 100644 ---- a/fs/xfs/xfs_discard.c -+++ b/fs/xfs/xfs_discard.c -@@ -68,7 +68,7 @@ xfs_trim_extents( - * Look up the longest btree in the AGF and start with it. - */ - error = xfs_alloc_lookup_le(cur, 0, -- XFS_BUF_TO_AGF(agbp)->agf_longest, &i); -+ be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest), &i); - if (error) - goto out_del_cursor; - -@@ -84,7 +84,7 @@ xfs_trim_extents( - if (error) - goto out_del_cursor; - XFS_WANT_CORRUPTED_GOTO(i == 1, out_del_cursor); -- ASSERT(flen <= XFS_BUF_TO_AGF(agbp)->agf_longest); -+ ASSERT(flen <= be32_to_cpu(XFS_BUF_TO_AGF(agbp)->agf_longest)); - - /* - * Too small? Give up. --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-i2c-eg20t-modified-the-setting-of-transfer-rate.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-i2c-eg20t-modified-the-setting-of-transfer-rate.patch deleted file mode 100644 index c57ba9ca..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-i2c-eg20t-modified-the-setting-of-transfer-rate.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 8d6915d8e53d9b080f079af5891d109011c6b112 Mon Sep 17 00:00:00 2001 -From: Toshiharu Okada -Date: Mon, 26 Sep 2011 16:16:23 +0900 -Subject: [PATCH 120/130] i2c-eg20t: modified the setting of transfer rate. - -commit ff35e8b18984ad2a82cbd259fc07f0be4b34b1aa upstream. - -This patch modified the setting value of -I2C Bus Transfer Rate Setting Counter regisrer. - -Signed-off-by: Toshiharu Okada -Signed-off-by: Ben Dooks -Signed-off-by: Greg Kroah-Hartman ---- - drivers/i2c/busses/i2c-eg20t.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c -index 18936ac..730215e 100644 ---- a/drivers/i2c/busses/i2c-eg20t.c -+++ b/drivers/i2c/busses/i2c-eg20t.c -@@ -243,7 +243,7 @@ static void pch_i2c_init(struct i2c_algo_pch_data *adap) - if (pch_clk > PCH_MAX_CLK) - pch_clk = 62500; - -- pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / pch_i2c_speed * 8; -+ pch_i2cbc = (pch_clk + (pch_i2c_speed * 4)) / (pch_i2c_speed * 8); - /* Set transfer speed in I2CBC */ - iowrite32(pch_i2cbc, p + PCH_I2CBC); - --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-score-fix-off-by-one-index-into-syscall-table.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-score-fix-off-by-one-index-into-syscall-table.patch new file mode 100644 index 00000000..32a8d963 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0120-score-fix-off-by-one-index-into-syscall-table.patch @@ -0,0 +1,46 @@ +From 9ed6d95eba2ead578e1fa4e5be8cb16b185c8c97 Mon Sep 17 00:00:00 2001 +From: Dan Rosenberg +Date: Fri, 20 Jan 2012 14:34:27 -0800 +Subject: [PATCH 120/129] score: fix off-by-one index into syscall table + +commit c25a785d6647984505fa165b5cd84cfc9a95970b upstream. + +If the provided system call number is equal to __NR_syscalls, the +current check will pass and a function pointer just after the system +call table may be called, since sys_call_table is an array with total +size __NR_syscalls. + +Whether or not this is a security bug depends on what the compiler puts +immediately after the system call table. It's likely that this won't do +anything bad because there is an additional NULL check on the syscall +entry, but if there happens to be a non-NULL value immediately after the +system call table, this may result in local privilege escalation. + +Signed-off-by: Dan Rosenberg +Cc: Chen Liqin +Cc: Lennox Wu +Cc: Eugene Teo +Cc: Arnd Bergmann +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + arch/score/kernel/entry.S | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S +index 577abba..83bb960 100644 +--- a/arch/score/kernel/entry.S ++++ b/arch/score/kernel/entry.S +@@ -408,7 +408,7 @@ ENTRY(handle_sys) + sw r9, [r0, PT_EPC] + + cmpi.c r27, __NR_syscalls # check syscall number +- bgtu illegal_syscall ++ bgeu illegal_syscall + + slli r8, r27, 2 # get syscall routine + la r11, sys_call_table +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-cifs-lower-default-wsize-when-unix-extensions-are-no.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-cifs-lower-default-wsize-when-unix-extensions-are-no.patch new file mode 100644 index 00000000..fb4af96b --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-cifs-lower-default-wsize-when-unix-extensions-are-no.patch @@ -0,0 +1,67 @@ +From ac9426f8233d76fd80412576fb53a26a7b1bd7ea Mon Sep 17 00:00:00 2001 +From: Jeff Layton +Date: Tue, 17 Jan 2012 16:08:51 -0500 +Subject: [PATCH 121/129] cifs: lower default wsize when unix extensions are + not used + +commit ce91acb3acae26f4163c5a6f1f695d1a1e8d9009 upstream. + +We've had some reports of servers (namely, the Solaris in-kernel CIFS +server) that don't deal properly with writes that are "too large" even +though they set CAP_LARGE_WRITE_ANDX. Change the default to better +mirror what windows clients do. + +Cc: Pavel Shilovsky +Reported-by: Nick Davis +Signed-off-by: Jeff Layton +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman +--- + fs/cifs/connect.c | 23 +++++++++++++++++++---- + 1 file changed, 19 insertions(+), 4 deletions(-) + +diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c +index f3670cf..63e4be4 100644 +--- a/fs/cifs/connect.c ++++ b/fs/cifs/connect.c +@@ -2914,18 +2914,33 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, + #define CIFS_DEFAULT_IOSIZE (1024 * 1024) + + /* +- * Windows only supports a max of 60k reads. Default to that when posix +- * extensions aren't in force. ++ * Windows only supports a max of 60kb reads and 65535 byte writes. Default to ++ * those values when posix extensions aren't in force. In actuality here, we ++ * use 65536 to allow for a write that is a multiple of 4k. Most servers seem ++ * to be ok with the extra byte even though Windows doesn't send writes that ++ * are that large. ++ * ++ * Citation: ++ * ++ * http://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx + */ + #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) ++#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) + + static unsigned int + cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) + { + __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); + struct TCP_Server_Info *server = tcon->ses->server; +- unsigned int wsize = pvolume_info->wsize ? pvolume_info->wsize : +- CIFS_DEFAULT_IOSIZE; ++ unsigned int wsize; ++ ++ /* start with specified wsize, or default */ ++ if (pvolume_info->wsize) ++ wsize = pvolume_info->wsize; ++ else if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) ++ wsize = CIFS_DEFAULT_IOSIZE; ++ else ++ wsize = CIFS_DEFAULT_NON_POSIX_WSIZE; + + /* can server support 24-bit write sizes? (via UNIX extensions) */ + if (!tcon->unix_ext || !(unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-score-fix-off-by-one-index-into-syscall-table.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-score-fix-off-by-one-index-into-syscall-table.patch deleted file mode 100644 index 22208696..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0121-score-fix-off-by-one-index-into-syscall-table.patch +++ /dev/null @@ -1,46 +0,0 @@ -From 9e5123c755ee15680df171b9b871533faa20bd70 Mon Sep 17 00:00:00 2001 -From: Dan Rosenberg -Date: Fri, 20 Jan 2012 14:34:27 -0800 -Subject: [PATCH 121/130] score: fix off-by-one index into syscall table - -commit c25a785d6647984505fa165b5cd84cfc9a95970b upstream. - -If the provided system call number is equal to __NR_syscalls, the -current check will pass and a function pointer just after the system -call table may be called, since sys_call_table is an array with total -size __NR_syscalls. - -Whether or not this is a security bug depends on what the compiler puts -immediately after the system call table. It's likely that this won't do -anything bad because there is an additional NULL check on the syscall -entry, but if there happens to be a non-NULL value immediately after the -system call table, this may result in local privilege escalation. - -Signed-off-by: Dan Rosenberg -Cc: Chen Liqin -Cc: Lennox Wu -Cc: Eugene Teo -Cc: Arnd Bergmann -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - arch/score/kernel/entry.S | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/arch/score/kernel/entry.S b/arch/score/kernel/entry.S -index 577abba..83bb960 100644 ---- a/arch/score/kernel/entry.S -+++ b/arch/score/kernel/entry.S -@@ -408,7 +408,7 @@ ENTRY(handle_sys) - sw r9, [r0, PT_EPC] - - cmpi.c r27, __NR_syscalls # check syscall number -- bgtu illegal_syscall -+ bgeu illegal_syscall - - slli r8, r27, 2 # get syscall routine - la r11, sys_call_table --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch deleted file mode 100644 index 3f2abcef..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-cifs-lower-default-wsize-when-unix-extensions-are-no.patch +++ /dev/null @@ -1,67 +0,0 @@ -From bc39faacff1307f46e6e0738f9b73ec9e3f06dc9 Mon Sep 17 00:00:00 2001 -From: Jeff Layton -Date: Tue, 17 Jan 2012 16:08:51 -0500 -Subject: [PATCH 122/130] cifs: lower default wsize when unix extensions are - not used - -commit ce91acb3acae26f4163c5a6f1f695d1a1e8d9009 upstream. - -We've had some reports of servers (namely, the Solaris in-kernel CIFS -server) that don't deal properly with writes that are "too large" even -though they set CAP_LARGE_WRITE_ANDX. Change the default to better -mirror what windows clients do. - -Cc: Pavel Shilovsky -Reported-by: Nick Davis -Signed-off-by: Jeff Layton -Signed-off-by: Steve French -Signed-off-by: Greg Kroah-Hartman ---- - fs/cifs/connect.c | 23 +++++++++++++++++++---- - 1 file changed, 19 insertions(+), 4 deletions(-) - -diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c -index f3670cf..63e4be4 100644 ---- a/fs/cifs/connect.c -+++ b/fs/cifs/connect.c -@@ -2914,18 +2914,33 @@ void cifs_setup_cifs_sb(struct smb_vol *pvolume_info, - #define CIFS_DEFAULT_IOSIZE (1024 * 1024) - - /* -- * Windows only supports a max of 60k reads. Default to that when posix -- * extensions aren't in force. -+ * Windows only supports a max of 60kb reads and 65535 byte writes. Default to -+ * those values when posix extensions aren't in force. In actuality here, we -+ * use 65536 to allow for a write that is a multiple of 4k. Most servers seem -+ * to be ok with the extra byte even though Windows doesn't send writes that -+ * are that large. -+ * -+ * Citation: -+ * -+ * http://blogs.msdn.com/b/openspecification/archive/2009/04/10/smb-maximum-transmit-buffer-size-and-performance-tuning.aspx - */ - #define CIFS_DEFAULT_NON_POSIX_RSIZE (60 * 1024) -+#define CIFS_DEFAULT_NON_POSIX_WSIZE (65536) - - static unsigned int - cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb_vol *pvolume_info) - { - __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); - struct TCP_Server_Info *server = tcon->ses->server; -- unsigned int wsize = pvolume_info->wsize ? pvolume_info->wsize : -- CIFS_DEFAULT_IOSIZE; -+ unsigned int wsize; -+ -+ /* start with specified wsize, or default */ -+ if (pvolume_info->wsize) -+ wsize = pvolume_info->wsize; -+ else if (tcon->unix_ext && (unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) -+ wsize = CIFS_DEFAULT_IOSIZE; -+ else -+ wsize = CIFS_DEFAULT_NON_POSIX_WSIZE; - - /* can server support 24-bit write sizes? (via UNIX extensions) */ - if (!tcon->unix_ext || !(unix_cap & CIFS_UNIX_LARGE_WRITE_CAP)) --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-kprobes-initialize-before-using-a-hlist.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-kprobes-initialize-before-using-a-hlist.patch new file mode 100644 index 00000000..3d055c3c --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0122-kprobes-initialize-before-using-a-hlist.patch @@ -0,0 +1,49 @@ +From d159bea43eb9f0ba806a4ddc7e03dbb218b88136 Mon Sep 17 00:00:00 2001 +From: Ananth N Mavinakayanahalli +Date: Fri, 20 Jan 2012 14:34:04 -0800 +Subject: [PATCH 122/129] kprobes: initialize before using a hlist + +commit d496aab567e7e52b3e974c9192a5de6e77dce32c upstream. + +Commit ef53d9c5e ("kprobes: improve kretprobe scalability with hashed +locking") introduced a bug where we can potentially leak +kretprobe_instances since we initialize a hlist head after having used +it. + +Initialize the hlist head before using it. + +Reported by: Jim Keniston +Acked-by: Jim Keniston +Signed-off-by: Ananth N Mavinakayanahalli +Acked-by: Masami Hiramatsu +Cc: Srinivasa D S +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + kernel/kprobes.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/kernel/kprobes.c b/kernel/kprobes.c +index e5d8464..52fd049 100644 +--- a/kernel/kprobes.c ++++ b/kernel/kprobes.c +@@ -1077,6 +1077,7 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) + /* Early boot. kretprobe_table_locks not yet initialized. */ + return; + ++ INIT_HLIST_HEAD(&empty_rp); + hash = hash_ptr(tk, KPROBE_HASH_BITS); + head = &kretprobe_inst_table[hash]; + kretprobe_table_lock(hash, &flags); +@@ -1085,7 +1086,6 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) + recycle_rp_inst(ri, &empty_rp); + } + kretprobe_table_unlock(hash, &flags); +- INIT_HLIST_HEAD(&empty_rp); + hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { + hlist_del(&ri->hlist); + kfree(ri); +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch deleted file mode 100644 index e5167230..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-kprobes-initialize-before-using-a-hlist.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 7e71cd56cf6675bb6ffebddbc6fae6cc1bc17d4d Mon Sep 17 00:00:00 2001 -From: Ananth N Mavinakayanahalli -Date: Fri, 20 Jan 2012 14:34:04 -0800 -Subject: [PATCH 123/130] kprobes: initialize before using a hlist - -commit d496aab567e7e52b3e974c9192a5de6e77dce32c upstream. - -Commit ef53d9c5e ("kprobes: improve kretprobe scalability with hashed -locking") introduced a bug where we can potentially leak -kretprobe_instances since we initialize a hlist head after having used -it. - -Initialize the hlist head before using it. - -Reported by: Jim Keniston -Acked-by: Jim Keniston -Signed-off-by: Ananth N Mavinakayanahalli -Acked-by: Masami Hiramatsu -Cc: Srinivasa D S -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - kernel/kprobes.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/kernel/kprobes.c b/kernel/kprobes.c -index e5d8464..52fd049 100644 ---- a/kernel/kprobes.c -+++ b/kernel/kprobes.c -@@ -1077,6 +1077,7 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) - /* Early boot. kretprobe_table_locks not yet initialized. */ - return; - -+ INIT_HLIST_HEAD(&empty_rp); - hash = hash_ptr(tk, KPROBE_HASH_BITS); - head = &kretprobe_inst_table[hash]; - kretprobe_table_lock(hash, &flags); -@@ -1085,7 +1086,6 @@ void __kprobes kprobe_flush_task(struct task_struct *tk) - recycle_rp_inst(ri, &empty_rp); - } - kretprobe_table_unlock(hash, &flags); -- INIT_HLIST_HEAD(&empty_rp); - hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) { - hlist_del(&ri->hlist); - kfree(ri); --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-proc-clear_refs-do-not-clear-reserved-pages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-proc-clear_refs-do-not-clear-reserved-pages.patch new file mode 100644 index 00000000..23678bde --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0123-proc-clear_refs-do-not-clear-reserved-pages.patch @@ -0,0 +1,64 @@ +From 1740c878a52dd4afc5b6e927d9b157d6db230184 Mon Sep 17 00:00:00 2001 +From: Will Deacon +Date: Fri, 20 Jan 2012 14:34:09 -0800 +Subject: [PATCH 123/129] proc: clear_refs: do not clear reserved pages + +commit 85e72aa5384b1a614563ad63257ded0e91d1a620 upstream. + +/proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for +pages and corresponding page table entries of the task with PID pid, which +includes any special mappings inserted into the page tables in order to +provide things like vDSOs and user helper functions. + +On ARM this causes a problem because the vectors page is mapped as a +global mapping and since ec706dab ("ARM: add a vma entry for the user +accessible vector page"), a VMA is also inserted into each task for this +page to aid unwinding through signals and syscall restarts. Since the +vectors page is required for handling faults, clearing the YOUNG bit (and +subsequently writing a faulting pte) means that we lose the vectors page +*globally* and cannot fault it back in. This results in a system deadlock +on the next exception. + +To see this problem in action, just run: + + $ echo 1 > /proc/self/clear_refs + +on an ARM platform (as any user) and watch your system hang. I think this +has been the case since 2.6.37 + +This patch avoids clearing the aforementioned bits for reserved pages, +therefore leaving the vectors page intact on ARM. Since reserved pages +are not candidates for swap, this change should not have any impact on the +usefulness of clear_refs. + +Signed-off-by: Will Deacon +Reported-by: Moussa Ba +Acked-by: Hugh Dickins +Cc: David Rientjes +Cc: Russell King +Acked-by: Nicolas Pitre +Cc: Matt Mackall +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + fs/proc/task_mmu.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c +index e418c5a..7dcd2a2 100644 +--- a/fs/proc/task_mmu.c ++++ b/fs/proc/task_mmu.c +@@ -518,6 +518,9 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr, + if (!page) + continue; + ++ if (PageReserved(page)) ++ continue; ++ + /* Clear accessed and referenced bits. */ + ptep_test_and_clear_young(vma, addr, pte); + ClearPageReferenced(page); +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch new file mode 100644 index 00000000..ca05e3e3 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch @@ -0,0 +1,91 @@ +From ddcb13eadda3bcb23d81672ea705d6bfa313bbf8 Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Fri, 20 Jan 2012 14:33:55 -0800 +Subject: [PATCH 124/129] mm: fix NULL ptr dereference in + __count_immobile_pages + +commit 687875fb7de4a95223af20ee024282fa9099f860 upstream. + +Fix the following NULL ptr dereference caused by + + cat /sys/devices/system/memory/memory0/removable + +Pid: 13979, comm: sed Not tainted 3.0.13-0.5-default #1 IBM BladeCenter LS21 -[7971PAM]-/Server Blade +RIP: __count_immobile_pages+0x4/0x100 +Process sed (pid: 13979, threadinfo ffff880221c36000, task ffff88022e788480) +Call Trace: + is_pageblock_removable_nolock+0x34/0x40 + is_mem_section_removable+0x74/0xf0 + show_mem_removable+0x41/0x70 + sysfs_read_file+0xfe/0x1c0 + vfs_read+0xc7/0x130 + sys_read+0x53/0xa0 + system_call_fastpath+0x16/0x1b + +We are crashing because we are trying to dereference NULL zone which +came from pfn=0 (struct page ffffea0000000000). According to the boot +log this page is marked reserved: +e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved) + +and early_node_map confirms that: +early_node_map[3] active PFN ranges + 1: 0x00000010 -> 0x0000009c + 1: 0x00000100 -> 0x000bffa3 + 1: 0x00100000 -> 0x00240000 + +The problem is that memory_present works in PAGE_SECTION_MASK aligned +blocks so the reserved range sneaks into the the section as well. This +also means that free_area_init_node will not take care of those reserved +pages and they stay uninitialized. + +When we try to read the removable status we walk through all available +sections and hope that the zone is valid for all pages in the section. +But this is not true in this case as the zone and nid are not initialized. + +We have only one node in this particular case and it is marked as node=1 +(rather than 0) and that made the problem visible because page_to_nid will +return 0 and there are no zones on the node. + +Let's check that the zone is valid and that the given pfn falls into its +boundaries and mark the section not removable. This might cause some +false positives, probably, but we do not have any sane way to find out +whether the page is reserved by the platform or it is just not used for +whatever other reasons. + +Signed-off-by: Michal Hocko +Acked-by: Mel Gorman +Cc: KAMEZAWA Hiroyuki +Cc: Andrea Arcangeli +Cc: David Rientjes +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + mm/page_alloc.c | 11 +++++++++++ + 1 file changed, 11 insertions(+) + +diff --git a/mm/page_alloc.c b/mm/page_alloc.c +index 2b8ba3a..485be89 100644 +--- a/mm/page_alloc.c ++++ b/mm/page_alloc.c +@@ -5608,6 +5608,17 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) + bool is_pageblock_removable_nolock(struct page *page) + { + struct zone *zone = page_zone(page); ++ unsigned long pfn = page_to_pfn(page); ++ ++ /* ++ * We have to be careful here because we are iterating over memory ++ * sections which are not zone aware so we might end up outside of ++ * the zone but still within the section. ++ */ ++ if (!zone || zone->zone_start_pfn > pfn || ++ zone->zone_start_pfn + zone->spanned_pages <= pfn) ++ return false; ++ + return __count_immobile_pages(zone, page, 0); + } + +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch deleted file mode 100644 index a4405c08..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0124-proc-clear_refs-do-not-clear-reserved-pages.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 669ae9fcf0f482983eed166dd9edc06ce3e1f1e9 Mon Sep 17 00:00:00 2001 -From: Will Deacon -Date: Fri, 20 Jan 2012 14:34:09 -0800 -Subject: [PATCH 124/130] proc: clear_refs: do not clear reserved pages - -commit 85e72aa5384b1a614563ad63257ded0e91d1a620 upstream. - -/proc/pid/clear_refs is used to clear the Referenced and YOUNG bits for -pages and corresponding page table entries of the task with PID pid, which -includes any special mappings inserted into the page tables in order to -provide things like vDSOs and user helper functions. - -On ARM this causes a problem because the vectors page is mapped as a -global mapping and since ec706dab ("ARM: add a vma entry for the user -accessible vector page"), a VMA is also inserted into each task for this -page to aid unwinding through signals and syscall restarts. Since the -vectors page is required for handling faults, clearing the YOUNG bit (and -subsequently writing a faulting pte) means that we lose the vectors page -*globally* and cannot fault it back in. This results in a system deadlock -on the next exception. - -To see this problem in action, just run: - - $ echo 1 > /proc/self/clear_refs - -on an ARM platform (as any user) and watch your system hang. I think this -has been the case since 2.6.37 - -This patch avoids clearing the aforementioned bits for reserved pages, -therefore leaving the vectors page intact on ARM. Since reserved pages -are not candidates for swap, this change should not have any impact on the -usefulness of clear_refs. - -Signed-off-by: Will Deacon -Reported-by: Moussa Ba -Acked-by: Hugh Dickins -Cc: David Rientjes -Cc: Russell King -Acked-by: Nicolas Pitre -Cc: Matt Mackall -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - fs/proc/task_mmu.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c -index e418c5a..7dcd2a2 100644 ---- a/fs/proc/task_mmu.c -+++ b/fs/proc/task_mmu.c -@@ -518,6 +518,9 @@ static int clear_refs_pte_range(pmd_t *pmd, unsigned long addr, - if (!page) - continue; - -+ if (PageReserved(page)) -+ continue; -+ - /* Clear accessed and referenced bits. */ - ptep_test_and_clear_young(vma, addr, pte); - ClearPageReferenced(page); --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-iwlagn-check-for-SMPS-mode.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-iwlagn-check-for-SMPS-mode.patch new file mode 100644 index 00000000..a3fffd51 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-iwlagn-check-for-SMPS-mode.patch @@ -0,0 +1,50 @@ +From cd3b4541cb6b11e119007268e0890a1a38e68f8e Mon Sep 17 00:00:00 2001 +From: Wey-Yi Guy +Date: Thu, 10 Nov 2011 06:55:04 -0800 +Subject: [PATCH 125/129] iwlagn: check for SMPS mode + +commit b2ccccdca46273c7b321ecf5041c362cd950da20 upstream. + +Check and report WARN only when its invalid + +Resolves: +https://bugzilla.kernel.org/show_bug.cgi?id=42621 +https://bugzilla.redhat.com/show_bug.cgi?id=766071 + +Signed-off-by: Wey-Yi Guy +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 + + drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 3 +++ + 2 files changed, 4 insertions(+) + +diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +index 1a52ed2..6465983 100644 +--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c ++++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c +@@ -827,6 +827,7 @@ static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) + case IEEE80211_SMPS_STATIC: + case IEEE80211_SMPS_DYNAMIC: + return IWL_NUM_IDLE_CHAINS_SINGLE; ++ case IEEE80211_SMPS_AUTOMATIC: + case IEEE80211_SMPS_OFF: + return active_cnt; + default: +diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +index 5c7c17c..d552fa3 100644 +--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c ++++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +@@ -559,6 +559,9 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) + + mutex_lock(&priv->shrd->mutex); + ++ if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) ++ goto out; ++ + if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) { + IWL_DEBUG_MAC80211(priv, "leave - scanning\n"); + goto out; +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch deleted file mode 100644 index 498a147c..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0125-mm-fix-NULL-ptr-dereference-in-__count_immobile_page.patch +++ /dev/null @@ -1,91 +0,0 @@ -From a59b11463ac1c9a0baf19cf3e713a6dd5c2e5509 Mon Sep 17 00:00:00 2001 -From: Michal Hocko -Date: Fri, 20 Jan 2012 14:33:55 -0800 -Subject: [PATCH 125/130] mm: fix NULL ptr dereference in - __count_immobile_pages - -commit 687875fb7de4a95223af20ee024282fa9099f860 upstream. - -Fix the following NULL ptr dereference caused by - - cat /sys/devices/system/memory/memory0/removable - -Pid: 13979, comm: sed Not tainted 3.0.13-0.5-default #1 IBM BladeCenter LS21 -[7971PAM]-/Server Blade -RIP: __count_immobile_pages+0x4/0x100 -Process sed (pid: 13979, threadinfo ffff880221c36000, task ffff88022e788480) -Call Trace: - is_pageblock_removable_nolock+0x34/0x40 - is_mem_section_removable+0x74/0xf0 - show_mem_removable+0x41/0x70 - sysfs_read_file+0xfe/0x1c0 - vfs_read+0xc7/0x130 - sys_read+0x53/0xa0 - system_call_fastpath+0x16/0x1b - -We are crashing because we are trying to dereference NULL zone which -came from pfn=0 (struct page ffffea0000000000). According to the boot -log this page is marked reserved: -e820 update range: 0000000000000000 - 0000000000010000 (usable) ==> (reserved) - -and early_node_map confirms that: -early_node_map[3] active PFN ranges - 1: 0x00000010 -> 0x0000009c - 1: 0x00000100 -> 0x000bffa3 - 1: 0x00100000 -> 0x00240000 - -The problem is that memory_present works in PAGE_SECTION_MASK aligned -blocks so the reserved range sneaks into the the section as well. This -also means that free_area_init_node will not take care of those reserved -pages and they stay uninitialized. - -When we try to read the removable status we walk through all available -sections and hope that the zone is valid for all pages in the section. -But this is not true in this case as the zone and nid are not initialized. - -We have only one node in this particular case and it is marked as node=1 -(rather than 0) and that made the problem visible because page_to_nid will -return 0 and there are no zones on the node. - -Let's check that the zone is valid and that the given pfn falls into its -boundaries and mark the section not removable. This might cause some -false positives, probably, but we do not have any sane way to find out -whether the page is reserved by the platform or it is just not used for -whatever other reasons. - -Signed-off-by: Michal Hocko -Acked-by: Mel Gorman -Cc: KAMEZAWA Hiroyuki -Cc: Andrea Arcangeli -Cc: David Rientjes -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - mm/page_alloc.c | 11 +++++++++++ - 1 file changed, 11 insertions(+) - -diff --git a/mm/page_alloc.c b/mm/page_alloc.c -index 2b8ba3a..485be89 100644 ---- a/mm/page_alloc.c -+++ b/mm/page_alloc.c -@@ -5608,6 +5608,17 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count) - bool is_pageblock_removable_nolock(struct page *page) - { - struct zone *zone = page_zone(page); -+ unsigned long pfn = page_to_pfn(page); -+ -+ /* -+ * We have to be careful here because we are iterating over memory -+ * sections which are not zone aware so we might end up outside of -+ * the zone but still within the section. -+ */ -+ if (!zone || zone->zone_start_pfn > pfn || -+ zone->zone_start_pfn + zone->spanned_pages <= pfn) -+ return false; -+ - return __count_immobile_pages(zone, page, 0); - } - --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlagn-check-for-SMPS-mode.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlagn-check-for-SMPS-mode.patch deleted file mode 100644 index 1691f6a1..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlagn-check-for-SMPS-mode.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3a12635bc47f7e3cd83525ce9e6e98dd3c58b31a Mon Sep 17 00:00:00 2001 -From: Wey-Yi Guy -Date: Thu, 10 Nov 2011 06:55:04 -0800 -Subject: [PATCH 126/130] iwlagn: check for SMPS mode - -commit b2ccccdca46273c7b321ecf5041c362cd950da20 upstream. - -Check and report WARN only when its invalid - -Resolves: -https://bugzilla.kernel.org/show_bug.cgi?id=42621 -https://bugzilla.redhat.com/show_bug.cgi?id=766071 - -Signed-off-by: Wey-Yi Guy -Signed-off-by: John W. Linville -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/wireless/iwlwifi/iwl-agn-lib.c | 1 + - drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 3 +++ - 2 files changed, 4 insertions(+) - -diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c -index 1a52ed2..6465983 100644 ---- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c -+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c -@@ -827,6 +827,7 @@ static int iwl_get_idle_rx_chain_count(struct iwl_priv *priv, int active_cnt) - case IEEE80211_SMPS_STATIC: - case IEEE80211_SMPS_DYNAMIC: - return IWL_NUM_IDLE_CHAINS_SINGLE; -+ case IEEE80211_SMPS_AUTOMATIC: - case IEEE80211_SMPS_OFF: - return active_cnt; - default: -diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c -index 5c7c17c..d552fa3 100644 ---- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c -+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c -@@ -559,6 +559,9 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed) - - mutex_lock(&priv->shrd->mutex); - -+ if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) -+ goto out; -+ - if (unlikely(test_bit(STATUS_SCANNING, &priv->shrd->status))) { - IWL_DEBUG_MAC80211(priv, "leave - scanning\n"); - goto out; --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch new file mode 100644 index 00000000..7cbd3d8d --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0126-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch @@ -0,0 +1,60 @@ +From 98214e3fab80dbfdf54c908de2ae0c9730d6430d Mon Sep 17 00:00:00 2001 +From: Stanislaw Gruszka +Date: Fri, 23 Dec 2011 08:13:50 +0100 +Subject: [PATCH 126/129] iwlegacy: 3945: fix hw passive scan on radar + channels + +commit 68acc4afb040d98ddfd2cae0de09e2f4e1ee127f upstream. + +Patch fix firmware error on "iw dev wlan0 scan passive" for +hardware scanning (with disable_hw_scan=0 module parameter). + + iwl3945 0000:03:00.0: Microcode SW error detected. Restarting 0x82000008. + iwl3945 0000:03:00.0: Loaded firmware version: 15.32.2.9 + iwl3945 0000:03:00.0: Start IWL Error Log Dump: + iwl3945 0000:03:00.0: Status: 0x0002A2E4, count: 1 + iwl3945 0000:03:00.0: Desc Time asrtPC blink2 ilink1 nmiPC Line + iwl3945 0000:03:00.0: SYSASSERT (0x5) 0041263900 0x13756 0x0031C 0x00000 764 + iwl3945 0000:03:00.0: Error Reply type 0x000002FC cmd C_SCAN (0x80) seq 0x443E ser 0x00340000 + iwl3945 0000:03:00.0: Command C_SCAN failed: FW Error + iwl3945 0000:03:00.0: Can't stop Rx DMA. + +We have disable ability to change passive scanning to active on +particular channel when traffic is detected on that channel. Otherwise +firmware will report error, when we try to do passive scan on radar +channels. + +Reported-and-debugged-by: Pedro Francisco +Signed-off-by: Stanislaw Gruszka +Signed-off-by: John W. Linville +Signed-off-by: Greg Kroah-Hartman +--- + drivers/net/wireless/iwlegacy/iwl3945-base.c | 9 ++++----- + 1 file changed, 4 insertions(+), 5 deletions(-) + +diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c +index b282d86..05f2ad1 100644 +--- a/drivers/net/wireless/iwlegacy/iwl3945-base.c ++++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c +@@ -2656,14 +2656,13 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) + IWL_WARN(priv, "Invalid scan band\n"); + return -EIO; + } +- + /* +- * If active scaning is requested but a certain channel +- * is marked passive, we can do active scanning if we +- * detect transmissions. ++ * If active scaning is requested but a certain channel is marked ++ * passive, we can do active scanning if we detect transmissions. For ++ * passive only scanning disable switching to active on any channel. + */ + scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : +- IWL_GOOD_CRC_TH_DISABLED; ++ IWL_GOOD_CRC_TH_NEVER; + + len = iwl_legacy_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, + vif->addr, priv->scan_request->ie, +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-SHM_UNLOCK-fix-long-unpreemptible-section.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-SHM_UNLOCK-fix-long-unpreemptible-section.patch new file mode 100644 index 00000000..3731f657 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-SHM_UNLOCK-fix-long-unpreemptible-section.patch @@ -0,0 +1,186 @@ +From 5e2208d9c6ce1c5e57ad5fe56adc5b8f349ce23a Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Fri, 20 Jan 2012 14:34:19 -0800 +Subject: [PATCH 127/129] SHM_UNLOCK: fix long unpreemptible section + +commit 85046579bde15e532983438f86b36856e358f417 upstream. + +scan_mapping_unevictable_pages() is used to make SysV SHM_LOCKed pages +evictable again once the shared memory is unlocked. It does this with +pagevec_lookup()s across the whole object (which might occupy most of +memory), and takes 300ms to unlock 7GB here. A cond_resched() every +PAGEVEC_SIZE pages would be good. + +However, KOSAKI-san points out that this is called under shmem.c's +info->lock, and it's also under shm.c's shm_lock(), both spinlocks. +There is no strong reason for that: we need to take these pages off the +unevictable list soonish, but those locks are not required for it. + +So move the call to scan_mapping_unevictable_pages() from shmem.c's +unlock handling up to shm.c's unlock handling. Remove the recently +added barrier, not needed now we have spin_unlock() before the scan. + +Use get_file(), with subsequent fput(), to make sure we have a reference +to mapping throughout scan_mapping_unevictable_pages(): that's something +that was previously guaranteed by the shm_lock(). + +Remove shmctl's lru_add_drain_all(): we don't fault in pages at SHM_LOCK +time, and we lazily discover them to be Unevictable later, so it serves +no purpose for SHM_LOCK; and serves no purpose for SHM_UNLOCK, since +pages still on pagevec are not marked Unevictable. + +The original code avoided redundant rescans by checking VM_LOCKED flag +at its level: now avoid them by checking shp's SHM_LOCKED. + +The original code called scan_mapping_unevictable_pages() on a locked +area at shm_destroy() time: perhaps we once had accounting cross-checks +which required that, but not now, so skip the overhead and just let +inode eviction deal with them. + +Put check_move_unevictable_page() and scan_mapping_unevictable_pages() +under CONFIG_SHMEM (with stub for the TINY case when ramfs is used), +more as comment than to save space; comment them used for SHM_UNLOCK. + +Signed-off-by: Hugh Dickins +Reviewed-by: KOSAKI Motohiro +Cc: Minchan Kim +Cc: Rik van Riel +Cc: Shaohua Li +Cc: Eric Dumazet +Cc: Johannes Weiner +Cc: Michel Lespinasse +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + ipc/shm.c | 37 ++++++++++++++++++++++--------------- + mm/shmem.c | 7 ------- + mm/vmscan.c | 12 +++++++++++- + 3 files changed, 33 insertions(+), 23 deletions(-) + +diff --git a/ipc/shm.c b/ipc/shm.c +index 02ecf2c..854ab58 100644 +--- a/ipc/shm.c ++++ b/ipc/shm.c +@@ -870,9 +870,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) + case SHM_LOCK: + case SHM_UNLOCK: + { +- struct file *uninitialized_var(shm_file); +- +- lru_add_drain_all(); /* drain pagevecs to lru lists */ ++ struct file *shm_file; + + shp = shm_lock_check(ns, shmid); + if (IS_ERR(shp)) { +@@ -895,22 +893,31 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) + err = security_shm_shmctl(shp, cmd); + if (err) + goto out_unlock; +- +- if(cmd==SHM_LOCK) { ++ ++ shm_file = shp->shm_file; ++ if (is_file_hugepages(shm_file)) ++ goto out_unlock; ++ ++ if (cmd == SHM_LOCK) { + struct user_struct *user = current_user(); +- if (!is_file_hugepages(shp->shm_file)) { +- err = shmem_lock(shp->shm_file, 1, user); +- if (!err && !(shp->shm_perm.mode & SHM_LOCKED)){ +- shp->shm_perm.mode |= SHM_LOCKED; +- shp->mlock_user = user; +- } ++ err = shmem_lock(shm_file, 1, user); ++ if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { ++ shp->shm_perm.mode |= SHM_LOCKED; ++ shp->mlock_user = user; + } +- } else if (!is_file_hugepages(shp->shm_file)) { +- shmem_lock(shp->shm_file, 0, shp->mlock_user); +- shp->shm_perm.mode &= ~SHM_LOCKED; +- shp->mlock_user = NULL; ++ goto out_unlock; + } ++ ++ /* SHM_UNLOCK */ ++ if (!(shp->shm_perm.mode & SHM_LOCKED)) ++ goto out_unlock; ++ shmem_lock(shm_file, 0, shp->mlock_user); ++ shp->shm_perm.mode &= ~SHM_LOCKED; ++ shp->mlock_user = NULL; ++ get_file(shm_file); + shm_unlock(shp); ++ scan_mapping_unevictable_pages(shm_file->f_mapping); ++ fput(shm_file); + goto out; + } + case IPC_RMID: +diff --git a/mm/shmem.c b/mm/shmem.c +index d6722506..cc6d40b2 100644 +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -1068,13 +1068,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) + user_shm_unlock(inode->i_size, user); + info->flags &= ~VM_LOCKED; + mapping_clear_unevictable(file->f_mapping); +- /* +- * Ensure that a racing putback_lru_page() can see +- * the pages of this mapping are evictable when we +- * skip them due to !PageLRU during the scan. +- */ +- smp_mb__after_clear_bit(); +- scan_mapping_unevictable_pages(file->f_mapping); + } + retval = 0; + +diff --git a/mm/vmscan.c b/mm/vmscan.c +index f54a05b..824676a 100644 +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -3353,6 +3353,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) + return 1; + } + ++#ifdef CONFIG_SHMEM + /** + * check_move_unevictable_page - check page for evictability and move to appropriate zone lru list + * @page: page to check evictability and move to appropriate lru list +@@ -3363,6 +3364,8 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) + * + * Restrictions: zone->lru_lock must be held, page must be on LRU and must + * have PageUnevictable set. ++ * ++ * This function is only used for SysV IPC SHM_UNLOCK. + */ + static void check_move_unevictable_page(struct page *page, struct zone *zone) + { +@@ -3396,6 +3399,8 @@ retry: + * + * Scan all pages in mapping. Check unevictable pages for + * evictability and move them to the appropriate zone lru list. ++ * ++ * This function is only used for SysV IPC SHM_UNLOCK. + */ + void scan_mapping_unevictable_pages(struct address_space *mapping) + { +@@ -3441,9 +3446,14 @@ void scan_mapping_unevictable_pages(struct address_space *mapping) + pagevec_release(&pvec); + + count_vm_events(UNEVICTABLE_PGSCANNED, pg_scanned); ++ cond_resched(); + } +- + } ++#else ++void scan_mapping_unevictable_pages(struct address_space *mapping) ++{ ++} ++#endif /* CONFIG_SHMEM */ + + static void warn_scan_unevictable_pages(void) + { +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch deleted file mode 100644 index 03ec19d1..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0127-iwlegacy-3945-fix-hw-passive-scan-on-radar-channels.patch +++ /dev/null @@ -1,60 +0,0 @@ -From 5be98e8ad61eb5fb868590255329e30408707c1b Mon Sep 17 00:00:00 2001 -From: Stanislaw Gruszka -Date: Fri, 23 Dec 2011 08:13:50 +0100 -Subject: [PATCH 127/130] iwlegacy: 3945: fix hw passive scan on radar - channels - -commit 68acc4afb040d98ddfd2cae0de09e2f4e1ee127f upstream. - -Patch fix firmware error on "iw dev wlan0 scan passive" for -hardware scanning (with disable_hw_scan=0 module parameter). - - iwl3945 0000:03:00.0: Microcode SW error detected. Restarting 0x82000008. - iwl3945 0000:03:00.0: Loaded firmware version: 15.32.2.9 - iwl3945 0000:03:00.0: Start IWL Error Log Dump: - iwl3945 0000:03:00.0: Status: 0x0002A2E4, count: 1 - iwl3945 0000:03:00.0: Desc Time asrtPC blink2 ilink1 nmiPC Line - iwl3945 0000:03:00.0: SYSASSERT (0x5) 0041263900 0x13756 0x0031C 0x00000 764 - iwl3945 0000:03:00.0: Error Reply type 0x000002FC cmd C_SCAN (0x80) seq 0x443E ser 0x00340000 - iwl3945 0000:03:00.0: Command C_SCAN failed: FW Error - iwl3945 0000:03:00.0: Can't stop Rx DMA. - -We have disable ability to change passive scanning to active on -particular channel when traffic is detected on that channel. Otherwise -firmware will report error, when we try to do passive scan on radar -channels. - -Reported-and-debugged-by: Pedro Francisco -Signed-off-by: Stanislaw Gruszka -Signed-off-by: John W. Linville -Signed-off-by: Greg Kroah-Hartman ---- - drivers/net/wireless/iwlegacy/iwl3945-base.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/drivers/net/wireless/iwlegacy/iwl3945-base.c b/drivers/net/wireless/iwlegacy/iwl3945-base.c -index b282d86..05f2ad1 100644 ---- a/drivers/net/wireless/iwlegacy/iwl3945-base.c -+++ b/drivers/net/wireless/iwlegacy/iwl3945-base.c -@@ -2656,14 +2656,13 @@ int iwl3945_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif) - IWL_WARN(priv, "Invalid scan band\n"); - return -EIO; - } -- - /* -- * If active scaning is requested but a certain channel -- * is marked passive, we can do active scanning if we -- * detect transmissions. -+ * If active scaning is requested but a certain channel is marked -+ * passive, we can do active scanning if we detect transmissions. For -+ * passive only scanning disable switching to active on any channel. - */ - scan->good_CRC_th = is_active ? IWL_GOOD_CRC_TH_DEFAULT : -- IWL_GOOD_CRC_TH_DISABLED; -+ IWL_GOOD_CRC_TH_NEVER; - - len = iwl_legacy_fill_probe_req(priv, (struct ieee80211_mgmt *)scan->data, - vif->addr, priv->scan_request->ie, --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch new file mode 100644 index 00000000..e7adafc9 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch @@ -0,0 +1,342 @@ +From 8704b3941de0865d7c11921ee2dd7abbc04a0081 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Fri, 20 Jan 2012 14:34:21 -0800 +Subject: [PATCH 128/129] SHM_UNLOCK: fix Unevictable pages stranded after + swap + +commit 245132643e1cfcd145bbc86a716c1818371fcb93 upstream. + +Commit cc39c6a9bbde ("mm: account skipped entries to avoid looping in +find_get_pages") correctly fixed an infinite loop; but left a problem +that find_get_pages() on shmem would return 0 (appearing to callers to +mean end of tree) when it meets a run of nr_pages swap entries. + +The only uses of find_get_pages() on shmem are via pagevec_lookup(), +called from invalidate_mapping_pages(), and from shmctl SHM_UNLOCK's +scan_mapping_unevictable_pages(). The first is already commented, and +not worth worrying about; but the second can leave pages on the +Unevictable list after an unusual sequence of swapping and locking. + +Fix that by using shmem_find_get_pages_and_swap() (then ignoring the +swap) instead of pagevec_lookup(). + +But I don't want to contaminate vmscan.c with shmem internals, nor +shmem.c with LRU locking. So move scan_mapping_unevictable_pages() into +shmem.c, renaming it shmem_unlock_mapping(); and rename +check_move_unevictable_page() to check_move_unevictable_pages(), looping +down an array of pages, oftentimes under the same lock. + +Leave out the "rotate unevictable list" block: that's a leftover from +when this was used for /proc/sys/vm/scan_unevictable_pages, whose flawed +handling involved looking at pages at tail of LRU. + +Was there significance to the sequence first ClearPageUnevictable, then +test page_evictable, then SetPageUnevictable here? I think not, we're +under LRU lock, and have no barriers between those. + +Signed-off-by: Hugh Dickins +Reviewed-by: KOSAKI Motohiro +Cc: Minchan Kim +Cc: Rik van Riel +Cc: Shaohua Li +Cc: Eric Dumazet +Cc: Johannes Weiner +Cc: Michel Lespinasse +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman +--- + include/linux/shmem_fs.h | 1 + + include/linux/swap.h | 2 +- + ipc/shm.c | 2 +- + mm/shmem.c | 46 +++++++++++++++-- + mm/vmscan.c | 122 ++++++++++++++-------------------------------- + 5 files changed, 81 insertions(+), 92 deletions(-) + +diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h +index 9291ac3..6f10c9c 100644 +--- a/include/linux/shmem_fs.h ++++ b/include/linux/shmem_fs.h +@@ -48,6 +48,7 @@ extern struct file *shmem_file_setup(const char *name, + loff_t size, unsigned long flags); + extern int shmem_zero_setup(struct vm_area_struct *); + extern int shmem_lock(struct file *file, int lock, struct user_struct *user); ++extern void shmem_unlock_mapping(struct address_space *mapping); + extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, + pgoff_t index, gfp_t gfp_mask); + extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); +diff --git a/include/linux/swap.h b/include/linux/swap.h +index 1e22e12..67b3fa3 100644 +--- a/include/linux/swap.h ++++ b/include/linux/swap.h +@@ -272,7 +272,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) + #endif + + extern int page_evictable(struct page *page, struct vm_area_struct *vma); +-extern void scan_mapping_unevictable_pages(struct address_space *); ++extern void check_move_unevictable_pages(struct page **, int nr_pages); + + extern unsigned long scan_unevictable_pages; + extern int scan_unevictable_handler(struct ctl_table *, int, +diff --git a/ipc/shm.c b/ipc/shm.c +index 854ab58..b76be5b 100644 +--- a/ipc/shm.c ++++ b/ipc/shm.c +@@ -916,7 +916,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) + shp->mlock_user = NULL; + get_file(shm_file); + shm_unlock(shp); +- scan_mapping_unevictable_pages(shm_file->f_mapping); ++ shmem_unlock_mapping(shm_file->f_mapping); + fput(shm_file); + goto out; + } +diff --git a/mm/shmem.c b/mm/shmem.c +index cc6d40b2..6c253f7 100644 +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -379,7 +379,7 @@ static int shmem_free_swap(struct address_space *mapping, + /* + * Pagevec may contain swap entries, so shuffle up pages before releasing. + */ +-static void shmem_pagevec_release(struct pagevec *pvec) ++static void shmem_deswap_pagevec(struct pagevec *pvec) + { + int i, j; + +@@ -389,7 +389,36 @@ static void shmem_pagevec_release(struct pagevec *pvec) + pvec->pages[j++] = page; + } + pvec->nr = j; +- pagevec_release(pvec); ++} ++ ++/* ++ * SysV IPC SHM_UNLOCK restore Unevictable pages to their evictable lists. ++ */ ++void shmem_unlock_mapping(struct address_space *mapping) ++{ ++ struct pagevec pvec; ++ pgoff_t indices[PAGEVEC_SIZE]; ++ pgoff_t index = 0; ++ ++ pagevec_init(&pvec, 0); ++ /* ++ * Minor point, but we might as well stop if someone else SHM_LOCKs it. ++ */ ++ while (!mapping_unevictable(mapping)) { ++ /* ++ * Avoid pagevec_lookup(): find_get_pages() returns 0 as if it ++ * has finished, if it hits a row of PAGEVEC_SIZE swap entries. ++ */ ++ pvec.nr = shmem_find_get_pages_and_swap(mapping, index, ++ PAGEVEC_SIZE, pvec.pages, indices); ++ if (!pvec.nr) ++ break; ++ index = indices[pvec.nr - 1] + 1; ++ shmem_deswap_pagevec(&pvec); ++ check_move_unevictable_pages(pvec.pages, pvec.nr); ++ pagevec_release(&pvec); ++ cond_resched(); ++ } + } + + /* +@@ -440,7 +469,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) + } + unlock_page(page); + } +- shmem_pagevec_release(&pvec); ++ shmem_deswap_pagevec(&pvec); ++ pagevec_release(&pvec); + mem_cgroup_uncharge_end(); + cond_resched(); + index++; +@@ -470,7 +500,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) + continue; + } + if (index == start && indices[0] > end) { +- shmem_pagevec_release(&pvec); ++ shmem_deswap_pagevec(&pvec); ++ pagevec_release(&pvec); + break; + } + mem_cgroup_uncharge_start(); +@@ -494,7 +525,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) + } + unlock_page(page); + } +- shmem_pagevec_release(&pvec); ++ shmem_deswap_pagevec(&pvec); ++ pagevec_release(&pvec); + mem_cgroup_uncharge_end(); + index++; + } +@@ -2439,6 +2471,10 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) + return 0; + } + ++void shmem_unlock_mapping(struct address_space *mapping) ++{ ++} ++ + void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) + { + truncate_inode_pages_range(inode->i_mapping, lstart, lend); +diff --git a/mm/vmscan.c b/mm/vmscan.c +index 824676a..cb33d9c 100644 +--- a/mm/vmscan.c ++++ b/mm/vmscan.c +@@ -636,7 +636,7 @@ redo: + * When racing with an mlock or AS_UNEVICTABLE clearing + * (page is unlocked) make sure that if the other thread + * does not observe our setting of PG_lru and fails +- * isolation/check_move_unevictable_page, ++ * isolation/check_move_unevictable_pages, + * we see PG_mlocked/AS_UNEVICTABLE cleared below and move + * the page back to the evictable list. + * +@@ -3355,104 +3355,56 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) + + #ifdef CONFIG_SHMEM + /** +- * check_move_unevictable_page - check page for evictability and move to appropriate zone lru list +- * @page: page to check evictability and move to appropriate lru list +- * @zone: zone page is in ++ * check_move_unevictable_pages - check pages for evictability and move to appropriate zone lru list ++ * @pages: array of pages to check ++ * @nr_pages: number of pages to check + * +- * Checks a page for evictability and moves the page to the appropriate +- * zone lru list. +- * +- * Restrictions: zone->lru_lock must be held, page must be on LRU and must +- * have PageUnevictable set. ++ * Checks pages for evictability and moves them to the appropriate lru list. + * + * This function is only used for SysV IPC SHM_UNLOCK. + */ +-static void check_move_unevictable_page(struct page *page, struct zone *zone) ++void check_move_unevictable_pages(struct page **pages, int nr_pages) + { +- VM_BUG_ON(PageActive(page)); ++ struct zone *zone = NULL; ++ int pgscanned = 0; ++ int pgrescued = 0; ++ int i; + +-retry: +- ClearPageUnevictable(page); +- if (page_evictable(page, NULL)) { +- enum lru_list l = page_lru_base_type(page); ++ for (i = 0; i < nr_pages; i++) { ++ struct page *page = pages[i]; ++ struct zone *pagezone; + +- __dec_zone_state(zone, NR_UNEVICTABLE); +- list_move(&page->lru, &zone->lru[l].list); +- mem_cgroup_move_lists(page, LRU_UNEVICTABLE, l); +- __inc_zone_state(zone, NR_INACTIVE_ANON + l); +- __count_vm_event(UNEVICTABLE_PGRESCUED); +- } else { +- /* +- * rotate unevictable list +- */ +- SetPageUnevictable(page); +- list_move(&page->lru, &zone->lru[LRU_UNEVICTABLE].list); +- mem_cgroup_rotate_lru_list(page, LRU_UNEVICTABLE); +- if (page_evictable(page, NULL)) +- goto retry; +- } +-} +- +-/** +- * scan_mapping_unevictable_pages - scan an address space for evictable pages +- * @mapping: struct address_space to scan for evictable pages +- * +- * Scan all pages in mapping. Check unevictable pages for +- * evictability and move them to the appropriate zone lru list. +- * +- * This function is only used for SysV IPC SHM_UNLOCK. +- */ +-void scan_mapping_unevictable_pages(struct address_space *mapping) +-{ +- pgoff_t next = 0; +- pgoff_t end = (i_size_read(mapping->host) + PAGE_CACHE_SIZE - 1) >> +- PAGE_CACHE_SHIFT; +- struct zone *zone; +- struct pagevec pvec; ++ pgscanned++; ++ pagezone = page_zone(page); ++ if (pagezone != zone) { ++ if (zone) ++ spin_unlock_irq(&zone->lru_lock); ++ zone = pagezone; ++ spin_lock_irq(&zone->lru_lock); ++ } + +- if (mapping->nrpages == 0) +- return; ++ if (!PageLRU(page) || !PageUnevictable(page)) ++ continue; + +- pagevec_init(&pvec, 0); +- while (next < end && +- pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { +- int i; +- int pg_scanned = 0; +- +- zone = NULL; +- +- for (i = 0; i < pagevec_count(&pvec); i++) { +- struct page *page = pvec.pages[i]; +- pgoff_t page_index = page->index; +- struct zone *pagezone = page_zone(page); +- +- pg_scanned++; +- if (page_index > next) +- next = page_index; +- next++; +- +- if (pagezone != zone) { +- if (zone) +- spin_unlock_irq(&zone->lru_lock); +- zone = pagezone; +- spin_lock_irq(&zone->lru_lock); +- } ++ if (page_evictable(page, NULL)) { ++ enum lru_list lru = page_lru_base_type(page); + +- if (PageLRU(page) && PageUnevictable(page)) +- check_move_unevictable_page(page, zone); ++ VM_BUG_ON(PageActive(page)); ++ ClearPageUnevictable(page); ++ __dec_zone_state(zone, NR_UNEVICTABLE); ++ list_move(&page->lru, &zone->lru[lru].list); ++ mem_cgroup_move_lists(page, LRU_UNEVICTABLE, lru); ++ __inc_zone_state(zone, NR_INACTIVE_ANON + lru); ++ pgrescued++; + } +- if (zone) +- spin_unlock_irq(&zone->lru_lock); +- pagevec_release(&pvec); ++ } + +- count_vm_events(UNEVICTABLE_PGSCANNED, pg_scanned); +- cond_resched(); ++ if (zone) { ++ __count_vm_events(UNEVICTABLE_PGRESCUED, pgrescued); ++ __count_vm_events(UNEVICTABLE_PGSCANNED, pgscanned); ++ spin_unlock_irq(&zone->lru_lock); + } + } +-#else +-void scan_mapping_unevictable_pages(struct address_space *mapping) +-{ +-} + #endif /* CONFIG_SHMEM */ + + static void warn_scan_unevictable_pages(void) +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-long-unpreemptible-section.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-long-unpreemptible-section.patch deleted file mode 100644 index d2eb914e..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0128-SHM_UNLOCK-fix-long-unpreemptible-section.patch +++ /dev/null @@ -1,186 +0,0 @@ -From 1d36f35b70322d93b6ed8e39ef38fdd9a895962e Mon Sep 17 00:00:00 2001 -From: Hugh Dickins -Date: Fri, 20 Jan 2012 14:34:19 -0800 -Subject: [PATCH 128/130] SHM_UNLOCK: fix long unpreemptible section - -commit 85046579bde15e532983438f86b36856e358f417 upstream. - -scan_mapping_unevictable_pages() is used to make SysV SHM_LOCKed pages -evictable again once the shared memory is unlocked. It does this with -pagevec_lookup()s across the whole object (which might occupy most of -memory), and takes 300ms to unlock 7GB here. A cond_resched() every -PAGEVEC_SIZE pages would be good. - -However, KOSAKI-san points out that this is called under shmem.c's -info->lock, and it's also under shm.c's shm_lock(), both spinlocks. -There is no strong reason for that: we need to take these pages off the -unevictable list soonish, but those locks are not required for it. - -So move the call to scan_mapping_unevictable_pages() from shmem.c's -unlock handling up to shm.c's unlock handling. Remove the recently -added barrier, not needed now we have spin_unlock() before the scan. - -Use get_file(), with subsequent fput(), to make sure we have a reference -to mapping throughout scan_mapping_unevictable_pages(): that's something -that was previously guaranteed by the shm_lock(). - -Remove shmctl's lru_add_drain_all(): we don't fault in pages at SHM_LOCK -time, and we lazily discover them to be Unevictable later, so it serves -no purpose for SHM_LOCK; and serves no purpose for SHM_UNLOCK, since -pages still on pagevec are not marked Unevictable. - -The original code avoided redundant rescans by checking VM_LOCKED flag -at its level: now avoid them by checking shp's SHM_LOCKED. - -The original code called scan_mapping_unevictable_pages() on a locked -area at shm_destroy() time: perhaps we once had accounting cross-checks -which required that, but not now, so skip the overhead and just let -inode eviction deal with them. - -Put check_move_unevictable_page() and scan_mapping_unevictable_pages() -under CONFIG_SHMEM (with stub for the TINY case when ramfs is used), -more as comment than to save space; comment them used for SHM_UNLOCK. - -Signed-off-by: Hugh Dickins -Reviewed-by: KOSAKI Motohiro -Cc: Minchan Kim -Cc: Rik van Riel -Cc: Shaohua Li -Cc: Eric Dumazet -Cc: Johannes Weiner -Cc: Michel Lespinasse -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - ipc/shm.c | 37 ++++++++++++++++++++++--------------- - mm/shmem.c | 7 ------- - mm/vmscan.c | 12 +++++++++++- - 3 files changed, 33 insertions(+), 23 deletions(-) - -diff --git a/ipc/shm.c b/ipc/shm.c -index 02ecf2c..854ab58 100644 ---- a/ipc/shm.c -+++ b/ipc/shm.c -@@ -870,9 +870,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) - case SHM_LOCK: - case SHM_UNLOCK: - { -- struct file *uninitialized_var(shm_file); -- -- lru_add_drain_all(); /* drain pagevecs to lru lists */ -+ struct file *shm_file; - - shp = shm_lock_check(ns, shmid); - if (IS_ERR(shp)) { -@@ -895,22 +893,31 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) - err = security_shm_shmctl(shp, cmd); - if (err) - goto out_unlock; -- -- if(cmd==SHM_LOCK) { -+ -+ shm_file = shp->shm_file; -+ if (is_file_hugepages(shm_file)) -+ goto out_unlock; -+ -+ if (cmd == SHM_LOCK) { - struct user_struct *user = current_user(); -- if (!is_file_hugepages(shp->shm_file)) { -- err = shmem_lock(shp->shm_file, 1, user); -- if (!err && !(shp->shm_perm.mode & SHM_LOCKED)){ -- shp->shm_perm.mode |= SHM_LOCKED; -- shp->mlock_user = user; -- } -+ err = shmem_lock(shm_file, 1, user); -+ if (!err && !(shp->shm_perm.mode & SHM_LOCKED)) { -+ shp->shm_perm.mode |= SHM_LOCKED; -+ shp->mlock_user = user; - } -- } else if (!is_file_hugepages(shp->shm_file)) { -- shmem_lock(shp->shm_file, 0, shp->mlock_user); -- shp->shm_perm.mode &= ~SHM_LOCKED; -- shp->mlock_user = NULL; -+ goto out_unlock; - } -+ -+ /* SHM_UNLOCK */ -+ if (!(shp->shm_perm.mode & SHM_LOCKED)) -+ goto out_unlock; -+ shmem_lock(shm_file, 0, shp->mlock_user); -+ shp->shm_perm.mode &= ~SHM_LOCKED; -+ shp->mlock_user = NULL; -+ get_file(shm_file); - shm_unlock(shp); -+ scan_mapping_unevictable_pages(shm_file->f_mapping); -+ fput(shm_file); - goto out; - } - case IPC_RMID: -diff --git a/mm/shmem.c b/mm/shmem.c -index d672250..cc6d40b2 100644 ---- a/mm/shmem.c -+++ b/mm/shmem.c -@@ -1068,13 +1068,6 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) - user_shm_unlock(inode->i_size, user); - info->flags &= ~VM_LOCKED; - mapping_clear_unevictable(file->f_mapping); -- /* -- * Ensure that a racing putback_lru_page() can see -- * the pages of this mapping are evictable when we -- * skip them due to !PageLRU during the scan. -- */ -- smp_mb__after_clear_bit(); -- scan_mapping_unevictable_pages(file->f_mapping); - } - retval = 0; - -diff --git a/mm/vmscan.c b/mm/vmscan.c -index f54a05b..824676a 100644 ---- a/mm/vmscan.c -+++ b/mm/vmscan.c -@@ -3353,6 +3353,7 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) - return 1; - } - -+#ifdef CONFIG_SHMEM - /** - * check_move_unevictable_page - check page for evictability and move to appropriate zone lru list - * @page: page to check evictability and move to appropriate lru list -@@ -3363,6 +3364,8 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) - * - * Restrictions: zone->lru_lock must be held, page must be on LRU and must - * have PageUnevictable set. -+ * -+ * This function is only used for SysV IPC SHM_UNLOCK. - */ - static void check_move_unevictable_page(struct page *page, struct zone *zone) - { -@@ -3396,6 +3399,8 @@ retry: - * - * Scan all pages in mapping. Check unevictable pages for - * evictability and move them to the appropriate zone lru list. -+ * -+ * This function is only used for SysV IPC SHM_UNLOCK. - */ - void scan_mapping_unevictable_pages(struct address_space *mapping) - { -@@ -3441,9 +3446,14 @@ void scan_mapping_unevictable_pages(struct address_space *mapping) - pagevec_release(&pvec); - - count_vm_events(UNEVICTABLE_PGSCANNED, pg_scanned); -+ cond_resched(); - } -- - } -+#else -+void scan_mapping_unevictable_pages(struct address_space *mapping) -+{ -+} -+#endif /* CONFIG_SHMEM */ - - static void warn_scan_unevictable_pages(void) - { --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-Linux-3.2.2.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-Linux-3.2.2.patch new file mode 100644 index 00000000..f4e3ff56 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-Linux-3.2.2.patch @@ -0,0 +1,24 @@ +From 8e03b0ed729407fef72578c24148208a079e7f2c Mon Sep 17 00:00:00 2001 +From: Greg Kroah-Hartman +Date: Wed, 25 Jan 2012 16:39:32 -0800 +Subject: [PATCH 129/129] Linux 3.2.2 + +--- + Makefile | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index c5edffa..2f684da 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,6 +1,6 @@ + VERSION = 3 + PATCHLEVEL = 2 +-SUBLEVEL = 1 ++SUBLEVEL = 2 + EXTRAVERSION = + NAME = Saber-toothed Squirrel + +-- +1.7.9.5 + diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch deleted file mode 100644 index 9371b39b..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0129-SHM_UNLOCK-fix-Unevictable-pages-stranded-after-swap.patch +++ /dev/null @@ -1,342 +0,0 @@ -From ab3abbd7cc331621031a1c603fc6be86c5a72430 Mon Sep 17 00:00:00 2001 -From: Hugh Dickins -Date: Fri, 20 Jan 2012 14:34:21 -0800 -Subject: [PATCH 129/130] SHM_UNLOCK: fix Unevictable pages stranded after - swap - -commit 245132643e1cfcd145bbc86a716c1818371fcb93 upstream. - -Commit cc39c6a9bbde ("mm: account skipped entries to avoid looping in -find_get_pages") correctly fixed an infinite loop; but left a problem -that find_get_pages() on shmem would return 0 (appearing to callers to -mean end of tree) when it meets a run of nr_pages swap entries. - -The only uses of find_get_pages() on shmem are via pagevec_lookup(), -called from invalidate_mapping_pages(), and from shmctl SHM_UNLOCK's -scan_mapping_unevictable_pages(). The first is already commented, and -not worth worrying about; but the second can leave pages on the -Unevictable list after an unusual sequence of swapping and locking. - -Fix that by using shmem_find_get_pages_and_swap() (then ignoring the -swap) instead of pagevec_lookup(). - -But I don't want to contaminate vmscan.c with shmem internals, nor -shmem.c with LRU locking. So move scan_mapping_unevictable_pages() into -shmem.c, renaming it shmem_unlock_mapping(); and rename -check_move_unevictable_page() to check_move_unevictable_pages(), looping -down an array of pages, oftentimes under the same lock. - -Leave out the "rotate unevictable list" block: that's a leftover from -when this was used for /proc/sys/vm/scan_unevictable_pages, whose flawed -handling involved looking at pages at tail of LRU. - -Was there significance to the sequence first ClearPageUnevictable, then -test page_evictable, then SetPageUnevictable here? I think not, we're -under LRU lock, and have no barriers between those. - -Signed-off-by: Hugh Dickins -Reviewed-by: KOSAKI Motohiro -Cc: Minchan Kim -Cc: Rik van Riel -Cc: Shaohua Li -Cc: Eric Dumazet -Cc: Johannes Weiner -Cc: Michel Lespinasse -Signed-off-by: Andrew Morton -Signed-off-by: Linus Torvalds -Signed-off-by: Greg Kroah-Hartman ---- - include/linux/shmem_fs.h | 1 + - include/linux/swap.h | 2 +- - ipc/shm.c | 2 +- - mm/shmem.c | 46 +++++++++++++++-- - mm/vmscan.c | 122 ++++++++++++++-------------------------------- - 5 files changed, 81 insertions(+), 92 deletions(-) - -diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h -index 9291ac3..6f10c9c 100644 ---- a/include/linux/shmem_fs.h -+++ b/include/linux/shmem_fs.h -@@ -48,6 +48,7 @@ extern struct file *shmem_file_setup(const char *name, - loff_t size, unsigned long flags); - extern int shmem_zero_setup(struct vm_area_struct *); - extern int shmem_lock(struct file *file, int lock, struct user_struct *user); -+extern void shmem_unlock_mapping(struct address_space *mapping); - extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping, - pgoff_t index, gfp_t gfp_mask); - extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); -diff --git a/include/linux/swap.h b/include/linux/swap.h -index 1e22e12..67b3fa3 100644 ---- a/include/linux/swap.h -+++ b/include/linux/swap.h -@@ -272,7 +272,7 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) - #endif - - extern int page_evictable(struct page *page, struct vm_area_struct *vma); --extern void scan_mapping_unevictable_pages(struct address_space *); -+extern void check_move_unevictable_pages(struct page **, int nr_pages); - - extern unsigned long scan_unevictable_pages; - extern int scan_unevictable_handler(struct ctl_table *, int, -diff --git a/ipc/shm.c b/ipc/shm.c -index 854ab58..b76be5b 100644 ---- a/ipc/shm.c -+++ b/ipc/shm.c -@@ -916,7 +916,7 @@ SYSCALL_DEFINE3(shmctl, int, shmid, int, cmd, struct shmid_ds __user *, buf) - shp->mlock_user = NULL; - get_file(shm_file); - shm_unlock(shp); -- scan_mapping_unevictable_pages(shm_file->f_mapping); -+ shmem_unlock_mapping(shm_file->f_mapping); - fput(shm_file); - goto out; - } -diff --git a/mm/shmem.c b/mm/shmem.c -index cc6d40b2..6c253f7 100644 ---- a/mm/shmem.c -+++ b/mm/shmem.c -@@ -379,7 +379,7 @@ static int shmem_free_swap(struct address_space *mapping, - /* - * Pagevec may contain swap entries, so shuffle up pages before releasing. - */ --static void shmem_pagevec_release(struct pagevec *pvec) -+static void shmem_deswap_pagevec(struct pagevec *pvec) - { - int i, j; - -@@ -389,7 +389,36 @@ static void shmem_pagevec_release(struct pagevec *pvec) - pvec->pages[j++] = page; - } - pvec->nr = j; -- pagevec_release(pvec); -+} -+ -+/* -+ * SysV IPC SHM_UNLOCK restore Unevictable pages to their evictable lists. -+ */ -+void shmem_unlock_mapping(struct address_space *mapping) -+{ -+ struct pagevec pvec; -+ pgoff_t indices[PAGEVEC_SIZE]; -+ pgoff_t index = 0; -+ -+ pagevec_init(&pvec, 0); -+ /* -+ * Minor point, but we might as well stop if someone else SHM_LOCKs it. -+ */ -+ while (!mapping_unevictable(mapping)) { -+ /* -+ * Avoid pagevec_lookup(): find_get_pages() returns 0 as if it -+ * has finished, if it hits a row of PAGEVEC_SIZE swap entries. -+ */ -+ pvec.nr = shmem_find_get_pages_and_swap(mapping, index, -+ PAGEVEC_SIZE, pvec.pages, indices); -+ if (!pvec.nr) -+ break; -+ index = indices[pvec.nr - 1] + 1; -+ shmem_deswap_pagevec(&pvec); -+ check_move_unevictable_pages(pvec.pages, pvec.nr); -+ pagevec_release(&pvec); -+ cond_resched(); -+ } - } - - /* -@@ -440,7 +469,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) - } - unlock_page(page); - } -- shmem_pagevec_release(&pvec); -+ shmem_deswap_pagevec(&pvec); -+ pagevec_release(&pvec); - mem_cgroup_uncharge_end(); - cond_resched(); - index++; -@@ -470,7 +500,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) - continue; - } - if (index == start && indices[0] > end) { -- shmem_pagevec_release(&pvec); -+ shmem_deswap_pagevec(&pvec); -+ pagevec_release(&pvec); - break; - } - mem_cgroup_uncharge_start(); -@@ -494,7 +525,8 @@ void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) - } - unlock_page(page); - } -- shmem_pagevec_release(&pvec); -+ shmem_deswap_pagevec(&pvec); -+ pagevec_release(&pvec); - mem_cgroup_uncharge_end(); - index++; - } -@@ -2439,6 +2471,10 @@ int shmem_lock(struct file *file, int lock, struct user_struct *user) - return 0; - } - -+void shmem_unlock_mapping(struct address_space *mapping) -+{ -+} -+ - void shmem_truncate_range(struct inode *inode, loff_t lstart, loff_t lend) - { - truncate_inode_pages_range(inode->i_mapping, lstart, lend); -diff --git a/mm/vmscan.c b/mm/vmscan.c -index 824676a..cb33d9c 100644 ---- a/mm/vmscan.c -+++ b/mm/vmscan.c -@@ -636,7 +636,7 @@ redo: - * When racing with an mlock or AS_UNEVICTABLE clearing - * (page is unlocked) make sure that if the other thread - * does not observe our setting of PG_lru and fails -- * isolation/check_move_unevictable_page, -+ * isolation/check_move_unevictable_pages, - * we see PG_mlocked/AS_UNEVICTABLE cleared below and move - * the page back to the evictable list. - * -@@ -3355,104 +3355,56 @@ int page_evictable(struct page *page, struct vm_area_struct *vma) - - #ifdef CONFIG_SHMEM - /** -- * check_move_unevictable_page - check page for evictability and move to appropriate zone lru list -- * @page: page to check evictability and move to appropriate lru list -- * @zone: zone page is in -+ * check_move_unevictable_pages - check pages for evictability and move to appropriate zone lru list -+ * @pages: array of pages to check -+ * @nr_pages: number of pages to check - * -- * Checks a page for evictability and moves the page to the appropriate -- * zone lru list. -- * -- * Restrictions: zone->lru_lock must be held, page must be on LRU and must -- * have PageUnevictable set. -+ * Checks pages for evictability and moves them to the appropriate lru list. - * - * This function is only used for SysV IPC SHM_UNLOCK. - */ --static void check_move_unevictable_page(struct page *page, struct zone *zone) -+void check_move_unevictable_pages(struct page **pages, int nr_pages) - { -- VM_BUG_ON(PageActive(page)); -+ struct zone *zone = NULL; -+ int pgscanned = 0; -+ int pgrescued = 0; -+ int i; - --retry: -- ClearPageUnevictable(page); -- if (page_evictable(page, NULL)) { -- enum lru_list l = page_lru_base_type(page); -+ for (i = 0; i < nr_pages; i++) { -+ struct page *page = pages[i]; -+ struct zone *pagezone; - -- __dec_zone_state(zone, NR_UNEVICTABLE); -- list_move(&page->lru, &zone->lru[l].list); -- mem_cgroup_move_lists(page, LRU_UNEVICTABLE, l); -- __inc_zone_state(zone, NR_INACTIVE_ANON + l); -- __count_vm_event(UNEVICTABLE_PGRESCUED); -- } else { -- /* -- * rotate unevictable list -- */ -- SetPageUnevictable(page); -- list_move(&page->lru, &zone->lru[LRU_UNEVICTABLE].list); -- mem_cgroup_rotate_lru_list(page, LRU_UNEVICTABLE); -- if (page_evictable(page, NULL)) -- goto retry; -- } --} -- --/** -- * scan_mapping_unevictable_pages - scan an address space for evictable pages -- * @mapping: struct address_space to scan for evictable pages -- * -- * Scan all pages in mapping. Check unevictable pages for -- * evictability and move them to the appropriate zone lru list. -- * -- * This function is only used for SysV IPC SHM_UNLOCK. -- */ --void scan_mapping_unevictable_pages(struct address_space *mapping) --{ -- pgoff_t next = 0; -- pgoff_t end = (i_size_read(mapping->host) + PAGE_CACHE_SIZE - 1) >> -- PAGE_CACHE_SHIFT; -- struct zone *zone; -- struct pagevec pvec; -+ pgscanned++; -+ pagezone = page_zone(page); -+ if (pagezone != zone) { -+ if (zone) -+ spin_unlock_irq(&zone->lru_lock); -+ zone = pagezone; -+ spin_lock_irq(&zone->lru_lock); -+ } - -- if (mapping->nrpages == 0) -- return; -+ if (!PageLRU(page) || !PageUnevictable(page)) -+ continue; - -- pagevec_init(&pvec, 0); -- while (next < end && -- pagevec_lookup(&pvec, mapping, next, PAGEVEC_SIZE)) { -- int i; -- int pg_scanned = 0; -- -- zone = NULL; -- -- for (i = 0; i < pagevec_count(&pvec); i++) { -- struct page *page = pvec.pages[i]; -- pgoff_t page_index = page->index; -- struct zone *pagezone = page_zone(page); -- -- pg_scanned++; -- if (page_index > next) -- next = page_index; -- next++; -- -- if (pagezone != zone) { -- if (zone) -- spin_unlock_irq(&zone->lru_lock); -- zone = pagezone; -- spin_lock_irq(&zone->lru_lock); -- } -+ if (page_evictable(page, NULL)) { -+ enum lru_list lru = page_lru_base_type(page); - -- if (PageLRU(page) && PageUnevictable(page)) -- check_move_unevictable_page(page, zone); -+ VM_BUG_ON(PageActive(page)); -+ ClearPageUnevictable(page); -+ __dec_zone_state(zone, NR_UNEVICTABLE); -+ list_move(&page->lru, &zone->lru[lru].list); -+ mem_cgroup_move_lists(page, LRU_UNEVICTABLE, lru); -+ __inc_zone_state(zone, NR_INACTIVE_ANON + lru); -+ pgrescued++; - } -- if (zone) -- spin_unlock_irq(&zone->lru_lock); -- pagevec_release(&pvec); -+ } - -- count_vm_events(UNEVICTABLE_PGSCANNED, pg_scanned); -- cond_resched(); -+ if (zone) { -+ __count_vm_events(UNEVICTABLE_PGRESCUED, pgrescued); -+ __count_vm_events(UNEVICTABLE_PGSCANNED, pgscanned); -+ spin_unlock_irq(&zone->lru_lock); - } - } --#else --void scan_mapping_unevictable_pages(struct address_space *mapping) --{ --} - #endif /* CONFIG_SHMEM */ - - static void warn_scan_unevictable_pages(void) --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0130-Linux-3.2.2.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0130-Linux-3.2.2.patch deleted file mode 100644 index 4b7bd534..00000000 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.2/0130-Linux-3.2.2.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 43a16c537c58047f07f1700cb0b15982ab68c6b8 Mon Sep 17 00:00:00 2001 -From: Greg Kroah-Hartman -Date: Wed, 25 Jan 2012 16:39:32 -0800 -Subject: [PATCH 130/130] Linux 3.2.2 - ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index c5edffa..2f684da 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,6 +1,6 @@ - VERSION = 3 - PATCHLEVEL = 2 --SUBLEVEL = 1 -+SUBLEVEL = 2 - EXTRAVERSION = - NAME = Saber-toothed Squirrel - --- -1.7.9.4 - diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/am335x-pm-firmware.bin b/recipes-kernel/linux/linux-ti33x-psp-3.2/am335x-pm-firmware.bin new file mode 100644 index 00000000..571d377d Binary files /dev/null and b/recipes-kernel/linux/linux-ti33x-psp-3.2/am335x-pm-firmware.bin differ diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch index 99ab48f7..6676539f 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch @@ -1,7 +1,7 @@ -From d325c3f83e6f42536678dbf317f1bbf0e3f8efc7 Mon Sep 17 00:00:00 2001 +From 0a4a06fdba20b76d03dde619a4dec0e88cdad6c3 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Fri, 7 Oct 2011 15:29:28 +0200 -Subject: [PATCH 01/22] f_rndis: HACK around undefined variables +Subject: [PATCH 01/26] f_rndis: HACK around undefined variables Signed-off-by: Koen Kooi --- @@ -27,5 +27,5 @@ index 6614490..d2f1b6f 100644 * the network link ... which is unavailable to this code * until we're activated via set_alt(). -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch index 1cc88e44..23b7aaf5 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch @@ -1,7 +1,7 @@ -From 94e7b8b9535e83ad46a523bb5020bd9fdb352f54 Mon Sep 17 00:00:00 2001 +From a89b2d3cdef2af0baa57f31da5e39537d22c247c Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Thu, 3 Nov 2011 17:35:50 +0100 -Subject: [PATCH 02/22] da8xx-fb: add DVI support for beaglebone +Subject: [PATCH 02/26] da8xx-fb: add DVI support for beaglebone Signed-off-by: Koen Kooi --- @@ -9,10 +9,10 @@ Signed-off-by: Koen Kooi 1 file changed, 14 insertions(+) diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c -index 85eda33..dea8936 100644 +index 2e69278..b01f15b 100644 --- a/drivers/video/da8xx-fb.c +++ b/drivers/video/da8xx-fb.c -@@ -271,6 +271,20 @@ static struct da8xx_panel known_lcd_panels[] = { +@@ -272,6 +272,20 @@ static struct da8xx_panel known_lcd_panels[] = { .pxl_clk = 30000000, .invert_pxl_clk = 0, }, @@ -34,5 +34,5 @@ index 85eda33..dea8936 100644 /* Enable the Raster Engine of the LCD Controller */ -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch index c5b1ce0d..4b682c5c 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch @@ -1,15 +1,16 @@ -From 839c23bffe07e2c955904ce3e9e3c776c1b2f88b Mon Sep 17 00:00:00 2001 +From 5b5413023290ed7f79ef3018eeee046c7736d7d0 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Mon, 30 Jan 2012 21:30:09 +0100 -Subject: [PATCH 03/22] beaglebone: rebase everything onto 3.2 - WARNING +Subject: [PATCH 03/26] beaglebone: rebase everything onto 3.2 - WARNING MEGAPATCH +Signed-off-by: Koen Kooi --- - arch/arm/mach-omap2/board-am335xevm.c | 425 ++++++++++++++++++++++++++++++++- - 1 file changed, 414 insertions(+), 11 deletions(-) + arch/arm/mach-omap2/board-am335xevm.c | 426 ++++++++++++++++++++++++++++++++- + 1 file changed, 415 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index 8aa7e10..e0c20c5 100644 +index 70aa3a9..12a269f 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c @@ -19,6 +19,7 @@ @@ -20,7 +21,15 @@ index 8aa7e10..e0c20c5 100644 #include #include #include -@@ -167,6 +168,66 @@ struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = { +@@ -35,7 +36,6 @@ + #include + #include + #include +-#include + #include + #include + +@@ -172,6 +172,68 @@ struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = { #include "common.h" @@ -84,14 +93,15 @@ index 8aa7e10..e0c20c5 100644 + .type = "1024x768@60", +}; + - /* TSc controller */ - #include ++/* TSc controller */ ++#include #include -@@ -320,9 +381,34 @@ struct am335x_evm_eeprom_config { - static struct am335x_evm_eeprom_config config; + + /* TSc controller */ +@@ -340,9 +402,34 @@ static struct am335x_evm_eeprom_config config; + static struct am335x_eeprom_config1 config1; static bool daughter_brd_detected; --#define GP_EVM_REV_IS_1_0 0x1 +struct beaglebone_cape_eeprom_config { + u32 header; + char format_revision[2]; @@ -116,14 +126,14 @@ index 8aa7e10..e0c20c5 100644 +static bool beaglebone_tsadcpins_free = 1; + + -+#define GP_EVM_REV_IS_1_0A 0x1 + #define GP_EVM_REV_IS_1_0 0x1 #define GP_EVM_REV_IS_1_1A 0x2 #define GP_EVM_REV_IS_UNKNOWN 0xFF +#define GP_EVM_ACTUALLY_BEAGLEBONE 0xBB static unsigned int gp_evm_revision = GP_EVM_REV_IS_UNKNOWN; - unsigned int gigabit_enable = 1; -@@ -404,11 +490,102 @@ static struct pinmux_config lcdc_pin_mux[] = { + unsigned int gigabit_enable = 1; +@@ -425,11 +512,102 @@ static struct pinmux_config lcdc_pin_mux[] = { {NULL, 0}, }; @@ -226,7 +236,7 @@ index 8aa7e10..e0c20c5 100644 {"vrefp.vrefp", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {"vrefn.vrefn", OMAP_MUX_MODE0 | AM33XX_INPUT_EN}, {NULL, 0}, -@@ -543,9 +720,9 @@ static struct pinmux_config i2c1_pin_mux[] = { +@@ -564,9 +742,9 @@ static struct pinmux_config i2c1_pin_mux[] = { static struct pinmux_config i2c2_pin_mux[] = { {"uart1_ctsn.i2c2_sda", OMAP_MUX_MODE3 | AM33XX_SLEWCTRL_SLOW | @@ -238,7 +248,7 @@ index 8aa7e10..e0c20c5 100644 {NULL, 0}, }; -@@ -823,6 +1000,64 @@ static struct pinmux_config profibus_pin_mux[] = { +@@ -844,6 +1022,64 @@ static struct pinmux_config profibus_pin_mux[] = { {NULL, 0}, }; @@ -303,7 +313,7 @@ index 8aa7e10..e0c20c5 100644 /* Module pin mux for eCAP0 */ static struct pinmux_config ecap0_pin_mux[] = { {"ecap0_in_pwm0_out.ecap0_in_pwm0_out", -@@ -932,6 +1167,51 @@ static void lcdc_init(int evm_id, int profile) +@@ -966,6 +1202,51 @@ static void lcdc_init(int evm_id, int profile) return; } @@ -355,7 +365,7 @@ index 8aa7e10..e0c20c5 100644 static void tsc_init(int evm_id, int profile) { int err; -@@ -939,16 +1219,48 @@ static void tsc_init(int evm_id, int profile) +@@ -973,10 +1254,15 @@ static void tsc_init(int evm_id, int profile) if (gp_evm_revision == GP_EVM_REV_IS_1_1A) { am335x_touchscreen_data.analog_input = 1; pr_info("TSC connected to beta GP EVM\n"); @@ -370,8 +380,9 @@ index 8aa7e10..e0c20c5 100644 + pr_info("TSC connected to BeagleBone\n");; + } setup_pin_mux(tsc_pin_mux); - err = platform_device_register(&tsc_device); - if (err) + + err = am33xx_register_tsc(&am335x_touchscreen_data); +@@ -984,6 +1270,33 @@ static void tsc_init(int evm_id, int profile) pr_err("failed to register touchscreen device\n"); } @@ -379,7 +390,7 @@ index 8aa7e10..e0c20c5 100644 +{ + int err; + setup_pin_mux(tsc_pin_mux); -+ err = platform_device_register(&bone_tsc_device); ++ err = am33xx_register_tsc(&bone_touchscreen_data); + if (err) + pr_err("failed to register touchscreen device\n"); +} @@ -405,7 +416,7 @@ index 8aa7e10..e0c20c5 100644 static void rgmii1_init(int evm_id, int profile) { setup_pin_mux(rgmii1_pin_mux); -@@ -1358,18 +1670,106 @@ static void i2c1_init(int evm_id, int profile) +@@ -1429,18 +1742,106 @@ static void i2c1_init(int evm_id, int profile) return; } @@ -517,7 +528,7 @@ index 8aa7e10..e0c20c5 100644 /* Setup McASP 1 */ static void mcasp1_init(int evm_id, int profile) { -@@ -1723,8 +2123,9 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { +@@ -1794,8 +2195,9 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { {rmii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, @@ -528,7 +539,7 @@ index 8aa7e10..e0c20c5 100644 {NULL, 0, 0}, }; -@@ -1734,8 +2135,9 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { +@@ -1805,8 +2207,9 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, @@ -539,7 +550,7 @@ index 8aa7e10..e0c20c5 100644 {NULL, 0, 0}, }; -@@ -1822,6 +2224,7 @@ static void setup_beaglebone_old(void) +@@ -1893,6 +2296,7 @@ static void setup_beaglebone_old(void) static void setup_beaglebone(void) { pr_info("The board is a AM335x Beaglebone.\n"); @@ -548,5 +559,5 @@ index 8aa7e10..e0c20c5 100644 /* Beagle Bone has Micro-SD slot which doesn't have Write Protect pin */ am335x_mmc[0].gpio_wp = -EINVAL; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0004-more-beaglebone-merges.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0004-more-beaglebone-merges.patch index eb79ebb9..e8ef8eeb 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0004-more-beaglebone-merges.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0004-more-beaglebone-merges.patch @@ -1,18 +1,18 @@ -From e32e80d4258b45a8b59306c3cf2ab35e6ec19ac2 Mon Sep 17 00:00:00 2001 +From f5d99c334bedef5b0213118590ea2ad7dbc2e29a Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 31 Jan 2012 10:04:03 +0100 -Subject: [PATCH 04/22] more beaglebone merges +Subject: [PATCH 04/26] more beaglebone merges Signed-off-by: Koen Kooi --- - arch/arm/mach-omap2/board-am335xevm.c | 63 +++++++++++++++++++++++++++++++-- - 1 file changed, 60 insertions(+), 3 deletions(-) + arch/arm/mach-omap2/board-am335xevm.c | 52 +++++++++++++++++++++++++++++++-- + 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index e0c20c5..177ab9e 100644 +index 12a269f..3c67e94 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -248,6 +248,11 @@ static struct resource tsc_resources[] = { +@@ -240,6 +240,11 @@ struct da8xx_lcdc_platform_data dvi_pdata = { static struct tsc_data am335x_touchscreen_data = { .wires = 4, .x_plate_resistance = 200, @@ -23,34 +23,16 @@ index e0c20c5..177ab9e 100644 + .mode = TI_TSCADC_GENMODE, }; - static struct platform_device tsc_device = { -@@ -260,6 +265,16 @@ static struct platform_device tsc_device = { - .resource = tsc_resources, - }; - -+static struct platform_device bone_tsc_device = { -+ .name = "tsc", -+ .id = -1, -+ .dev = { -+ .platform_data = &bone_touchscreen_data, -+ }, -+ .num_resources = ARRAY_SIZE(tsc_resources), -+ .resource = tsc_resources, -+}; -+ static u8 am335x_iis_serializer_direction1[] = { - INACTIVE_MODE, INACTIVE_MODE, TX_MODE, RX_MODE, - INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, INACTIVE_MODE, -@@ -404,7 +419,7 @@ static bool beaglebone_cape_detected; - static int capecount = 0; - static bool beaglebone_tsadcpins_free = 1; +@@ -427,6 +432,7 @@ static bool beaglebone_tsadcpins_free = 1; + -- -+#define GP_EVM_REV_IS_1_0 0x1 - #define GP_EVM_REV_IS_1_0A 0x1 + #define GP_EVM_REV_IS_1_0 0x1 ++#define GP_EVM_REV_IS_1_0A 0x1 #define GP_EVM_REV_IS_1_1A 0x2 #define GP_EVM_REV_IS_UNKNOWN 0xFF -@@ -1000,6 +1015,47 @@ static struct pinmux_config profibus_pin_mux[] = { + #define GP_EVM_ACTUALLY_BEAGLEBONE 0xBB +@@ -1022,6 +1028,47 @@ static struct pinmux_config profibus_pin_mux[] = { {NULL, 0}, }; @@ -98,7 +80,7 @@ index e0c20c5..177ab9e 100644 #define BEAGLEBONEDVI_USR0_LED GPIO_TO_PIN(1, 18) #define BEAGLEBONEDVI_USR1_LED GPIO_TO_PIN(1, 19) -@@ -1703,11 +1759,11 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context +@@ -1775,11 +1822,11 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context snprintf(tmp, sizeof(cape_config.partnumber) + 1, "%s", cape_config.partnumber); pr_info("BeagleBone cape partnumber: %s\n", tmp); @@ -112,7 +94,7 @@ index e0c20c5..177ab9e 100644 pr_info("BeagleBone cape: initializing LCD cape\n"); bbtoys7lcd_init(0,0); pr_info("BeagleBone cape: initializing LCD cape touchscreen\n"); -@@ -2154,6 +2210,7 @@ static void setup_general_purpose_evm(void) +@@ -2226,6 +2273,7 @@ static void setup_general_purpose_evm(void) pr_info("The board is general purpose EVM in profile %d\n", prof_sel); if (!strncmp("1.1A", config.version, 4)) { @@ -121,5 +103,5 @@ index e0c20c5..177ab9e 100644 } else if (!strncmp("1.0", config.version, 3)) { gp_evm_revision = GP_EVM_REV_IS_1_0; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0005-beaglebone-disable-tsadc.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0005-beaglebone-disable-tsadc.patch index 5b60b4c7..a7f53852 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0005-beaglebone-disable-tsadc.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0005-beaglebone-disable-tsadc.patch @@ -1,7 +1,7 @@ -From 622a15ae235de585d3223384828d68ed6faa7730 Mon Sep 17 00:00:00 2001 +From ca13fa5f840198db430a21a643f3df4788f21b85 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 31 Jan 2012 10:09:06 +0100 -Subject: [PATCH 05/22] beaglebone: disable tsadc +Subject: [PATCH 05/26] beaglebone: disable tsadc Signed-off-by: Koen Kooi --- @@ -9,10 +9,10 @@ Signed-off-by: Koen Kooi 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index 177ab9e..87ccf14 100644 +index 3c67e94..b0f5ce3 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -248,11 +248,11 @@ static struct resource tsc_resources[] = { +@@ -240,11 +240,11 @@ struct da8xx_lcdc_platform_data dvi_pdata = { static struct tsc_data am335x_touchscreen_data = { .wires = 4, .x_plate_resistance = 200, @@ -25,7 +25,7 @@ index 177ab9e..87ccf14 100644 +// .mode = TI_TSCADC_GENMODE, }; - static struct platform_device tsc_device = { + static u8 am335x_iis_serializer_direction1[] = { -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0006-tscadc-Add-general-purpose-mode-untested-with-touchs.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0006-tscadc-Add-general-purpose-mode-untested-with-touchs.patch index 69f2e4e0..01c309d1 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0006-tscadc-Add-general-purpose-mode-untested-with-touchs.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0006-tscadc-Add-general-purpose-mode-untested-with-touchs.patch @@ -1,7 +1,7 @@ -From cd5378a9341cb6c5ea511a95ec8ebbfeb2aae44d Mon Sep 17 00:00:00 2001 +From 529eb4be71f6387842a1823c7dcac803cc31d8f9 Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Wed, 30 Nov 2011 15:00:40 +0100 -Subject: [PATCH 06/22] tscadc: Add general purpose mode, untested with +Subject: [PATCH 06/26] tscadc: Add general purpose mode, untested with touchscreen functionality Signed-off-by: Joel A Fernandes @@ -14,15 +14,15 @@ Conflicts: arch/arm/mach-omap2/board-am335xevm.c | 2 + arch/arm/mach-omap2/mux33xx.c | 12 ++ arch/arm/mach-omap2/mux33xx.h | 4 + - drivers/input/touchscreen/ti_tscadc.c | 209 +++++++++++++++++++++++++-------- + drivers/input/touchscreen/ti_tscadc.c | 205 +++++++++++++++++++++++++-------- include/linux/input/ti_tscadc.h | 4 + - 5 files changed, 180 insertions(+), 51 deletions(-) + 5 files changed, 178 insertions(+), 49 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index 87ccf14..c7bb091 100644 +index b0f5ce3..5ab9c18 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -2182,6 +2182,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { +@@ -2245,6 +2245,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -30,7 +30,7 @@ index 87ccf14..c7bb091 100644 {NULL, 0, 0}, }; -@@ -2194,6 +2195,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { +@@ -2257,6 +2258,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -39,7 +39,7 @@ index 87ccf14..c7bb091 100644 }; diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c -index 8df8fa9..14ef129 100644 +index 59e51e0..572ed16 100644 --- a/arch/arm/mach-omap2/mux33xx.c +++ b/arch/arm/mach-omap2/mux33xx.c @@ -584,6 +584,18 @@ static struct omap_mux __initdata am33xx_muxmodes[] = { @@ -77,23 +77,22 @@ index 70a3012..348c8e5 100644 #define AM33XX_CONTROL_PADCONF_AIN2_OFFSET 0x0B24 #define AM33XX_CONTROL_PADCONF_AIN1_OFFSET 0x0B28 diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index e3b5775..699503d 100644 +index 950c07f..2f38c0c 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -27,6 +27,8 @@ - #include +@@ -28,6 +28,8 @@ #include + #include +/* Memory mapped registers here have incorrect offsets! + * Correct after referring TRM */ #define TSCADC_REG_IRQEOI 0x020 #define TSCADC_REG_RAWIRQSTATUS 0x024 #define TSCADC_REG_IRQSTATUS 0x028 -@@ -54,12 +56,18 @@ - - /* Register Bitfields */ +@@ -58,12 +60,19 @@ #define TSCADC_IRQWKUP_ENB BIT(0) --#define TSCADC_STPENB_STEPENB 0x7FFF + #define TSCADC_IRQWKUP_DISABLE 0x00 + #define TSCADC_STPENB_STEPENB 0x7FFF +#define TSCADC_STPENB_STEPENB_TOUCHSCREEN 0x7FFF +#define TSCADC_STPENB_STEPENB_GENERAL 0x0400 #define TSCADC_IRQENB_FIFO0THRES BIT(2) @@ -101,8 +100,8 @@ index e3b5775..699503d 100644 #define TSCADC_IRQENB_FIFO1THRES BIT(5) +#define TSCADC_IRQENB_EOS BIT(1) #define TSCADC_IRQENB_PENUP BIT(9) --#define TSCADC_STEPCONFIG_MODE_HWSYNC 0x2 -+#define TSCADC_STEPCONFIG_MODE_HWSYNC 0x2 + #define TSCADC_IRQENB_HW_PEN BIT(0) + #define TSCADC_STEPCONFIG_MODE_HWSYNC 0x2 +#define TSCADC_STEPCONFIG_MODE_SWCONT 0x1 +#define TSCADC_STEPCONFIG_MODE_SWONESHOT 0x0 #define TSCADC_STEPCONFIG_2SAMPLES_AVG (1 << 4) @@ -110,15 +109,15 @@ index e3b5775..699503d 100644 #define TSCADC_STEPCONFIG_XPP BIT(5) #define TSCADC_STEPCONFIG_XNN BIT(6) #define TSCADC_STEPCONFIG_YPP BIT(7) -@@ -105,6 +113,7 @@ struct tscadc { +@@ -108,6 +117,7 @@ struct tscadc { + int wires; int analog_input; int x_plate_resistance; - struct clk *tsc_ick; + int mode; int irq; void __iomem *tsc_base; - }; -@@ -120,6 +129,86 @@ static void tscadc_writel(struct tscadc *tsc, unsigned int reg, + unsigned int ctrl; +@@ -124,6 +134,86 @@ static void tscadc_writel(struct tscadc *tsc, unsigned int reg, writel(val, tsc->tsc_base + reg); } @@ -205,7 +204,7 @@ index e3b5775..699503d 100644 static void tsc_step_config(struct tscadc *ts_dev) { unsigned int stepconfigx = 0, stepconfigy = 0; -@@ -224,7 +313,7 @@ static void tsc_step_config(struct tscadc *ts_dev) +@@ -228,7 +318,7 @@ static void tsc_step_config(struct tscadc *ts_dev) tscadc_writel(ts_dev, TSCADC_REG_STEPCONFIG14, stepconfigz2); tscadc_writel(ts_dev, TSCADC_REG_STEPDELAY14, delay); @@ -214,7 +213,7 @@ index e3b5775..699503d 100644 } static void tsc_idle_config(struct tscadc *ts_config) -@@ -242,7 +331,7 @@ static void tsc_idle_config(struct tscadc *ts_config) +@@ -246,7 +336,7 @@ static void tsc_idle_config(struct tscadc *ts_config) tscadc_writel(ts_config, TSCADC_REG_IDLECONFIG, idleconfig); } @@ -223,7 +222,7 @@ index e3b5775..699503d 100644 { struct tscadc *ts_dev = (struct tscadc *)dev; struct input_dev *input_dev = ts_dev->input; -@@ -362,7 +451,7 @@ static irqreturn_t tscadc_interrupt(int irq, void *dev) +@@ -367,7 +457,7 @@ static irqreturn_t tscadc_interrupt(int irq, void *dev) /* check pending interrupts */ tscadc_writel(ts_dev, TSCADC_REG_IRQEOI, 0x0); @@ -232,7 +231,7 @@ index e3b5775..699503d 100644 return IRQ_HANDLED; } -@@ -400,13 +489,15 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -405,13 +495,15 @@ static int __devinit tscadc_probe(struct platform_device *pdev) return -ENODEV; } @@ -254,7 +253,7 @@ index e3b5775..699503d 100644 res = request_mem_region(res->start, resource_size(res), pdev->name); if (!res) { -@@ -422,8 +513,15 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -427,8 +519,15 @@ static int __devinit tscadc_probe(struct platform_device *pdev) goto err_release_mem; } @@ -272,7 +271,7 @@ index e3b5775..699503d 100644 if (err) { dev_err(&pdev->dev, "failed to allocate irq.\n"); goto err_unmap_regs; -@@ -443,11 +541,17 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -444,12 +543,18 @@ static int __devinit tscadc_probe(struct platform_device *pdev) goto err_free_irq; } clock_rate = clk_get_rate(clk); @@ -284,13 +283,14 @@ index e3b5775..699503d 100644 clk_value = clock_rate / ADC_CLK; if (clk_value < 7) { dev_err(&pdev->dev, "clock input less than min clock requirement\n"); + err = -EINVAL; goto err_fail; } + /* TSCADC_CLKDIV needs to be configured to the value minus 1 */ clk_value = clk_value - 1; tscadc_writel(ts_dev, TSCADC_REG_CLKDIV, clk_value); -@@ -458,57 +562,60 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -457,53 +562,55 @@ static int __devinit tscadc_probe(struct platform_device *pdev) ts_dev->wires = pdata->wires; ts_dev->analog_input = pdata->analog_input; ts_dev->x_plate_resistance = pdata->x_plate_resistance; @@ -327,6 +327,7 @@ index e3b5775..699503d 100644 + } } tscadc_writel(ts_dev, TSCADC_REG_CTRL, ctrl); + ts_dev->ctrl = ctrl; - /* Set register bits for Idel Config Mode */ - tsc_idle_config(ts_dev); @@ -381,14 +382,8 @@ index e3b5775..699503d 100644 - goto err_fail; + tscadc_writel(ts_dev, TSCADC_REG_CTRL, ctrl); /* Turn on TSC_ADC */ + device_init_wakeup(&pdev->dev, true); platform_set_drvdata(pdev, ts_dev); - return 0; - - err_fail: -+ printk(KERN_ERR "Fatal error, shutting down TSC_ADC\n"); - clk_disable(ts_dev->tsc_ick); - clk_put(ts_dev->tsc_ick); - err_free_irq: diff --git a/include/linux/input/ti_tscadc.h b/include/linux/input/ti_tscadc.h index 2c547bb..850cd4b 100644 --- a/include/linux/input/ti_tscadc.h @@ -407,5 +402,5 @@ index 2c547bb..850cd4b 100644 + int mode; }; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0007-tscadc-Add-board-file-mfd-support-fix-warning.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0007-tscadc-Add-board-file-mfd-support-fix-warning.patch index 6f37ba61..81192703 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0007-tscadc-Add-board-file-mfd-support-fix-warning.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0007-tscadc-Add-board-file-mfd-support-fix-warning.patch @@ -1,7 +1,7 @@ -From f6e6f6bf5e460f5294b4f0f05af14506db631b55 Mon Sep 17 00:00:00 2001 +From 3d2d69999a7de330c9c1e85fcedb094d4f160e16 Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Wed, 30 Nov 2011 15:02:17 +0100 -Subject: [PATCH 07/22] tscadc: Add board file mfd support, fix warning +Subject: [PATCH 07/26] tscadc: Add board file mfd support, fix warning Signed-off-by: Joel A Fernandes @@ -14,10 +14,10 @@ Conflicts: 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index c7bb091..17705b3 100644 +index 5ab9c18..2597650 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -2182,7 +2182,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { +@@ -2245,7 +2245,7 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -27,10 +27,10 @@ index c7bb091..17705b3 100644 }; diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index 699503d..f813564 100644 +index 2f38c0c..5070450 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -462,7 +462,7 @@ static irqreturn_t tsc_interrupt(int irq, void *dev) +@@ -468,7 +468,7 @@ static irqreturn_t tsc_interrupt(int irq, void *dev) static int __devinit tscadc_probe(struct platform_device *pdev) { struct tscadc *ts_dev; @@ -40,5 +40,5 @@ index 699503d..f813564 100644 int clk_value; int clock_rate, irqenable, ctrl; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0008-AM335X-init-tsc-bone-style-for-new-boards.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0008-AM335X-init-tsc-bone-style-for-new-boards.patch index 6f499185..2cf1fec4 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0008-AM335X-init-tsc-bone-style-for-new-boards.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0008-AM335X-init-tsc-bone-style-for-new-boards.patch @@ -1,7 +1,7 @@ -From d27f8ff05d04b9191f70eb8a7cb4d901d3ab50f7 Mon Sep 17 00:00:00 2001 +From 165b0cfffef915ca0efc4f55bc7078c55893ef3e Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Wed, 30 Nov 2011 15:03:59 +0100 -Subject: [PATCH 08/22] AM335X: init tsc bone style for new boards +Subject: [PATCH 08/26] AM335X: init tsc bone style for new boards Signed-off-by: Joel A Fernandes --- @@ -9,10 +9,10 @@ Signed-off-by: Joel A Fernandes 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index 17705b3..ac4f78f 100644 +index 2597650..5bac604 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -2195,7 +2195,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { +@@ -2258,7 +2258,7 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -22,5 +22,5 @@ index 17705b3..ac4f78f 100644 }; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0009-tscadc-make-stepconfig-channel-configurable.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0009-tscadc-make-stepconfig-channel-configurable.patch index 47d9b248..d1dadf20 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0009-tscadc-make-stepconfig-channel-configurable.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0009-tscadc-make-stepconfig-channel-configurable.patch @@ -1,7 +1,7 @@ -From 750ca3e9b053119b867d3630bf5c891b845144b3 Mon Sep 17 00:00:00 2001 +From f7e890d43fd383c48e75bbdc363e5ce44bd5eb04 Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Mon, 28 Nov 2011 18:18:04 -0600 -Subject: [PATCH 09/22] tscadc: make stepconfig channel-configurable +Subject: [PATCH 09/26] tscadc: make stepconfig channel-configurable Signed-off-by: Joel A Fernandes --- @@ -9,10 +9,10 @@ Signed-off-by: Joel A Fernandes 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index f813564..0b91bdc 100644 +index 5070450..3950696 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -129,7 +129,9 @@ static void tscadc_writel(struct tscadc *tsc, unsigned int reg, +@@ -134,7 +134,9 @@ static void tscadc_writel(struct tscadc *tsc, unsigned int reg, writel(val, tsc->tsc_base + reg); } @@ -23,7 +23,7 @@ index f813564..0b91bdc 100644 { unsigned int stepconfig = 0, delay = 0, chargeconfig = 0; -@@ -141,7 +143,7 @@ static void tsc_adc_step_config(struct tscadc *ts_dev) +@@ -146,7 +148,7 @@ static void tsc_adc_step_config(struct tscadc *ts_dev) */ stepconfig = TSCADC_STEPCONFIG_MODE_SWONESHOT | TSCADC_STEPCONFIG_2SAMPLES_AVG | @@ -32,7 +32,7 @@ index f813564..0b91bdc 100644 delay = TSCADC_STEPCONFIG_SAMPLEDLY | TSCADC_STEPCONFIG_OPENDLY; -@@ -602,7 +604,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -603,7 +605,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev) goto err_fail; } else { @@ -42,5 +42,5 @@ index f813564..0b91bdc 100644 irqenable = TSCADC_IRQENB_FIFO0THRES; } -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0010-tscadc-Trigger-through-sysfs.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0010-tscadc-Trigger-through-sysfs.patch index a008eb56..a0765427 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0010-tscadc-Trigger-through-sysfs.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0010-tscadc-Trigger-through-sysfs.patch @@ -1,7 +1,7 @@ -From fb718df2afa6f3876c22d830c55de70943d95812 Mon Sep 17 00:00:00 2001 +From 50c698d37ac59a4ba4cec9d6b844444e312e1a26 Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Mon, 28 Nov 2011 20:55:25 -0600 -Subject: [PATCH 10/22] tscadc: Trigger through sysfs +Subject: [PATCH 10/26] tscadc: Trigger through sysfs Signed-off-by: Joel A Fernandes @@ -14,15 +14,16 @@ Conflicts: 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index 0b91bdc..a74d9ba 100644 +index 3950696..8661b3a 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -26,6 +26,17 @@ +@@ -26,8 +26,19 @@ #include #include #include +#include -+ + #include + +size_t do_adc_sample(struct kobject *, struct attribute *, char *); +static DEVICE_ATTR(ain1, S_IRUGO, do_adc_sample, NULL); +static DEVICE_ATTR(ain2, S_IRUGO, do_adc_sample, NULL); @@ -32,10 +33,11 @@ index 0b91bdc..a74d9ba 100644 +static DEVICE_ATTR(ain6, S_IRUGO, do_adc_sample, NULL); +static DEVICE_ATTR(ain7, S_IRUGO, do_adc_sample, NULL); +static DEVICE_ATTR(ain8, S_IRUGO, do_adc_sample, NULL); - ++ /* Memory mapped registers here have incorrect offsets! * Correct after referring TRM */ -@@ -144,12 +155,12 @@ static void tsc_adc_step_config(struct tscadc *ts_dev, int channel) + #define TSCADC_REG_IRQEOI 0x020 +@@ -149,12 +160,12 @@ static void tsc_adc_step_config(struct tscadc *ts_dev, int channel) stepconfig = TSCADC_STEPCONFIG_MODE_SWONESHOT | TSCADC_STEPCONFIG_2SAMPLES_AVG | ((channel-1) << 19); @@ -50,7 +52,7 @@ index 0b91bdc..a74d9ba 100644 /* Get the ball rolling, this will trigger the FSM to step through * as soon as TSC_ADC_SS is turned on */ tscadc_writel(ts_dev, TSCADC_REG_SE, TSCADC_STPENB_STEPENB_GENERAL); -@@ -199,7 +210,7 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) +@@ -204,7 +215,7 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) irqclr |= TSCADC_IRQENB_FIFO1THRES; } @@ -59,7 +61,7 @@ index 0b91bdc..a74d9ba 100644 tscadc_writel(ts_dev, TSCADC_REG_IRQSTATUS, irqclr); -@@ -207,7 +218,7 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) +@@ -212,7 +223,7 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) tscadc_writel(ts_dev, TSCADC_REG_IRQEOI, 0x0); /* Turn on Step 1 again */ @@ -68,7 +70,7 @@ index 0b91bdc..a74d9ba 100644 return IRQ_HANDLED; } -@@ -461,6 +472,34 @@ static irqreturn_t tsc_interrupt(int irq, void *dev) +@@ -467,6 +478,34 @@ static irqreturn_t tsc_interrupt(int irq, void *dev) * The functions for inserting/removing driver as a module. */ @@ -103,7 +105,7 @@ index 0b91bdc..a74d9ba 100644 static int __devinit tscadc_probe(struct platform_device *pdev) { struct tscadc *ts_dev; -@@ -472,6 +511,18 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -478,6 +517,18 @@ static int __devinit tscadc_probe(struct platform_device *pdev) struct resource *res; struct clk *clk; @@ -122,7 +124,7 @@ index 0b91bdc..a74d9ba 100644 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) { dev_err(&pdev->dev, "no memory resource defined.\n"); -@@ -604,7 +655,6 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -605,7 +656,6 @@ static int __devinit tscadc_probe(struct platform_device *pdev) goto err_fail; } else { @@ -143,5 +145,5 @@ index 850cd4b..fc239c6 100644 #define TI_TSCADC_TSCMODE 0 #define TI_TSCADC_GENMODE 1 -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0011-meta-ti-Remove-debug-messages-for-meta-ti.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0011-meta-ti-Remove-debug-messages-for-meta-ti.patch index 9470d398..c7c1c373 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0011-meta-ti-Remove-debug-messages-for-meta-ti.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0011-meta-ti-Remove-debug-messages-for-meta-ti.patch @@ -1,7 +1,7 @@ -From f3e413faef836c5f9357f091d7149a8924ffabdd Mon Sep 17 00:00:00 2001 +From 92c8dd2fe6e62db7bcb07a9010c5eb9b757f2446 Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Mon, 28 Nov 2011 20:56:48 -0600 -Subject: [PATCH 11/22] meta-ti: Remove debug messages for meta-ti +Subject: [PATCH 11/26] meta-ti: Remove debug messages for meta-ti Signed-off-by: Joel A Fernandes --- @@ -9,10 +9,10 @@ Signed-off-by: Joel A Fernandes 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index a74d9ba..1f9cbf5 100644 +index 8661b3a..c82f9bf 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -181,14 +181,14 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) +@@ -186,14 +186,14 @@ static irqreturn_t tsc_adc_interrupt(int irq, void *dev) status = tscadc_readl(ts_dev, TSCADC_REG_IRQSTATUS); @@ -30,5 +30,5 @@ index a74d9ba..1f9cbf5 100644 for (i = 0; i < fifo1count; i++) { read_sample = tscadc_readl(ts_dev, TSCADC_REG_FIFO0); -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch index d1456ada..d08d8d5a 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0012-tscadc-switch-to-polling-instead-of-interrupts.patch @@ -1,7 +1,7 @@ -From 994bbaf10e91e859c54ba238e72e8f6f496c14e0 Mon Sep 17 00:00:00 2001 +From a1bedb47197c154069710b8f0f2258a7651cc05c Mon Sep 17 00:00:00 2001 From: Joel A Fernandes Date: Tue, 29 Nov 2011 09:44:22 -0600 -Subject: [PATCH 12/22] tscadc: switch to polling instead of interrupts +Subject: [PATCH 12/26] tscadc: switch to polling instead of interrupts Signed-off-by: Joel A Fernandes --- @@ -9,10 +9,10 @@ Signed-off-by: Joel A Fernandes 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/ti_tscadc.c b/drivers/input/touchscreen/ti_tscadc.c -index 1f9cbf5..8e2a994 100644 +index c82f9bf..3082e5c 100644 --- a/drivers/input/touchscreen/ti_tscadc.c +++ b/drivers/input/touchscreen/ti_tscadc.c -@@ -477,6 +477,8 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) { +@@ -483,6 +483,8 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) { struct device *dev; struct tscadc *ts_dev; int channel_num; @@ -21,7 +21,7 @@ index 1f9cbf5..8e2a994 100644 pdev = (struct platform_device *)container_of(kobj, struct device, kobj); dev = &pdev->dev; -@@ -496,7 +498,17 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) { +@@ -502,7 +504,17 @@ size_t do_adc_sample(struct kobject *kobj, struct attribute *attr, char *buf) { tsc_adc_step_config(ts_dev, channel_num); @@ -40,7 +40,7 @@ index 1f9cbf5..8e2a994 100644 return strlen(attr->name); } -@@ -656,7 +668,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev) +@@ -657,7 +669,7 @@ static int __devinit tscadc_probe(struct platform_device *pdev) } else { tscadc_writel(ts_dev, TSCADC_REG_FIFO0THR, 0); @@ -50,5 +50,5 @@ index 1f9cbf5..8e2a994 100644 tscadc_writel(ts_dev, TSCADC_REG_IRQENABLE, irqenable); -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0013-beaglebone-fix-ADC-init.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0013-beaglebone-fix-ADC-init.patch index 97367382..59318299 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0013-beaglebone-fix-ADC-init.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0013-beaglebone-fix-ADC-init.patch @@ -1,7 +1,7 @@ -From 045193b61f57d4244e569800b252fff5e6e91a4b Mon Sep 17 00:00:00 2001 +From 1d54ffc655a7d22e1477e3bc0d72c0593049d83b Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 31 Jan 2012 14:50:55 +0100 -Subject: [PATCH 13/22] beaglebone: fix ADC init +Subject: [PATCH 13/26] beaglebone: fix ADC init Signed-off-by: Koen Kooi --- @@ -9,10 +9,10 @@ Signed-off-by: Koen Kooi 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index ac4f78f..177ab9e 100644 +index 5bac604..3c67e94 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -248,11 +248,11 @@ static struct resource tsc_resources[] = { +@@ -240,11 +240,11 @@ struct da8xx_lcdc_platform_data dvi_pdata = { static struct tsc_data am335x_touchscreen_data = { .wires = 4, .x_plate_resistance = 200, @@ -25,8 +25,8 @@ index ac4f78f..177ab9e 100644 + .mode = TI_TSCADC_GENMODE, }; - static struct platform_device tsc_device = { -@@ -2182,7 +2182,6 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { + static u8 am335x_iis_serializer_direction1[] = { +@@ -2245,7 +2245,6 @@ static struct evm_dev_cfg beaglebone_old_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -34,7 +34,7 @@ index ac4f78f..177ab9e 100644 {NULL, 0, 0}, }; -@@ -2195,7 +2194,6 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { +@@ -2258,7 +2257,6 @@ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {i2c2_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {boneleds_init, DEV_ON_BASEBOARD, PROFILE_ALL}, @@ -43,5 +43,5 @@ index ac4f78f..177ab9e 100644 }; -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0014-AM335x-MUX-add-ehrpwm1A.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0014-AM335x-MUX-add-ehrpwm1A.patch index 15aebe50..44c50520 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0014-AM335x-MUX-add-ehrpwm1A.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0014-AM335x-MUX-add-ehrpwm1A.patch @@ -1,7 +1,7 @@ -From bc405fc66657f9275bcdfe82c46e78ab71195f93 Mon Sep 17 00:00:00 2001 +From c150d02db78ceb0ec05774b834bf2001c6427552 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 31 Jan 2012 16:49:52 +0100 -Subject: [PATCH 14/22] AM335x: MUX: add ehrpwm1A +Subject: [PATCH 14/26] AM335x: MUX: add ehrpwm1A Signed-off-by: Koen Kooi --- @@ -9,7 +9,7 @@ Signed-off-by: Koen Kooi 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c -index 14ef129..fcb81ec 100644 +index 572ed16..0f71646 100644 --- a/arch/arm/mach-omap2/mux33xx.c +++ b/arch/arm/mach-omap2/mux33xx.c @@ -85,7 +85,7 @@ static struct omap_mux __initdata am33xx_muxmodes[] = { @@ -22,5 +22,5 @@ index 14ef129..fcb81ec 100644 "gpmc_a3", "mii2_txd2", "rgmii2_td2", "mmc2_dat2", NULL, NULL, NULL, "gpio1_19"), -- -1.7.9.4 +1.7.9.5 diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0015-beaglebone-enable-PWM-for-lcd-backlight-backlight-is.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0015-beaglebone-enable-PWM-for-lcd-backlight-backlight-is.patch index b98a95cf..ba2b3060 100644 --- a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0015-beaglebone-enable-PWM-for-lcd-backlight-backlight-is.patch +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0015-beaglebone-enable-PWM-for-lcd-backlight-backlight-is.patch @@ -1,38 +1,19 @@ -From b1340250f872964ced2298fc4e0ae4d39469cf12 Mon Sep 17 00:00:00 2001 +From 46c7fc0ed1ad0e5da431d15a4333a4fb5bb0ff0e Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 31 Jan 2012 17:02:10 +0100 -Subject: [PATCH 15/22] beaglebone: enable PWM for lcd backlight <- backlight +Subject: [PATCH 15/26] beaglebone: enable PWM for lcd backlight <- backlight is inverted Signed-off-by: Koen Kooi --- - arch/arm/mach-omap2/board-am335xevm.c | 54 +++++++++++++++++++++++++++------ - arch/arm/mach-omap2/devices.c | 13 ++++++++ - arch/arm/mach-omap2/devices.h | 1 + - 3 files changed, 58 insertions(+), 10 deletions(-) + arch/arm/mach-omap2/board-am335xevm.c | 51 +++++++++++++++++++++++++++------ + 1 file changed, 42 insertions(+), 9 deletions(-) diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c -index 177ab9e..6a77194 100644 +index 3c67e94..23b59c2 100644 --- a/arch/arm/mach-omap2/board-am335xevm.c +++ b/arch/arm/mach-omap2/board-am335xevm.c -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - - /* LCD controller is similar to DA850 */ - #include