summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-08-22 14:29:17 +0200
committerDenys Dmytriyenko <denys@ti.com>2012-09-14 01:51:19 -0400
commitdf83a59b6b9fd9de817a06aa162912682ab6b5b7 (patch)
tree532f2e31c8443d6158dffda904bac404027589ea
parentf55bb66b46d0b3541a6115843026de360ec37b53 (diff)
downloadmeta-ti-df83a59b6b9fd9de817a06aa162912682ab6b5b7.tar.gz
linux-ti33x-psp 3.2: update to 3.2.28 and add motorcape support
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
-rw-r--r--conf/machine/include/ti33x.inc2
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0001-x86-Simplify-code-by-removing-a-SMP-ifdefs-from-stru.patch273
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0002-Linux-3.2.26.patch24
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0001-sched-Fix-race-in-task_group.patch158
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0002-floppy-Cleanup-disk-queue-before-caling-put_disk-if-.patch51
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0003-xen-mark-local-pages-as-FOREIGN-in-the-m2p_override.patch156
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0004-lirc_sir-make-device-registration-work.patch131
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0005-stable-update-references-to-older-2.6-versions-for-3.patch62
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0006-ALSA-hda-add-dock-support-for-Thinkpad-X230-Tablet.patch107
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0007-cfg80211-fix-interface-combinations-check-for-ADHOC-.patch67
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0008-m68k-Correct-the-Atari-ALLOWINT-definition.patch97
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0009-ene_ir-Fix-driver-initialisation.patch47
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0010-nfsd4-our-filesystems-are-normally-case-sensitive.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0011-random-Use-arch_get_random_int-instead-of-cycle-coun.patch69
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0012-random-Use-arch-specific-RNG-to-initialize-the-entro.patch49
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0013-random-Adjust-the-number-of-loops-when-initializing.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0014-random-make-add_interrupt_randomness-do-something-sa.patch288
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0015-random-use-lockless-techniques-in-the-interrupt-path.patch245
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0016-random-create-add_device_randomness-interface.patch93
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0017-usb-feed-USB-device-information-to-the-dev-random-dr.patch49
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0018-net-feed-dev-random-with-the-MAC-address-when-regist.patch60
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0019-random-use-the-arch-specific-rng-in-xfer_secondary_p.patch91
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0020-random-add-new-get_random_bytes_arch-function.patch95
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0021-rtc-wm831x-Feed-the-write-counter-into-device_add_ra.patch75
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0022-mfd-wm831x-Feed-the-device-UUID-into-device_add_rand.patch54
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0023-ASoC-wm8994-Ensure-there-are-enough-BCLKs-for-four-c.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0024-futex-Test-for-pi_mutex-on-fault-in-futex_wait_reque.patch38
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0025-futex-Fix-bug-in-WARN_ON-for-NULL-q.pi_state.patch36
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0026-futex-Forbid-uaddr-uaddr2-in-futex_wait_requeue_pi.patch59
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0027-video-smscufx-fix-line-counting-in-fb_write.patch36
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0028-Input-synaptics-handle-out-of-bounds-values-from-the.patch89
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0029-ALSA-hda-Fix-invalid-D3-of-headphone-DAC-on-VT202x-c.patch60
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0030-ALSA-mpu401-Fix-missing-initialization-of-irq-field.patch34
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0031-x86-nops-Missing-break-resulting-in-incorrect-select.patch36
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0032-s390-mm-downgrade-page-table-after-fork-of-a-31-bit-.patch140
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0033-Redefine-ATOMIC_INIT-and-ATOMIC64_INIT-to-drop-the-c.patch73
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0034-dm-thin-reduce-endio_hook-pool-size.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0035-dm-thin-fix-memory-leak-in-process_prepared_mapping-.patch53
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0036-random-mix-in-architectural-randomness-in-extract_bu.patch151
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0037-asus-wmi-use-ASUS_WMI_METHODID_DSTS2-as-default-DSTS.patch44
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0038-virtio-blk-Use-block-layer-provided-spinlock.patch103
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0039-s390-mm-fix-fault-handling-for-page-table-walk-case.patch72
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0040-nfs-skip-commit-in-releasepage-if-we-re-freeing-memo.patch182
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0041-md-raid1-don-t-abort-a-resync-on-the-first-badblock.patch48
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0042-pcdp-use-early_ioremap-early_iounmap-to-access-pcdp-.patch73
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0043-lib-vsprintf.c-kptr_restrict-fix-pK-error-in-SysRq-s.patch48
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0044-nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioct.patch144
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0045-SUNRPC-return-negative-value-in-case-rpcbind-client-.patch45
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0046-ARM-7467-1-mutex-use-generic-xchg-based-implementati.patch165
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0047-ARM-7476-1-vfp-only-clear-vfp-state-for-current-cpu-.patch36
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0048-ARM-7477-1-vfp-Always-save-VFP-state-in-vfp_pm_suspe.patch58
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0049-ARM-7478-1-errata-extend-workaround-for-erratum-7207.patch62
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0050-ARM-Fix-undefined-instruction-exception-handling.patch335
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0051-USB-echi-dbgp-increase-the-controller-wait-time-to-c.patch38
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0052-ASoC-wm8962-Allow-VMID-time-to-fully-ramp.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0053-mm-page_alloc.c-remove-pageblock_default_order.patch98
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0054-mm-setup-pageblock_order-before-it-s-used-by-sparsem.patch101
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0055-mm-mmu_notifier-fix-freed-page-still-mapped-in-secon.patch137
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0056-mm-hugetlbfs-close-race-during-teardown-of-hugetlbfs.patch340
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0057-ALSA-snd-usb-fix-clock-source-validity-index.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0058-ALSA-hda-Support-dock-on-Lenovo-Thinkpad-T530-with-A.patch34
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0059-ore-Fix-out-of-bounds-access-in-_ios_obj.patch75
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0060-m68k-Make-sys_atomic_cmpxchg_32-work-on-classic-m68k.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0061-drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0062-rt2x00-Add-support-for-BUFFALO-WLI-UC-GNM2-to-rt2800.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0063-drop_monitor-fix-sleeping-in-invalid-context-warning.patch115
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0064-drop_monitor-Make-updating-data-skb-smp-safe.patch187
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0065-drop_monitor-prevent-init-path-from-scheduling-on-th.patch93
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0066-drop_monitor-dont-sleep-in-atomic-context.patch244
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0067-pch_uart-Fix-missing-break-for-16-byte-fifo.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0068-pch_uart-Fix-rx-error-interrupt-setting-issue.patch85
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0069-pch_uart-Fix-parity-setting-issue.patch35
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0070-Linux-3.2.27.patch24
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0001-bnx2-Fix-bug-in-bnx2_free_tx_skbs.patch47
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0002-sch_sfb-Fix-missing-NULL-check.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0003-sctp-Fix-list-corruption-resulting-from-freeing-an-a.patch188
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0004-caif-Fix-access-to-freed-pernet-memory.patch52
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0005-cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch95
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0006-caif-fix-NULL-pointer-check.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0007-wanmain-comparing-array-with-NULL.patch83
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0008-tcp-Add-TCP_USER_TIMEOUT-negative-value-check.patch39
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0009-USB-kaweth.c-use-GFP_ATOMIC-under-spin_lock.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0010-net-fix-rtnetlink-IFF_PROMISC-and-IFF_ALLMULTI-handl.patch60
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0011-tcp-perform-DMA-to-userspace-only-if-there-is-a-task.patch57
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0012-net-tun-fix-ioctl-based-info-leaks.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0013-e1000-add-dropped-DMA-receive-enable-back-in-for-WoL.patch50
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0014-rtlwifi-rtl8192cu-Change-buffer-allocation-for-synch.patch77
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0015-hfsplus-fix-overflow-in-sector-calculations-in-hfspl.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0016-drm-i915-fixup-seqno-allocation-logic-for-lazy_reque.patch182
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0017-KVM-VMX-Advertise-CPU_BASED_RDPMC_EXITING-for-nested.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0018-mac80211-cancel-mesh-path-timer.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0019-ath9k-Add-PID-VID-support-for-AR1111.patch65
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0020-ARM-mxs-Remove-MMAP_MIN_ADDR-setting-from-mxs_defcon.patch52
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0021-ALSA-hda-add-dock-support-for-Thinkpad-T430s.patch34
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0022-cfg80211-process-pending-events-when-unregistering-n.patch72
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0023-rt61pci-fix-NULL-pointer-dereference-in-config_lna_g.patch39
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0024-iwlwifi-disable-greenfield-transmissions-as-a-workar.patch53
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0025-ALSA-hda-add-dock-support-for-Thinkpad-X230.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0026-e1000e-NIC-goes-up-and-immediately-goes-down.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0027-ALSA-hda-remove-quirk-for-Dell-Vostro-1015.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0028-ALSA-hda-Fix-double-quirk-for-Quanta-FL1-Lenovo-Idea.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0029-ARM-pxa-remove-irq_to_gpio-from-ezx-pcap-driver.patch57
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0030-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch150
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0031-drm-i915-Add-wait_for-in-init_ring_common.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0032-drm-i915-correctly-order-the-ring-init-sequence.patch49
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0033-s390-compat-fix-compat-wrappers-for-process_vm-syste.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0034-s390-compat-fix-mmap-compat-system-calls.patch54
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0035-drm-radeon-fix-bank-tiling-parameters-on-evergreen.patch44
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0036-drm-radeon-fix-bank-tiling-parameters-on-cayman.patch45
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0037-drm-radeon-do-not-reenable-crtc-after-moving-vram-st.patch178
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0038-Linux-3.2.28.patch24
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0086-board-am335xevm-Add-Beaglebone-Motor-Cape-Support.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0087-mux33xx-Fix-MUXENTRYs-for-MCASP0_ACLKX-FSX-to-add-eh.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch8
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0001-PWM-ecap-Correct-configuration-of-polarity.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0002-ARM-OMAP2-am335x-mux-add-ecap2_in_pwm2_out-string-en.patch29
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0003-ARM-OMAP2-AM335x-hwmod-Remove-PRCM-entries-for-PWMSS.patch107
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0004-PWM-ecap-Resets-the-PWM-output-to-low-on-stop.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0005-PWM-ecap-Fix-for-throwing-PWM-output-before-running.patch52
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0006-pwm-ehrpwm-Configure-polarity-on-pwm_start.patch30
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp_3.2.bb131
121 files changed, 9365 insertions, 12 deletions
diff --git a/conf/machine/include/ti33x.inc b/conf/machine/include/ti33x.inc
index 9610881e..223f814d 100644
--- a/conf/machine/include/ti33x.inc
+++ b/conf/machine/include/ti33x.inc
@@ -4,7 +4,7 @@ require conf/machine/include/soc-family.inc
4require conf/machine/include/tune-cortexa8.inc 4require conf/machine/include/tune-cortexa8.inc
5PREFERRED_PROVIDER_virtual/kernel = "linux-ti33x-psp" 5PREFERRED_PROVIDER_virtual/kernel = "linux-ti33x-psp"
6# Increase this everytime you change something in the kernel 6# Increase this everytime you change something in the kernel
7MACHINE_KERNEL_PR = "r15" 7MACHINE_KERNEL_PR = "r16"
8 8
9KERNEL_IMAGETYPE = "uImage" 9KERNEL_IMAGETYPE = "uImage"
10 10
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0001-x86-Simplify-code-by-removing-a-SMP-ifdefs-from-stru.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0001-x86-Simplify-code-by-removing-a-SMP-ifdefs-from-stru.patch
new file mode 100644
index 00000000..e858dedc
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0001-x86-Simplify-code-by-removing-a-SMP-ifdefs-from-stru.patch
@@ -0,0 +1,273 @@
1From 6b4860ef321fadc060ec7541cb5074980fd41a68 Mon Sep 17 00:00:00 2001
2From: Kevin Winchester <kjwinchester@gmail.com>
3Date: Tue, 20 Dec 2011 20:52:22 -0400
4Subject: [PATCH 1/2] x86: Simplify code by removing a !SMP #ifdefs from
5 'struct cpuinfo_x86'
6
7commit 141168c36cdee3ff23d9c7700b0edc47cb65479f and
8commit 3f806e50981825fa56a7f1938f24c0680816be45 upstream.
9
10Several fields in struct cpuinfo_x86 were not defined for the
11!SMP case, likely to save space. However, those fields still
12have some meaning for UP, and keeping them allows some #ifdef
13removal from other files. The additional size of the UP kernel
14from this change is not significant enough to worry about
15keeping up the distinction:
16
17 text data bss dec hex filename
18 4737168 506459 972040 6215667 5ed7f3 vmlinux.o.before
19 4737444 506459 972040 6215943 5ed907 vmlinux.o.after
20
21for a difference of 276 bytes for an example UP config.
22
23If someone wants those 276 bytes back badly then it should
24be implemented in a cleaner way.
25
26Signed-off-by: Kevin Winchester <kjwinchester@gmail.com>
27Cc: Steffen Persvold <sp@numascale.com>
28Link: http://lkml.kernel.org/r/1324428742-12498-1-git-send-email-kjwinchester@gmail.com
29Signed-off-by: Ingo Molnar <mingo@elte.hu>
30Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
31Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
32---
33 arch/x86/include/asm/processor.h | 2 --
34 arch/x86/kernel/amd_nb.c | 8 ++------
35 arch/x86/kernel/cpu/amd.c | 2 --
36 arch/x86/kernel/cpu/common.c | 5 -----
37 arch/x86/kernel/cpu/intel.c | 2 --
38 arch/x86/kernel/cpu/mcheck/mce.c | 2 --
39 arch/x86/kernel/cpu/mcheck/mce_amd.c | 5 +----
40 arch/x86/kernel/cpu/proc.c | 4 +---
41 drivers/edac/sb_edac.c | 2 --
42 drivers/hwmon/coretemp.c | 7 +++----
43 10 files changed, 7 insertions(+), 32 deletions(-)
44
45diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
46index bb3ee36..f7c89e2 100644
47--- a/arch/x86/include/asm/processor.h
48+++ b/arch/x86/include/asm/processor.h
49@@ -99,7 +99,6 @@ struct cpuinfo_x86 {
50 u16 apicid;
51 u16 initial_apicid;
52 u16 x86_clflush_size;
53-#ifdef CONFIG_SMP
54 /* number of cores as seen by the OS: */
55 u16 booted_cores;
56 /* Physical processor id: */
57@@ -110,7 +109,6 @@ struct cpuinfo_x86 {
58 u8 compute_unit_id;
59 /* Index into per_cpu list: */
60 u16 cpu_index;
61-#endif
62 u32 microcode;
63 } __attribute__((__aligned__(SMP_CACHE_BYTES)));
64
65diff --git a/arch/x86/kernel/amd_nb.c b/arch/x86/kernel/amd_nb.c
66index bae1efe..be16854 100644
67--- a/arch/x86/kernel/amd_nb.c
68+++ b/arch/x86/kernel/amd_nb.c
69@@ -154,16 +154,14 @@ int amd_get_subcaches(int cpu)
70 {
71 struct pci_dev *link = node_to_amd_nb(amd_get_nb_id(cpu))->link;
72 unsigned int mask;
73- int cuid = 0;
74+ int cuid;
75
76 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING))
77 return 0;
78
79 pci_read_config_dword(link, 0x1d4, &mask);
80
81-#ifdef CONFIG_SMP
82 cuid = cpu_data(cpu).compute_unit_id;
83-#endif
84 return (mask >> (4 * cuid)) & 0xf;
85 }
86
87@@ -172,7 +170,7 @@ int amd_set_subcaches(int cpu, int mask)
88 static unsigned int reset, ban;
89 struct amd_northbridge *nb = node_to_amd_nb(amd_get_nb_id(cpu));
90 unsigned int reg;
91- int cuid = 0;
92+ int cuid;
93
94 if (!amd_nb_has_feature(AMD_NB_L3_PARTITIONING) || mask > 0xf)
95 return -EINVAL;
96@@ -190,9 +188,7 @@ int amd_set_subcaches(int cpu, int mask)
97 pci_write_config_dword(nb->misc, 0x1b8, reg & ~0x180000);
98 }
99
100-#ifdef CONFIG_SMP
101 cuid = cpu_data(cpu).compute_unit_id;
102-#endif
103 mask <<= 4 * cuid;
104 mask |= (0xf ^ (1 << cuid)) << 26;
105
106diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
107index 3524e1f..ff8557e 100644
108--- a/arch/x86/kernel/cpu/amd.c
109+++ b/arch/x86/kernel/cpu/amd.c
110@@ -148,7 +148,6 @@ static void __cpuinit init_amd_k6(struct cpuinfo_x86 *c)
111
112 static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
113 {
114-#ifdef CONFIG_SMP
115 /* calling is from identify_secondary_cpu() ? */
116 if (!c->cpu_index)
117 return;
118@@ -192,7 +191,6 @@ static void __cpuinit amd_k7_smp_check(struct cpuinfo_x86 *c)
119
120 valid_k7:
121 ;
122-#endif
123 }
124
125 static void __cpuinit init_amd_k7(struct cpuinfo_x86 *c)
126diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
127index aa003b1..ca93cc7 100644
128--- a/arch/x86/kernel/cpu/common.c
129+++ b/arch/x86/kernel/cpu/common.c
130@@ -676,9 +676,7 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)
131 if (this_cpu->c_early_init)
132 this_cpu->c_early_init(c);
133
134-#ifdef CONFIG_SMP
135 c->cpu_index = 0;
136-#endif
137 filter_cpuid_features(c, false);
138
139 setup_smep(c);
140@@ -764,10 +762,7 @@ static void __cpuinit generic_identify(struct cpuinfo_x86 *c)
141 c->apicid = c->initial_apicid;
142 # endif
143 #endif
144-
145-#ifdef CONFIG_X86_HT
146 c->phys_proc_id = c->initial_apicid;
147-#endif
148 }
149
150 setup_smep(c);
151diff --git a/arch/x86/kernel/cpu/intel.c b/arch/x86/kernel/cpu/intel.c
152index 5231312..3e6ff6c 100644
153--- a/arch/x86/kernel/cpu/intel.c
154+++ b/arch/x86/kernel/cpu/intel.c
155@@ -181,7 +181,6 @@ static void __cpuinit trap_init_f00f_bug(void)
156
157 static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
158 {
159-#ifdef CONFIG_SMP
160 /* calling is from identify_secondary_cpu() ? */
161 if (!c->cpu_index)
162 return;
163@@ -198,7 +197,6 @@ static void __cpuinit intel_smp_check(struct cpuinfo_x86 *c)
164 WARN_ONCE(1, "WARNING: SMP operation may be unreliable"
165 "with B stepping processors.\n");
166 }
167-#endif
168 }
169
170 static void __cpuinit intel_workarounds(struct cpuinfo_x86 *c)
171diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
172index b0f1271..3b67877 100644
173--- a/arch/x86/kernel/cpu/mcheck/mce.c
174+++ b/arch/x86/kernel/cpu/mcheck/mce.c
175@@ -119,9 +119,7 @@ void mce_setup(struct mce *m)
176 m->time = get_seconds();
177 m->cpuvendor = boot_cpu_data.x86_vendor;
178 m->cpuid = cpuid_eax(1);
179-#ifdef CONFIG_SMP
180 m->socketid = cpu_data(m->extcpu).phys_proc_id;
181-#endif
182 m->apicid = cpu_data(m->extcpu).initial_apicid;
183 rdmsrl(MSR_IA32_MCG_CAP, m->mcgcap);
184 }
185diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
186index 445a61c..d4444be 100644
187--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
188+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
189@@ -65,11 +65,9 @@ struct threshold_bank {
190 };
191 static DEFINE_PER_CPU(struct threshold_bank * [NR_BANKS], threshold_banks);
192
193-#ifdef CONFIG_SMP
194 static unsigned char shared_bank[NR_BANKS] = {
195 0, 0, 0, 0, 1
196 };
197-#endif
198
199 static DEFINE_PER_CPU(unsigned char, bank_map); /* see which banks are on */
200
201@@ -227,10 +225,9 @@ void mce_amd_feature_init(struct cpuinfo_x86 *c)
202
203 if (!block)
204 per_cpu(bank_map, cpu) |= (1 << bank);
205-#ifdef CONFIG_SMP
206+
207 if (shared_bank[bank] && c->cpu_core_id)
208 break;
209-#endif
210
211 memset(&b, 0, sizeof(b));
212 b.cpu = cpu;
213diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c
214index 14b2314..8022c66 100644
215--- a/arch/x86/kernel/cpu/proc.c
216+++ b/arch/x86/kernel/cpu/proc.c
217@@ -64,12 +64,10 @@ static void show_cpuinfo_misc(struct seq_file *m, struct cpuinfo_x86 *c)
218 static int show_cpuinfo(struct seq_file *m, void *v)
219 {
220 struct cpuinfo_x86 *c = v;
221- unsigned int cpu = 0;
222+ unsigned int cpu;
223 int i;
224
225-#ifdef CONFIG_SMP
226 cpu = c->cpu_index;
227-#endif
228 seq_printf(m, "processor\t: %u\n"
229 "vendor_id\t: %s\n"
230 "cpu family\t: %d\n"
231diff --git a/drivers/edac/sb_edac.c b/drivers/edac/sb_edac.c
232index 18a1293..0db57b5 100644
233--- a/drivers/edac/sb_edac.c
234+++ b/drivers/edac/sb_edac.c
235@@ -1609,11 +1609,9 @@ static int sbridge_mce_check_error(struct notifier_block *nb, unsigned long val,
236 mce->cpuvendor, mce->cpuid, mce->time,
237 mce->socketid, mce->apicid);
238
239-#ifdef CONFIG_SMP
240 /* Only handle if it is the right mc controller */
241 if (cpu_data(mce->cpu).phys_proc_id != pvt->sbridge_dev->mc)
242 return NOTIFY_DONE;
243-#endif
244
245 smp_rmb();
246 if ((pvt->mce_out + 1) % MCE_LOG_LEN == pvt->mce_in) {
247diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
248index 0790c98..19b4412 100644
249--- a/drivers/hwmon/coretemp.c
250+++ b/drivers/hwmon/coretemp.c
251@@ -57,16 +57,15 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
252 #define TOTAL_ATTRS (MAX_CORE_ATTRS + 1)
253 #define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
254
255-#ifdef CONFIG_SMP
256 #define TO_PHYS_ID(cpu) cpu_data(cpu).phys_proc_id
257 #define TO_CORE_ID(cpu) cpu_data(cpu).cpu_core_id
258+#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
259+
260+#ifdef CONFIG_SMP
261 #define for_each_sibling(i, cpu) for_each_cpu(i, cpu_sibling_mask(cpu))
262 #else
263-#define TO_PHYS_ID(cpu) (cpu)
264-#define TO_CORE_ID(cpu) (cpu)
265 #define for_each_sibling(i, cpu) for (i = 0; false; )
266 #endif
267-#define TO_ATTR_NO(cpu) (TO_CORE_ID(cpu) + BASE_SYSFS_ATTR_NO)
268
269 /*
270 * Per-Core Temperature Data
271--
2721.7.7.6
273
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0002-Linux-3.2.26.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0002-Linux-3.2.26.patch
new file mode 100644
index 00000000..3015fd3d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.26/0002-Linux-3.2.26.patch
@@ -0,0 +1,24 @@
1From c155c854372ebc05bac443b7d5285dd8d5834c62 Mon Sep 17 00:00:00 2001
2From: Ben Hutchings <ben@decadent.org.uk>
3Date: Sat, 4 Aug 2012 16:31:19 +0100
4Subject: [PATCH 2/2] Linux 3.2.26
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index e13e4e7..fa5acc83 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 25
18+SUBLEVEL = 26
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.6
24
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0001-sched-Fix-race-in-task_group.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0001-sched-Fix-race-in-task_group.patch
new file mode 100644
index 00000000..ea42ba5e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0001-sched-Fix-race-in-task_group.patch
@@ -0,0 +1,158 @@
1From 7164208d7f019fd736a9b7411858b534b3b69bba Mon Sep 17 00:00:00 2001
2From: Peter Zijlstra <peterz@infradead.org>
3Date: Fri, 22 Jun 2012 13:36:05 +0200
4Subject: [PATCH 01/70] sched: Fix race in task_group()
5
6commit 8323f26ce3425460769605a6aece7a174edaa7d1 upstream
7
8Stefan reported a crash on a kernel before a3e5d1091c1 ("sched:
9Don't call task_group() too many times in set_task_rq()"), he
10found the reason to be that the multiple task_group()
11invocations in set_task_rq() returned different values.
12
13Looking at all that I found a lack of serialization and plain
14wrong comments.
15
16The below tries to fix it using an extra pointer which is
17updated under the appropriate scheduler locks. Its not pretty,
18but I can't really see another way given how all the cgroup
19stuff works.
20
21Reported-and-tested-by: Stefan Bader <stefan.bader@canonical.com>
22Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
23Link: http://lkml.kernel.org/r/1340364965.18025.71.camel@twins
24Signed-off-by: Ingo Molnar <mingo@kernel.org>
25
26(backported to previous file names and layout)
27Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
28Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
29---
30 include/linux/init_task.h | 12 +++++++++++-
31 include/linux/sched.h | 5 ++++-
32 kernel/sched.c | 32 ++++++++++++++++++--------------
33 3 files changed, 33 insertions(+), 16 deletions(-)
34
35diff --git a/include/linux/init_task.h b/include/linux/init_task.h
36index df53fdf..cdde2b3 100644
37--- a/include/linux/init_task.h
38+++ b/include/linux/init_task.h
39@@ -124,8 +124,17 @@ extern struct group_info init_groups;
40
41 extern struct cred init_cred;
42
43+extern struct task_group root_task_group;
44+
45+#ifdef CONFIG_CGROUP_SCHED
46+# define INIT_CGROUP_SCHED(tsk) \
47+ .sched_task_group = &root_task_group,
48+#else
49+# define INIT_CGROUP_SCHED(tsk)
50+#endif
51+
52 #ifdef CONFIG_PERF_EVENTS
53-# define INIT_PERF_EVENTS(tsk) \
54+# define INIT_PERF_EVENTS(tsk) \
55 .perf_event_mutex = \
56 __MUTEX_INITIALIZER(tsk.perf_event_mutex), \
57 .perf_event_list = LIST_HEAD_INIT(tsk.perf_event_list),
58@@ -162,6 +171,7 @@ extern struct cred init_cred;
59 }, \
60 .tasks = LIST_HEAD_INIT(tsk.tasks), \
61 INIT_PUSHABLE_TASKS(tsk) \
62+ INIT_CGROUP_SCHED(tsk) \
63 .ptraced = LIST_HEAD_INIT(tsk.ptraced), \
64 .ptrace_entry = LIST_HEAD_INIT(tsk.ptrace_entry), \
65 .real_parent = &tsk, \
66diff --git a/include/linux/sched.h b/include/linux/sched.h
67index d336c35..1e86bb4 100644
68--- a/include/linux/sched.h
69+++ b/include/linux/sched.h
70@@ -1236,6 +1236,9 @@ struct task_struct {
71 const struct sched_class *sched_class;
72 struct sched_entity se;
73 struct sched_rt_entity rt;
74+#ifdef CONFIG_CGROUP_SCHED
75+ struct task_group *sched_task_group;
76+#endif
77
78 #ifdef CONFIG_PREEMPT_NOTIFIERS
79 /* list of struct preempt_notifier: */
80@@ -2646,7 +2649,7 @@ extern int sched_group_set_rt_period(struct task_group *tg,
81 extern long sched_group_rt_period(struct task_group *tg);
82 extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk);
83 #endif
84-#endif
85+#endif /* CONFIG_CGROUP_SCHED */
86
87 extern int task_can_switch_user(struct user_struct *up,
88 struct task_struct *tsk);
89diff --git a/kernel/sched.c b/kernel/sched.c
90index 9cd8ca7..e0431c4 100644
91--- a/kernel/sched.c
92+++ b/kernel/sched.c
93@@ -746,22 +746,19 @@ static inline int cpu_of(struct rq *rq)
94 /*
95 * Return the group to which this tasks belongs.
96 *
97- * We use task_subsys_state_check() and extend the RCU verification with
98- * pi->lock and rq->lock because cpu_cgroup_attach() holds those locks for each
99- * task it moves into the cgroup. Therefore by holding either of those locks,
100- * we pin the task to the current cgroup.
101+ * We cannot use task_subsys_state() and friends because the cgroup
102+ * subsystem changes that value before the cgroup_subsys::attach() method
103+ * is called, therefore we cannot pin it and might observe the wrong value.
104+ *
105+ * The same is true for autogroup's p->signal->autogroup->tg, the autogroup
106+ * core changes this before calling sched_move_task().
107+ *
108+ * Instead we use a 'copy' which is updated from sched_move_task() while
109+ * holding both task_struct::pi_lock and rq::lock.
110 */
111 static inline struct task_group *task_group(struct task_struct *p)
112 {
113- struct task_group *tg;
114- struct cgroup_subsys_state *css;
115-
116- css = task_subsys_state_check(p, cpu_cgroup_subsys_id,
117- lockdep_is_held(&p->pi_lock) ||
118- lockdep_is_held(&task_rq(p)->lock));
119- tg = container_of(css, struct task_group, css);
120-
121- return autogroup_task_group(p, tg);
122+ return p->sched_task_group;
123 }
124
125 /* Change a task's cfs_rq and parent entity if it moves across CPUs/groups */
126@@ -2372,7 +2369,7 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu)
127 * a task's CPU. ->pi_lock for waking tasks, rq->lock for runnable tasks.
128 *
129 * sched_move_task() holds both and thus holding either pins the cgroup,
130- * see set_task_rq().
131+ * see task_group().
132 *
133 * Furthermore, all task_rq users should acquire both locks, see
134 * task_rq_lock().
135@@ -8952,6 +8949,7 @@ void sched_destroy_group(struct task_group *tg)
136 */
137 void sched_move_task(struct task_struct *tsk)
138 {
139+ struct task_group *tg;
140 int on_rq, running;
141 unsigned long flags;
142 struct rq *rq;
143@@ -8966,6 +8964,12 @@ void sched_move_task(struct task_struct *tsk)
144 if (unlikely(running))
145 tsk->sched_class->put_prev_task(rq, tsk);
146
147+ tg = container_of(task_subsys_state_check(tsk, cpu_cgroup_subsys_id,
148+ lockdep_is_held(&tsk->sighand->siglock)),
149+ struct task_group, css);
150+ tg = autogroup_task_group(tsk, tg);
151+ tsk->sched_task_group = tg;
152+
153 #ifdef CONFIG_FAIR_GROUP_SCHED
154 if (tsk->sched_class->task_move_group)
155 tsk->sched_class->task_move_group(tsk, on_rq);
156--
1571.7.7.6
158
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0002-floppy-Cleanup-disk-queue-before-caling-put_disk-if-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0002-floppy-Cleanup-disk-queue-before-caling-put_disk-if-.patch
new file mode 100644
index 00000000..5f258a32
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0002-floppy-Cleanup-disk-queue-before-caling-put_disk-if-.patch
@@ -0,0 +1,51 @@
1From d51b64762e38f2ef1577ddc9f6399a7b56aaeb25 Mon Sep 17 00:00:00 2001
2From: Vivek Goyal <vgoyal@redhat.com>
3Date: Wed, 8 Feb 2012 20:03:38 +0100
4Subject: [PATCH 02/70] floppy: Cleanup disk->queue before caling put_disk()
5 if add_disk() was never called
6
7commit 3f9a5aabd0a9fe0e0cd308506f48963d79169aa7 upstream.
8
9add_disk() takes gendisk reference on request queue. If driver failed during
10initialization and never called add_disk() then that extra reference is not
11taken. That reference is put in put_disk(). floppy driver allocates the
12disk, allocates queue, sets disk->queue and then relizes that floppy
13controller is not present. It tries to tear down everything and tries to
14put a reference down in put_disk() which was never taken.
15
16In such error cases cleanup disk->queue before calling put_disk() so that
17we never try to put down a reference which was never taken in first place.
18
19Reported-and-tested-by: Suresh Jayaraman <sjayaraman@suse.com>
20Tested-by: Dirk Gouders <gouders@et.bocholt.fh-gelsenkirchen.de>
21Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
22Acked-by: Tejun Heo <tj@kernel.org>
23Signed-off-by: Jens Axboe <axboe@kernel.dk>
24Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
25---
26 drivers/block/floppy.c | 8 +++++++-
27 1 files changed, 7 insertions(+), 1 deletions(-)
28
29diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
30index 9955a53..c864add 100644
31--- a/drivers/block/floppy.c
32+++ b/drivers/block/floppy.c
33@@ -4369,8 +4369,14 @@ out_unreg_blkdev:
34 out_put_disk:
35 while (dr--) {
36 del_timer_sync(&motor_off_timer[dr]);
37- if (disks[dr]->queue)
38+ if (disks[dr]->queue) {
39 blk_cleanup_queue(disks[dr]->queue);
40+ /*
41+ * put_disk() is not paired with add_disk() and
42+ * will put queue reference one extra time. fix it.
43+ */
44+ disks[dr]->queue = NULL;
45+ }
46 put_disk(disks[dr]);
47 }
48 return err;
49--
501.7.7.6
51
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0003-xen-mark-local-pages-as-FOREIGN-in-the-m2p_override.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0003-xen-mark-local-pages-as-FOREIGN-in-the-m2p_override.patch
new file mode 100644
index 00000000..a111e550
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0003-xen-mark-local-pages-as-FOREIGN-in-the-m2p_override.patch
@@ -0,0 +1,156 @@
1From 0619fd368e61287667b8e77ae17b332e196f6258 Mon Sep 17 00:00:00 2001
2From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
3Date: Wed, 23 May 2012 18:57:20 +0100
4Subject: [PATCH 03/70] xen: mark local pages as FOREIGN in the m2p_override
5
6commit b9e0d95c041ca2d7ad297ee37c2e9cfab67a188f upstream.
7
8When the frontend and the backend reside on the same domain, even if we
9add pages to the m2p_override, these pages will never be returned by
10mfn_to_pfn because the check "get_phys_to_machine(pfn) != mfn" will
11always fail, so the pfn of the frontend will be returned instead
12(resulting in a deadlock because the frontend pages are already locked).
13
14INFO: task qemu-system-i38:1085 blocked for more than 120 seconds.
15"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
16qemu-system-i38 D ffff8800cfc137c0 0 1085 1 0x00000000
17 ffff8800c47ed898 0000000000000282 ffff8800be4596b0 00000000000137c0
18 ffff8800c47edfd8 ffff8800c47ec010 00000000000137c0 00000000000137c0
19 ffff8800c47edfd8 00000000000137c0 ffffffff82213020 ffff8800be4596b0
20Call Trace:
21 [<ffffffff81101ee0>] ? __lock_page+0x70/0x70
22 [<ffffffff81a0fdd9>] schedule+0x29/0x70
23 [<ffffffff81a0fe80>] io_schedule+0x60/0x80
24 [<ffffffff81101eee>] sleep_on_page+0xe/0x20
25 [<ffffffff81a0e1ca>] __wait_on_bit_lock+0x5a/0xc0
26 [<ffffffff81101ed7>] __lock_page+0x67/0x70
27 [<ffffffff8106f750>] ? autoremove_wake_function+0x40/0x40
28 [<ffffffff811867e6>] ? bio_add_page+0x36/0x40
29 [<ffffffff8110b692>] set_page_dirty_lock+0x52/0x60
30 [<ffffffff81186021>] bio_set_pages_dirty+0x51/0x70
31 [<ffffffff8118c6b4>] do_blockdev_direct_IO+0xb24/0xeb0
32 [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
33 [<ffffffff8118ca95>] __blockdev_direct_IO+0x55/0x60
34 [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
35 [<ffffffff811e91c8>] ext3_direct_IO+0xf8/0x390
36 [<ffffffff811e71a0>] ? ext3_get_blocks_handle+0xe00/0xe00
37 [<ffffffff81004b60>] ? xen_mc_flush+0xb0/0x1b0
38 [<ffffffff81104027>] generic_file_aio_read+0x737/0x780
39 [<ffffffff813bedeb>] ? gnttab_map_refs+0x15b/0x1e0
40 [<ffffffff811038f0>] ? find_get_pages+0x150/0x150
41 [<ffffffff8119736c>] aio_rw_vect_retry+0x7c/0x1d0
42 [<ffffffff811972f0>] ? lookup_ioctx+0x90/0x90
43 [<ffffffff81198856>] aio_run_iocb+0x66/0x1a0
44 [<ffffffff811998b8>] do_io_submit+0x708/0xb90
45 [<ffffffff81199d50>] sys_io_submit+0x10/0x20
46 [<ffffffff81a18d69>] system_call_fastpath+0x16/0x1b
47
48The explanation is in the comment within the code:
49
50We need to do this because the pages shared by the frontend
51(xen-blkfront) can be already locked (lock_page, called by
52do_read_cache_page); when the userspace backend tries to use them
53with direct_IO, mfn_to_pfn returns the pfn of the frontend, so
54do_blockdev_direct_IO is going to try to lock the same pages
55again resulting in a deadlock.
56
57A simplified call graph looks like this:
58
59pygrub QEMU
60-----------------------------------------------
61do_read_cache_page io_submit
62 | |
63lock_page ext3_direct_IO
64 |
65 bio_add_page
66 |
67 lock_page
68
69Internally the xen-blkback uses m2p_add_override to swizzle (temporarily)
70a 'struct page' to have a different MFN (so that it can point to another
71guest). It also can easily find out whether another pfn corresponding
72to the mfn exists in the m2p, and can set the FOREIGN bit
73in the p2m, making sure that mfn_to_pfn returns the pfn of the backend.
74
75This allows the backend to perform direct_IO on these pages, but as a
76side effect prevents the frontend from using get_user_pages_fast on
77them while they are being shared with the backend.
78
79Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
80Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
81Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
82---
83 arch/x86/xen/p2m.c | 36 ++++++++++++++++++++++++++++++++++++
84 1 files changed, 36 insertions(+), 0 deletions(-)
85
86diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
87index 1b267e7..00a03854 100644
88--- a/arch/x86/xen/p2m.c
89+++ b/arch/x86/xen/p2m.c
90@@ -686,6 +686,7 @@ int m2p_add_override(unsigned long mfn, struct page *page,
91 unsigned long uninitialized_var(address);
92 unsigned level;
93 pte_t *ptep = NULL;
94+ int ret = 0;
95
96 pfn = page_to_pfn(page);
97 if (!PageHighMem(page)) {
98@@ -721,6 +722,24 @@ int m2p_add_override(unsigned long mfn, struct page *page,
99 list_add(&page->lru, &m2p_overrides[mfn_hash(mfn)]);
100 spin_unlock_irqrestore(&m2p_override_lock, flags);
101
102+ /* p2m(m2p(mfn)) == mfn: the mfn is already present somewhere in
103+ * this domain. Set the FOREIGN_FRAME_BIT in the p2m for the other
104+ * pfn so that the following mfn_to_pfn(mfn) calls will return the
105+ * pfn from the m2p_override (the backend pfn) instead.
106+ * We need to do this because the pages shared by the frontend
107+ * (xen-blkfront) can be already locked (lock_page, called by
108+ * do_read_cache_page); when the userspace backend tries to use them
109+ * with direct_IO, mfn_to_pfn returns the pfn of the frontend, so
110+ * do_blockdev_direct_IO is going to try to lock the same pages
111+ * again resulting in a deadlock.
112+ * As a side effect get_user_pages_fast might not be safe on the
113+ * frontend pages while they are being shared with the backend,
114+ * because mfn_to_pfn (that ends up being called by GUPF) will
115+ * return the backend pfn rather than the frontend pfn. */
116+ ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
117+ if (ret == 0 && get_phys_to_machine(pfn) == mfn)
118+ set_phys_to_machine(pfn, FOREIGN_FRAME(mfn));
119+
120 return 0;
121 }
122 EXPORT_SYMBOL_GPL(m2p_add_override);
123@@ -732,6 +751,7 @@ int m2p_remove_override(struct page *page, bool clear_pte)
124 unsigned long uninitialized_var(address);
125 unsigned level;
126 pte_t *ptep = NULL;
127+ int ret = 0;
128
129 pfn = page_to_pfn(page);
130 mfn = get_phys_to_machine(pfn);
131@@ -801,6 +821,22 @@ int m2p_remove_override(struct page *page, bool clear_pte)
132 } else
133 set_phys_to_machine(pfn, page->index);
134
135+ /* p2m(m2p(mfn)) == FOREIGN_FRAME(mfn): the mfn is already present
136+ * somewhere in this domain, even before being added to the
137+ * m2p_override (see comment above in m2p_add_override).
138+ * If there are no other entries in the m2p_override corresponding
139+ * to this mfn, then remove the FOREIGN_FRAME_BIT from the p2m for
140+ * the original pfn (the one shared by the frontend): the backend
141+ * cannot do any IO on this page anymore because it has been
142+ * unshared. Removing the FOREIGN_FRAME_BIT from the p2m entry of
143+ * the original pfn causes mfn_to_pfn(mfn) to return the frontend
144+ * pfn again. */
145+ mfn &= ~FOREIGN_FRAME_BIT;
146+ ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
147+ if (ret == 0 && get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) &&
148+ m2p_find_override(mfn) == NULL)
149+ set_phys_to_machine(pfn, mfn);
150+
151 return 0;
152 }
153 EXPORT_SYMBOL_GPL(m2p_remove_override);
154--
1551.7.7.6
156
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0004-lirc_sir-make-device-registration-work.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0004-lirc_sir-make-device-registration-work.patch
new file mode 100644
index 00000000..9a3e2ada
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0004-lirc_sir-make-device-registration-work.patch
@@ -0,0 +1,131 @@
1From 03d61a0ca7ab54f6fb1524f4313afd1811fde803 Mon Sep 17 00:00:00 2001
2From: Jarod Wilson <jarod@redhat.com>
3Date: Mon, 4 Jun 2012 13:05:24 -0300
4Subject: [PATCH 04/70] lirc_sir: make device registration work
5
6commit 4b71ca6bce8fab3d08c61bf330e781f957934ae1 upstream.
7
8For one, the driver device pointer needs to be filled in, or the lirc core
9will refuse to load the driver. And we really need to wire up all the
10platform_device bits. This has been tested via the lirc sourceforge tree
11and verified to work, been sitting there for months, finally getting
12around to sending it. :\
13
14CC: Josh Boyer <jwboyer@redhat.com>
15Signed-off-by: Jarod Wilson <jarod@redhat.com>
16Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/staging/media/lirc/lirc_sir.c | 60 +++++++++++++++++++++++++++++++-
20 1 files changed, 58 insertions(+), 2 deletions(-)
21
22diff --git a/drivers/staging/media/lirc/lirc_sir.c b/drivers/staging/media/lirc/lirc_sir.c
23index 6903d39..90e9e32 100644
24--- a/drivers/staging/media/lirc/lirc_sir.c
25+++ b/drivers/staging/media/lirc/lirc_sir.c
26@@ -53,6 +53,7 @@
27 #include <linux/io.h>
28 #include <asm/irq.h>
29 #include <linux/fcntl.h>
30+#include <linux/platform_device.h>
31 #ifdef LIRC_ON_SA1100
32 #include <asm/hardware.h>
33 #ifdef CONFIG_SA1100_COLLIE
34@@ -488,9 +489,11 @@ static struct lirc_driver driver = {
35 .owner = THIS_MODULE,
36 };
37
38+static struct platform_device *lirc_sir_dev;
39
40 static int init_chrdev(void)
41 {
42+ driver.dev = &lirc_sir_dev->dev;
43 driver.minor = lirc_register_driver(&driver);
44 if (driver.minor < 0) {
45 printk(KERN_ERR LIRC_DRIVER_NAME ": init_chrdev() failed.\n");
46@@ -1216,20 +1219,71 @@ static int init_lirc_sir(void)
47 return 0;
48 }
49
50+static int __devinit lirc_sir_probe(struct platform_device *dev)
51+{
52+ return 0;
53+}
54+
55+static int __devexit lirc_sir_remove(struct platform_device *dev)
56+{
57+ return 0;
58+}
59+
60+static struct platform_driver lirc_sir_driver = {
61+ .probe = lirc_sir_probe,
62+ .remove = __devexit_p(lirc_sir_remove),
63+ .driver = {
64+ .name = "lirc_sir",
65+ .owner = THIS_MODULE,
66+ },
67+};
68
69 static int __init lirc_sir_init(void)
70 {
71 int retval;
72
73+ retval = platform_driver_register(&lirc_sir_driver);
74+ if (retval) {
75+ printk(KERN_ERR LIRC_DRIVER_NAME ": Platform driver register "
76+ "failed!\n");
77+ return -ENODEV;
78+ }
79+
80+ lirc_sir_dev = platform_device_alloc("lirc_dev", 0);
81+ if (!lirc_sir_dev) {
82+ printk(KERN_ERR LIRC_DRIVER_NAME ": Platform device alloc "
83+ "failed!\n");
84+ retval = -ENOMEM;
85+ goto pdev_alloc_fail;
86+ }
87+
88+ retval = platform_device_add(lirc_sir_dev);
89+ if (retval) {
90+ printk(KERN_ERR LIRC_DRIVER_NAME ": Platform device add "
91+ "failed!\n");
92+ retval = -ENODEV;
93+ goto pdev_add_fail;
94+ }
95+
96 retval = init_chrdev();
97 if (retval < 0)
98- return retval;
99+ goto fail;
100+
101 retval = init_lirc_sir();
102 if (retval) {
103 drop_chrdev();
104- return retval;
105+ goto fail;
106 }
107+
108 return 0;
109+
110+fail:
111+ platform_device_del(lirc_sir_dev);
112+pdev_add_fail:
113+ platform_device_put(lirc_sir_dev);
114+pdev_alloc_fail:
115+ platform_driver_unregister(&lirc_sir_driver);
116+ return retval;
117 }
118
119 static void __exit lirc_sir_exit(void)
120@@ -1237,6 +1291,8 @@ static void __exit lirc_sir_exit(void)
121 drop_hardware();
122 drop_chrdev();
123 drop_port();
124+ platform_device_unregister(lirc_sir_dev);
125+ platform_driver_unregister(&lirc_sir_driver);
126 printk(KERN_INFO LIRC_DRIVER_NAME ": Uninstalled.\n");
127 }
128
129--
1301.7.7.6
131
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0005-stable-update-references-to-older-2.6-versions-for-3.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0005-stable-update-references-to-older-2.6-versions-for-3.patch
new file mode 100644
index 00000000..78b67293
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0005-stable-update-references-to-older-2.6-versions-for-3.patch
@@ -0,0 +1,62 @@
1From ed3c699ad6609ac8df5b4cea1805b7c5b0235c1f Mon Sep 17 00:00:00 2001
2From: Paul Gortmaker <paul.gortmaker@windriver.com>
3Date: Tue, 5 Jun 2012 11:15:50 -0400
4Subject: [PATCH 05/70] stable: update references to older 2.6 versions for
5 3.x
6
7commit 2584f5212d97b664be250ad5700a2d0fee31a10d upstream.
8
9Also add information on where the respective trees are.
10
11Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
12Acked-by: Rob Landley <rob@landley.net>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 Documentation/stable_kernel_rules.txt | 19 ++++++++++++++-----
17 1 files changed, 14 insertions(+), 5 deletions(-)
18
19diff --git a/Documentation/stable_kernel_rules.txt b/Documentation/stable_kernel_rules.txt
20index e1f856b..22bf11b 100644
21--- a/Documentation/stable_kernel_rules.txt
22+++ b/Documentation/stable_kernel_rules.txt
23@@ -1,4 +1,4 @@
24-Everything you ever wanted to know about Linux 2.6 -stable releases.
25+Everything you ever wanted to know about Linux -stable releases.
26
27 Rules on what kind of patches are accepted, and which ones are not, into the
28 "-stable" tree:
29@@ -41,10 +41,10 @@ Procedure for submitting patches to the -stable tree:
30 cherry-picked than this can be specified in the following format in
31 the sign-off area:
32
33- Cc: <stable@vger.kernel.org> # .32.x: a1f84a3: sched: Check for idle
34- Cc: <stable@vger.kernel.org> # .32.x: 1b9508f: sched: Rate-limit newidle
35- Cc: <stable@vger.kernel.org> # .32.x: fd21073: sched: Fix affinity logic
36- Cc: <stable@vger.kernel.org> # .32.x
37+ Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
38+ Cc: <stable@vger.kernel.org> # 3.3.x: 1b9508f: sched: Rate-limit newidle
39+ Cc: <stable@vger.kernel.org> # 3.3.x: fd21073: sched: Fix affinity logic
40+ Cc: <stable@vger.kernel.org> # 3.3.x
41 Signed-off-by: Ingo Molnar <mingo@elte.hu>
42
43 The tag sequence has the meaning of:
44@@ -78,6 +78,15 @@ Review cycle:
45 security kernel team, and not go through the normal review cycle.
46 Contact the kernel security team for more details on this procedure.
47
48+Trees:
49+
50+ - The queues of patches, for both completed versions and in progress
51+ versions can be found at:
52+ http://git.kernel.org/?p=linux/kernel/git/stable/stable-queue.git
53+ - The finalized and tagged releases of all stable kernels can be found
54+ in separate branches per version at:
55+ http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git
56+
57
58 Review committee:
59
60--
611.7.7.6
62
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0006-ALSA-hda-add-dock-support-for-Thinkpad-X230-Tablet.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0006-ALSA-hda-add-dock-support-for-Thinkpad-X230-Tablet.patch
new file mode 100644
index 00000000..d2a0bcd1
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0006-ALSA-hda-add-dock-support-for-Thinkpad-X230-Tablet.patch
@@ -0,0 +1,107 @@
1From bad9b02f55b18da07c00945ac46d33636331bfa0 Mon Sep 17 00:00:00 2001
2From: David Henningsson <david.henningsson@canonical.com>
3Date: Fri, 20 Jul 2012 10:37:25 +0200
4Subject: [PATCH 06/70] ALSA: hda - add dock support for Thinkpad X230 Tablet
5
6commit 108cc108a3bb42fe4705df1317ff98e1e29428a6 upstream.
7
8Also add a model/fixup string "lenovo-dock", so that other Thinkpad
9users will be able to test this fixup easily, to see if it enables
10dock I/O for them as well.
11
12BugLink: https://bugs.launchpad.net/bugs/1026953
13Tested-by: John McCarron <john.mccarron@canonical.com>
14Signed-off-by: David Henningsson <david.henningsson@canonical.com>
15Signed-off-by: Takashi Iwai <tiwai@suse.de>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 Documentation/sound/alsa/HD-Audio-Models.txt | 3 +-
19 sound/pci/hda/patch_realtek.c | 27 ++++++++++++++++++++++++++
20 2 files changed, 29 insertions(+), 1 deletions(-)
21
22diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt
23index edad99a..69820b2 100644
24--- a/Documentation/sound/alsa/HD-Audio-Models.txt
25+++ b/Documentation/sound/alsa/HD-Audio-Models.txt
26@@ -60,10 +60,11 @@ ALC267/268
27 ==========
28 N/A
29
30-ALC269
31+ALC269/270/275/276/280/282
32 ======
33 laptop-amic Laptops with analog-mic input
34 laptop-dmic Laptops with digital-mic input
35+ lenovo-dock Enables docking station I/O for some Lenovos
36
37 ALC662/663/272
38 ==============
39diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
40index 191fd78..6ae58b2 100644
41--- a/sound/pci/hda/patch_realtek.c
42+++ b/sound/pci/hda/patch_realtek.c
43@@ -4809,6 +4809,15 @@ static int alc269_resume(struct hda_codec *codec)
44 }
45 #endif /* CONFIG_PM */
46
47+static void alc269_fixup_pincfg_no_hp_to_lineout(struct hda_codec *codec,
48+ const struct alc_fixup *fix, int action)
49+{
50+ struct alc_spec *spec = codec->spec;
51+
52+ if (action == ALC_FIXUP_ACT_PRE_PROBE)
53+ spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
54+}
55+
56 static void alc269_fixup_hweq(struct hda_codec *codec,
57 const struct alc_fixup *fix, int action)
58 {
59@@ -4909,6 +4918,8 @@ enum {
60 ALC269_FIXUP_DMIC,
61 ALC269VB_FIXUP_AMIC,
62 ALC269VB_FIXUP_DMIC,
63+ ALC269_FIXUP_LENOVO_DOCK,
64+ ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT,
65 };
66
67 static const struct alc_fixup alc269_fixups[] = {
68@@ -5029,6 +5040,20 @@ static const struct alc_fixup alc269_fixups[] = {
69 { }
70 },
71 },
72+ [ALC269_FIXUP_LENOVO_DOCK] = {
73+ .type = ALC_FIXUP_PINS,
74+ .v.pins = (const struct alc_pincfg[]) {
75+ { 0x19, 0x23a11040 }, /* dock mic */
76+ { 0x1b, 0x2121103f }, /* dock headphone */
77+ { }
78+ },
79+ .chained = true,
80+ .chain_id = ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT
81+ },
82+ [ALC269_FIXUP_PINCFG_NO_HP_TO_LINEOUT] = {
83+ .type = ALC_FIXUP_FUNC,
84+ .v.func = alc269_fixup_pincfg_no_hp_to_lineout,
85+ },
86 };
87
88 static const struct snd_pci_quirk alc269_fixup_tbl[] = {
89@@ -5051,6 +5076,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
90 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
91 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
92 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
93+ SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
94 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
95 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
96 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
97@@ -5109,6 +5135,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
98 static const struct alc_model_fixup alc269_fixup_models[] = {
99 {.id = ALC269_FIXUP_AMIC, .name = "laptop-amic"},
100 {.id = ALC269_FIXUP_DMIC, .name = "laptop-dmic"},
101+ {.id = ALC269_FIXUP_LENOVO_DOCK, .name = "lenovo-dock"},
102 {}
103 };
104
105--
1061.7.7.6
107
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0007-cfg80211-fix-interface-combinations-check-for-ADHOC-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0007-cfg80211-fix-interface-combinations-check-for-ADHOC-.patch
new file mode 100644
index 00000000..3238c870
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0007-cfg80211-fix-interface-combinations-check-for-ADHOC-.patch
@@ -0,0 +1,67 @@
1From 41cc15f973d21bd51d318e8f5d67512821561d89 Mon Sep 17 00:00:00 2001
2From: Liang Li <liang.li@windriver.com>
3Date: Thu, 2 Aug 2012 18:55:41 -0400
4Subject: [PATCH 07/70] cfg80211: fix interface combinations check for
5 ADHOC(IBSS)
6
7partial of commit 8e8b41f9d8c8e63fc92f899ace8da91a490ac573 upstream.
8
9As part of commit 463454b5dbd8 ("cfg80211: fix interface
10combinations check"), this extra check was introduced:
11
12 if ((all_iftypes & used_iftypes) != used_iftypes)
13 goto cont;
14
15However, most wireless NIC drivers did not advertise ADHOC in
16wiphy.iface_combinations[i].limits[] and hence we'll get -EBUSY
17when we bring up a ADHOC wlan with commands similar to:
18
19 # iwconfig wlan0 mode ad-hoc && ifconfig wlan0 up
20
21In commit 8e8b41f9d8c8e ("cfg80211: enforce lack of interface
22combinations"), the change below fixes the issue:
23
24 if (total == 1)
25 return 0;
26
27But it also introduces other dependencies for stable. For example,
28a full cherry pick of 8e8b41f9d8c8e would introduce additional
29regressions unless we also start cherry picking driver specific
30fixes like the following:
31
32 9b4760e ath5k: add possible wiphy interface combinations
33 1ae2fc2 mac80211_hwsim: advertise interface combinations
34 20c8e8d ath9k: add possible wiphy interface combinations
35
36And the purpose of the 'if (total == 1)' is to cover the specific
37use case (IBSS, adhoc) that was mentioned above. So we just pick
38the specific part out from 8e8b41f9d8c8e here.
39
40Doing so gives stable kernels a way to fix the change introduced
41by 463454b5dbd8, without having to make cherry picks specific to
42various NIC drivers.
43
44Signed-off-by: Liang Li <liang.li@windriver.com>
45Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
46Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
47---
48 net/wireless/util.c | 3 +++
49 1 files changed, 3 insertions(+), 0 deletions(-)
50
51diff --git a/net/wireless/util.c b/net/wireless/util.c
52index 74d5292..b5e4c1c 100644
53--- a/net/wireless/util.c
54+++ b/net/wireless/util.c
55@@ -981,6 +981,9 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
56 }
57 mutex_unlock(&rdev->devlist_mtx);
58
59+ if (total == 1)
60+ return 0;
61+
62 for (i = 0; i < rdev->wiphy.n_iface_combinations; i++) {
63 const struct ieee80211_iface_combination *c;
64 struct ieee80211_iface_limit *limits;
65--
661.7.7.6
67
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0008-m68k-Correct-the-Atari-ALLOWINT-definition.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0008-m68k-Correct-the-Atari-ALLOWINT-definition.patch
new file mode 100644
index 00000000..a6dd032e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0008-m68k-Correct-the-Atari-ALLOWINT-definition.patch
@@ -0,0 +1,97 @@
1From b7cced0ffff904b0803fad89348dec227ab3c79a Mon Sep 17 00:00:00 2001
2From: Mikael Pettersson <mikpe@it.uu.se>
3Date: Thu, 19 Apr 2012 00:53:36 +0200
4Subject: [PATCH 08/70] m68k: Correct the Atari ALLOWINT definition
5
6commit c663600584a596b5e66258cc10716fb781a5c2c9 upstream.
7
8Booting a 3.2, 3.3, or 3.4-rc4 kernel on an Atari using the
9`nfeth' ethernet device triggers a WARN_ONCE() in generic irq
10handling code on the first irq for that device:
11
12WARNING: at kernel/irq/handle.c:146 handle_irq_event_percpu+0x134/0x142()
13irq 3 handler nfeth_interrupt+0x0/0x194 enabled interrupts
14Modules linked in:
15Call Trace: [<000299b2>] warn_slowpath_common+0x48/0x6a
16 [<000299c0>] warn_slowpath_common+0x56/0x6a
17 [<00029a4c>] warn_slowpath_fmt+0x2a/0x32
18 [<0005b34c>] handle_irq_event_percpu+0x134/0x142
19 [<0005b34c>] handle_irq_event_percpu+0x134/0x142
20 [<0000a584>] nfeth_interrupt+0x0/0x194
21 [<001ba0a8>] schedule_preempt_disabled+0x0/0xc
22 [<0005b37a>] handle_irq_event+0x20/0x2c
23 [<0005add4>] generic_handle_irq+0x2c/0x3a
24 [<00002ab6>] do_IRQ+0x20/0x32
25 [<0000289e>] auto_irqhandler_fixup+0x4/0x6
26 [<00003144>] cpu_idle+0x22/0x2e
27 [<001b8a78>] printk+0x0/0x18
28 [<0024d112>] start_kernel+0x37a/0x386
29 [<0003021d>] __do_proc_dointvec+0xb1/0x366
30 [<0003021d>] __do_proc_dointvec+0xb1/0x366
31 [<0024c31e>] _sinittext+0x31e/0x9c0
32
33After invoking the irq's handler the kernel sees !irqs_disabled()
34and concludes that the handler erroneously enabled interrupts.
35
36However, debugging shows that !irqs_disabled() is true even before
37the handler is invoked, which indicates a problem in the platform
38code rather than the specific driver.
39
40The warning does not occur in 3.1 or older kernels.
41
42It turns out that the ALLOWINT definition for Atari is incorrect.
43
44The Atari definition of ALLOWINT is ~0x400, the stated purpose of
45that is to avoid taking HSYNC interrupts. irqs_disabled() returns
46true if the 3-bit ipl & 4 is non-zero. The nfeth interrupt runs at
47ipl 3 (it's autovector 3), but 3 & 4 is zero so irqs_disabled() is
48false, and the warning above is generated.
49
50When interrupts are explicitly disabled, ipl is set to 7. When they
51are enabled, ipl is masked with ALLOWINT. On Atari this will result
52in ipl = 3, which blocks interrupts at ipl 3 and below. So how come
53nfeth interrupts at ipl 3 are received at all? That's because ipl
54is reset to 2 by Atari-specific code in default_idle(), again with
55the stated purpose of blocking HSYNC interrupts. This discrepancy
56means that ipl 3 can remain blocked for longer than intended.
57
58Both default_idle() and falcon_hblhandler() identify HSYNC with
59ipl 2, and the "Atari ST/.../F030 Hardware Register Listing" agrees,
60but ALLOWINT is defined as if HSYNC was ipl 3.
61
62[As an experiment I modified default_idle() to reset ipl to 3, and
63as expected that resulted in all nfeth interrupts being blocked.]
64
65The fix is simple: define ALLOWINT as ~0x500 instead. This makes
66arch_local_irq_enable() consistent with default_idle(), and prevents
67the !irqs_disabled() problems for ipl 3 interrupts.
68
69Tested on Atari running in an Aranym VM.
70
71Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
72Tested-by: Michael Schmitz <schmitzmic@googlemail.com> (on Falcon/CT60)
73[Geert Uytterhoeven: This version applies to v3.2..v3.4.]
74Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
75Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
76---
77 arch/m68k/include/asm/entry.h | 4 ++--
78 1 files changed, 2 insertions(+), 2 deletions(-)
79
80diff --git a/arch/m68k/include/asm/entry.h b/arch/m68k/include/asm/entry.h
81index c3c5a86..8798ebc 100644
82--- a/arch/m68k/include/asm/entry.h
83+++ b/arch/m68k/include/asm/entry.h
84@@ -33,8 +33,8 @@
85
86 /* the following macro is used when enabling interrupts */
87 #if defined(MACH_ATARI_ONLY)
88- /* block out HSYNC on the atari */
89-#define ALLOWINT (~0x400)
90+ /* block out HSYNC = ipl 2 on the atari */
91+#define ALLOWINT (~0x500)
92 #define MAX_NOINT_IPL 3
93 #else
94 /* portable version */
95--
961.7.7.6
97
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0009-ene_ir-Fix-driver-initialisation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0009-ene_ir-Fix-driver-initialisation.patch
new file mode 100644
index 00000000..472f534a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0009-ene_ir-Fix-driver-initialisation.patch
@@ -0,0 +1,47 @@
1From 07187b4a8471054cf6698ddc3d72ce6b45b8544e Mon Sep 17 00:00:00 2001
2From: Luis Henriques <luis.henriques@canonical.com>
3Date: Tue, 19 Jun 2012 11:29:49 -0300
4Subject: [PATCH 09/70] ene_ir: Fix driver initialisation
5
6commit b31b021988fed9e3741a46918f14ba9b063811db upstream.
7
8commit 9ef449c6b31bb6a8e6dedc24de475a3b8c79be20 ("[media] rc: Postpone ISR
9registration") fixed an early ISR registration on several drivers. It did
10however also introduced a bug by moving the invocation of pnp_port_start()
11to the end of the probe function.
12
13This patch fixes this issue by moving the invocation of pnp_port_start() to
14an earlier stage in the probe function.
15
16Cc: Jarod Wilson <jarod@redhat.com>
17Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
18Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 drivers/media/rc/ene_ir.c | 3 ++-
22 1 files changed, 2 insertions(+), 1 deletions(-)
23
24diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
25index bef5296..647dd95 100644
26--- a/drivers/media/rc/ene_ir.c
27+++ b/drivers/media/rc/ene_ir.c
28@@ -1018,6 +1018,8 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
29
30 spin_lock_init(&dev->hw_lock);
31
32+ dev->hw_io = pnp_port_start(pnp_dev, 0);
33+
34 pnp_set_drvdata(pnp_dev, dev);
35 dev->pnp_dev = pnp_dev;
36
37@@ -1072,7 +1074,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
38
39 /* claim the resources */
40 error = -EBUSY;
41- dev->hw_io = pnp_port_start(pnp_dev, 0);
42 if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
43 dev->hw_io = -1;
44 dev->irq = -1;
45--
461.7.7.6
47
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0010-nfsd4-our-filesystems-are-normally-case-sensitive.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0010-nfsd4-our-filesystems-are-normally-case-sensitive.patch
new file mode 100644
index 00000000..de068e45
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0010-nfsd4-our-filesystems-are-normally-case-sensitive.patch
@@ -0,0 +1,32 @@
1From 6effad381853da1eb23ae2a04aac78009253ea74 Mon Sep 17 00:00:00 2001
2From: "J. Bruce Fields" <bfields@redhat.com>
3Date: Tue, 5 Jun 2012 16:52:06 -0400
4Subject: [PATCH 10/70] nfsd4: our filesystems are normally case sensitive
5
6commit 2930d381d22b9c56f40dd4c63a8fa59719ca2c3c upstream.
7
8Actually, xfs and jfs can optionally be case insensitive; we'll handle
9that case in later patches.
10
11Signed-off-by: J. Bruce Fields <bfields@redhat.com>
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13---
14 fs/nfsd/nfs4xdr.c | 2 +-
15 1 files changed, 1 insertions(+), 1 deletions(-)
16
17diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
18index 9cfa60a..87a1746 100644
19--- a/fs/nfsd/nfs4xdr.c
20+++ b/fs/nfsd/nfs4xdr.c
21@@ -2236,7 +2236,7 @@ out_acl:
22 if (bmval0 & FATTR4_WORD0_CASE_INSENSITIVE) {
23 if ((buflen -= 4) < 0)
24 goto out_resource;
25- WRITE32(1);
26+ WRITE32(0);
27 }
28 if (bmval0 & FATTR4_WORD0_CASE_PRESERVING) {
29 if ((buflen -= 4) < 0)
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0011-random-Use-arch_get_random_int-instead-of-cycle-coun.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0011-random-Use-arch_get_random_int-instead-of-cycle-coun.patch
new file mode 100644
index 00000000..50e30917
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0011-random-Use-arch_get_random_int-instead-of-cycle-coun.patch
@@ -0,0 +1,69 @@
1From 396b7a076c7496b8d98861bbebe701de9a3b795a Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 22 Dec 2011 11:36:22 -0800
4Subject: [PATCH 11/70] random: Use arch_get_random_int instead of cycle
5 counter if avail
6
7commit cf833d0b9937874b50ef2867c4e8badfd64948ce upstream.
8
9We still don't use rdrand in /dev/random, which just seems stupid. We
10accept the *cycle*counter* as a random input, but we don't accept
11rdrand? That's just broken.
12
13Sure, people can do things in user space (write to /dev/random, use
14rdrand in addition to /dev/random themselves etc etc), but that
15*still* seems to be a particularly stupid reason for saying "we
16shouldn't bother to try to do better in /dev/random".
17
18And even if somebody really doesn't trust rdrand as a source of random
19bytes, it seems singularly stupid to trust the cycle counter *more*.
20
21So I'd suggest the attached patch. I'm not going to even bother
22arguing that we should add more bits to the entropy estimate, because
23that's not the point - I don't care if /dev/random fills up slowly or
24not, I think it's just stupid to not use the bits we can get from
25rdrand and mix them into the strong randomness pool.
26
27Link: http://lkml.kernel.org/r/CA%2B55aFwn59N1=m651QAyTy-1gO1noGbK18zwKDwvwqnravA84A@mail.gmail.com
28Acked-by: "David S. Miller" <davem@davemloft.net>
29Acked-by: "Theodore Ts'o" <tytso@mit.edu>
30Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
31Cc: Matt Mackall <mpm@selenic.com>
32Cc: Tony Luck <tony.luck@intel.com>
33Cc: Eric Dumazet <eric.dumazet@gmail.com>
34Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
35Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
36---
37 drivers/char/random.c | 8 ++++++--
38 1 files changed, 6 insertions(+), 2 deletions(-)
39
40diff --git a/drivers/char/random.c b/drivers/char/random.c
41index 6035ab8..85da874 100644
42--- a/drivers/char/random.c
43+++ b/drivers/char/random.c
44@@ -624,8 +624,8 @@ static struct timer_rand_state input_timer_state;
45 static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
46 {
47 struct {
48- cycles_t cycles;
49 long jiffies;
50+ unsigned cycles;
51 unsigned num;
52 } sample;
53 long delta, delta2, delta3;
54@@ -637,7 +637,11 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
55 goto out;
56
57 sample.jiffies = jiffies;
58- sample.cycles = get_cycles();
59+
60+ /* Use arch random value, fall back to cycles */
61+ if (!arch_get_random_int(&sample.cycles))
62+ sample.cycles = get_cycles();
63+
64 sample.num = num;
65 mix_pool_bytes(&input_pool, &sample, sizeof(sample));
66
67--
681.7.7.6
69
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0012-random-Use-arch-specific-RNG-to-initialize-the-entro.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0012-random-Use-arch-specific-RNG-to-initialize-the-entro.patch
new file mode 100644
index 00000000..623bc631
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0012-random-Use-arch-specific-RNG-to-initialize-the-entro.patch
@@ -0,0 +1,49 @@
1From 5633ed2c64b766f280942d8c0906f7ae77cf2c20 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Thu, 22 Dec 2011 16:28:01 -0500
4Subject: [PATCH 12/70] random: Use arch-specific RNG to initialize the
5 entropy store
6
7commit 3e88bdff1c65145f7ba297ccec69c774afe4c785 upstream.
8
9If there is an architecture-specific random number generator (such as
10RDRAND for Intel architectures), use it to initialize /dev/random's
11entropy stores. Even in the worst case, if RDRAND is something like
12AES(NSA_KEY, counter++), it won't hurt, and it will definitely help
13against any other adversaries.
14
15Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
16Link: http://lkml.kernel.org/r/1324589281-31931-1-git-send-email-tytso@mit.edu
17Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 drivers/char/random.c | 6 ++++++
21 1 files changed, 6 insertions(+), 0 deletions(-)
22
23diff --git a/drivers/char/random.c b/drivers/char/random.c
24index 85da874..3079477 100644
25--- a/drivers/char/random.c
26+++ b/drivers/char/random.c
27@@ -965,6 +965,7 @@ EXPORT_SYMBOL(get_random_bytes);
28 */
29 static void init_std_data(struct entropy_store *r)
30 {
31+ int i;
32 ktime_t now;
33 unsigned long flags;
34
35@@ -974,6 +975,11 @@ static void init_std_data(struct entropy_store *r)
36
37 now = ktime_get_real();
38 mix_pool_bytes(r, &now, sizeof(now));
39+ for (i = r->poolinfo->poolwords; i; i--) {
40+ if (!arch_get_random_long(&flags))
41+ break;
42+ mix_pool_bytes(r, &flags, sizeof(flags));
43+ }
44 mix_pool_bytes(r, utsname(), sizeof(*(utsname())));
45 }
46
47--
481.7.7.6
49
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0013-random-Adjust-the-number-of-loops-when-initializing.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0013-random-Adjust-the-number-of-loops-when-initializing.patch
new file mode 100644
index 00000000..03af3b2d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0013-random-Adjust-the-number-of-loops-when-initializing.patch
@@ -0,0 +1,37 @@
1From 451f20f81b1619b22ecd823bb962d76e05a4afa6 Mon Sep 17 00:00:00 2001
2From: "H. Peter Anvin" <hpa@linux.intel.com>
3Date: Mon, 16 Jan 2012 11:23:29 -0800
4Subject: [PATCH 13/70] random: Adjust the number of loops when initializing
5
6commit 2dac8e54f988ab58525505d7ef982493374433c3 upstream.
7
8When we are initializing using arch_get_random_long() we only need to
9loop enough times to touch all the bytes in the buffer; using
10poolwords for that does twice the number of operations necessary on a
1164-bit machine, since in the random number generator code "word" means
1232 bits.
13
14Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
15Cc: "Theodore Ts'o" <tytso@mit.edu>
16Link: http://lkml.kernel.org/r/1324589281-31931-1-git-send-email-tytso@mit.edu
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/char/random.c | 2 +-
20 1 files changed, 1 insertions(+), 1 deletions(-)
21
22diff --git a/drivers/char/random.c b/drivers/char/random.c
23index 3079477..9a2156d 100644
24--- a/drivers/char/random.c
25+++ b/drivers/char/random.c
26@@ -975,7 +975,7 @@ static void init_std_data(struct entropy_store *r)
27
28 now = ktime_get_real();
29 mix_pool_bytes(r, &now, sizeof(now));
30- for (i = r->poolinfo->poolwords; i; i--) {
31+ for (i = r->poolinfo->POOLBYTES; i > 0; i -= sizeof flags) {
32 if (!arch_get_random_long(&flags))
33 break;
34 mix_pool_bytes(r, &flags, sizeof(flags));
35--
361.7.7.6
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0014-random-make-add_interrupt_randomness-do-something-sa.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0014-random-make-add_interrupt_randomness-do-something-sa.patch
new file mode 100644
index 00000000..70a2ed5a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0014-random-make-add_interrupt_randomness-do-something-sa.patch
@@ -0,0 +1,288 @@
1From 7fdc8a8f6b3498487bee19b2f01969245f8ac85a Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Mon, 2 Jul 2012 07:52:16 -0400
4Subject: [PATCH 14/70] random: make 'add_interrupt_randomness()' do something
5 sane
6
7commit 775f4b297b780601e61787b766f306ed3e1d23eb upstream.
8
9We've been moving away from add_interrupt_randomness() for various
10reasons: it's too expensive to do on every interrupt, and flooding the
11CPU with interrupts could theoretically cause bogus floods of entropy
12from a somewhat externally controllable source.
13
14This solves both problems by limiting the actual randomness addition
15to just once a second or after 64 interrupts, whicever comes first.
16During that time, the interrupt cycle data is buffered up in a per-cpu
17pool. Also, we make sure the the nonblocking pool used by urandom is
18initialized before we start feeding the normal input pool. This
19assures that /dev/urandom is returning unpredictable data as soon as
20possible.
21
22(Based on an original patch by Linus, but significantly modified by
23tytso.)
24
25Tested-by: Eric Wustrow <ewust@umich.edu>
26Reported-by: Eric Wustrow <ewust@umich.edu>
27Reported-by: Nadia Heninger <nadiah@cs.ucsd.edu>
28Reported-by: Zakir Durumeric <zakir@umich.edu>
29Reported-by: J. Alex Halderman <jhalderm@umich.edu>.
30Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
31Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
32Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
33---
34 drivers/char/random.c | 103 +++++++++++++++++++++++++++++++++++++-------
35 drivers/mfd/ab3100-core.c | 2 -
36 include/linux/random.h | 2 +-
37 kernel/irq/handle.c | 7 +--
38 4 files changed, 90 insertions(+), 24 deletions(-)
39
40diff --git a/drivers/char/random.c b/drivers/char/random.c
41index 9a2156d..a30df99 100644
42--- a/drivers/char/random.c
43+++ b/drivers/char/random.c
44@@ -127,19 +127,15 @@
45 *
46 * void add_input_randomness(unsigned int type, unsigned int code,
47 * unsigned int value);
48- * void add_interrupt_randomness(int irq);
49+ * void add_interrupt_randomness(int irq, int irq_flags);
50 * void add_disk_randomness(struct gendisk *disk);
51 *
52 * add_input_randomness() uses the input layer interrupt timing, as well as
53 * the event type information from the hardware.
54 *
55- * add_interrupt_randomness() uses the inter-interrupt timing as random
56- * inputs to the entropy pool. Note that not all interrupts are good
57- * sources of randomness! For example, the timer interrupts is not a
58- * good choice, because the periodicity of the interrupts is too
59- * regular, and hence predictable to an attacker. Network Interface
60- * Controller interrupts are a better measure, since the timing of the
61- * NIC interrupts are more unpredictable.
62+ * add_interrupt_randomness() uses the interrupt timing as random
63+ * inputs to the entropy pool. Using the cycle counters and the irq source
64+ * as inputs, it feeds the randomness roughly once a second.
65 *
66 * add_disk_randomness() uses what amounts to the seek time of block
67 * layer request events, on a per-disk_devt basis, as input to the
68@@ -248,6 +244,7 @@
69 #include <linux/percpu.h>
70 #include <linux/cryptohash.h>
71 #include <linux/fips.h>
72+#include <linux/ptrace.h>
73
74 #ifdef CONFIG_GENERIC_HARDIRQS
75 # include <linux/irq.h>
76@@ -256,6 +253,7 @@
77 #include <asm/processor.h>
78 #include <asm/uaccess.h>
79 #include <asm/irq.h>
80+#include <asm/irq_regs.h>
81 #include <asm/io.h>
82
83 /*
84@@ -421,7 +419,9 @@ struct entropy_store {
85 spinlock_t lock;
86 unsigned add_ptr;
87 int entropy_count;
88+ int entropy_total;
89 int input_rotate;
90+ unsigned int initialized:1;
91 __u8 last_data[EXTRACT_SIZE];
92 };
93
94@@ -454,6 +454,10 @@ static struct entropy_store nonblocking_pool = {
95 .pool = nonblocking_pool_data
96 };
97
98+static __u32 const twist_table[8] = {
99+ 0x00000000, 0x3b6e20c8, 0x76dc4190, 0x4db26158,
100+ 0xedb88320, 0xd6d6a3e8, 0x9b64c2b0, 0xa00ae278 };
101+
102 /*
103 * This function adds bytes into the entropy "pool". It does not
104 * update the entropy estimate. The caller should call
105@@ -467,9 +471,6 @@ static struct entropy_store nonblocking_pool = {
106 static void mix_pool_bytes_extract(struct entropy_store *r, const void *in,
107 int nbytes, __u8 out[64])
108 {
109- static __u32 const twist_table[8] = {
110- 0x00000000, 0x3b6e20c8, 0x76dc4190, 0x4db26158,
111- 0xedb88320, 0xd6d6a3e8, 0x9b64c2b0, 0xa00ae278 };
112 unsigned long i, j, tap1, tap2, tap3, tap4, tap5;
113 int input_rotate;
114 int wordmask = r->poolinfo->poolwords - 1;
115@@ -528,6 +529,36 @@ static void mix_pool_bytes(struct entropy_store *r, const void *in, int bytes)
116 mix_pool_bytes_extract(r, in, bytes, NULL);
117 }
118
119+struct fast_pool {
120+ __u32 pool[4];
121+ unsigned long last;
122+ unsigned short count;
123+ unsigned char rotate;
124+ unsigned char last_timer_intr;
125+};
126+
127+/*
128+ * This is a fast mixing routine used by the interrupt randomness
129+ * collector. It's hardcoded for an 128 bit pool and assumes that any
130+ * locks that might be needed are taken by the caller.
131+ */
132+static void fast_mix(struct fast_pool *f, const void *in, int nbytes)
133+{
134+ const char *bytes = in;
135+ __u32 w;
136+ unsigned i = f->count;
137+ unsigned input_rotate = f->rotate;
138+
139+ while (nbytes--) {
140+ w = rol32(*bytes++, input_rotate & 31) ^ f->pool[i & 3] ^
141+ f->pool[(i + 1) & 3];
142+ f->pool[i & 3] = (w >> 3) ^ twist_table[w & 7];
143+ input_rotate += (i++ & 3) ? 7 : 14;
144+ }
145+ f->count = i;
146+ f->rotate = input_rotate;
147+}
148+
149 /*
150 * Credit (or debit) the entropy store with n bits of entropy
151 */
152@@ -551,6 +582,12 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
153 entropy_count = r->poolinfo->POOLBITS;
154 r->entropy_count = entropy_count;
155
156+ if (!r->initialized && nbits > 0) {
157+ r->entropy_total += nbits;
158+ if (r->entropy_total > 128)
159+ r->initialized = 1;
160+ }
161+
162 /* should we wake readers? */
163 if (r == &input_pool && entropy_count >= random_read_wakeup_thresh) {
164 wake_up_interruptible(&random_read_wait);
165@@ -700,17 +737,48 @@ void add_input_randomness(unsigned int type, unsigned int code,
166 }
167 EXPORT_SYMBOL_GPL(add_input_randomness);
168
169-void add_interrupt_randomness(int irq)
170+static DEFINE_PER_CPU(struct fast_pool, irq_randomness);
171+
172+void add_interrupt_randomness(int irq, int irq_flags)
173 {
174- struct timer_rand_state *state;
175+ struct entropy_store *r;
176+ struct fast_pool *fast_pool = &__get_cpu_var(irq_randomness);
177+ struct pt_regs *regs = get_irq_regs();
178+ unsigned long now = jiffies;
179+ __u32 input[4], cycles = get_cycles();
180+
181+ input[0] = cycles ^ jiffies;
182+ input[1] = irq;
183+ if (regs) {
184+ __u64 ip = instruction_pointer(regs);
185+ input[2] = ip;
186+ input[3] = ip >> 32;
187+ }
188
189- state = get_timer_rand_state(irq);
190+ fast_mix(fast_pool, input, sizeof(input));
191
192- if (state == NULL)
193+ if ((fast_pool->count & 1023) &&
194+ !time_after(now, fast_pool->last + HZ))
195 return;
196
197- DEBUG_ENT("irq event %d\n", irq);
198- add_timer_randomness(state, 0x100 + irq);
199+ fast_pool->last = now;
200+
201+ r = nonblocking_pool.initialized ? &input_pool : &nonblocking_pool;
202+ mix_pool_bytes(r, &fast_pool->pool, sizeof(fast_pool->pool));
203+ /*
204+ * If we don't have a valid cycle counter, and we see
205+ * back-to-back timer interrupts, then skip giving credit for
206+ * any entropy.
207+ */
208+ if (cycles == 0) {
209+ if (irq_flags & __IRQF_TIMER) {
210+ if (fast_pool->last_timer_intr)
211+ return;
212+ fast_pool->last_timer_intr = 1;
213+ } else
214+ fast_pool->last_timer_intr = 0;
215+ }
216+ credit_entropy_bits(r, 1);
217 }
218
219 #ifdef CONFIG_BLOCK
220@@ -971,6 +1039,7 @@ static void init_std_data(struct entropy_store *r)
221
222 spin_lock_irqsave(&r->lock, flags);
223 r->entropy_count = 0;
224+ r->entropy_total = 0;
225 spin_unlock_irqrestore(&r->lock, flags);
226
227 now = ktime_get_real();
228diff --git a/drivers/mfd/ab3100-core.c b/drivers/mfd/ab3100-core.c
229index 60107ee..4eec7b7 100644
230--- a/drivers/mfd/ab3100-core.c
231+++ b/drivers/mfd/ab3100-core.c
232@@ -409,8 +409,6 @@ static irqreturn_t ab3100_irq_handler(int irq, void *data)
233 u32 fatevent;
234 int err;
235
236- add_interrupt_randomness(irq);
237-
238 err = ab3100_get_register_page_interruptible(ab3100, AB3100_EVENTA1,
239 event_regs, 3);
240 if (err)
241diff --git a/include/linux/random.h b/include/linux/random.h
242index 8f74538..6ef39d7 100644
243--- a/include/linux/random.h
244+++ b/include/linux/random.h
245@@ -52,7 +52,7 @@ extern void rand_initialize_irq(int irq);
246
247 extern void add_input_randomness(unsigned int type, unsigned int code,
248 unsigned int value);
249-extern void add_interrupt_randomness(int irq);
250+extern void add_interrupt_randomness(int irq, int irq_flags);
251
252 extern void get_random_bytes(void *buf, int nbytes);
253 void generate_random_uuid(unsigned char uuid_out[16]);
254diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
255index 470d08c..10e0772 100644
256--- a/kernel/irq/handle.c
257+++ b/kernel/irq/handle.c
258@@ -117,7 +117,7 @@ irqreturn_t
259 handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
260 {
261 irqreturn_t retval = IRQ_NONE;
262- unsigned int random = 0, irq = desc->irq_data.irq;
263+ unsigned int flags = 0, irq = desc->irq_data.irq;
264
265 do {
266 irqreturn_t res;
267@@ -145,7 +145,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
268
269 /* Fall through to add to randomness */
270 case IRQ_HANDLED:
271- random |= action->flags;
272+ flags |= action->flags;
273 break;
274
275 default:
276@@ -156,8 +156,7 @@ handle_irq_event_percpu(struct irq_desc *desc, struct irqaction *action)
277 action = action->next;
278 } while (action);
279
280- if (random & IRQF_SAMPLE_RANDOM)
281- add_interrupt_randomness(irq);
282+ add_interrupt_randomness(irq, flags);
283
284 if (!noirqdebug)
285 note_interrupt(irq, desc, retval);
286--
2871.7.7.6
288
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0015-random-use-lockless-techniques-in-the-interrupt-path.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0015-random-use-lockless-techniques-in-the-interrupt-path.patch
new file mode 100644
index 00000000..7638e84a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0015-random-use-lockless-techniques-in-the-interrupt-path.patch
@@ -0,0 +1,245 @@
1From 121c36f0542c9e8e3066652a19d4cfa838e28139 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Wed, 4 Jul 2012 10:38:30 -0400
4Subject: [PATCH 15/70] random: use lockless techniques in the interrupt path
5
6commit 902c098a3663de3fa18639efbb71b6080f0bcd3c upstream.
7
8The real-time Linux folks don't like add_interrupt_randomness() taking
9a spinlock since it is called in the low-level interrupt routine.
10This also allows us to reduce the overhead in the fast path, for the
11random driver, which is the interrupt collection path.
12
13Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 drivers/char/random.c | 78 ++++++++++++++++++++++++------------------------
17 1 files changed, 39 insertions(+), 39 deletions(-)
18
19diff --git a/drivers/char/random.c b/drivers/char/random.c
20index a30df99..8ac7e05 100644
21--- a/drivers/char/random.c
22+++ b/drivers/char/random.c
23@@ -418,9 +418,9 @@ struct entropy_store {
24 /* read-write data: */
25 spinlock_t lock;
26 unsigned add_ptr;
27+ unsigned input_rotate;
28 int entropy_count;
29 int entropy_total;
30- int input_rotate;
31 unsigned int initialized:1;
32 __u8 last_data[EXTRACT_SIZE];
33 };
34@@ -468,26 +468,24 @@ static __u32 const twist_table[8] = {
35 * it's cheap to do so and helps slightly in the expected case where
36 * the entropy is concentrated in the low-order bits.
37 */
38-static void mix_pool_bytes_extract(struct entropy_store *r, const void *in,
39- int nbytes, __u8 out[64])
40+static void __mix_pool_bytes(struct entropy_store *r, const void *in,
41+ int nbytes, __u8 out[64])
42 {
43 unsigned long i, j, tap1, tap2, tap3, tap4, tap5;
44 int input_rotate;
45 int wordmask = r->poolinfo->poolwords - 1;
46 const char *bytes = in;
47 __u32 w;
48- unsigned long flags;
49
50- /* Taps are constant, so we can load them without holding r->lock. */
51 tap1 = r->poolinfo->tap1;
52 tap2 = r->poolinfo->tap2;
53 tap3 = r->poolinfo->tap3;
54 tap4 = r->poolinfo->tap4;
55 tap5 = r->poolinfo->tap5;
56
57- spin_lock_irqsave(&r->lock, flags);
58- input_rotate = r->input_rotate;
59- i = r->add_ptr;
60+ smp_rmb();
61+ input_rotate = ACCESS_ONCE(r->input_rotate);
62+ i = ACCESS_ONCE(r->add_ptr);
63
64 /* mix one byte at a time to simplify size handling and churn faster */
65 while (nbytes--) {
66@@ -514,19 +512,23 @@ static void mix_pool_bytes_extract(struct entropy_store *r, const void *in,
67 input_rotate += i ? 7 : 14;
68 }
69
70- r->input_rotate = input_rotate;
71- r->add_ptr = i;
72+ ACCESS_ONCE(r->input_rotate) = input_rotate;
73+ ACCESS_ONCE(r->add_ptr) = i;
74+ smp_wmb();
75
76 if (out)
77 for (j = 0; j < 16; j++)
78 ((__u32 *)out)[j] = r->pool[(i - j) & wordmask];
79-
80- spin_unlock_irqrestore(&r->lock, flags);
81 }
82
83-static void mix_pool_bytes(struct entropy_store *r, const void *in, int bytes)
84+static void mix_pool_bytes(struct entropy_store *r, const void *in,
85+ int nbytes, __u8 out[64])
86 {
87- mix_pool_bytes_extract(r, in, bytes, NULL);
88+ unsigned long flags;
89+
90+ spin_lock_irqsave(&r->lock, flags);
91+ __mix_pool_bytes(r, in, nbytes, out);
92+ spin_unlock_irqrestore(&r->lock, flags);
93 }
94
95 struct fast_pool {
96@@ -564,23 +566,22 @@ static void fast_mix(struct fast_pool *f, const void *in, int nbytes)
97 */
98 static void credit_entropy_bits(struct entropy_store *r, int nbits)
99 {
100- unsigned long flags;
101- int entropy_count;
102+ int entropy_count, orig;
103
104 if (!nbits)
105 return;
106
107- spin_lock_irqsave(&r->lock, flags);
108-
109 DEBUG_ENT("added %d entropy credits to %s\n", nbits, r->name);
110- entropy_count = r->entropy_count;
111+retry:
112+ entropy_count = orig = ACCESS_ONCE(r->entropy_count);
113 entropy_count += nbits;
114 if (entropy_count < 0) {
115 DEBUG_ENT("negative entropy/overflow\n");
116 entropy_count = 0;
117 } else if (entropy_count > r->poolinfo->POOLBITS)
118 entropy_count = r->poolinfo->POOLBITS;
119- r->entropy_count = entropy_count;
120+ if (cmpxchg(&r->entropy_count, orig, entropy_count) != orig)
121+ goto retry;
122
123 if (!r->initialized && nbits > 0) {
124 r->entropy_total += nbits;
125@@ -593,7 +594,6 @@ static void credit_entropy_bits(struct entropy_store *r, int nbits)
126 wake_up_interruptible(&random_read_wait);
127 kill_fasync(&fasync, SIGIO, POLL_IN);
128 }
129- spin_unlock_irqrestore(&r->lock, flags);
130 }
131
132 /*********************************************************************
133@@ -680,7 +680,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
134 sample.cycles = get_cycles();
135
136 sample.num = num;
137- mix_pool_bytes(&input_pool, &sample, sizeof(sample));
138+ mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL);
139
140 /*
141 * Calculate number of bits of randomness we probably added.
142@@ -764,7 +764,7 @@ void add_interrupt_randomness(int irq, int irq_flags)
143 fast_pool->last = now;
144
145 r = nonblocking_pool.initialized ? &input_pool : &nonblocking_pool;
146- mix_pool_bytes(r, &fast_pool->pool, sizeof(fast_pool->pool));
147+ __mix_pool_bytes(r, &fast_pool->pool, sizeof(fast_pool->pool), NULL);
148 /*
149 * If we don't have a valid cycle counter, and we see
150 * back-to-back timer interrupts, then skip giving credit for
151@@ -829,7 +829,7 @@ static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
152
153 bytes = extract_entropy(r->pull, tmp, bytes,
154 random_read_wakeup_thresh / 8, rsvd);
155- mix_pool_bytes(r, tmp, bytes);
156+ mix_pool_bytes(r, tmp, bytes, NULL);
157 credit_entropy_bits(r, bytes*8);
158 }
159 }
160@@ -890,9 +890,11 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
161 int i;
162 __u32 hash[5], workspace[SHA_WORKSPACE_WORDS];
163 __u8 extract[64];
164+ unsigned long flags;
165
166 /* Generate a hash across the pool, 16 words (512 bits) at a time */
167 sha_init(hash);
168+ spin_lock_irqsave(&r->lock, flags);
169 for (i = 0; i < r->poolinfo->poolwords; i += 16)
170 sha_transform(hash, (__u8 *)(r->pool + i), workspace);
171
172@@ -905,7 +907,8 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
173 * brute-forcing the feedback as hard as brute-forcing the
174 * hash.
175 */
176- mix_pool_bytes_extract(r, hash, sizeof(hash), extract);
177+ __mix_pool_bytes(r, hash, sizeof(hash), extract);
178+ spin_unlock_irqrestore(&r->lock, flags);
179
180 /*
181 * To avoid duplicates, we atomically extract a portion of the
182@@ -928,11 +931,10 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
183 }
184
185 static ssize_t extract_entropy(struct entropy_store *r, void *buf,
186- size_t nbytes, int min, int reserved)
187+ size_t nbytes, int min, int reserved)
188 {
189 ssize_t ret = 0, i;
190 __u8 tmp[EXTRACT_SIZE];
191- unsigned long flags;
192
193 xfer_secondary_pool(r, nbytes);
194 nbytes = account(r, nbytes, min, reserved);
195@@ -941,6 +943,8 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
196 extract_buf(r, tmp);
197
198 if (fips_enabled) {
199+ unsigned long flags;
200+
201 spin_lock_irqsave(&r->lock, flags);
202 if (!memcmp(tmp, r->last_data, EXTRACT_SIZE))
203 panic("Hardware RNG duplicated output!\n");
204@@ -1034,22 +1038,18 @@ EXPORT_SYMBOL(get_random_bytes);
205 static void init_std_data(struct entropy_store *r)
206 {
207 int i;
208- ktime_t now;
209- unsigned long flags;
210+ ktime_t now = ktime_get_real();
211+ unsigned long rv;
212
213- spin_lock_irqsave(&r->lock, flags);
214 r->entropy_count = 0;
215 r->entropy_total = 0;
216- spin_unlock_irqrestore(&r->lock, flags);
217-
218- now = ktime_get_real();
219- mix_pool_bytes(r, &now, sizeof(now));
220- for (i = r->poolinfo->POOLBYTES; i > 0; i -= sizeof flags) {
221- if (!arch_get_random_long(&flags))
222+ mix_pool_bytes(r, &now, sizeof(now), NULL);
223+ for (i = r->poolinfo->POOLBYTES; i > 0; i -= sizeof(rv)) {
224+ if (!arch_get_random_long(&rv))
225 break;
226- mix_pool_bytes(r, &flags, sizeof(flags));
227+ mix_pool_bytes(r, &rv, sizeof(rv), NULL);
228 }
229- mix_pool_bytes(r, utsname(), sizeof(*(utsname())));
230+ mix_pool_bytes(r, utsname(), sizeof(*(utsname())), NULL);
231 }
232
233 static int rand_initialize(void)
234@@ -1186,7 +1186,7 @@ write_pool(struct entropy_store *r, const char __user *buffer, size_t count)
235 count -= bytes;
236 p += bytes;
237
238- mix_pool_bytes(r, buf, bytes);
239+ mix_pool_bytes(r, buf, bytes, NULL);
240 cond_resched();
241 }
242
243--
2441.7.7.6
245
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0016-random-create-add_device_randomness-interface.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0016-random-create-add_device_randomness-interface.patch
new file mode 100644
index 00000000..78b8dcbb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0016-random-create-add_device_randomness-interface.patch
@@ -0,0 +1,93 @@
1From 683cefe6594a919e89ca7d7d076ca753ced67679 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Wed, 4 Jul 2012 11:16:01 -0400
4Subject: [PATCH 16/70] random: create add_device_randomness() interface
5
6commit a2080a67abe9e314f9e9c2cc3a4a176e8a8f8793 upstream.
7
8Add a new interface, add_device_randomness() for adding data to the
9random pool that is likely to differ between two devices (or possibly
10even per boot). This would be things like MAC addresses or serial
11numbers, or the read-out of the RTC. This does *not* add any actual
12entropy to the pool, but it initializes the pool to different values
13for devices that might otherwise be identical and have very little
14entropy available to them (particularly common in the embedded world).
15
16[ Modified by tytso to mix in a timestamp, since there may be some
17 variability caused by the time needed to detect/configure the hardware
18 in question. ]
19
20Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
21Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23---
24 drivers/char/random.c | 28 ++++++++++++++++++++++++++++
25 include/linux/random.h | 1 +
26 2 files changed, 29 insertions(+), 0 deletions(-)
27
28diff --git a/drivers/char/random.c b/drivers/char/random.c
29index 8ac7e05..4446a27 100644
30--- a/drivers/char/random.c
31+++ b/drivers/char/random.c
32@@ -125,11 +125,20 @@
33 * The current exported interfaces for gathering environmental noise
34 * from the devices are:
35 *
36+ * void add_device_randomness(const void *buf, unsigned int size);
37 * void add_input_randomness(unsigned int type, unsigned int code,
38 * unsigned int value);
39 * void add_interrupt_randomness(int irq, int irq_flags);
40 * void add_disk_randomness(struct gendisk *disk);
41 *
42+ * add_device_randomness() is for adding data to the random pool that
43+ * is likely to differ between two devices (or possibly even per boot).
44+ * This would be things like MAC addresses or serial numbers, or the
45+ * read-out of the RTC. This does *not* add any actual entropy to the
46+ * pool, but it initializes the pool to different values for devices
47+ * that might otherwise be identical and have very little entropy
48+ * available to them (particularly common in the embedded world).
49+ *
50 * add_input_randomness() uses the input layer interrupt timing, as well as
51 * the event type information from the hardware.
52 *
53@@ -646,6 +655,25 @@ static void set_timer_rand_state(unsigned int irq,
54 }
55 #endif
56
57+/*
58+ * Add device- or boot-specific data to the input and nonblocking
59+ * pools to help initialize them to unique values.
60+ *
61+ * None of this adds any entropy, it is meant to avoid the
62+ * problem of the nonblocking pool having similar initial state
63+ * across largely identical devices.
64+ */
65+void add_device_randomness(const void *buf, unsigned int size)
66+{
67+ unsigned long time = get_cycles() ^ jiffies;
68+
69+ mix_pool_bytes(&input_pool, buf, size, NULL);
70+ mix_pool_bytes(&input_pool, &time, sizeof(time), NULL);
71+ mix_pool_bytes(&nonblocking_pool, buf, size, NULL);
72+ mix_pool_bytes(&nonblocking_pool, &time, sizeof(time), NULL);
73+}
74+EXPORT_SYMBOL(add_device_randomness);
75+
76 static struct timer_rand_state input_timer_state;
77
78 /*
79diff --git a/include/linux/random.h b/include/linux/random.h
80index 6ef39d7..e14b438 100644
81--- a/include/linux/random.h
82+++ b/include/linux/random.h
83@@ -50,6 +50,7 @@ struct rnd_state {
84
85 extern void rand_initialize_irq(int irq);
86
87+extern void add_device_randomness(const void *, unsigned int);
88 extern void add_input_randomness(unsigned int type, unsigned int code,
89 unsigned int value);
90 extern void add_interrupt_randomness(int irq, int irq_flags);
91--
921.7.7.6
93
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0017-usb-feed-USB-device-information-to-the-dev-random-dr.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0017-usb-feed-USB-device-information-to-the-dev-random-dr.patch
new file mode 100644
index 00000000..a2e4aeab
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0017-usb-feed-USB-device-information-to-the-dev-random-dr.patch
@@ -0,0 +1,49 @@
1From 578a5228a14f84af6f10050b84e3da331b0c37eb Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Wed, 4 Jul 2012 11:22:20 -0400
4Subject: [PATCH 17/70] usb: feed USB device information to the /dev/random
5 driver
6
7commit b04b3156a20d395a7faa8eed98698d1e17a36000 upstream.
8
9Send the USB device's serial, product, and manufacturer strings to the
10/dev/random driver to help seed its pools.
11
12Cc: Linus Torvalds <torvalds@linux-foundation.org>
13Acked-by: Greg KH <greg@kroah.com>
14Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 drivers/usb/core/hub.c | 9 +++++++++
18 1 files changed, 9 insertions(+), 0 deletions(-)
19
20diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
21index 2bc736f..6a4a8c9 100644
22--- a/drivers/usb/core/hub.c
23+++ b/drivers/usb/core/hub.c
24@@ -24,6 +24,7 @@
25 #include <linux/kthread.h>
26 #include <linux/mutex.h>
27 #include <linux/freezer.h>
28+#include <linux/random.h>
29
30 #include <asm/uaccess.h>
31 #include <asm/byteorder.h>
32@@ -1897,6 +1898,14 @@ int usb_new_device(struct usb_device *udev)
33 /* Tell the world! */
34 announce_device(udev);
35
36+ if (udev->serial)
37+ add_device_randomness(udev->serial, strlen(udev->serial));
38+ if (udev->product)
39+ add_device_randomness(udev->product, strlen(udev->product));
40+ if (udev->manufacturer)
41+ add_device_randomness(udev->manufacturer,
42+ strlen(udev->manufacturer));
43+
44 device_enable_async_suspend(&udev->dev);
45 /* Register the device. The device driver is responsible
46 * for configuring the device and invoking the add-device
47--
481.7.7.6
49
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0018-net-feed-dev-random-with-the-MAC-address-when-regist.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0018-net-feed-dev-random-with-the-MAC-address-when-regist.patch
new file mode 100644
index 00000000..f2dd6aa6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0018-net-feed-dev-random-with-the-MAC-address-when-regist.patch
@@ -0,0 +1,60 @@
1From c59aebeab04a154ab9b93a79303be44d5d382059 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Wed, 4 Jul 2012 21:23:25 -0400
4Subject: [PATCH 18/70] net: feed /dev/random with the MAC address when
5 registering a device
6
7commit 7bf2357524408b97fec58344caf7397f8140c3fd upstream.
8
9Cc: David Miller <davem@davemloft.net>
10Cc: Linus Torvalds <torvalds@linux-foundation.org>
11Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13---
14 net/core/dev.c | 3 +++
15 net/core/rtnetlink.c | 1 +
16 2 files changed, 4 insertions(+), 0 deletions(-)
17
18diff --git a/net/core/dev.c b/net/core/dev.c
19index 5738654..4b18703 100644
20--- a/net/core/dev.c
21+++ b/net/core/dev.c
22@@ -1177,6 +1177,7 @@ static int __dev_open(struct net_device *dev)
23 net_dmaengine_get();
24 dev_set_rx_mode(dev);
25 dev_activate(dev);
26+ add_device_randomness(dev->dev_addr, dev->addr_len);
27 }
28
29 return ret;
30@@ -4841,6 +4842,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa)
31 err = ops->ndo_set_mac_address(dev, sa);
32 if (!err)
33 call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
34+ add_device_randomness(dev->dev_addr, dev->addr_len);
35 return err;
36 }
37 EXPORT_SYMBOL(dev_set_mac_address);
38@@ -5621,6 +5623,7 @@ int register_netdevice(struct net_device *dev)
39 dev_init_scheduler(dev);
40 dev_hold(dev);
41 list_netdevice(dev);
42+ add_device_randomness(dev->dev_addr, dev->addr_len);
43
44 /* Notify protocols, that a new device appeared. */
45 ret = call_netdevice_notifiers(NETDEV_REGISTER, dev);
46diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
47index 2ef859a..05842ab 100644
48--- a/net/core/rtnetlink.c
49+++ b/net/core/rtnetlink.c
50@@ -1354,6 +1354,7 @@ static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm,
51 goto errout;
52 send_addr_notify = 1;
53 modified = 1;
54+ add_device_randomness(dev->dev_addr, dev->addr_len);
55 }
56
57 if (tb[IFLA_MTU]) {
58--
591.7.7.6
60
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0019-random-use-the-arch-specific-rng-in-xfer_secondary_p.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0019-random-use-the-arch-specific-rng-in-xfer_secondary_p.patch
new file mode 100644
index 00000000..a69ffbec
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0019-random-use-the-arch-specific-rng-in-xfer_secondary_p.patch
@@ -0,0 +1,91 @@
1From 8692924706ea929d1176354912971149133ab768 Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Thu, 5 Jul 2012 10:21:01 -0400
4Subject: [PATCH 19/70] random: use the arch-specific rng in
5 xfer_secondary_pool
6
7commit e6d4947b12e8ad947add1032dd754803c6004824 upstream.
8
9If the CPU supports a hardware random number generator, use it in
10xfer_secondary_pool(), where it will significantly improve things and
11where we can afford it.
12
13Also, remove the use of the arch-specific rng in
14add_timer_randomness(), since the call is significantly slower than
15get_cycles(), and we're much better off using it in
16xfer_secondary_pool() anyway.
17
18Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 drivers/char/random.c | 25 ++++++++++++++++---------
22 1 files changed, 16 insertions(+), 9 deletions(-)
23
24diff --git a/drivers/char/random.c b/drivers/char/random.c
25index 4446a27..4a83220 100644
26--- a/drivers/char/random.c
27+++ b/drivers/char/random.c
28@@ -254,6 +254,7 @@
29 #include <linux/cryptohash.h>
30 #include <linux/fips.h>
31 #include <linux/ptrace.h>
32+#include <linux/kmemcheck.h>
33
34 #ifdef CONFIG_GENERIC_HARDIRQS
35 # include <linux/irq.h>
36@@ -702,11 +703,7 @@ static void add_timer_randomness(struct timer_rand_state *state, unsigned num)
37 goto out;
38
39 sample.jiffies = jiffies;
40-
41- /* Use arch random value, fall back to cycles */
42- if (!arch_get_random_int(&sample.cycles))
43- sample.cycles = get_cycles();
44-
45+ sample.cycles = get_cycles();
46 sample.num = num;
47 mix_pool_bytes(&input_pool, &sample, sizeof(sample), NULL);
48
49@@ -838,7 +835,11 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
50 */
51 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
52 {
53- __u32 tmp[OUTPUT_POOL_WORDS];
54+ union {
55+ __u32 tmp[OUTPUT_POOL_WORDS];
56+ long hwrand[4];
57+ } u;
58+ int i;
59
60 if (r->pull && r->entropy_count < nbytes * 8 &&
61 r->entropy_count < r->poolinfo->POOLBITS) {
62@@ -849,17 +850,23 @@ static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
63 /* pull at least as many as BYTES as wakeup BITS */
64 bytes = max_t(int, bytes, random_read_wakeup_thresh / 8);
65 /* but never more than the buffer size */
66- bytes = min_t(int, bytes, sizeof(tmp));
67+ bytes = min_t(int, bytes, sizeof(u.tmp));
68
69 DEBUG_ENT("going to reseed %s with %d bits "
70 "(%d of %d requested)\n",
71 r->name, bytes * 8, nbytes * 8, r->entropy_count);
72
73- bytes = extract_entropy(r->pull, tmp, bytes,
74+ bytes = extract_entropy(r->pull, u.tmp, bytes,
75 random_read_wakeup_thresh / 8, rsvd);
76- mix_pool_bytes(r, tmp, bytes, NULL);
77+ mix_pool_bytes(r, u.tmp, bytes, NULL);
78 credit_entropy_bits(r, bytes*8);
79 }
80+ kmemcheck_mark_initialized(&u.hwrand, sizeof(u.hwrand));
81+ for (i = 0; i < 4; i++)
82+ if (arch_get_random_long(&u.hwrand[i]))
83+ break;
84+ if (i)
85+ mix_pool_bytes(r, &u.hwrand, sizeof(u.hwrand), 0);
86 }
87
88 /*
89--
901.7.7.6
91
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0020-random-add-new-get_random_bytes_arch-function.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0020-random-add-new-get_random_bytes_arch-function.patch
new file mode 100644
index 00000000..28ba75e3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0020-random-add-new-get_random_bytes_arch-function.patch
@@ -0,0 +1,95 @@
1From 6ce374197d352474ff8514805efb43436c9cf87b Mon Sep 17 00:00:00 2001
2From: Theodore Ts'o <tytso@mit.edu>
3Date: Thu, 5 Jul 2012 10:35:23 -0400
4Subject: [PATCH 20/70] random: add new get_random_bytes_arch() function
5
6commit c2557a303ab6712bb6e09447df828c557c710ac9 upstream.
7
8Create a new function, get_random_bytes_arch() which will use the
9architecture-specific hardware random number generator if it is
10present. Change get_random_bytes() to not use the HW RNG, even if it
11is avaiable.
12
13The reason for this is that the hw random number generator is fast (if
14it is present), but it requires that we trust the hardware
15manufacturer to have not put in a back door. (For example, an
16increasing counter encrypted by an AES key known to the NSA.)
17
18It's unlikely that Intel (for example) was paid off by the US
19Government to do this, but it's impossible for them to prove otherwise
20---
21 drivers/char/random.c | 29 ++++++++++++++++++++++++-----
22 include/linux/random.h | 1 +
23 2 files changed, 25 insertions(+), 5 deletions(-)
24
25diff --git a/drivers/char/random.c b/drivers/char/random.c
26index 4a83220..f3200bf 100644
27--- a/drivers/char/random.c
28+++ b/drivers/char/random.c
29@@ -1038,17 +1038,34 @@ static ssize_t extract_entropy_user(struct entropy_store *r, void __user *buf,
30
31 /*
32 * This function is the exported kernel interface. It returns some
33- * number of good random numbers, suitable for seeding TCP sequence
34- * numbers, etc.
35+ * number of good random numbers, suitable for key generation, seeding
36+ * TCP sequence numbers, etc. It does not use the hw random number
37+ * generator, if available; use get_random_bytes_arch() for that.
38 */
39 void get_random_bytes(void *buf, int nbytes)
40 {
41+ extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0);
42+}
43+EXPORT_SYMBOL(get_random_bytes);
44+
45+/*
46+ * This function will use the architecture-specific hardware random
47+ * number generator if it is available. The arch-specific hw RNG will
48+ * almost certainly be faster than what we can do in software, but it
49+ * is impossible to verify that it is implemented securely (as
50+ * opposed, to, say, the AES encryption of a sequence number using a
51+ * key known by the NSA). So it's useful if we need the speed, but
52+ * only if we're willing to trust the hardware manufacturer not to
53+ * have put in a back door.
54+ */
55+void get_random_bytes_arch(void *buf, int nbytes)
56+{
57 char *p = buf;
58
59 while (nbytes) {
60 unsigned long v;
61 int chunk = min(nbytes, (int)sizeof(unsigned long));
62-
63+
64 if (!arch_get_random_long(&v))
65 break;
66
67@@ -1057,9 +1074,11 @@ void get_random_bytes(void *buf, int nbytes)
68 nbytes -= chunk;
69 }
70
71- extract_entropy(&nonblocking_pool, p, nbytes, 0, 0);
72+ if (nbytes)
73+ extract_entropy(&nonblocking_pool, p, nbytes, 0, 0);
74 }
75-EXPORT_SYMBOL(get_random_bytes);
76+EXPORT_SYMBOL(get_random_bytes_arch);
77+
78
79 /*
80 * init_std_data - initialize pool with system data
81diff --git a/include/linux/random.h b/include/linux/random.h
82index e14b438..29e217a 100644
83--- a/include/linux/random.h
84+++ b/include/linux/random.h
85@@ -56,6 +56,7 @@ extern void add_input_randomness(unsigned int type, unsigned int code,
86 extern void add_interrupt_randomness(int irq, int irq_flags);
87
88 extern void get_random_bytes(void *buf, int nbytes);
89+extern void get_random_bytes_arch(void *buf, int nbytes);
90 void generate_random_uuid(unsigned char uuid_out[16]);
91
92 #ifndef MODULE
93--
941.7.7.6
95
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0021-rtc-wm831x-Feed-the-write-counter-into-device_add_ra.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0021-rtc-wm831x-Feed-the-write-counter-into-device_add_ra.patch
new file mode 100644
index 00000000..567d064c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0021-rtc-wm831x-Feed-the-write-counter-into-device_add_ra.patch
@@ -0,0 +1,75 @@
1From 70392d9bb5b688d5e6ccb6052d1b6a953942aea8 Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Thu, 5 Jul 2012 20:19:17 +0000
4Subject: [PATCH 21/70] rtc: wm831x: Feed the write counter into
5 device_add_randomness()
6
7commit 9dccf55f4cb011a7552a8a2749a580662f5ed8ed upstream.
8
9The tamper evident features of the RTC include the "write counter" which
10is a pseudo-random number regenerated whenever we set the RTC. Since this
11value is unpredictable it should provide some useful seeding to the random
12number generator.
13
14Only do this on boot since the goal is to seed the pool rather than add
15useful entropy.
16
17Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
18Signed-off-by: Theodore Ts'o <tytso@mit.edu>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 drivers/rtc/rtc-wm831x.c | 24 +++++++++++++++++++++++-
22 1 files changed, 23 insertions(+), 1 deletions(-)
23
24diff --git a/drivers/rtc/rtc-wm831x.c b/drivers/rtc/rtc-wm831x.c
25index bdc909b..f3c2110 100644
26--- a/drivers/rtc/rtc-wm831x.c
27+++ b/drivers/rtc/rtc-wm831x.c
28@@ -24,7 +24,7 @@
29 #include <linux/mfd/wm831x/core.h>
30 #include <linux/delay.h>
31 #include <linux/platform_device.h>
32-
33+#include <linux/random.h>
34
35 /*
36 * R16416 (0x4020) - RTC Write Counter
37@@ -96,6 +96,26 @@ struct wm831x_rtc {
38 unsigned int alarm_enabled:1;
39 };
40
41+static void wm831x_rtc_add_randomness(struct wm831x *wm831x)
42+{
43+ int ret;
44+ u16 reg;
45+
46+ /*
47+ * The write counter contains a pseudo-random number which is
48+ * regenerated every time we set the RTC so it should be a
49+ * useful per-system source of entropy.
50+ */
51+ ret = wm831x_reg_read(wm831x, WM831X_RTC_WRITE_COUNTER);
52+ if (ret >= 0) {
53+ reg = ret;
54+ add_device_randomness(&reg, sizeof(reg));
55+ } else {
56+ dev_warn(wm831x->dev, "Failed to read RTC write counter: %d\n",
57+ ret);
58+ }
59+}
60+
61 /*
62 * Read current time and date in RTC
63 */
64@@ -449,6 +469,8 @@ static int wm831x_rtc_probe(struct platform_device *pdev)
65 alm_irq, ret);
66 }
67
68+ wm831x_rtc_add_randomness(wm831x);
69+
70 return 0;
71
72 err:
73--
741.7.7.6
75
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0022-mfd-wm831x-Feed-the-device-UUID-into-device_add_rand.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0022-mfd-wm831x-Feed-the-device-UUID-into-device_add_rand.patch
new file mode 100644
index 00000000..ea38b5a2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0022-mfd-wm831x-Feed-the-device-UUID-into-device_add_rand.patch
@@ -0,0 +1,54 @@
1From fb9ac5d5d77aaf09012931a54251629368050ee2 Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Thu, 5 Jul 2012 20:23:21 +0000
4Subject: [PATCH 22/70] mfd: wm831x: Feed the device UUID into
5 device_add_randomness()
6
7commit 27130f0cc3ab97560384da437e4621fc4e94f21c upstream.
8
9wm831x devices contain a unique ID value. Feed this into the newly added
10device_add_randomness() to add some per device seed data to the pool.
11
12Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13Signed-off-by: Theodore Ts'o <tytso@mit.edu>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 drivers/mfd/wm831x-otp.c | 8 ++++++++
17 1 files changed, 8 insertions(+), 0 deletions(-)
18
19diff --git a/drivers/mfd/wm831x-otp.c b/drivers/mfd/wm831x-otp.c
20index f742745..b90f3e0 100644
21--- a/drivers/mfd/wm831x-otp.c
22+++ b/drivers/mfd/wm831x-otp.c
23@@ -18,6 +18,7 @@
24 #include <linux/bcd.h>
25 #include <linux/delay.h>
26 #include <linux/mfd/core.h>
27+#include <linux/random.h>
28
29 #include <linux/mfd/wm831x/core.h>
30 #include <linux/mfd/wm831x/otp.h>
31@@ -66,6 +67,7 @@ static DEVICE_ATTR(unique_id, 0444, wm831x_unique_id_show, NULL);
32
33 int wm831x_otp_init(struct wm831x *wm831x)
34 {
35+ char uuid[WM831X_UNIQUE_ID_LEN];
36 int ret;
37
38 ret = device_create_file(wm831x->dev, &dev_attr_unique_id);
39@@ -73,6 +75,12 @@ int wm831x_otp_init(struct wm831x *wm831x)
40 dev_err(wm831x->dev, "Unique ID attribute not created: %d\n",
41 ret);
42
43+ ret = wm831x_unique_id_read(wm831x, uuid);
44+ if (ret == 0)
45+ add_device_randomness(uuid, sizeof(uuid));
46+ else
47+ dev_err(wm831x->dev, "Failed to read UUID: %d\n", ret);
48+
49 return ret;
50 }
51
52--
531.7.7.6
54
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0023-ASoC-wm8994-Ensure-there-are-enough-BCLKs-for-four-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0023-ASoC-wm8994-Ensure-there-are-enough-BCLKs-for-four-c.patch
new file mode 100644
index 00000000..0019f5e6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0023-ASoC-wm8994-Ensure-there-are-enough-BCLKs-for-four-c.patch
@@ -0,0 +1,33 @@
1From f2173fb9a41cc0f7c114bb81fc0d138bc9649ccd Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Fri, 22 Jun 2012 17:21:17 +0100
4Subject: [PATCH 23/70] ASoC: wm8994: Ensure there are enough BCLKs for four
5 channels
6
7commit b8edf3e5522735c8ce78b81845f7a1a2d4a08626 upstream.
8
9Otherwise if someone tries to use all four channels on AIF1 with the
10device in master mode we won't be able to clock out all the data.
11
12Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 sound/soc/codecs/wm8994.c | 2 +-
16 1 files changed, 1 insertions(+), 1 deletions(-)
17
18diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
19index de61b8a..98c5774 100644
20--- a/sound/soc/codecs/wm8994.c
21+++ b/sound/soc/codecs/wm8994.c
22@@ -2508,7 +2508,7 @@ static int wm8994_hw_params(struct snd_pcm_substream *substream,
23 return -EINVAL;
24 }
25
26- bclk_rate = params_rate(params) * 2;
27+ bclk_rate = params_rate(params) * 4;
28 switch (params_format(params)) {
29 case SNDRV_PCM_FORMAT_S16_LE:
30 bclk_rate *= 16;
31--
321.7.7.6
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0024-futex-Test-for-pi_mutex-on-fault-in-futex_wait_reque.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0024-futex-Test-for-pi_mutex-on-fault-in-futex_wait_reque.patch
new file mode 100644
index 00000000..54224948
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0024-futex-Test-for-pi_mutex-on-fault-in-futex_wait_reque.patch
@@ -0,0 +1,38 @@
1From f36864057b59eec6a77bd9be1d04267fe3648b8f Mon Sep 17 00:00:00 2001
2From: Darren Hart <dvhart@linux.intel.com>
3Date: Fri, 20 Jul 2012 11:53:29 -0700
4Subject: [PATCH 24/70] futex: Test for pi_mutex on fault in
5 futex_wait_requeue_pi()
6
7commit b6070a8d9853eda010a549fa9a09eb8d7269b929 upstream.
8
9If fixup_pi_state_owner() faults, pi_mutex may be NULL. Test
10for pi_mutex != NULL before testing the owner against current
11and possibly unlocking it.
12
13Signed-off-by: Darren Hart <dvhart@linux.intel.com>
14Cc: Dave Jones <davej@redhat.com>
15Cc: Dan Carpenter <dan.carpenter@oracle.com>
16Link: http://lkml.kernel.org/r/dc59890338fc413606f04e5c5b131530734dae3d.1342809673.git.dvhart@linux.intel.com
17Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 kernel/futex.c | 2 +-
21 1 files changed, 1 insertions(+), 1 deletions(-)
22
23diff --git a/kernel/futex.c b/kernel/futex.c
24index 866c9d5..ed96926 100644
25--- a/kernel/futex.c
26+++ b/kernel/futex.c
27@@ -2370,7 +2370,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
28 * fault, unlock the rt_mutex and return the fault to userspace.
29 */
30 if (ret == -EFAULT) {
31- if (rt_mutex_owner(pi_mutex) == current)
32+ if (pi_mutex && rt_mutex_owner(pi_mutex) == current)
33 rt_mutex_unlock(pi_mutex);
34 } else if (ret == -EINTR) {
35 /*
36--
371.7.7.6
38
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0025-futex-Fix-bug-in-WARN_ON-for-NULL-q.pi_state.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0025-futex-Fix-bug-in-WARN_ON-for-NULL-q.pi_state.patch
new file mode 100644
index 00000000..ac9cdc0d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0025-futex-Fix-bug-in-WARN_ON-for-NULL-q.pi_state.patch
@@ -0,0 +1,36 @@
1From 5630485a96fdf29be75437e32eabccf5a2ac9fe7 Mon Sep 17 00:00:00 2001
2From: Darren Hart <dvhart@linux.intel.com>
3Date: Fri, 20 Jul 2012 11:53:30 -0700
4Subject: [PATCH 25/70] futex: Fix bug in WARN_ON for NULL q.pi_state
5
6commit f27071cb7fe3e1d37a9dbe6c0dfc5395cd40fa43 upstream.
7
8The WARN_ON in futex_wait_requeue_pi() for a NULL q.pi_state was testing
9the address (&q.pi_state) of the pointer instead of the value
10(q.pi_state) of the pointer. Correct it accordingly.
11
12Signed-off-by: Darren Hart <dvhart@linux.intel.com>
13Cc: Dave Jones <davej@redhat.com>
14Link: http://lkml.kernel.org/r/1c85d97f6e5f79ec389a4ead3e367363c74bd09a.1342809673.git.dvhart@linux.intel.com
15Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 kernel/futex.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/kernel/futex.c b/kernel/futex.c
22index ed96926..68e817a 100644
23--- a/kernel/futex.c
24+++ b/kernel/futex.c
25@@ -2343,7 +2343,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
26 * signal. futex_unlock_pi() will not destroy the lock_ptr nor
27 * the pi_state.
28 */
29- WARN_ON(!&q.pi_state);
30+ WARN_ON(!q.pi_state);
31 pi_mutex = &q.pi_state->pi_mutex;
32 ret = rt_mutex_finish_proxy_lock(pi_mutex, to, &rt_waiter, 1);
33 debug_rt_mutex_free_waiter(&rt_waiter);
34--
351.7.7.6
36
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0026-futex-Forbid-uaddr-uaddr2-in-futex_wait_requeue_pi.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0026-futex-Forbid-uaddr-uaddr2-in-futex_wait_requeue_pi.patch
new file mode 100644
index 00000000..9f0ff307
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0026-futex-Forbid-uaddr-uaddr2-in-futex_wait_requeue_pi.patch
@@ -0,0 +1,59 @@
1From 6b32682a969a782f8a03b42f0cec593a923412fb Mon Sep 17 00:00:00 2001
2From: Darren Hart <dvhart@linux.intel.com>
3Date: Fri, 20 Jul 2012 11:53:31 -0700
4Subject: [PATCH 26/70] futex: Forbid uaddr == uaddr2 in
5 futex_wait_requeue_pi()
6
7commit 6f7b0a2a5c0fb03be7c25bd1745baa50582348ef upstream.
8
9If uaddr == uaddr2, then we have broken the rule of only requeueing
10from a non-pi futex to a pi futex with this call. If we attempt this,
11as the trinity test suite manages to do, we miss early wakeups as
12q.key is equal to key2 (because they are the same uaddr). We will then
13attempt to dereference the pi_mutex (which would exist had the futex_q
14been properly requeued to a pi futex) and trigger a NULL pointer
15dereference.
16
17Signed-off-by: Darren Hart <dvhart@linux.intel.com>
18Cc: Dave Jones <davej@redhat.com>
19Link: http://lkml.kernel.org/r/ad82bfe7f7d130247fbe2b5b4275654807774227.1342809673.git.dvhart@linux.intel.com
20Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
21Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
22---
23 kernel/futex.c | 13 ++++++++-----
24 1 files changed, 8 insertions(+), 5 deletions(-)
25
26diff --git a/kernel/futex.c b/kernel/futex.c
27index 68e817a..80fb1c6 100644
28--- a/kernel/futex.c
29+++ b/kernel/futex.c
30@@ -2231,11 +2231,11 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,
31 * @uaddr2: the pi futex we will take prior to returning to user-space
32 *
33 * The caller will wait on uaddr and will be requeued by futex_requeue() to
34- * uaddr2 which must be PI aware. Normal wakeup will wake on uaddr2 and
35- * complete the acquisition of the rt_mutex prior to returning to userspace.
36- * This ensures the rt_mutex maintains an owner when it has waiters; without
37- * one, the pi logic wouldn't know which task to boost/deboost, if there was a
38- * need to.
39+ * uaddr2 which must be PI aware and unique from uaddr. Normal wakeup will wake
40+ * on uaddr2 and complete the acquisition of the rt_mutex prior to returning to
41+ * userspace. This ensures the rt_mutex maintains an owner when it has waiters;
42+ * without one, the pi logic would not know which task to boost/deboost, if
43+ * there was a need to.
44 *
45 * We call schedule in futex_wait_queue_me() when we enqueue and return there
46 * via the following:
47@@ -2272,6 +2272,9 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
48 struct futex_q q = futex_q_init;
49 int res, ret;
50
51+ if (uaddr == uaddr2)
52+ return -EINVAL;
53+
54 if (!bitset)
55 return -EINVAL;
56
57--
581.7.7.6
59
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0027-video-smscufx-fix-line-counting-in-fb_write.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0027-video-smscufx-fix-line-counting-in-fb_write.patch
new file mode 100644
index 00000000..030c40e5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0027-video-smscufx-fix-line-counting-in-fb_write.patch
@@ -0,0 +1,36 @@
1From 3c9cd66c826a8517a56d6d6b102018f73a0a6371 Mon Sep 17 00:00:00 2001
2From: Alexander Holler <holler@ahsoftware.de>
3Date: Sat, 21 Apr 2012 00:11:07 +0200
4Subject: [PATCH 27/70] video/smscufx: fix line counting in fb_write
5
6commit 2fe2d9f47cfe1a3e66e7d087368b3d7155b04c15 upstream.
7
8Line 0 and 1 were both written to line 0 (on the display) and all subsequent
9lines had an offset of -1. The result was that the last line on the display
10was never overwritten by writes to /dev/fbN.
11
12The origin of this bug seems to have been udlfb.
13
14Signed-off-by: Alexander Holler <holler@ahsoftware.de>
15Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 drivers/video/smscufx.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/drivers/video/smscufx.c b/drivers/video/smscufx.c
22index aaccffa..dd9533a 100644
23--- a/drivers/video/smscufx.c
24+++ b/drivers/video/smscufx.c
25@@ -904,7 +904,7 @@ static ssize_t ufx_ops_write(struct fb_info *info, const char __user *buf,
26 result = fb_sys_write(info, buf, count, ppos);
27
28 if (result > 0) {
29- int start = max((int)(offset / info->fix.line_length) - 1, 0);
30+ int start = max((int)(offset / info->fix.line_length), 0);
31 int lines = min((u32)((result / info->fix.line_length) + 1),
32 (u32)info->var.yres);
33
34--
351.7.7.6
36
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0028-Input-synaptics-handle-out-of-bounds-values-from-the.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0028-Input-synaptics-handle-out-of-bounds-values-from-the.patch
new file mode 100644
index 00000000..f77c2c2d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0028-Input-synaptics-handle-out-of-bounds-values-from-the.patch
@@ -0,0 +1,89 @@
1From 9bd55f644225e671f6c74cc89d9cf68b434385d1 Mon Sep 17 00:00:00 2001
2From: Seth Forshee <seth.forshee@canonical.com>
3Date: Tue, 24 Jul 2012 23:54:11 -0700
4Subject: [PATCH 28/70] Input: synaptics - handle out of bounds values from
5 the hardware
6
7commit c0394506e69b37c47d391c2a7bbea3ea236d8ec8 upstream.
8
9The touchpad on the Acer Aspire One D250 will report out of range values
10in the extreme lower portion of the touchpad. These appear as abrupt
11changes in the values reported by the hardware from very low values to
12very high values, which can cause unexpected vertical jumps in the
13position of the mouse pointer.
14
15What seems to be happening is that the value is wrapping to a two's
16compliment negative value of higher resolution than the 13-bit value
17reported by the hardware, with the high-order bits being truncated. This
18patch adds handling for these values by converting them to the
19appropriate negative values.
20
21The only tricky part about this is deciding when to treat a number as
22negative. It stands to reason that if out of range values can be
23reported on the low end then it could also happen on the high end, so
24not all out of range values should be treated as negative. The approach
25taken here is to split the difference between the maximum legitimate
26value for the axis and the maximum possible value that the hardware can
27report, treating values greater than this number as negative and all
28other values as positive. This can be tweaked later if hardware is found
29that operates outside of these parameters.
30
31BugLink: http://bugs.launchpad.net/bugs/1001251
32Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
33Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
34Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
35[bwh: Backported to 3.2: adjust context]
36Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
37---
38 drivers/input/mouse/synaptics.c | 23 +++++++++++++++++++++++
39 1 files changed, 23 insertions(+), 0 deletions(-)
40
41diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
42index a6dcd18..96532bc 100644
43--- a/drivers/input/mouse/synaptics.c
44+++ b/drivers/input/mouse/synaptics.c
45@@ -40,11 +40,28 @@
46 * Note that newer firmware allows querying device for maximum useable
47 * coordinates.
48 */
49+#define XMIN 0
50+#define XMAX 6143
51+#define YMIN 0
52+#define YMAX 6143
53 #define XMIN_NOMINAL 1472
54 #define XMAX_NOMINAL 5472
55 #define YMIN_NOMINAL 1408
56 #define YMAX_NOMINAL 4448
57
58+/* Size in bits of absolute position values reported by the hardware */
59+#define ABS_POS_BITS 13
60+
61+/*
62+ * Any position values from the hardware above the following limits are
63+ * treated as "wrapped around negative" values that have been truncated to
64+ * the 13-bit reporting range of the hardware. These are just reasonable
65+ * guesses and can be adjusted if hardware is found that operates outside
66+ * of these parameters.
67+ */
68+#define X_MAX_POSITIVE (((1 << ABS_POS_BITS) + XMAX) / 2)
69+#define Y_MAX_POSITIVE (((1 << ABS_POS_BITS) + YMAX) / 2)
70+
71 /*
72 * Synaptics touchpads report the y coordinate from bottom to top, which is
73 * opposite from what userspace expects.
74@@ -544,6 +561,12 @@ static int synaptics_parse_hw_state(const unsigned char buf[],
75 hw->right = (buf[0] & 0x02) ? 1 : 0;
76 }
77
78+ /* Convert wrap-around values to negative */
79+ if (hw->x > X_MAX_POSITIVE)
80+ hw->x -= 1 << ABS_POS_BITS;
81+ if (hw->y > Y_MAX_POSITIVE)
82+ hw->y -= 1 << ABS_POS_BITS;
83+
84 return 0;
85 }
86
87--
881.7.7.6
89
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0029-ALSA-hda-Fix-invalid-D3-of-headphone-DAC-on-VT202x-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0029-ALSA-hda-Fix-invalid-D3-of-headphone-DAC-on-VT202x-c.patch
new file mode 100644
index 00000000..963bda54
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0029-ALSA-hda-Fix-invalid-D3-of-headphone-DAC-on-VT202x-c.patch
@@ -0,0 +1,60 @@
1From 82ed7ed6d4c89cbcaa138eb1fd0075357e8c06d3 Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Wed, 25 Jul 2012 13:54:55 +0200
4Subject: [PATCH 29/70] ALSA: hda - Fix invalid D3 of headphone DAC on VT202x
5 codecs
6
7commit 6162552b0de6ba80937c3dd53e084967851cd199 upstream.
8
9We've got a bug report about the silent output from the headphone on a
10mobo with VT2021, and spotted out that this was because of the wrong
11D3 state on the DAC for the headphone output. The bug is triggered by
12the incomplete check for this DAC in set_widgets_power_state_vt1718S().
13It checks only the connectivity of the primary output (0x27) but
14doesn't consider the path from the headphone pin (0x28).
15
16Now this patch fixes the problem by checking both pins for DAC 0x0b.
17
18Signed-off-by: Takashi Iwai <tiwai@suse.de>
19[bwh: Backported to 3.2: keep using snd_hda_codec_write() as
20 update_power_state() is missing]
21Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
22---
23 sound/pci/hda/patch_via.c | 7 +++++--
24 1 files changed, 5 insertions(+), 2 deletions(-)
25
26diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
27index 1fe1308..7160ff2 100644
28--- a/sound/pci/hda/patch_via.c
29+++ b/sound/pci/hda/patch_via.c
30@@ -3227,7 +3227,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
31 {
32 struct via_spec *spec = codec->spec;
33 int imux_is_smixer;
34- unsigned int parm;
35+ unsigned int parm, parm2;
36 /* MUX6 (1eh) = stereo mixer */
37 imux_is_smixer =
38 snd_hda_codec_read(codec, 0x1e, 0, AC_VERB_GET_CONNECT_SEL, 0x00) == 5;
39@@ -3250,7 +3250,7 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
40 parm = AC_PWRST_D3;
41 set_pin_power_state(codec, 0x27, &parm);
42 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_POWER_STATE, parm);
43- snd_hda_codec_write(codec, 0xb, 0, AC_VERB_SET_POWER_STATE, parm);
44+ parm2 = parm; /* for pin 0x0b */
45
46 /* PW2 (26h), AOW2 (ah) */
47 parm = AC_PWRST_D3;
48@@ -3265,6 +3265,9 @@ static void set_widgets_power_state_vt1718S(struct hda_codec *codec)
49 if (!spec->hp_independent_mode) /* check for redirected HP */
50 set_pin_power_state(codec, 0x28, &parm);
51 snd_hda_codec_write(codec, 0x8, 0, AC_VERB_SET_POWER_STATE, parm);
52+ if (!spec->hp_independent_mode && parm2 != AC_PWRST_D3)
53+ parm = parm2;
54+ snd_hda_codec_write(codec, 0xb, 0, AC_VERB_SET_POWER_STATE, parm);
55 /* MW9 (21h), Mw2 (1ah), AOW0 (8h) */
56 snd_hda_codec_write(codec, 0x21, 0, AC_VERB_SET_POWER_STATE,
57 imux_is_smixer ? AC_PWRST_D0 : parm);
58--
591.7.7.6
60
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0030-ALSA-mpu401-Fix-missing-initialization-of-irq-field.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0030-ALSA-mpu401-Fix-missing-initialization-of-irq-field.patch
new file mode 100644
index 00000000..5885b459
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0030-ALSA-mpu401-Fix-missing-initialization-of-irq-field.patch
@@ -0,0 +1,34 @@
1From 1b12abe45ddcd7a4f3d927195dd69b8e6e9acb4e Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Mon, 23 Jul 2012 11:35:55 +0200
4Subject: [PATCH 30/70] ALSA: mpu401: Fix missing initialization of irq field
5
6commit bc733d495267a23ef8660220d696c6e549ce30b3 upstream.
7
8The irq field of struct snd_mpu401 is supposed to be initialized to -1.
9Since it's set to zero as of now, a probing error before the irq
10installation results in a kernel warning "Trying to free already-free
11IRQ 0".
12
13Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44821
14Signed-off-by: Takashi Iwai <tiwai@suse.de>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 sound/drivers/mpu401/mpu401_uart.c | 1 +
18 1 files changed, 1 insertions(+), 0 deletions(-)
19
20diff --git a/sound/drivers/mpu401/mpu401_uart.c b/sound/drivers/mpu401/mpu401_uart.c
21index 1cff331..4608c2c 100644
22--- a/sound/drivers/mpu401/mpu401_uart.c
23+++ b/sound/drivers/mpu401/mpu401_uart.c
24@@ -554,6 +554,7 @@ int snd_mpu401_uart_new(struct snd_card *card, int device,
25 spin_lock_init(&mpu->output_lock);
26 spin_lock_init(&mpu->timer_lock);
27 mpu->hardware = hardware;
28+ mpu->irq = -1;
29 if (! (info_flags & MPU401_INFO_INTEGRATED)) {
30 int res_size = hardware == MPU401_HW_PC98II ? 4 : 2;
31 mpu->res = request_region(port, res_size, "MPU401 UART");
32--
331.7.7.6
34
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0031-x86-nops-Missing-break-resulting-in-incorrect-select.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0031-x86-nops-Missing-break-resulting-in-incorrect-select.patch
new file mode 100644
index 00000000..b99ccb2c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0031-x86-nops-Missing-break-resulting-in-incorrect-select.patch
@@ -0,0 +1,36 @@
1From 884a5eb458ec88aad066be1cd4486dba34488aad Mon Sep 17 00:00:00 2001
2From: Alan Cox <alan@linux.intel.com>
3Date: Wed, 25 Jul 2012 16:28:19 +0100
4Subject: [PATCH 31/70] x86, nops: Missing break resulting in incorrect
5 selection on Intel
6
7commit d6250a3f12edb3a86db9598ffeca3de8b4a219e9 upstream.
8
9The Intel case falls through into the generic case which then changes
10the values. For cases like the P6 it doesn't do the right thing so
11this seems to be a screwup.
12
13Signed-off-by: Alan Cox <alan@linux.intel.com>
14Link: http://lkml.kernel.org/n/tip-lww2uirad4skzjlmrm0vru8o@git.kernel.org
15Signed-off-by: H. Peter Anvin <hpa@zytor.com>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 arch/x86/kernel/alternative.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
22index 1f84794..73ef56c 100644
23--- a/arch/x86/kernel/alternative.c
24+++ b/arch/x86/kernel/alternative.c
25@@ -219,7 +219,7 @@ void __init arch_init_ideal_nops(void)
26 ideal_nops = intel_nops;
27 #endif
28 }
29-
30+ break;
31 default:
32 #ifdef CONFIG_X86_64
33 ideal_nops = k8_nops;
34--
351.7.7.6
36
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0032-s390-mm-downgrade-page-table-after-fork-of-a-31-bit-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0032-s390-mm-downgrade-page-table-after-fork-of-a-31-bit-.patch
new file mode 100644
index 00000000..d285d97b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0032-s390-mm-downgrade-page-table-after-fork-of-a-31-bit-.patch
@@ -0,0 +1,140 @@
1From 7cd099a4bf8f6367aff3ef6f7b0409712925f42e Mon Sep 17 00:00:00 2001
2From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3Date: Thu, 26 Jul 2012 08:53:06 +0200
4Subject: [PATCH 32/70] s390/mm: downgrade page table after fork of a 31 bit
5 process
6
7commit 0f6f281b731d20bfe75c13f85d33f3f05b440222 upstream.
8
9The downgrade of the 4 level page table created by init_new_context is
10currently done only in start_thread31. If a 31 bit process forks the
11new mm uses a 4 level page table, including the task size of 2<<42
12that goes along with it. This is incorrect as now a 31 bit process
13can map memory beyond 2GB. Define arch_dup_mmap to do the downgrade
14after fork.
15
16Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
17[bwh: Backported to 3.2: adjust context]
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 arch/s390/include/asm/mmu_context.h | 14 +++++++++++++-
21 arch/s390/include/asm/processor.h | 2 ++
22 arch/s390/mm/mmap.c | 12 ++++++++++--
23 arch/s390/mm/pgtable.c | 5 -----
24 4 files changed, 25 insertions(+), 8 deletions(-)
25
26diff --git a/arch/s390/include/asm/mmu_context.h b/arch/s390/include/asm/mmu_context.h
27index 5682f16..20f0e01 100644
28--- a/arch/s390/include/asm/mmu_context.h
29+++ b/arch/s390/include/asm/mmu_context.h
30@@ -12,7 +12,6 @@
31 #include <asm/pgalloc.h>
32 #include <asm/uaccess.h>
33 #include <asm/tlbflush.h>
34-#include <asm-generic/mm_hooks.h>
35
36 static inline int init_new_context(struct task_struct *tsk,
37 struct mm_struct *mm)
38@@ -92,4 +91,17 @@ static inline void activate_mm(struct mm_struct *prev,
39 switch_mm(prev, next, current);
40 }
41
42+static inline void arch_dup_mmap(struct mm_struct *oldmm,
43+ struct mm_struct *mm)
44+{
45+#ifdef CONFIG_64BIT
46+ if (oldmm->context.asce_limit < mm->context.asce_limit)
47+ crst_table_downgrade(mm, oldmm->context.asce_limit);
48+#endif
49+}
50+
51+static inline void arch_exit_mmap(struct mm_struct *mm)
52+{
53+}
54+
55 #endif /* __S390_MMU_CONTEXT_H */
56diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h
57index 5f33d37..172550d 100644
58--- a/arch/s390/include/asm/processor.h
59+++ b/arch/s390/include/asm/processor.h
60@@ -130,7 +130,9 @@ struct stack_frame {
61 regs->psw.mask = psw_user_bits | PSW_MASK_BA; \
62 regs->psw.addr = new_psw | PSW_ADDR_AMODE; \
63 regs->gprs[15] = new_stackp; \
64+ __tlb_flush_mm(current->mm); \
65 crst_table_downgrade(current->mm, 1UL << 31); \
66+ update_mm(current->mm, current); \
67 } while (0)
68
69 /* Forward declaration, a strange C thing */
70diff --git a/arch/s390/mm/mmap.c b/arch/s390/mm/mmap.c
71index a0155c0..c70b3d8 100644
72--- a/arch/s390/mm/mmap.c
73+++ b/arch/s390/mm/mmap.c
74@@ -106,9 +106,15 @@ EXPORT_SYMBOL_GPL(arch_pick_mmap_layout);
75
76 int s390_mmap_check(unsigned long addr, unsigned long len)
77 {
78+ int rc;
79+
80 if (!is_compat_task() &&
81- len >= TASK_SIZE && TASK_SIZE < (1UL << 53))
82- return crst_table_upgrade(current->mm, 1UL << 53);
83+ len >= TASK_SIZE && TASK_SIZE < (1UL << 53)) {
84+ rc = crst_table_upgrade(current->mm, 1UL << 53);
85+ if (rc)
86+ return rc;
87+ update_mm(current->mm, current);
88+ }
89 return 0;
90 }
91
92@@ -128,6 +134,7 @@ s390_get_unmapped_area(struct file *filp, unsigned long addr,
93 rc = crst_table_upgrade(mm, 1UL << 53);
94 if (rc)
95 return (unsigned long) rc;
96+ update_mm(mm, current);
97 area = arch_get_unmapped_area(filp, addr, len, pgoff, flags);
98 }
99 return area;
100@@ -150,6 +157,7 @@ s390_get_unmapped_area_topdown(struct file *filp, const unsigned long addr,
101 rc = crst_table_upgrade(mm, 1UL << 53);
102 if (rc)
103 return (unsigned long) rc;
104+ update_mm(mm, current);
105 area = arch_get_unmapped_area_topdown(filp, addr, len,
106 pgoff, flags);
107 }
108diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
109index f8ceac4..f8e92f8 100644
110--- a/arch/s390/mm/pgtable.c
111+++ b/arch/s390/mm/pgtable.c
112@@ -97,7 +97,6 @@ repeat:
113 crst_table_free(mm, table);
114 if (mm->context.asce_limit < limit)
115 goto repeat;
116- update_mm(mm, current);
117 return 0;
118 }
119
120@@ -105,9 +104,6 @@ void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
121 {
122 pgd_t *pgd;
123
124- if (mm->context.asce_limit <= limit)
125- return;
126- __tlb_flush_mm(mm);
127 while (mm->context.asce_limit > limit) {
128 pgd = mm->pgd;
129 switch (pgd_val(*pgd) & _REGION_ENTRY_TYPE_MASK) {
130@@ -130,7 +126,6 @@ void crst_table_downgrade(struct mm_struct *mm, unsigned long limit)
131 mm->task_size = mm->context.asce_limit;
132 crst_table_free(mm, (unsigned long *) pgd);
133 }
134- update_mm(mm, current);
135 }
136 #endif
137
138--
1391.7.7.6
140
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0033-Redefine-ATOMIC_INIT-and-ATOMIC64_INIT-to-drop-the-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0033-Redefine-ATOMIC_INIT-and-ATOMIC64_INIT-to-drop-the-c.patch
new file mode 100644
index 00000000..2a98f77a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0033-Redefine-ATOMIC_INIT-and-ATOMIC64_INIT-to-drop-the-c.patch
@@ -0,0 +1,73 @@
1From f96e9f9d90fd6778b97a1a32c6769abcb302fbb0 Mon Sep 17 00:00:00 2001
2From: Tony Luck <tony.luck@intel.com>
3Date: Thu, 26 Jul 2012 10:55:26 -0700
4Subject: [PATCH 33/70] Redefine ATOMIC_INIT and ATOMIC64_INIT to drop the
5 casts
6
7commit a119365586b0130dfea06457f584953e0ff6481d upstream.
8
9The following build error occured during a ia64 build with
10swap-over-NFS patches applied.
11
12net/core/sock.c:274:36: error: initializer element is not constant
13net/core/sock.c:274:36: error: (near initialization for 'memalloc_socks')
14net/core/sock.c:274:36: error: initializer element is not constant
15
16This is identical to a parisc build error. Fengguang Wu, Mel Gorman
17and James Bottomley did all the legwork to track the root cause of
18the problem. This fix and entire commit log is shamelessly copied
19from them with one extra detail to change a dubious runtime use of
20ATOMIC_INIT() to atomic_set() in drivers/char/mspec.c
21
22Dave Anglin says:
23> Here is the line in sock.i:
24>
25> struct static_key memalloc_socks = ((struct static_key) { .enabled =
26> ((atomic_t) { (0) }) });
27
28The above line contains two compound literals. It also uses a designated
29initializer to initialize the field enabled. A compound literal is not a
30constant expression.
31
32The location of the above statement isn't fully clear, but if a compound
33literal occurs outside the body of a function, the initializer list must
34consist of constant expressions.
35
36Signed-off-by: Tony Luck <tony.luck@intel.com>
37Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
38---
39 arch/ia64/include/asm/atomic.h | 4 ++--
40 drivers/char/mspec.c | 2 +-
41 2 files changed, 3 insertions(+), 3 deletions(-)
42
43diff --git a/arch/ia64/include/asm/atomic.h b/arch/ia64/include/asm/atomic.h
44index 3fad89e..2fc214b 100644
45--- a/arch/ia64/include/asm/atomic.h
46+++ b/arch/ia64/include/asm/atomic.h
47@@ -18,8 +18,8 @@
48 #include <asm/system.h>
49
50
51-#define ATOMIC_INIT(i) ((atomic_t) { (i) })
52-#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
53+#define ATOMIC_INIT(i) { (i) }
54+#define ATOMIC64_INIT(i) { (i) }
55
56 #define atomic_read(v) (*(volatile int *)&(v)->counter)
57 #define atomic64_read(v) (*(volatile long *)&(v)->counter)
58diff --git a/drivers/char/mspec.c b/drivers/char/mspec.c
59index 5c0d96a..b12ffea 100644
60--- a/drivers/char/mspec.c
61+++ b/drivers/char/mspec.c
62@@ -284,7 +284,7 @@ mspec_mmap(struct file *file, struct vm_area_struct *vma,
63 vdata->flags = flags;
64 vdata->type = type;
65 spin_lock_init(&vdata->lock);
66- vdata->refcnt = ATOMIC_INIT(1);
67+ atomic_set(&vdata->refcnt, 1);
68 vma->vm_private_data = vdata;
69
70 vma->vm_flags |= (VM_IO | VM_RESERVED | VM_PFNMAP | VM_DONTEXPAND);
71--
721.7.7.6
73
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0034-dm-thin-reduce-endio_hook-pool-size.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0034-dm-thin-reduce-endio_hook-pool-size.patch
new file mode 100644
index 00000000..c3c5f8ba
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0034-dm-thin-reduce-endio_hook-pool-size.patch
@@ -0,0 +1,37 @@
1From 1385bcac3fbce09731cb85a16a86952796a5dcbf Mon Sep 17 00:00:00 2001
2From: Alasdair G Kergon <agk@redhat.com>
3Date: Fri, 27 Jul 2012 15:07:57 +0100
4Subject: [PATCH 34/70] dm thin: reduce endio_hook pool size
5
6commit 7768ed33ccdc02801c4483fc5682dc66ace14aea upstream.
7
8Reduce the slab size used for the dm_thin_endio_hook mempool.
9
10Allocation has been seen to fail on machines with smaller amounts
11of memory due to fragmentation.
12
13 lvm: page allocation failure. order:5, mode:0xd0
14 device-mapper: table: 253:38: thin-pool: Error creating pool's endio_hook mempool
15
16Signed-off-by: Alasdair G Kergon <agk@redhat.com>
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/md/dm-thin.c | 2 +-
20 1 files changed, 1 insertions(+), 1 deletions(-)
21
22diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
23index 532a902..f68290d 100644
24--- a/drivers/md/dm-thin.c
25+++ b/drivers/md/dm-thin.c
26@@ -19,7 +19,7 @@
27 /*
28 * Tunable constants
29 */
30-#define ENDIO_HOOK_POOL_SIZE 10240
31+#define ENDIO_HOOK_POOL_SIZE 1024
32 #define DEFERRED_SET_SIZE 64
33 #define MAPPING_POOL_SIZE 1024
34 #define PRISON_CELLS 1024
35--
361.7.7.6
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0035-dm-thin-fix-memory-leak-in-process_prepared_mapping-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0035-dm-thin-fix-memory-leak-in-process_prepared_mapping-.patch
new file mode 100644
index 00000000..1a4dfb93
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0035-dm-thin-fix-memory-leak-in-process_prepared_mapping-.patch
@@ -0,0 +1,53 @@
1From 0b46cbe86286a3688c4469a702b907d4f45f6b17 Mon Sep 17 00:00:00 2001
2From: Joe Thornber <ejt@redhat.com>
3Date: Fri, 27 Jul 2012 15:08:05 +0100
4Subject: [PATCH 35/70] dm thin: fix memory leak in process_prepared_mapping
5 error paths
6
7commit 905386f82d08f66726912f303f3e6605248c60a3 upstream.
8
9Fix memory leak in process_prepared_mapping by always freeing
10the dm_thin_new_mapping structs from the mapping_pool mempool on
11the error paths.
12
13Signed-off-by: Joe Thornber <ejt@redhat.com>
14Signed-off-by: Mike Snitzer <snitzer@redhat.com>
15Signed-off-by: Alasdair G Kergon <agk@redhat.com>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 drivers/md/dm-thin.c | 5 +++--
19 1 files changed, 3 insertions(+), 2 deletions(-)
20
21diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
22index f68290d..d432032 100644
23--- a/drivers/md/dm-thin.c
24+++ b/drivers/md/dm-thin.c
25@@ -857,7 +857,7 @@ static void process_prepared_mapping(struct new_mapping *m)
26
27 if (m->err) {
28 cell_error(m->cell);
29- return;
30+ goto out;
31 }
32
33 /*
34@@ -869,7 +869,7 @@ static void process_prepared_mapping(struct new_mapping *m)
35 if (r) {
36 DMERR("dm_thin_insert_block() failed");
37 cell_error(m->cell);
38- return;
39+ goto out;
40 }
41
42 /*
43@@ -884,6 +884,7 @@ static void process_prepared_mapping(struct new_mapping *m)
44 } else
45 cell_defer(tc, m->cell, m->data_block);
46
47+out:
48 list_del(&m->list);
49 mempool_free(m, tc->pool->mapping_pool);
50 }
51--
521.7.7.6
53
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0036-random-mix-in-architectural-randomness-in-extract_bu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0036-random-mix-in-architectural-randomness-in-extract_bu.patch
new file mode 100644
index 00000000..26586e66
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0036-random-mix-in-architectural-randomness-in-extract_bu.patch
@@ -0,0 +1,151 @@
1From fe897421d28b4fce43ee643aa1e1bacecd6aacf2 Mon Sep 17 00:00:00 2001
2From: "H. Peter Anvin" <hpa@linux.intel.com>
3Date: Fri, 27 Jul 2012 22:26:08 -0400
4Subject: [PATCH 36/70] random: mix in architectural randomness in
5 extract_buf()
6
7commit d2e7c96af1e54b507ae2a6a7dd2baf588417a7e5 upstream.
8
9Mix in any architectural randomness in extract_buf() instead of
10xfer_secondary_buf(). This allows us to mix in more architectural
11randomness, and it also makes xfer_secondary_buf() faster, moving a
12tiny bit of additional CPU overhead to process which is extracting the
13randomness.
14
15[ Commit description modified by tytso to remove an extended
16 advertisement for the RDRAND instruction. ]
17
18Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
19Acked-by: Ingo Molnar <mingo@kernel.org>
20Cc: DJ Johnston <dj.johnston@intel.com>
21Signed-off-by: Theodore Ts'o <tytso@mit.edu>
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23---
24 drivers/char/random.c | 56 ++++++++++++++++++++++++++++---------------------
25 1 files changed, 32 insertions(+), 24 deletions(-)
26
27diff --git a/drivers/char/random.c b/drivers/char/random.c
28index f3200bf..631d4f6 100644
29--- a/drivers/char/random.c
30+++ b/drivers/char/random.c
31@@ -274,6 +274,8 @@
32 #define SEC_XFER_SIZE 512
33 #define EXTRACT_SIZE 10
34
35+#define LONGS(x) (((x) + sizeof(unsigned long) - 1)/sizeof(unsigned long))
36+
37 /*
38 * The minimum number of bits of entropy before we wake up a read on
39 * /dev/random. Should be enough to do a significant reseed.
40@@ -835,11 +837,7 @@ static ssize_t extract_entropy(struct entropy_store *r, void *buf,
41 */
42 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
43 {
44- union {
45- __u32 tmp[OUTPUT_POOL_WORDS];
46- long hwrand[4];
47- } u;
48- int i;
49+ __u32 tmp[OUTPUT_POOL_WORDS];
50
51 if (r->pull && r->entropy_count < nbytes * 8 &&
52 r->entropy_count < r->poolinfo->POOLBITS) {
53@@ -850,23 +848,17 @@ static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)
54 /* pull at least as many as BYTES as wakeup BITS */
55 bytes = max_t(int, bytes, random_read_wakeup_thresh / 8);
56 /* but never more than the buffer size */
57- bytes = min_t(int, bytes, sizeof(u.tmp));
58+ bytes = min_t(int, bytes, sizeof(tmp));
59
60 DEBUG_ENT("going to reseed %s with %d bits "
61 "(%d of %d requested)\n",
62 r->name, bytes * 8, nbytes * 8, r->entropy_count);
63
64- bytes = extract_entropy(r->pull, u.tmp, bytes,
65+ bytes = extract_entropy(r->pull, tmp, bytes,
66 random_read_wakeup_thresh / 8, rsvd);
67- mix_pool_bytes(r, u.tmp, bytes, NULL);
68+ mix_pool_bytes(r, tmp, bytes, NULL);
69 credit_entropy_bits(r, bytes*8);
70 }
71- kmemcheck_mark_initialized(&u.hwrand, sizeof(u.hwrand));
72- for (i = 0; i < 4; i++)
73- if (arch_get_random_long(&u.hwrand[i]))
74- break;
75- if (i)
76- mix_pool_bytes(r, &u.hwrand, sizeof(u.hwrand), 0);
77 }
78
79 /*
80@@ -923,15 +915,19 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
81 static void extract_buf(struct entropy_store *r, __u8 *out)
82 {
83 int i;
84- __u32 hash[5], workspace[SHA_WORKSPACE_WORDS];
85+ union {
86+ __u32 w[5];
87+ unsigned long l[LONGS(EXTRACT_SIZE)];
88+ } hash;
89+ __u32 workspace[SHA_WORKSPACE_WORDS];
90 __u8 extract[64];
91 unsigned long flags;
92
93 /* Generate a hash across the pool, 16 words (512 bits) at a time */
94- sha_init(hash);
95+ sha_init(hash.w);
96 spin_lock_irqsave(&r->lock, flags);
97 for (i = 0; i < r->poolinfo->poolwords; i += 16)
98- sha_transform(hash, (__u8 *)(r->pool + i), workspace);
99+ sha_transform(hash.w, (__u8 *)(r->pool + i), workspace);
100
101 /*
102 * We mix the hash back into the pool to prevent backtracking
103@@ -942,14 +938,14 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
104 * brute-forcing the feedback as hard as brute-forcing the
105 * hash.
106 */
107- __mix_pool_bytes(r, hash, sizeof(hash), extract);
108+ __mix_pool_bytes(r, hash.w, sizeof(hash.w), extract);
109 spin_unlock_irqrestore(&r->lock, flags);
110
111 /*
112 * To avoid duplicates, we atomically extract a portion of the
113 * pool while mixing, and hash one final time.
114 */
115- sha_transform(hash, extract, workspace);
116+ sha_transform(hash.w, extract, workspace);
117 memset(extract, 0, sizeof(extract));
118 memset(workspace, 0, sizeof(workspace));
119
120@@ -958,11 +954,23 @@ static void extract_buf(struct entropy_store *r, __u8 *out)
121 * pattern, we fold it in half. Thus, we always feed back
122 * twice as much data as we output.
123 */
124- hash[0] ^= hash[3];
125- hash[1] ^= hash[4];
126- hash[2] ^= rol32(hash[2], 16);
127- memcpy(out, hash, EXTRACT_SIZE);
128- memset(hash, 0, sizeof(hash));
129+ hash.w[0] ^= hash.w[3];
130+ hash.w[1] ^= hash.w[4];
131+ hash.w[2] ^= rol32(hash.w[2], 16);
132+
133+ /*
134+ * If we have a architectural hardware random number
135+ * generator, mix that in, too.
136+ */
137+ for (i = 0; i < LONGS(EXTRACT_SIZE); i++) {
138+ unsigned long v;
139+ if (!arch_get_random_long(&v))
140+ break;
141+ hash.l[i] ^= v;
142+ }
143+
144+ memcpy(out, &hash, EXTRACT_SIZE);
145+ memset(&hash, 0, sizeof(hash));
146 }
147
148 static ssize_t extract_entropy(struct entropy_store *r, void *buf,
149--
1501.7.7.6
151
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0037-asus-wmi-use-ASUS_WMI_METHODID_DSTS2-as-default-DSTS.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0037-asus-wmi-use-ASUS_WMI_METHODID_DSTS2-as-default-DSTS.patch
new file mode 100644
index 00000000..983ede29
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0037-asus-wmi-use-ASUS_WMI_METHODID_DSTS2-as-default-DSTS.patch
@@ -0,0 +1,44 @@
1From b84b4b80d632292198b2281d2c76044b5bebadd3 Mon Sep 17 00:00:00 2001
2From: Alex Hung <alex.hung@canonical.com>
3Date: Wed, 20 Jun 2012 11:47:35 +0800
4Subject: [PATCH 37/70] asus-wmi: use ASUS_WMI_METHODID_DSTS2 as default DSTS
5 ID.
6
7commit 63a78bb1051b240417daad3a3fa9c1bb10646dca upstream.
8
9According to responses from the BIOS team, ASUS_WMI_METHODID_DSTS2
10(0x53545344) will be used as future DSTS ID. In addition, calling
11asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2, 0, 0, NULL) returns
12ASUS_WMI_UNSUPPORTED_METHOD in new ASUS laptop PCs. This patch fixes
13no DSTS ID will be assigned in this case.
14
15Signed-off-by: Alex Hung <alex.hung@canonical.com>
16Signed-off-by: Matthew Garrett <mjg@redhat.com>
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/platform/x86/asus-wmi.c | 7 +------
20 1 files changed, 1 insertions(+), 6 deletions(-)
21
22diff --git a/drivers/platform/x86/asus-wmi.c b/drivers/platform/x86/asus-wmi.c
23index d1049ee..26fba2d 100644
24--- a/drivers/platform/x86/asus-wmi.c
25+++ b/drivers/platform/x86/asus-wmi.c
26@@ -1431,14 +1431,9 @@ static int asus_wmi_platform_init(struct asus_wmi *asus)
27 */
28 if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS, 0, 0, NULL))
29 asus->dsts_id = ASUS_WMI_METHODID_DSTS;
30- else if (!asus_wmi_evaluate_method(ASUS_WMI_METHODID_DSTS2, 0, 0, NULL))
31+ else
32 asus->dsts_id = ASUS_WMI_METHODID_DSTS2;
33
34- if (!asus->dsts_id) {
35- pr_err("Can't find DSTS");
36- return -ENODEV;
37- }
38-
39 /* CWAP allow to define the behavior of the Fn+F2 key,
40 * this method doesn't seems to be present on Eee PCs */
41 if (asus->driver->wapf >= 0)
42--
431.7.7.6
44
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0038-virtio-blk-Use-block-layer-provided-spinlock.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0038-virtio-blk-Use-block-layer-provided-spinlock.patch
new file mode 100644
index 00000000..8efee34f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0038-virtio-blk-Use-block-layer-provided-spinlock.patch
@@ -0,0 +1,103 @@
1From b0b5f9284f3f86ce8c28aa112d267d261a5201e9 Mon Sep 17 00:00:00 2001
2From: Asias He <asias@redhat.com>
3Date: Fri, 25 May 2012 16:03:27 +0800
4Subject: [PATCH 38/70] virtio-blk: Use block layer provided spinlock
5
6commit 2c95a3290919541b846bee3e0fbaa75860929f53 upstream.
7
8Block layer will allocate a spinlock for the queue if the driver does
9not provide one in blk_init_queue().
10
11The reason to use the internal spinlock is that blk_cleanup_queue() will
12switch to use the internal spinlock in the cleanup code path.
13
14 if (q->queue_lock != &q->__queue_lock)
15 q->queue_lock = &q->__queue_lock;
16
17However, processes which are in D state might have taken the driver
18provided spinlock, when the processes wake up, they would release the
19block provided spinlock.
20
21=====================================
22[ BUG: bad unlock balance detected! ]
233.4.0-rc7+ #238 Not tainted
24-------------------------------------
25fio/3587 is trying to release lock (&(&q->__queue_lock)->rlock) at:
26[<ffffffff813274d2>] blk_queue_bio+0x2a2/0x380
27but there are no more locks to release!
28
29other info that might help us debug this:
301 lock held by fio/3587:
31 #0: (&(&vblk->lock)->rlock){......}, at:
32[<ffffffff8132661a>] get_request_wait+0x19a/0x250
33
34Other drivers use block layer provided spinlock as well, e.g. SCSI.
35
36Switching to the block layer provided spinlock saves a bit of memory and
37does not increase lock contention. Performance test shows no real
38difference is observed before and after this patch.
39
40Changes in v2: Improve commit log as Michael suggested.
41
42Cc: virtualization@lists.linux-foundation.org
43Cc: kvm@vger.kernel.org
44Signed-off-by: Asias He <asias@redhat.com>
45Acked-by: Michael S. Tsirkin <mst@redhat.com>
46Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
47[bwh: Backported to 3.2: adjust context]
48Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
49---
50 drivers/block/virtio_blk.c | 9 +++------
51 1 files changed, 3 insertions(+), 6 deletions(-)
52
53diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c
54index e46f2f7..650a308 100644
55--- a/drivers/block/virtio_blk.c
56+++ b/drivers/block/virtio_blk.c
57@@ -20,8 +20,6 @@ struct workqueue_struct *virtblk_wq;
58
59 struct virtio_blk
60 {
61- spinlock_t lock;
62-
63 struct virtio_device *vdev;
64 struct virtqueue *vq;
65
66@@ -62,7 +60,7 @@ static void blk_done(struct virtqueue *vq)
67 unsigned int len;
68 unsigned long flags;
69
70- spin_lock_irqsave(&vblk->lock, flags);
71+ spin_lock_irqsave(vblk->disk->queue->queue_lock, flags);
72 while ((vbr = virtqueue_get_buf(vblk->vq, &len)) != NULL) {
73 int error;
74
75@@ -97,7 +95,7 @@ static void blk_done(struct virtqueue *vq)
76 }
77 /* In case queue is stopped waiting for more buffers. */
78 blk_start_queue(vblk->disk->queue);
79- spin_unlock_irqrestore(&vblk->lock, flags);
80+ spin_unlock_irqrestore(vblk->disk->queue->queue_lock, flags);
81 }
82
83 static bool do_req(struct request_queue *q, struct virtio_blk *vblk,
84@@ -384,7 +382,6 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
85 }
86
87 INIT_LIST_HEAD(&vblk->reqs);
88- spin_lock_init(&vblk->lock);
89 vblk->vdev = vdev;
90 vblk->sg_elems = sg_elems;
91 sg_init_table(vblk->sg, vblk->sg_elems);
92@@ -410,7 +407,7 @@ static int __devinit virtblk_probe(struct virtio_device *vdev)
93 goto out_mempool;
94 }
95
96- q = vblk->disk->queue = blk_init_queue(do_virtblk_request, &vblk->lock);
97+ q = vblk->disk->queue = blk_init_queue(do_virtblk_request, NULL);
98 if (!q) {
99 err = -ENOMEM;
100 goto out_put_disk;
101--
1021.7.7.6
103
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0039-s390-mm-fix-fault-handling-for-page-table-walk-case.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0039-s390-mm-fix-fault-handling-for-page-table-walk-case.patch
new file mode 100644
index 00000000..51b2063d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0039-s390-mm-fix-fault-handling-for-page-table-walk-case.patch
@@ -0,0 +1,72 @@
1From 3f3c533087d18cd75fbd23caa35032b3cec80ea8 Mon Sep 17 00:00:00 2001
2From: Heiko Carstens <heiko.carstens@de.ibm.com>
3Date: Fri, 27 Jul 2012 09:45:39 +0200
4Subject: [PATCH 39/70] s390/mm: fix fault handling for page table walk case
5
6commit 008c2e8f247f0a8db1e8e26139da12f3a3abcda0 upstream.
7
8Make sure the kernel does not incorrectly create a SIGBUS signal during
9user space accesses:
10
11For user space accesses in the switched addressing mode case the kernel
12may walk page tables and access user address space via the kernel
13mapping. If a page table entry is invalid the function __handle_fault()
14gets called in order to emulate a page fault and trigger all the usual
15actions like paging in a missing page etc. by calling handle_mm_fault().
16
17If handle_mm_fault() returns with an error fixup handling is necessary.
18For the switched addressing mode case all errors need to be mapped to
19-EFAULT, so that the calling uaccess function can return -EFAULT to
20user space.
21
22Unfortunately the __handle_fault() incorrectly calls do_sigbus() if
23VM_FAULT_SIGBUS is set. This however should only happen if a page fault
24was triggered by a user space instruction. For kernel mode uaccesses
25the correct action is to only return -EFAULT.
26So user space may incorrectly see SIGBUS signals because of this bug.
27
28For current machines this would only be possible for the switched
29addressing mode case in conjunction with futex operations.
30
31Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
32Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
33[bwh: Backported to 3.2: do_exception() and do_sigbus() parameters differ]
34Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
35---
36 arch/s390/mm/fault.c | 13 +++++++------
37 1 files changed, 7 insertions(+), 6 deletions(-)
38
39diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c
40index b28aaa4..0fc0a7e 100644
41--- a/arch/s390/mm/fault.c
42+++ b/arch/s390/mm/fault.c
43@@ -453,6 +453,7 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
44 struct pt_regs regs;
45 int access, fault;
46
47+ /* Emulate a uaccess fault from kernel mode. */
48 regs.psw.mask = psw_kernel_bits | PSW_MASK_DAT | PSW_MASK_MCHECK;
49 if (!irqs_disabled())
50 regs.psw.mask |= PSW_MASK_IO | PSW_MASK_EXT;
51@@ -461,12 +462,12 @@ int __handle_fault(unsigned long uaddr, unsigned long pgm_int_code, int write)
52 uaddr &= PAGE_MASK;
53 access = write ? VM_WRITE : VM_READ;
54 fault = do_exception(&regs, access, uaddr | 2);
55- if (unlikely(fault)) {
56- if (fault & VM_FAULT_OOM)
57- return -EFAULT;
58- else if (fault & VM_FAULT_SIGBUS)
59- do_sigbus(&regs, pgm_int_code, uaddr);
60- }
61+ /*
62+ * Since the fault happened in kernel mode while performing a uaccess
63+ * all we need to do now is emulating a fixup in case "fault" is not
64+ * zero.
65+ * For the calling uaccess functions this results always in -EFAULT.
66+ */
67 return fault ? -EFAULT : 0;
68 }
69
70--
711.7.7.6
72
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0040-nfs-skip-commit-in-releasepage-if-we-re-freeing-memo.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0040-nfs-skip-commit-in-releasepage-if-we-re-freeing-memo.patch
new file mode 100644
index 00000000..1063bad8
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0040-nfs-skip-commit-in-releasepage-if-we-re-freeing-memo.patch
@@ -0,0 +1,182 @@
1From 264ef5a0ef781e5e2212558fe56f17f6cc2b7308 Mon Sep 17 00:00:00 2001
2From: Jeff Layton <jlayton@redhat.com>
3Date: Mon, 23 Jul 2012 13:58:51 -0400
4Subject: [PATCH 40/70] nfs: skip commit in releasepage if we're freeing
5 memory for fs-related reasons
6
7commit 5cf02d09b50b1ee1c2d536c9cf64af5a7d433f56 upstream.
8
9We've had some reports of a deadlock where rpciod ends up with a stack
10trace like this:
11
12 PID: 2507 TASK: ffff88103691ab40 CPU: 14 COMMAND: "rpciod/14"
13 #0 [ffff8810343bf2f0] schedule at ffffffff814dabd9
14 #1 [ffff8810343bf3b8] nfs_wait_bit_killable at ffffffffa038fc04 [nfs]
15 #2 [ffff8810343bf3c8] __wait_on_bit at ffffffff814dbc2f
16 #3 [ffff8810343bf418] out_of_line_wait_on_bit at ffffffff814dbcd8
17 #4 [ffff8810343bf488] nfs_commit_inode at ffffffffa039e0c1 [nfs]
18 #5 [ffff8810343bf4f8] nfs_release_page at ffffffffa038bef6 [nfs]
19 #6 [ffff8810343bf528] try_to_release_page at ffffffff8110c670
20 #7 [ffff8810343bf538] shrink_page_list.clone.0 at ffffffff81126271
21 #8 [ffff8810343bf668] shrink_inactive_list at ffffffff81126638
22 #9 [ffff8810343bf818] shrink_zone at ffffffff8112788f
23 #10 [ffff8810343bf8c8] do_try_to_free_pages at ffffffff81127b1e
24 #11 [ffff8810343bf958] try_to_free_pages at ffffffff8112812f
25 #12 [ffff8810343bfa08] __alloc_pages_nodemask at ffffffff8111fdad
26 #13 [ffff8810343bfb28] kmem_getpages at ffffffff81159942
27 #14 [ffff8810343bfb58] fallback_alloc at ffffffff8115a55a
28 #15 [ffff8810343bfbd8] ____cache_alloc_node at ffffffff8115a2d9
29 #16 [ffff8810343bfc38] kmem_cache_alloc at ffffffff8115b09b
30 #17 [ffff8810343bfc78] sk_prot_alloc at ffffffff81411808
31 #18 [ffff8810343bfcb8] sk_alloc at ffffffff8141197c
32 #19 [ffff8810343bfce8] inet_create at ffffffff81483ba6
33 #20 [ffff8810343bfd38] __sock_create at ffffffff8140b4a7
34 #21 [ffff8810343bfd98] xs_create_sock at ffffffffa01f649b [sunrpc]
35 #22 [ffff8810343bfdd8] xs_tcp_setup_socket at ffffffffa01f6965 [sunrpc]
36 #23 [ffff8810343bfe38] worker_thread at ffffffff810887d0
37 #24 [ffff8810343bfee8] kthread at ffffffff8108dd96
38 #25 [ffff8810343bff48] kernel_thread at ffffffff8100c1ca
39
40rpciod is trying to allocate memory for a new socket to talk to the
41server. The VM ends up calling ->releasepage to get more memory, and it
42tries to do a blocking commit. That commit can't succeed however without
43a connected socket, so we deadlock.
44
45Fix this by setting PF_FSTRANS on the workqueue task prior to doing the
46socket allocation, and having nfs_release_page check for that flag when
47deciding whether to do a commit call. Also, set PF_FSTRANS
48unconditionally in rpc_async_schedule since that function can also do
49allocations sometimes.
50
51Signed-off-by: Jeff Layton <jlayton@redhat.com>
52Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
53Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
54---
55 fs/nfs/file.c | 7 +++++--
56 net/sunrpc/sched.c | 2 ++
57 net/sunrpc/xprtrdma/transport.c | 3 ++-
58 net/sunrpc/xprtsock.c | 10 ++++++++++
59 4 files changed, 19 insertions(+), 3 deletions(-)
60
61diff --git a/fs/nfs/file.c b/fs/nfs/file.c
62index c43a452..961e562 100644
63--- a/fs/nfs/file.c
64+++ b/fs/nfs/file.c
65@@ -452,8 +452,11 @@ static int nfs_release_page(struct page *page, gfp_t gfp)
66
67 dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page);
68
69- /* Only do I/O if gfp is a superset of GFP_KERNEL */
70- if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL) {
71+ /* Only do I/O if gfp is a superset of GFP_KERNEL, and we're not
72+ * doing this memory reclaim for a fs-related allocation.
73+ */
74+ if (mapping && (gfp & GFP_KERNEL) == GFP_KERNEL &&
75+ !(current->flags & PF_FSTRANS)) {
76 int how = FLUSH_SYNC;
77
78 /* Don't let kswapd deadlock waiting for OOM RPC calls */
79diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c
80index 4e2b3b4..c90b832 100644
81--- a/net/sunrpc/sched.c
82+++ b/net/sunrpc/sched.c
83@@ -755,7 +755,9 @@ void rpc_execute(struct rpc_task *task)
84
85 static void rpc_async_schedule(struct work_struct *work)
86 {
87+ current->flags |= PF_FSTRANS;
88 __rpc_execute(container_of(work, struct rpc_task, u.tk_work));
89+ current->flags &= ~PF_FSTRANS;
90 }
91
92 /**
93diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
94index b446e10..06cdbff 100644
95--- a/net/sunrpc/xprtrdma/transport.c
96+++ b/net/sunrpc/xprtrdma/transport.c
97@@ -200,6 +200,7 @@ xprt_rdma_connect_worker(struct work_struct *work)
98 int rc = 0;
99
100 if (!xprt->shutdown) {
101+ current->flags |= PF_FSTRANS;
102 xprt_clear_connected(xprt);
103
104 dprintk("RPC: %s: %sconnect\n", __func__,
105@@ -212,10 +213,10 @@ xprt_rdma_connect_worker(struct work_struct *work)
106
107 out:
108 xprt_wake_pending_tasks(xprt, rc);
109-
110 out_clear:
111 dprintk("RPC: %s: exit\n", __func__);
112 xprt_clear_connecting(xprt);
113+ current->flags &= ~PF_FSTRANS;
114 }
115
116 /*
117diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
118index 55472c4..1a6edc7 100644
119--- a/net/sunrpc/xprtsock.c
120+++ b/net/sunrpc/xprtsock.c
121@@ -1895,6 +1895,8 @@ static void xs_local_setup_socket(struct work_struct *work)
122 if (xprt->shutdown)
123 goto out;
124
125+ current->flags |= PF_FSTRANS;
126+
127 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
128 status = __sock_create(xprt->xprt_net, AF_LOCAL,
129 SOCK_STREAM, 0, &sock, 1);
130@@ -1928,6 +1930,7 @@ static void xs_local_setup_socket(struct work_struct *work)
131 out:
132 xprt_clear_connecting(xprt);
133 xprt_wake_pending_tasks(xprt, status);
134+ current->flags &= ~PF_FSTRANS;
135 }
136
137 static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
138@@ -1970,6 +1973,8 @@ static void xs_udp_setup_socket(struct work_struct *work)
139 if (xprt->shutdown)
140 goto out;
141
142+ current->flags |= PF_FSTRANS;
143+
144 /* Start by resetting any existing state */
145 xs_reset_transport(transport);
146 sock = xs_create_sock(xprt, transport,
147@@ -1988,6 +1993,7 @@ static void xs_udp_setup_socket(struct work_struct *work)
148 out:
149 xprt_clear_connecting(xprt);
150 xprt_wake_pending_tasks(xprt, status);
151+ current->flags &= ~PF_FSTRANS;
152 }
153
154 /*
155@@ -2113,6 +2119,8 @@ static void xs_tcp_setup_socket(struct work_struct *work)
156 if (xprt->shutdown)
157 goto out;
158
159+ current->flags |= PF_FSTRANS;
160+
161 if (!sock) {
162 clear_bit(XPRT_CONNECTION_ABORT, &xprt->state);
163 sock = xs_create_sock(xprt, transport,
164@@ -2162,6 +2170,7 @@ static void xs_tcp_setup_socket(struct work_struct *work)
165 case -EINPROGRESS:
166 case -EALREADY:
167 xprt_clear_connecting(xprt);
168+ current->flags &= ~PF_FSTRANS;
169 return;
170 case -EINVAL:
171 /* Happens, for instance, if the user specified a link
172@@ -2174,6 +2183,7 @@ out_eagain:
173 out:
174 xprt_clear_connecting(xprt);
175 xprt_wake_pending_tasks(xprt, status);
176+ current->flags &= ~PF_FSTRANS;
177 }
178
179 /**
180--
1811.7.7.6
182
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0041-md-raid1-don-t-abort-a-resync-on-the-first-badblock.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0041-md-raid1-don-t-abort-a-resync-on-the-first-badblock.patch
new file mode 100644
index 00000000..5cbbca63
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0041-md-raid1-don-t-abort-a-resync-on-the-first-badblock.patch
@@ -0,0 +1,48 @@
1From 30dede5f9785f15bda14b54146afa5d3bd8ebcef Mon Sep 17 00:00:00 2001
2From: NeilBrown <neilb@suse.de>
3Date: Tue, 31 Jul 2012 10:05:34 +1000
4Subject: [PATCH 41/70] md/raid1: don't abort a resync on the first badblock.
5
6commit b7219ccb33aa0df9949a60c68b5e9f712615e56f upstream.
7
8If a resync of a RAID1 array with 2 devices finds a known bad block
9one device it will neither read from, or write to, that device for
10this block offset.
11So there will be one read_target (The other device) and zero write
12targets.
13This condition causes md/raid1 to abort the resync assuming that it
14has finished - without known bad blocks this would be true.
15
16When there are no write targets because of the presence of bad blocks
17we should only skip over the area covered by the bad block.
18RAID10 already gets this right, raid1 doesn't. Or didn't.
19
20As this can cause a 'sync' to abort early and appear to have succeeded
21it could lead to some data corruption, so it suitable for -stable.
22
23Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
24Signed-off-by: NeilBrown <neilb@suse.de>
25Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
26---
27 drivers/md/raid1.c | 5 ++++-
28 1 files changed, 4 insertions(+), 1 deletions(-)
29
30diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
31index 2d97bf0..62306e5 100644
32--- a/drivers/md/raid1.c
33+++ b/drivers/md/raid1.c
34@@ -2321,7 +2321,10 @@ static sector_t sync_request(struct mddev *mddev, sector_t sector_nr, int *skipp
35 /* There is nowhere to write, so all non-sync
36 * drives must be failed - so we are finished
37 */
38- sector_t rv = max_sector - sector_nr;
39+ sector_t rv;
40+ if (min_bad > 0)
41+ max_sector = sector_nr + min_bad;
42+ rv = max_sector - sector_nr;
43 *skipped = 1;
44 put_buf(r1_bio);
45 return rv;
46--
471.7.7.6
48
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0042-pcdp-use-early_ioremap-early_iounmap-to-access-pcdp-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0042-pcdp-use-early_ioremap-early_iounmap-to-access-pcdp-.patch
new file mode 100644
index 00000000..5d73f170
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0042-pcdp-use-early_ioremap-early_iounmap-to-access-pcdp-.patch
@@ -0,0 +1,73 @@
1From d95d761e05255b4aadcc2978c41cbabb0fba5069 Mon Sep 17 00:00:00 2001
2From: Greg Pearson <greg.pearson@hp.com>
3Date: Mon, 30 Jul 2012 14:39:05 -0700
4Subject: [PATCH 42/70] pcdp: use early_ioremap/early_iounmap to access pcdp
5 table
6
7commit 6c4088ac3a4d82779903433bcd5f048c58fb1aca upstream.
8
9efi_setup_pcdp_console() is called during boot to parse the HCDP/PCDP
10EFI system table and setup an early console for printk output. The
11routine uses ioremap/iounmap to setup access to the HCDP/PCDP table
12information.
13
14The call to ioremap is happening early in the boot process which leads
15to a panic on x86_64 systems:
16
17 panic+0x01ca
18 do_exit+0x043c
19 oops_end+0x00a7
20 no_context+0x0119
21 __bad_area_nosemaphore+0x0138
22 bad_area_nosemaphore+0x000e
23 do_page_fault+0x0321
24 page_fault+0x0020
25 reserve_memtype+0x02a1
26 __ioremap_caller+0x0123
27 ioremap_nocache+0x0012
28 efi_setup_pcdp_console+0x002b
29 setup_arch+0x03a9
30 start_kernel+0x00d4
31 x86_64_start_reservations+0x012c
32 x86_64_start_kernel+0x00fe
33
34This replaces the calls to ioremap/iounmap in efi_setup_pcdp_console()
35with calls to early_ioremap/early_iounmap which can be called during
36early boot.
37
38This patch was tested on an x86_64 prototype system which uses the
39HCDP/PCDP table for early console setup.
40
41Signed-off-by: Greg Pearson <greg.pearson@hp.com>
42Acked-by: Khalid Aziz <khalid.aziz@hp.com>
43Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
44Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
45Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
46---
47 drivers/firmware/pcdp.c | 4 ++--
48 1 files changed, 2 insertions(+), 2 deletions(-)
49
50diff --git a/drivers/firmware/pcdp.c b/drivers/firmware/pcdp.c
51index 51e0e2d..a330492 100644
52--- a/drivers/firmware/pcdp.c
53+++ b/drivers/firmware/pcdp.c
54@@ -95,7 +95,7 @@ efi_setup_pcdp_console(char *cmdline)
55 if (efi.hcdp == EFI_INVALID_TABLE_ADDR)
56 return -ENODEV;
57
58- pcdp = ioremap(efi.hcdp, 4096);
59+ pcdp = early_ioremap(efi.hcdp, 4096);
60 printk(KERN_INFO "PCDP: v%d at 0x%lx\n", pcdp->rev, efi.hcdp);
61
62 if (strstr(cmdline, "console=hcdp")) {
63@@ -131,6 +131,6 @@ efi_setup_pcdp_console(char *cmdline)
64 }
65
66 out:
67- iounmap(pcdp);
68+ early_iounmap(pcdp, 4096);
69 return rc;
70 }
71--
721.7.7.6
73
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0043-lib-vsprintf.c-kptr_restrict-fix-pK-error-in-SysRq-s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0043-lib-vsprintf.c-kptr_restrict-fix-pK-error-in-SysRq-s.patch
new file mode 100644
index 00000000..791a80eb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0043-lib-vsprintf.c-kptr_restrict-fix-pK-error-in-SysRq-s.patch
@@ -0,0 +1,48 @@
1From a0a91da6c89df972be571c3b3cc7288dcab8b501 Mon Sep 17 00:00:00 2001
2From: Dan Rosenberg <drosenberg@vsecurity.com>
3Date: Mon, 30 Jul 2012 14:40:26 -0700
4Subject: [PATCH 43/70] lib/vsprintf.c: kptr_restrict: fix pK-error in SysRq
5 show-all-timers(Q)
6
7commit 3715c5309f6d175c3053672b73fd4f73be16fd07 upstream.
8
9When using ALT+SysRq+Q all the pointers are replaced with "pK-error" like
10this:
11
12 [23153.208033] .base: pK-error
13
14with echo h > /proc/sysrq-trigger it works:
15
16 [23107.776363] .base: ffff88023e60d540
17
18The intent behind this behavior was to return "pK-error" in cases where
19the %pK format specifier was used in interrupt context, because the
20CAP_SYSLOG check wouldn't be meaningful. Clearly this should only apply
21when kptr_restrict is actually enabled though.
22
23Reported-by: Stevie Trujillo <stevie.trujillo@gmail.com>
24Signed-off-by: Dan Rosenberg <dan.j.rosenberg@gmail.com>
25Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
26Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
27Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
28---
29 lib/vsprintf.c | 3 ++-
30 1 files changed, 2 insertions(+), 1 deletions(-)
31
32diff --git a/lib/vsprintf.c b/lib/vsprintf.c
33index 993599e..d74c317 100644
34--- a/lib/vsprintf.c
35+++ b/lib/vsprintf.c
36@@ -886,7 +886,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
37 * %pK cannot be used in IRQ context because its test
38 * for CAP_SYSLOG would be meaningless.
39 */
40- if (in_irq() || in_serving_softirq() || in_nmi()) {
41+ if (kptr_restrict && (in_irq() || in_serving_softirq() ||
42+ in_nmi())) {
43 if (spec.field_width == -1)
44 spec.field_width = 2 * sizeof(void *);
45 return string(buf, end, "pK-error", spec);
46--
471.7.7.6
48
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0044-nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioct.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0044-nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioct.patch
new file mode 100644
index 00000000..081eb4b3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0044-nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioct.patch
@@ -0,0 +1,144 @@
1From 9cdd3090a527c3174e3db476d1e86db6e9b2333e Mon Sep 17 00:00:00 2001
2From: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
3Date: Mon, 30 Jul 2012 14:42:07 -0700
4Subject: [PATCH 44/70] nilfs2: fix deadlock issue between chcp and thaw
5 ioctls
6
7commit 572d8b3945a31bee7c40d21556803e4807fd9141 upstream.
8
9An fs-thaw ioctl causes deadlock with a chcp or mkcp -s command:
10
11 chcp D ffff88013870f3d0 0 1325 1324 0x00000004
12 ...
13 Call Trace:
14 nilfs_transaction_begin+0x11c/0x1a0 [nilfs2]
15 wake_up_bit+0x20/0x20
16 copy_from_user+0x18/0x30 [nilfs2]
17 nilfs_ioctl_change_cpmode+0x7d/0xcf [nilfs2]
18 nilfs_ioctl+0x252/0x61a [nilfs2]
19 do_page_fault+0x311/0x34c
20 get_unmapped_area+0x132/0x14e
21 do_vfs_ioctl+0x44b/0x490
22 __set_task_blocked+0x5a/0x61
23 vm_mmap_pgoff+0x76/0x87
24 __set_current_blocked+0x30/0x4a
25 sys_ioctl+0x4b/0x6f
26 system_call_fastpath+0x16/0x1b
27 thaw D ffff88013870d890 0 1352 1351 0x00000004
28 ...
29 Call Trace:
30 rwsem_down_failed_common+0xdb/0x10f
31 call_rwsem_down_write_failed+0x13/0x20
32 down_write+0x25/0x27
33 thaw_super+0x13/0x9e
34 do_vfs_ioctl+0x1f5/0x490
35 vm_mmap_pgoff+0x76/0x87
36 sys_ioctl+0x4b/0x6f
37 filp_close+0x64/0x6c
38 system_call_fastpath+0x16/0x1b
39
40where the thaw ioctl deadlocked at thaw_super() when called while chcp was
41waiting at nilfs_transaction_begin() called from
42nilfs_ioctl_change_cpmode(). This deadlock is 100% reproducible.
43
44This is because nilfs_ioctl_change_cpmode() first locks sb->s_umount in
45read mode and then waits for unfreezing in nilfs_transaction_begin(),
46whereas thaw_super() locks sb->s_umount in write mode. The locking of
47sb->s_umount here was intended to make snapshot mounts and the downgrade
48of snapshots to checkpoints exclusive.
49
50This fixes the deadlock issue by replacing the sb->s_umount usage in
51nilfs_ioctl_change_cpmode() with a dedicated mutex which protects snapshot
52mounts.
53
54Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
55Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
56Tested-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
57Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
58Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
59Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
60---
61 fs/nilfs2/ioctl.c | 4 ++--
62 fs/nilfs2/super.c | 3 +++
63 fs/nilfs2/the_nilfs.c | 1 +
64 fs/nilfs2/the_nilfs.h | 2 ++
65 4 files changed, 8 insertions(+), 2 deletions(-)
66
67diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
68index ac258be..c598cfb 100644
69--- a/fs/nilfs2/ioctl.c
70+++ b/fs/nilfs2/ioctl.c
71@@ -182,7 +182,7 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
72 if (copy_from_user(&cpmode, argp, sizeof(cpmode)))
73 goto out;
74
75- down_read(&inode->i_sb->s_umount);
76+ mutex_lock(&nilfs->ns_snapshot_mount_mutex);
77
78 nilfs_transaction_begin(inode->i_sb, &ti, 0);
79 ret = nilfs_cpfile_change_cpmode(
80@@ -192,7 +192,7 @@ static int nilfs_ioctl_change_cpmode(struct inode *inode, struct file *filp,
81 else
82 nilfs_transaction_commit(inode->i_sb); /* never fails */
83
84- up_read(&inode->i_sb->s_umount);
85+ mutex_unlock(&nilfs->ns_snapshot_mount_mutex);
86 out:
87 mnt_drop_write(filp->f_path.mnt);
88 return ret;
89diff --git a/fs/nilfs2/super.c b/fs/nilfs2/super.c
90index 8351c44..97bfbdd 100644
91--- a/fs/nilfs2/super.c
92+++ b/fs/nilfs2/super.c
93@@ -951,6 +951,8 @@ static int nilfs_attach_snapshot(struct super_block *s, __u64 cno,
94 struct nilfs_root *root;
95 int ret;
96
97+ mutex_lock(&nilfs->ns_snapshot_mount_mutex);
98+
99 down_read(&nilfs->ns_segctor_sem);
100 ret = nilfs_cpfile_is_snapshot(nilfs->ns_cpfile, cno);
101 up_read(&nilfs->ns_segctor_sem);
102@@ -975,6 +977,7 @@ static int nilfs_attach_snapshot(struct super_block *s, __u64 cno,
103 ret = nilfs_get_root_dentry(s, root, root_dentry);
104 nilfs_put_root(root);
105 out:
106+ mutex_unlock(&nilfs->ns_snapshot_mount_mutex);
107 return ret;
108 }
109
110diff --git a/fs/nilfs2/the_nilfs.c b/fs/nilfs2/the_nilfs.c
111index 35a8970..1c98f53 100644
112--- a/fs/nilfs2/the_nilfs.c
113+++ b/fs/nilfs2/the_nilfs.c
114@@ -76,6 +76,7 @@ struct the_nilfs *alloc_nilfs(struct block_device *bdev)
115 nilfs->ns_bdev = bdev;
116 atomic_set(&nilfs->ns_ndirtyblks, 0);
117 init_rwsem(&nilfs->ns_sem);
118+ mutex_init(&nilfs->ns_snapshot_mount_mutex);
119 INIT_LIST_HEAD(&nilfs->ns_dirty_files);
120 INIT_LIST_HEAD(&nilfs->ns_gc_inodes);
121 spin_lock_init(&nilfs->ns_inode_lock);
122diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
123index 9992b11..de7435f 100644
124--- a/fs/nilfs2/the_nilfs.h
125+++ b/fs/nilfs2/the_nilfs.h
126@@ -47,6 +47,7 @@ enum {
127 * @ns_flags: flags
128 * @ns_bdev: block device
129 * @ns_sem: semaphore for shared states
130+ * @ns_snapshot_mount_mutex: mutex to protect snapshot mounts
131 * @ns_sbh: buffer heads of on-disk super blocks
132 * @ns_sbp: pointers to super block data
133 * @ns_sbwtime: previous write time of super block
134@@ -99,6 +100,7 @@ struct the_nilfs {
135
136 struct block_device *ns_bdev;
137 struct rw_semaphore ns_sem;
138+ struct mutex ns_snapshot_mount_mutex;
139
140 /*
141 * used for
142--
1431.7.7.6
144
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0045-SUNRPC-return-negative-value-in-case-rpcbind-client-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0045-SUNRPC-return-negative-value-in-case-rpcbind-client-.patch
new file mode 100644
index 00000000..78d6dc3c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0045-SUNRPC-return-negative-value-in-case-rpcbind-client-.patch
@@ -0,0 +1,45 @@
1From 2bf260f82454f5f3809e8bb31cf158abdc7259a3 Mon Sep 17 00:00:00 2001
2From: Stanislav Kinsbursky <skinsbursky@parallels.com>
3Date: Fri, 20 Jul 2012 15:57:48 +0400
4Subject: [PATCH 45/70] SUNRPC: return negative value in case rpcbind client
5 creation error
6
7commit caea33da898e4e14f0ba58173e3b7689981d2c0b upstream.
8
9Without this patch kernel will panic on LockD start, because lockd_up() checks
10lockd_up_net() result for negative value.
11From my pow it's better to return negative value from rpcbind routines instead
12of replacing all such checks like in lockd_up().
13
14Signed-off-by: Stanislav Kinsbursky <skinsbursky@parallels.com>
15Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 net/sunrpc/rpcb_clnt.c | 4 ++--
19 1 files changed, 2 insertions(+), 2 deletions(-)
20
21diff --git a/net/sunrpc/rpcb_clnt.c b/net/sunrpc/rpcb_clnt.c
22index 8761bf8..337c68b 100644
23--- a/net/sunrpc/rpcb_clnt.c
24+++ b/net/sunrpc/rpcb_clnt.c
25@@ -246,7 +246,7 @@ static int rpcb_create_local_unix(void)
26 if (IS_ERR(clnt)) {
27 dprintk("RPC: failed to create AF_LOCAL rpcbind "
28 "client (errno %ld).\n", PTR_ERR(clnt));
29- result = -PTR_ERR(clnt);
30+ result = PTR_ERR(clnt);
31 goto out;
32 }
33
34@@ -293,7 +293,7 @@ static int rpcb_create_local_net(void)
35 if (IS_ERR(clnt)) {
36 dprintk("RPC: failed to create local rpcbind "
37 "client (errno %ld).\n", PTR_ERR(clnt));
38- result = -PTR_ERR(clnt);
39+ result = PTR_ERR(clnt);
40 goto out;
41 }
42
43--
441.7.7.6
45
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0046-ARM-7467-1-mutex-use-generic-xchg-based-implementati.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0046-ARM-7467-1-mutex-use-generic-xchg-based-implementati.patch
new file mode 100644
index 00000000..08080242
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0046-ARM-7467-1-mutex-use-generic-xchg-based-implementati.patch
@@ -0,0 +1,165 @@
1From 28c5c473fd1dffcd9dacfc1b4ea643181398f149 Mon Sep 17 00:00:00 2001
2From: Will Deacon <will.deacon@arm.com>
3Date: Fri, 13 Jul 2012 19:15:40 +0100
4Subject: [PATCH 46/70] ARM: 7467/1: mutex: use generic xchg-based
5 implementation for ARMv6+
6
7commit a76d7bd96d65fa5119adba97e1b58d95f2e78829 upstream.
8
9The open-coded mutex implementation for ARMv6+ cores suffers from a
10severe lack of barriers, so in the uncontended case we don't actually
11protect any accesses performed during the critical section.
12
13Furthermore, the code is largely a duplication of the ARMv6+ atomic_dec
14code but optimised to remove a branch instruction, as the mutex fastpath
15was previously inlined. Now that this is executed out-of-line, we can
16reuse the atomic access code for the locking (in fact, we use the xchg
17code as this produces shorter critical sections).
18
19This patch uses the generic xchg based implementation for mutexes on
20ARMv6+, which introduces barriers to the lock/unlock operations and also
21has the benefit of removing a fair amount of inline assembly code.
22
23Acked-by: Arnd Bergmann <arnd@arndb.de>
24Acked-by: Nicolas Pitre <nico@linaro.org>
25Reported-by: Shan Kang <kangshan0910@gmail.com>
26Signed-off-by: Will Deacon <will.deacon@arm.com>
27Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
28Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
29---
30 arch/arm/include/asm/mutex.h | 119 ++----------------------------------------
31 1 files changed, 4 insertions(+), 115 deletions(-)
32
33diff --git a/arch/arm/include/asm/mutex.h b/arch/arm/include/asm/mutex.h
34index 93226cf..b1479fd 100644
35--- a/arch/arm/include/asm/mutex.h
36+++ b/arch/arm/include/asm/mutex.h
37@@ -7,121 +7,10 @@
38 */
39 #ifndef _ASM_MUTEX_H
40 #define _ASM_MUTEX_H
41-
42-#if __LINUX_ARM_ARCH__ < 6
43-/* On pre-ARMv6 hardware the swp based implementation is the most efficient. */
44-# include <asm-generic/mutex-xchg.h>
45-#else
46-
47 /*
48- * Attempting to lock a mutex on ARMv6+ can be done with a bastardized
49- * atomic decrement (it is not a reliable atomic decrement but it satisfies
50- * the defined semantics for our purpose, while being smaller and faster
51- * than a real atomic decrement or atomic swap. The idea is to attempt
52- * decrementing the lock value only once. If once decremented it isn't zero,
53- * or if its store-back fails due to a dispute on the exclusive store, we
54- * simply bail out immediately through the slow path where the lock will be
55- * reattempted until it succeeds.
56+ * On pre-ARMv6 hardware this results in a swp-based implementation,
57+ * which is the most efficient. For ARMv6+, we emit a pair of exclusive
58+ * accesses instead.
59 */
60-static inline void
61-__mutex_fastpath_lock(atomic_t *count, void (*fail_fn)(atomic_t *))
62-{
63- int __ex_flag, __res;
64-
65- __asm__ (
66-
67- "ldrex %0, [%2] \n\t"
68- "sub %0, %0, #1 \n\t"
69- "strex %1, %0, [%2] "
70-
71- : "=&r" (__res), "=&r" (__ex_flag)
72- : "r" (&(count)->counter)
73- : "cc","memory" );
74-
75- __res |= __ex_flag;
76- if (unlikely(__res != 0))
77- fail_fn(count);
78-}
79-
80-static inline int
81-__mutex_fastpath_lock_retval(atomic_t *count, int (*fail_fn)(atomic_t *))
82-{
83- int __ex_flag, __res;
84-
85- __asm__ (
86-
87- "ldrex %0, [%2] \n\t"
88- "sub %0, %0, #1 \n\t"
89- "strex %1, %0, [%2] "
90-
91- : "=&r" (__res), "=&r" (__ex_flag)
92- : "r" (&(count)->counter)
93- : "cc","memory" );
94-
95- __res |= __ex_flag;
96- if (unlikely(__res != 0))
97- __res = fail_fn(count);
98- return __res;
99-}
100-
101-/*
102- * Same trick is used for the unlock fast path. However the original value,
103- * rather than the result, is used to test for success in order to have
104- * better generated assembly.
105- */
106-static inline void
107-__mutex_fastpath_unlock(atomic_t *count, void (*fail_fn)(atomic_t *))
108-{
109- int __ex_flag, __res, __orig;
110-
111- __asm__ (
112-
113- "ldrex %0, [%3] \n\t"
114- "add %1, %0, #1 \n\t"
115- "strex %2, %1, [%3] "
116-
117- : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
118- : "r" (&(count)->counter)
119- : "cc","memory" );
120-
121- __orig |= __ex_flag;
122- if (unlikely(__orig != 0))
123- fail_fn(count);
124-}
125-
126-/*
127- * If the unlock was done on a contended lock, or if the unlock simply fails
128- * then the mutex remains locked.
129- */
130-#define __mutex_slowpath_needs_to_unlock() 1
131-
132-/*
133- * For __mutex_fastpath_trylock we use another construct which could be
134- * described as a "single value cmpxchg".
135- *
136- * This provides the needed trylock semantics like cmpxchg would, but it is
137- * lighter and less generic than a true cmpxchg implementation.
138- */
139-static inline int
140-__mutex_fastpath_trylock(atomic_t *count, int (*fail_fn)(atomic_t *))
141-{
142- int __ex_flag, __res, __orig;
143-
144- __asm__ (
145-
146- "1: ldrex %0, [%3] \n\t"
147- "subs %1, %0, #1 \n\t"
148- "strexeq %2, %1, [%3] \n\t"
149- "movlt %0, #0 \n\t"
150- "cmpeq %2, #0 \n\t"
151- "bgt 1b "
152-
153- : "=&r" (__orig), "=&r" (__res), "=&r" (__ex_flag)
154- : "r" (&count->counter)
155- : "cc", "memory" );
156-
157- return __orig;
158-}
159-
160-#endif
161+#include <asm-generic/mutex-xchg.h>
162 #endif
163--
1641.7.7.6
165
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0047-ARM-7476-1-vfp-only-clear-vfp-state-for-current-cpu-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0047-ARM-7476-1-vfp-only-clear-vfp-state-for-current-cpu-.patch
new file mode 100644
index 00000000..d7aaf223
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0047-ARM-7476-1-vfp-only-clear-vfp-state-for-current-cpu-.patch
@@ -0,0 +1,36 @@
1From 57a8207d3a9a4df2ed7a736afa04cdff4b1eae03 Mon Sep 17 00:00:00 2001
2From: Colin Cross <ccross@android.com>
3Date: Fri, 20 Jul 2012 02:03:43 +0100
4Subject: [PATCH 47/70] ARM: 7476/1: vfp: only clear vfp state for current cpu
5 in vfp_pm_suspend
6
7commit a84b895a2348f0dbff31b71ddf954f70a6cde368 upstream.
8
9vfp_pm_suspend runs on each cpu, only clear the hardware state
10pointer for the current cpu. Prevents a possible crash if one
11cpu clears the hw state pointer when another cpu has already
12checked if it is valid.
13
14Signed-off-by: Colin Cross <ccross@android.com>
15Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 arch/arm/vfp/vfpmodule.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
22index 8ea07e4..61e11ce 100644
23--- a/arch/arm/vfp/vfpmodule.c
24+++ b/arch/arm/vfp/vfpmodule.c
25@@ -456,7 +456,7 @@ static int vfp_pm_suspend(void)
26 }
27
28 /* clear any information we had about last context state */
29- memset(vfp_current_hw_state, 0, sizeof(vfp_current_hw_state));
30+ vfp_current_hw_state[ti->cpu] = NULL;
31
32 return 0;
33 }
34--
351.7.7.6
36
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0048-ARM-7477-1-vfp-Always-save-VFP-state-in-vfp_pm_suspe.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0048-ARM-7477-1-vfp-Always-save-VFP-state-in-vfp_pm_suspe.patch
new file mode 100644
index 00000000..aa5978ef
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0048-ARM-7477-1-vfp-Always-save-VFP-state-in-vfp_pm_suspe.patch
@@ -0,0 +1,58 @@
1From 670bc10621ecb0750e22b72dc873b4ade756fd73 Mon Sep 17 00:00:00 2001
2From: Colin Cross <ccross@android.com>
3Date: Fri, 20 Jul 2012 02:03:42 +0100
4Subject: [PATCH 48/70] ARM: 7477/1: vfp: Always save VFP state in
5 vfp_pm_suspend on UP
6
7commit 24b35521b8ddf088531258f06f681bb7b227bf47 upstream.
8
9vfp_pm_suspend should save the VFP state in suspend after
10any lazy context switch. If it only saves when the VFP is enabled,
11the state can get lost when, on a UP system:
12 Thread 1 uses the VFP
13 Context switch occurs to thread 2, VFP is disabled but the
14 VFP context is not saved
15 Thread 2 initiates suspend
16 vfp_pm_suspend is called with the VFP disabled, and the unsaved
17 VFP context of Thread 1 in the registers
18
19Modify vfp_pm_suspend to save the VFP context whenever
20vfp_current_hw_state is not NULL.
21
22Includes a fix from Ido Yariv <ido@wizery.com>, who pointed out that on
23SMP systems, the state pointer can be pointing to a freed task struct if
24a task exited on another cpu, fixed by using #ifndef CONFIG_SMP in the
25new if clause.
26
27Cc: Barry Song <bs14@csr.com>
28Cc: Catalin Marinas <catalin.marinas@arm.com>
29Cc: Ido Yariv <ido@wizery.com>
30Cc: Daniel Drake <dsd@laptop.org>
31Cc: Will Deacon <will.deacon@arm.com>
32Signed-off-by: Colin Cross <ccross@android.com>
33Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
34Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
35---
36 arch/arm/vfp/vfpmodule.c | 6 ++++++
37 1 files changed, 6 insertions(+), 0 deletions(-)
38
39diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
40index 61e11ce..ad83dad 100644
41--- a/arch/arm/vfp/vfpmodule.c
42+++ b/arch/arm/vfp/vfpmodule.c
43@@ -453,6 +453,12 @@ static int vfp_pm_suspend(void)
44
45 /* disable, just in case */
46 fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
47+ } else if (vfp_current_hw_state[ti->cpu]) {
48+#ifndef CONFIG_SMP
49+ fmxr(FPEXC, fpexc | FPEXC_EN);
50+ vfp_save_state(vfp_current_hw_state[ti->cpu], fpexc);
51+ fmxr(FPEXC, fpexc);
52+#endif
53 }
54
55 /* clear any information we had about last context state */
56--
571.7.7.6
58
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0049-ARM-7478-1-errata-extend-workaround-for-erratum-7207.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0049-ARM-7478-1-errata-extend-workaround-for-erratum-7207.patch
new file mode 100644
index 00000000..0940ef07
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0049-ARM-7478-1-errata-extend-workaround-for-erratum-7207.patch
@@ -0,0 +1,62 @@
1From 98922b7089b3ef806a0c3bae3c7e10e5618e4859 Mon Sep 17 00:00:00 2001
2From: Will Deacon <will.deacon@arm.com>
3Date: Fri, 20 Jul 2012 18:24:55 +0100
4Subject: [PATCH 49/70] ARM: 7478/1: errata: extend workaround for erratum
5 #720789
6
7commit 5a783cbc48367cfc7b65afc75430953dfe60098f upstream.
8
9Commit cdf357f1 ("ARM: 6299/1: errata: TLBIASIDIS and TLBIMVAIS
10operations can broadcast a faulty ASID") replaced by-ASID TLB flushing
11operations with all-ASID variants to workaround A9 erratum #720789.
12
13This patch extends the workaround to include the tlb_range operations,
14which were overlooked by the original patch.
15
16Tested-by: Steve Capper <steve.capper@arm.com>
17Signed-off-by: Will Deacon <will.deacon@arm.com>
18Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 arch/arm/mm/tlb-v7.S | 12 ++++++++++++
22 1 files changed, 12 insertions(+), 0 deletions(-)
23
24diff --git a/arch/arm/mm/tlb-v7.S b/arch/arm/mm/tlb-v7.S
25index 845f461..c202113 100644
26--- a/arch/arm/mm/tlb-v7.S
27+++ b/arch/arm/mm/tlb-v7.S
28@@ -38,11 +38,19 @@ ENTRY(v7wbi_flush_user_tlb_range)
29 dsb
30 mov r0, r0, lsr #PAGE_SHIFT @ align address
31 mov r1, r1, lsr #PAGE_SHIFT
32+#ifdef CONFIG_ARM_ERRATA_720789
33+ mov r3, #0
34+#else
35 asid r3, r3 @ mask ASID
36+#endif
37 orr r0, r3, r0, lsl #PAGE_SHIFT @ Create initial MVA
38 mov r1, r1, lsl #PAGE_SHIFT
39 1:
40+#ifdef CONFIG_ARM_ERRATA_720789
41+ ALT_SMP(mcr p15, 0, r0, c8, c3, 3) @ TLB invalidate U MVA all ASID (shareable)
42+#else
43 ALT_SMP(mcr p15, 0, r0, c8, c3, 1) @ TLB invalidate U MVA (shareable)
44+#endif
45 ALT_UP(mcr p15, 0, r0, c8, c7, 1) @ TLB invalidate U MVA
46
47 add r0, r0, #PAGE_SZ
48@@ -67,7 +75,11 @@ ENTRY(v7wbi_flush_kern_tlb_range)
49 mov r0, r0, lsl #PAGE_SHIFT
50 mov r1, r1, lsl #PAGE_SHIFT
51 1:
52+#ifdef CONFIG_ARM_ERRATA_720789
53+ ALT_SMP(mcr p15, 0, r0, c8, c3, 3) @ TLB invalidate U MVA all ASID (shareable)
54+#else
55 ALT_SMP(mcr p15, 0, r0, c8, c3, 1) @ TLB invalidate U MVA (shareable)
56+#endif
57 ALT_UP(mcr p15, 0, r0, c8, c7, 1) @ TLB invalidate U MVA
58 add r0, r0, #PAGE_SZ
59 cmp r0, r1
60--
611.7.7.6
62
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0050-ARM-Fix-undefined-instruction-exception-handling.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0050-ARM-Fix-undefined-instruction-exception-handling.patch
new file mode 100644
index 00000000..0b984095
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0050-ARM-Fix-undefined-instruction-exception-handling.patch
@@ -0,0 +1,335 @@
1From 6b090d4fbcfaaa71f311f47019e622a794b0fca4 Mon Sep 17 00:00:00 2001
2From: Russell King <rmk+kernel@arm.linux.org.uk>
3Date: Mon, 30 Jul 2012 19:42:10 +0100
4Subject: [PATCH 50/70] ARM: Fix undefined instruction exception handling
5
6commit 15ac49b65024f55c4371a53214879a9c77c4fbf9 upstream.
7
8While trying to get a v3.5 kernel booted on the cubox, I noticed that
9VFP does not work correctly with VFP bounce handling. This is because
10of the confusion over 16-bit vs 32-bit instructions, and where PC is
11supposed to point to.
12
13The rule is that FP handlers are entered with regs->ARM_pc pointing at
14the _next_ instruction to be executed. However, if the exception is
15not handled, regs->ARM_pc points at the faulting instruction.
16
17This is easy for ARM mode, because we know that the next instruction and
18previous instructions are separated by four bytes. This is not true of
19Thumb2 though.
20
21Since all FP instructions are 32-bit in Thumb2, it makes things easy.
22We just need to select the appropriate adjustment. Do this by moving
23the adjustment out of do_undefinstr() into the assembly code, as only
24the assembly code knows whether it's dealing with a 32-bit or 16-bit
25instruction.
26
27Acked-by: Will Deacon <will.deacon@arm.com>
28Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
29Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
30---
31 arch/arm/kernel/entry-armv.S | 111 +++++++++++++++++++++++++++---------------
32 arch/arm/kernel/traps.c | 8 ---
33 arch/arm/vfp/entry.S | 16 +++---
34 arch/arm/vfp/vfphw.S | 19 ++++---
35 4 files changed, 92 insertions(+), 62 deletions(-)
36
37diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
38index 3a456c6..bc084a1 100644
39--- a/arch/arm/kernel/entry-armv.S
40+++ b/arch/arm/kernel/entry-armv.S
41@@ -241,6 +241,19 @@ svc_preempt:
42 b 1b
43 #endif
44
45+__und_fault:
46+ @ Correct the PC such that it is pointing at the instruction
47+ @ which caused the fault. If the faulting instruction was ARM
48+ @ the PC will be pointing at the next instruction, and have to
49+ @ subtract 4. Otherwise, it is Thumb, and the PC will be
50+ @ pointing at the second half of the Thumb instruction. We
51+ @ have to subtract 2.
52+ ldr r2, [r0, #S_PC]
53+ sub r2, r2, r1
54+ str r2, [r0, #S_PC]
55+ b do_undefinstr
56+ENDPROC(__und_fault)
57+
58 .align 5
59 __und_svc:
60 #ifdef CONFIG_KPROBES
61@@ -258,25 +271,32 @@ __und_svc:
62 @
63 @ r0 - instruction
64 @
65-#ifndef CONFIG_THUMB2_KERNEL
66+#ifndef CONFIG_THUMB2_KERNEL
67 ldr r0, [r4, #-4]
68 #else
69+ mov r1, #2
70 ldrh r0, [r4, #-2] @ Thumb instruction at LR - 2
71 cmp r0, #0xe800 @ 32-bit instruction if xx >= 0
72- ldrhhs r9, [r4] @ bottom 16 bits
73- orrhs r0, r9, r0, lsl #16
74+ blo __und_svc_fault
75+ ldrh r9, [r4] @ bottom 16 bits
76+ add r4, r4, #2
77+ str r4, [sp, #S_PC]
78+ orr r0, r9, r0, lsl #16
79 #endif
80- adr r9, BSYM(1f)
81+ adr r9, BSYM(__und_svc_finish)
82 mov r2, r4
83 bl call_fpe
84
85+ mov r1, #4 @ PC correction to apply
86+__und_svc_fault:
87 mov r0, sp @ struct pt_regs *regs
88- bl do_undefinstr
89+ bl __und_fault
90
91 @
92 @ IRQs off again before pulling preserved data off the stack
93 @
94-1: disable_irq_notrace
95+__und_svc_finish:
96+ disable_irq_notrace
97
98 @
99 @ restore SPSR and restart the instruction
100@@ -420,25 +440,33 @@ __und_usr:
101 mov r2, r4
102 mov r3, r5
103
104+ @ r2 = regs->ARM_pc, which is either 2 or 4 bytes ahead of the
105+ @ faulting instruction depending on Thumb mode.
106+ @ r3 = regs->ARM_cpsr
107 @
108- @ fall through to the emulation code, which returns using r9 if
109- @ it has emulated the instruction, or the more conventional lr
110- @ if we are to treat this as a real undefined instruction
111- @
112- @ r0 - instruction
113+ @ The emulation code returns using r9 if it has emulated the
114+ @ instruction, or the more conventional lr if we are to treat
115+ @ this as a real undefined instruction
116 @
117 adr r9, BSYM(ret_from_exception)
118- adr lr, BSYM(__und_usr_unknown)
119+
120 tst r3, #PSR_T_BIT @ Thumb mode?
121- itet eq @ explicit IT needed for the 1f label
122- subeq r4, r2, #4 @ ARM instr at LR - 4
123- subne r4, r2, #2 @ Thumb instr at LR - 2
124-1: ldreqt r0, [r4]
125+ bne __und_usr_thumb
126+ sub r4, r2, #4 @ ARM instr at LR - 4
127+1: ldrt r0, [r4]
128 #ifdef CONFIG_CPU_ENDIAN_BE8
129- reveq r0, r0 @ little endian instruction
130+ rev r0, r0 @ little endian instruction
131 #endif
132- beq call_fpe
133+ @ r0 = 32-bit ARM instruction which caused the exception
134+ @ r2 = PC value for the following instruction (:= regs->ARM_pc)
135+ @ r4 = PC value for the faulting instruction
136+ @ lr = 32-bit undefined instruction function
137+ adr lr, BSYM(__und_usr_fault_32)
138+ b call_fpe
139+
140+__und_usr_thumb:
141 @ Thumb instruction
142+ sub r4, r2, #2 @ First half of thumb instr at LR - 2
143 #if CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7
144 /*
145 * Thumb-2 instruction handling. Note that because pre-v6 and >= v6 platforms
146@@ -452,7 +480,7 @@ __und_usr:
147 ldr r5, .LCcpu_architecture
148 ldr r5, [r5]
149 cmp r5, #CPU_ARCH_ARMv7
150- blo __und_usr_unknown
151+ blo __und_usr_fault_16 @ 16bit undefined instruction
152 /*
153 * The following code won't get run unless the running CPU really is v7, so
154 * coding round the lack of ldrht on older arches is pointless. Temporarily
155@@ -460,15 +488,18 @@ __und_usr:
156 */
157 .arch armv6t2
158 #endif
159-2:
160- ARM( ldrht r5, [r4], #2 )
161- THUMB( ldrht r5, [r4] )
162- THUMB( add r4, r4, #2 )
163+2: ldrht r5, [r4]
164 cmp r5, #0xe800 @ 32bit instruction if xx != 0
165- blo __und_usr_unknown
166-3: ldrht r0, [r4]
167+ blo __und_usr_fault_16 @ 16bit undefined instruction
168+3: ldrht r0, [r2]
169 add r2, r2, #2 @ r2 is PC + 2, make it PC + 4
170+ str r2, [sp, #S_PC] @ it's a 2x16bit instr, update
171 orr r0, r0, r5, lsl #16
172+ adr lr, BSYM(__und_usr_fault_32)
173+ @ r0 = the two 16-bit Thumb instructions which caused the exception
174+ @ r2 = PC value for the following Thumb instruction (:= regs->ARM_pc)
175+ @ r4 = PC value for the first 16-bit Thumb instruction
176+ @ lr = 32bit undefined instruction function
177
178 #if __LINUX_ARM_ARCH__ < 7
179 /* If the target arch was overridden, change it back: */
180@@ -479,17 +510,13 @@ __und_usr:
181 #endif
182 #endif /* __LINUX_ARM_ARCH__ < 7 */
183 #else /* !(CONFIG_ARM_THUMB && __LINUX_ARM_ARCH__ >= 6 && CONFIG_CPU_V7) */
184- b __und_usr_unknown
185+ b __und_usr_fault_16
186 #endif
187- UNWIND(.fnend )
188+ UNWIND(.fnend)
189 ENDPROC(__und_usr)
190
191- @
192- @ fallthrough to call_fpe
193- @
194-
195 /*
196- * The out of line fixup for the ldrt above.
197+ * The out of line fixup for the ldrt instructions above.
198 */
199 .pushsection .fixup, "ax"
200 4: mov pc, r9
201@@ -520,11 +547,12 @@ ENDPROC(__und_usr)
202 * NEON handler code.
203 *
204 * Emulators may wish to make use of the following registers:
205- * r0 = instruction opcode.
206- * r2 = PC+4
207+ * r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
208+ * r2 = PC value to resume execution after successful emulation
209 * r9 = normal "successful" return address
210- * r10 = this threads thread_info structure.
211+ * r10 = this threads thread_info structure
212 * lr = unrecognised instruction return address
213+ * IRQs disabled, FIQs enabled.
214 */
215 @
216 @ Fall-through from Thumb-2 __und_usr
217@@ -659,12 +687,17 @@ ENTRY(no_fp)
218 mov pc, lr
219 ENDPROC(no_fp)
220
221-__und_usr_unknown:
222- enable_irq
223+__und_usr_fault_32:
224+ mov r1, #4
225+ b 1f
226+__und_usr_fault_16:
227+ mov r1, #2
228+1: enable_irq
229 mov r0, sp
230 adr lr, BSYM(ret_from_exception)
231- b do_undefinstr
232-ENDPROC(__und_usr_unknown)
233+ b __und_fault
234+ENDPROC(__und_usr_fault_32)
235+ENDPROC(__und_usr_fault_16)
236
237 .align 5
238 __pabt_usr:
239diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
240index 160cb16..8380bd1 100644
241--- a/arch/arm/kernel/traps.c
242+++ b/arch/arm/kernel/traps.c
243@@ -362,18 +362,10 @@ static int call_undef_hook(struct pt_regs *regs, unsigned int instr)
244
245 asmlinkage void __exception do_undefinstr(struct pt_regs *regs)
246 {
247- unsigned int correction = thumb_mode(regs) ? 2 : 4;
248 unsigned int instr;
249 siginfo_t info;
250 void __user *pc;
251
252- /*
253- * According to the ARM ARM, PC is 2 or 4 bytes ahead,
254- * depending whether we're in Thumb mode or not.
255- * Correct this offset.
256- */
257- regs->ARM_pc -= correction;
258-
259 pc = (void __user *)instruction_pointer(regs);
260
261 if (processor_mode(regs) == SVC_MODE) {
262diff --git a/arch/arm/vfp/entry.S b/arch/arm/vfp/entry.S
263index 4fa9903..cc926c9 100644
264--- a/arch/arm/vfp/entry.S
265+++ b/arch/arm/vfp/entry.S
266@@ -7,18 +7,20 @@
267 * This program is free software; you can redistribute it and/or modify
268 * it under the terms of the GNU General Public License version 2 as
269 * published by the Free Software Foundation.
270- *
271- * Basic entry code, called from the kernel's undefined instruction trap.
272- * r0 = faulted instruction
273- * r5 = faulted PC+4
274- * r9 = successful return
275- * r10 = thread_info structure
276- * lr = failure return
277 */
278 #include <asm/thread_info.h>
279 #include <asm/vfpmacros.h>
280 #include "../kernel/entry-header.S"
281
282+@ VFP entry point.
283+@
284+@ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
285+@ r2 = PC value to resume execution after successful emulation
286+@ r9 = normal "successful" return address
287+@ r10 = this threads thread_info structure
288+@ lr = unrecognised instruction return address
289+@ IRQs disabled.
290+@
291 ENTRY(do_vfp)
292 #ifdef CONFIG_PREEMPT
293 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
294diff --git a/arch/arm/vfp/vfphw.S b/arch/arm/vfp/vfphw.S
295index 2d30c7f..3a0efaa 100644
296--- a/arch/arm/vfp/vfphw.S
297+++ b/arch/arm/vfp/vfphw.S
298@@ -61,13 +61,13 @@
299
300 @ VFP hardware support entry point.
301 @
302-@ r0 = faulted instruction
303-@ r2 = faulted PC+4
304-@ r9 = successful return
305+@ r0 = instruction opcode (32-bit ARM or two 16-bit Thumb)
306+@ r2 = PC value to resume execution after successful emulation
307+@ r9 = normal "successful" return address
308 @ r10 = vfp_state union
309 @ r11 = CPU number
310-@ lr = failure return
311-
312+@ lr = unrecognised instruction return address
313+@ IRQs enabled.
314 ENTRY(vfp_support_entry)
315 DBGSTR3 "instr %08x pc %08x state %p", r0, r2, r10
316
317@@ -161,9 +161,12 @@ vfp_hw_state_valid:
318 @ exception before retrying branch
319 @ out before setting an FPEXC that
320 @ stops us reading stuff
321- VFPFMXR FPEXC, r1 @ restore FPEXC last
322- sub r2, r2, #4
323- str r2, [sp, #S_PC] @ retry the instruction
324+ VFPFMXR FPEXC, r1 @ Restore FPEXC last
325+ sub r2, r2, #4 @ Retry current instruction - if Thumb
326+ str r2, [sp, #S_PC] @ mode it's two 16-bit instructions,
327+ @ else it's one 32-bit instruction, so
328+ @ always subtract 4 from the following
329+ @ instruction address.
330 #ifdef CONFIG_PREEMPT
331 get_thread_info r10
332 ldr r4, [r10, #TI_PREEMPT] @ get preempt count
333--
3341.7.7.6
335
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0051-USB-echi-dbgp-increase-the-controller-wait-time-to-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0051-USB-echi-dbgp-increase-the-controller-wait-time-to-c.patch
new file mode 100644
index 00000000..39c9f4c9
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0051-USB-echi-dbgp-increase-the-controller-wait-time-to-c.patch
@@ -0,0 +1,38 @@
1From d8b93bb6a3ec7a8092ad0ea2a3fa78746aba6471 Mon Sep 17 00:00:00 2001
2From: Colin Ian King <colin.king@canonical.com>
3Date: Mon, 30 Jul 2012 16:06:42 +0100
4Subject: [PATCH 51/70] USB: echi-dbgp: increase the controller wait time to
5 come out of halt.
6
7commit f96a4216e85050c0a9d41a41ecb0ae9d8e39b509 upstream.
8
9The default 10 microsecond delay for the controller to come out of
10halt in dbgp_ehci_startup is too short, so increase it to 1 millisecond.
11
12This is based on emperical testing on various USB debug ports on
13modern machines such as a Lenovo X220i and an Ivybridge development
14platform that needed to wait ~450-950 microseconds.
15
16Signed-off-by: Colin Ian King <colin.king@canonical.com>
17Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 drivers/usb/early/ehci-dbgp.c | 2 +-
21 1 files changed, 1 insertions(+), 1 deletions(-)
22
23diff --git a/drivers/usb/early/ehci-dbgp.c b/drivers/usb/early/ehci-dbgp.c
24index 1fc8f12..347bb05 100644
25--- a/drivers/usb/early/ehci-dbgp.c
26+++ b/drivers/usb/early/ehci-dbgp.c
27@@ -450,7 +450,7 @@ static int dbgp_ehci_startup(void)
28 writel(FLAG_CF, &ehci_regs->configured_flag);
29
30 /* Wait until the controller is no longer halted */
31- loop = 10;
32+ loop = 1000;
33 do {
34 status = readl(&ehci_regs->status);
35 if (!(status & STS_HALT))
36--
371.7.7.6
38
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0052-ASoC-wm8962-Allow-VMID-time-to-fully-ramp.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0052-ASoC-wm8962-Allow-VMID-time-to-fully-ramp.patch
new file mode 100644
index 00000000..b9c1a038
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0052-ASoC-wm8962-Allow-VMID-time-to-fully-ramp.patch
@@ -0,0 +1,32 @@
1From 83c2f7e55e6b8ecd96bf3222c8176824c643d562 Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Mon, 30 Jul 2012 18:24:19 +0100
4Subject: [PATCH 52/70] ASoC: wm8962: Allow VMID time to fully ramp
5
6commit 9d40e5582c9c4cfb6977ba2a0ca9c2ed82c56f21 upstream.
7
8Required for reliable power up from cold.
9
10Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
11Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
12---
13 sound/soc/codecs/wm8962.c | 3 +++
14 1 files changed, 3 insertions(+), 0 deletions(-)
15
16diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
17index 07dd7eb..e97df24 100644
18--- a/sound/soc/codecs/wm8962.c
19+++ b/sound/soc/codecs/wm8962.c
20@@ -3105,6 +3105,9 @@ static int wm8962_set_bias_level(struct snd_soc_codec *codec,
21 /* VMID 2*250k */
22 snd_soc_update_bits(codec, WM8962_PWR_MGMT_1,
23 WM8962_VMID_SEL_MASK, 0x100);
24+
25+ if (codec->dapm.bias_level == SND_SOC_BIAS_OFF)
26+ msleep(100);
27 break;
28
29 case SND_SOC_BIAS_OFF:
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0053-mm-page_alloc.c-remove-pageblock_default_order.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0053-mm-page_alloc.c-remove-pageblock_default_order.patch
new file mode 100644
index 00000000..0143cbd2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0053-mm-page_alloc.c-remove-pageblock_default_order.patch
@@ -0,0 +1,98 @@
1From 9159bdebda7f6210dfe791c22f4a1f6c04826b0d Mon Sep 17 00:00:00 2001
2From: Andrew Morton <akpm@linux-foundation.org>
3Date: Tue, 29 May 2012 15:06:31 -0700
4Subject: [PATCH 53/70] mm/page_alloc.c: remove pageblock_default_order()
5
6commit 955c1cd7401565671b064e499115344ec8067dfd upstream.
7
8This has always been broken: one version takes an unsigned int and the
9other version takes no arguments. This bug was hidden because one
10version of set_pageblock_order() was a macro which doesn't evaluate its
11argument.
12
13Simplify it all and remove pageblock_default_order() altogether.
14
15Reported-by: rajman mekaco <rajman.mekaco@gmail.com>
16Cc: Mel Gorman <mel@csn.ul.ie>
17Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
18Cc: Tejun Heo <tj@kernel.org>
19Cc: Minchan Kim <minchan.kim@gmail.com>
20Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
21Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23---
24 mm/page_alloc.c | 33 +++++++++++++++------------------
25 1 files changed, 15 insertions(+), 18 deletions(-)
26
27diff --git a/mm/page_alloc.c b/mm/page_alloc.c
28index 065dbe8..63a4e1d 100644
29--- a/mm/page_alloc.c
30+++ b/mm/page_alloc.c
31@@ -4281,25 +4281,24 @@ static inline void setup_usemap(struct pglist_data *pgdat,
32
33 #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
34
35-/* Return a sensible default order for the pageblock size. */
36-static inline int pageblock_default_order(void)
37-{
38- if (HPAGE_SHIFT > PAGE_SHIFT)
39- return HUGETLB_PAGE_ORDER;
40-
41- return MAX_ORDER-1;
42-}
43-
44 /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */
45-static inline void __init set_pageblock_order(unsigned int order)
46+static inline void __init set_pageblock_order(void)
47 {
48+ unsigned int order;
49+
50 /* Check that pageblock_nr_pages has not already been setup */
51 if (pageblock_order)
52 return;
53
54+ if (HPAGE_SHIFT > PAGE_SHIFT)
55+ order = HUGETLB_PAGE_ORDER;
56+ else
57+ order = MAX_ORDER - 1;
58+
59 /*
60 * Assume the largest contiguous order of interest is a huge page.
61- * This value may be variable depending on boot parameters on IA64
62+ * This value may be variable depending on boot parameters on IA64 and
63+ * powerpc.
64 */
65 pageblock_order = order;
66 }
67@@ -4307,15 +4306,13 @@ static inline void __init set_pageblock_order(unsigned int order)
68
69 /*
70 * When CONFIG_HUGETLB_PAGE_SIZE_VARIABLE is not set, set_pageblock_order()
71- * and pageblock_default_order() are unused as pageblock_order is set
72- * at compile-time. See include/linux/pageblock-flags.h for the values of
73- * pageblock_order based on the kernel config
74+ * is unused as pageblock_order is set at compile-time. See
75+ * include/linux/pageblock-flags.h for the values of pageblock_order based on
76+ * the kernel config
77 */
78-static inline int pageblock_default_order(unsigned int order)
79+static inline void set_pageblock_order(void)
80 {
81- return MAX_ORDER-1;
82 }
83-#define set_pageblock_order(x) do {} while (0)
84
85 #endif /* CONFIG_HUGETLB_PAGE_SIZE_VARIABLE */
86
87@@ -4403,7 +4400,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
88 if (!size)
89 continue;
90
91- set_pageblock_order(pageblock_default_order());
92+ set_pageblock_order();
93 setup_usemap(pgdat, zone, size);
94 ret = init_currently_empty_zone(zone, zone_start_pfn,
95 size, MEMMAP_EARLY);
96--
971.7.7.6
98
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0054-mm-setup-pageblock_order-before-it-s-used-by-sparsem.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0054-mm-setup-pageblock_order-before-it-s-used-by-sparsem.patch
new file mode 100644
index 00000000..540cd1cf
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0054-mm-setup-pageblock_order-before-it-s-used-by-sparsem.patch
@@ -0,0 +1,101 @@
1From 4cf34c29c3362f55fe4ca807f2b01984c36fe1b2 Mon Sep 17 00:00:00 2001
2From: Xishi Qiu <qiuxishi@huawei.com>
3Date: Tue, 31 Jul 2012 16:43:19 -0700
4Subject: [PATCH 54/70] mm: setup pageblock_order before it's used by
5 sparsemem
6
7commit ca57df79d4f64e1a4886606af4289d40636189c5 upstream.
8
9On architectures with CONFIG_HUGETLB_PAGE_SIZE_VARIABLE set, such as
10Itanium, pageblock_order is a variable with default value of 0. It's set
11to the right value by set_pageblock_order() in function
12free_area_init_core().
13
14But pageblock_order may be used by sparse_init() before free_area_init_core()
15is called along path:
16sparse_init()
17 ->sparse_early_usemaps_alloc_node()
18 ->usemap_size()
19 ->SECTION_BLOCKFLAGS_BITS
20 ->((1UL << (PFN_SECTION_SHIFT - pageblock_order)) *
21NR_PAGEBLOCK_BITS)
22
23The uninitialized pageblock_size will cause memory wasting because
24usemap_size() returns a much bigger value then it's really needed.
25
26For example, on an Itanium platform,
27sparse_init() pageblock_order=0 usemap_size=24576
28free_area_init_core() before pageblock_order=0, usemap_size=24576
29free_area_init_core() after pageblock_order=12, usemap_size=8
30
31That means 24K memory has been wasted for each section, so fix it by calling
32set_pageblock_order() from sparse_init().
33
34Signed-off-by: Xishi Qiu <qiuxishi@huawei.com>
35Signed-off-by: Jiang Liu <liuj97@gmail.com>
36Cc: Tony Luck <tony.luck@intel.com>
37Cc: Yinghai Lu <yinghai@kernel.org>
38Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
39Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
40Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
41Cc: David Rientjes <rientjes@google.com>
42Cc: Keping Chen <chenkeping@huawei.com>
43Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
44Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
45[bwh: Backported to 3.2: adjust context]
46Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
47---
48 mm/internal.h | 2 ++
49 mm/page_alloc.c | 4 ++--
50 mm/sparse.c | 3 +++
51 3 files changed, 7 insertions(+), 2 deletions(-)
52
53diff --git a/mm/internal.h b/mm/internal.h
54index 2189af4..0c26b5e 100644
55--- a/mm/internal.h
56+++ b/mm/internal.h
57@@ -309,3 +309,5 @@ extern u64 hwpoison_filter_flags_mask;
58 extern u64 hwpoison_filter_flags_value;
59 extern u64 hwpoison_filter_memcg;
60 extern u32 hwpoison_filter_enable;
61+
62+extern void set_pageblock_order(void);
63diff --git a/mm/page_alloc.c b/mm/page_alloc.c
64index 63a4e1d..6e51bf0 100644
65--- a/mm/page_alloc.c
66+++ b/mm/page_alloc.c
67@@ -4282,7 +4282,7 @@ static inline void setup_usemap(struct pglist_data *pgdat,
68 #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE
69
70 /* Initialise the number of pages represented by NR_PAGEBLOCK_BITS */
71-static inline void __init set_pageblock_order(void)
72+void __init set_pageblock_order(void)
73 {
74 unsigned int order;
75
76@@ -4310,7 +4310,7 @@ static inline void __init set_pageblock_order(void)
77 * include/linux/pageblock-flags.h for the values of pageblock_order based on
78 * the kernel config
79 */
80-static inline void set_pageblock_order(void)
81+void __init set_pageblock_order(void)
82 {
83 }
84
85diff --git a/mm/sparse.c b/mm/sparse.c
86index a8bc7d3..bf7d3cc 100644
87--- a/mm/sparse.c
88+++ b/mm/sparse.c
89@@ -486,6 +486,9 @@ void __init sparse_init(void)
90 struct page **map_map;
91 #endif
92
93+ /* Setup pageblock_order for HUGETLB_PAGE_SIZE_VARIABLE */
94+ set_pageblock_order();
95+
96 /*
97 * map is using big page (aka 2M in x86 64 bit)
98 * usemap is less one page (aka 24 bytes)
99--
1001.7.7.6
101
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0055-mm-mmu_notifier-fix-freed-page-still-mapped-in-secon.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0055-mm-mmu_notifier-fix-freed-page-still-mapped-in-secon.patch
new file mode 100644
index 00000000..78c9f978
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0055-mm-mmu_notifier-fix-freed-page-still-mapped-in-secon.patch
@@ -0,0 +1,137 @@
1From 4bc62f55f275bd09fa00023c52414a4c08784919 Mon Sep 17 00:00:00 2001
2From: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
3Date: Tue, 31 Jul 2012 16:45:52 -0700
4Subject: [PATCH 55/70] mm: mmu_notifier: fix freed page still mapped in
5 secondary MMU
6
7commit 3ad3d901bbcfb15a5e4690e55350db0899095a68 upstream.
8
9mmu_notifier_release() is called when the process is exiting. It will
10delete all the mmu notifiers. But at this time the page belonging to the
11process is still present in page tables and is present on the LRU list, so
12this race will happen:
13
14 CPU 0 CPU 1
15mmu_notifier_release: try_to_unmap:
16 hlist_del_init_rcu(&mn->hlist);
17 ptep_clear_flush_notify:
18 mmu nofifler not found
19 free page !!!!!!
20 /*
21 * At the point, the page has been
22 * freed, but it is still mapped in
23 * the secondary MMU.
24 */
25
26 mn->ops->release(mn, mm);
27
28Then the box is not stable and sometimes we can get this bug:
29
30[ 738.075923] BUG: Bad page state in process migrate-perf pfn:03bec
31[ 738.075931] page:ffffea00000efb00 count:0 mapcount:0 mapping: (null) index:0x8076
32[ 738.075936] page flags: 0x20000000000014(referenced|dirty)
33
34The same issue is present in mmu_notifier_unregister().
35
36We can call ->release before deleting the notifier to ensure the page has
37been unmapped from the secondary MMU before it is freed.
38
39Signed-off-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com>
40Cc: Avi Kivity <avi@redhat.com>
41Cc: Marcelo Tosatti <mtosatti@redhat.com>
42Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
43Cc: Andrea Arcangeli <aarcange@redhat.com>
44Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
45Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
46Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
47---
48 mm/mmu_notifier.c | 45 +++++++++++++++++++++++----------------------
49 1 files changed, 23 insertions(+), 22 deletions(-)
50
51diff --git a/mm/mmu_notifier.c b/mm/mmu_notifier.c
52index 9a611d3..862b608 100644
53--- a/mm/mmu_notifier.c
54+++ b/mm/mmu_notifier.c
55@@ -33,6 +33,24 @@
56 void __mmu_notifier_release(struct mm_struct *mm)
57 {
58 struct mmu_notifier *mn;
59+ struct hlist_node *n;
60+
61+ /*
62+ * RCU here will block mmu_notifier_unregister until
63+ * ->release returns.
64+ */
65+ rcu_read_lock();
66+ hlist_for_each_entry_rcu(mn, n, &mm->mmu_notifier_mm->list, hlist)
67+ /*
68+ * if ->release runs before mmu_notifier_unregister it
69+ * must be handled as it's the only way for the driver
70+ * to flush all existing sptes and stop the driver
71+ * from establishing any more sptes before all the
72+ * pages in the mm are freed.
73+ */
74+ if (mn->ops->release)
75+ mn->ops->release(mn, mm);
76+ rcu_read_unlock();
77
78 spin_lock(&mm->mmu_notifier_mm->lock);
79 while (unlikely(!hlist_empty(&mm->mmu_notifier_mm->list))) {
80@@ -46,23 +64,6 @@ void __mmu_notifier_release(struct mm_struct *mm)
81 * mmu_notifier_unregister to return.
82 */
83 hlist_del_init_rcu(&mn->hlist);
84- /*
85- * RCU here will block mmu_notifier_unregister until
86- * ->release returns.
87- */
88- rcu_read_lock();
89- spin_unlock(&mm->mmu_notifier_mm->lock);
90- /*
91- * if ->release runs before mmu_notifier_unregister it
92- * must be handled as it's the only way for the driver
93- * to flush all existing sptes and stop the driver
94- * from establishing any more sptes before all the
95- * pages in the mm are freed.
96- */
97- if (mn->ops->release)
98- mn->ops->release(mn, mm);
99- rcu_read_unlock();
100- spin_lock(&mm->mmu_notifier_mm->lock);
101 }
102 spin_unlock(&mm->mmu_notifier_mm->lock);
103
104@@ -284,16 +285,13 @@ void mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm)
105 {
106 BUG_ON(atomic_read(&mm->mm_count) <= 0);
107
108- spin_lock(&mm->mmu_notifier_mm->lock);
109 if (!hlist_unhashed(&mn->hlist)) {
110- hlist_del_rcu(&mn->hlist);
111-
112 /*
113 * RCU here will force exit_mmap to wait ->release to finish
114 * before freeing the pages.
115 */
116 rcu_read_lock();
117- spin_unlock(&mm->mmu_notifier_mm->lock);
118+
119 /*
120 * exit_mmap will block in mmu_notifier_release to
121 * guarantee ->release is called before freeing the
122@@ -302,8 +300,11 @@ void mmu_notifier_unregister(struct mmu_notifier *mn, struct mm_struct *mm)
123 if (mn->ops->release)
124 mn->ops->release(mn, mm);
125 rcu_read_unlock();
126- } else
127+
128+ spin_lock(&mm->mmu_notifier_mm->lock);
129+ hlist_del_rcu(&mn->hlist);
130 spin_unlock(&mm->mmu_notifier_mm->lock);
131+ }
132
133 /*
134 * Wait any running method to finish, of course including
135--
1361.7.7.6
137
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0056-mm-hugetlbfs-close-race-during-teardown-of-hugetlbfs.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0056-mm-hugetlbfs-close-race-during-teardown-of-hugetlbfs.patch
new file mode 100644
index 00000000..653bd0c6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0056-mm-hugetlbfs-close-race-during-teardown-of-hugetlbfs.patch
@@ -0,0 +1,340 @@
1From 677941da036e27de0418fa601b49f8c8c6ccf594 Mon Sep 17 00:00:00 2001
2From: Mel Gorman <mgorman@suse.de>
3Date: Tue, 31 Jul 2012 16:46:20 -0700
4Subject: [PATCH 56/70] mm: hugetlbfs: close race during teardown of hugetlbfs
5 shared page tables
6
7commit d833352a4338dc31295ed832a30c9ccff5c7a183 upstream.
8
9If a process creates a large hugetlbfs mapping that is eligible for page
10table sharing and forks heavily with children some of whom fault and
11others which destroy the mapping then it is possible for page tables to
12get corrupted. Some teardowns of the mapping encounter a "bad pmd" and
13output a message to the kernel log. The final teardown will trigger a
14BUG_ON in mm/filemap.c.
15
16This was reproduced in 3.4 but is known to have existed for a long time
17and goes back at least as far as 2.6.37. It was probably was introduced
18in 2.6.20 by [39dde65c: shared page table for hugetlb page]. The messages
19look like this;
20
21[ ..........] Lots of bad pmd messages followed by this
22[ 127.164256] mm/memory.c:391: bad pmd ffff880412e04fe8(80000003de4000e7).
23[ 127.164257] mm/memory.c:391: bad pmd ffff880412e04ff0(80000003de6000e7).
24[ 127.164258] mm/memory.c:391: bad pmd ffff880412e04ff8(80000003de0000e7).
25[ 127.186778] ------------[ cut here ]------------
26[ 127.186781] kernel BUG at mm/filemap.c:134!
27[ 127.186782] invalid opcode: 0000 [#1] SMP
28[ 127.186783] CPU 7
29[ 127.186784] Modules linked in: af_packet cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq mperf ext3 jbd dm_mod coretemp crc32c_intel usb_storage ghash_clmulni_intel aesni_intel i2c_i801 r8169 mii uas sr_mod cdrom sg iTCO_wdt iTCO_vendor_support shpchp serio_raw cryptd aes_x86_64 e1000e pci_hotplug dcdbas aes_generic container microcode ext4 mbcache jbd2 crc16 sd_mod crc_t10dif i915 drm_kms_helper drm i2c_algo_bit ehci_hcd ahci libahci usbcore rtc_cmos usb_common button i2c_core intel_agp video intel_gtt fan processor thermal thermal_sys hwmon ata_generic pata_atiixp libata scsi_mod
30[ 127.186801]
31[ 127.186802] Pid: 9017, comm: hugetlbfs-test Not tainted 3.4.0-autobuild #53 Dell Inc. OptiPlex 990/06D7TR
32[ 127.186804] RIP: 0010:[<ffffffff810ed6ce>] [<ffffffff810ed6ce>] __delete_from_page_cache+0x15e/0x160
33[ 127.186809] RSP: 0000:ffff8804144b5c08 EFLAGS: 00010002
34[ 127.186810] RAX: 0000000000000001 RBX: ffffea000a5c9000 RCX: 00000000ffffffc0
35[ 127.186811] RDX: 0000000000000000 RSI: 0000000000000009 RDI: ffff88042dfdad00
36[ 127.186812] RBP: ffff8804144b5c18 R08: 0000000000000009 R09: 0000000000000003
37[ 127.186813] R10: 0000000000000000 R11: 000000000000002d R12: ffff880412ff83d8
38[ 127.186814] R13: ffff880412ff83d8 R14: 0000000000000000 R15: ffff880412ff83d8
39[ 127.186815] FS: 00007fe18ed2c700(0000) GS:ffff88042dce0000(0000) knlGS:0000000000000000
40[ 127.186816] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
41[ 127.186817] CR2: 00007fe340000503 CR3: 0000000417a14000 CR4: 00000000000407e0
42[ 127.186818] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
43[ 127.186819] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
44[ 127.186820] Process hugetlbfs-test (pid: 9017, threadinfo ffff8804144b4000, task ffff880417f803c0)
45[ 127.186821] Stack:
46[ 127.186822] ffffea000a5c9000 0000000000000000 ffff8804144b5c48 ffffffff810ed83b
47[ 127.186824] ffff8804144b5c48 000000000000138a 0000000000001387 ffff8804144b5c98
48[ 127.186825] ffff8804144b5d48 ffffffff811bc925 ffff8804144b5cb8 0000000000000000
49[ 127.186827] Call Trace:
50[ 127.186829] [<ffffffff810ed83b>] delete_from_page_cache+0x3b/0x80
51[ 127.186832] [<ffffffff811bc925>] truncate_hugepages+0x115/0x220
52[ 127.186834] [<ffffffff811bca43>] hugetlbfs_evict_inode+0x13/0x30
53[ 127.186837] [<ffffffff811655c7>] evict+0xa7/0x1b0
54[ 127.186839] [<ffffffff811657a3>] iput_final+0xd3/0x1f0
55[ 127.186840] [<ffffffff811658f9>] iput+0x39/0x50
56[ 127.186842] [<ffffffff81162708>] d_kill+0xf8/0x130
57[ 127.186843] [<ffffffff81162812>] dput+0xd2/0x1a0
58[ 127.186845] [<ffffffff8114e2d0>] __fput+0x170/0x230
59[ 127.186848] [<ffffffff81236e0e>] ? rb_erase+0xce/0x150
60[ 127.186849] [<ffffffff8114e3ad>] fput+0x1d/0x30
61[ 127.186851] [<ffffffff81117db7>] remove_vma+0x37/0x80
62[ 127.186853] [<ffffffff81119182>] do_munmap+0x2d2/0x360
63[ 127.186855] [<ffffffff811cc639>] sys_shmdt+0xc9/0x170
64[ 127.186857] [<ffffffff81410a39>] system_call_fastpath+0x16/0x1b
65[ 127.186858] Code: 0f 1f 44 00 00 48 8b 43 08 48 8b 00 48 8b 40 28 8b b0 40 03 00 00 85 f6 0f 88 df fe ff ff 48 89 df e8 e7 cb 05 00 e9 d2 fe ff ff <0f> 0b 55 83 e2 fd 48 89 e5 48 83 ec 30 48 89 5d d8 4c 89 65 e0
66[ 127.186868] RIP [<ffffffff810ed6ce>] __delete_from_page_cache+0x15e/0x160
67[ 127.186870] RSP <ffff8804144b5c08>
68[ 127.186871] ---[ end trace 7cbac5d1db69f426 ]---
69
70The bug is a race and not always easy to reproduce. To reproduce it I was
71doing the following on a single socket I7-based machine with 16G of RAM.
72
73$ hugeadm --pool-pages-max DEFAULT:13G
74$ echo $((18*1048576*1024)) > /proc/sys/kernel/shmmax
75$ echo $((18*1048576*1024)) > /proc/sys/kernel/shmall
76$ for i in `seq 1 9000`; do ./hugetlbfs-test; done
77
78On my particular machine, it usually triggers within 10 minutes but
79enabling debug options can change the timing such that it never hits.
80Once the bug is triggered, the machine is in trouble and needs to be
81rebooted. The machine will respond but processes accessing proc like "ps
82aux" will hang due to the BUG_ON. shutdown will also hang and needs a
83hard reset or a sysrq-b.
84
85The basic problem is a race between page table sharing and teardown. For
86the most part page table sharing depends on i_mmap_mutex. In some cases,
87it is also taking the mm->page_table_lock for the PTE updates but with
88shared page tables, it is the i_mmap_mutex that is more important.
89
90Unfortunately it appears to be also insufficient. Consider the following
91situation
92
93Process A Process B
94--------- ---------
95hugetlb_fault shmdt
96 LockWrite(mmap_sem)
97 do_munmap
98 unmap_region
99 unmap_vmas
100 unmap_single_vma
101 unmap_hugepage_range
102 Lock(i_mmap_mutex)
103 Lock(mm->page_table_lock)
104 huge_pmd_unshare/unmap tables <--- (1)
105 Unlock(mm->page_table_lock)
106 Unlock(i_mmap_mutex)
107 huge_pte_alloc ...
108 Lock(i_mmap_mutex) ...
109 vma_prio_walk, find svma, spte ...
110 Lock(mm->page_table_lock) ...
111 share spte ...
112 Unlock(mm->page_table_lock) ...
113 Unlock(i_mmap_mutex) ...
114 hugetlb_no_page <--- (2)
115 free_pgtables
116 unlink_file_vma
117 hugetlb_free_pgd_range
118 remove_vma_list
119
120In this scenario, it is possible for Process A to share page tables with
121Process B that is trying to tear them down. The i_mmap_mutex on its own
122does not prevent Process A walking Process B's page tables. At (1) above,
123the page tables are not shared yet so it unmaps the PMDs. Process A sets
124up page table sharing and at (2) faults a new entry. Process B then trips
125up on it in free_pgtables.
126
127This patch fixes the problem by adding a new function
128__unmap_hugepage_range_final that is only called when the VMA is about to
129be destroyed. This function clears VM_MAYSHARE during
130unmap_hugepage_range() under the i_mmap_mutex. This makes the VMA
131ineligible for sharing and avoids the race. Superficially this looks like
132it would then be vunerable to truncate and madvise issues but hugetlbfs
133has its own truncate handlers so does not use unmap_mapping_range() and
134does not support madvise(DONTNEED).
135
136This should be treated as a -stable candidate if it is merged.
137
138Test program is as follows. The test case was mostly written by Michal
139Hocko with a few minor changes to reproduce this bug.
140
141==== CUT HERE ====
142
143static size_t huge_page_size = (2UL << 20);
144static size_t nr_huge_page_A = 512;
145static size_t nr_huge_page_B = 5632;
146
147unsigned int get_random(unsigned int max)
148{
149 struct timeval tv;
150
151 gettimeofday(&tv, NULL);
152 srandom(tv.tv_usec);
153 return random() % max;
154}
155
156static void play(void *addr, size_t size)
157{
158 unsigned char *start = addr,
159 *end = start + size,
160 *a;
161 start += get_random(size/2);
162
163 /* we could itterate on huge pages but let's give it more time. */
164 for (a = start; a < end; a += 4096)
165 *a = 0;
166}
167
168int main(int argc, char **argv)
169{
170 key_t key = IPC_PRIVATE;
171 size_t sizeA = nr_huge_page_A * huge_page_size;
172 size_t sizeB = nr_huge_page_B * huge_page_size;
173 int shmidA, shmidB;
174 void *addrA = NULL, *addrB = NULL;
175 int nr_children = 300, n = 0;
176
177 if ((shmidA = shmget(key, sizeA, IPC_CREAT|SHM_HUGETLB|0660)) == -1) {
178 perror("shmget:");
179 return 1;
180 }
181
182 if ((addrA = shmat(shmidA, addrA, SHM_R|SHM_W)) == (void *)-1UL) {
183 perror("shmat");
184 return 1;
185 }
186 if ((shmidB = shmget(key, sizeB, IPC_CREAT|SHM_HUGETLB|0660)) == -1) {
187 perror("shmget:");
188 return 1;
189 }
190
191 if ((addrB = shmat(shmidB, addrB, SHM_R|SHM_W)) == (void *)-1UL) {
192 perror("shmat");
193 return 1;
194 }
195
196fork_child:
197 switch(fork()) {
198 case 0:
199 switch (n%3) {
200 case 0:
201 play(addrA, sizeA);
202 break;
203 case 1:
204 play(addrB, sizeB);
205 break;
206 case 2:
207 break;
208 }
209 break;
210 case -1:
211 perror("fork:");
212 break;
213 default:
214 if (++n < nr_children)
215 goto fork_child;
216 play(addrA, sizeA);
217 break;
218 }
219 shmdt(addrA);
220 shmdt(addrB);
221 do {
222 wait(NULL);
223 } while (--n > 0);
224 shmctl(shmidA, IPC_RMID, NULL);
225 shmctl(shmidB, IPC_RMID, NULL);
226 return 0;
227}
228
229[akpm@linux-foundation.org: name the declaration's args, fix CONFIG_HUGETLBFS=n build]
230Signed-off-by: Hugh Dickins <hughd@google.com>
231Reviewed-by: Michal Hocko <mhocko@suse.cz>
232Signed-off-by: Mel Gorman <mgorman@suse.de>
233Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
234Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
235[bwh: Backported to 3.2:
236 - Adjust context
237 - Drop the mmu_gather * parameters]
238Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
239---
240 include/linux/hugetlb.h | 10 ++++++++++
241 mm/hugetlb.c | 28 ++++++++++++++++++++++++++--
242 mm/memory.c | 7 +++++--
243 3 files changed, 41 insertions(+), 4 deletions(-)
244
245diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
246index c5ed2f1..a2227f7 100644
247--- a/include/linux/hugetlb.h
248+++ b/include/linux/hugetlb.h
249@@ -41,6 +41,9 @@ int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *,
250 unsigned long *, int *, int, unsigned int flags);
251 void unmap_hugepage_range(struct vm_area_struct *,
252 unsigned long, unsigned long, struct page *);
253+void __unmap_hugepage_range_final(struct vm_area_struct *vma,
254+ unsigned long start, unsigned long end,
255+ struct page *ref_page);
256 void __unmap_hugepage_range(struct vm_area_struct *,
257 unsigned long, unsigned long, struct page *);
258 int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
259@@ -99,6 +102,13 @@ static inline unsigned long hugetlb_total_pages(void)
260 #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; })
261 #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; })
262 #define unmap_hugepage_range(vma, start, end, page) BUG()
263+static inline void __unmap_hugepage_range_final(struct vm_area_struct *vma,
264+ unsigned long start, unsigned long end,
265+ struct page *ref_page)
266+{
267+ BUG();
268+}
269+
270 static inline void hugetlb_report_meminfo(struct seq_file *m)
271 {
272 }
273diff --git a/mm/hugetlb.c b/mm/hugetlb.c
274index b1e1bad..0f897b8 100644
275--- a/mm/hugetlb.c
276+++ b/mm/hugetlb.c
277@@ -2382,6 +2382,25 @@ void __unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
278 }
279 }
280
281+void __unmap_hugepage_range_final(struct vm_area_struct *vma,
282+ unsigned long start, unsigned long end,
283+ struct page *ref_page)
284+{
285+ __unmap_hugepage_range(vma, start, end, ref_page);
286+
287+ /*
288+ * Clear this flag so that x86's huge_pmd_share page_table_shareable
289+ * test will fail on a vma being torn down, and not grab a page table
290+ * on its way out. We're lucky that the flag has such an appropriate
291+ * name, and can in fact be safely cleared here. We could clear it
292+ * before the __unmap_hugepage_range above, but all that's necessary
293+ * is to clear it before releasing the i_mmap_mutex. This works
294+ * because in the context this is called, the VMA is about to be
295+ * destroyed and the i_mmap_mutex is held.
296+ */
297+ vma->vm_flags &= ~VM_MAYSHARE;
298+}
299+
300 void unmap_hugepage_range(struct vm_area_struct *vma, unsigned long start,
301 unsigned long end, struct page *ref_page)
302 {
303@@ -2939,9 +2958,14 @@ void hugetlb_change_protection(struct vm_area_struct *vma,
304 }
305 }
306 spin_unlock(&mm->page_table_lock);
307- mutex_unlock(&vma->vm_file->f_mapping->i_mmap_mutex);
308-
309+ /*
310+ * Must flush TLB before releasing i_mmap_mutex: x86's huge_pmd_unshare
311+ * may have cleared our pud entry and done put_page on the page table:
312+ * once we release i_mmap_mutex, another task can do the final put_page
313+ * and that page table be reused and filled with junk.
314+ */
315 flush_tlb_range(vma, start, end);
316+ mutex_unlock(&vma->vm_file->f_mapping->i_mmap_mutex);
317 }
318
319 int hugetlb_reserve_pages(struct inode *inode,
320diff --git a/mm/memory.c b/mm/memory.c
321index 1b1ca17..70f5daf 100644
322--- a/mm/memory.c
323+++ b/mm/memory.c
324@@ -1358,8 +1358,11 @@ unsigned long unmap_vmas(struct mmu_gather *tlb,
325 * Since no pte has actually been setup, it is
326 * safe to do nothing in this case.
327 */
328- if (vma->vm_file)
329- unmap_hugepage_range(vma, start, end, NULL);
330+ if (vma->vm_file) {
331+ mutex_lock(&vma->vm_file->f_mapping->i_mmap_mutex);
332+ __unmap_hugepage_range_final(vma, start, end, NULL);
333+ mutex_unlock(&vma->vm_file->f_mapping->i_mmap_mutex);
334+ }
335
336 start = end;
337 } else
338--
3391.7.7.6
340
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0057-ALSA-snd-usb-fix-clock-source-validity-index.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0057-ALSA-snd-usb-fix-clock-source-validity-index.patch
new file mode 100644
index 00000000..007e393e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0057-ALSA-snd-usb-fix-clock-source-validity-index.patch
@@ -0,0 +1,40 @@
1From 25ad0cb4cfe9597474d8cda839d5adedc9412201 Mon Sep 17 00:00:00 2001
2From: Daniel Mack <zonque@gmail.com>
3Date: Wed, 1 Aug 2012 10:16:53 +0200
4Subject: [PATCH 57/70] ALSA: snd-usb: fix clock source validity index
5
6commit aff252a848ce21b431ba822de3dab9c4c94571cb upstream.
7
8uac_clock_source_is_valid() uses the control selector value to access
9the bmControls bitmap of the clock source unit. This is wrong, as
10control selector values start from 1, while the bitmap uses all
11available bits.
12
13In other words, "Clock Validity Control" is stored in D3..2, not D5..4
14of the clock selector unit's bmControls.
15
16Signed-off-by: Daniel Mack <zonque@gmail.com>
17Reported-by: Andreas Koch <andreas@akdesigninc.com>
18Signed-off-by: Takashi Iwai <tiwai@suse.de>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 sound/usb/clock.c | 3 ++-
22 1 files changed, 2 insertions(+), 1 deletions(-)
23
24diff --git a/sound/usb/clock.c b/sound/usb/clock.c
25index 379baad..5e634a2 100644
26--- a/sound/usb/clock.c
27+++ b/sound/usb/clock.c
28@@ -111,7 +111,8 @@ static bool uac_clock_source_is_valid(struct snd_usb_audio *chip, int source_id)
29 return 0;
30
31 /* If a clock source can't tell us whether it's valid, we assume it is */
32- if (!uac2_control_is_readable(cs_desc->bmControls, UAC2_CS_CONTROL_CLOCK_VALID))
33+ if (!uac2_control_is_readable(cs_desc->bmControls,
34+ UAC2_CS_CONTROL_CLOCK_VALID - 1))
35 return 1;
36
37 err = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), UAC2_CS_CUR,
38--
391.7.7.6
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0058-ALSA-hda-Support-dock-on-Lenovo-Thinkpad-T530-with-A.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0058-ALSA-hda-Support-dock-on-Lenovo-Thinkpad-T530-with-A.patch
new file mode 100644
index 00000000..9ffbd4c2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0058-ALSA-hda-Support-dock-on-Lenovo-Thinkpad-T530-with-A.patch
@@ -0,0 +1,34 @@
1From 49cbaa1b1111f838004b74390214575cc82ae5ff Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Thu, 2 Aug 2012 09:04:39 +0200
4Subject: [PATCH 58/70] ALSA: hda - Support dock on Lenovo Thinkpad T530 with
5 ALC269VC
6
7commit 707fba3fa76a4c8855552f5d4c1a12430c09bce8 upstream.
8
9Lenovo Thinkpad T530 with ALC269VC codec has a dock port but BIOS
10doesn't set up the pins properly. Enable the pins as well as on
11Thinkpad X230 Tablet.
12
13Reported-and-tested-by: Mario <anyc@hadiko.de>
14Signed-off-by: Takashi Iwai <tiwai@suse.de>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 sound/pci/hda/patch_realtek.c | 1 +
18 1 files changed, 1 insertions(+), 0 deletions(-)
19
20diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
21index 6ae58b2..2e2eb93 100644
22--- a/sound/pci/hda/patch_realtek.c
23+++ b/sound/pci/hda/patch_realtek.c
24@@ -5076,6 +5076,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
25 SND_PCI_QUIRK(0x17aa, 0x21b8, "Thinkpad Edge 14", ALC269_FIXUP_SKU_IGNORE),
26 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
27 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
28+ SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
29 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
30 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
31 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
32--
331.7.7.6
34
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0059-ore-Fix-out-of-bounds-access-in-_ios_obj.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0059-ore-Fix-out-of-bounds-access-in-_ios_obj.patch
new file mode 100644
index 00000000..42b27e56
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0059-ore-Fix-out-of-bounds-access-in-_ios_obj.patch
@@ -0,0 +1,75 @@
1From e9c69241e1b7a169690d8b16393d712d7613706d Mon Sep 17 00:00:00 2001
2From: Boaz Harrosh <bharrosh@panasas.com>
3Date: Wed, 1 Aug 2012 17:48:36 +0300
4Subject: [PATCH 59/70] ore: Fix out-of-bounds access in _ios_obj()
5
6commit 9e62bb4458ad2cf28bd701aa5fab380b846db326 upstream.
7
8_ios_obj() is accessed by group_index not device_table index.
9
10The oc->comps array is only a group_full of devices at a time
11it is not like ore_comp_dev() which is indexed by a global
12device_table index.
13
14This did not BUG until now because exofs only uses a single
15COMP for all devices. But with other FSs like PanFS this is
16not true.
17
18This bug was only in the write_path, all other users were
19using it correctly
20
21[This is a bug since 3.2 Kernel]
22
23Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
24Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
25---
26 fs/exofs/ore.c | 14 +++++++-------
27 1 files changed, 7 insertions(+), 7 deletions(-)
28
29diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
30index 24a49d4..1585db1 100644
31--- a/fs/exofs/ore.c
32+++ b/fs/exofs/ore.c
33@@ -837,11 +837,11 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
34 bio->bi_rw |= REQ_WRITE;
35 }
36
37- osd_req_write(or, _ios_obj(ios, dev), per_dev->offset,
38- bio, per_dev->length);
39+ osd_req_write(or, _ios_obj(ios, cur_comp),
40+ per_dev->offset, bio, per_dev->length);
41 ORE_DBGMSG("write(0x%llx) offset=0x%llx "
42 "length=0x%llx dev=%d\n",
43- _LLU(_ios_obj(ios, dev)->id),
44+ _LLU(_ios_obj(ios, cur_comp)->id),
45 _LLU(per_dev->offset),
46 _LLU(per_dev->length), dev);
47 } else if (ios->kern_buff) {
48@@ -853,20 +853,20 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
49 (ios->si.unit_off + ios->length >
50 ios->layout->stripe_unit));
51
52- ret = osd_req_write_kern(or, _ios_obj(ios, per_dev->dev),
53+ ret = osd_req_write_kern(or, _ios_obj(ios, cur_comp),
54 per_dev->offset,
55 ios->kern_buff, ios->length);
56 if (unlikely(ret))
57 goto out;
58 ORE_DBGMSG2("write_kern(0x%llx) offset=0x%llx "
59 "length=0x%llx dev=%d\n",
60- _LLU(_ios_obj(ios, dev)->id),
61+ _LLU(_ios_obj(ios, cur_comp)->id),
62 _LLU(per_dev->offset),
63 _LLU(ios->length), per_dev->dev);
64 } else {
65- osd_req_set_attributes(or, _ios_obj(ios, dev));
66+ osd_req_set_attributes(or, _ios_obj(ios, cur_comp));
67 ORE_DBGMSG2("obj(0x%llx) set_attributes=%d dev=%d\n",
68- _LLU(_ios_obj(ios, dev)->id),
69+ _LLU(_ios_obj(ios, cur_comp)->id),
70 ios->out_attr_len, dev);
71 }
72
73--
741.7.7.6
75
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0060-m68k-Make-sys_atomic_cmpxchg_32-work-on-classic-m68k.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0060-m68k-Make-sys_atomic_cmpxchg_32-work-on-classic-m68k.patch
new file mode 100644
index 00000000..b9555011
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0060-m68k-Make-sys_atomic_cmpxchg_32-work-on-classic-m68k.patch
@@ -0,0 +1,41 @@
1From 83e7a3bd925b3f8886f4a116a3d6581c89fcb87e Mon Sep 17 00:00:00 2001
2From: Andreas Schwab <schwab@linux-m68k.org>
3Date: Sat, 28 Jul 2012 00:20:34 +0200
4Subject: [PATCH 60/70] m68k: Make sys_atomic_cmpxchg_32 work on classic m68k
5
6commit 9e2760d18b3cf179534bbc27692c84879c61b97c upstream.
7
8User space access must always go through uaccess accessors, since on
9classic m68k user space and kernel space are completely separate.
10
11Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
12Tested-by: Thorsten Glaser <tg@debian.org>
13Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 arch/m68k/kernel/sys_m68k.c | 8 ++++++--
17 1 files changed, 6 insertions(+), 2 deletions(-)
18
19diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c
20index 8623f8d..9a5932e 100644
21--- a/arch/m68k/kernel/sys_m68k.c
22+++ b/arch/m68k/kernel/sys_m68k.c
23@@ -479,9 +479,13 @@ sys_atomic_cmpxchg_32(unsigned long newval, int oldval, int d3, int d4, int d5,
24 goto bad_access;
25 }
26
27- mem_value = *mem;
28+ /*
29+ * No need to check for EFAULT; we know that the page is
30+ * present and writable.
31+ */
32+ __get_user(mem_value, mem);
33 if (mem_value == oldval)
34- *mem = newval;
35+ __put_user(newval, mem);
36
37 pte_unmap_unlock(pte, ptl);
38 up_read(&mm->mmap_sem);
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0061-drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0061-drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch
new file mode 100644
index 00000000..5d55fb52
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0061-drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch
@@ -0,0 +1,41 @@
1From dc2062a19f602bfb44928a95bdeb21165a17e27c Mon Sep 17 00:00:00 2001
2From: Jesse Barnes <jbarnes@virtuousgeek.org>
3Date: Thu, 21 Jun 2012 15:13:50 -0700
4Subject: [PATCH 61/70] drm/i915: prefer wide & slow to fast & narrow in DP
5 configs
6
7commit 2514bc510d0c3aadcc5204056bb440fa36845147 upstream.
8
9High frequency link configurations have the potential to cause trouble
10with long and/or cheap cables, so prefer slow and wide configurations
11instead. This patch has the potential to cause trouble for eDP
12configurations that lie about available lanes, so if we run into that we
13can make it conditional on eDP.
14
15Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45801
16Tested-by: peter@colberg.org
17Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
18Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 drivers/gpu/drm/i915/intel_dp.c | 4 ++--
22 1 files changed, 2 insertions(+), 2 deletions(-)
23
24diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
25index d4c4937..fae2050 100644
26--- a/drivers/gpu/drm/i915/intel_dp.c
27+++ b/drivers/gpu/drm/i915/intel_dp.c
28@@ -708,8 +708,8 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
29
30 bpp = adjusted_mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
31
32- for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
33- for (clock = 0; clock <= max_clock; clock++) {
34+ for (clock = 0; clock <= max_clock; clock++) {
35+ for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
36 int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
37
38 if (intel_dp_link_required(mode->clock, bpp)
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0062-rt2x00-Add-support-for-BUFFALO-WLI-UC-GNM2-to-rt2800.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0062-rt2x00-Add-support-for-BUFFALO-WLI-UC-GNM2-to-rt2800.patch
new file mode 100644
index 00000000..a55d0138
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0062-rt2x00-Add-support-for-BUFFALO-WLI-UC-GNM2-to-rt2800.patch
@@ -0,0 +1,32 @@
1From 1daebd9ade24166c1212e0dc8383a54558c77476 Mon Sep 17 00:00:00 2001
2From: Jeongdo Son <sohn9086@gmail.com>
3Date: Fri, 15 Jun 2012 02:28:01 +0900
4Subject: [PATCH 62/70] rt2x00: Add support for BUFFALO WLI-UC-GNM2 to
5 rt2800usb.
6
7commit a769f9577232afe2c754606a83aad85127e7052a upstream.
8
9This is a RT3070 based device.
10
11Signed-off-by: Jeongdo Son <sohn9086@gmail.com>
12Signed-off-by: John W. Linville <linville@tuxdriver.com>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 drivers/net/wireless/rt2x00/rt2800usb.c | 1 +
16 1 files changed, 1 insertions(+), 0 deletions(-)
17
18diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
19index bdf960b..ae7528b 100644
20--- a/drivers/net/wireless/rt2x00/rt2800usb.c
21+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
22@@ -925,6 +925,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
23 { USB_DEVICE(0x0411, 0x015d) },
24 { USB_DEVICE(0x0411, 0x016f) },
25 { USB_DEVICE(0x0411, 0x01a2) },
26+ { USB_DEVICE(0x0411, 0x01ee) },
27 /* Corega */
28 { USB_DEVICE(0x07aa, 0x002f) },
29 { USB_DEVICE(0x07aa, 0x003c) },
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0063-drop_monitor-fix-sleeping-in-invalid-context-warning.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0063-drop_monitor-fix-sleeping-in-invalid-context-warning.patch
new file mode 100644
index 00000000..66b0cf54
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0063-drop_monitor-fix-sleeping-in-invalid-context-warning.patch
@@ -0,0 +1,115 @@
1From f525976c33830cfe23b1a73eb9ae853820c5c085 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@tuxdriver.com>
3Date: Fri, 27 Apr 2012 10:11:48 +0000
4Subject: [PATCH 63/70] drop_monitor: fix sleeping in invalid context warning
5
6commit cde2e9a651b76d8db36ae94cd0febc82b637e5dd upstream.
7
8Eric Dumazet pointed out this warning in the drop_monitor protocol to me:
9
10[ 38.352571] BUG: sleeping function called from invalid context at kernel/mutex.c:85
11[ 38.352576] in_atomic(): 1, irqs_disabled(): 0, pid: 4415, name: dropwatch
12[ 38.352580] Pid: 4415, comm: dropwatch Not tainted 3.4.0-rc2+ #71
13[ 38.352582] Call Trace:
14[ 38.352592] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
15[ 38.352599] [<ffffffff81063f2a>] __might_sleep+0xca/0xf0
16[ 38.352606] [<ffffffff81655b16>] mutex_lock+0x26/0x50
17[ 38.352610] [<ffffffff8153aaf0>] ? trace_napi_poll_hit+0xd0/0xd0
18[ 38.352616] [<ffffffff810b72d9>] tracepoint_probe_register+0x29/0x90
19[ 38.352621] [<ffffffff8153a585>] set_all_monitor_traces+0x105/0x170
20[ 38.352625] [<ffffffff8153a8ca>] net_dm_cmd_trace+0x2a/0x40
21[ 38.352630] [<ffffffff8154a81a>] genl_rcv_msg+0x21a/0x2b0
22[ 38.352636] [<ffffffff810f8029>] ? zone_statistics+0x99/0xc0
23[ 38.352640] [<ffffffff8154a600>] ? genl_rcv+0x30/0x30
24[ 38.352645] [<ffffffff8154a059>] netlink_rcv_skb+0xa9/0xd0
25[ 38.352649] [<ffffffff8154a5f0>] genl_rcv+0x20/0x30
26[ 38.352653] [<ffffffff81549a7e>] netlink_unicast+0x1ae/0x1f0
27[ 38.352658] [<ffffffff81549d76>] netlink_sendmsg+0x2b6/0x310
28[ 38.352663] [<ffffffff8150824f>] sock_sendmsg+0x10f/0x130
29[ 38.352668] [<ffffffff8150abe0>] ? move_addr_to_kernel+0x60/0xb0
30[ 38.352673] [<ffffffff81515f04>] ? verify_iovec+0x64/0xe0
31[ 38.352677] [<ffffffff81509c46>] __sys_sendmsg+0x386/0x390
32[ 38.352682] [<ffffffff810ffaf9>] ? handle_mm_fault+0x139/0x210
33[ 38.352687] [<ffffffff8165b5bc>] ? do_page_fault+0x1ec/0x4f0
34[ 38.352693] [<ffffffff8106ba4d>] ? set_next_entity+0x9d/0xb0
35[ 38.352699] [<ffffffff81310b49>] ? tty_ldisc_deref+0x9/0x10
36[ 38.352703] [<ffffffff8106d363>] ? pick_next_task_fair+0x63/0x140
37[ 38.352708] [<ffffffff8150b8d4>] sys_sendmsg+0x44/0x80
38[ 38.352713] [<ffffffff8165f8e2>] system_call_fastpath+0x16/0x1b
39
40It stems from holding a spinlock (trace_state_lock) while attempting to register
41or unregister tracepoint hooks, making in_atomic() true in this context, leading
42to the warning when the tracepoint calls might_sleep() while its taking a mutex.
43Since we only use the trace_state_lock to prevent trace protocol state races, as
44well as hardware stat list updates on an rcu write side, we can just convert the
45spinlock to a mutex to avoid this problem.
46
47Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
48Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
49CC: David Miller <davem@davemloft.net>
50Acked-by: Eric Dumazet <edumazet@google.com>
51Signed-off-by: David S. Miller <davem@davemloft.net>
52Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
53---
54 net/core/drop_monitor.c | 14 +++++++-------
55 1 files changed, 7 insertions(+), 7 deletions(-)
56
57diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
58index 7f36b38..f74d7d7 100644
59--- a/net/core/drop_monitor.c
60+++ b/net/core/drop_monitor.c
61@@ -42,7 +42,7 @@ static void send_dm_alert(struct work_struct *unused);
62 * netlink alerts
63 */
64 static int trace_state = TRACE_OFF;
65-static DEFINE_SPINLOCK(trace_state_lock);
66+static DEFINE_MUTEX(trace_state_mutex);
67
68 struct per_cpu_dm_data {
69 struct work_struct dm_alert_work;
70@@ -213,7 +213,7 @@ static int set_all_monitor_traces(int state)
71 struct dm_hw_stat_delta *new_stat = NULL;
72 struct dm_hw_stat_delta *temp;
73
74- spin_lock(&trace_state_lock);
75+ mutex_lock(&trace_state_mutex);
76
77 if (state == trace_state) {
78 rc = -EAGAIN;
79@@ -252,7 +252,7 @@ static int set_all_monitor_traces(int state)
80 rc = -EINPROGRESS;
81
82 out_unlock:
83- spin_unlock(&trace_state_lock);
84+ mutex_unlock(&trace_state_mutex);
85
86 return rc;
87 }
88@@ -295,12 +295,12 @@ static int dropmon_net_event(struct notifier_block *ev_block,
89
90 new_stat->dev = dev;
91 new_stat->last_rx = jiffies;
92- spin_lock(&trace_state_lock);
93+ mutex_lock(&trace_state_mutex);
94 list_add_rcu(&new_stat->list, &hw_stats_list);
95- spin_unlock(&trace_state_lock);
96+ mutex_unlock(&trace_state_mutex);
97 break;
98 case NETDEV_UNREGISTER:
99- spin_lock(&trace_state_lock);
100+ mutex_lock(&trace_state_mutex);
101 list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) {
102 if (new_stat->dev == dev) {
103 new_stat->dev = NULL;
104@@ -311,7 +311,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
105 }
106 }
107 }
108- spin_unlock(&trace_state_lock);
109+ mutex_unlock(&trace_state_mutex);
110 break;
111 }
112 out:
113--
1141.7.7.6
115
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0064-drop_monitor-Make-updating-data-skb-smp-safe.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0064-drop_monitor-Make-updating-data-skb-smp-safe.patch
new file mode 100644
index 00000000..437f06cf
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0064-drop_monitor-Make-updating-data-skb-smp-safe.patch
@@ -0,0 +1,187 @@
1From 89f73073f155006eaacd5709739fb83e07f3caa8 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@tuxdriver.com>
3Date: Fri, 27 Apr 2012 10:11:49 +0000
4Subject: [PATCH 64/70] drop_monitor: Make updating data->skb smp safe
5
6commit 3885ca785a3618593226687ced84f3f336dc3860 upstream.
7
8Eric Dumazet pointed out to me that the drop_monitor protocol has some holes in
9its smp protections. Specifically, its possible to replace data->skb while its
10being written. This patch corrects that by making data->skb an rcu protected
11variable. That will prevent it from being overwritten while a tracepoint is
12modifying it.
13
14Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
15Reported-by: Eric Dumazet <eric.dumazet@gmail.com>
16CC: David Miller <davem@davemloft.net>
17Acked-by: Eric Dumazet <edumazet@google.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 net/core/drop_monitor.c | 70 ++++++++++++++++++++++++++++++++++++-----------
22 1 files changed, 54 insertions(+), 16 deletions(-)
23
24diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
25index f74d7d7..d75cbfc 100644
26--- a/net/core/drop_monitor.c
27+++ b/net/core/drop_monitor.c
28@@ -46,7 +46,7 @@ static DEFINE_MUTEX(trace_state_mutex);
29
30 struct per_cpu_dm_data {
31 struct work_struct dm_alert_work;
32- struct sk_buff *skb;
33+ struct sk_buff __rcu *skb;
34 atomic_t dm_hit_count;
35 struct timer_list send_timer;
36 };
37@@ -73,35 +73,58 @@ static int dm_hit_limit = 64;
38 static int dm_delay = 1;
39 static unsigned long dm_hw_check_delta = 2*HZ;
40 static LIST_HEAD(hw_stats_list);
41+static int initialized = 0;
42
43 static void reset_per_cpu_data(struct per_cpu_dm_data *data)
44 {
45 size_t al;
46 struct net_dm_alert_msg *msg;
47 struct nlattr *nla;
48+ struct sk_buff *skb;
49+ struct sk_buff *oskb = rcu_dereference_protected(data->skb, 1);
50
51 al = sizeof(struct net_dm_alert_msg);
52 al += dm_hit_limit * sizeof(struct net_dm_drop_point);
53 al += sizeof(struct nlattr);
54
55- data->skb = genlmsg_new(al, GFP_KERNEL);
56- genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
57- 0, NET_DM_CMD_ALERT);
58- nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
59- msg = nla_data(nla);
60- memset(msg, 0, al);
61- atomic_set(&data->dm_hit_count, dm_hit_limit);
62+ skb = genlmsg_new(al, GFP_KERNEL);
63+
64+ if (skb) {
65+ genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
66+ 0, NET_DM_CMD_ALERT);
67+ nla = nla_reserve(skb, NLA_UNSPEC,
68+ sizeof(struct net_dm_alert_msg));
69+ msg = nla_data(nla);
70+ memset(msg, 0, al);
71+ } else if (initialized)
72+ schedule_work_on(smp_processor_id(), &data->dm_alert_work);
73+
74+ /*
75+ * Don't need to lock this, since we are guaranteed to only
76+ * run this on a single cpu at a time.
77+ * Note also that we only update data->skb if the old and new skb
78+ * pointers don't match. This ensures that we don't continually call
79+ * synchornize_rcu if we repeatedly fail to alloc a new netlink message.
80+ */
81+ if (skb != oskb) {
82+ rcu_assign_pointer(data->skb, skb);
83+
84+ synchronize_rcu();
85+
86+ atomic_set(&data->dm_hit_count, dm_hit_limit);
87+ }
88+
89 }
90
91 static void send_dm_alert(struct work_struct *unused)
92 {
93 struct sk_buff *skb;
94- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
95+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
96
97 /*
98 * Grab the skb we're about to send
99 */
100- skb = data->skb;
101+ skb = rcu_dereference_protected(data->skb, 1);
102
103 /*
104 * Replace it with a new one
105@@ -111,8 +134,10 @@ static void send_dm_alert(struct work_struct *unused)
106 /*
107 * Ship it!
108 */
109- genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
110+ if (skb)
111+ genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
112
113+ put_cpu_var(dm_cpu_data);
114 }
115
116 /*
117@@ -123,9 +148,11 @@ static void send_dm_alert(struct work_struct *unused)
118 */
119 static void sched_send_work(unsigned long unused)
120 {
121- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
122+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
123+
124+ schedule_work_on(smp_processor_id(), &data->dm_alert_work);
125
126- schedule_work(&data->dm_alert_work);
127+ put_cpu_var(dm_cpu_data);
128 }
129
130 static void trace_drop_common(struct sk_buff *skb, void *location)
131@@ -134,9 +161,16 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
132 struct nlmsghdr *nlh;
133 struct nlattr *nla;
134 int i;
135- struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
136+ struct sk_buff *dskb;
137+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
138
139
140+ rcu_read_lock();
141+ dskb = rcu_dereference(data->skb);
142+
143+ if (!dskb)
144+ goto out;
145+
146 if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
147 /*
148 * we're already at zero, discard this hit
149@@ -144,7 +178,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
150 goto out;
151 }
152
153- nlh = (struct nlmsghdr *)data->skb->data;
154+ nlh = (struct nlmsghdr *)dskb->data;
155 nla = genlmsg_data(nlmsg_data(nlh));
156 msg = nla_data(nla);
157 for (i = 0; i < msg->entries; i++) {
158@@ -157,7 +191,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
159 /*
160 * We need to create a new entry
161 */
162- __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
163+ __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
164 nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
165 memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
166 msg->points[msg->entries].count = 1;
167@@ -169,6 +203,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
168 }
169
170 out:
171+ rcu_read_unlock();
172+ put_cpu_var(dm_cpu_data);
173 return;
174 }
175
176@@ -374,6 +410,8 @@ static int __init init_net_drop_monitor(void)
177 data->send_timer.function = sched_send_work;
178 }
179
180+ initialized = 1;
181+
182 goto out;
183
184 out_unreg:
185--
1861.7.7.6
187
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0065-drop_monitor-prevent-init-path-from-scheduling-on-th.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0065-drop_monitor-prevent-init-path-from-scheduling-on-th.patch
new file mode 100644
index 00000000..08c7a7c6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0065-drop_monitor-prevent-init-path-from-scheduling-on-th.patch
@@ -0,0 +1,93 @@
1From e056f9e8a25db637798455e701c2a42f9cdeb5b8 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@tuxdriver.com>
3Date: Tue, 1 May 2012 08:18:02 +0000
4Subject: [PATCH 65/70] drop_monitor: prevent init path from scheduling on the
5 wrong cpu
6
7commit 4fdcfa12843bca38d0c9deff70c8720e4e8f515f upstream.
8
9I just noticed after some recent updates, that the init path for the drop
10monitor protocol has a minor error. drop monitor maintains a per cpu structure,
11that gets initalized from a single cpu. Normally this is fine, as the protocol
12isn't in use yet, but I recently made a change that causes a failed skb
13allocation to reschedule itself . Given the current code, the implication is
14that this workqueue reschedule will take place on the wrong cpu. If drop
15monitor is used early during the boot process, its possible that two cpus will
16access a single per-cpu structure in parallel, possibly leading to data
17corruption.
18
19This patch fixes the situation, by storing the cpu number that a given instance
20of this per-cpu data should be accessed from. In the case of a need for a
21reschedule, the cpu stored in the struct is assigned the rescheule, rather than
22the currently executing cpu
23
24Tested successfully by myself.
25
26Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
27CC: David Miller <davem@davemloft.net>
28Signed-off-by: David S. Miller <davem@davemloft.net>
29Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
30---
31 net/core/drop_monitor.c | 12 +++++++-----
32 1 files changed, 7 insertions(+), 5 deletions(-)
33
34diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
35index d75cbfc..e836592 100644
36--- a/net/core/drop_monitor.c
37+++ b/net/core/drop_monitor.c
38@@ -49,6 +49,7 @@ struct per_cpu_dm_data {
39 struct sk_buff __rcu *skb;
40 atomic_t dm_hit_count;
41 struct timer_list send_timer;
42+ int cpu;
43 };
44
45 struct dm_hw_stat_delta {
46@@ -73,7 +74,6 @@ static int dm_hit_limit = 64;
47 static int dm_delay = 1;
48 static unsigned long dm_hw_check_delta = 2*HZ;
49 static LIST_HEAD(hw_stats_list);
50-static int initialized = 0;
51
52 static void reset_per_cpu_data(struct per_cpu_dm_data *data)
53 {
54@@ -96,8 +96,8 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
55 sizeof(struct net_dm_alert_msg));
56 msg = nla_data(nla);
57 memset(msg, 0, al);
58- } else if (initialized)
59- schedule_work_on(smp_processor_id(), &data->dm_alert_work);
60+ } else
61+ schedule_work_on(data->cpu, &data->dm_alert_work);
62
63 /*
64 * Don't need to lock this, since we are guaranteed to only
65@@ -121,6 +121,8 @@ static void send_dm_alert(struct work_struct *unused)
66 struct sk_buff *skb;
67 struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
68
69+ WARN_ON_ONCE(data->cpu != smp_processor_id());
70+
71 /*
72 * Grab the skb we're about to send
73 */
74@@ -403,14 +405,14 @@ static int __init init_net_drop_monitor(void)
75
76 for_each_present_cpu(cpu) {
77 data = &per_cpu(dm_cpu_data, cpu);
78- reset_per_cpu_data(data);
79+ data->cpu = cpu;
80 INIT_WORK(&data->dm_alert_work, send_dm_alert);
81 init_timer(&data->send_timer);
82 data->send_timer.data = cpu;
83 data->send_timer.function = sched_send_work;
84+ reset_per_cpu_data(data);
85 }
86
87- initialized = 1;
88
89 goto out;
90
91--
921.7.7.6
93
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0066-drop_monitor-dont-sleep-in-atomic-context.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0066-drop_monitor-dont-sleep-in-atomic-context.patch
new file mode 100644
index 00000000..dff38d28
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0066-drop_monitor-dont-sleep-in-atomic-context.patch
@@ -0,0 +1,244 @@
1From af61f8503b1c3a3d2e034a79abc0368ab3fd2aa4 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <edumazet@google.com>
3Date: Mon, 4 Jun 2012 00:18:19 +0000
4Subject: [PATCH 66/70] drop_monitor: dont sleep in atomic context
5
6commit bec4596b4e6770c7037f21f6bd27567b152dc0d6 upstream.
7
8drop_monitor calls several sleeping functions while in atomic context.
9
10 BUG: sleeping function called from invalid context at mm/slub.c:943
11 in_atomic(): 1, irqs_disabled(): 0, pid: 2103, name: kworker/0:2
12 Pid: 2103, comm: kworker/0:2 Not tainted 3.5.0-rc1+ #55
13 Call Trace:
14 [<ffffffff810697ca>] __might_sleep+0xca/0xf0
15 [<ffffffff811345a3>] kmem_cache_alloc_node+0x1b3/0x1c0
16 [<ffffffff8105578c>] ? queue_delayed_work_on+0x11c/0x130
17 [<ffffffff815343fb>] __alloc_skb+0x4b/0x230
18 [<ffffffffa00b0360>] ? reset_per_cpu_data+0x160/0x160 [drop_monitor]
19 [<ffffffffa00b022f>] reset_per_cpu_data+0x2f/0x160 [drop_monitor]
20 [<ffffffffa00b03ab>] send_dm_alert+0x4b/0xb0 [drop_monitor]
21 [<ffffffff810568e0>] process_one_work+0x130/0x4c0
22 [<ffffffff81058249>] worker_thread+0x159/0x360
23 [<ffffffff810580f0>] ? manage_workers.isra.27+0x240/0x240
24 [<ffffffff8105d403>] kthread+0x93/0xa0
25 [<ffffffff816be6d4>] kernel_thread_helper+0x4/0x10
26 [<ffffffff8105d370>] ? kthread_freezable_should_stop+0x80/0x80
27 [<ffffffff816be6d0>] ? gs_change+0xb/0xb
28
29Rework the logic to call the sleeping functions in right context.
30
31Use standard timer/workqueue api to let system chose any cpu to perform
32the allocation and netlink send.
33
34Also avoid a loop if reset_per_cpu_data() cannot allocate memory :
35use mod_timer() to wait 1/10 second before next try.
36
37Signed-off-by: Eric Dumazet <edumazet@google.com>
38Cc: Neil Horman <nhorman@tuxdriver.com>
39Reviewed-by: Neil Horman <nhorman@tuxdriver.com>
40Signed-off-by: David S. Miller <davem@davemloft.net>
41Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
42---
43 net/core/drop_monitor.c | 101 +++++++++++++++-------------------------------
44 1 files changed, 33 insertions(+), 68 deletions(-)
45
46diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
47index e836592..b856f87 100644
48--- a/net/core/drop_monitor.c
49+++ b/net/core/drop_monitor.c
50@@ -33,9 +33,6 @@
51 #define TRACE_ON 1
52 #define TRACE_OFF 0
53
54-static void send_dm_alert(struct work_struct *unused);
55-
56-
57 /*
58 * Globals, our netlink socket pointer
59 * and the work handle that will send up
60@@ -45,11 +42,10 @@ static int trace_state = TRACE_OFF;
61 static DEFINE_MUTEX(trace_state_mutex);
62
63 struct per_cpu_dm_data {
64- struct work_struct dm_alert_work;
65- struct sk_buff __rcu *skb;
66- atomic_t dm_hit_count;
67- struct timer_list send_timer;
68- int cpu;
69+ spinlock_t lock;
70+ struct sk_buff *skb;
71+ struct work_struct dm_alert_work;
72+ struct timer_list send_timer;
73 };
74
75 struct dm_hw_stat_delta {
76@@ -75,13 +71,13 @@ static int dm_delay = 1;
77 static unsigned long dm_hw_check_delta = 2*HZ;
78 static LIST_HEAD(hw_stats_list);
79
80-static void reset_per_cpu_data(struct per_cpu_dm_data *data)
81+static struct sk_buff *reset_per_cpu_data(struct per_cpu_dm_data *data)
82 {
83 size_t al;
84 struct net_dm_alert_msg *msg;
85 struct nlattr *nla;
86 struct sk_buff *skb;
87- struct sk_buff *oskb = rcu_dereference_protected(data->skb, 1);
88+ unsigned long flags;
89
90 al = sizeof(struct net_dm_alert_msg);
91 al += dm_hit_limit * sizeof(struct net_dm_drop_point);
92@@ -96,65 +92,40 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
93 sizeof(struct net_dm_alert_msg));
94 msg = nla_data(nla);
95 memset(msg, 0, al);
96- } else
97- schedule_work_on(data->cpu, &data->dm_alert_work);
98-
99- /*
100- * Don't need to lock this, since we are guaranteed to only
101- * run this on a single cpu at a time.
102- * Note also that we only update data->skb if the old and new skb
103- * pointers don't match. This ensures that we don't continually call
104- * synchornize_rcu if we repeatedly fail to alloc a new netlink message.
105- */
106- if (skb != oskb) {
107- rcu_assign_pointer(data->skb, skb);
108-
109- synchronize_rcu();
110-
111- atomic_set(&data->dm_hit_count, dm_hit_limit);
112+ } else {
113+ mod_timer(&data->send_timer, jiffies + HZ / 10);
114 }
115
116+ spin_lock_irqsave(&data->lock, flags);
117+ swap(data->skb, skb);
118+ spin_unlock_irqrestore(&data->lock, flags);
119+
120+ return skb;
121 }
122
123-static void send_dm_alert(struct work_struct *unused)
124+static void send_dm_alert(struct work_struct *work)
125 {
126 struct sk_buff *skb;
127- struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
128+ struct per_cpu_dm_data *data;
129
130- WARN_ON_ONCE(data->cpu != smp_processor_id());
131+ data = container_of(work, struct per_cpu_dm_data, dm_alert_work);
132
133- /*
134- * Grab the skb we're about to send
135- */
136- skb = rcu_dereference_protected(data->skb, 1);
137+ skb = reset_per_cpu_data(data);
138
139- /*
140- * Replace it with a new one
141- */
142- reset_per_cpu_data(data);
143-
144- /*
145- * Ship it!
146- */
147 if (skb)
148 genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
149-
150- put_cpu_var(dm_cpu_data);
151 }
152
153 /*
154 * This is the timer function to delay the sending of an alert
155 * in the event that more drops will arrive during the
156- * hysteresis period. Note that it operates under the timer interrupt
157- * so we don't need to disable preemption here
158+ * hysteresis period.
159 */
160-static void sched_send_work(unsigned long unused)
161+static void sched_send_work(unsigned long _data)
162 {
163- struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
164+ struct per_cpu_dm_data *data = (struct per_cpu_dm_data *)_data;
165
166- schedule_work_on(smp_processor_id(), &data->dm_alert_work);
167-
168- put_cpu_var(dm_cpu_data);
169+ schedule_work(&data->dm_alert_work);
170 }
171
172 static void trace_drop_common(struct sk_buff *skb, void *location)
173@@ -164,22 +135,17 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
174 struct nlattr *nla;
175 int i;
176 struct sk_buff *dskb;
177- struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
178-
179+ struct per_cpu_dm_data *data;
180+ unsigned long flags;
181
182- rcu_read_lock();
183- dskb = rcu_dereference(data->skb);
184+ local_irq_save(flags);
185+ data = &__get_cpu_var(dm_cpu_data);
186+ spin_lock(&data->lock);
187+ dskb = data->skb;
188
189 if (!dskb)
190 goto out;
191
192- if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
193- /*
194- * we're already at zero, discard this hit
195- */
196- goto out;
197- }
198-
199 nlh = (struct nlmsghdr *)dskb->data;
200 nla = genlmsg_data(nlmsg_data(nlh));
201 msg = nla_data(nla);
202@@ -189,7 +155,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
203 goto out;
204 }
205 }
206-
207+ if (msg->entries == dm_hit_limit)
208+ goto out;
209 /*
210 * We need to create a new entry
211 */
212@@ -201,13 +168,11 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
213
214 if (!timer_pending(&data->send_timer)) {
215 data->send_timer.expires = jiffies + dm_delay * HZ;
216- add_timer_on(&data->send_timer, smp_processor_id());
217+ add_timer(&data->send_timer);
218 }
219
220 out:
221- rcu_read_unlock();
222- put_cpu_var(dm_cpu_data);
223- return;
224+ spin_unlock_irqrestore(&data->lock, flags);
225 }
226
227 static void trace_kfree_skb_hit(void *ignore, struct sk_buff *skb, void *location)
228@@ -405,11 +370,11 @@ static int __init init_net_drop_monitor(void)
229
230 for_each_present_cpu(cpu) {
231 data = &per_cpu(dm_cpu_data, cpu);
232- data->cpu = cpu;
233 INIT_WORK(&data->dm_alert_work, send_dm_alert);
234 init_timer(&data->send_timer);
235- data->send_timer.data = cpu;
236+ data->send_timer.data = (unsigned long)data;
237 data->send_timer.function = sched_send_work;
238+ spin_lock_init(&data->lock);
239 reset_per_cpu_data(data);
240 }
241
242--
2431.7.7.6
244
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0067-pch_uart-Fix-missing-break-for-16-byte-fifo.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0067-pch_uart-Fix-missing-break-for-16-byte-fifo.patch
new file mode 100644
index 00000000..54f82b52
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0067-pch_uart-Fix-missing-break-for-16-byte-fifo.patch
@@ -0,0 +1,33 @@
1From 3cae39d521ecb047ef935280fff8eac467b2b8ce Mon Sep 17 00:00:00 2001
2From: Alan Cox <alan@linux.intel.com>
3Date: Mon, 2 Jul 2012 18:51:38 +0100
4Subject: [PATCH 67/70] pch_uart: Fix missing break for 16 byte fifo
5
6commit 9bc03743fff0770dc5a5324ba92e67cc377f16ca upstream.
7
8Otherwise we fall back to the wrong value.
9
10Reported-by: <dcb314@hotmail.com>
11Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44091
12Signed-off-by: Alan Cox <alan@linux.intel.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 drivers/tty/serial/pch_uart.c | 1 +
17 1 files changed, 1 insertions(+), 0 deletions(-)
18
19diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
20index a4b192d..5ad5040 100644
21--- a/drivers/tty/serial/pch_uart.c
22+++ b/drivers/tty/serial/pch_uart.c
23@@ -1163,6 +1163,7 @@ static int pch_uart_startup(struct uart_port *port)
24 break;
25 case 16:
26 fifo_size = PCH_UART_HAL_FIFO16;
27+ break;
28 case 1:
29 default:
30 fifo_size = PCH_UART_HAL_FIFO_DIS;
31--
321.7.7.6
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0068-pch_uart-Fix-rx-error-interrupt-setting-issue.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0068-pch_uart-Fix-rx-error-interrupt-setting-issue.patch
new file mode 100644
index 00000000..010bf8cb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0068-pch_uart-Fix-rx-error-interrupt-setting-issue.patch
@@ -0,0 +1,85 @@
1From 5e59a1ea39747dfffd111ac418cb27de4047363a Mon Sep 17 00:00:00 2001
2From: Tomoya MORINAGA <tomoya.rohm@gmail.com>
3Date: Fri, 6 Jul 2012 17:19:42 +0900
4Subject: [PATCH 68/70] pch_uart: Fix rx error interrupt setting issue
5
6commit 9539dfb7ac1c84522fe1f79bb7dac2990f3de44a upstream.
7
8Rx Error interrupt(E.G. parity error) is not enabled.
9So, when parity error occurs, error interrupt is not occurred.
10As a result, the received data is not dropped.
11
12This patch adds enable/disable rx error interrupt code.
13
14Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
15Acked-by: Alan Cox <alan@linux.intel.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17[Backported by Tomoya MORINGA: adjusted context]
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 drivers/tty/serial/pch_uart.c | 18 ++++++++++++------
21 1 files changed, 12 insertions(+), 6 deletions(-)
22
23diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
24index 5ad5040..82f5760 100644
25--- a/drivers/tty/serial/pch_uart.c
26+++ b/drivers/tty/serial/pch_uart.c
27@@ -660,7 +660,8 @@ static void pch_dma_rx_complete(void *arg)
28 tty_flip_buffer_push(tty);
29 tty_kref_put(tty);
30 async_tx_ack(priv->desc_rx);
31- pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT);
32+ pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT |
33+ PCH_UART_HAL_RX_ERR_INT);
34 }
35
36 static void pch_dma_tx_complete(void *arg)
37@@ -715,7 +716,8 @@ static int handle_rx_to(struct eg20t_port *priv)
38 int rx_size;
39 int ret;
40 if (!priv->start_rx) {
41- pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT);
42+ pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT |
43+ PCH_UART_HAL_RX_ERR_INT);
44 return 0;
45 }
46 buf = &priv->rxbuf;
47@@ -977,11 +979,13 @@ static irqreturn_t pch_uart_interrupt(int irq, void *dev_id)
48 case PCH_UART_IID_RDR: /* Received Data Ready */
49 if (priv->use_dma) {
50 pch_uart_hal_disable_interrupt(priv,
51- PCH_UART_HAL_RX_INT);
52+ PCH_UART_HAL_RX_INT |
53+ PCH_UART_HAL_RX_ERR_INT);
54 ret = dma_handle_rx(priv);
55 if (!ret)
56 pch_uart_hal_enable_interrupt(priv,
57- PCH_UART_HAL_RX_INT);
58+ PCH_UART_HAL_RX_INT |
59+ PCH_UART_HAL_RX_ERR_INT);
60 } else {
61 ret = handle_rx(priv);
62 }
63@@ -1107,7 +1111,8 @@ static void pch_uart_stop_rx(struct uart_port *port)
64 struct eg20t_port *priv;
65 priv = container_of(port, struct eg20t_port, port);
66 priv->start_rx = 0;
67- pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT);
68+ pch_uart_hal_disable_interrupt(priv, PCH_UART_HAL_RX_INT |
69+ PCH_UART_HAL_RX_ERR_INT);
70 priv->int_dis_flag = 1;
71 }
72
73@@ -1201,7 +1206,8 @@ static int pch_uart_startup(struct uart_port *port)
74 pch_request_dma(port);
75
76 priv->start_rx = 1;
77- pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT);
78+ pch_uart_hal_enable_interrupt(priv, PCH_UART_HAL_RX_INT |
79+ PCH_UART_HAL_RX_ERR_INT);
80 uart_update_timeout(port, CS8, default_baud);
81
82 return 0;
83--
841.7.7.6
85
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0069-pch_uart-Fix-parity-setting-issue.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0069-pch_uart-Fix-parity-setting-issue.patch
new file mode 100644
index 00000000..345038c2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0069-pch_uart-Fix-parity-setting-issue.patch
@@ -0,0 +1,35 @@
1From 60811100a88284132fb0d48f99305e87f8c74d0f Mon Sep 17 00:00:00 2001
2From: Tomoya MORINAGA <tomoya.rohm@gmail.com>
3Date: Fri, 6 Jul 2012 17:19:43 +0900
4Subject: [PATCH 69/70] pch_uart: Fix parity setting issue
5
6commit 38bd2a1ac736901d1cf4971c78ef952ba92ef78b upstream.
7
8Parity Setting value is reverse.
9E.G. In case of setting ODD parity, EVEN value is set.
10This patch inverts "if" condition.
11
12Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com>
13Acked-by: Alan Cox <alan@linux.intel.com>
14Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 drivers/tty/serial/pch_uart.c | 2 +-
18 1 files changed, 1 insertions(+), 1 deletions(-)
19
20diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
21index 82f5760..08b92a6 100644
22--- a/drivers/tty/serial/pch_uart.c
23+++ b/drivers/tty/serial/pch_uart.c
24@@ -1265,7 +1265,7 @@ static void pch_uart_set_termios(struct uart_port *port,
25 stb = PCH_UART_HAL_STB1;
26
27 if (termios->c_cflag & PARENB) {
28- if (!(termios->c_cflag & PARODD))
29+ if (termios->c_cflag & PARODD)
30 parity = PCH_UART_HAL_PARITY_ODD;
31 else
32 parity = PCH_UART_HAL_PARITY_EVEN;
33--
341.7.7.6
35
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0070-Linux-3.2.27.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0070-Linux-3.2.27.patch
new file mode 100644
index 00000000..6d3fce00
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.27/0070-Linux-3.2.27.patch
@@ -0,0 +1,24 @@
1From 1ff662dfc66fa1db58460d0cf92c1900095f7f0c Mon Sep 17 00:00:00 2001
2From: Ben Hutchings <ben@decadent.org.uk>
3Date: Fri, 10 Aug 2012 00:25:22 +0100
4Subject: [PATCH 70/70] Linux 3.2.27
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index fa5acc83..bdf851f 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 26
18+SUBLEVEL = 27
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.6
24
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0001-bnx2-Fix-bug-in-bnx2_free_tx_skbs.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0001-bnx2-Fix-bug-in-bnx2_free_tx_skbs.patch
new file mode 100644
index 00000000..83af235e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0001-bnx2-Fix-bug-in-bnx2_free_tx_skbs.patch
@@ -0,0 +1,47 @@
1From ac01c6d147d4570eba977bd3d0632732231bcf8b Mon Sep 17 00:00:00 2001
2From: Michael Chan <mchan@broadcom.com>
3Date: Tue, 10 Jul 2012 10:04:40 +0000
4Subject: [PATCH 01/38] bnx2: Fix bug in bnx2_free_tx_skbs().
5
6[ Upstream commit c1f5163de417dab01fa9daaf09a74bbb19303f3c ]
7
8In rare cases, bnx2x_free_tx_skbs() can unmap the wrong DMA address
9when it gets to the last entry of the tx ring. We were not using
10the proper macro to skip the last entry when advancing the tx index.
11
12Reported-by: Zongyun Lai <zlai@vmware.com>
13Reviewed-by: Jeffrey Huang <huangjw@broadcom.com>
14Signed-off-by: Michael Chan <mchan@broadcom.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 drivers/net/ethernet/broadcom/bnx2.c | 6 +++---
19 1 files changed, 3 insertions(+), 3 deletions(-)
20
21diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
22index 965c723..721adfd 100644
23--- a/drivers/net/ethernet/broadcom/bnx2.c
24+++ b/drivers/net/ethernet/broadcom/bnx2.c
25@@ -5378,7 +5378,7 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
26 int k, last;
27
28 if (skb == NULL) {
29- j++;
30+ j = NEXT_TX_BD(j);
31 continue;
32 }
33
34@@ -5390,8 +5390,8 @@ bnx2_free_tx_skbs(struct bnx2 *bp)
35 tx_buf->skb = NULL;
36
37 last = tx_buf->nr_frags;
38- j++;
39- for (k = 0; k < last; k++, j++) {
40+ j = NEXT_TX_BD(j);
41+ for (k = 0; k < last; k++, j = NEXT_TX_BD(j)) {
42 tx_buf = &txr->tx_buf_ring[TX_RING_IDX(j)];
43 dma_unmap_page(&bp->pdev->dev,
44 dma_unmap_addr(tx_buf, mapping),
45--
461.7.7.6
47
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0002-sch_sfb-Fix-missing-NULL-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0002-sch_sfb-Fix-missing-NULL-check.patch
new file mode 100644
index 00000000..480f1b80
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0002-sch_sfb-Fix-missing-NULL-check.patch
@@ -0,0 +1,33 @@
1From 9404ab928af493a8793024335d18ad8151f114c3 Mon Sep 17 00:00:00 2001
2From: Alan Cox <alan@linux.intel.com>
3Date: Thu, 12 Jul 2012 03:39:11 +0000
4Subject: [PATCH 02/38] sch_sfb: Fix missing NULL check
5
6[ Upstream commit 7ac2908e4b2edaec60e9090ddb4d9ceb76c05e7d ]
7
8Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=44461
9
10Signed-off-by: Alan Cox <alan@linux.intel.com>
11Acked-by: Eric Dumazet <edumazet@google.com>
12Signed-off-by: David S. Miller <davem@davemloft.net>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 net/sched/sch_sfb.c | 2 ++
16 1 files changed, 2 insertions(+), 0 deletions(-)
17
18diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
19index 17859ea..351a69b 100644
20--- a/net/sched/sch_sfb.c
21+++ b/net/sched/sch_sfb.c
22@@ -559,6 +559,8 @@ static int sfb_dump(struct Qdisc *sch, struct sk_buff *skb)
23
24 sch->qstats.backlog = q->qdisc->qstats.backlog;
25 opts = nla_nest_start(skb, TCA_OPTIONS);
26+ if (opts == NULL)
27+ goto nla_put_failure;
28 NLA_PUT(skb, TCA_SFB_PARMS, sizeof(opt), &opt);
29 return nla_nest_end(skb, opts);
30
31--
321.7.7.6
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0003-sctp-Fix-list-corruption-resulting-from-freeing-an-a.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0003-sctp-Fix-list-corruption-resulting-from-freeing-an-a.patch
new file mode 100644
index 00000000..f1291c06
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0003-sctp-Fix-list-corruption-resulting-from-freeing-an-a.patch
@@ -0,0 +1,188 @@
1From e7ccb3dde4457e701c4ec1a77e7728e180c57526 Mon Sep 17 00:00:00 2001
2From: Neil Horman <nhorman@tuxdriver.com>
3Date: Mon, 16 Jul 2012 09:13:51 +0000
4Subject: [PATCH 03/38] sctp: Fix list corruption resulting from freeing an
5 association on a list
6
7[ Upstream commit 2eebc1e188e9e45886ee00662519849339884d6d ]
8
9A few days ago Dave Jones reported this oops:
10
11[22766.294255] general protection fault: 0000 [#1] PREEMPT SMP
12[22766.295376] CPU 0
13[22766.295384] Modules linked in:
14[22766.387137] ffffffffa169f292 6b6b6b6b6b6b6b6b ffff880147c03a90
15ffff880147c03a74
16[22766.387135] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 00000000000
17[22766.387136] Process trinity-watchdo (pid: 10896, threadinfo ffff88013e7d2000,
18[22766.387137] Stack:
19[22766.387140] ffff880147c03a10
20[22766.387140] ffffffffa169f2b6
21[22766.387140] ffff88013ed95728
22[22766.387143] 0000000000000002
23[22766.387143] 0000000000000000
24[22766.387143] ffff880003fad062
25[22766.387144] ffff88013c120000
26[22766.387144]
27[22766.387145] Call Trace:
28[22766.387145] <IRQ>
29[22766.387150] [<ffffffffa169f292>] ? __sctp_lookup_association+0x62/0xd0
30[sctp]
31[22766.387154] [<ffffffffa169f2b6>] __sctp_lookup_association+0x86/0xd0 [sctp]
32[22766.387157] [<ffffffffa169f597>] sctp_rcv+0x207/0xbb0 [sctp]
33[22766.387161] [<ffffffff810d4da8>] ? trace_hardirqs_off_caller+0x28/0xd0
34[22766.387163] [<ffffffff815827e3>] ? nf_hook_slow+0x133/0x210
35[22766.387166] [<ffffffff815902fc>] ? ip_local_deliver_finish+0x4c/0x4c0
36[22766.387168] [<ffffffff8159043d>] ip_local_deliver_finish+0x18d/0x4c0
37[22766.387169] [<ffffffff815902fc>] ? ip_local_deliver_finish+0x4c/0x4c0
38[22766.387171] [<ffffffff81590a07>] ip_local_deliver+0x47/0x80
39[22766.387172] [<ffffffff8158fd80>] ip_rcv_finish+0x150/0x680
40[22766.387174] [<ffffffff81590c54>] ip_rcv+0x214/0x320
41[22766.387176] [<ffffffff81558c07>] __netif_receive_skb+0x7b7/0x910
42[22766.387178] [<ffffffff8155856c>] ? __netif_receive_skb+0x11c/0x910
43[22766.387180] [<ffffffff810d423e>] ? put_lock_stats.isra.25+0xe/0x40
44[22766.387182] [<ffffffff81558f83>] netif_receive_skb+0x23/0x1f0
45[22766.387183] [<ffffffff815596a9>] ? dev_gro_receive+0x139/0x440
46[22766.387185] [<ffffffff81559280>] napi_skb_finish+0x70/0xa0
47[22766.387187] [<ffffffff81559cb5>] napi_gro_receive+0xf5/0x130
48[22766.387218] [<ffffffffa01c4679>] e1000_receive_skb+0x59/0x70 [e1000e]
49[22766.387242] [<ffffffffa01c5aab>] e1000_clean_rx_irq+0x28b/0x460 [e1000e]
50[22766.387266] [<ffffffffa01c9c18>] e1000e_poll+0x78/0x430 [e1000e]
51[22766.387268] [<ffffffff81559fea>] net_rx_action+0x1aa/0x3d0
52[22766.387270] [<ffffffff810a495f>] ? account_system_vtime+0x10f/0x130
53[22766.387273] [<ffffffff810734d0>] __do_softirq+0xe0/0x420
54[22766.387275] [<ffffffff8169826c>] call_softirq+0x1c/0x30
55[22766.387278] [<ffffffff8101db15>] do_softirq+0xd5/0x110
56[22766.387279] [<ffffffff81073bc5>] irq_exit+0xd5/0xe0
57[22766.387281] [<ffffffff81698b03>] do_IRQ+0x63/0xd0
58[22766.387283] [<ffffffff8168ee2f>] common_interrupt+0x6f/0x6f
59[22766.387283] <EOI>
60[22766.387284]
61[22766.387285] [<ffffffff8168eed9>] ? retint_swapgs+0x13/0x1b
62[22766.387285] Code: c0 90 5d c3 66 0f 1f 44 00 00 4c 89 c8 5d c3 0f 1f 00 55 48
6389 e5 48 83
64ec 20 48 89 5d e8 4c 89 65 f0 4c 89 6d f8 66 66 66 66 90 <0f> b7 87 98 00 00 00
6548 89 fb
6649 89 f5 66 c1 c0 08 66 39 46 02
67[22766.387307]
68[22766.387307] RIP
69[22766.387311] [<ffffffffa168a2c9>] sctp_assoc_is_match+0x19/0x90 [sctp]
70[22766.387311] RSP <ffff880147c039b0>
71[22766.387142] ffffffffa16ab120
72[22766.599537] ---[ end trace 3f6dae82e37b17f5 ]---
73[22766.601221] Kernel panic - not syncing: Fatal exception in interrupt
74
75It appears from his analysis and some staring at the code that this is likely
76occuring because an association is getting freed while still on the
77sctp_assoc_hashtable. As a result, we get a gpf when traversing the hashtable
78while a freed node corrupts part of the list.
79
80Nominally I would think that an mibalanced refcount was responsible for this,
81but I can't seem to find any obvious imbalance. What I did note however was
82that the two places where we create an association using
83sctp_primitive_ASSOCIATE (__sctp_connect and sctp_sendmsg), have failure paths
84which free a newly created association after calling sctp_primitive_ASSOCIATE.
85sctp_primitive_ASSOCIATE brings us into the sctp_sf_do_prm_asoc path, which
86issues a SCTP_CMD_NEW_ASOC side effect, which in turn adds a new association to
87the aforementioned hash table. the sctp command interpreter that process side
88effects has not way to unwind previously processed commands, so freeing the
89association from the __sctp_connect or sctp_sendmsg error path would lead to a
90freed association remaining on this hash table.
91
92I've fixed this but modifying sctp_[un]hash_established to use hlist_del_init,
93which allows us to proerly use hlist_unhashed to check if the node is on a
94hashlist safely during a delete. That in turn alows us to safely call
95sctp_unhash_established in the __sctp_connect and sctp_sendmsg error paths
96before freeing them, regardles of what the associations state is on the hash
97list.
98
99I noted, while I was doing this, that the __sctp_unhash_endpoint was using
100hlist_unhsashed in a simmilar fashion, but never nullified any removed nodes
101pointers to make that function work properly, so I fixed that up in a simmilar
102fashion.
103
104I attempted to test this using a virtual guest running the SCTP_RR test from
105netperf in a loop while running the trinity fuzzer, both in a loop. I wasn't
106able to recreate the problem prior to this fix, nor was I able to trigger the
107failure after (neither of which I suppose is suprising). Given the trace above
108however, I think its likely that this is what we hit.
109
110Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
111Reported-by: davej@redhat.com
112CC: davej@redhat.com
113CC: "David S. Miller" <davem@davemloft.net>
114CC: Vlad Yasevich <vyasevich@gmail.com>
115CC: Sridhar Samudrala <sri@us.ibm.com>
116CC: linux-sctp@vger.kernel.org
117Signed-off-by: David S. Miller <davem@davemloft.net>
118Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
119---
120 net/sctp/input.c | 7 ++-----
121 net/sctp/socket.c | 12 ++++++++++--
122 2 files changed, 12 insertions(+), 7 deletions(-)
123
124diff --git a/net/sctp/input.c b/net/sctp/input.c
125index b7692aa..0fc18c7 100644
126--- a/net/sctp/input.c
127+++ b/net/sctp/input.c
128@@ -736,15 +736,12 @@ static void __sctp_unhash_endpoint(struct sctp_endpoint *ep)
129
130 epb = &ep->base;
131
132- if (hlist_unhashed(&epb->node))
133- return;
134-
135 epb->hashent = sctp_ep_hashfn(epb->bind_addr.port);
136
137 head = &sctp_ep_hashtable[epb->hashent];
138
139 sctp_write_lock(&head->lock);
140- __hlist_del(&epb->node);
141+ hlist_del_init(&epb->node);
142 sctp_write_unlock(&head->lock);
143 }
144
145@@ -825,7 +822,7 @@ static void __sctp_unhash_established(struct sctp_association *asoc)
146 head = &sctp_assoc_hashtable[epb->hashent];
147
148 sctp_write_lock(&head->lock);
149- __hlist_del(&epb->node);
150+ hlist_del_init(&epb->node);
151 sctp_write_unlock(&head->lock);
152 }
153
154diff --git a/net/sctp/socket.c b/net/sctp/socket.c
155index 0075554..8e49d76 100644
156--- a/net/sctp/socket.c
157+++ b/net/sctp/socket.c
158@@ -1231,8 +1231,14 @@ out_free:
159 SCTP_DEBUG_PRINTK("About to exit __sctp_connect() free asoc: %p"
160 " kaddrs: %p err: %d\n",
161 asoc, kaddrs, err);
162- if (asoc)
163+ if (asoc) {
164+ /* sctp_primitive_ASSOCIATE may have added this association
165+ * To the hash table, try to unhash it, just in case, its a noop
166+ * if it wasn't hashed so we're safe
167+ */
168+ sctp_unhash_established(asoc);
169 sctp_association_free(asoc);
170+ }
171 return err;
172 }
173
174@@ -1942,8 +1948,10 @@ SCTP_STATIC int sctp_sendmsg(struct kiocb *iocb, struct sock *sk,
175 goto out_unlock;
176
177 out_free:
178- if (new_asoc)
179+ if (new_asoc) {
180+ sctp_unhash_established(asoc);
181 sctp_association_free(asoc);
182+ }
183 out_unlock:
184 sctp_release_sock(sk);
185
186--
1871.7.7.6
188
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0004-caif-Fix-access-to-freed-pernet-memory.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0004-caif-Fix-access-to-freed-pernet-memory.patch
new file mode 100644
index 00000000..d9746204
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0004-caif-Fix-access-to-freed-pernet-memory.patch
@@ -0,0 +1,52 @@
1From b86789c525a7fc1e9cae59eb21bc0138f89ba8c3 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Sjur=20Br=C3=A6ndeland?= <sjur.brandeland@stericsson.com>
3Date: Sun, 15 Jul 2012 10:10:14 +0000
4Subject: [PATCH 04/38] caif: Fix access to freed pernet memory
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9[ Upstream commit 96f80d123eff05c3cd4701463786b87952a6c3ac ]
10
11unregister_netdevice_notifier() must be called before
12unregister_pernet_subsys() to avoid accessing already freed
13pernet memory. This fixes the following oops when doing rmmod:
14
15Call Trace:
16 [<ffffffffa0f802bd>] caif_device_notify+0x4d/0x5a0 [caif]
17 [<ffffffff81552ba9>] unregister_netdevice_notifier+0xb9/0x100
18 [<ffffffffa0f86dcc>] caif_device_exit+0x1c/0x250 [caif]
19 [<ffffffff810e7734>] sys_delete_module+0x1a4/0x300
20 [<ffffffff810da82d>] ? trace_hardirqs_on_caller+0x15d/0x1e0
21 [<ffffffff813517de>] ? trace_hardirqs_on_thunk+0x3a/0x3
22 [<ffffffff81696bad>] system_call_fastpath+0x1a/0x1f
23
24RIP
25 [<ffffffffa0f7f561>] caif_get+0x51/0xb0 [caif]
26
27Signed-off-by: Sjur Brændeland <sjur.brandeland@stericsson.com>
28Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
29Signed-off-by: David S. Miller <davem@davemloft.net>
30Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
31---
32 net/caif/caif_dev.c | 2 +-
33 1 files changed, 1 insertions(+), 1 deletions(-)
34
35diff --git a/net/caif/caif_dev.c b/net/caif/caif_dev.c
36index 68223e4..4e9115d 100644
37--- a/net/caif/caif_dev.c
38+++ b/net/caif/caif_dev.c
39@@ -428,9 +428,9 @@ static int __init caif_device_init(void)
40
41 static void __exit caif_device_exit(void)
42 {
43- unregister_pernet_subsys(&caif_net_ops);
44 unregister_netdevice_notifier(&caif_device_notifier);
45 dev_remove_pack(&caif_packet_type);
46+ unregister_pernet_subsys(&caif_net_ops);
47 }
48
49 module_init(caif_device_init);
50--
511.7.7.6
52
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0005-cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0005-cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch
new file mode 100644
index 00000000..ee4d3cc2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0005-cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch
@@ -0,0 +1,95 @@
1From 6037d0b798b22b0b0be2a95c65e629b5532884a2 Mon Sep 17 00:00:00 2001
2From: Paul Moore <pmoore@redhat.com>
3Date: Tue, 17 Jul 2012 11:07:47 +0000
4Subject: [PATCH 05/38] cipso: don't follow a NULL pointer when setsockopt()
5 is called
6
7[ Upstream commit 89d7ae34cdda4195809a5a987f697a517a2a3177 ]
8
9As reported by Alan Cox, and verified by Lin Ming, when a user
10attempts to add a CIPSO option to a socket using the CIPSO_V4_TAG_LOCAL
11tag the kernel dies a terrible death when it attempts to follow a NULL
12pointer (the skb argument to cipso_v4_validate() is NULL when called via
13the setsockopt() syscall).
14
15This patch fixes this by first checking to ensure that the skb is
16non-NULL before using it to find the incoming network interface. In
17the unlikely case where the skb is NULL and the user attempts to add
18a CIPSO option with the _TAG_LOCAL tag we return an error as this is
19not something we want to allow.
20
21A simple reproducer, kindly supplied by Lin Ming, although you must
22have the CIPSO DOI #3 configure on the system first or you will be
23caught early in cipso_v4_validate():
24
25 #include <sys/types.h>
26 #include <sys/socket.h>
27 #include <linux/ip.h>
28 #include <linux/in.h>
29 #include <string.h>
30
31 struct local_tag {
32 char type;
33 char length;
34 char info[4];
35 };
36
37 struct cipso {
38 char type;
39 char length;
40 char doi[4];
41 struct local_tag local;
42 };
43
44 int main(int argc, char **argv)
45 {
46 int sockfd;
47 struct cipso cipso = {
48 .type = IPOPT_CIPSO,
49 .length = sizeof(struct cipso),
50 .local = {
51 .type = 128,
52 .length = sizeof(struct local_tag),
53 },
54 };
55
56 memset(cipso.doi, 0, 4);
57 cipso.doi[3] = 3;
58
59 sockfd = socket(AF_INET, SOCK_DGRAM, 0);
60 #define SOL_IP 0
61 setsockopt(sockfd, SOL_IP, IP_OPTIONS,
62 &cipso, sizeof(struct cipso));
63
64 return 0;
65 }
66
67CC: Lin Ming <mlin@ss.pku.edu.cn>
68Reported-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
69Signed-off-by: Paul Moore <pmoore@redhat.com>
70Signed-off-by: David S. Miller <davem@davemloft.net>
71Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
72---
73 net/ipv4/cipso_ipv4.c | 6 ++++--
74 1 files changed, 4 insertions(+), 2 deletions(-)
75
76diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c
77index 86f3b88..afaa735 100644
78--- a/net/ipv4/cipso_ipv4.c
79+++ b/net/ipv4/cipso_ipv4.c
80@@ -1725,8 +1725,10 @@ int cipso_v4_validate(const struct sk_buff *skb, unsigned char **option)
81 case CIPSO_V4_TAG_LOCAL:
82 /* This is a non-standard tag that we only allow for
83 * local connections, so if the incoming interface is
84- * not the loopback device drop the packet. */
85- if (!(skb->dev->flags & IFF_LOOPBACK)) {
86+ * not the loopback device drop the packet. Further,
87+ * there is no legitimate reason for setting this from
88+ * userspace so reject it if skb is NULL. */
89+ if (skb == NULL || !(skb->dev->flags & IFF_LOOPBACK)) {
90 err_offset = opt_iter;
91 goto validate_return_locked;
92 }
93--
941.7.7.6
95
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0006-caif-fix-NULL-pointer-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0006-caif-fix-NULL-pointer-check.patch
new file mode 100644
index 00000000..b83525e4
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0006-caif-fix-NULL-pointer-check.patch
@@ -0,0 +1,33 @@
1From 074a6a80582984a2cf5fb8f62225bbd9cd314434 Mon Sep 17 00:00:00 2001
2From: Alan Cox <alan@linux.intel.com>
3Date: Tue, 24 Jul 2012 02:42:14 +0000
4Subject: [PATCH 06/38] caif: fix NULL pointer check
5
6[ Upstream commit c66b9b7d365444b433307ebb18734757cb668a02 ]
7
8Reported-by: <rucsoftsec@gmail.com>
9Resolves-bug: http://bugzilla.kernel.org/show_bug?44441
10Signed-off-by: Alan Cox <alan@linux.intel.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13---
14 drivers/net/caif/caif_serial.c | 3 +++
15 1 files changed, 3 insertions(+), 0 deletions(-)
16
17diff --git a/drivers/net/caif/caif_serial.c b/drivers/net/caif/caif_serial.c
18index 23406e6..ae286a9 100644
19--- a/drivers/net/caif/caif_serial.c
20+++ b/drivers/net/caif/caif_serial.c
21@@ -325,6 +325,9 @@ static int ldisc_open(struct tty_struct *tty)
22
23 sprintf(name, "cf%s", tty->name);
24 dev = alloc_netdev(sizeof(*ser), name, caifdev_setup);
25+ if (!dev)
26+ return -ENOMEM;
27+
28 ser = netdev_priv(dev);
29 ser->tty = tty_kref_get(tty);
30 ser->dev = dev;
31--
321.7.7.6
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0007-wanmain-comparing-array-with-NULL.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0007-wanmain-comparing-array-with-NULL.patch
new file mode 100644
index 00000000..15348035
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0007-wanmain-comparing-array-with-NULL.patch
@@ -0,0 +1,83 @@
1From ed8467f422e2d17a05fbe02b149780199a683d11 Mon Sep 17 00:00:00 2001
2From: Alan Cox <alan@linux.intel.com>
3Date: Tue, 24 Jul 2012 08:16:25 +0000
4Subject: [PATCH 07/38] wanmain: comparing array with NULL
5
6[ Upstream commit 8b72ff6484fe303e01498b58621810a114f3cf09 ]
7
8gcc really should warn about these !
9
10Signed-off-by: Alan Cox <alan@linux.intel.com>
11Signed-off-by: David S. Miller <davem@davemloft.net>
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13---
14 net/wanrouter/wanmain.c | 51 +++++++++++++++++++++-------------------------
15 1 files changed, 23 insertions(+), 28 deletions(-)
16
17diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c
18index 788a12c..2ab7850 100644
19--- a/net/wanrouter/wanmain.c
20+++ b/net/wanrouter/wanmain.c
21@@ -602,36 +602,31 @@ static int wanrouter_device_new_if(struct wan_device *wandev,
22 * successfully, add it to the interface list.
23 */
24
25- if (dev->name == NULL) {
26- err = -EINVAL;
27- } else {
28+#ifdef WANDEBUG
29+ printk(KERN_INFO "%s: registering interface %s...\n",
30+ wanrouter_modname, dev->name);
31+#endif
32
33- #ifdef WANDEBUG
34- printk(KERN_INFO "%s: registering interface %s...\n",
35- wanrouter_modname, dev->name);
36- #endif
37-
38- err = register_netdev(dev);
39- if (!err) {
40- struct net_device *slave = NULL;
41- unsigned long smp_flags=0;
42-
43- lock_adapter_irq(&wandev->lock, &smp_flags);
44-
45- if (wandev->dev == NULL) {
46- wandev->dev = dev;
47- } else {
48- for (slave=wandev->dev;
49- DEV_TO_SLAVE(slave);
50- slave = DEV_TO_SLAVE(slave))
51- DEV_TO_SLAVE(slave) = dev;
52- }
53- ++wandev->ndev;
54-
55- unlock_adapter_irq(&wandev->lock, &smp_flags);
56- err = 0; /* done !!! */
57- goto out;
58+ err = register_netdev(dev);
59+ if (!err) {
60+ struct net_device *slave = NULL;
61+ unsigned long smp_flags=0;
62+
63+ lock_adapter_irq(&wandev->lock, &smp_flags);
64+
65+ if (wandev->dev == NULL) {
66+ wandev->dev = dev;
67+ } else {
68+ for (slave=wandev->dev;
69+ DEV_TO_SLAVE(slave);
70+ slave = DEV_TO_SLAVE(slave))
71+ DEV_TO_SLAVE(slave) = dev;
72 }
73+ ++wandev->ndev;
74+
75+ unlock_adapter_irq(&wandev->lock, &smp_flags);
76+ err = 0; /* done !!! */
77+ goto out;
78 }
79 if (wandev->del_if)
80 wandev->del_if(wandev, dev);
81--
821.7.7.6
83
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0008-tcp-Add-TCP_USER_TIMEOUT-negative-value-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0008-tcp-Add-TCP_USER_TIMEOUT-negative-value-check.patch
new file mode 100644
index 00000000..c2a2ae2d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0008-tcp-Add-TCP_USER_TIMEOUT-negative-value-check.patch
@@ -0,0 +1,39 @@
1From 24be4ad08d43124b8146baeaf2e0ea04beaeedc4 Mon Sep 17 00:00:00 2001
2From: Hangbin Liu <liuhangbin@gmail.com>
3Date: Thu, 26 Jul 2012 22:52:21 +0000
4Subject: [PATCH 08/38] tcp: Add TCP_USER_TIMEOUT negative value check
5
6[ Upstream commit 42493570100b91ef663c4c6f0c0fdab238f9d3c2 ]
7
8TCP_USER_TIMEOUT is a TCP level socket option that takes an unsigned int. But
9patch "tcp: Add TCP_USER_TIMEOUT socket option"(dca43c75) didn't check the negative
10values. If a user assign -1 to it, the socket will set successfully and wait
11for 4294967295 miliseconds. This patch add a negative value check to avoid
12this issue.
13
14Signed-off-by: Hangbin Liu <liuhangbin@gmail.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
17---
18 net/ipv4/tcp.c | 5 ++++-
19 1 files changed, 4 insertions(+), 1 deletions(-)
20
21diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
22index 11ba922..ad466a7 100644
23--- a/net/ipv4/tcp.c
24+++ b/net/ipv4/tcp.c
25@@ -2391,7 +2391,10 @@ static int do_tcp_setsockopt(struct sock *sk, int level,
26 /* Cap the max timeout in ms TCP will retry/retrans
27 * before giving up and aborting (ETIMEDOUT) a connection.
28 */
29- icsk->icsk_user_timeout = msecs_to_jiffies(val);
30+ if (val < 0)
31+ err = -EINVAL;
32+ else
33+ icsk->icsk_user_timeout = msecs_to_jiffies(val);
34 break;
35 default:
36 err = -ENOPROTOOPT;
37--
381.7.7.6
39
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0009-USB-kaweth.c-use-GFP_ATOMIC-under-spin_lock.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0009-USB-kaweth.c-use-GFP_ATOMIC-under-spin_lock.patch
new file mode 100644
index 00000000..aa27cd58
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0009-USB-kaweth.c-use-GFP_ATOMIC-under-spin_lock.patch
@@ -0,0 +1,40 @@
1From 0ffa373b3d400c24d958e623a99a276c4a5e25db Mon Sep 17 00:00:00 2001
2From: Dan Carpenter <dan.carpenter@oracle.com>
3Date: Fri, 27 Jul 2012 01:46:51 +0000
4Subject: [PATCH 09/38] USB: kaweth.c: use GFP_ATOMIC under spin_lock
5
6[ Upstream commit e4c7f259c5be99dcfc3d98f913590663b0305bf8 ]
7
8The problem is that we call this with a spin lock held. The call tree
9is:
10 kaweth_start_xmit() holds kaweth->device_lock.
11 -> kaweth_async_set_rx_mode()
12 -> kaweth_control()
13 -> kaweth_internal_control_msg()
14
15The kaweth_internal_control_msg() function is only called from
16kaweth_control() which used GFP_ATOMIC for its allocations.
17
18Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
21---
22 drivers/net/usb/kaweth.c | 2 +-
23 1 files changed, 1 insertions(+), 1 deletions(-)
24
25diff --git a/drivers/net/usb/kaweth.c b/drivers/net/usb/kaweth.c
26index 582ca2d..c4c6a73 100644
27--- a/drivers/net/usb/kaweth.c
28+++ b/drivers/net/usb/kaweth.c
29@@ -1308,7 +1308,7 @@ static int kaweth_internal_control_msg(struct usb_device *usb_dev,
30 int retv;
31 int length = 0; /* shut up GCC */
32
33- urb = usb_alloc_urb(0, GFP_NOIO);
34+ urb = usb_alloc_urb(0, GFP_ATOMIC);
35 if (!urb)
36 return -ENOMEM;
37
38--
391.7.7.6
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0010-net-fix-rtnetlink-IFF_PROMISC-and-IFF_ALLMULTI-handl.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0010-net-fix-rtnetlink-IFF_PROMISC-and-IFF_ALLMULTI-handl.patch
new file mode 100644
index 00000000..b662f1a0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0010-net-fix-rtnetlink-IFF_PROMISC-and-IFF_ALLMULTI-handl.patch
@@ -0,0 +1,60 @@
1From 10bd72dd5d3631b8058ef86bfbb64d5176477dc7 Mon Sep 17 00:00:00 2001
2From: Jiri Benc <jbenc@redhat.com>
3Date: Fri, 27 Jul 2012 02:58:22 +0000
4Subject: [PATCH 10/38] net: fix rtnetlink IFF_PROMISC and IFF_ALLMULTI
5 handling
6
7[ Upstream commit b1beb681cba5358f62e6187340660ade226a5fcc ]
8
9When device flags are set using rtnetlink, IFF_PROMISC and IFF_ALLMULTI
10flags are handled specially. Function dev_change_flags sets IFF_PROMISC and
11IFF_ALLMULTI bits in dev->gflags according to the passed value but
12do_setlink passes a result of rtnl_dev_combine_flags which takes those bits
13from dev->flags.
14
15This can be easily trigerred by doing:
16
17tcpdump -i eth0 &
18ip l s up eth0
19
20ip sets IFF_UP flag in ifi_flags and ifi_change, which is combined with
21IFF_PROMISC by rtnl_dev_combine_flags, causing __dev_change_flags to set
22IFF_PROMISC in gflags.
23
24Reported-by: Max Matveev <makc@redhat.com>
25Signed-off-by: Jiri Benc <jbenc@redhat.com>
26Signed-off-by: David S. Miller <davem@davemloft.net>
27Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
28---
29 net/core/rtnetlink.c | 8 +++++++-
30 1 files changed, 7 insertions(+), 1 deletions(-)
31
32diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
33index 05842ab..0cf604b 100644
34--- a/net/core/rtnetlink.c
35+++ b/net/core/rtnetlink.c
36@@ -670,6 +670,12 @@ static void set_operstate(struct net_device *dev, unsigned char transition)
37 }
38 }
39
40+static unsigned int rtnl_dev_get_flags(const struct net_device *dev)
41+{
42+ return (dev->flags & ~(IFF_PROMISC | IFF_ALLMULTI)) |
43+ (dev->gflags & (IFF_PROMISC | IFF_ALLMULTI));
44+}
45+
46 static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
47 const struct ifinfomsg *ifm)
48 {
49@@ -678,7 +684,7 @@ static unsigned int rtnl_dev_combine_flags(const struct net_device *dev,
50 /* bugwards compatibility: ifi_change == 0 is treated as ~0 */
51 if (ifm->ifi_change)
52 flags = (flags & ifm->ifi_change) |
53- (dev->flags & ~ifm->ifi_change);
54+ (rtnl_dev_get_flags(dev) & ~ifm->ifi_change);
55
56 return flags;
57 }
58--
591.7.7.6
60
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0011-tcp-perform-DMA-to-userspace-only-if-there-is-a-task.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0011-tcp-perform-DMA-to-userspace-only-if-there-is-a-task.patch
new file mode 100644
index 00000000..86f80264
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0011-tcp-perform-DMA-to-userspace-only-if-there-is-a-task.patch
@@ -0,0 +1,57 @@
1From 0d41914945b1a1d6b6aa1c9ec95af25a5d7d06e6 Mon Sep 17 00:00:00 2001
2From: Jiri Kosina <jkosina@suse.cz>
3Date: Fri, 27 Jul 2012 10:38:50 +0000
4Subject: [PATCH 11/38] tcp: perform DMA to userspace only if there is a task
5 waiting for it
6
7[ Upstream commit 59ea33a68a9083ac98515e4861c00e71efdc49a1 ]
8
9Back in 2006, commit 1a2449a87b ("[I/OAT]: TCP recv offload to I/OAT")
10added support for receive offloading to IOAT dma engine if available.
11
12The code in tcp_rcv_established() tries to perform early DMA copy if
13applicable. It however does so without checking whether the userspace
14task is actually expecting the data in the buffer.
15
16This is not a problem under normal circumstances, but there is a corner
17case where this doesn't work -- and that's when MSG_TRUNC flag to
18recvmsg() is used.
19
20If the IOAT dma engine is not used, the code properly checks whether
21there is a valid ucopy.task and the socket is owned by userspace, but
22misses the check in the dmaengine case.
23
24This problem can be observed in real trivially -- for example 'tbench' is a
25good reproducer, as it makes a heavy use of MSG_TRUNC. On systems utilizing
26IOAT, you will soon find tbench waiting indefinitely in sk_wait_data(), as they
27have been already early-copied in tcp_rcv_established() using dma engine.
28
29This patch introduces the same check we are performing in the simple
30iovec copy case to the IOAT case as well. It fixes the indefinite
31recvmsg(MSG_TRUNC) hangs.
32
33Signed-off-by: Jiri Kosina <jkosina@suse.cz>
34Signed-off-by: David S. Miller <davem@davemloft.net>
35Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
36---
37 net/ipv4/tcp_input.c | 4 +++-
38 1 files changed, 3 insertions(+), 1 deletions(-)
39
40diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
41index 32e6ca2..a08a621 100644
42--- a/net/ipv4/tcp_input.c
43+++ b/net/ipv4/tcp_input.c
44@@ -5415,7 +5415,9 @@ int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
45 if (tp->copied_seq == tp->rcv_nxt &&
46 len - tcp_header_len <= tp->ucopy.len) {
47 #ifdef CONFIG_NET_DMA
48- if (tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
49+ if (tp->ucopy.task == current &&
50+ sock_owned_by_user(sk) &&
51+ tcp_dma_try_early_copy(sk, skb, tcp_header_len)) {
52 copied_early = 1;
53 eaten = 1;
54 }
55--
561.7.7.6
57
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0012-net-tun-fix-ioctl-based-info-leaks.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0012-net-tun-fix-ioctl-based-info-leaks.patch
new file mode 100644
index 00000000..efd83102
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0012-net-tun-fix-ioctl-based-info-leaks.patch
@@ -0,0 +1,41 @@
1From c45f3d3d8ea33347baec087b5f05f561bbb7e994 Mon Sep 17 00:00:00 2001
2From: Mathias Krause <minipli@googlemail.com>
3Date: Sun, 29 Jul 2012 19:45:14 +0000
4Subject: [PATCH 12/38] net/tun: fix ioctl() based info leaks
5
6[ Upstream commits a117dacde0288f3ec60b6e5bcedae8fa37ee0dfc
7 and 8bbb181308bc348e02bfdbebdedd4e4ec9d452ce ]
8
9The tun module leaks up to 36 bytes of memory by not fully initializing
10a structure located on the stack that gets copied to user memory by the
11TUNGETIFF and SIOCGIFHWADDR ioctl()s.
12
13Signed-off-by: Mathias Krause <minipli@googlemail.com>
14Signed-off-by: David S. Miller <davem@davemloft.net>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 drivers/net/tun.c | 6 ++++--
18 1 files changed, 4 insertions(+), 2 deletions(-)
19
20diff --git a/drivers/net/tun.c b/drivers/net/tun.c
21index 7bea9c6..a12c9bf 100644
22--- a/drivers/net/tun.c
23+++ b/drivers/net/tun.c
24@@ -1243,10 +1243,12 @@ static long __tun_chr_ioctl(struct file *file, unsigned int cmd,
25 int vnet_hdr_sz;
26 int ret;
27
28- if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89)
29+ if (cmd == TUNSETIFF || _IOC_TYPE(cmd) == 0x89) {
30 if (copy_from_user(&ifr, argp, ifreq_len))
31 return -EFAULT;
32-
33+ } else {
34+ memset(&ifr, 0, sizeof(ifr));
35+ }
36 if (cmd == TUNGETFEATURES) {
37 /* Currently this just means: "what IFF flags are valid?".
38 * This is needed because we never checked for invalid flags on
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0013-e1000-add-dropped-DMA-receive-enable-back-in-for-WoL.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0013-e1000-add-dropped-DMA-receive-enable-back-in-for-WoL.patch
new file mode 100644
index 00000000..60114171
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0013-e1000-add-dropped-DMA-receive-enable-back-in-for-WoL.patch
@@ -0,0 +1,50 @@
1From a434024fe4e85366698b867be432dfd3dc2f70c1 Mon Sep 17 00:00:00 2001
2From: Dean Nelson <dnelson@redhat.com>
3Date: Thu, 19 Jan 2012 17:47:24 +0000
4Subject: [PATCH 13/38] e1000: add dropped DMA receive enable back in for WoL
5
6commit b868179c47e9e8eadcd04c1f3105998e528988a3 upstream.
7
8Commit d5bc77a223b0e9b9dfb002048d2b34a79e7d0b48 broke Wake-on-LAN by
9inadvertently dropping the enabling of DMA receives.
10
11Restore the enabling of DMA receives for WoL.
12
13This is applicable to 3.1+ stable trees.
14
15Reported-by: Tobias Klausmann <klausman@schwarzvogel.de>
16Signed-off-by: Dean Nelson <dnelson@redhat.com>
17Tested-by: Tobias Klausmann <klausman@schwarzvogel.de>
18Tested-by: Aaron Brown <aaron.f.brown@intel.com>
19Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
20Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
21---
22 drivers/net/ethernet/intel/e1000/e1000_main.c | 10 ++++++----
23 1 files changed, 6 insertions(+), 4 deletions(-)
24
25diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
26index de00805..0549261 100644
27--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
28+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
29@@ -4743,12 +4743,14 @@ static int __e1000_shutdown(struct pci_dev *pdev, bool *enable_wake)
30 e1000_setup_rctl(adapter);
31 e1000_set_rx_mode(netdev);
32
33+ rctl = er32(RCTL);
34+
35 /* turn on all-multi mode if wake on multicast is enabled */
36- if (wufc & E1000_WUFC_MC) {
37- rctl = er32(RCTL);
38+ if (wufc & E1000_WUFC_MC)
39 rctl |= E1000_RCTL_MPE;
40- ew32(RCTL, rctl);
41- }
42+
43+ /* enable receives in the hardware */
44+ ew32(RCTL, rctl | E1000_RCTL_EN);
45
46 if (hw->mac_type >= e1000_82540) {
47 ctrl = er32(CTRL);
48--
491.7.7.6
50
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0014-rtlwifi-rtl8192cu-Change-buffer-allocation-for-synch.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0014-rtlwifi-rtl8192cu-Change-buffer-allocation-for-synch.patch
new file mode 100644
index 00000000..40ef1899
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0014-rtlwifi-rtl8192cu-Change-buffer-allocation-for-synch.patch
@@ -0,0 +1,77 @@
1From 9f32412e06d7c657dc0db00f1990196da0edc7b5 Mon Sep 17 00:00:00 2001
2From: Larry Finger <Larry.Finger@lwfinger.net>
3Date: Wed, 11 Jul 2012 14:37:28 -0500
4Subject: [PATCH 14/38] rtlwifi: rtl8192cu: Change buffer allocation for
5 synchronous reads
6
7commit 3ce4d85b76010525adedcc2555fa164bf706a2f3 upstream.
8
9In commit a7959c1, the USB part of rtlwifi was switched to convert
10_usb_read_sync() to using a preallocated buffer rather than one
11that has been acquired using kmalloc. Although this routine is named
12as though it were synchronous, there seem to be simultaneous users,
13and the selection of the index to the data buffer is not multi-user
14safe. This situation is addressed by adding a new spinlock. The routine
15cannot sleep, thus a mutex is not allowed.
16
17Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
18Signed-off-by: John W. Linville <linville@tuxdriver.com>
19Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
20---
21 drivers/net/wireless/rtlwifi/usb.c | 14 +++++++++++---
22 drivers/net/wireless/rtlwifi/wifi.h | 1 +
23 2 files changed, 12 insertions(+), 3 deletions(-)
24
25diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
26index db34db6..a49e848 100644
27--- a/drivers/net/wireless/rtlwifi/usb.c
28+++ b/drivers/net/wireless/rtlwifi/usb.c
29@@ -120,15 +120,19 @@ static u32 _usb_read_sync(struct rtl_priv *rtlpriv, u32 addr, u16 len)
30 u8 request;
31 u16 wvalue;
32 u16 index;
33- __le32 *data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
34+ __le32 *data;
35+ unsigned long flags;
36
37+ spin_lock_irqsave(&rtlpriv->locks.usb_lock, flags);
38+ if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
39+ rtlpriv->usb_data_index = 0;
40+ data = &rtlpriv->usb_data[rtlpriv->usb_data_index];
41+ spin_unlock_irqrestore(&rtlpriv->locks.usb_lock, flags);
42 request = REALTEK_USB_VENQT_CMD_REQ;
43 index = REALTEK_USB_VENQT_CMD_IDX; /* n/a */
44
45 wvalue = (u16)addr;
46 _usbctrl_vendorreq_sync_read(udev, request, wvalue, index, data, len);
47- if (++rtlpriv->usb_data_index >= RTL_USB_MAX_RX_COUNT)
48- rtlpriv->usb_data_index = 0;
49 return le32_to_cpu(*data);
50 }
51
52@@ -909,6 +913,10 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
53 GFP_KERNEL);
54 if (!rtlpriv->usb_data)
55 return -ENOMEM;
56+
57+ /* this spin lock must be initialized early */
58+ spin_lock_init(&rtlpriv->locks.usb_lock);
59+
60 rtlpriv->usb_data_index = 0;
61 SET_IEEE80211_DEV(hw, &intf->dev);
62 udev = interface_to_usbdev(intf);
63diff --git a/drivers/net/wireless/rtlwifi/wifi.h b/drivers/net/wireless/rtlwifi/wifi.h
64index b1e9deb..deb87e9 100644
65--- a/drivers/net/wireless/rtlwifi/wifi.h
66+++ b/drivers/net/wireless/rtlwifi/wifi.h
67@@ -1550,6 +1550,7 @@ struct rtl_locks {
68 spinlock_t rf_lock;
69 spinlock_t lps_lock;
70 spinlock_t waitq_lock;
71+ spinlock_t usb_lock;
72
73 /*Dual mac*/
74 spinlock_t cck_and_rw_pagea_lock;
75--
761.7.7.6
77
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0015-hfsplus-fix-overflow-in-sector-calculations-in-hfspl.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0015-hfsplus-fix-overflow-in-sector-calculations-in-hfspl.patch
new file mode 100644
index 00000000..471e5680
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0015-hfsplus-fix-overflow-in-sector-calculations-in-hfspl.patch
@@ -0,0 +1,40 @@
1From 2a5405901ea07bfd5de0ab32cd08149f70b29e0b Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Janne=20Kalliom=C3=A4ki?= <janne@tuxera.com>
3Date: Sun, 17 Jun 2012 17:05:24 -0400
4Subject: [PATCH 15/38] hfsplus: fix overflow in sector calculations in
5 hfsplus_submit_bio
6MIME-Version: 1.0
7Content-Type: text/plain; charset=UTF-8
8Content-Transfer-Encoding: 8bit
9
10commit a6dc8c04218eb752ff79cdc24a995cf51866caed upstream.
11
12The variable io_size was unsigned int, which caused the wrong sector number
13to be calculated after aligning it. This then caused mount to fail with big
14volumes, as backup volume header information was searched from a
15wrong sector.
16
17Signed-off-by: Janne Kalliomäki <janne@tuxera.com>
18Signed-off-by: Christoph Hellwig <hch@lst.de>
19Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
20Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
21---
22 fs/hfsplus/wrapper.c | 2 +-
23 1 files changed, 1 insertions(+), 1 deletions(-)
24
25diff --git a/fs/hfsplus/wrapper.c b/fs/hfsplus/wrapper.c
26index 7daf4b8..90effcc 100644
27--- a/fs/hfsplus/wrapper.c
28+++ b/fs/hfsplus/wrapper.c
29@@ -56,7 +56,7 @@ int hfsplus_submit_bio(struct super_block *sb, sector_t sector,
30 DECLARE_COMPLETION_ONSTACK(wait);
31 struct bio *bio;
32 int ret = 0;
33- unsigned int io_size;
34+ u64 io_size;
35 loff_t start;
36 int offset;
37
38--
391.7.7.6
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0016-drm-i915-fixup-seqno-allocation-logic-for-lazy_reque.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0016-drm-i915-fixup-seqno-allocation-logic-for-lazy_reque.patch
new file mode 100644
index 00000000..dab607f7
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0016-drm-i915-fixup-seqno-allocation-logic-for-lazy_reque.patch
@@ -0,0 +1,182 @@
1From fb7b884cf3c3ea0ff01bade0bff2d6338559e870 Mon Sep 17 00:00:00 2001
2From: Daniel Vetter <daniel.vetter@ffwll.ch>
3Date: Wed, 25 Jan 2012 16:32:49 +0100
4Subject: [PATCH 16/38] drm/i915: fixup seqno allocation logic for
5 lazy_request
6
7commit 53d227f282eb9fa4c7cdbfd691fa372b7ca8c4c3 upstream.
8
9Currently we reserve seqnos only when we emit the request to the ring
10(by bumping dev_priv->next_seqno), but start using it much earlier for
11ring->oustanding_lazy_request. When 2 threads compete for the gpu and
12run on two different rings (e.g. ddx on blitter vs. compositor)
13hilarity ensued, especially when we get constantly interrupted while
14reserving buffers.
15
16Breakage seems to have been introduced in
17
18commit 6f392d548658a17600da7faaf8a5df25ee5f01f6
19Author: Chris Wilson <chris@chris-wilson.co.uk>
20Date: Sat Aug 7 11:01:22 2010 +0100
21
22 drm/i915: Use a common seqno for all rings.
23
24This patch fixes up the seqno reservation logic by moving it into
25i915_gem_next_request_seqno. The ring->add_request functions now
26superflously still return the new seqno through a pointer, that will
27be refactored in the next patch.
28
29Note that with this change we now unconditionally allocate a seqno,
30even when ->add_request might fail because the rings are full and the
31gpu died. But this does not open up a new can of worms because we can
32already leave behind an outstanding_request_seqno if e.g. the caller
33gets interrupted with a signal while stalling for the gpu in the
34eviciton paths. And with the bugfix we only ever have one seqno
35allocated per ring (and only that ring), so there are no ordering
36issues with multiple outstanding seqnos on the same ring.
37
38v2: Keep i915_gem_get_seqno (but move it to i915_gem.c) to make it
39clear that we only have one seqno counter for all rings. Suggested by
40Chris Wilson.
41
42v3: As suggested by Chris Wilson use i915_gem_next_request_seqno
43instead of ring->oustanding_lazy_request to make the follow-up
44refactoring more clearly correct. Also improve the commit message
45with issues discussed on irc.
46
47Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45181
48Tested-by: Nicolas Kalkhof nkalkhof()at()web.de
49Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
50Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
51Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
52---
53 drivers/gpu/drm/i915/i915_drv.h | 7 +------
54 drivers/gpu/drm/i915/i915_gem.c | 23 +++++++++++++++++++++++
55 drivers/gpu/drm/i915/intel_ringbuffer.c | 24 ++++--------------------
56 3 files changed, 28 insertions(+), 26 deletions(-)
57
58diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
59index d62c731..c364358 100644
60--- a/drivers/gpu/drm/i915/i915_drv.h
61+++ b/drivers/gpu/drm/i915/i915_drv.h
62@@ -1170,12 +1170,7 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2)
63 return (int32_t)(seq1 - seq2) >= 0;
64 }
65
66-static inline u32
67-i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
68-{
69- drm_i915_private_t *dev_priv = ring->dev->dev_private;
70- return ring->outstanding_lazy_request = dev_priv->next_seqno;
71-}
72+u32 i915_gem_next_request_seqno(struct intel_ring_buffer *ring);
73
74 int __must_check i915_gem_object_get_fence(struct drm_i915_gem_object *obj,
75 struct intel_ring_buffer *pipelined);
76diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
77index 3e2edc6..548a400 100644
78--- a/drivers/gpu/drm/i915/i915_gem.c
79+++ b/drivers/gpu/drm/i915/i915_gem.c
80@@ -1647,6 +1647,28 @@ i915_gem_process_flushing_list(struct intel_ring_buffer *ring,
81 }
82 }
83
84+static u32
85+i915_gem_get_seqno(struct drm_device *dev)
86+{
87+ drm_i915_private_t *dev_priv = dev->dev_private;
88+ u32 seqno = dev_priv->next_seqno;
89+
90+ /* reserve 0 for non-seqno */
91+ if (++dev_priv->next_seqno == 0)
92+ dev_priv->next_seqno = 1;
93+
94+ return seqno;
95+}
96+
97+u32
98+i915_gem_next_request_seqno(struct intel_ring_buffer *ring)
99+{
100+ if (ring->outstanding_lazy_request == 0)
101+ ring->outstanding_lazy_request = i915_gem_get_seqno(ring->dev);
102+
103+ return ring->outstanding_lazy_request;
104+}
105+
106 int
107 i915_add_request(struct intel_ring_buffer *ring,
108 struct drm_file *file,
109@@ -1658,6 +1680,7 @@ i915_add_request(struct intel_ring_buffer *ring,
110 int ret;
111
112 BUG_ON(request == NULL);
113+ seqno = i915_gem_next_request_seqno(ring);
114
115 ret = ring->add_request(ring, &seqno);
116 if (ret)
117diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
118index f6613dc..d2cbe5d 100644
119--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
120+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
121@@ -52,20 +52,6 @@ static inline int ring_space(struct intel_ring_buffer *ring)
122 return space;
123 }
124
125-static u32 i915_gem_get_seqno(struct drm_device *dev)
126-{
127- drm_i915_private_t *dev_priv = dev->dev_private;
128- u32 seqno;
129-
130- seqno = dev_priv->next_seqno;
131-
132- /* reserve 0 for non-seqno */
133- if (++dev_priv->next_seqno == 0)
134- dev_priv->next_seqno = 1;
135-
136- return seqno;
137-}
138-
139 static int
140 render_ring_flush(struct intel_ring_buffer *ring,
141 u32 invalidate_domains,
142@@ -488,7 +474,7 @@ gen6_add_request(struct intel_ring_buffer *ring,
143 mbox1_reg = ring->signal_mbox[0];
144 mbox2_reg = ring->signal_mbox[1];
145
146- *seqno = i915_gem_get_seqno(ring->dev);
147+ *seqno = i915_gem_next_request_seqno(ring);
148
149 update_mboxes(ring, *seqno, mbox1_reg);
150 update_mboxes(ring, *seqno, mbox2_reg);
151@@ -586,8 +572,7 @@ static int
152 pc_render_add_request(struct intel_ring_buffer *ring,
153 u32 *result)
154 {
155- struct drm_device *dev = ring->dev;
156- u32 seqno = i915_gem_get_seqno(dev);
157+ u32 seqno = i915_gem_next_request_seqno(ring);
158 struct pipe_control *pc = ring->private;
159 u32 scratch_addr = pc->gtt_offset + 128;
160 int ret;
161@@ -638,8 +623,7 @@ static int
162 render_ring_add_request(struct intel_ring_buffer *ring,
163 u32 *result)
164 {
165- struct drm_device *dev = ring->dev;
166- u32 seqno = i915_gem_get_seqno(dev);
167+ u32 seqno = i915_gem_next_request_seqno(ring);
168 int ret;
169
170 ret = intel_ring_begin(ring, 4);
171@@ -813,7 +797,7 @@ ring_add_request(struct intel_ring_buffer *ring,
172 if (ret)
173 return ret;
174
175- seqno = i915_gem_get_seqno(ring->dev);
176+ seqno = i915_gem_next_request_seqno(ring);
177
178 intel_ring_emit(ring, MI_STORE_DWORD_INDEX);
179 intel_ring_emit(ring, I915_GEM_HWS_INDEX << MI_STORE_DWORD_INDEX_SHIFT);
180--
1811.7.7.6
182
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0017-KVM-VMX-Advertise-CPU_BASED_RDPMC_EXITING-for-nested.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0017-KVM-VMX-Advertise-CPU_BASED_RDPMC_EXITING-for-nested.patch
new file mode 100644
index 00000000..ce5de76e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0017-KVM-VMX-Advertise-CPU_BASED_RDPMC_EXITING-for-nested.patch
@@ -0,0 +1,37 @@
1From 3a120a56ad2a35167da519fb81f66027f6b8b8bc Mon Sep 17 00:00:00 2001
2From: Stefan Bader <stefan.bader@canonical.com>
3Date: Thu, 9 Aug 2012 12:33:12 +0300
4Subject: [PATCH 17/38] KVM: VMX: Advertise CPU_BASED_RDPMC_EXITING for nested
5 guests
6
7Based on commit fee84b079d5ddee2247b5c1f53162c330c622902 upstream.
8
9 Intercept RDPMC and forward it to the PMU emulation code.
10
11Newer vmx support will only allow to load the kvm_intel module
12if RDPMC_EXITING is supported. Even without the actual support
13this part of the change is required on 3.2 hosts.
14
15BugLink: http://bugs.launchpad.net/bugs/1031090
16Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
17Signed-off-by: Avi Kivity <avi@redhat.com>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 arch/x86/kvm/vmx.c | 1 +
21 1 files changed, 1 insertions(+), 0 deletions(-)
22
23diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
24index 7315488..407789b 100644
25--- a/arch/x86/kvm/vmx.c
26+++ b/arch/x86/kvm/vmx.c
27@@ -1956,6 +1956,7 @@ static __init void nested_vmx_setup_ctls_msrs(void)
28 #endif
29 CPU_BASED_MOV_DR_EXITING | CPU_BASED_UNCOND_IO_EXITING |
30 CPU_BASED_USE_IO_BITMAPS | CPU_BASED_MONITOR_EXITING |
31+ CPU_BASED_RDPMC_EXITING |
32 CPU_BASED_ACTIVATE_SECONDARY_CONTROLS;
33 /*
34 * We can allow some features even when not supported by the
35--
361.7.7.6
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0018-mac80211-cancel-mesh-path-timer.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0018-mac80211-cancel-mesh-path-timer.patch
new file mode 100644
index 00000000..ce103a36
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0018-mac80211-cancel-mesh-path-timer.patch
@@ -0,0 +1,32 @@
1From 6232af882bb87e23d74aad3351552b267c99e952 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Wed, 1 Aug 2012 21:03:21 +0200
4Subject: [PATCH 18/38] mac80211: cancel mesh path timer
5
6commit dd4c9260e7f23f2e951cbfb2726e468c6d30306c upstream.
7
8The mesh path timer needs to be canceled when
9leaving the mesh as otherwise it could fire
10after the interface has been removed already.
11
12Signed-off-by: Johannes Berg <johannes.berg@intel.com>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 net/mac80211/mesh.c | 1 +
16 1 files changed, 1 insertions(+), 0 deletions(-)
17
18diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
19index a7078fd..f85de8e 100644
20--- a/net/mac80211/mesh.c
21+++ b/net/mac80211/mesh.c
22@@ -543,6 +543,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
23
24 del_timer_sync(&sdata->u.mesh.housekeeping_timer);
25 del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
26+ del_timer_sync(&sdata->u.mesh.mesh_path_timer);
27 /*
28 * If the timer fired while we waited for it, it will have
29 * requeued the work. Now the work will be running again
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0019-ath9k-Add-PID-VID-support-for-AR1111.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0019-ath9k-Add-PID-VID-support-for-AR1111.patch
new file mode 100644
index 00000000..4c77dce2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0019-ath9k-Add-PID-VID-support-for-AR1111.patch
@@ -0,0 +1,65 @@
1From 79e8531b00817a47eaadccc39250dbe05d4f141f Mon Sep 17 00:00:00 2001
2From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
3Date: Thu, 2 Aug 2012 11:58:50 +0530
4Subject: [PATCH 19/38] ath9k: Add PID/VID support for AR1111
5
6commit d4e5979c0da95791aa717c18e162540c7a596360 upstream.
7
8AR1111 is same as AR9485. The h/w
9difference between them is quite insignificant,
10Felix suggests only very few baseband features
11may not be available in AR1111. The h/w code for
12AR9485 is already present, so AR1111 should
13work fine with the addition of its PID/VID.
14
15Cc: Felix Bitterli <felixb@qca.qualcomm.com>
16Reported-by: Tim Bentley <Tim.Bentley@Gmail.com>
17Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
18Tested-by: Tim Bentley <Tim.Bentley@Gmail.com>
19Signed-off-by: John W. Linville <linville@tuxdriver.com>
20Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
21---
22 drivers/net/wireless/ath/ath9k/hw.c | 1 +
23 drivers/net/wireless/ath/ath9k/hw.h | 1 +
24 drivers/net/wireless/ath/ath9k/pci.c | 1 +
25 3 files changed, 3 insertions(+), 0 deletions(-)
26
27diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
28index 7f97164..2b8e957 100644
29--- a/drivers/net/wireless/ath/ath9k/hw.c
30+++ b/drivers/net/wireless/ath/ath9k/hw.c
31@@ -674,6 +674,7 @@ int ath9k_hw_init(struct ath_hw *ah)
32 case AR9300_DEVID_AR9340:
33 case AR9300_DEVID_AR9580:
34 case AR9300_DEVID_AR9462:
35+ case AR9485_DEVID_AR1111:
36 break;
37 default:
38 if (common->bus_ops->ath_bus_type == ATH_USB)
39diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
40index 1bd8edf..a5c4ba8 100644
41--- a/drivers/net/wireless/ath/ath9k/hw.h
42+++ b/drivers/net/wireless/ath/ath9k/hw.h
43@@ -48,6 +48,7 @@
44 #define AR9300_DEVID_AR9580 0x0033
45 #define AR9300_DEVID_AR9462 0x0034
46 #define AR9300_DEVID_AR9330 0x0035
47+#define AR9485_DEVID_AR1111 0x0037
48
49 #define AR5416_AR9100_DEVID 0x000b
50
51diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
52index 2dcdf63..1883d39 100644
53--- a/drivers/net/wireless/ath/ath9k/pci.c
54+++ b/drivers/net/wireless/ath/ath9k/pci.c
55@@ -35,6 +35,7 @@ static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
56 { PCI_VDEVICE(ATHEROS, 0x0032) }, /* PCI-E AR9485 */
57 { PCI_VDEVICE(ATHEROS, 0x0033) }, /* PCI-E AR9580 */
58 { PCI_VDEVICE(ATHEROS, 0x0034) }, /* PCI-E AR9462 */
59+ { PCI_VDEVICE(ATHEROS, 0x0037) }, /* PCI-E AR1111/AR9485 */
60 { 0 }
61 };
62
63--
641.7.7.6
65
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0020-ARM-mxs-Remove-MMAP_MIN_ADDR-setting-from-mxs_defcon.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0020-ARM-mxs-Remove-MMAP_MIN_ADDR-setting-from-mxs_defcon.patch
new file mode 100644
index 00000000..08c67772
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0020-ARM-mxs-Remove-MMAP_MIN_ADDR-setting-from-mxs_defcon.patch
@@ -0,0 +1,52 @@
1From 72e131402c22fe7df4bff17249c4b5a513118b8b Mon Sep 17 00:00:00 2001
2From: Marek Vasut <marex@denx.de>
3Date: Fri, 3 Aug 2012 20:54:48 +0200
4Subject: [PATCH 20/38] ARM: mxs: Remove MMAP_MIN_ADDR setting from
5 mxs_defconfig
6
7commit 3bed491c8d28329e34f8a31e3fe64d03f3a350f1 upstream.
8
9The CONFIG_DEFAULT_MMAP_MIN_ADDR was set to 65536 in mxs_defconfig,
10this caused severe breakage of userland applications since the upper
11limit for ARM is 32768. By default CONFIG_DEFAULT_MMAP_MIN_ADDR is
12set to 4096 and can also be changed via /proc/sys/vm/mmap_min_addr
13if needed.
14
15Quoting Russell King [1]:
16
17"4096 is also fine for ARM too. There's not much point in having
18defconfigs change it - that would just be pure noise in the config
19files."
20
21the CONFIG_DEFAULT_MMAP_MIN_ADDR can be removed from the defconfig
22altogether.
23
24This problem was introduced by commit cde7c41 (ARM: configs: add
25defconfig for mach-mxs).
26
27[1] http://marc.info/?l=linux-arm-kernel&m=134401593807820&w=2
28
29Signed-off-by: Marek Vasut <marex@denx.de>
30Cc: Russell King <linux@arm.linux.org.uk>
31Cc: Wolfgang Denk <wd@denx.de>
32Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
33Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
34---
35 arch/arm/configs/mxs_defconfig | 1 -
36 1 files changed, 0 insertions(+), 1 deletions(-)
37
38diff --git a/arch/arm/configs/mxs_defconfig b/arch/arm/configs/mxs_defconfig
39index 6ee781b..3ee3e84 100644
40--- a/arch/arm/configs/mxs_defconfig
41+++ b/arch/arm/configs/mxs_defconfig
42@@ -32,7 +32,6 @@ CONFIG_NO_HZ=y
43 CONFIG_HIGH_RES_TIMERS=y
44 CONFIG_PREEMPT_VOLUNTARY=y
45 CONFIG_AEABI=y
46-CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
47 CONFIG_AUTO_ZRELADDR=y
48 CONFIG_FPE_NWFPE=y
49 CONFIG_NET=y
50--
511.7.7.6
52
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0021-ALSA-hda-add-dock-support-for-Thinkpad-T430s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0021-ALSA-hda-add-dock-support-for-Thinkpad-T430s.patch
new file mode 100644
index 00000000..087bd236
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0021-ALSA-hda-add-dock-support-for-Thinkpad-T430s.patch
@@ -0,0 +1,34 @@
1From e7af387d6087031280b03362bbfdeaefa97cecfa Mon Sep 17 00:00:00 2001
2From: "Philipp A. Mohrenweiser" <phiamo@googlemail.com>
3Date: Mon, 6 Aug 2012 13:14:18 +0200
4Subject: [PATCH 21/38] ALSA: hda - add dock support for Thinkpad T430s
5
6commit 4407be6ba217514b1bc01488f8b56467d309e416 upstream.
7
8Add a model/fixup string "lenovo-dock", for Thinkpad T430s, to allow
9sound in docking station.
10
11Tested on Lenovo T430s with ThinkPad Mini Dock Plus Series 3
12
13Signed-off-by: Philipp A. Mohrenweiser <phiamo@googlemail.com>
14Signed-off-by: Takashi Iwai <tiwai@suse.de>
15Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
16---
17 sound/pci/hda/patch_realtek.c | 1 +
18 1 files changed, 1 insertions(+), 0 deletions(-)
19
20diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
21index 2e2eb93..36cef6f 100644
22--- a/sound/pci/hda/patch_realtek.c
23+++ b/sound/pci/hda/patch_realtek.c
24@@ -5077,6 +5077,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
25 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
26 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
27 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
28+ SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
29 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
30 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
31 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
32--
331.7.7.6
34
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0022-cfg80211-process-pending-events-when-unregistering-n.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0022-cfg80211-process-pending-events-when-unregistering-n.patch
new file mode 100644
index 00000000..0b3cd87f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0022-cfg80211-process-pending-events-when-unregistering-n.patch
@@ -0,0 +1,72 @@
1From 494c6e65c2040893d8d7bb7a5c34eeb5355a1255 Mon Sep 17 00:00:00 2001
2From: Daniel Drake <dsd@laptop.org>
3Date: Thu, 2 Aug 2012 18:41:48 +0100
4Subject: [PATCH 22/38] cfg80211: process pending events when unregistering
5 net device
6
7commit 1f6fc43e621167492ed4b7f3b4269c584c3d6ccc upstream.
8
9libertas currently calls cfg80211_disconnected() when it is being
10brought down. This causes an event to be allocated, but since the
11wdev is already removed from the rdev by the time that the event
12processing work executes, the event is never processed or freed.
13http://article.gmane.org/gmane.linux.kernel.wireless.general/95666
14
15Fix this leak, and other possible situations, by processing the event
16queue when a device is being unregistered. Thanks to Johannes Berg for
17the suggestion.
18
19Signed-off-by: Daniel Drake <dsd@laptop.org>
20Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
21Signed-off-by: John W. Linville <linville@tuxdriver.com>
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23---
24 net/wireless/core.c | 5 +++++
25 net/wireless/core.h | 1 +
26 net/wireless/util.c | 2 +-
27 3 files changed, 7 insertions(+), 1 deletions(-)
28
29diff --git a/net/wireless/core.c b/net/wireless/core.c
30index 220f3bd..8f5042d 100644
31--- a/net/wireless/core.c
32+++ b/net/wireless/core.c
33@@ -971,6 +971,11 @@ static int cfg80211_netdev_notifier_call(struct notifier_block * nb,
34 */
35 synchronize_rcu();
36 INIT_LIST_HEAD(&wdev->list);
37+ /*
38+ * Ensure that all events have been processed and
39+ * freed.
40+ */
41+ cfg80211_process_wdev_events(wdev);
42 break;
43 case NETDEV_PRE_UP:
44 if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype)))
45diff --git a/net/wireless/core.h b/net/wireless/core.h
46index b9ec306..02c3be3 100644
47--- a/net/wireless/core.h
48+++ b/net/wireless/core.h
49@@ -426,6 +426,7 @@ int cfg80211_change_iface(struct cfg80211_registered_device *rdev,
50 struct net_device *dev, enum nl80211_iftype ntype,
51 u32 *flags, struct vif_params *params);
52 void cfg80211_process_rdev_events(struct cfg80211_registered_device *rdev);
53+void cfg80211_process_wdev_events(struct wireless_dev *wdev);
54
55 int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
56 struct wireless_dev *wdev,
57diff --git a/net/wireless/util.c b/net/wireless/util.c
58index b5e4c1c..22fb802 100644
59--- a/net/wireless/util.c
60+++ b/net/wireless/util.c
61@@ -725,7 +725,7 @@ void cfg80211_upload_connect_keys(struct wireless_dev *wdev)
62 wdev->connect_keys = NULL;
63 }
64
65-static void cfg80211_process_wdev_events(struct wireless_dev *wdev)
66+void cfg80211_process_wdev_events(struct wireless_dev *wdev)
67 {
68 struct cfg80211_event *ev;
69 unsigned long flags;
70--
711.7.7.6
72
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0023-rt61pci-fix-NULL-pointer-dereference-in-config_lna_g.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0023-rt61pci-fix-NULL-pointer-dereference-in-config_lna_g.patch
new file mode 100644
index 00000000..7ada863b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0023-rt61pci-fix-NULL-pointer-dereference-in-config_lna_g.patch
@@ -0,0 +1,39 @@
1From 6eeecbf1bfca2b6453a4708a0e0392ba10db91b4 Mon Sep 17 00:00:00 2001
2From: Stanislaw Gruszka <sgruszka@redhat.com>
3Date: Fri, 3 Aug 2012 12:49:14 +0200
4Subject: [PATCH 23/38] rt61pci: fix NULL pointer dereference in
5 config_lna_gain
6
7commit deee0214def5d8a32b8112f11d9c2b1696e9c0cb upstream.
8
9We can not pass NULL libconf->conf->channel to rt61pci_config() as it
10is dereferenced unconditionally in rt61pci_config_lna_gain() subroutine.
11
12Resolves:
13https://bugzilla.kernel.org/show_bug.cgi?id=44361
14
15Reported-and-tested-by: <dolohow@gmail.com>
16Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
17Signed-off-by: John W. Linville <linville@tuxdriver.com>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 drivers/net/wireless/rt2x00/rt61pci.c | 3 +--
21 1 files changed, 1 insertions(+), 2 deletions(-)
22
23diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
24index bf55b4a..d69f88c 100644
25--- a/drivers/net/wireless/rt2x00/rt61pci.c
26+++ b/drivers/net/wireless/rt2x00/rt61pci.c
27@@ -2243,8 +2243,7 @@ static void rt61pci_txdone(struct rt2x00_dev *rt2x00dev)
28
29 static void rt61pci_wakeup(struct rt2x00_dev *rt2x00dev)
30 {
31- struct ieee80211_conf conf = { .flags = 0 };
32- struct rt2x00lib_conf libconf = { .conf = &conf };
33+ struct rt2x00lib_conf libconf = { .conf = &rt2x00dev->hw->conf };
34
35 rt61pci_config(rt2x00dev, &libconf, IEEE80211_CONF_CHANGE_PS);
36 }
37--
381.7.7.6
39
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0024-iwlwifi-disable-greenfield-transmissions-as-a-workar.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0024-iwlwifi-disable-greenfield-transmissions-as-a-workar.patch
new file mode 100644
index 00000000..4a140542
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0024-iwlwifi-disable-greenfield-transmissions-as-a-workar.patch
@@ -0,0 +1,53 @@
1From a05a0b85c314feeebcbf3491dd6ed98e4ffb0958 Mon Sep 17 00:00:00 2001
2From: Johannes Berg <johannes.berg@intel.com>
3Date: Sun, 5 Aug 2012 18:31:46 +0200
4Subject: [PATCH 24/38] iwlwifi: disable greenfield transmissions as a
5 workaround
6
7commit 50e2a30cf6fcaeb2d27360ba614dd169a10041c5 upstream.
8
9There's a bug that causes the rate scaling to get stuck
10when it has to use single-stream rates with a peer that
11can do GF and SGI; the two are incompatible so we can't
12use them together, but that causes the algorithm to not
13work at all, it always rejects updates.
14
15Disable greenfield for now to prevent that problem.
16
17Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
18Tested-by: Cesar Eduardo Barros <cesarb@cesarb.net>
19Signed-off-by: Johannes Berg <johannes.berg@intel.com>
20Signed-off-by: John W. Linville <linville@tuxdriver.com>
21[bwh: Backported to 3.2: adjust filename]
22Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
23---
24 drivers/net/wireless/iwlwifi/iwl-agn-rs.c | 13 ++++++++-----
25 1 files changed, 8 insertions(+), 5 deletions(-)
26
27diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
28index 9ba2c1b..3395025 100644
29--- a/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
30+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rs.c
31@@ -708,11 +708,14 @@ static int rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
32 */
33 static bool rs_use_green(struct ieee80211_sta *sta)
34 {
35- struct iwl_station_priv *sta_priv = (void *)sta->drv_priv;
36- struct iwl_rxon_context *ctx = sta_priv->ctx;
37-
38- return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
39- !(ctx->ht.non_gf_sta_present);
40+ /*
41+ * There's a bug somewhere in this code that causes the
42+ * scaling to get stuck because GF+SGI can't be combined
43+ * in SISO rates. Until we find that bug, disable GF, it
44+ * has only limited benefit and we still interoperate with
45+ * GF APs since we can always receive GF transmissions.
46+ */
47+ return false;
48 }
49
50 /**
51--
521.7.7.6
53
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0025-ALSA-hda-add-dock-support-for-Thinkpad-X230.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0025-ALSA-hda-add-dock-support-for-Thinkpad-X230.patch
new file mode 100644
index 00000000..9ffee7ba
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0025-ALSA-hda-add-dock-support-for-Thinkpad-X230.patch
@@ -0,0 +1,32 @@
1From d1d4e5b872501c6b9a04a50d656a517fdbb3d7b1 Mon Sep 17 00:00:00 2001
2From: Felix Kaechele <felix@fetzig.org>
3Date: Mon, 6 Aug 2012 23:02:01 +0200
4Subject: [PATCH 25/38] ALSA: hda - add dock support for Thinkpad X230
5
6commit c8415a48fcb7a29889f4405d38c57db351e4b50a upstream.
7
8As with the ThinkPad Models X230 Tablet and T530 the X230 needs a qurik to
9correctly set up the pins for the dock port.
10
11Signed-off-by: Felix Kaechele <felix@fetzig.org>
12Signed-off-by: Takashi Iwai <tiwai@suse.de>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 sound/pci/hda/patch_realtek.c | 1 +
16 1 files changed, 1 insertions(+), 0 deletions(-)
17
18diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
19index 36cef6f..2bf8cbb 100644
20--- a/sound/pci/hda/patch_realtek.c
21+++ b/sound/pci/hda/patch_realtek.c
22@@ -5077,6 +5077,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
23 SND_PCI_QUIRK(0x17aa, 0x21ca, "Thinkpad L412", ALC269_FIXUP_SKU_IGNORE),
24 SND_PCI_QUIRK(0x17aa, 0x21e9, "Thinkpad Edge 15", ALC269_FIXUP_SKU_IGNORE),
25 SND_PCI_QUIRK(0x17aa, 0x21f6, "Thinkpad T530", ALC269_FIXUP_LENOVO_DOCK),
26+ SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
27 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
28 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
29 SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0026-e1000e-NIC-goes-up-and-immediately-goes-down.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0026-e1000e-NIC-goes-up-and-immediately-goes-down.patch
new file mode 100644
index 00000000..d5eec9fd
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0026-e1000e-NIC-goes-up-and-immediately-goes-down.patch
@@ -0,0 +1,41 @@
1From 4391276e45606802564174334f4a43ce57b9601c Mon Sep 17 00:00:00 2001
2From: Tushar Dave <tushar.n.dave@intel.com>
3Date: Tue, 31 Jul 2012 02:02:43 +0000
4Subject: [PATCH 26/38] e1000e: NIC goes up and immediately goes down
5
6commit b7ec70be01a87f2c85df3ae11046e74f9b67e323 upstream.
7
8Found that commit d478eb44 was a bad commit.
9If the link partner is transmitting codeword (even if NULL codeword),
10then the RXCW.C bit will be set so check for RXCW.CW is unnecessary.
11Ref: RH BZ 840642
12
13Reported-by: Fabio Futigami <ffutigam@redhat.com>
14Signed-off-by: Tushar Dave <tushar.n.dave@intel.com>
15CC: Marcelo Ricardo Leitner <mleitner@redhat.com>
16Tested-by: Aaron Brown <aaron.f.brown@intel.com>
17Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
18Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
19---
20 drivers/net/ethernet/intel/e1000e/82571.c | 4 +---
21 1 files changed, 1 insertions(+), 3 deletions(-)
22
23diff --git a/drivers/net/ethernet/intel/e1000e/82571.c b/drivers/net/ethernet/intel/e1000e/82571.c
24index 3072d35..4f4d52a 100644
25--- a/drivers/net/ethernet/intel/e1000e/82571.c
26+++ b/drivers/net/ethernet/intel/e1000e/82571.c
27@@ -1600,10 +1600,8 @@ static s32 e1000_check_for_serdes_link_82571(struct e1000_hw *hw)
28 * auto-negotiation in the TXCW register and disable
29 * forced link in the Device Control register in an
30 * attempt to auto-negotiate with our link partner.
31- * If the partner code word is null, stop forcing
32- * and restart auto negotiation.
33 */
34- if ((rxcw & E1000_RXCW_C) || !(rxcw & E1000_RXCW_CW)) {
35+ if (rxcw & E1000_RXCW_C) {
36 /* Enable autoneg, and unforce link up */
37 ew32(TXCW, mac->txcw);
38 ew32(CTRL, (ctrl & ~E1000_CTRL_SLU));
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0027-ALSA-hda-remove-quirk-for-Dell-Vostro-1015.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0027-ALSA-hda-remove-quirk-for-Dell-Vostro-1015.patch
new file mode 100644
index 00000000..0f76ad6c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0027-ALSA-hda-remove-quirk-for-Dell-Vostro-1015.patch
@@ -0,0 +1,32 @@
1From e812f3553b54d0a821ba55198f31d898cf57a6b0 Mon Sep 17 00:00:00 2001
2From: David Henningsson <david.henningsson@canonical.com>
3Date: Tue, 7 Aug 2012 14:03:29 +0200
4Subject: [PATCH 27/38] ALSA: hda - remove quirk for Dell Vostro 1015
5
6commit e9fc83cb2e5877801a255a37ddbc5be996ea8046 upstream.
7
8This computer is confirmed working with model=auto on kernel 3.2.
9Also, parsing fails with hda-emu with the current model.
10
11Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12Signed-off-by: Takashi Iwai <tiwai@suse.de>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 sound/pci/hda/patch_conexant.c | 1 -
16 1 files changed, 0 insertions(+), 1 deletions(-)
17
18diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
19index 51a1afc..402f330 100644
20--- a/sound/pci/hda/patch_conexant.c
21+++ b/sound/pci/hda/patch_conexant.c
22@@ -3059,7 +3059,6 @@ static const struct snd_pci_quirk cxt5066_cfg_tbl[] = {
23 SND_PCI_QUIRK(0x1028, 0x02d8, "Dell Vostro", CXT5066_DELL_VOSTRO),
24 SND_PCI_QUIRK(0x1028, 0x02f5, "Dell Vostro 320", CXT5066_IDEAPAD),
25 SND_PCI_QUIRK(0x1028, 0x0401, "Dell Vostro 1014", CXT5066_DELL_VOSTRO),
26- SND_PCI_QUIRK(0x1028, 0x0402, "Dell Vostro", CXT5066_DELL_VOSTRO),
27 SND_PCI_QUIRK(0x1028, 0x0408, "Dell Inspiron One 19T", CXT5066_IDEAPAD),
28 SND_PCI_QUIRK(0x1028, 0x050f, "Dell Inspiron", CXT5066_IDEAPAD),
29 SND_PCI_QUIRK(0x1028, 0x0510, "Dell Vostro", CXT5066_IDEAPAD),
30--
311.7.7.6
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0028-ALSA-hda-Fix-double-quirk-for-Quanta-FL1-Lenovo-Idea.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0028-ALSA-hda-Fix-double-quirk-for-Quanta-FL1-Lenovo-Idea.patch
new file mode 100644
index 00000000..8bd12917
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0028-ALSA-hda-Fix-double-quirk-for-Quanta-FL1-Lenovo-Idea.patch
@@ -0,0 +1,43 @@
1From 48c0a41688550241188e24029bfbc89b431f39be Mon Sep 17 00:00:00 2001
2From: David Henningsson <david.henningsson@canonical.com>
3Date: Wed, 8 Aug 2012 08:43:37 +0200
4Subject: [PATCH 28/38] ALSA: hda - Fix double quirk for Quanta FL1 / Lenovo
5 Ideapad
6
7commit 012e7eb1e501d0120e0383b81477f63091f5e365 upstream.
8
9The same ID is twice in the quirk table, so the second one is not used.
10
11Signed-off-by: David Henningsson <david.henningsson@canonical.com>
12Signed-off-by: Takashi Iwai <tiwai@suse.de>
13Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
14---
15 sound/pci/hda/patch_realtek.c | 5 +++--
16 1 files changed, 3 insertions(+), 2 deletions(-)
17
18diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
19index 2bf8cbb..32c8169 100644
20--- a/sound/pci/hda/patch_realtek.c
21+++ b/sound/pci/hda/patch_realtek.c
22@@ -4981,6 +4981,8 @@ static const struct alc_fixup alc269_fixups[] = {
23 [ALC269_FIXUP_PCM_44K] = {
24 .type = ALC_FIXUP_FUNC,
25 .v.func = alc269_fixup_pcm_44k,
26+ .chained = true,
27+ .chain_id = ALC269_FIXUP_QUANTA_MUTE
28 },
29 [ALC269_FIXUP_STEREO_DMIC] = {
30 .type = ALC_FIXUP_FUNC,
31@@ -5080,8 +5082,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
32 SND_PCI_QUIRK(0x17aa, 0x21fa, "Thinkpad X230", ALC269_FIXUP_LENOVO_DOCK),
33 SND_PCI_QUIRK(0x17aa, 0x21fb, "Thinkpad T430s", ALC269_FIXUP_LENOVO_DOCK),
34 SND_PCI_QUIRK(0x17aa, 0x2203, "Thinkpad X230 Tablet", ALC269_FIXUP_LENOVO_DOCK),
35- SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_QUANTA_MUTE),
36- SND_PCI_QUIRK(0x17aa, 0x3bf8, "Lenovo Ideapd", ALC269_FIXUP_PCM_44K),
37+ SND_PCI_QUIRK(0x17aa, 0x3bf8, "Quanta FL1", ALC269_FIXUP_PCM_44K),
38 SND_PCI_QUIRK(0x17aa, 0x9e54, "LENOVO NB", ALC269_FIXUP_LENOVO_EAPD),
39
40 #if 1
41--
421.7.7.6
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0029-ARM-pxa-remove-irq_to_gpio-from-ezx-pcap-driver.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0029-ARM-pxa-remove-irq_to_gpio-from-ezx-pcap-driver.patch
new file mode 100644
index 00000000..74e4c99b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0029-ARM-pxa-remove-irq_to_gpio-from-ezx-pcap-driver.patch
@@ -0,0 +1,57 @@
1From d1a256509df27e34f01e3c36017f21fd94b9d40f Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Sun, 5 Aug 2012 14:58:37 +0000
4Subject: [PATCH 29/38] ARM: pxa: remove irq_to_gpio from ezx-pcap driver
5
6commit 59ee93a528b94ef4e81a08db252b0326feff171f upstream.
7
8The irq_to_gpio function was removed from the pxa platform
9in linux-3.2, and this driver has been broken since.
10
11There is actually no in-tree user of this driver that adds
12this platform device, but the driver can and does get enabled
13on some platforms.
14
15Without this patch, building ezx_defconfig results in:
16
17drivers/mfd/ezx-pcap.c: In function 'pcap_isr_work':
18drivers/mfd/ezx-pcap.c:205:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]
19
20Signed-off-by: Arnd Bergmann <arnd@arndb.de>
21Acked-by: Haojian Zhuang <haojian.zhuang@gmail.com>
22Cc: Samuel Ortiz <sameo@linux.intel.com>
23Cc: Daniel Ribeiro <drwyrm@gmail.com>
24Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
25---
26 drivers/mfd/ezx-pcap.c | 2 +-
27 include/linux/mfd/ezx-pcap.h | 1 +
28 2 files changed, 2 insertions(+), 1 deletions(-)
29
30diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c
31index 43a76c4..db662e2 100644
32--- a/drivers/mfd/ezx-pcap.c
33+++ b/drivers/mfd/ezx-pcap.c
34@@ -202,7 +202,7 @@ static void pcap_isr_work(struct work_struct *work)
35 }
36 local_irq_enable();
37 ezx_pcap_write(pcap, PCAP_REG_MSR, pcap->msr);
38- } while (gpio_get_value(irq_to_gpio(pcap->spi->irq)));
39+ } while (gpio_get_value(pdata->gpio));
40 }
41
42 static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc)
43diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h
44index 40c37216..32a1b5c 100644
45--- a/include/linux/mfd/ezx-pcap.h
46+++ b/include/linux/mfd/ezx-pcap.h
47@@ -16,6 +16,7 @@ struct pcap_subdev {
48 struct pcap_platform_data {
49 unsigned int irq_base;
50 unsigned int config;
51+ int gpio;
52 void (*init) (void *); /* board specific init */
53 int num_subdevs;
54 struct pcap_subdev *subdevs;
55--
561.7.7.6
57
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0030-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0030-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch
new file mode 100644
index 00000000..ba341a41
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0030-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch
@@ -0,0 +1,150 @@
1From 2cc9ed812de17dc47de5a66405766895cc02c729 Mon Sep 17 00:00:00 2001
2From: Arnd Bergmann <arnd@arndb.de>
3Date: Mon, 30 Apr 2012 16:21:37 +0000
4Subject: [PATCH 30/38] Input: eeti_ts: pass gpio value instead of IRQ
5
6commit 4eef6cbfcc03b294d9d334368a851b35b496ce53 upstream.
7
8The EETI touchscreen asserts its IRQ line as soon as it has data in its
9internal buffers. The line is automatically deasserted once all data has
10been read via I2C. Hence, the driver has to monitor the GPIO line and
11cannot simply rely on the interrupt handler reception.
12
13In the current implementation of the driver, irq_to_gpio() is used to
14determine the GPIO number from the i2c_client's IRQ value.
15
16As irq_to_gpio() is not available on all platforms, this patch changes
17this and makes the driver ignore the passed in IRQ. Instead, a GPIO is
18added to the platform_data struct and gpio_to_irq is used to derive the
19IRQ from that GPIO. If this fails, bail out. The driver is only able to
20work in environments where the touchscreen GPIO can be mapped to an
21IRQ.
22
23Without this patch, building raumfeld_defconfig results in:
24
25drivers/input/touchscreen/eeti_ts.c: In function 'eeti_ts_irq_active':
26drivers/input/touchscreen/eeti_ts.c:65:2: error: implicit declaration of function 'irq_to_gpio' [-Werror=implicit-function-declaration]
27
28Signed-off-by: Daniel Mack <zonque@gmail.com>
29Signed-off-by: Arnd Bergmann <arnd@arndb.de>
30Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
31Cc: Sven Neumann <s.neumann@raumfeld.com>
32Cc: linux-input@vger.kernel.org
33Cc: Haojian Zhuang <haojian.zhuang@gmail.com>
34[bwh: Backported to 3.2: raumfeld_controller_i2c_board_info.irq was
35 initialised using gpio_to_irq(), but this doesn't seem to matter]
36Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
37---
38 arch/arm/mach-pxa/raumfeld.c | 2 +-
39 drivers/input/touchscreen/eeti_ts.c | 21 +++++++++++++--------
40 include/linux/input/eeti_ts.h | 1 +
41 3 files changed, 15 insertions(+), 9 deletions(-)
42
43diff --git a/arch/arm/mach-pxa/raumfeld.c b/arch/arm/mach-pxa/raumfeld.c
44index f0c05f4..ae7786d 100644
45--- a/arch/arm/mach-pxa/raumfeld.c
46+++ b/arch/arm/mach-pxa/raumfeld.c
47@@ -951,12 +951,12 @@ static struct i2c_board_info raumfeld_connector_i2c_board_info __initdata = {
48
49 static struct eeti_ts_platform_data eeti_ts_pdata = {
50 .irq_active_high = 1,
51+ .irq_gpio = GPIO_TOUCH_IRQ,
52 };
53
54 static struct i2c_board_info raumfeld_controller_i2c_board_info __initdata = {
55 .type = "eeti_ts",
56 .addr = 0x0a,
57- .irq = gpio_to_irq(GPIO_TOUCH_IRQ),
58 .platform_data = &eeti_ts_pdata,
59 };
60
61diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
62index 7f8f538..4f938bb 100644
63--- a/drivers/input/touchscreen/eeti_ts.c
64+++ b/drivers/input/touchscreen/eeti_ts.c
65@@ -48,7 +48,7 @@ struct eeti_ts_priv {
66 struct input_dev *input;
67 struct work_struct work;
68 struct mutex mutex;
69- int irq, irq_active_high;
70+ int irq_gpio, irq, irq_active_high;
71 };
72
73 #define EETI_TS_BITDEPTH (11)
74@@ -62,7 +62,7 @@ struct eeti_ts_priv {
75
76 static inline int eeti_ts_irq_active(struct eeti_ts_priv *priv)
77 {
78- return gpio_get_value(irq_to_gpio(priv->irq)) == priv->irq_active_high;
79+ return gpio_get_value(priv->irq_gpio) == priv->irq_active_high;
80 }
81
82 static void eeti_ts_read(struct work_struct *work)
83@@ -157,7 +157,7 @@ static void eeti_ts_close(struct input_dev *dev)
84 static int __devinit eeti_ts_probe(struct i2c_client *client,
85 const struct i2c_device_id *idp)
86 {
87- struct eeti_ts_platform_data *pdata;
88+ struct eeti_ts_platform_data *pdata = client->dev.platform_data;
89 struct eeti_ts_priv *priv;
90 struct input_dev *input;
91 unsigned int irq_flags;
92@@ -199,9 +199,12 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
93
94 priv->client = client;
95 priv->input = input;
96- priv->irq = client->irq;
97+ priv->irq_gpio = pdata->irq_gpio;
98+ priv->irq = gpio_to_irq(pdata->irq_gpio);
99
100- pdata = client->dev.platform_data;
101+ err = gpio_request_one(pdata->irq_gpio, GPIOF_IN, client->name);
102+ if (err < 0)
103+ goto err1;
104
105 if (pdata)
106 priv->irq_active_high = pdata->irq_active_high;
107@@ -215,13 +218,13 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
108
109 err = input_register_device(input);
110 if (err)
111- goto err1;
112+ goto err2;
113
114 err = request_irq(priv->irq, eeti_ts_isr, irq_flags,
115 client->name, priv);
116 if (err) {
117 dev_err(&client->dev, "Unable to request touchscreen IRQ.\n");
118- goto err2;
119+ goto err3;
120 }
121
122 /*
123@@ -233,9 +236,11 @@ static int __devinit eeti_ts_probe(struct i2c_client *client,
124 device_init_wakeup(&client->dev, 0);
125 return 0;
126
127-err2:
128+err3:
129 input_unregister_device(input);
130 input = NULL; /* so we dont try to free it below */
131+err2:
132+ gpio_free(pdata->irq_gpio);
133 err1:
134 input_free_device(input);
135 kfree(priv);
136diff --git a/include/linux/input/eeti_ts.h b/include/linux/input/eeti_ts.h
137index f875b31..16625d7 100644
138--- a/include/linux/input/eeti_ts.h
139+++ b/include/linux/input/eeti_ts.h
140@@ -2,6 +2,7 @@
141 #define LINUX_INPUT_EETI_TS_H
142
143 struct eeti_ts_platform_data {
144+ int irq_gpio;
145 unsigned int irq_active_high;
146 };
147
148--
1491.7.7.6
150
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0031-drm-i915-Add-wait_for-in-init_ring_common.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0031-drm-i915-Add-wait_for-in-init_ring_common.patch
new file mode 100644
index 00000000..e45866d8
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0031-drm-i915-Add-wait_for-in-init_ring_common.patch
@@ -0,0 +1,41 @@
1From d23b1ce378587bb69517adb584a891ae632e6796 Mon Sep 17 00:00:00 2001
2From: Sean Paul <seanpaul@chromium.org>
3Date: Fri, 16 Mar 2012 12:43:22 -0400
4Subject: [PATCH 31/38] drm/i915: Add wait_for in init_ring_common
5
6commit f01db988ef6f6c70a6cc36ee71e4a98a68901229 upstream.
7
8I have seen a number of "blt ring initialization failed" messages
9where the ctl or start registers are not the correct value. Upon further
10inspection, if the code just waited a little bit, it would read the
11correct value. Adding the wait_for to these reads should eliminate the
12issue.
13
14Signed-off-by: Sean Paul <seanpaul@chromium.org>
15Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
16Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/gpu/drm/i915/intel_ringbuffer.c | 6 +++---
20 1 files changed, 3 insertions(+), 3 deletions(-)
21
22diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
23index d2cbe5d..4983e59 100644
24--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
25+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
26@@ -295,9 +295,9 @@ static int init_ring_common(struct intel_ring_buffer *ring)
27 | RING_VALID);
28
29 /* If the head is still not zero, the ring is dead */
30- if ((I915_READ_CTL(ring) & RING_VALID) == 0 ||
31- I915_READ_START(ring) != obj->gtt_offset ||
32- (I915_READ_HEAD(ring) & HEAD_ADDR) != 0) {
33+ if (wait_for((I915_READ_CTL(ring) & RING_VALID) != 0 &&
34+ I915_READ_START(ring) == obj->gtt_offset &&
35+ (I915_READ_HEAD(ring) & HEAD_ADDR) == 0, 50)) {
36 DRM_ERROR("%s initialization failed "
37 "ctl %08x head %08x tail %08x start %08x\n",
38 ring->name,
39--
401.7.7.6
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0032-drm-i915-correctly-order-the-ring-init-sequence.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0032-drm-i915-correctly-order-the-ring-init-sequence.patch
new file mode 100644
index 00000000..dffe4ded
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0032-drm-i915-correctly-order-the-ring-init-sequence.patch
@@ -0,0 +1,49 @@
1From 0985ae7d2afe20b2e54416d1985672a37aea9f0a Mon Sep 17 00:00:00 2001
2From: Daniel Vetter <daniel.vetter@ffwll.ch>
3Date: Tue, 7 Aug 2012 09:54:14 +0200
4Subject: [PATCH 32/38] drm/i915: correctly order the ring init sequence
5
6commit 0d8957c8a90bbb5d34fab9a304459448a5131e06 upstream.
7
8We may only start to set up the new register values after having
9confirmed that the ring is truely off. Otherwise the hw might lose the
10newly written register values. This is caught later on in the init
11sequence, when we check whether the register writes have stuck.
12
13Reviewed-by: Jani Nikula <jani.nikula@intel.com>
14Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50522
15Tested-by: Yang Guang <guang.a.yang@intel.com>
16Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
17Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
18---
19 drivers/gpu/drm/i915/intel_ringbuffer.c | 7 +++++--
20 1 files changed, 5 insertions(+), 2 deletions(-)
21
22diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
23index 4983e59..19085c0 100644
24--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
25+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
26@@ -263,8 +263,6 @@ static int init_ring_common(struct intel_ring_buffer *ring)
27 I915_WRITE_HEAD(ring, 0);
28 ring->write_tail(ring, 0);
29
30- /* Initialize the ring. */
31- I915_WRITE_START(ring, obj->gtt_offset);
32 head = I915_READ_HEAD(ring) & HEAD_ADDR;
33
34 /* G45 ring initialization fails to reset head to zero */
35@@ -290,6 +288,11 @@ static int init_ring_common(struct intel_ring_buffer *ring)
36 }
37 }
38
39+ /* Initialize the ring. This must happen _after_ we've cleared the ring
40+ * registers with the above sequence (the readback of the HEAD registers
41+ * also enforces ordering), otherwise the hw might lose the new ring
42+ * register values. */
43+ I915_WRITE_START(ring, obj->gtt_offset);
44 I915_WRITE_CTL(ring,
45 ((ring->size - PAGE_SIZE) & RING_NR_PAGES)
46 | RING_VALID);
47--
481.7.7.6
49
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0033-s390-compat-fix-compat-wrappers-for-process_vm-syste.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0033-s390-compat-fix-compat-wrappers-for-process_vm-syste.patch
new file mode 100644
index 00000000..b004b580
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0033-s390-compat-fix-compat-wrappers-for-process_vm-syste.patch
@@ -0,0 +1,40 @@
1From 664f500626e5151a1b9350bb7e6fc68618d7769c Mon Sep 17 00:00:00 2001
2From: Heiko Carstens <heiko.carstens@de.ibm.com>
3Date: Tue, 7 Aug 2012 09:48:13 +0200
4Subject: [PATCH 33/38] s390/compat: fix compat wrappers for process_vm system
5 calls
6
7commit 82aabdb6f1eb61e0034ec23901480f5dd23db7c4 upstream.
8
9The compat wrappers incorrectly called the non compat versions of
10the system process_vm system calls.
11
12Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
13Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
14Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
15---
16 arch/s390/kernel/compat_wrapper.S | 4 ++--
17 1 files changed, 2 insertions(+), 2 deletions(-)
18
19diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S
20index 18c51df..25408d3 100644
21--- a/arch/s390/kernel/compat_wrapper.S
22+++ b/arch/s390/kernel/compat_wrapper.S
23@@ -1636,7 +1636,7 @@ ENTRY(compat_sys_process_vm_readv_wrapper)
24 llgfr %r6,%r6 # unsigned long
25 llgf %r0,164(%r15) # unsigned long
26 stg %r0,160(%r15)
27- jg sys_process_vm_readv
28+ jg compat_sys_process_vm_readv
29
30 ENTRY(compat_sys_process_vm_writev_wrapper)
31 lgfr %r2,%r2 # compat_pid_t
32@@ -1646,4 +1646,4 @@ ENTRY(compat_sys_process_vm_writev_wrapper)
33 llgfr %r6,%r6 # unsigned long
34 llgf %r0,164(%r15) # unsigned long
35 stg %r0,160(%r15)
36- jg sys_process_vm_writev
37+ jg compat_sys_process_vm_writev
38--
391.7.7.6
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0034-s390-compat-fix-mmap-compat-system-calls.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0034-s390-compat-fix-mmap-compat-system-calls.patch
new file mode 100644
index 00000000..043e7ccd
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0034-s390-compat-fix-mmap-compat-system-calls.patch
@@ -0,0 +1,54 @@
1From 406540dcb821843e6807203e7530a00909d42bf0 Mon Sep 17 00:00:00 2001
2From: Heiko Carstens <heiko.carstens@de.ibm.com>
3Date: Wed, 8 Aug 2012 09:32:20 +0200
4Subject: [PATCH 34/38] s390/compat: fix mmap compat system calls
5
6commit e85871218513c54f7dfdb6009043cb638f2fecbe upstream.
7
8The native 31 bit and the compat behaviour for the mmap system calls differ:
9
10In native 31 bit mode the passed in address for the mmap system call will be
11unmodified passed to sys_mmap_pgoff().
12In compat mode however the passed in address will be modified with
13compat_ptr() which masks out the most significant bit.
14
15The result is that in native 31 bit mode each mmap request (with MAP_FIXED)
16will fail where the most significat bit is set, while in compat mode it
17may succeed.
18
19This odd behaviour was introduced with d3815898 "[S390] mmap: add missing
20compat_ptr conversion to both mmap compat syscalls".
21
22To restore a consistent behaviour accross native and compat mode this
23patch functionally reverts the above mentioned commit.
24
25Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
26Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
27Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
28---
29 arch/s390/kernel/compat_linux.c | 2 --
30 1 files changed, 0 insertions(+), 2 deletions(-)
31
32diff --git a/arch/s390/kernel/compat_linux.c b/arch/s390/kernel/compat_linux.c
33index 84a9828..38c6645 100644
34--- a/arch/s390/kernel/compat_linux.c
35+++ b/arch/s390/kernel/compat_linux.c
36@@ -615,7 +615,6 @@ asmlinkage unsigned long old32_mmap(struct mmap_arg_struct_emu31 __user *arg)
37 return -EFAULT;
38 if (a.offset & ~PAGE_MASK)
39 return -EINVAL;
40- a.addr = (unsigned long) compat_ptr(a.addr);
41 return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd,
42 a.offset >> PAGE_SHIFT);
43 }
44@@ -626,7 +625,6 @@ asmlinkage long sys32_mmap2(struct mmap_arg_struct_emu31 __user *arg)
45
46 if (copy_from_user(&a, arg, sizeof(a)))
47 return -EFAULT;
48- a.addr = (unsigned long) compat_ptr(a.addr);
49 return sys_mmap_pgoff(a.addr, a.len, a.prot, a.flags, a.fd, a.offset);
50 }
51
52--
531.7.7.6
54
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0035-drm-radeon-fix-bank-tiling-parameters-on-evergreen.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0035-drm-radeon-fix-bank-tiling-parameters-on-evergreen.patch
new file mode 100644
index 00000000..e95ddc77
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0035-drm-radeon-fix-bank-tiling-parameters-on-evergreen.patch
@@ -0,0 +1,44 @@
1From 15678bda8906e4eef89b8b2f9661a765f86aced6 Mon Sep 17 00:00:00 2001
2From: Alex Deucher <alexander.deucher@amd.com>
3Date: Tue, 31 Jul 2012 11:01:10 -0400
4Subject: [PATCH 35/38] drm/radeon: fix bank tiling parameters on evergreen
5
6commit c8d15edc17d836686d1f071e564800e1a2724fa6 upstream.
7
8Handle the 16 bank case.
9
10Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
12---
13 drivers/gpu/drm/radeon/evergreen.c | 14 +++++++++++---
14 1 files changed, 11 insertions(+), 3 deletions(-)
15
16diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
17index 931f4df..3fdbdd1 100644
18--- a/drivers/gpu/drm/radeon/evergreen.c
19+++ b/drivers/gpu/drm/radeon/evergreen.c
20@@ -2080,10 +2080,18 @@ static void evergreen_gpu_init(struct radeon_device *rdev)
21 if (rdev->flags & RADEON_IS_IGP)
22 rdev->config.evergreen.tile_config |= 1 << 4;
23 else {
24- if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
25- rdev->config.evergreen.tile_config |= 1 << 4;
26- else
27+ switch ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) {
28+ case 0: /* four banks */
29 rdev->config.evergreen.tile_config |= 0 << 4;
30+ break;
31+ case 1: /* eight banks */
32+ rdev->config.evergreen.tile_config |= 1 << 4;
33+ break;
34+ case 2: /* sixteen banks */
35+ default:
36+ rdev->config.evergreen.tile_config |= 2 << 4;
37+ break;
38+ }
39 }
40 rdev->config.evergreen.tile_config |=
41 ((mc_arb_ramcfg & BURSTLENGTH_MASK) >> BURSTLENGTH_SHIFT) << 8;
42--
431.7.7.6
44
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0036-drm-radeon-fix-bank-tiling-parameters-on-cayman.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0036-drm-radeon-fix-bank-tiling-parameters-on-cayman.patch
new file mode 100644
index 00000000..e001c22c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0036-drm-radeon-fix-bank-tiling-parameters-on-cayman.patch
@@ -0,0 +1,45 @@
1From 175620c56b4907a68fd11f7bfbea559739394915 Mon Sep 17 00:00:00 2001
2From: Alex Deucher <alexander.deucher@amd.com>
3Date: Tue, 31 Jul 2012 11:05:11 -0400
4Subject: [PATCH 36/38] drm/radeon: fix bank tiling parameters on cayman
5
6commit 5b23c9045a8b61352986270b2d109edf5085e113 upstream.
7
8Handle the 16 bank case.
9
10Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11[bwh: Backported to 3.2: adjust context, indentation]
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13---
14 drivers/gpu/drm/radeon/ni.c | 14 +++++++++++---
15 1 files changed, 11 insertions(+), 3 deletions(-)
16
17diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c
18index 9e50814..636255b 100644
19--- a/drivers/gpu/drm/radeon/ni.c
20+++ b/drivers/gpu/drm/radeon/ni.c
21@@ -804,10 +804,18 @@ static void cayman_gpu_init(struct radeon_device *rdev)
22 rdev->config.cayman.tile_config |= (3 << 0);
23 break;
24 }
25- if ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT)
26- rdev->config.cayman.tile_config |= 1 << 4;
27- else
28+ switch ((mc_arb_ramcfg & NOOFBANK_MASK) >> NOOFBANK_SHIFT) {
29+ case 0: /* four banks */
30 rdev->config.cayman.tile_config |= 0 << 4;
31+ break;
32+ case 1: /* eight banks */
33+ rdev->config.cayman.tile_config |= 1 << 4;
34+ break;
35+ case 2: /* sixteen banks */
36+ default:
37+ rdev->config.cayman.tile_config |= 2 << 4;
38+ break;
39+ }
40 rdev->config.cayman.tile_config |=
41 ((gb_addr_config & PIPE_INTERLEAVE_SIZE_MASK) >> PIPE_INTERLEAVE_SIZE_SHIFT) << 8;
42 rdev->config.cayman.tile_config |=
43--
441.7.7.6
45
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0037-drm-radeon-do-not-reenable-crtc-after-moving-vram-st.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0037-drm-radeon-do-not-reenable-crtc-after-moving-vram-st.patch
new file mode 100644
index 00000000..435ae160
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0037-drm-radeon-do-not-reenable-crtc-after-moving-vram-st.patch
@@ -0,0 +1,178 @@
1From 5c84fba575f5b4915184ba74d2f3be21ffb231b9 Mon Sep 17 00:00:00 2001
2From: Jerome Glisse <jglisse@redhat.com>
3Date: Fri, 27 Jul 2012 16:32:24 -0400
4Subject: [PATCH 37/38] drm/radeon: do not reenable crtc after moving vram
5 start address
6
7commit 81ee8fb6b52ec69eeed37fe7943446af1dccecc5 upstream.
8
9It seems we can not update the crtc scanout address. After disabling
10crtc, update to base address do not take effect after crtc being
11reenable leading to at least frame being scanout from the old crtc
12base address. Disabling crtc display request lead to same behavior.
13
14So after changing the vram address if we don't keep crtc disabled
15we will have the GPU trying to read some random system memory address
16with some iommu this will broke the crtc engine and will lead to
17broken display and iommu error message.
18
19So to avoid this, disable crtc. For flicker less boot we will need
20to avoid moving the vram start address.
21
22This patch should also fix :
23
24https://bugs.freedesktop.org/show_bug.cgi?id=42373
25
26Signed-off-by: Jerome Glisse <jglisse@redhat.com>
27Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
28---
29 drivers/gpu/drm/radeon/evergreen.c | 57 ----------------------------------
30 drivers/gpu/drm/radeon/radeon_asic.h | 8 +---
31 drivers/gpu/drm/radeon/rv515.c | 13 --------
32 3 files changed, 2 insertions(+), 76 deletions(-)
33
34diff --git a/drivers/gpu/drm/radeon/evergreen.c b/drivers/gpu/drm/radeon/evergreen.c
35index 3fdbdd1..fc0633c 100644
36--- a/drivers/gpu/drm/radeon/evergreen.c
37+++ b/drivers/gpu/drm/radeon/evergreen.c
38@@ -1065,24 +1065,8 @@ void evergreen_agp_enable(struct radeon_device *rdev)
39
40 void evergreen_mc_stop(struct radeon_device *rdev, struct evergreen_mc_save *save)
41 {
42- save->vga_control[0] = RREG32(D1VGA_CONTROL);
43- save->vga_control[1] = RREG32(D2VGA_CONTROL);
44 save->vga_render_control = RREG32(VGA_RENDER_CONTROL);
45 save->vga_hdp_control = RREG32(VGA_HDP_CONTROL);
46- save->crtc_control[0] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET);
47- save->crtc_control[1] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET);
48- if (rdev->num_crtc >= 4) {
49- save->vga_control[2] = RREG32(EVERGREEN_D3VGA_CONTROL);
50- save->vga_control[3] = RREG32(EVERGREEN_D4VGA_CONTROL);
51- save->crtc_control[2] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET);
52- save->crtc_control[3] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET);
53- }
54- if (rdev->num_crtc >= 6) {
55- save->vga_control[4] = RREG32(EVERGREEN_D5VGA_CONTROL);
56- save->vga_control[5] = RREG32(EVERGREEN_D6VGA_CONTROL);
57- save->crtc_control[4] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET);
58- save->crtc_control[5] = RREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET);
59- }
60
61 /* Stop all video */
62 WREG32(VGA_RENDER_CONTROL, 0);
63@@ -1193,47 +1177,6 @@ void evergreen_mc_resume(struct radeon_device *rdev, struct evergreen_mc_save *s
64 /* Unlock host access */
65 WREG32(VGA_HDP_CONTROL, save->vga_hdp_control);
66 mdelay(1);
67- /* Restore video state */
68- WREG32(D1VGA_CONTROL, save->vga_control[0]);
69- WREG32(D2VGA_CONTROL, save->vga_control[1]);
70- if (rdev->num_crtc >= 4) {
71- WREG32(EVERGREEN_D3VGA_CONTROL, save->vga_control[2]);
72- WREG32(EVERGREEN_D4VGA_CONTROL, save->vga_control[3]);
73- }
74- if (rdev->num_crtc >= 6) {
75- WREG32(EVERGREEN_D5VGA_CONTROL, save->vga_control[4]);
76- WREG32(EVERGREEN_D6VGA_CONTROL, save->vga_control[5]);
77- }
78- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 1);
79- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 1);
80- if (rdev->num_crtc >= 4) {
81- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 1);
82- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 1);
83- }
84- if (rdev->num_crtc >= 6) {
85- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 1);
86- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 1);
87- }
88- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC0_REGISTER_OFFSET, save->crtc_control[0]);
89- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC1_REGISTER_OFFSET, save->crtc_control[1]);
90- if (rdev->num_crtc >= 4) {
91- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC2_REGISTER_OFFSET, save->crtc_control[2]);
92- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC3_REGISTER_OFFSET, save->crtc_control[3]);
93- }
94- if (rdev->num_crtc >= 6) {
95- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC4_REGISTER_OFFSET, save->crtc_control[4]);
96- WREG32(EVERGREEN_CRTC_CONTROL + EVERGREEN_CRTC5_REGISTER_OFFSET, save->crtc_control[5]);
97- }
98- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC0_REGISTER_OFFSET, 0);
99- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC1_REGISTER_OFFSET, 0);
100- if (rdev->num_crtc >= 4) {
101- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC2_REGISTER_OFFSET, 0);
102- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC3_REGISTER_OFFSET, 0);
103- }
104- if (rdev->num_crtc >= 6) {
105- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC4_REGISTER_OFFSET, 0);
106- WREG32(EVERGREEN_CRTC_UPDATE_LOCK + EVERGREEN_CRTC5_REGISTER_OFFSET, 0);
107- }
108 WREG32(VGA_RENDER_CONTROL, save->vga_render_control);
109 }
110
111diff --git a/drivers/gpu/drm/radeon/radeon_asic.h b/drivers/gpu/drm/radeon/radeon_asic.h
112index 5991484..5ce9402 100644
113--- a/drivers/gpu/drm/radeon/radeon_asic.h
114+++ b/drivers/gpu/drm/radeon/radeon_asic.h
115@@ -253,13 +253,10 @@ void rs690_line_buffer_adjust(struct radeon_device *rdev,
116 * rv515
117 */
118 struct rv515_mc_save {
119- u32 d1vga_control;
120- u32 d2vga_control;
121 u32 vga_render_control;
122 u32 vga_hdp_control;
123- u32 d1crtc_control;
124- u32 d2crtc_control;
125 };
126+
127 int rv515_init(struct radeon_device *rdev);
128 void rv515_fini(struct radeon_device *rdev);
129 uint32_t rv515_mc_rreg(struct radeon_device *rdev, uint32_t reg);
130@@ -387,11 +384,10 @@ void r700_cp_fini(struct radeon_device *rdev);
131 * evergreen
132 */
133 struct evergreen_mc_save {
134- u32 vga_control[6];
135 u32 vga_render_control;
136 u32 vga_hdp_control;
137- u32 crtc_control[6];
138 };
139+
140 void evergreen_pcie_gart_tlb_flush(struct radeon_device *rdev);
141 int evergreen_init(struct radeon_device *rdev);
142 void evergreen_fini(struct radeon_device *rdev);
143diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
144index 6613ee9..d5f45b4 100644
145--- a/drivers/gpu/drm/radeon/rv515.c
146+++ b/drivers/gpu/drm/radeon/rv515.c
147@@ -281,12 +281,8 @@ int rv515_debugfs_ga_info_init(struct radeon_device *rdev)
148
149 void rv515_mc_stop(struct radeon_device *rdev, struct rv515_mc_save *save)
150 {
151- save->d1vga_control = RREG32(R_000330_D1VGA_CONTROL);
152- save->d2vga_control = RREG32(R_000338_D2VGA_CONTROL);
153 save->vga_render_control = RREG32(R_000300_VGA_RENDER_CONTROL);
154 save->vga_hdp_control = RREG32(R_000328_VGA_HDP_CONTROL);
155- save->d1crtc_control = RREG32(R_006080_D1CRTC_CONTROL);
156- save->d2crtc_control = RREG32(R_006880_D2CRTC_CONTROL);
157
158 /* Stop all video */
159 WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
160@@ -311,15 +307,6 @@ void rv515_mc_resume(struct radeon_device *rdev, struct rv515_mc_save *save)
161 /* Unlock host access */
162 WREG32(R_000328_VGA_HDP_CONTROL, save->vga_hdp_control);
163 mdelay(1);
164- /* Restore video state */
165- WREG32(R_000330_D1VGA_CONTROL, save->d1vga_control);
166- WREG32(R_000338_D2VGA_CONTROL, save->d2vga_control);
167- WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 1);
168- WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 1);
169- WREG32(R_006080_D1CRTC_CONTROL, save->d1crtc_control);
170- WREG32(R_006880_D2CRTC_CONTROL, save->d2crtc_control);
171- WREG32(R_0060E8_D1CRTC_UPDATE_LOCK, 0);
172- WREG32(R_0068E8_D2CRTC_UPDATE_LOCK, 0);
173 WREG32(R_000300_VGA_RENDER_CONTROL, save->vga_render_control);
174 }
175
176--
1771.7.7.6
178
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0038-Linux-3.2.28.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0038-Linux-3.2.28.patch
new file mode 100644
index 00000000..54aab40b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.28/0038-Linux-3.2.28.patch
@@ -0,0 +1,24 @@
1From 07d458defd356c96a7d4edaeae46b5b17f37fd2b Mon Sep 17 00:00:00 2001
2From: Ben Hutchings <ben@decadent.org.uk>
3Date: Sun, 19 Aug 2012 18:15:38 +0100
4Subject: [PATCH 38/38] Linux 3.2.28
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index bdf851f..5368961 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 27
18+SUBLEVEL = 28
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.6
24
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0086-board-am335xevm-Add-Beaglebone-Motor-Cape-Support.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0086-board-am335xevm-Add-Beaglebone-Motor-Cape-Support.patch
new file mode 100644
index 00000000..78055d0f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0086-board-am335xevm-Add-Beaglebone-Motor-Cape-Support.patch
@@ -0,0 +1,43 @@
1From 4184217cda11245823527d7b3b65fcb9eeb88c6a Mon Sep 17 00:00:00 2001
2From: Roger Monk <r-monk@ti.com>
3Date: Mon, 13 Aug 2012 21:44:49 +0100
4Subject: [PATCH 86/87] board-am335xevm: Add Beaglebone Motor Cape Support
5
6 * Beaglebone Motor Cape adds 4 DRV8833 devices connected to
7 the 8 PWM outputs on the beaglebone allowing 8 DC Motors or
8 4 Stepper Motors to be controlled
9 * If PWM channels are not available some of these channels can be
10 remapped to GPIO pins via jumpers
11
12 * GPIOs are used for Direction control of each motor channel (1 per channel)
13 * GPIOs are also used for Sense Feedback from each motor (2 per channel)
14 * Channel 1 sense pins are mapped to QEP0 for use with quadrature encoders
15
16 * Initial Patch recognises the Motor Cape and makes all necessary
17 pins available by ensuring w1 and spi1 are marked as in-use
18
19Signed-off-by: Roger Monk <r-monk@ti.com>
20---
21 arch/arm/mach-omap2/board-am335xevm.c | 6 ++++++
22 1 files changed, 6 insertions(+), 0 deletions(-)
23
24diff --git a/arch/arm/mach-omap2/board-am335xevm.c b/arch/arm/mach-omap2/board-am335xevm.c
25index 699fab3..f2d4a69 100644
26--- a/arch/arm/mach-omap2/board-am335xevm.c
27+++ b/arch/arm/mach-omap2/board-am335xevm.c
28@@ -3165,6 +3165,12 @@ static void beaglebone_cape_setup(struct memory_accessor *mem_acc, void *context
29 cssp_gpmc_init();
30 }
31
32+ if (!strncmp("BB-BONE-MOTOR-01", cape_config.partnumber, 16)) {
33+ pr_info("BeagleBone cape: initializing Motor cape\n");
34+ beaglebone_w1gpio_free = 0;
35+ beaglebone_spi1_free = 0;
36+ }
37+
38 goto out2;
39 out:
40 /*
41--
421.7.7.6
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0087-mux33xx-Fix-MUXENTRYs-for-MCASP0_ACLKX-FSX-to-add-eh.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0087-mux33xx-Fix-MUXENTRYs-for-MCASP0_ACLKX-FSX-to-add-eh.patch
new file mode 100644
index 00000000..d361e16a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/beaglebone/0087-mux33xx-Fix-MUXENTRYs-for-MCASP0_ACLKX-FSX-to-add-eh.patch
@@ -0,0 +1,37 @@
1From 2bb4fd4b7a1eb2a29de53ca66c67ca92ae52351e Mon Sep 17 00:00:00 2001
2From: Roger Monk <r-monk@ti.com>
3Date: Tue, 14 Aug 2012 18:06:13 +0100
4Subject: [PATCH 87/87] mux33xx: Fix MUXENTRYs for MCASP0_ACLKX/FSX to add
5 ehrpwm0 and pru pins
6
7 * Add Mux Entries for ehrpwm0 to MCASP0_CLKX/FSX pins
8 * Also add modes 5/6 to the same pins for completeness (pru pins)
9
10Signed-off-by: Roger Monk <r-monk@ti.com>
11---
12 arch/arm/mach-omap2/mux33xx.c | 8 ++++----
13 1 files changed, 4 insertions(+), 4 deletions(-)
14
15diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c
16index 852f7f0..c0d14b3 100644
17--- a/arch/arm/mach-omap2/mux33xx.c
18+++ b/arch/arm/mach-omap2/mux33xx.c
19@@ -335,11 +335,11 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
20 "i2c0_scl", NULL, NULL, NULL,
21 NULL, NULL, NULL, "gpio3_6"),
22 _AM33XX_MUXENTRY(MCASP0_ACLKX, 0,
23- "mcasp0_aclkx", NULL, NULL, "spi1_sclk",
24- "mmc0_sdcd", NULL, NULL, "gpio3_14"),
25+ "mcasp0_aclkx", "ehrpwm0A", NULL, "spi1_sclk",
26+ "mmc0_sdcd", "pr1_pru0_pru_r30_0", "pr1_pru0_pru_r31_0", "gpio3_14"),
27 _AM33XX_MUXENTRY(MCASP0_FSX, 0,
28- "mcasp0_fsx", NULL, NULL, "spi1_d0",
29- "mmc1_sdcd", NULL, NULL, "gpio3_15"),
30+ "mcasp0_fsx", "ehrpwm0B", NULL, "spi1_d0",
31+ "mmc1_sdcd", "pr1_pru0_pru_r30_1", "pr1_pru0_pru_r31_1", "gpio3_15"),
32 _AM33XX_MUXENTRY(MCASP0_AXR0, 0,
33 "mcasp0_axr0", NULL, NULL, "spi1_d1",
34 "mmc2_sdcd", NULL, NULL, "gpio3_16"),
35--
361.7.7.6
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch
index 87b7741b..bd24051e 100644
--- a/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch
@@ -1,7 +1,7 @@
1From 59d23a375a752abc6a6a8ddd935d1b367f69ed3d Mon Sep 17 00:00:00 2001 1From a48682f0690f07aa31d3e9d5d24388f0aee0bf3d Mon Sep 17 00:00:00 2001
2From: Alexander Holler <hol...@ahsoftware.de> 2From: Alexander Holler <hol...@ahsoftware.de>
3Date: Wed, 25 Apr 2012 00:50:03 +0200 3Date: Wed, 25 Apr 2012 00:50:03 +0200
4Subject: [PATCH] leds: heartbeat: stop on shutdown, reboot or panic 4Subject: [PATCH 1/4] leds: heartbeat: stop on shutdown, reboot or panic
5 5
6A halted kernel should not show a heartbeat. 6A halted kernel should not show a heartbeat.
7 7
@@ -9,7 +9,7 @@ Signed-off-by: Alexander Holler <hol...@ahsoftware.de>
9Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> 9Signed-off-by: Koen Kooi <koen@dominion.thruhere.net>
10--- 10---
11 drivers/leds/ledtrig-heartbeat.c | 27 ++++++++++++++++++++++++++- 11 drivers/leds/ledtrig-heartbeat.c | 27 ++++++++++++++++++++++++++-
12 1 file changed, 26 insertions(+), 1 deletion(-) 12 1 files changed, 26 insertions(+), 1 deletions(-)
13 13
14diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c 14diff --git a/drivers/leds/ledtrig-heartbeat.c b/drivers/leds/ledtrig-heartbeat.c
15index 759c0bb..31c234c 100644 15index 759c0bb..31c234c 100644
@@ -63,5 +63,5 @@ index 759c0bb..31c234c 100644
63 } 63 }
64 64
65-- 65--
661.7.10 661.7.7.6
67 67
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0001-PWM-ecap-Correct-configuration-of-polarity.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0001-PWM-ecap-Correct-configuration-of-polarity.patch
new file mode 100644
index 00000000..1d17a8c5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0001-PWM-ecap-Correct-configuration-of-polarity.patch
@@ -0,0 +1,42 @@
1From 0a2068b30dcf949b2852511c4c909e5283cbd540 Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Fri, 18 May 2012 12:10:36 +0530
4Subject: [PATCH 1/6] PWM: ecap: Correct configuration of polarity
5
61. ECAP driver configures PWM polarity wrongly. For example if polarity
7configured low and duty percentage to 20%, PWM output should be 20% low
8and 80% high. However behavior is inverted here.
9
102. Also reading back from SYSFS interface for polarity always gives 0.
11
12This patch fixes both.
13
14Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
15---
16 drivers/pwm/ecap.c | 3 ++-
17 1 files changed, 2 insertions(+), 1 deletions(-)
18
19diff --git a/drivers/pwm/ecap.c b/drivers/pwm/ecap.c
20index 63c2405..614be36 100644
21--- a/drivers/pwm/ecap.c
22+++ b/drivers/pwm/ecap.c
23@@ -121,7 +121,7 @@ static int ecap_pwm_set_polarity(struct pwm_device *p, char pol)
24 spin_lock_irqsave(&ep->lock, flags);
25 v = readw(ep->mmio_base + CAPTURE_CTRL2_REG);
26 v &= ~ECTRL2_PLSL_LOW;
27- v |= (!pol << 10);
28+ v |= pol << 10;
29 writew(v, ep->mmio_base + CAPTURE_CTRL2_REG);
30 spin_unlock_irqrestore(&ep->lock, flags);
31
32@@ -188,6 +188,7 @@ static int ecap_pwm_config(struct pwm_device *p,
33 break;
34
35 case BIT(PWM_CONFIG_POLARITY):
36+ p->active_high = c->polarity;
37 ret = ecap_pwm_set_polarity(p, c->polarity);
38 break;
39
40--
411.7.7.6
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0002-ARM-OMAP2-am335x-mux-add-ecap2_in_pwm2_out-string-en.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0002-ARM-OMAP2-am335x-mux-add-ecap2_in_pwm2_out-string-en.patch
new file mode 100644
index 00000000..009c7857
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0002-ARM-OMAP2-am335x-mux-add-ecap2_in_pwm2_out-string-en.patch
@@ -0,0 +1,29 @@
1From c2496a91c7a198e0713a00d5d8a3e6d6dd8eea30 Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Wed, 16 May 2012 09:43:56 +0530
4Subject: [PATCH 2/6] ARM: OMAP2+: am335x-mux: add ecap2_in_pwm2_out string
5 entry
6
7On am335x-sk board, backlight is control through ecap 2.
8
9Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
10---
11 arch/arm/mach-omap2/mux33xx.c | 2 +-
12 1 files changed, 1 insertions(+), 1 deletions(-)
13
14diff --git a/arch/arm/mach-omap2/mux33xx.c b/arch/arm/mach-omap2/mux33xx.c
15index 59e51e0..5749d20 100644
16--- a/arch/arm/mach-omap2/mux33xx.c
17+++ b/arch/arm/mach-omap2/mux33xx.c
18@@ -340,7 +340,7 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
19 "mmc2_sdcd", NULL, NULL, "gpio3_16"),
20 _AM33XX_MUXENTRY(MCASP0_AHCLKR, 0,
21 "mcasp0_ahclkr", NULL, "mcasp0_axr2", "spi1_cs0",
22- NULL, NULL, NULL, "gpio3_17"),
23+ "ecap2_in_pwm2_out", NULL, NULL, "gpio3_17"),
24 _AM33XX_MUXENTRY(MCASP0_ACLKR, 0,
25 "mcasp0_aclkr", NULL, "mcasp0_axr2", "mcasp1_aclkx",
26 "mmc0_sdwp", NULL, NULL, "gpio3_18"),
27--
281.7.7.6
29
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0003-ARM-OMAP2-AM335x-hwmod-Remove-PRCM-entries-for-PWMSS.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0003-ARM-OMAP2-AM335x-hwmod-Remove-PRCM-entries-for-PWMSS.patch
new file mode 100644
index 00000000..fcdc5b25
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0003-ARM-OMAP2-AM335x-hwmod-Remove-PRCM-entries-for-PWMSS.patch
@@ -0,0 +1,107 @@
1From 3c42d32f6dac363c3a7e3fa491278592409498cf Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Tue, 7 Aug 2012 18:25:50 +0530
4Subject: [PATCH 3/6] ARM: OMAP2+: AM335x: hwmod: Remove PRCM entries for
5 PWMSS
6
7PWMSS clock resources being used as a shared resource for eCAP & eHRPWM
8OMAP devices. However OMAP hwmod didn't protect the race condition for
9accessing shared resources from independent OMAP devices. So removes
10PRCM entries, so that clock framework takes care of clock synchronization
11between eCAP & eHRPWM devices.
12
13NOTE:
14With removal .prcm hwmod data, clock enabling is happening from clock
15frame work. With clock framework, usecount entry in struct clk takes
16care the race condition.
17
18Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
19---
20 arch/arm/mach-omap2/omap_hwmod_33xx_data.c | 36 ----------------------------
21 1 files changed, 0 insertions(+), 36 deletions(-)
22
23diff --git a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
24index 9d3c9a5..832bba3 100644
25--- a/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
26+++ b/arch/arm/mach-omap2/omap_hwmod_33xx_data.c
27@@ -729,12 +729,6 @@ static struct omap_hwmod am33xx_ehrpwm0_hwmod = {
28 .class = &am33xx_epwmss_hwmod_class,
29 .main_clk = "epwmss0_fck",
30 .clkdm_name = "l4ls_clkdm",
31- .prcm = {
32- .omap4 = {
33- .clkctrl_offs = AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
34- .modulemode = MODULEMODE_SWCTRL,
35- },
36- },
37 .slaves = am33xx_ehrpwm0_slaves,
38 .slaves_cnt = ARRAY_SIZE(am33xx_ehrpwm0_slaves),
39 .opt_clks = ehrpwm0_opt_clks,
40@@ -787,12 +781,6 @@ static struct omap_hwmod am33xx_ehrpwm1_hwmod = {
41 .class = &am33xx_epwmss_hwmod_class,
42 .main_clk = "epwmss1_fck",
43 .clkdm_name = "l4ls_clkdm",
44- .prcm = {
45- .omap4 = {
46- .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
47- .modulemode = MODULEMODE_SWCTRL,
48- },
49- },
50 .slaves = am33xx_ehrpwm1_slaves,
51 .slaves_cnt = ARRAY_SIZE(am33xx_ehrpwm1_slaves),
52 .opt_clks = ehrpwm1_opt_clks,
53@@ -845,12 +833,6 @@ static struct omap_hwmod am33xx_ehrpwm2_hwmod = {
54 .class = &am33xx_epwmss_hwmod_class,
55 .main_clk = "epwmss2_fck",
56 .clkdm_name = "l4ls_clkdm",
57- .prcm = {
58- .omap4 = {
59- .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
60- .modulemode = MODULEMODE_SWCTRL,
61- },
62- },
63 .slaves = am33xx_ehrpwm2_slaves,
64 .slaves_cnt = ARRAY_SIZE(am33xx_ehrpwm2_slaves),
65 .opt_clks = ehrpwm2_opt_clks,
66@@ -898,12 +880,6 @@ static struct omap_hwmod am33xx_ecap0_hwmod = {
67 .class = &am33xx_epwmss_hwmod_class,
68 .main_clk = "epwmss0_fck",
69 .clkdm_name = "l4ls_clkdm",
70- .prcm = {
71- .omap4 = {
72- .clkctrl_offs = AM33XX_CM_PER_EPWMSS0_CLKCTRL_OFFSET,
73- .modulemode = MODULEMODE_SWCTRL,
74- },
75- },
76 .slaves = am33xx_ecap0_slaves,
77 .slaves_cnt = ARRAY_SIZE(am33xx_ecap0_slaves),
78 };
79@@ -949,12 +925,6 @@ static struct omap_hwmod am33xx_ecap1_hwmod = {
80 .class = &am33xx_epwmss_hwmod_class,
81 .main_clk = "epwmss1_fck",
82 .clkdm_name = "l4ls_clkdm",
83- .prcm = {
84- .omap4 = {
85- .clkctrl_offs = AM33XX_CM_PER_EPWMSS1_CLKCTRL_OFFSET,
86- .modulemode = MODULEMODE_SWCTRL,
87- },
88- },
89 .slaves = am33xx_ecap1_slaves,
90 .slaves_cnt = ARRAY_SIZE(am33xx_ecap1_slaves),
91 };
92@@ -1000,12 +970,6 @@ static struct omap_hwmod am33xx_ecap2_hwmod = {
93 .class = &am33xx_epwmss_hwmod_class,
94 .clkdm_name = "l4ls_clkdm",
95 .main_clk = "epwmss2_fck",
96- .prcm = {
97- .omap4 = {
98- .clkctrl_offs = AM33XX_CM_PER_EPWMSS2_CLKCTRL_OFFSET,
99- .modulemode = MODULEMODE_SWCTRL,
100- },
101- },
102 .slaves = am33xx_ecap2_slaves,
103 .slaves_cnt = ARRAY_SIZE(am33xx_ecap2_slaves),
104 };
105--
1061.7.7.6
107
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0004-PWM-ecap-Resets-the-PWM-output-to-low-on-stop.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0004-PWM-ecap-Resets-the-PWM-output-to-low-on-stop.patch
new file mode 100644
index 00000000..781e6905
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0004-PWM-ecap-Resets-the-PWM-output-to-low-on-stop.patch
@@ -0,0 +1,40 @@
1From cd86d4c2a2a380a0824a08aed2d878c1d12a94e4 Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Wed, 8 Aug 2012 18:17:11 +0530
4Subject: [PATCH 4/6] PWM: ecap: Resets the PWM output to low on stop
5
6When PWM is stopped, the output on the PWM pin is not reset to low. This
7can result in un-predictable output (example pwm brightness goes to 100%
8if the line is high upon stop).
9This patch fixes by disabling APWM mode on stop & enable it on start.
10
11Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
12---
13 drivers/pwm/ecap.c | 4 ++--
14 1 files changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/drivers/pwm/ecap.c b/drivers/pwm/ecap.c
17index 614be36..670b32e 100644
18--- a/drivers/pwm/ecap.c
19+++ b/drivers/pwm/ecap.c
20@@ -77,7 +77,7 @@ static int ecap_pwm_stop(struct pwm_device *p)
21
22 spin_lock_irqsave(&ep->lock, flags);
23 v = readw(ep->mmio_base + CAPTURE_CTRL2_REG);
24- v &= ~ECTRL2_CTRSTP_FREERUN;
25+ v &= ~(ECTRL2_CTRSTP_FREERUN | ECTRL2_MDSL_ECAP);
26 writew(v, ep->mmio_base + CAPTURE_CTRL2_REG);
27 spin_unlock_irqrestore(&ep->lock, flags);
28
29@@ -103,7 +103,7 @@ static int ecap_pwm_start(struct pwm_device *p)
30
31 spin_lock_irqsave(&ep->lock, flags);
32 v = readw(ep->mmio_base + CAPTURE_CTRL2_REG);
33- v |= ECTRL2_CTRSTP_FREERUN;
34+ v |= (ECTRL2_CTRSTP_FREERUN | ECTRL2_MDSL_ECAP);
35 writew(v, ep->mmio_base + CAPTURE_CTRL2_REG);
36 spin_unlock_irqrestore(&ep->lock, flags);
37 set_bit(FLAG_RUNNING, &p->flags);
38--
391.7.7.6
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0005-PWM-ecap-Fix-for-throwing-PWM-output-before-running.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0005-PWM-ecap-Fix-for-throwing-PWM-output-before-running.patch
new file mode 100644
index 00000000..fb333d8c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0005-PWM-ecap-Fix-for-throwing-PWM-output-before-running.patch
@@ -0,0 +1,52 @@
1From 16bfdd6480abb907b946d1c902205e6f03d7ed68 Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Tue, 14 Aug 2012 13:48:55 +0530
4Subject: [PATCH 5/6] PWM: ecap: Fix for throwing PWM output before running
5
6On configuring duty cycle, APWM mode is enabled and left enabled even if
7PWM not running. Fixes the same by disabling APWM mode if PWM device not
8running. This ensures PWM output is low if PWM device not running.
9
10Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
11---
12 drivers/pwm/ecap.c | 11 +++++++----
13 1 files changed, 7 insertions(+), 4 deletions(-)
14
15diff --git a/drivers/pwm/ecap.c b/drivers/pwm/ecap.c
16index 670b32e..864f3ee 100644
17--- a/drivers/pwm/ecap.c
18+++ b/drivers/pwm/ecap.c
19@@ -131,16 +131,13 @@ static int ecap_pwm_set_polarity(struct pwm_device *p, char pol)
20
21 static int ecap_pwm_config_period(struct pwm_device *p)
22 {
23- unsigned long flags, v;
24+ unsigned long flags;
25 struct ecap_pwm *ep = to_ecap_pwm(p);
26
27 pm_runtime_get_sync(ep->dev);
28
29 spin_lock_irqsave(&ep->lock, flags);
30 writel((p->period_ticks) - 1, ep->mmio_base + CAPTURE_3_REG);
31- v = readw(ep->mmio_base + CAPTURE_CTRL2_REG);
32- v |= (ECTRL2_MDSL_ECAP | ECTRL2_SYNCOSEL_MASK);
33- writew(v, ep->mmio_base + CAPTURE_CTRL2_REG);
34 spin_unlock_irqrestore(&ep->lock, flags);
35
36 pm_runtime_put_sync(ep->dev);
37@@ -167,6 +164,12 @@ static int ecap_pwm_config_duty(struct pwm_device *p)
38 }
39 spin_unlock_irqrestore(&ep->lock, flags);
40
41+ if (!pwm_is_running(p)) {
42+ v = readw(ep->mmio_base + CAPTURE_CTRL2_REG);
43+ v &= ~ECTRL2_MDSL_ECAP;
44+ writew(v, ep->mmio_base + CAPTURE_CTRL2_REG);
45+ }
46+
47 pm_runtime_put_sync(ep->dev);
48 return 0;
49 }
50--
511.7.7.6
52
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0006-pwm-ehrpwm-Configure-polarity-on-pwm_start.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0006-pwm-ehrpwm-Configure-polarity-on-pwm_start.patch
new file mode 100644
index 00000000..3ebb6f7d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/pwm/0006-pwm-ehrpwm-Configure-polarity-on-pwm_start.patch
@@ -0,0 +1,30 @@
1From 76361b6715c04d513b9f6bb4ec79ef2297eafe78 Mon Sep 17 00:00:00 2001
2From: "Philip, Avinash" <avinashphilip@ti.com>
3Date: Tue, 14 Aug 2012 13:50:37 +0530
4Subject: [PATCH 6/6] pwm: ehrpwm: Configure polarity on pwm_start
5
6Polarity of PWM device should done only from start. This helps in
7disabling polarity change even PWM device is running.
8
9Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
10---
11 drivers/pwm/ehrpwm.c | 2 +-
12 1 files changed, 1 insertions(+), 1 deletions(-)
13
14diff --git a/drivers/pwm/ehrpwm.c b/drivers/pwm/ehrpwm.c
15index 8bbed87..636b0d9 100644
16--- a/drivers/pwm/ehrpwm.c
17+++ b/drivers/pwm/ehrpwm.c
18@@ -1284,8 +1284,8 @@ static int ehrpwm_pwm_config(struct pwm_device *p,
19 break;
20
21 case BIT(PWM_CONFIG_POLARITY):
22+ /* Polarity configuration done from pwm_start */
23 p->active_high = c->polarity;
24- ret = ehrpwm_pwm_set_pol(p);
25 break;
26
27 case BIT(PWM_CONFIG_START):
28--
291.7.7.6
30
diff --git a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
index 5cbf46b7..2bc60817 100644
--- a/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
+++ b/recipes-kernel/linux/linux-ti33x-psp_3.2.bb
@@ -11,11 +11,11 @@ S = "${WORKDIR}/git"
11MULTI_CONFIG_BASE_SUFFIX = "" 11MULTI_CONFIG_BASE_SUFFIX = ""
12 12
13# the PATCHES_OVER_PSP updates it to 3.2.x, so adjust PV to match 13# the PATCHES_OVER_PSP updates it to 3.2.x, so adjust PV to match
14PV = "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "3.2", "3.2.25", d)}" 14PV = "${@base_contains('DISTRO_FEATURES', 'tipspkernel', "3.2", "3.2.28", d)}"
15 15
16BRANCH = "v3.2-staging" 16BRANCH = "v3.2-staging"
17SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01" 17SRCREV = "720e07b4c1f687b61b147b31c698cb6816d72f01"
18MACHINE_KERNEL_PR_append = "b+gitr${SRCREV}" 18MACHINE_KERNEL_PR_append = "a+gitr${SRCREV}"
19 19
20COMPATIBLE_MACHINE = "(ti33x)" 20COMPATIBLE_MACHINE = "(ti33x)"
21 21
@@ -1722,7 +1722,116 @@ PATCHES_OVER_PSP = " \
1722 file://3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch \ 1722 file://3.2.25/0071-nouveau-Fix-alignment-requirements-on-src-and-dst-ad.patch \
1723 file://3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch \ 1723 file://3.2.25/0072-mm-fix-wrong-argument-of-migrate_huge_pages-in-soft_.patch \
1724 file://3.2.25/0073-Linux-3.2.25.patch \ 1724 file://3.2.25/0073-Linux-3.2.25.patch \
1725 file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \ 1725 file://3.2.26/0001-x86-Simplify-code-by-removing-a-SMP-ifdefs-from-stru.patch \
1726 file://3.2.26/0002-Linux-3.2.26.patch \
1727 file://3.2.27/0001-sched-Fix-race-in-task_group.patch \
1728 file://3.2.27/0002-floppy-Cleanup-disk-queue-before-caling-put_disk-if-.patch \
1729 file://3.2.27/0003-xen-mark-local-pages-as-FOREIGN-in-the-m2p_override.patch \
1730 file://3.2.27/0004-lirc_sir-make-device-registration-work.patch \
1731 file://3.2.27/0005-stable-update-references-to-older-2.6-versions-for-3.patch \
1732 file://3.2.27/0006-ALSA-hda-add-dock-support-for-Thinkpad-X230-Tablet.patch \
1733 file://3.2.27/0007-cfg80211-fix-interface-combinations-check-for-ADHOC-.patch \
1734 file://3.2.27/0008-m68k-Correct-the-Atari-ALLOWINT-definition.patch \
1735 file://3.2.27/0009-ene_ir-Fix-driver-initialisation.patch \
1736 file://3.2.27/0010-nfsd4-our-filesystems-are-normally-case-sensitive.patch \
1737 file://3.2.27/0011-random-Use-arch_get_random_int-instead-of-cycle-coun.patch \
1738 file://3.2.27/0012-random-Use-arch-specific-RNG-to-initialize-the-entro.patch \
1739 file://3.2.27/0013-random-Adjust-the-number-of-loops-when-initializing.patch \
1740 file://3.2.27/0014-random-make-add_interrupt_randomness-do-something-sa.patch \
1741 file://3.2.27/0015-random-use-lockless-techniques-in-the-interrupt-path.patch \
1742 file://3.2.27/0016-random-create-add_device_randomness-interface.patch \
1743 file://3.2.27/0017-usb-feed-USB-device-information-to-the-dev-random-dr.patch \
1744 file://3.2.27/0018-net-feed-dev-random-with-the-MAC-address-when-regist.patch \
1745 file://3.2.27/0019-random-use-the-arch-specific-rng-in-xfer_secondary_p.patch \
1746 file://3.2.27/0020-random-add-new-get_random_bytes_arch-function.patch \
1747 file://3.2.27/0021-rtc-wm831x-Feed-the-write-counter-into-device_add_ra.patch \
1748 file://3.2.27/0022-mfd-wm831x-Feed-the-device-UUID-into-device_add_rand.patch \
1749 file://3.2.27/0023-ASoC-wm8994-Ensure-there-are-enough-BCLKs-for-four-c.patch \
1750 file://3.2.27/0024-futex-Test-for-pi_mutex-on-fault-in-futex_wait_reque.patch \
1751 file://3.2.27/0025-futex-Fix-bug-in-WARN_ON-for-NULL-q.pi_state.patch \
1752 file://3.2.27/0026-futex-Forbid-uaddr-uaddr2-in-futex_wait_requeue_pi.patch \
1753 file://3.2.27/0027-video-smscufx-fix-line-counting-in-fb_write.patch \
1754 file://3.2.27/0028-Input-synaptics-handle-out-of-bounds-values-from-the.patch \
1755 file://3.2.27/0029-ALSA-hda-Fix-invalid-D3-of-headphone-DAC-on-VT202x-c.patch \
1756 file://3.2.27/0030-ALSA-mpu401-Fix-missing-initialization-of-irq-field.patch \
1757 file://3.2.27/0031-x86-nops-Missing-break-resulting-in-incorrect-select.patch \
1758 file://3.2.27/0032-s390-mm-downgrade-page-table-after-fork-of-a-31-bit-.patch \
1759 file://3.2.27/0033-Redefine-ATOMIC_INIT-and-ATOMIC64_INIT-to-drop-the-c.patch \
1760 file://3.2.27/0034-dm-thin-reduce-endio_hook-pool-size.patch \
1761 file://3.2.27/0035-dm-thin-fix-memory-leak-in-process_prepared_mapping-.patch \
1762 file://3.2.27/0036-random-mix-in-architectural-randomness-in-extract_bu.patch \
1763 file://3.2.27/0037-asus-wmi-use-ASUS_WMI_METHODID_DSTS2-as-default-DSTS.patch \
1764 file://3.2.27/0038-virtio-blk-Use-block-layer-provided-spinlock.patch \
1765 file://3.2.27/0039-s390-mm-fix-fault-handling-for-page-table-walk-case.patch \
1766 file://3.2.27/0040-nfs-skip-commit-in-releasepage-if-we-re-freeing-memo.patch \
1767 file://3.2.27/0041-md-raid1-don-t-abort-a-resync-on-the-first-badblock.patch \
1768 file://3.2.27/0042-pcdp-use-early_ioremap-early_iounmap-to-access-pcdp-.patch \
1769 file://3.2.27/0043-lib-vsprintf.c-kptr_restrict-fix-pK-error-in-SysRq-s.patch \
1770 file://3.2.27/0044-nilfs2-fix-deadlock-issue-between-chcp-and-thaw-ioct.patch \
1771 file://3.2.27/0045-SUNRPC-return-negative-value-in-case-rpcbind-client-.patch \
1772 file://3.2.27/0046-ARM-7467-1-mutex-use-generic-xchg-based-implementati.patch \
1773 file://3.2.27/0047-ARM-7476-1-vfp-only-clear-vfp-state-for-current-cpu-.patch \
1774 file://3.2.27/0048-ARM-7477-1-vfp-Always-save-VFP-state-in-vfp_pm_suspe.patch \
1775 file://3.2.27/0049-ARM-7478-1-errata-extend-workaround-for-erratum-7207.patch \
1776 file://3.2.27/0050-ARM-Fix-undefined-instruction-exception-handling.patch \
1777 file://3.2.27/0051-USB-echi-dbgp-increase-the-controller-wait-time-to-c.patch \
1778 file://3.2.27/0052-ASoC-wm8962-Allow-VMID-time-to-fully-ramp.patch \
1779 file://3.2.27/0053-mm-page_alloc.c-remove-pageblock_default_order.patch \
1780 file://3.2.27/0054-mm-setup-pageblock_order-before-it-s-used-by-sparsem.patch \
1781 file://3.2.27/0055-mm-mmu_notifier-fix-freed-page-still-mapped-in-secon.patch \
1782 file://3.2.27/0056-mm-hugetlbfs-close-race-during-teardown-of-hugetlbfs.patch \
1783 file://3.2.27/0057-ALSA-snd-usb-fix-clock-source-validity-index.patch \
1784 file://3.2.27/0058-ALSA-hda-Support-dock-on-Lenovo-Thinkpad-T530-with-A.patch \
1785 file://3.2.27/0059-ore-Fix-out-of-bounds-access-in-_ios_obj.patch \
1786 file://3.2.27/0060-m68k-Make-sys_atomic_cmpxchg_32-work-on-classic-m68k.patch \
1787 file://3.2.27/0061-drm-i915-prefer-wide-slow-to-fast-narrow-in-DP-confi.patch \
1788 file://3.2.27/0062-rt2x00-Add-support-for-BUFFALO-WLI-UC-GNM2-to-rt2800.patch \
1789 file://3.2.27/0063-drop_monitor-fix-sleeping-in-invalid-context-warning.patch \
1790 file://3.2.27/0064-drop_monitor-Make-updating-data-skb-smp-safe.patch \
1791 file://3.2.27/0065-drop_monitor-prevent-init-path-from-scheduling-on-th.patch \
1792 file://3.2.27/0066-drop_monitor-dont-sleep-in-atomic-context.patch \
1793 file://3.2.27/0067-pch_uart-Fix-missing-break-for-16-byte-fifo.patch \
1794 file://3.2.27/0068-pch_uart-Fix-rx-error-interrupt-setting-issue.patch \
1795 file://3.2.27/0069-pch_uart-Fix-parity-setting-issue.patch \
1796 file://3.2.27/0070-Linux-3.2.27.patch \
1797 file://3.2.28/0001-bnx2-Fix-bug-in-bnx2_free_tx_skbs.patch \
1798 file://3.2.28/0002-sch_sfb-Fix-missing-NULL-check.patch \
1799 file://3.2.28/0003-sctp-Fix-list-corruption-resulting-from-freeing-an-a.patch \
1800 file://3.2.28/0004-caif-Fix-access-to-freed-pernet-memory.patch \
1801 file://3.2.28/0005-cipso-don-t-follow-a-NULL-pointer-when-setsockopt-is.patch \
1802 file://3.2.28/0006-caif-fix-NULL-pointer-check.patch \
1803 file://3.2.28/0007-wanmain-comparing-array-with-NULL.patch \
1804 file://3.2.28/0008-tcp-Add-TCP_USER_TIMEOUT-negative-value-check.patch \
1805 file://3.2.28/0009-USB-kaweth.c-use-GFP_ATOMIC-under-spin_lock.patch \
1806 file://3.2.28/0010-net-fix-rtnetlink-IFF_PROMISC-and-IFF_ALLMULTI-handl.patch \
1807 file://3.2.28/0011-tcp-perform-DMA-to-userspace-only-if-there-is-a-task.patch \
1808 file://3.2.28/0012-net-tun-fix-ioctl-based-info-leaks.patch \
1809 file://3.2.28/0013-e1000-add-dropped-DMA-receive-enable-back-in-for-WoL.patch \
1810 file://3.2.28/0014-rtlwifi-rtl8192cu-Change-buffer-allocation-for-synch.patch \
1811 file://3.2.28/0015-hfsplus-fix-overflow-in-sector-calculations-in-hfspl.patch \
1812 file://3.2.28/0016-drm-i915-fixup-seqno-allocation-logic-for-lazy_reque.patch \
1813 file://3.2.28/0017-KVM-VMX-Advertise-CPU_BASED_RDPMC_EXITING-for-nested.patch \
1814 file://3.2.28/0018-mac80211-cancel-mesh-path-timer.patch \
1815 file://3.2.28/0019-ath9k-Add-PID-VID-support-for-AR1111.patch \
1816 file://3.2.28/0020-ARM-mxs-Remove-MMAP_MIN_ADDR-setting-from-mxs_defcon.patch \
1817 file://3.2.28/0021-ALSA-hda-add-dock-support-for-Thinkpad-T430s.patch \
1818 file://3.2.28/0022-cfg80211-process-pending-events-when-unregistering-n.patch \
1819 file://3.2.28/0023-rt61pci-fix-NULL-pointer-dereference-in-config_lna_g.patch \
1820 file://3.2.28/0024-iwlwifi-disable-greenfield-transmissions-as-a-workar.patch \
1821 file://3.2.28/0025-ALSA-hda-add-dock-support-for-Thinkpad-X230.patch \
1822 file://3.2.28/0026-e1000e-NIC-goes-up-and-immediately-goes-down.patch \
1823 file://3.2.28/0027-ALSA-hda-remove-quirk-for-Dell-Vostro-1015.patch \
1824 file://3.2.28/0028-ALSA-hda-Fix-double-quirk-for-Quanta-FL1-Lenovo-Idea.patch \
1825 file://3.2.28/0029-ARM-pxa-remove-irq_to_gpio-from-ezx-pcap-driver.patch \
1826 file://3.2.28/0030-Input-eeti_ts-pass-gpio-value-instead-of-IRQ.patch \
1827 file://3.2.28/0031-drm-i915-Add-wait_for-in-init_ring_common.patch \
1828 file://3.2.28/0032-drm-i915-correctly-order-the-ring-init-sequence.patch \
1829 file://3.2.28/0033-s390-compat-fix-compat-wrappers-for-process_vm-syste.patch \
1830 file://3.2.28/0034-s390-compat-fix-mmap-compat-system-calls.patch \
1831 file://3.2.28/0035-drm-radeon-fix-bank-tiling-parameters-on-evergreen.patch \
1832 file://3.2.28/0036-drm-radeon-fix-bank-tiling-parameters-on-cayman.patch \
1833 file://3.2.28/0037-drm-radeon-do-not-reenable-crtc-after-moving-vram-st.patch \
1834 file://3.2.28/0038-Linux-3.2.28.patch \
1726 file://libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch \ 1835 file://libertas/0001-USB-convert-drivers-net-to-use-module_usb_driver.patch \
1727 file://libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch \ 1836 file://libertas/0002-net-fix-assignment-of-0-1-to-bool-variables.patch \
1728 file://libertas/0003-switch-debugfs-to-umode_t.patch \ 1837 file://libertas/0003-switch-debugfs-to-umode_t.patch \
@@ -1739,9 +1848,12 @@ PATCHES_OVER_PSP = " \
1739 file://libertas/0014-libertas-CS-convert-to-asynchronous-firmware-loading.patch \ 1848 file://libertas/0014-libertas-CS-convert-to-asynchronous-firmware-loading.patch \
1740 file://libertas/0015-libertas-add-missing-include.patch \ 1849 file://libertas/0015-libertas-add-missing-include.patch \
1741 file://libertas/0016-remove-debug-msgs-due-to-missing-in_interrupt.patch \ 1850 file://libertas/0016-remove-debug-msgs-due-to-missing-in_interrupt.patch \
1742 \ 1851 file://pwm/0001-PWM-ecap-Correct-configuration-of-polarity.patch \
1743 file://beaglebone/0001-arm-boot-compressed-default-asm-arch-to-armv7-a.patch \ 1852 file://pwm/0002-ARM-OMAP2-am335x-mux-add-ecap2_in_pwm2_out-string-en.patch \
1744 \ 1853 file://pwm/0003-ARM-OMAP2-AM335x-hwmod-Remove-PRCM-entries-for-PWMSS.patch \
1854 file://pwm/0004-PWM-ecap-Resets-the-PWM-output-to-low-on-stop.patch \
1855 file://pwm/0005-PWM-ecap-Fix-for-throwing-PWM-output-before-running.patch \
1856 file://pwm/0006-pwm-ehrpwm-Configure-polarity-on-pwm_start.patch \
1745 file://beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch \ 1857 file://beaglebone/0001-f_rndis-HACK-around-undefined-variables.patch \
1746 file://beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch \ 1858 file://beaglebone/0002-da8xx-fb-add-DVI-support-for-beaglebone.patch \
1747 file://beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch \ 1859 file://beaglebone/0003-beaglebone-rebase-everything-onto-3.2-WARNING-MEGAPA.patch \
@@ -1827,4 +1939,9 @@ PATCHES_OVER_PSP = " \
1827 file://beaglebone/0083-beaglebone-add-extra-partnumber-for-camera-cape.patch \ 1939 file://beaglebone/0083-beaglebone-add-extra-partnumber-for-camera-cape.patch \
1828 file://beaglebone/0084-beaglebone-cssp_camera-driver-cleanup.patch \ 1940 file://beaglebone/0084-beaglebone-cssp_camera-driver-cleanup.patch \
1829 file://beaglebone/0085-beaglebone-mux-camera-cape-orientation-pin-to-gpio.patch \ 1941 file://beaglebone/0085-beaglebone-mux-camera-cape-orientation-pin-to-gpio.patch \
1830" 1942 file://beaglebone/0086-board-am335xevm-Add-Beaglebone-Motor-Cape-Support.patch \
1943 file://beaglebone/0087-mux33xx-Fix-MUXENTRYs-for-MCASP0_ACLKX-FSX-to-add-eh.patch \
1944 file://led/0001-leds-heartbeat-stop-on-shutdown-reboot-or-panic.patch \
1945 \
1946 file://beaglebone/0001-arm-boot-compressed-default-asm-arch-to-armv7-a.patch \
1947 "