summaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-ti33x-psp-3.2
diff options
context:
space:
mode:
authorKoen Kooi <koen@dominion.thruhere.net>2012-03-01 09:35:40 +0100
committerDenys Dmytriyenko <denys@ti.com>2012-03-04 23:35:53 -0500
commit4d6e7c358e61f2053f945423718d0923b6413f99 (patch)
treed2c7ac4906cb51ff7183ab48b497675584c72cfc /recipes-kernel/linux/linux-ti33x-psp-3.2
parente31722adc42ef202ae273571ce19a7ac304e5eb6 (diff)
downloadmeta-ti-4d6e7c358e61f2053f945423718d0923b6413f99.tar.gz
linux-ti33x-psp 3.2: update to 3.2.9 and add 2 patches from PSP tree
Signed-off-by: Koen Kooi <koen@dominion.thruhere.net> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2')
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/0022-ARM-OMAP2-am33xx-fix-serial-mux-warnings-for-am33xx.patch39
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/0023-ARM-OMAP2-am335x-correct-McASP0-pin-mux-detail.patch29
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0001-ixgbe-fix-vf-lookup.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0002-igb-fix-vf-lookup.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0003-perf-evsel-Fix-an-issue-where-perf-report-fails-to-s.patch64
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0004-perf-tools-Fix-perf-stack-to-non-executable-on-x86_6.patch55
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0005-drm-i915-Force-explicit-bpp-selection-for-intel_dp_l.patch99
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0006-drm-i915-no-lvds-quirk-for-AOpen-MP45.patch40
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0007-ath9k-Fix-kernel-panic-during-driver-initilization.patch96
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0008-ath9k-fix-a-WEP-crypto-related-regression.patch45
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0009-ath9k_hw-fix-a-RTS-CTS-timeout-regression.patch52
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0010-hwmon-f75375s-Fix-bit-shifting-in-f75375_write16.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0011-net-enable-TC35815-for-MIPS-again.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0012-lib-proportion-lower-PROP_MAX_SHIFT-to-32-on-64-bit-.patch48
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0013-relay-prevent-integer-overflow-in-relay_open.patch50
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0014-mac80211-timeout-a-single-frame-in-the-rx-reorder-bu.patch36
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0015-writeback-fix-NULL-bdi-dev-in-trace-writeback_single.patch72
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0016-writeback-fix-dereferencing-NULL-bdi-dev-on-trace_wr.patch44
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0017-hwmon-f75375s-Fix-automatic-pwm-mode-setting-for-F75.patch34
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0018-cifs-request-oplock-when-doing-open-on-lookup.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0019-cifs-don-t-return-error-from-standard_receive3-after.patch50
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0020-crypto-sha512-Use-binary-and-instead-of-modulus.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0021-crypto-sha512-Avoid-stack-bloat-on-i386.patch113
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0022-backing-dev-fix-wakeup-timer-races-with-bdi_unregist.patch95
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0023-ALSA-intel8x0-Fix-default-inaudible-sound-on-Gateway.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0024-ALSA-hda-Fix-initialization-of-secondary-capture-sou.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0025-ALSA-hda-Fix-silent-speaker-output-on-Acer-Aspire-69.patch78
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0026-mmc-atmel-mci-save-and-restore-sdioirq-when-soft-res.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0027-mmc-dw_mmc-Fix-PIO-mode-with-support-of-highmem.patch353
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0028-xen-pvhvm-do-not-remap-pirqs-onto-evtchns-if-xen_hav.patch31
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0029-crypto-sha512-use-standard-ror64.patch90
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0030-Linux-3.2.7.patch24
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0001-i387-math_state_restore-isn-t-called-from-asm.patch53
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0002-i387-make-irq_fpu_usable-tests-more-robust.patch131
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0003-i387-fix-sense-of-sanity-check.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0004-i387-fix-x86-64-preemption-unsafe-user-stack-save-re.patch163
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0005-i387-move-TS_USEDFPU-clearing-out-of-__save_init_fpu.patch64
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0006-i387-don-t-ever-touch-TS_USEDFPU-directly-use-helper.patch228
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0007-i387-do-not-preload-FPU-state-at-task-switch-time.patch202
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0008-i387-move-AMD-K7-K8-fpu-fxsave-fxrstor-workaround-fr.patch133
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0009-i387-move-TS_USEDFPU-flag-from-thread_info-to-task_s.patch305
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0010-i387-re-introduce-FPU-state-preloading-at-context-sw.patch353
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0011-Linux-3.2.8.patch24
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0001-Security-tomoyo-add-.gitignore-file.patch32
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0002-powerpc-perf-power_pmu_start-restores-incorrect-valu.patch58
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0003-ARM-at91-USB-AT91-gadget-registration-for-module.patch78
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0004-drm-radeon-kms-fix-MSI-re-arm-on-rv370.patch54
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0005-PCI-workaround-hard-wired-bus-number-V2.patch44
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0006-mac80211-Fix-a-rwlock-bad-magic-bug.patch91
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0007-ipheth-Add-iPhone-4S.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0008-regmap-Fix-cache-defaults-initialization-from-raw-ca.patch53
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0009-eCryptfs-Copy-up-lower-inode-attrs-after-setting-low.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0010-S390-correct-ktime-to-tod-clock-comparator-conversio.patch44
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0011-vfs-fix-d_inode_lookup-dentry-ref-leak.patch35
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0012-ARM-7326-2-PL330-fix-null-pointer-dereference-in-pl3.patch45
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0013-ALSA-hda-Fix-redundant-jack-creations-for-cx5051.patch68
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0014-mmc-core-check-for-zero-length-ioctl-data.patch137
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0015-NFSv4-Fix-an-Oops-in-the-NFSv4-getacl-code.patch98
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0016-NFSv4-Ensure-we-throw-out-bad-delegation-stateids-on.patch33
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0017-NFSv4-fix-server_scope-memory-leak.patch55
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0018-ARM-7321-1-cache-v7-Disable-preemption-when-reading-.patch61
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0019-ARM-7325-1-fix-v7-boot-with-lockdep-enabled.patch61
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0020-3c59x-shorten-timer-period-for-slave-devices.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0021-net-Don-t-proxy-arp-respond-if-iif-rt-dst.dev-if-pri.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0022-netpoll-netpoll_poll_dev-should-access-dev-flags.patch35
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0023-net_sched-Bug-in-netem-reordering.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0024-veth-Enforce-minimum-size-of-VETH_INFO_PEER.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0025-via-velocity-S3-resume-fix.patch37
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch90
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0027-tcp_v4_send_reset-binding-oif-to-iif-in-no-sock-case.patch47
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0028-ipv4-Fix-wrong-order-of-ip_rt_get_source-and-update-.patch38
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0029-net-Make-qdisc_skb_cb-upper-size-bound-explicit.patch90
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0030-IPoIB-Stop-lying-about-hard_header_len-and-use-skb-c.patch213
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0031-gro-more-generic-L2-header-check.patch61
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0032-tcp-allow-tcp_sacktag_one-to-tag-ranges-not-aligned-.patch119
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0033-tcp-fix-range-tcp_shifted_skb-passes-to-tcp_sacktag_.patch77
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0034-tcp-fix-tcp_shifted_skb-adjustment-of-lost_cnt_hint-.patch42
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0035-USB-Added-Kamstrup-VID-PIDs-to-cp210x-serial-driver.patch29
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0036-USB-option-cleanup-zte-3g-dongle-s-pid-in-option.c.patch246
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0037-USB-Serial-ti_usb_3410_5052-Add-Abbot-Diabetes-Care-.patch76
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0038-USB-Remove-duplicate-USB-3.0-hub-feature-defines.patch74
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch69
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0040-xhci-Fix-oops-caused-by-more-USB2-ports-than-USB3-po.patch39
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0041-xhci-Fix-encoding-for-HS-bulk-control-NAK-rate.patch98
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0042-USB-Don-t-fail-USB3-probe-on-missing-legacy-PCI-IRQ.patch80
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0043-USB-Set-hub-depth-after-USB3-hub-reset.patch86
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0044-usb-storage-fix-freezing-of-the-scanning-thread.patch213
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0045-target-Allow-control-CDBs-with-data-1-page.patch513
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0046-ASoC-wm8962-Fix-sidetone-enumeration-texts.patch31
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0047-ALSA-hda-realtek-Fix-overflow-of-vol-sw-check-bitmap.patch61
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0048-ALSA-hda-realtek-Fix-surround-output-regression-on-A.patch53
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0049-NOMMU-Lock-i_mmap_mutex-for-access-to-the-VMA-prio-l.patch76
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0050-hwmon-max6639-Fix-FAN_FROM_REG-calculation.patch46
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0051-hwmon-max6639-Fix-PPR-register-initialization-to-set.patch65
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0052-hwmon-ads1015-Fix-file-leak-in-probe-function.patch43
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0053-ARM-omap-fix-oops-in-drivers-video-omap2-dss-dpi.c.patch113
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0054-ARM-omap-fix-oops-in-arch-arm-mach-omap2-vp.c-when-p.patch74
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0055-x86-amd-Fix-L1i-and-L2-cache-sharing-information-for.patch100
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0056-ath9k-stop-on-rates-with-idx-1-in-ath9k-rate-control.patch41
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0057-genirq-Unmask-oneshot-irqs-when-thread-was-not-woken.patch81
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0058-genirq-Handle-pending-irqs-in-irq_startup.patch117
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0059-scsi_scan-Fix-Poison-overwritten-warning-caused-by-u.patch104
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0060-scsi_pm-Fix-bug-in-the-SCSI-power-management-handler.patch106
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0061-ipvs-fix-matching-of-fwmark-templates-during-schedul.patch47
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0062-jme-Fix-FIFO-flush-issue.patch63
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0063-davinci_emac-Do-not-free-all-rx-dma-descriptors-duri.patch72
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0064-builddeb-Don-t-create-files-in-tmp-with-predictable-.patch47
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0065-can-sja1000-fix-isr-hang-when-hw-is-unplugged-under-.patch67
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0066-hdpvr-fix-race-conditon-during-start-of-streaming.patch39
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0067-imon-don-t-wedge-hardware-after-early-callbacks.patch107
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch48
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0069-epoll-introduce-POLLFREE-to-flush-signalfd_wqh-befor.patch164
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0070-epoll-ep_unregister_pollwait-can-use-the-freed-pwq-w.patch116
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0071-epoll-limit-paths.patch475
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0072-cdrom-use-copy_to_user-without-the-underscores.patch56
-rw-r--r--recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0073-Linux-3.2.9.patch24
116 files changed, 9792 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/0022-ARM-OMAP2-am33xx-fix-serial-mux-warnings-for-am33xx.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/0022-ARM-OMAP2-am33xx-fix-serial-mux-warnings-for-am33xx.patch
new file mode 100644
index 00000000..2c98099e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/0022-ARM-OMAP2-am33xx-fix-serial-mux-warnings-for-am33xx.patch
@@ -0,0 +1,39 @@
1From cf59e3f3c203e6812881c12ab1b3d956a3fc47cc Mon Sep 17 00:00:00 2001
2From: "Hebbar, Gururaja" <gururaja.hebbar@ti.com>
3Date: Tue, 24 Jan 2012 19:45:12 +0530
4Subject: [PATCH 1/2] ARM: OMAP2+: am33xx: fix serial mux warnings for am33xx
5
6The patch removes below warning in serial mux setup on AM335x platform
7
8[ 0.162052] _omap_mux_get_by_name: Could not find signal
9uart1_cts.uart1_cts
10[ 0.169437] omap_hwmod_mux_init: Could not allocate device mux entry
11[ 0.176384] _omap_mux_get_by_name: Could not find signal
12uart2_cts.uart2_cts
13[ 0.183735] omap_hwmod_mux_init: Could not allocate device mux entry
14[ 0.190663] _omap_mux_get_by_name: Could not find signal
15uart3_cts_rctx.uart3_cts_rctx
16[ 0.198926] omap_hwmod_mux_init: Could not allocate device mux entry
17
18Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com>
19---
20 arch/arm/mach-omap2/serial.c | 3 ++-
21 1 files changed, 2 insertions(+), 1 deletions(-)
22
23diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
24index ad5bed3..bfa8ae3 100644
25--- a/arch/arm/mach-omap2/serial.c
26+++ b/arch/arm/mach-omap2/serial.c
27@@ -409,7 +409,8 @@ void __init omap_serial_board_init(struct omap_uart_port_info *info)
28 bdata.pads = NULL;
29 bdata.pads_cnt = 0;
30
31- if (cpu_is_omap44xx() || cpu_is_omap34xx())
32+ if (cpu_is_omap44xx() || (cpu_is_omap34xx() &&
33+ !cpu_is_am33xx()))
34 omap_serial_fill_default_pads(&bdata);
35
36 if (!info)
37--
381.7.7.4
39
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/0023-ARM-OMAP2-am335x-correct-McASP0-pin-mux-detail.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/0023-ARM-OMAP2-am335x-correct-McASP0-pin-mux-detail.patch
new file mode 100644
index 00000000..c59b8c8c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/0023-ARM-OMAP2-am335x-correct-McASP0-pin-mux-detail.patch
@@ -0,0 +1,29 @@
1From 64c66b9ea196032c017306f487e89ef12e5cdaca Mon Sep 17 00:00:00 2001
2From: "Hebbar, Gururaja" <gururaja.hebbar@ti.com>
3Date: Mon, 27 Feb 2012 11:56:39 +0530
4Subject: [PATCH 2/2] ARM: OMAP2+: am335x: correct McASP0 pin mux detail
5
6McASP0 AXR3 pin mux-mode was incorrect specified in mux file. This
7patch corrects the same.
8
9Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@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 2de76e3..25dcedb 100644
16--- a/arch/arm/mach-omap2/mux33xx.c
17+++ b/arch/arm/mach-omap2/mux33xx.c
18@@ -351,7 +351,7 @@ static struct omap_mux __initdata am33xx_muxmodes[] = {
19 "mcasp0_axr1", NULL, NULL, "mcasp1_axr0",
20 NULL, NULL, NULL, "gpio3_20"),
21 _AM33XX_MUXENTRY(MCASP0_AHCLKX, 0,
22- "mcasp0_ahclkx", "mcasp0_axr3", NULL, "mcasp1_axr1",
23+ "mcasp0_ahclkx", NULL, "mcasp0_axr3", "mcasp1_axr1",
24 NULL, NULL, NULL, "gpio3_21"),
25 _AM33XX_MUXENTRY(XDMA_EVENT_INTR0, 0,
26 "xdma_event_intr0", NULL, NULL, NULL,
27--
281.7.7.4
29
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0001-ixgbe-fix-vf-lookup.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0001-ixgbe-fix-vf-lookup.patch
new file mode 100644
index 00000000..082c2b18
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0001-ixgbe-fix-vf-lookup.patch
@@ -0,0 +1,42 @@
1From ec00c9c49aef783ec75155431d43df4cd93e24a4 Mon Sep 17 00:00:00 2001
2From: Greg Rose <gregory.v.rose@intel.com>
3Date: Fri, 3 Feb 2012 00:54:13 +0000
4Subject: [PATCH 01/30] ixgbe: fix vf lookup
5
6commit a4b08329c74985e5cc3a44b6d2b2c59444ed8079 upstream.
7
8Recent addition of code to find already allocated VFs failed to take
9account that systems with 2 or more multi-port SR-IOV capable controllers
10might have already enabled VFs. Make sure that the VFs the function is
11finding are actually subordinate to the particular instance of the adapter
12that is looking for them and not subordinate to some device that has
13previously enabled SR-IOV.
14
15This bug exists in 3.2 stable as well as 3.3 release candidates.
16
17Reported-by: David Ahern <daahern@cisco.com>
18Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
19Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
20Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 3 ++-
24 1 files changed, 2 insertions(+), 1 deletions(-)
25
26diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
27index 00fcd39..e571356 100644
28--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
29+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c
30@@ -67,7 +67,8 @@ static int ixgbe_find_enabled_vfs(struct ixgbe_adapter *adapter)
31 vf_devfn = pdev->devfn + 0x80;
32 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID, device_id, NULL);
33 while (pvfdev) {
34- if (pvfdev->devfn == vf_devfn)
35+ if (pvfdev->devfn == vf_devfn &&
36+ (pvfdev->bus->number >= pdev->bus->number))
37 vfs_found++;
38 vf_devfn += 2;
39 pvfdev = pci_get_device(IXGBE_INTEL_VENDOR_ID,
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0002-igb-fix-vf-lookup.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0002-igb-fix-vf-lookup.patch
new file mode 100644
index 00000000..7b268127
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0002-igb-fix-vf-lookup.patch
@@ -0,0 +1,42 @@
1From 3039fb27d54ba3ffa564c56ef25d799e756ca3ad Mon Sep 17 00:00:00 2001
2From: Greg Rose <gregory.v.rose@intel.com>
3Date: Thu, 2 Feb 2012 23:51:43 +0000
4Subject: [PATCH 02/30] igb: fix vf lookup
5
6commit 0629292117572a60465f38cdedde2f8164c3df0b upstream.
7
8Recent addition of code to find already allocated VFs failed to take
9account that systems with 2 or more multi-port SR-IOV capable controllers
10might have already enabled VFs. Make sure that the VFs the function is
11finding are actually subordinate to the particular instance of the adapter
12that is looking for them and not subordinate to some device that has
13previously enabled SR-IOV.
14
15This is applicable to 3.2+ kernels.
16
17Reported-by: David Ahern <daahern@cisco.com>
18Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
19Tested-by: Robert E Garrett <robertX.e.garrett@intel.com>
20Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/net/ethernet/intel/igb/igb_main.c | 3 ++-
24 1 files changed, 2 insertions(+), 1 deletions(-)
25
26diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
27index ced5444..222954d 100644
28--- a/drivers/net/ethernet/intel/igb/igb_main.c
29+++ b/drivers/net/ethernet/intel/igb/igb_main.c
30@@ -4965,7 +4965,8 @@ static int igb_find_enabled_vfs(struct igb_adapter *adapter)
31 vf_devfn = pdev->devfn + 0x80;
32 pvfdev = pci_get_device(hw->vendor_id, device_id, NULL);
33 while (pvfdev) {
34- if (pvfdev->devfn == vf_devfn)
35+ if (pvfdev->devfn == vf_devfn &&
36+ (pvfdev->bus->number >= pdev->bus->number))
37 vfs_found++;
38 vf_devfn += vf_stride;
39 pvfdev = pci_get_device(hw->vendor_id,
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0003-perf-evsel-Fix-an-issue-where-perf-report-fails-to-s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0003-perf-evsel-Fix-an-issue-where-perf-report-fails-to-s.patch
new file mode 100644
index 00000000..12e66937
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0003-perf-evsel-Fix-an-issue-where-perf-report-fails-to-s.patch
@@ -0,0 +1,64 @@
1From 838d7aabe2a5c93aa7116f1a74758731ba1a0264 Mon Sep 17 00:00:00 2001
2From: "Naveen N. Rao" <naveen.n.rao@linux.vnet.ibm.com>
3Date: Fri, 3 Feb 2012 22:31:13 +0530
4Subject: [PATCH 03/30] perf evsel: Fix an issue where perf report fails to
5 show the proper percentage
6
7commit a4a03fc7ef89020baca4f19174e6a43767c6d78a upstream.
8
9This patch fixes an issue where perf report shows nan% for certain
10perf.data files. The below is from a report for a do_fork probe:
11
12 -nan% sshd [kernel.kallsyms] [k] do_fork
13 -nan% packagekitd [kernel.kallsyms] [k] do_fork
14 -nan% dbus-daemon [kernel.kallsyms] [k] do_fork
15 -nan% bash [kernel.kallsyms] [k] do_fork
16
17A git bisect shows commit f3bda2c as the cause. However, looking back
18through the git history, I saw commit 640c03c which seems to have
19removed the required initialization for perf_sample->period. The problem
20only started showing after commit f3bda2c. The below patch re-introduces
21the initialization and it fixes the problem for me.
22
23With the below patch, for the same perf.data:
24
25 73.08% bash [kernel.kallsyms] [k] do_fork
26 8.97% 11-dhclient [kernel.kallsyms] [k] do_fork
27 6.41% sshd [kernel.kallsyms] [k] do_fork
28 3.85% 20-chrony [kernel.kallsyms] [k] do_fork
29 2.56% sendmail [kernel.kallsyms] [k] do_fork
30
31This patch applies over current linux-tip commit 9949284.
32
33Problem introduced in:
34
35$ git describe 640c03c
36v2.6.37-rc3-83-g640c03c
37
38Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
39Cc: Ingo Molnar <mingo@elte.hu>
40Cc: Robert Richter <robert.richter@amd.com>
41Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
42Link: http://lkml.kernel.org/r/20120203170113.5190.25558.stgit@localhost6.localdomain6
43Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
44Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
45Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
46---
47 tools/perf/util/evsel.c | 1 +
48 1 files changed, 1 insertions(+), 0 deletions(-)
49
50diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
51index d7915d4..efca198 100644
52--- a/tools/perf/util/evsel.c
53+++ b/tools/perf/util/evsel.c
54@@ -390,6 +390,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,
55
56 data->cpu = data->pid = data->tid = -1;
57 data->stream_id = data->id = data->time = -1ULL;
58+ data->period = 1;
59
60 if (event->header.type != PERF_RECORD_SAMPLE) {
61 if (!sample_id_all)
62--
631.7.7.4
64
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0004-perf-tools-Fix-perf-stack-to-non-executable-on-x86_6.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0004-perf-tools-Fix-perf-stack-to-non-executable-on-x86_6.patch
new file mode 100644
index 00000000..c7d70450
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0004-perf-tools-Fix-perf-stack-to-non-executable-on-x86_6.patch
@@ -0,0 +1,55 @@
1From bb937c6a47bdc27bf0f5c7323b8e75b5c313adeb Mon Sep 17 00:00:00 2001
2From: Jiri Olsa <jolsa@redhat.com>
3Date: Mon, 6 Feb 2012 18:54:06 -0200
4Subject: [PATCH 04/30] perf tools: Fix perf stack to non executable on x86_64
5
6commit 7a0153ee15575a4d07b5da8c96b79e0b0fd41a12 upstream.
7
8By adding following objects:
9 bench/mem-memcpy-x86-64-asm.o
10the x86_64 perf binary ended up with executable stack.
11
12The reason was that above object are assembler sourced and is missing the
13GNU-stack note section. In such case the linker assumes that the final binary
14should not be restricted at all and mark the stack as RWX.
15
16Adding section ".note.GNU-stack" definition to mentioned object, with all
17flags disabled, thus omiting this object from linker stack flags decision.
18
19Problem introduced in:
20
21 $ git describe ea7872b
22 v2.6.37-rc2-19-gea7872b
23
24Reported-at: https://bugzilla.redhat.com/show_bug.cgi?id=783570
25Reported-by: Clark Williams <williams@redhat.com>
26Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
27Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
28Cc: Ingo Molnar <mingo@elte.hu>
29Cc: Paul Mackerras <paulus@samba.org>
30Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
31Link: http://lkml.kernel.org/r/1328100848-5630-1-git-send-email-jolsa@redhat.com
32Signed-off-by: Jiri Olsa <jolsa@redhat.com>
33[ committer note: Backported fix to perf/urgent (3.3-rc2+) ]
34Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
35Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
36---
37 tools/perf/bench/mem-memcpy-x86-64-asm.S | 6 ++++++
38 1 files changed, 6 insertions(+), 0 deletions(-)
39
40diff --git a/tools/perf/bench/mem-memcpy-x86-64-asm.S b/tools/perf/bench/mem-memcpy-x86-64-asm.S
41index a57b66e..185a96d 100644
42--- a/tools/perf/bench/mem-memcpy-x86-64-asm.S
43+++ b/tools/perf/bench/mem-memcpy-x86-64-asm.S
44@@ -1,2 +1,8 @@
45
46 #include "../../../arch/x86/lib/memcpy_64.S"
47+/*
48+ * We need to provide note.GNU-stack section, saying that we want
49+ * NOT executable stack. Otherwise the final linking will assume that
50+ * the ELF stack should not be restricted at all and set it RWX.
51+ */
52+.section .note.GNU-stack,"",@progbits
53--
541.7.7.4
55
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0005-drm-i915-Force-explicit-bpp-selection-for-intel_dp_l.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0005-drm-i915-Force-explicit-bpp-selection-for-intel_dp_l.patch
new file mode 100644
index 00000000..227c5812
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0005-drm-i915-Force-explicit-bpp-selection-for-intel_dp_l.patch
@@ -0,0 +1,99 @@
1From 3d794f87238f74d80e78a7611c7fbde8a54c85c2 Mon Sep 17 00:00:00 2001
2From: Keith Packard <keithp@keithp.com>
3Date: Wed, 25 Jan 2012 08:16:25 -0800
4Subject: [PATCH 05/30] drm/i915: Force explicit bpp selection for
5 intel_dp_link_required
6
7commit c898261c0dad617f0f1080bedc02d507a2fcfb92 upstream.
8
9It is never correct to use intel_crtc->bpp in intel_dp_link_required,
10so instead pass an explicit bpp in to this function. This patch
11only supports 18bpp and 24bpp modes, which means that 10bpc modes will
12be computed incorrectly. Fixing that will require more extensive
13changes, and so must be addressed separately from this bugfix.
14
15intel_dp_link_required is called from intel_dp_mode_valid and
16intel_dp_mode_fixup.
17
18* intel_dp_mode_valid is called to list supported modes; in this case,
19 the current crtc values cannot be relevant as the modes in question
20 may never be selected. Thus, using intel_crtc->bpp is never right.
21
22* intel_dp_mode_fixup is called during mode setting, but it is run
23 well before ironlake_crtc_mode_set is called to set intel_crtc->bpp,
24 so using intel_crtc-bpp in this path can only ever get a stale
25 value.
26
27Cc: Lubos Kolouch <lubos.kolouch@gmail.com>
28Cc: Adam Jackson <ajax@redhat.com>
29Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
30Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=42263
31Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44881
32Tested-by: Dave Airlie <airlied@redhat.com>
33Tested-by: camalot@picnicpark.org (Dell Latitude 6510)
34Tested-by: Roland Dreier <roland@digitalvampire.org>
35Signed-off-by: Keith Packard <keithp@keithp.com>
36Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
37---
38 drivers/gpu/drm/i915/intel_dp.c | 20 +++++---------------
39 1 files changed, 5 insertions(+), 15 deletions(-)
40
41diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
42index db3b461..94f860c 100644
43--- a/drivers/gpu/drm/i915/intel_dp.c
44+++ b/drivers/gpu/drm/i915/intel_dp.c
45@@ -208,17 +208,8 @@ intel_dp_link_clock(uint8_t link_bw)
46 */
47
48 static int
49-intel_dp_link_required(struct intel_dp *intel_dp, int pixel_clock, int check_bpp)
50+intel_dp_link_required(int pixel_clock, int bpp)
51 {
52- struct drm_crtc *crtc = intel_dp->base.base.crtc;
53- struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
54- int bpp = 24;
55-
56- if (check_bpp)
57- bpp = check_bpp;
58- else if (intel_crtc)
59- bpp = intel_crtc->bpp;
60-
61 return (pixel_clock * bpp + 9) / 10;
62 }
63
64@@ -245,12 +236,11 @@ intel_dp_mode_valid(struct drm_connector *connector,
65 return MODE_PANEL;
66 }
67
68- mode_rate = intel_dp_link_required(intel_dp, mode->clock, 0);
69+ mode_rate = intel_dp_link_required(mode->clock, 24);
70 max_rate = intel_dp_max_data_rate(max_link_clock, max_lanes);
71
72 if (mode_rate > max_rate) {
73- mode_rate = intel_dp_link_required(intel_dp,
74- mode->clock, 18);
75+ mode_rate = intel_dp_link_required(mode->clock, 18);
76 if (mode_rate > max_rate)
77 return MODE_CLOCK_HIGH;
78 else
79@@ -683,7 +673,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
80 int lane_count, clock;
81 int max_lane_count = intel_dp_max_lane_count(intel_dp);
82 int max_clock = intel_dp_max_link_bw(intel_dp) == DP_LINK_BW_2_7 ? 1 : 0;
83- int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 0;
84+ int bpp = mode->private_flags & INTEL_MODE_DP_FORCE_6BPC ? 18 : 24;
85 static int bws[2] = { DP_LINK_BW_1_62, DP_LINK_BW_2_7 };
86
87 if (is_edp(intel_dp) && intel_dp->panel_fixed_mode) {
88@@ -701,7 +691,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
89 for (clock = 0; clock <= max_clock; clock++) {
90 int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
91
92- if (intel_dp_link_required(intel_dp, mode->clock, bpp)
93+ if (intel_dp_link_required(mode->clock, bpp)
94 <= link_avail) {
95 intel_dp->link_bw = bws[clock];
96 intel_dp->lane_count = lane_count;
97--
981.7.7.4
99
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0006-drm-i915-no-lvds-quirk-for-AOpen-MP45.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0006-drm-i915-no-lvds-quirk-for-AOpen-MP45.patch
new file mode 100644
index 00000000..0483dfbb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0006-drm-i915-no-lvds-quirk-for-AOpen-MP45.patch
@@ -0,0 +1,40 @@
1From e0de290452ad63560c1051b1f0a3d2fba665094e Mon Sep 17 00:00:00 2001
2From: Daniel Vetter <daniel.vetter@ffwll.ch>
3Date: Wed, 8 Feb 2012 16:42:52 +0100
4Subject: [PATCH 06/30] drm/i915: no lvds quirk for AOpen MP45
5
6commit e57b6886f555ab57f40a01713304e2053efe51ec upstream.
7
8According to a bug report, it doesn't have one.
9
10Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=44263
11Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
12Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
13Signed-off-by: Keith Packard <keithp@keithp.com>
14Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15---
16 drivers/gpu/drm/i915/intel_lvds.c | 8 ++++++++
17 1 files changed, 8 insertions(+), 0 deletions(-)
18
19diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
20index e441911..b83f745 100644
21--- a/drivers/gpu/drm/i915/intel_lvds.c
22+++ b/drivers/gpu/drm/i915/intel_lvds.c
23@@ -694,6 +694,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
24 },
25 {
26 .callback = intel_no_lvds_dmi_callback,
27+ .ident = "AOpen i45GMx-I",
28+ .matches = {
29+ DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
30+ DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
31+ },
32+ },
33+ {
34+ .callback = intel_no_lvds_dmi_callback,
35 .ident = "Aopen i945GTt-VFA",
36 .matches = {
37 DMI_MATCH(DMI_PRODUCT_VERSION, "AO00001JW"),
38--
391.7.7.4
40
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0007-ath9k-Fix-kernel-panic-during-driver-initilization.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0007-ath9k-Fix-kernel-panic-during-driver-initilization.patch
new file mode 100644
index 00000000..e6b767e3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0007-ath9k-Fix-kernel-panic-during-driver-initilization.patch
@@ -0,0 +1,96 @@
1From 801cb74a250edad565024f2db5c5a6c7930ecbb1 Mon Sep 17 00:00:00 2001
2From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
3Date: Thu, 2 Feb 2012 16:29:05 +0530
4Subject: [PATCH 07/30] ath9k: Fix kernel panic during driver initilization
5
6commit 07445f688218a48bde72316aed9de4fdcc173131 upstream.
7
8all works need to be initialized before ieee80211_register_hw
9to prevent mac80211 call backs such as drv_start, drv_config
10getting started. otherwise we would queue/cancel works before
11initializing them and it leads to kernel panic.
12this issue can be recreated with the following script
13in Chrome laptops with AR928X cards, with background scan
14running (or) Network manager is running
15
16while true
17do
18sudo modprobe -v ath9k
19sleep 3
20sudo modprobe -r ath9k
21sleep 3
22done
23
24 EIP: [<81040a47>] __cancel_work_timer+0xb8/0xe1 SS:ESP 0068:f6be9d70
25 ---[ end trace 4f86d6139a9900ef ]---
26 Registered led device: ath9k-phy0
27 ieee80211 phy0: Atheros AR9280 Rev:2 mem=0xf88a0000,
28 irq=16
29 Kernel panic - not syncing: Fatal exception
30 Pid: 456, comm: wpa_supplicant Tainted: G D
31 3.0.13 #1
32 Call Trace:
33 [<81379e21>] panic+0x53/0x14a
34 [<81004a30>] oops_end+0x73/0x81
35 [<81004b53>] die+0x4c/0x55
36 [<81002710>] do_trap+0x7c/0x83
37 [<81002855>] ? do_bounds+0x58/0x58
38 [<810028cc>] do_invalid_op+0x77/0x81
39 [<81040a47>] ? __cancel_work_timer+0xb8/0xe1
40 [<810489ec>] ? sched_clock_cpu+0x81/0x11f
41 [<8103f809>] ? wait_on_work+0xe2/0xf7
42 [<8137f807>] error_code+0x67/0x6c
43 [<810300d8>] ? wait_consider_task+0x4ba/0x84c
44 [<81040a47>] ? __cancel_work_timer+0xb8/0xe1
45 [<810380c9>] ? try_to_del_timer_sync+0x5f/0x67
46 [<81040a91>] cancel_work_sync+0xf/0x11
47 [<f88d7b7c>] ath_set_channel+0x62/0x25c [ath9k]
48 [<f88d67d1>] ? ath9k_tx_last_beacon+0x26a/0x85c [ath9k]
49 [<f88d8899>] ath_radio_disable+0x3f1/0x68e [ath9k]
50 [<f90d0edb>] ieee80211_hw_config+0x111/0x116 [mac80211]
51 [<f90dd95c>] __ieee80211_recalc_idle+0x919/0xa37 [mac80211]
52 [<f90dda76>] __ieee80211_recalc_idle+0xa33/0xa37 [mac80211]
53 [<812dbed8>] __dev_open+0x82/0xab
54
55Cc: Gary Morain <gmorain@google.com>
56Cc: Paul Stewart <pstew@google.com>
57Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
58Tested-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
59Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
60Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
61Signed-off-by: John W. Linville <linville@tuxdriver.com>
62Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
63---
64 drivers/net/wireless/ath/ath9k/init.c | 9 +++++----
65 1 files changed, 5 insertions(+), 4 deletions(-)
66
67diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
68index d4c909f..57622e0 100644
69--- a/drivers/net/wireless/ath/ath9k/init.c
70+++ b/drivers/net/wireless/ath/ath9k/init.c
71@@ -775,6 +775,11 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
72 ARRAY_SIZE(ath9k_tpt_blink));
73 #endif
74
75+ INIT_WORK(&sc->hw_reset_work, ath_reset_work);
76+ INIT_WORK(&sc->hw_check_work, ath_hw_check);
77+ INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
78+ INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
79+
80 /* Register with mac80211 */
81 error = ieee80211_register_hw(hw);
82 if (error)
83@@ -793,10 +798,6 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc,
84 goto error_world;
85 }
86
87- INIT_WORK(&sc->hw_reset_work, ath_reset_work);
88- INIT_WORK(&sc->hw_check_work, ath_hw_check);
89- INIT_WORK(&sc->paprd_work, ath_paprd_calibrate);
90- INIT_DELAYED_WORK(&sc->hw_pll_work, ath_hw_pll_work);
91 sc->last_rssi = ATH_RSSI_DUMMY_MARKER;
92
93 ath_init_leds(sc);
94--
951.7.7.4
96
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0008-ath9k-fix-a-WEP-crypto-related-regression.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0008-ath9k-fix-a-WEP-crypto-related-regression.patch
new file mode 100644
index 00000000..0ef0ce86
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0008-ath9k-fix-a-WEP-crypto-related-regression.patch
@@ -0,0 +1,45 @@
1From 07c07e52693740326b24511ba6053f3fd52c0942 Mon Sep 17 00:00:00 2001
2From: Felix Fietkau <nbd@openwrt.org>
3Date: Sun, 5 Feb 2012 21:15:17 +0100
4Subject: [PATCH 08/30] ath9k: fix a WEP crypto related regression
5
6commit f88373fa47f3ce6590fdfaa742d0ddacc2ae017f upstream.
7
8commit b4a82a0 "ath9k_hw: fix interpretation of the rx KeyMiss flag"
9fixed the interpretation of the KeyMiss flag for keycache based lookups,
10however WEP encryption uses a static index, so KeyMiss is always asserted
11for it, even though frames are decrypted properly.
12Fix this by clearing the ATH9K_RXERR_KEYMISS flag if no keycache based
13lookup was performed.
14
15Signed-off-by: Felix Fietkau <nbd@openwrt.org>
16Reported-by: Laurent Bonnans <bonnans.l@gmail.com>
17Reported-by: Jurica Vukadin <u.ra604@googlemail.com>
18Signed-off-by: John W. Linville <linville@tuxdriver.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/net/wireless/ath/ath9k/recv.c | 8 ++++++++
22 1 files changed, 8 insertions(+), 0 deletions(-)
23
24diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
25index 67b862c..2f3aeac 100644
26--- a/drivers/net/wireless/ath/ath9k/recv.c
27+++ b/drivers/net/wireless/ath/ath9k/recv.c
28@@ -824,6 +824,14 @@ static bool ath9k_rx_accept(struct ath_common *common,
29 (ATH9K_RXERR_DECRYPT | ATH9K_RXERR_CRC | ATH9K_RXERR_MIC |
30 ATH9K_RXERR_KEYMISS));
31
32+ /*
33+ * Key miss events are only relevant for pairwise keys where the
34+ * descriptor does contain a valid key index. This has been observed
35+ * mostly with CCMP encryption.
36+ */
37+ if (rx_stats->rs_keyix == ATH9K_RXKEYIX_INVALID)
38+ rx_stats->rs_status &= ~ATH9K_RXERR_KEYMISS;
39+
40 if (!rx_stats->rs_datalen)
41 return false;
42 /*
43--
441.7.7.4
45
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0009-ath9k_hw-fix-a-RTS-CTS-timeout-regression.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0009-ath9k_hw-fix-a-RTS-CTS-timeout-regression.patch
new file mode 100644
index 00000000..9f2c1cd0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0009-ath9k_hw-fix-a-RTS-CTS-timeout-regression.patch
@@ -0,0 +1,52 @@
1From 39141a87c717403c9dd4e0432766ea18054f86f8 Mon Sep 17 00:00:00 2001
2From: Felix Fietkau <nbd@openwrt.org>
3Date: Sun, 5 Feb 2012 21:15:18 +0100
4Subject: [PATCH 09/30] ath9k_hw: fix a RTS/CTS timeout regression
5
6commit 55a2bb4a6d5e8c7b324d003e130fd9aaf33be4e6 upstream.
7
8commit adb5066 "ath9k_hw: do not apply the 2.4 ghz ack timeout
9workaround to cts" reduced the hardware CTS timeout to the normal
10values specified by the standard, but it turns out while it doesn't
11need the same extra time that it needs for the ACK timeout, it
12does need more than the value specified in the standard, but only
13for 2.4 GHz.
14
15This patch brings the CTS timeout value in sync with the initialization
16values, while still allowing adjustment for bigger distances.
17
18Signed-off-by: Felix Fietkau <nbd@openwrt.org>
19Reported-by: Seth Forshee <seth.forshee@canonical.com>
20Reported-by: Marek Lindner <lindner_marek@yahoo.de>
21Signed-off-by: John W. Linville <linville@tuxdriver.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23---
24 drivers/net/wireless/ath/ath9k/hw.c | 7 +++++--
25 1 files changed, 5 insertions(+), 2 deletions(-)
26
27diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
28index 8873c6e..8b0c2ca 100644
29--- a/drivers/net/wireless/ath/ath9k/hw.c
30+++ b/drivers/net/wireless/ath/ath9k/hw.c
31@@ -1034,13 +1034,16 @@ void ath9k_hw_init_global_settings(struct ath_hw *ah)
32
33 /*
34 * Workaround for early ACK timeouts, add an offset to match the
35- * initval's 64us ack timeout value.
36+ * initval's 64us ack timeout value. Use 48us for the CTS timeout.
37 * This was initially only meant to work around an issue with delayed
38 * BA frames in some implementations, but it has been found to fix ACK
39 * timeout issues in other cases as well.
40 */
41- if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ)
42+ if (conf->channel && conf->channel->band == IEEE80211_BAND_2GHZ) {
43 acktimeout += 64 - sifstime - ah->slottime;
44+ ctstimeout += 48 - sifstime - ah->slottime;
45+ }
46+
47
48 ath9k_hw_set_sifs_time(ah, sifstime);
49 ath9k_hw_setslottime(ah, slottime);
50--
511.7.7.4
52
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0010-hwmon-f75375s-Fix-bit-shifting-in-f75375_write16.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0010-hwmon-f75375s-Fix-bit-shifting-in-f75375_write16.patch
new file mode 100644
index 00000000..e4a498c2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0010-hwmon-f75375s-Fix-bit-shifting-in-f75375_write16.patch
@@ -0,0 +1,33 @@
1From 82546bf5ccd28a6c5f0829f43d3d5050065ce4d4 Mon Sep 17 00:00:00 2001
2From: Nikolaus Schulz <schulz@macnetix.de>
3Date: Wed, 8 Feb 2012 18:56:10 +0100
4Subject: [PATCH 10/30] hwmon: (f75375s) Fix bit shifting in f75375_write16
5
6commit eb2f255b2d360df3f500042a2258dcf2fcbe89a2 upstream.
7
8In order to extract the high byte of the 16-bit word, shift the word to
9the right, not to the left.
10
11Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
12Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 drivers/hwmon/f75375s.c | 2 +-
16 1 files changed, 1 insertions(+), 1 deletions(-)
17
18diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
19index 95cbfb3..dcfd9e1 100644
20--- a/drivers/hwmon/f75375s.c
21+++ b/drivers/hwmon/f75375s.c
22@@ -159,7 +159,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,
23 static inline void f75375_write16(struct i2c_client *client, u8 reg,
24 u16 value)
25 {
26- int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
27+ int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
28 if (err)
29 return;
30 i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
31--
321.7.7.4
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0011-net-enable-TC35815-for-MIPS-again.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0011-net-enable-TC35815-for-MIPS-again.patch
new file mode 100644
index 00000000..c80b5ac5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0011-net-enable-TC35815-for-MIPS-again.patch
@@ -0,0 +1,41 @@
1From 5f892ebab0da0262e16737c1a618a19384da29bf Mon Sep 17 00:00:00 2001
2From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
3Date: Mon, 6 Feb 2012 14:51:03 +0000
4Subject: [PATCH 11/30] net: enable TC35815 for MIPS again
5
6commit a1728800bed3b93b231d99e97c756f622b9991c2 upstream.
7
88<----------------------------------------------------------------------
9From: Ralf Roesch <ralf.roesch@rw-gmbh.de>
10Date: Wed, 16 Nov 2011 09:33:50 +0100
11Subject: net: enable TC35815 for MIPS again
12
13TX493[8,9] MIPS SoCs support 2 Ethernet channels of type TC35815
14which are connected to the internal PCI controller.
15And JMR3927 MIPS board has a TC35815 chip on board.
16These dependencies were lost on movement to drivers/net/ethernet/toshiba.
17
18Signed-off-by: Ralf Roesch <ralf.roesch@rw-gmbh.de>
19Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
20Signed-off-by: David S. Miller <davem@davemloft.net>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/net/ethernet/toshiba/Kconfig | 2 +-
24 1 files changed, 1 insertions(+), 1 deletions(-)
25
26diff --git a/drivers/net/ethernet/toshiba/Kconfig b/drivers/net/ethernet/toshiba/Kconfig
27index 0517647..74acb5c 100644
28--- a/drivers/net/ethernet/toshiba/Kconfig
29+++ b/drivers/net/ethernet/toshiba/Kconfig
30@@ -5,7 +5,7 @@
31 config NET_VENDOR_TOSHIBA
32 bool "Toshiba devices"
33 default y
34- depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB) || PPC_PS3
35+ depends on PCI && (PPC_IBM_CELL_BLADE || PPC_CELLEB || MIPS) || PPC_PS3
36 ---help---
37 If you have a network (Ethernet) card belonging to this class, say Y
38 and read the Ethernet-HOWTO, available from
39--
401.7.7.4
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0012-lib-proportion-lower-PROP_MAX_SHIFT-to-32-on-64-bit-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0012-lib-proportion-lower-PROP_MAX_SHIFT-to-32-on-64-bit-.patch
new file mode 100644
index 00000000..9bb974d5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0012-lib-proportion-lower-PROP_MAX_SHIFT-to-32-on-64-bit-.patch
@@ -0,0 +1,48 @@
1From 736020248ccb92a11af037e1cec4a2c79946be8a Mon Sep 17 00:00:00 2001
2From: Wu Fengguang <fengguang.wu@intel.com>
3Date: Mon, 9 Jan 2012 11:53:50 -0600
4Subject: [PATCH 12/30] lib: proportion: lower PROP_MAX_SHIFT to 32 on 64-bit
5 kernel
6
7commit 3310225dfc71a35a2cc9340c15c0e08b14b3c754 upstream.
8
9PROP_MAX_SHIFT should be set to <=32 on 64-bit box. This fixes two bugs
10in the below lines of bdi_dirty_limit():
11
12 bdi_dirty *= numerator;
13 do_div(bdi_dirty, denominator);
14
151) divide error: do_div() only uses the lower 32 bit of the denominator,
16 which may trimmed to be 0 when PROP_MAX_SHIFT > 32.
17
182) overflow: (bdi_dirty * numerator) could easily overflow if numerator
19 used up to 48 bits, leaving only 16 bits to bdi_dirty
20
21Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
22Reported-by: Ilya Tumaykin <librarian_rus@yahoo.com>
23Tested-by: Ilya Tumaykin <librarian_rus@yahoo.com>
24Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26---
27 include/linux/proportions.h | 4 ++++
28 1 files changed, 4 insertions(+), 0 deletions(-)
29
30diff --git a/include/linux/proportions.h b/include/linux/proportions.h
31index ef35bb7..26a8a4e 100644
32--- a/include/linux/proportions.h
33+++ b/include/linux/proportions.h
34@@ -81,7 +81,11 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
35 * Limit the time part in order to ensure there are some bits left for the
36 * cycle counter and fraction multiply.
37 */
38+#if BITS_PER_LONG == 32
39 #define PROP_MAX_SHIFT (3*BITS_PER_LONG/4)
40+#else
41+#define PROP_MAX_SHIFT (BITS_PER_LONG/2)
42+#endif
43
44 #define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1)
45 #define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT)
46--
471.7.7.4
48
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0013-relay-prevent-integer-overflow-in-relay_open.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0013-relay-prevent-integer-overflow-in-relay_open.patch
new file mode 100644
index 00000000..96aa48de
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0013-relay-prevent-integer-overflow-in-relay_open.patch
@@ -0,0 +1,50 @@
1From a0cbc2da8ed19f3affb50a249dc16a04d5d6f42f Mon Sep 17 00:00:00 2001
2From: Dan Carpenter <dan.carpenter@oracle.com>
3Date: Fri, 10 Feb 2012 09:03:58 +0100
4Subject: [PATCH 13/30] relay: prevent integer overflow in relay_open()
5
6commit f6302f1bcd75a042df69866d98b8d775a668f8f1 upstream.
7
8"subbuf_size" and "n_subbufs" come from the user and they need to be
9capped to prevent an integer overflow.
10
11Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
12Signed-off-by: Jens Axboe <axboe@kernel.dk>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 kernel/relay.c | 10 ++++++++--
16 1 files changed, 8 insertions(+), 2 deletions(-)
17
18diff --git a/kernel/relay.c b/kernel/relay.c
19index 226fade..b6f803a 100644
20--- a/kernel/relay.c
21+++ b/kernel/relay.c
22@@ -164,10 +164,14 @@ depopulate:
23 */
24 static struct rchan_buf *relay_create_buf(struct rchan *chan)
25 {
26- struct rchan_buf *buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
27- if (!buf)
28+ struct rchan_buf *buf;
29+
30+ if (chan->n_subbufs > UINT_MAX / sizeof(size_t *))
31 return NULL;
32
33+ buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
34+ if (!buf)
35+ return NULL;
36 buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
37 if (!buf->padding)
38 goto free_buf;
39@@ -574,6 +578,8 @@ struct rchan *relay_open(const char *base_filename,
40
41 if (!(subbuf_size && n_subbufs))
42 return NULL;
43+ if (subbuf_size > UINT_MAX / n_subbufs)
44+ return NULL;
45
46 chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
47 if (!chan)
48--
491.7.7.4
50
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0014-mac80211-timeout-a-single-frame-in-the-rx-reorder-bu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0014-mac80211-timeout-a-single-frame-in-the-rx-reorder-bu.patch
new file mode 100644
index 00000000..190babf9
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0014-mac80211-timeout-a-single-frame-in-the-rx-reorder-bu.patch
@@ -0,0 +1,36 @@
1From 60d08dde8e209a4e5b6ff95022004c65672c149f Mon Sep 17 00:00:00 2001
2From: Eliad Peller <eliad@wizery.com>
3Date: Wed, 1 Feb 2012 18:48:09 +0200
4Subject: [PATCH 14/30] mac80211: timeout a single frame in the rx reorder
5 buffer
6
7commit 07ae2dfcf4f7143ce191c6436da1c33f179af0d6 upstream.
8
9The current code checks for stored_mpdu_num > 1, causing
10the reorder_timer to be triggered indefinitely, but the
11frame is never timed-out (until the next packet is received)
12
13Signed-off-by: Eliad Peller <eliad@wizery.com>
14Acked-by: Johannes Berg <johannes@sipsolutions.net>
15Signed-off-by: John W. Linville <linville@tuxdriver.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 net/mac80211/rx.c | 2 +-
19 1 files changed, 1 insertions(+), 1 deletions(-)
20
21diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
22index 5c51607..064d20f 100644
23--- a/net/mac80211/rx.c
24+++ b/net/mac80211/rx.c
25@@ -616,7 +616,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
26 index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) %
27 tid_agg_rx->buf_size;
28 if (!tid_agg_rx->reorder_buf[index] &&
29- tid_agg_rx->stored_mpdu_num > 1) {
30+ tid_agg_rx->stored_mpdu_num) {
31 /*
32 * No buffers ready to be released, but check whether any
33 * frames in the reorder buffer have timed out.
34--
351.7.7.4
36
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0015-writeback-fix-NULL-bdi-dev-in-trace-writeback_single.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0015-writeback-fix-NULL-bdi-dev-in-trace-writeback_single.patch
new file mode 100644
index 00000000..4c7acabf
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0015-writeback-fix-NULL-bdi-dev-in-trace-writeback_single.patch
@@ -0,0 +1,72 @@
1From aec14f459cc9d40f9fd4a7aad2be761de084b320 Mon Sep 17 00:00:00 2001
2From: Wu Fengguang <fengguang.wu@intel.com>
3Date: Tue, 17 Jan 2012 11:18:56 -0600
4Subject: [PATCH 15/30] writeback: fix NULL bdi->dev in trace
5 writeback_single_inode
6
7commit 15eb77a07c714ac80201abd0a9568888bcee6276 upstream.
8
9bdi_prune_sb() resets sb->s_bdi to default_backing_dev_info when the
10tearing down the original bdi. Fix trace_writeback_single_inode to
11use sb->s_bdi=default_backing_dev_info rather than bdi->dev=NULL for a
12teared down bdi.
13
14Reported-by: Rabin Vincent <rabin@rab.in>
15Tested-by: Rabin Vincent <rabin@rab.in>
16Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 fs/fs-writeback.c | 16 ++++++++--------
20 include/trace/events/writeback.h | 2 +-
21 2 files changed, 9 insertions(+), 9 deletions(-)
22
23diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
24index 517f211..54f5786 100644
25--- a/fs/fs-writeback.c
26+++ b/fs/fs-writeback.c
27@@ -48,14 +48,6 @@ struct wb_writeback_work {
28 };
29
30 /*
31- * Include the creation of the trace points after defining the
32- * wb_writeback_work structure so that the definition remains local to this
33- * file.
34- */
35-#define CREATE_TRACE_POINTS
36-#include <trace/events/writeback.h>
37-
38-/*
39 * We don't actually have pdflush, but this one is exported though /proc...
40 */
41 int nr_pdflush_threads;
42@@ -87,6 +79,14 @@ static inline struct inode *wb_inode(struct list_head *head)
43 return list_entry(head, struct inode, i_wb_list);
44 }
45
46+/*
47+ * Include the creation of the trace points after defining the
48+ * wb_writeback_work structure and inline functions so that the definition
49+ * remains local to this file.
50+ */
51+#define CREATE_TRACE_POINTS
52+#include <trace/events/writeback.h>
53+
54 /* Wakeup flusher thread or forker thread to fork it. Requires bdi->wb_lock. */
55 static void bdi_wakeup_flusher(struct backing_dev_info *bdi)
56 {
57diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
58index 99d1d0d..46e389c 100644
59--- a/include/trace/events/writeback.h
60+++ b/include/trace/events/writeback.h
61@@ -418,7 +418,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
62
63 TP_fast_assign(
64 strncpy(__entry->name,
65- dev_name(inode->i_mapping->backing_dev_info->dev), 32);
66+ dev_name(inode_to_bdi(inode)->dev), 32);
67 __entry->ino = inode->i_ino;
68 __entry->state = inode->i_state;
69 __entry->dirtied_when = inode->dirtied_when;
70--
711.7.7.4
72
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0016-writeback-fix-dereferencing-NULL-bdi-dev-on-trace_wr.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0016-writeback-fix-dereferencing-NULL-bdi-dev-on-trace_wr.patch
new file mode 100644
index 00000000..495dfa8d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0016-writeback-fix-dereferencing-NULL-bdi-dev-on-trace_wr.patch
@@ -0,0 +1,44 @@
1From 422204b77968331ce85721527f7ece49f72658f2 Mon Sep 17 00:00:00 2001
2From: Wu Fengguang <fengguang.wu@intel.com>
3Date: Sat, 4 Feb 2012 20:54:03 -0600
4Subject: [PATCH 16/30] writeback: fix dereferencing NULL bdi->dev on
5 trace_writeback_queue
6
7commit 977b7e3a52a7421ad33a393a38ece59f3d41c2fa upstream.
8
9When a SD card is hot removed without umount, del_gendisk() will call
10bdi_unregister() without destroying/freeing it. This leaves the bdi in
11the bdi->dev = NULL, bdi->wb.task = NULL, bdi->bdi_list removed state.
12
13When sync(2) gets the bdi before bdi_unregister() and calls
14bdi_queue_work() after the unregister, trace_writeback_queue will be
15dereferencing the NULL bdi->dev. Fix it with a simple test for NULL.
16
17LKML-reference: http://lkml.org/lkml/2012/1/18/346
18Reported-by: Rabin Vincent <rabin@rab.in>
19Tested-by: Namjae Jeon <linkinjeon@gmail.com>
20Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 include/trace/events/writeback.h | 5 ++++-
24 1 files changed, 4 insertions(+), 1 deletions(-)
25
26diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
27index 46e389c..1f48f14 100644
28--- a/include/trace/events/writeback.h
29+++ b/include/trace/events/writeback.h
30@@ -47,7 +47,10 @@ DECLARE_EVENT_CLASS(writeback_work_class,
31 __field(int, reason)
32 ),
33 TP_fast_assign(
34- strncpy(__entry->name, dev_name(bdi->dev), 32);
35+ struct device *dev = bdi->dev;
36+ if (!dev)
37+ dev = default_backing_dev_info.dev;
38+ strncpy(__entry->name, dev_name(dev), 32);
39 __entry->nr_pages = work->nr_pages;
40 __entry->sb_dev = work->sb ? work->sb->s_dev : 0;
41 __entry->sync_mode = work->sync_mode;
42--
431.7.7.4
44
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0017-hwmon-f75375s-Fix-automatic-pwm-mode-setting-for-F75.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0017-hwmon-f75375s-Fix-automatic-pwm-mode-setting-for-F75.patch
new file mode 100644
index 00000000..ae31b440
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0017-hwmon-f75375s-Fix-automatic-pwm-mode-setting-for-F75.patch
@@ -0,0 +1,34 @@
1From 90d9b5dce1ba11bb577378da3138be5c40c01278 Mon Sep 17 00:00:00 2001
2From: Nikolaus Schulz <schulz@macnetix.de>
3Date: Wed, 8 Feb 2012 18:56:08 +0100
4Subject: [PATCH 17/30] hwmon: (f75375s) Fix automatic pwm mode setting for
5 F75373 & F75375
6
7commit 09e87e5c4f9af656af2a8a3afc03487c5d9287c3 upstream.
8
9In order to enable temperature mode aka automatic mode for the F75373 and
10F75375 chips, the two FANx_MODE bits in the fan configuration register
11need be set to 01, not 10.
12
13Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
14Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15---
16 drivers/hwmon/f75375s.c | 2 +-
17 1 files changed, 1 insertions(+), 1 deletions(-)
18
19diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
20index dcfd9e1..e4ab491 100644
21--- a/drivers/hwmon/f75375s.c
22+++ b/drivers/hwmon/f75375s.c
23@@ -311,7 +311,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
24 fanmode |= (3 << FAN_CTRL_MODE(nr));
25 break;
26 case 2: /* AUTOMATIC*/
27- fanmode |= (2 << FAN_CTRL_MODE(nr));
28+ fanmode |= (1 << FAN_CTRL_MODE(nr));
29 break;
30 case 3: /* fan speed */
31 break;
32--
331.7.7.4
34
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0018-cifs-request-oplock-when-doing-open-on-lookup.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0018-cifs-request-oplock-when-doing-open-on-lookup.patch
new file mode 100644
index 00000000..b942b85b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0018-cifs-request-oplock-when-doing-open-on-lookup.patch
@@ -0,0 +1,32 @@
1From 77d04b76d64e24329bb63d3d8d52c942db61bcb6 Mon Sep 17 00:00:00 2001
2From: Jeff Layton <jlayton@redhat.com>
3Date: Tue, 7 Feb 2012 06:30:52 -0500
4Subject: [PATCH 18/30] cifs: request oplock when doing open on lookup
5
6commit 8b0192a5f478da1c1ae906bf3ffff53f26204f56 upstream.
7
8Currently, it's always set to 0 (no oplock requested).
9
10Signed-off-by: Jeff Layton <jlayton@redhat.com>
11Signed-off-by: Steve French <smfrench@gmail.com>
12Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13---
14 fs/cifs/dir.c | 2 +-
15 1 files changed, 1 insertions(+), 1 deletions(-)
16
17diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
18index d7eeb9d..e4c3334 100644
19--- a/fs/cifs/dir.c
20+++ b/fs/cifs/dir.c
21@@ -492,7 +492,7 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
22 {
23 int xid;
24 int rc = 0; /* to get around spurious gcc warning, set to zero here */
25- __u32 oplock = 0;
26+ __u32 oplock = enable_oplocks ? REQ_OPLOCK : 0;
27 __u16 fileHandle = 0;
28 bool posix_open = false;
29 struct cifs_sb_info *cifs_sb;
30--
311.7.7.4
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0019-cifs-don-t-return-error-from-standard_receive3-after.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0019-cifs-don-t-return-error-from-standard_receive3-after.patch
new file mode 100644
index 00000000..38e1b8f6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0019-cifs-don-t-return-error-from-standard_receive3-after.patch
@@ -0,0 +1,50 @@
1From 23cfecf97911af4ef38afd61879f030af0410755 Mon Sep 17 00:00:00 2001
2From: Jeff Layton <jlayton@redhat.com>
3Date: Tue, 7 Feb 2012 06:31:05 -0500
4Subject: [PATCH 19/30] cifs: don't return error from standard_receive3 after
5 marking response malformed
6
7commit ff4fa4a25a33f92b5653bb43add0c63bea98d464 upstream.
8
9standard_receive3 will check the validity of the response from the
10server (via checkSMB). It'll pass the result of that check to handle_mid
11which will dequeue it and mark it with a status of
12MID_RESPONSE_MALFORMED if checkSMB returned an error. At that point,
13standard_receive3 will also return an error, which will make the
14demultiplex thread skip doing the callback for the mid.
15
16This is wrong -- if we were able to identify the request and the
17response is marked malformed, then we want the demultiplex thread to do
18the callback. Fix this by making standard_receive3 return 0 in this
19situation.
20
21Reported-and-Tested-by: Mark Moseley <moseleymark@gmail.com>
22Signed-off-by: Jeff Layton <jlayton@redhat.com>
23Signed-off-by: Steve French <smfrench@gmail.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 fs/cifs/connect.c | 7 ++++---
27 1 files changed, 4 insertions(+), 3 deletions(-)
28
29diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
30index 63e4be4..720edf5 100644
31--- a/fs/cifs/connect.c
32+++ b/fs/cifs/connect.c
33@@ -756,10 +756,11 @@ standard_receive3(struct TCP_Server_Info *server, struct mid_q_entry *mid)
34 cifs_dump_mem("Bad SMB: ", buf,
35 min_t(unsigned int, server->total_read, 48));
36
37- if (mid)
38- handle_mid(mid, server, smb_buffer, length);
39+ if (!mid)
40+ return length;
41
42- return length;
43+ handle_mid(mid, server, smb_buffer, length);
44+ return 0;
45 }
46
47 static int
48--
491.7.7.4
50
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0020-crypto-sha512-Use-binary-and-instead-of-modulus.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0020-crypto-sha512-Use-binary-and-instead-of-modulus.patch
new file mode 100644
index 00000000..d948f724
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0020-crypto-sha512-Use-binary-and-instead-of-modulus.patch
@@ -0,0 +1,42 @@
1From f334f74575cb0d9463d39caf4a43483cfc3dd542 Mon Sep 17 00:00:00 2001
2From: Herbert Xu <herbert@gondor.apana.org.au>
3Date: Thu, 26 Jan 2012 15:03:16 +1100
4Subject: [PATCH 20/30] crypto: sha512 - Use binary and instead of modulus
5
6commit 58d7d18b5268febb8b1391c6dffc8e2aaa751fcd upstream.
7
8The previous patch used the modulus operator over a power of 2
9unnecessarily which may produce suboptimal binary code. This
10patch changes changes them to binary ands instead.
11
12Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 crypto/sha512_generic.c | 4 ++--
16 1 files changed, 2 insertions(+), 2 deletions(-)
17
18diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
19index 88f160b..3edebfd 100644
20--- a/crypto/sha512_generic.c
21+++ b/crypto/sha512_generic.c
22@@ -78,7 +78,7 @@ static inline void LOAD_OP(int I, u64 *W, const u8 *input)
23
24 static inline void BLEND_OP(int I, u64 *W)
25 {
26- W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]);
27+ W[I & 15] += s1(W[(I-2) & 15]) + W[(I-7) & 15] + s0(W[(I-15) & 15]);
28 }
29
30 static void
31@@ -105,7 +105,7 @@ sha512_transform(u64 *state, const u8 *input)
32
33 #define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
34 BLEND_OP(i, W); \
35- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \
36+ t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \
37 t2 = e0(a) + Maj(a, b, c); \
38 d += t1; \
39 h = t1 + t2
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0021-crypto-sha512-Avoid-stack-bloat-on-i386.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0021-crypto-sha512-Avoid-stack-bloat-on-i386.patch
new file mode 100644
index 00000000..c5441ebb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0021-crypto-sha512-Avoid-stack-bloat-on-i386.patch
@@ -0,0 +1,113 @@
1From 03b762ab87db7977a7e6d9fe92dd63fa6dbc5f02 Mon Sep 17 00:00:00 2001
2From: Herbert Xu <herbert@gondor.apana.org.au>
3Date: Sun, 5 Feb 2012 15:09:28 +1100
4Subject: [PATCH 21/30] crypto: sha512 - Avoid stack bloat on i386
5
6commit 3a92d687c8015860a19213e3c102cad6b722f83c upstream.
7
8Unfortunately in reducing W from 80 to 16 we ended up unrolling
9the loop twice. As gcc has issues dealing with 64-bit ops on
10i386 this means that we end up using even more stack space (>1K).
11
12This patch solves the W reduction by moving LOAD_OP/BLEND_OP
13into the loop itself, thus avoiding the need to duplicate it.
14
15While the stack space still isn't great (>0.5K) it is at least
16in the same ball park as the amount of stack used for our C sha1
17implementation.
18
19Note that this patch basically reverts to the original code so
20the diff looks bigger than it really is.
21
22Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 crypto/sha512_generic.c | 68 ++++++++++++++++++++++-------------------------
26 1 files changed, 32 insertions(+), 36 deletions(-)
27
28diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
29index 3edebfd..f04af93 100644
30--- a/crypto/sha512_generic.c
31+++ b/crypto/sha512_generic.c
32@@ -89,46 +89,42 @@ sha512_transform(u64 *state, const u8 *input)
33 int i;
34 u64 W[16];
35
36- /* load the input */
37- for (i = 0; i < 16; i++)
38- LOAD_OP(i, W, input);
39-
40 /* load the state into our registers */
41 a=state[0]; b=state[1]; c=state[2]; d=state[3];
42 e=state[4]; f=state[5]; g=state[6]; h=state[7];
43
44-#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \
45- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \
46- t2 = e0(a) + Maj(a, b, c); \
47- d += t1; \
48- h = t1 + t2
49-
50-#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
51- BLEND_OP(i, W); \
52- t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)&15]; \
53- t2 = e0(a) + Maj(a, b, c); \
54- d += t1; \
55- h = t1 + t2
56-
57- for (i = 0; i < 16; i += 8) {
58- SHA512_0_15(i, a, b, c, d, e, f, g, h);
59- SHA512_0_15(i + 1, h, a, b, c, d, e, f, g);
60- SHA512_0_15(i + 2, g, h, a, b, c, d, e, f);
61- SHA512_0_15(i + 3, f, g, h, a, b, c, d, e);
62- SHA512_0_15(i + 4, e, f, g, h, a, b, c, d);
63- SHA512_0_15(i + 5, d, e, f, g, h, a, b, c);
64- SHA512_0_15(i + 6, c, d, e, f, g, h, a, b);
65- SHA512_0_15(i + 7, b, c, d, e, f, g, h, a);
66- }
67- for (i = 16; i < 80; i += 8) {
68- SHA512_16_79(i, a, b, c, d, e, f, g, h);
69- SHA512_16_79(i + 1, h, a, b, c, d, e, f, g);
70- SHA512_16_79(i + 2, g, h, a, b, c, d, e, f);
71- SHA512_16_79(i + 3, f, g, h, a, b, c, d, e);
72- SHA512_16_79(i + 4, e, f, g, h, a, b, c, d);
73- SHA512_16_79(i + 5, d, e, f, g, h, a, b, c);
74- SHA512_16_79(i + 6, c, d, e, f, g, h, a, b);
75- SHA512_16_79(i + 7, b, c, d, e, f, g, h, a);
76+ /* now iterate */
77+ for (i=0; i<80; i+=8) {
78+ if (!(i & 8)) {
79+ int j;
80+
81+ if (i < 16) {
82+ /* load the input */
83+ for (j = 0; j < 16; j++)
84+ LOAD_OP(i + j, W, input);
85+ } else {
86+ for (j = 0; j < 16; j++) {
87+ BLEND_OP(i + j, W);
88+ }
89+ }
90+ }
91+
92+ t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[(i & 15)];
93+ t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2;
94+ t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[(i & 15) + 1];
95+ t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2;
96+ t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[(i & 15) + 2];
97+ t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2;
98+ t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[(i & 15) + 3];
99+ t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2;
100+ t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[(i & 15) + 4];
101+ t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2;
102+ t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[(i & 15) + 5];
103+ t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2;
104+ t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[(i & 15) + 6];
105+ t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2;
106+ t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[(i & 15) + 7];
107+ t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2;
108 }
109
110 state[0] += a; state[1] += b; state[2] += c; state[3] += d;
111--
1121.7.7.4
113
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0022-backing-dev-fix-wakeup-timer-races-with-bdi_unregist.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0022-backing-dev-fix-wakeup-timer-races-with-bdi_unregist.patch
new file mode 100644
index 00000000..708c8141
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0022-backing-dev-fix-wakeup-timer-races-with-bdi_unregist.patch
@@ -0,0 +1,95 @@
1From 884d833e27faee8f929f95ca1be53b1997c66c30 Mon Sep 17 00:00:00 2001
2From: Rabin Vincent <rabin@rab.in>
3Date: Sun, 29 Jan 2012 12:17:33 -0600
4Subject: [PATCH 22/30] backing-dev: fix wakeup timer races with
5 bdi_unregister()
6
7commit 2673b4cf5d59c3ee5e0c12f6d734d38770324dc4 upstream.
8
9While 7a401a972df8e18 ("backing-dev: ensure wakeup_timer is deleted")
10addressed the problem of the bdi being freed with a queued wakeup
11timer, there are other races that could happen if the wakeup timer
12expires after/during bdi_unregister(), before bdi_destroy() is called.
13
14wakeup_timer_fn() could attempt to wakeup a task which has already has
15been freed, or could access a NULL bdi->dev via the wake_forker_thread
16tracepoint.
17
18Cc: Jens Axboe <axboe@kernel.dk>
19Reported-by: Chanho Min <chanho.min@lge.com>
20Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
21Signed-off-by: Rabin Vincent <rabin@rab.in>
22Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 mm/backing-dev.c | 25 +++++++++++++++++++------
26 1 files changed, 19 insertions(+), 6 deletions(-)
27
28diff --git a/mm/backing-dev.c b/mm/backing-dev.c
29index 71034f4..2b49dd2 100644
30--- a/mm/backing-dev.c
31+++ b/mm/backing-dev.c
32@@ -318,7 +318,7 @@ static void wakeup_timer_fn(unsigned long data)
33 if (bdi->wb.task) {
34 trace_writeback_wake_thread(bdi);
35 wake_up_process(bdi->wb.task);
36- } else {
37+ } else if (bdi->dev) {
38 /*
39 * When bdi tasks are inactive for long time, they are killed.
40 * In this case we have to wake-up the forker thread which
41@@ -584,6 +584,8 @@ EXPORT_SYMBOL(bdi_register_dev);
42 */
43 static void bdi_wb_shutdown(struct backing_dev_info *bdi)
44 {
45+ struct task_struct *task;
46+
47 if (!bdi_cap_writeback_dirty(bdi))
48 return;
49
50@@ -604,9 +606,14 @@ static void bdi_wb_shutdown(struct backing_dev_info *bdi)
51 * unfreeze of the thread before calling kthread_stop(), otherwise
52 * it would never exet if it is currently stuck in the refrigerator.
53 */
54- if (bdi->wb.task) {
55- thaw_process(bdi->wb.task);
56- kthread_stop(bdi->wb.task);
57+ spin_lock_bh(&bdi->wb_lock);
58+ task = bdi->wb.task;
59+ bdi->wb.task = NULL;
60+ spin_unlock_bh(&bdi->wb_lock);
61+
62+ if (task) {
63+ thaw_process(task);
64+ kthread_stop(task);
65 }
66 }
67
68@@ -627,7 +634,9 @@ static void bdi_prune_sb(struct backing_dev_info *bdi)
69
70 void bdi_unregister(struct backing_dev_info *bdi)
71 {
72- if (bdi->dev) {
73+ struct device *dev = bdi->dev;
74+
75+ if (dev) {
76 bdi_set_min_ratio(bdi, 0);
77 trace_writeback_bdi_unregister(bdi);
78 bdi_prune_sb(bdi);
79@@ -636,8 +645,12 @@ void bdi_unregister(struct backing_dev_info *bdi)
80 if (!bdi_cap_flush_forker(bdi))
81 bdi_wb_shutdown(bdi);
82 bdi_debug_unregister(bdi);
83- device_unregister(bdi->dev);
84+
85+ spin_lock_bh(&bdi->wb_lock);
86 bdi->dev = NULL;
87+ spin_unlock_bh(&bdi->wb_lock);
88+
89+ device_unregister(dev);
90 }
91 }
92 EXPORT_SYMBOL(bdi_unregister);
93--
941.7.7.4
95
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0023-ALSA-intel8x0-Fix-default-inaudible-sound-on-Gateway.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0023-ALSA-intel8x0-Fix-default-inaudible-sound-on-Gateway.patch
new file mode 100644
index 00000000..7ebb3f92
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0023-ALSA-intel8x0-Fix-default-inaudible-sound-on-Gateway.patch
@@ -0,0 +1,42 @@
1From c9353a7b06ea31cea2e1319ebe75d6e9045fffd4 Mon Sep 17 00:00:00 2001
2From: Daniel T Chen <crimsun@ubuntu.com>
3Date: Mon, 13 Feb 2012 23:44:22 -0500
4Subject: [PATCH 23/30] ALSA: intel8x0: Fix default inaudible sound on Gateway
5 M520
6
7commit 27c3afe6e1cf129faac90405121203962da08ff4 upstream.
8
9BugLink: https://bugs.launchpad.net/bugs/930842
10
11The reporter states that audio is inaudible by default without muting
12'External Amplifier'. Add a quirk to handle his SSID so that changing
13the control is not necessary.
14
15Reported-and-tested-by: Benjamin Carlson <elderbubba0810@gmail.com>
16Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
17Signed-off-by: Takashi Iwai <tiwai@suse.de>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 sound/pci/intel8x0.c | 6 ++++++
21 1 files changed, 6 insertions(+), 0 deletions(-)
22
23diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
24index 11718b49..55f48fb 100644
25--- a/sound/pci/intel8x0.c
26+++ b/sound/pci/intel8x0.c
27@@ -2102,6 +2102,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
28 },
29 {
30 .subvendor = 0x161f,
31+ .subdevice = 0x202f,
32+ .name = "Gateway M520",
33+ .type = AC97_TUNE_INV_EAPD
34+ },
35+ {
36+ .subvendor = 0x161f,
37 .subdevice = 0x203a,
38 .name = "Gateway 4525GZ", /* AD1981B */
39 .type = AC97_TUNE_INV_EAPD
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0024-ALSA-hda-Fix-initialization-of-secondary-capture-sou.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0024-ALSA-hda-Fix-initialization-of-secondary-capture-sou.patch
new file mode 100644
index 00000000..d07a261a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0024-ALSA-hda-Fix-initialization-of-secondary-capture-sou.patch
@@ -0,0 +1,41 @@
1From 852c3a36c216e351d07ca96e9af30b81fff30ccc Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Mon, 13 Feb 2012 15:04:06 +0100
4Subject: [PATCH 24/30] ALSA: hda - Fix initialization of secondary capture
5 source on VT1705
6
7commit fc1156c0b0f7ad45ec03d919866349eeca2bf18c upstream.
8
9VT1705 codec has two ADCs where the secondary ADC has no MUX but only
10a fixed connection to the mic pin. This confused the driver and it
11tries always overriding the input-source selection by assumption of
12the existing MUX for the secondary ADC, resulted in resetting the
13input-source at each time PM (including power-saving) occurs.
14
15The fix is simply to check the existence of MUX for secondary ADCs in
16the initialization code.
17
18Tested-by: Anisse Astier <anisse@astier.eu>
19Signed-off-by: Takashi Iwai <tiwai@suse.de>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 sound/pci/hda/patch_via.c | 3 +++
23 1 files changed, 3 insertions(+), 0 deletions(-)
24
25diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
26index a0a3f50..1fe1308 100644
27--- a/sound/pci/hda/patch_via.c
28+++ b/sound/pci/hda/patch_via.c
29@@ -665,6 +665,9 @@ static void via_auto_init_analog_input(struct hda_codec *codec)
30 /* init input-src */
31 for (i = 0; i < spec->num_adc_nids; i++) {
32 int adc_idx = spec->inputs[spec->cur_mux[i]].adc_idx;
33+ /* secondary ADCs must have the unique MUX */
34+ if (i > 0 && !spec->mux_nids[i])
35+ break;
36 if (spec->mux_nids[adc_idx]) {
37 int mux_idx = spec->inputs[spec->cur_mux[i]].mux_idx;
38 snd_hda_codec_write(codec, spec->mux_nids[adc_idx], 0,
39--
401.7.7.4
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0025-ALSA-hda-Fix-silent-speaker-output-on-Acer-Aspire-69.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0025-ALSA-hda-Fix-silent-speaker-output-on-Acer-Aspire-69.patch
new file mode 100644
index 00000000..8fb6bfde
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0025-ALSA-hda-Fix-silent-speaker-output-on-Acer-Aspire-69.patch
@@ -0,0 +1,78 @@
1From 2edcb814b345ab919010974e88a4bbd407bf4db8 Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Mon, 13 Feb 2012 15:25:07 +0100
4Subject: [PATCH 25/30] ALSA: hda - Fix silent speaker output on Acer Aspire
5 6935
6
7commit 02a237b24d57e2e2d5402c92549e9e792aa24359 upstream.
8
9Since 3.2 kernel, the driver starts trying to assign the multi-io DACs
10before the speaker, thus it assigns DAC2/3 for multi-io and DAC4 for
11the speaker for a standard laptop setup like a HP, a speaker, a mic-in
12and a line-in. However, on Acer Aspire 6935, it seems that the
13speaker pin 0x14 must be connected with either DAC1 or 2; otherwise it
14results in silence by some reason, although the codec itself allows
15the routing to DAC3/4.
16
17As a workaround, the connection list of each pin is reduced to be
18mapped to either only DAC1/2 or DAC3/4, so that the compatible
19assignment as in kernel 3.1 is achieved.
20
21Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42740
22
23Signed-off-by: Takashi Iwai <tiwai@suse.de>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 sound/pci/hda/patch_realtek.c | 23 +++++++++++++++++++++++
27 1 files changed, 23 insertions(+), 0 deletions(-)
28
29diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
30index 34e5fcc..9c197d4 100644
31--- a/sound/pci/hda/patch_realtek.c
32+++ b/sound/pci/hda/patch_realtek.c
33@@ -4213,8 +4213,26 @@ enum {
34 PINFIX_PB_M5210,
35 PINFIX_ACER_ASPIRE_7736,
36 PINFIX_ASUS_W90V,
37+ ALC889_FIXUP_DAC_ROUTE,
38 };
39
40+/* Fix the connection of some pins for ALC889:
41+ * At least, Acer Aspire 5935 shows the connections to DAC3/4 don't
42+ * work correctly (bko#42740)
43+ */
44+static void alc889_fixup_dac_route(struct hda_codec *codec,
45+ const struct alc_fixup *fix, int action)
46+{
47+ if (action == ALC_FIXUP_ACT_PRE_PROBE) {
48+ hda_nid_t conn1[2] = { 0x0c, 0x0d };
49+ hda_nid_t conn2[2] = { 0x0e, 0x0f };
50+ snd_hda_override_conn_list(codec, 0x14, 2, conn1);
51+ snd_hda_override_conn_list(codec, 0x15, 2, conn1);
52+ snd_hda_override_conn_list(codec, 0x18, 2, conn2);
53+ snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
54+ }
55+}
56+
57 static const struct alc_fixup alc882_fixups[] = {
58 [PINFIX_ABIT_AW9D_MAX] = {
59 .type = ALC_FIXUP_PINS,
60@@ -4251,10 +4269,15 @@ static const struct alc_fixup alc882_fixups[] = {
61 { }
62 }
63 },
64+ [ALC889_FIXUP_DAC_ROUTE] = {
65+ .type = ALC_FIXUP_FUNC,
66+ .v.func = alc889_fixup_dac_route,
67+ },
68 };
69
70 static const struct snd_pci_quirk alc882_fixup_tbl[] = {
71 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", PINFIX_PB_M5210),
72+ SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
73 SND_PCI_QUIRK(0x1043, 0x1873, "ASUS W90V", PINFIX_ASUS_W90V),
74 SND_PCI_QUIRK(0x17aa, 0x3a0d, "Lenovo Y530", PINFIX_LENOVO_Y530),
75 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", PINFIX_ABIT_AW9D_MAX),
76--
771.7.7.4
78
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0026-mmc-atmel-mci-save-and-restore-sdioirq-when-soft-res.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0026-mmc-atmel-mci-save-and-restore-sdioirq-when-soft-res.patch
new file mode 100644
index 00000000..40667ce3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0026-mmc-atmel-mci-save-and-restore-sdioirq-when-soft-res.patch
@@ -0,0 +1,42 @@
1From b207384ec8dd38b408be6c29bcf7a3484771c34e Mon Sep 17 00:00:00 2001
2From: Ludovic Desroches <ludovic.desroches@atmel.com>
3Date: Thu, 9 Feb 2012 11:55:29 +0100
4Subject: [PATCH 26/30] mmc: atmel-mci: save and restore sdioirq when soft
5 reset is performed
6
7commit 18ee684b8ab666329e0a0a72d8b70f16fb0e2243 upstream.
8
9Sometimes a software reset is needed. Then some registers are saved and
10restored but the interrupt mask register is missing. It causes issues
11with sdio devices whose interrupts are masked after reset.
12
13Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
14Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
15Signed-off-by: Chris Ball <cjb@laptop.org>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/mmc/host/atmel-mci.c | 3 +++
19 1 files changed, 3 insertions(+), 0 deletions(-)
20
21diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
22index a7ee502..72bc756 100644
23--- a/drivers/mmc/host/atmel-mci.c
24+++ b/drivers/mmc/host/atmel-mci.c
25@@ -965,11 +965,14 @@ static void atmci_start_request(struct atmel_mci *host,
26 host->data_status = 0;
27
28 if (host->need_reset) {
29+ iflags = atmci_readl(host, ATMCI_IMR);
30+ iflags &= (ATMCI_SDIOIRQA | ATMCI_SDIOIRQB);
31 atmci_writel(host, ATMCI_CR, ATMCI_CR_SWRST);
32 atmci_writel(host, ATMCI_CR, ATMCI_CR_MCIEN);
33 atmci_writel(host, ATMCI_MR, host->mode_reg);
34 if (host->caps.has_cfg_reg)
35 atmci_writel(host, ATMCI_CFG, host->cfg_reg);
36+ atmci_writel(host, ATMCI_IER, iflags);
37 host->need_reset = false;
38 }
39 atmci_writel(host, ATMCI_SDCR, slot->sdc_reg);
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0027-mmc-dw_mmc-Fix-PIO-mode-with-support-of-highmem.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0027-mmc-dw_mmc-Fix-PIO-mode-with-support-of-highmem.patch
new file mode 100644
index 00000000..d0cb3c79
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0027-mmc-dw_mmc-Fix-PIO-mode-with-support-of-highmem.patch
@@ -0,0 +1,353 @@
1From 00863fc2727e1d1e93c17add69f675935b4d1956 Mon Sep 17 00:00:00 2001
2From: Seungwon Jeon <tgih.jun@samsung.com>
3Date: Thu, 9 Feb 2012 14:32:43 +0900
4Subject: [PATCH 27/30] mmc: dw_mmc: Fix PIO mode with support of highmem
5
6commit f9c2a0dc42a6938ff2a80e55ca2bbd1d5581c72e upstream.
7
8Current PIO mode makes a kernel crash with CONFIG_HIGHMEM.
9Highmem pages have a NULL from sg_virt(sg).
10This patch fixes the following problem.
11
12Unable to handle kernel NULL pointer dereference at virtual address 00000000
13pgd = c0004000
14[00000000] *pgd=00000000
15Internal error: Oops: 817 [#1] PREEMPT SMP
16Modules linked in:
17CPU: 0 Not tainted (3.0.15-01423-gdbf465f #589)
18PC is at dw_mci_pull_data32+0x4c/0x9c
19LR is at dw_mci_read_data_pio+0x54/0x1f0
20pc : [<c0358824>] lr : [<c035988c>] psr: 20000193
21sp : c0619d48 ip : c0619d70 fp : c0619d6c
22r10: 00000000 r9 : 00000002 r8 : 00001000
23r7 : 00000200 r6 : 00000000 r5 : e1dd3100 r4 : 00000000
24r3 : 65622023 r2 : 0000007f r1 : eeb96000 r0 : e1dd3100
25Flags: nzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment
26xkernel
27Control: 10c5387d Table: 61e2004a DAC: 00000015
28Process swapper (pid: 0, stack limit = 0xc06182f0)
29Stack: (0xc0619d48 to 0xc061a000)
309d40: e1dd3100 e1a4f000 00000000 e1dd3100 e1a4f000 00000200
319d60: c0619da4 c0619d70 c035988c c03587e4 c0619d9c e18158f4 e1dd3100 e1dd3100
329d80: 00000020 00000000 00000000 00000020 c06e8a84 00000000 c0619e04 c0619da8
339da0: c0359b24 c0359844 e18158f4 e1dd3164 e1dd3168 e1dd3150 3d02fc79 e1dd3154
349dc0: e1dd3178 00000000 00000020 00000000 e1dd3150 00000000 c10dd7e8 e1a84900
359de0: c061e7cc 00000000 00000000 0000008d c06e8a84 c061e780 c0619e4c c0619e08
369e00: c00c4738 c0359a34 3d02fc79 00000000 c0619e4c c05a1698 c05a1670 c05a165c
379e20: c04de8b0 c061e780 c061e7cc e1a84900 ffffed68 0000008d c0618000 00000000
389e40: c0619e6c c0619e50 c00c48b4 c00c46c8 c061e780 c00423ac c061e7cc ffffed68
399e60: c0619e8c c0619e70 c00c7358 c00c487c 0000008d ffffee38 c0618000 ffffed68
409e80: c0619ea4 c0619e90 c00c4258 c00c72b0 c00423ac ffffee38 c0619ecc c0619ea8
419ea0: c004241c c00c4234 ffffffff f8810000 0000006d 00000002 00000001 7fffffff
429ec0: c0619f44 c0619ed0 c0048bc0 c00423c4 220ae7a9 00000000 386f0d30 0005d3a4
439ee0: c00423ac c10dd0b8 c06f2cd8 c0618000 c0594778 c003a674 7fffffff c0619f44
449f00: 386f0d30 c0619f18 c00a6f94 c005be3c 80000013 ffffffff 386f0d30 0005d3a4
459f20: 386f0d30 0005d2d1 c10dd0a8 c10dd0b8 c06f2cd8 c0618000 c0619f74 c0619f48
469f40: c0345858 c005be00 c00a2440 c0618000 c0618000 c00410d8 c06c1944 c00410fc
479f60: c0594778 c003a674 c0619f9c c0619f78 c004a7e8 c03457b4 c0618000 c06c18f8
489f80: 00000000 c0039c70 c06c18d4 c003a674 c0619fb4 c0619fa0 c04ceafc c004a714
499fa0: c06287b4 c06c18f8 c0619ff4 c0619fb8 c0008b68 c04cea68 c0008578 00000000
509fc0: 00000000 c003a674 00000000 10c5387d c0628658 c003aa78 c062f1c4 4000406a
519fe0: 413fc090 00000000 00000000 c0619ff8 40008044 c0008858 00000000 00000000
52Backtrace:
53[<c03587d8>] (dw_mci_pull_data32+0x0/0x9c) from [<c035988c>] (dw_mci_read_data_pio+0x54/0x1f0)
54 r6:00000200 r5:e1a4f000 r4:e1dd3100
55 [<c0359838>] (dw_mci_read_data_pio+0x0/0x1f0) from [<c0359b24>] (dw_mci_interrupt+0xfc/0x4a4)
56[<c0359a28>] (dw_mci_interrupt+0x0/0x4a4) from [<c00c4738>] (handle_irq_event_percpu+0x7c/0x1b4)
57[<c00c46bc>] (handle_irq_event_percpu+0x0/0x1b4) from [<c00c48b4>] (handle_irq_event+0x44/0x64)
58[<c00c4870>] (handle_irq_event+0x0/0x64) from [<c00c7358>] (handle_fasteoi_irq+0xb4/0x124)
59 r7:ffffed68 r6:c061e7cc r5:c00423ac r4:c061e780
60 [<c00c72a4>] (handle_fasteoi_irq+0x0/0x124) from [<c00c4258>] (generic_handle_irq+0x30/0x38)
61 r7:ffffed68 r6:c0618000 r5:ffffee38 r4:0000008d
62 [<c00c4228>] (generic_handle_irq+0x0/0x38) from [<c004241c>] (asm_do_IRQ+0x64/0xe0)
63 r5:ffffee38 r4:c00423ac
64 [<c00423b8>] (asm_do_IRQ+0x0/0xe0) from [<c0048bc0>] (__irq_svc+0x80/0x14c)
65Exception stack(0xc0619ed0 to 0xc0619f18)
66
67Signed-off-by: Seungwon Jeon <tgih.jun@samsung.com>
68Acked-by: Will Newton <will.newton@imgtec.com>
69Signed-off-by: Chris Ball <cjb@laptop.org>
70Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
71---
72 drivers/mmc/host/dw_mmc.c | 144 +++++++++++++++++++++++---------------------
73 include/linux/mmc/dw_mmc.h | 6 +-
74 2 files changed, 79 insertions(+), 71 deletions(-)
75
76diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
77index 3aaeb08..baf3d42 100644
78--- a/drivers/mmc/host/dw_mmc.c
79+++ b/drivers/mmc/host/dw_mmc.c
80@@ -22,7 +22,6 @@
81 #include <linux/ioport.h>
82 #include <linux/module.h>
83 #include <linux/platform_device.h>
84-#include <linux/scatterlist.h>
85 #include <linux/seq_file.h>
86 #include <linux/slab.h>
87 #include <linux/stat.h>
88@@ -502,8 +501,14 @@ static void dw_mci_submit_data(struct dw_mci *host, struct mmc_data *data)
89 host->dir_status = DW_MCI_SEND_STATUS;
90
91 if (dw_mci_submit_data_dma(host, data)) {
92+ int flags = SG_MITER_ATOMIC;
93+ if (host->data->flags & MMC_DATA_READ)
94+ flags |= SG_MITER_TO_SG;
95+ else
96+ flags |= SG_MITER_FROM_SG;
97+
98+ sg_miter_start(&host->sg_miter, data->sg, data->sg_len, flags);
99 host->sg = data->sg;
100- host->pio_offset = 0;
101 host->part_buf_start = 0;
102 host->part_buf_count = 0;
103
104@@ -953,6 +958,7 @@ static void dw_mci_tasklet_func(unsigned long priv)
105 * generates a block interrupt, hence setting
106 * the scatter-gather pointer to NULL.
107 */
108+ sg_miter_stop(&host->sg_miter);
109 host->sg = NULL;
110 ctrl = mci_readl(host, CTRL);
111 ctrl |= SDMMC_CTRL_FIFO_RESET;
112@@ -1286,54 +1292,44 @@ static void dw_mci_pull_data(struct dw_mci *host, void *buf, int cnt)
113
114 static void dw_mci_read_data_pio(struct dw_mci *host)
115 {
116- struct scatterlist *sg = host->sg;
117- void *buf = sg_virt(sg);
118- unsigned int offset = host->pio_offset;
119+ struct sg_mapping_iter *sg_miter = &host->sg_miter;
120+ void *buf;
121+ unsigned int offset;
122 struct mmc_data *data = host->data;
123 int shift = host->data_shift;
124 u32 status;
125 unsigned int nbytes = 0, len;
126+ unsigned int remain, fcnt;
127
128 do {
129- len = host->part_buf_count +
130- (SDMMC_GET_FCNT(mci_readl(host, STATUS)) << shift);
131- if (offset + len <= sg->length) {
132+ if (!sg_miter_next(sg_miter))
133+ goto done;
134+
135+ host->sg = sg_miter->__sg;
136+ buf = sg_miter->addr;
137+ remain = sg_miter->length;
138+ offset = 0;
139+
140+ do {
141+ fcnt = (SDMMC_GET_FCNT(mci_readl(host, STATUS))
142+ << shift) + host->part_buf_count;
143+ len = min(remain, fcnt);
144+ if (!len)
145+ break;
146 dw_mci_pull_data(host, (void *)(buf + offset), len);
147-
148 offset += len;
149 nbytes += len;
150-
151- if (offset == sg->length) {
152- flush_dcache_page(sg_page(sg));
153- host->sg = sg = sg_next(sg);
154- if (!sg)
155- goto done;
156-
157- offset = 0;
158- buf = sg_virt(sg);
159- }
160- } else {
161- unsigned int remaining = sg->length - offset;
162- dw_mci_pull_data(host, (void *)(buf + offset),
163- remaining);
164- nbytes += remaining;
165-
166- flush_dcache_page(sg_page(sg));
167- host->sg = sg = sg_next(sg);
168- if (!sg)
169- goto done;
170-
171- offset = len - remaining;
172- buf = sg_virt(sg);
173- dw_mci_pull_data(host, buf, offset);
174- nbytes += offset;
175- }
176+ remain -= len;
177+ } while (remain);
178+ sg_miter->consumed = offset;
179
180 status = mci_readl(host, MINTSTS);
181 mci_writel(host, RINTSTS, SDMMC_INT_RXDR);
182 if (status & DW_MCI_DATA_ERROR_FLAGS) {
183 host->data_status = status;
184 data->bytes_xfered += nbytes;
185+ sg_miter_stop(sg_miter);
186+ host->sg = NULL;
187 smp_wmb();
188
189 set_bit(EVENT_DATA_ERROR, &host->pending_events);
190@@ -1342,65 +1338,66 @@ static void dw_mci_read_data_pio(struct dw_mci *host)
191 return;
192 }
193 } while (status & SDMMC_INT_RXDR); /*if the RXDR is ready read again*/
194- host->pio_offset = offset;
195 data->bytes_xfered += nbytes;
196+
197+ if (!remain) {
198+ if (!sg_miter_next(sg_miter))
199+ goto done;
200+ sg_miter->consumed = 0;
201+ }
202+ sg_miter_stop(sg_miter);
203 return;
204
205 done:
206 data->bytes_xfered += nbytes;
207+ sg_miter_stop(sg_miter);
208+ host->sg = NULL;
209 smp_wmb();
210 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
211 }
212
213 static void dw_mci_write_data_pio(struct dw_mci *host)
214 {
215- struct scatterlist *sg = host->sg;
216- void *buf = sg_virt(sg);
217- unsigned int offset = host->pio_offset;
218+ struct sg_mapping_iter *sg_miter = &host->sg_miter;
219+ void *buf;
220+ unsigned int offset;
221 struct mmc_data *data = host->data;
222 int shift = host->data_shift;
223 u32 status;
224 unsigned int nbytes = 0, len;
225+ unsigned int fifo_depth = host->fifo_depth;
226+ unsigned int remain, fcnt;
227
228 do {
229- len = ((host->fifo_depth -
230- SDMMC_GET_FCNT(mci_readl(host, STATUS))) << shift)
231- - host->part_buf_count;
232- if (offset + len <= sg->length) {
233+ if (!sg_miter_next(sg_miter))
234+ goto done;
235+
236+ host->sg = sg_miter->__sg;
237+ buf = sg_miter->addr;
238+ remain = sg_miter->length;
239+ offset = 0;
240+
241+ do {
242+ fcnt = ((fifo_depth -
243+ SDMMC_GET_FCNT(mci_readl(host, STATUS)))
244+ << shift) - host->part_buf_count;
245+ len = min(remain, fcnt);
246+ if (!len)
247+ break;
248 host->push_data(host, (void *)(buf + offset), len);
249-
250 offset += len;
251 nbytes += len;
252- if (offset == sg->length) {
253- host->sg = sg = sg_next(sg);
254- if (!sg)
255- goto done;
256-
257- offset = 0;
258- buf = sg_virt(sg);
259- }
260- } else {
261- unsigned int remaining = sg->length - offset;
262-
263- host->push_data(host, (void *)(buf + offset),
264- remaining);
265- nbytes += remaining;
266-
267- host->sg = sg = sg_next(sg);
268- if (!sg)
269- goto done;
270-
271- offset = len - remaining;
272- buf = sg_virt(sg);
273- host->push_data(host, (void *)buf, offset);
274- nbytes += offset;
275- }
276+ remain -= len;
277+ } while (remain);
278+ sg_miter->consumed = offset;
279
280 status = mci_readl(host, MINTSTS);
281 mci_writel(host, RINTSTS, SDMMC_INT_TXDR);
282 if (status & DW_MCI_DATA_ERROR_FLAGS) {
283 host->data_status = status;
284 data->bytes_xfered += nbytes;
285+ sg_miter_stop(sg_miter);
286+ host->sg = NULL;
287
288 smp_wmb();
289
290@@ -1410,12 +1407,20 @@ static void dw_mci_write_data_pio(struct dw_mci *host)
291 return;
292 }
293 } while (status & SDMMC_INT_TXDR); /* if TXDR write again */
294- host->pio_offset = offset;
295 data->bytes_xfered += nbytes;
296+
297+ if (!remain) {
298+ if (!sg_miter_next(sg_miter))
299+ goto done;
300+ sg_miter->consumed = 0;
301+ }
302+ sg_miter_stop(sg_miter);
303 return;
304
305 done:
306 data->bytes_xfered += nbytes;
307+ sg_miter_stop(sg_miter);
308+ host->sg = NULL;
309 smp_wmb();
310 set_bit(EVENT_XFER_COMPLETE, &host->pending_events);
311 }
312@@ -1618,6 +1623,7 @@ static void dw_mci_work_routine_card(struct work_struct *work)
313 * block interrupt, hence setting the
314 * scatter-gather pointer to NULL.
315 */
316+ sg_miter_stop(&host->sg_miter);
317 host->sg = NULL;
318
319 ctrl = mci_readl(host, CTRL);
320diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
321index 6dc9b80..107fcb3 100644
322--- a/include/linux/mmc/dw_mmc.h
323+++ b/include/linux/mmc/dw_mmc.h
324@@ -14,6 +14,8 @@
325 #ifndef LINUX_MMC_DW_MMC_H
326 #define LINUX_MMC_DW_MMC_H
327
328+#include <linux/scatterlist.h>
329+
330 #define MAX_MCI_SLOTS 2
331
332 enum dw_mci_state {
333@@ -40,7 +42,7 @@ struct mmc_data;
334 * @lock: Spinlock protecting the queue and associated data.
335 * @regs: Pointer to MMIO registers.
336 * @sg: Scatterlist entry currently being processed by PIO code, if any.
337- * @pio_offset: Offset into the current scatterlist entry.
338+ * @sg_miter: PIO mapping scatterlist iterator.
339 * @cur_slot: The slot which is currently using the controller.
340 * @mrq: The request currently being processed on @cur_slot,
341 * or NULL if the controller is idle.
342@@ -115,7 +117,7 @@ struct dw_mci {
343 void __iomem *regs;
344
345 struct scatterlist *sg;
346- unsigned int pio_offset;
347+ struct sg_mapping_iter sg_miter;
348
349 struct dw_mci_slot *cur_slot;
350 struct mmc_request *mrq;
351--
3521.7.7.4
353
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0028-xen-pvhvm-do-not-remap-pirqs-onto-evtchns-if-xen_hav.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0028-xen-pvhvm-do-not-remap-pirqs-onto-evtchns-if-xen_hav.patch
new file mode 100644
index 00000000..014dd68f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0028-xen-pvhvm-do-not-remap-pirqs-onto-evtchns-if-xen_hav.patch
@@ -0,0 +1,31 @@
1From 3601bce60f271876c8dee6747ad5874aed96037f Mon Sep 17 00:00:00 2001
2From: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
3Date: Mon, 30 Jan 2012 14:31:46 +0000
4Subject: [PATCH 28/30] xen pvhvm: do not remap pirqs onto evtchns if
5 !xen_have_vector_callback
6
7commit 207d543f472c1ac9552df79838dc807cbcaa9740 upstream.
8
9Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
10Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
11Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12---
13 arch/x86/pci/xen.c | 2 +-
14 1 files changed, 1 insertions(+), 1 deletions(-)
15
16diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
17index 492ade8..d99346e 100644
18--- a/arch/x86/pci/xen.c
19+++ b/arch/x86/pci/xen.c
20@@ -374,7 +374,7 @@ int __init pci_xen_init(void)
21
22 int __init pci_xen_hvm_init(void)
23 {
24- if (!xen_feature(XENFEAT_hvm_pirqs))
25+ if (!xen_have_vector_callback || !xen_feature(XENFEAT_hvm_pirqs))
26 return 0;
27
28 #ifdef CONFIG_ACPI
29--
301.7.7.4
31
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0029-crypto-sha512-use-standard-ror64.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0029-crypto-sha512-use-standard-ror64.patch
new file mode 100644
index 00000000..3d4c4874
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0029-crypto-sha512-use-standard-ror64.patch
@@ -0,0 +1,90 @@
1From 7c51cb723a36b2b8491354029df48a984e8e8f8a Mon Sep 17 00:00:00 2001
2From: Alexey Dobriyan <adobriyan@gmail.com>
3Date: Sat, 14 Jan 2012 21:44:49 +0300
4Subject: [PATCH 29/30] crypto: sha512 - use standard ror64()
5
6commit f2ea0f5f04c97b48c88edccba52b0682fbe45087 upstream.
7
8Use standard ror64() instead of hand-written.
9There is no standard ror64, so create it.
10
11The difference is shift value being "unsigned int" instead of uint64_t
12(for which there is no reason). gcc starts to emit native ROR instructions
13which it doesn't do for some reason currently. This should make the code
14faster.
15
16Patch survives in-tree crypto test and ping flood with hmac(sha512) on.
17
18Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
19Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 crypto/sha512_generic.c | 13 ++++---------
23 include/linux/bitops.h | 20 ++++++++++++++++++++
24 2 files changed, 24 insertions(+), 9 deletions(-)
25
26diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
27index f04af93..107f6f7 100644
28--- a/crypto/sha512_generic.c
29+++ b/crypto/sha512_generic.c
30@@ -31,11 +31,6 @@ static inline u64 Maj(u64 x, u64 y, u64 z)
31 return (x & y) | (z & (x | y));
32 }
33
34-static inline u64 RORu64(u64 x, u64 y)
35-{
36- return (x >> y) | (x << (64 - y));
37-}
38-
39 static const u64 sha512_K[80] = {
40 0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
41 0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
42@@ -66,10 +61,10 @@ static const u64 sha512_K[80] = {
43 0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
44 };
45
46-#define e0(x) (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
47-#define e1(x) (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
48-#define s0(x) (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
49-#define s1(x) (RORu64(x,19) ^ RORu64(x,61) ^ (x >> 6))
50+#define e0(x) (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39))
51+#define e1(x) (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41))
52+#define s0(x) (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7))
53+#define s1(x) (ror64(x,19) ^ ror64(x,61) ^ (x >> 6))
54
55 static inline void LOAD_OP(int I, u64 *W, const u8 *input)
56 {
57diff --git a/include/linux/bitops.h b/include/linux/bitops.h
58index a3ef66a..fc8a3ff 100644
59--- a/include/linux/bitops.h
60+++ b/include/linux/bitops.h
61@@ -50,6 +50,26 @@ static inline unsigned long hweight_long(unsigned long w)
62 }
63
64 /**
65+ * rol64 - rotate a 64-bit value left
66+ * @word: value to rotate
67+ * @shift: bits to roll
68+ */
69+static inline __u64 rol64(__u64 word, unsigned int shift)
70+{
71+ return (word << shift) | (word >> (64 - shift));
72+}
73+
74+/**
75+ * ror64 - rotate a 64-bit value right
76+ * @word: value to rotate
77+ * @shift: bits to roll
78+ */
79+static inline __u64 ror64(__u64 word, unsigned int shift)
80+{
81+ return (word >> shift) | (word << (64 - shift));
82+}
83+
84+/**
85 * rol32 - rotate a 32-bit value left
86 * @word: value to rotate
87 * @shift: bits to roll
88--
891.7.7.4
90
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0030-Linux-3.2.7.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0030-Linux-3.2.7.patch
new file mode 100644
index 00000000..aeab9622
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.7/0030-Linux-3.2.7.patch
@@ -0,0 +1,24 @@
1From 9d0231c207faeda051cf54c1a64e1a147d2187fa Mon Sep 17 00:00:00 2001
2From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3Date: Mon, 20 Feb 2012 13:42:16 -0800
4Subject: [PATCH 30/30] Linux 3.2.7
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index 47fe496..d1bdc90 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 6
18+SUBLEVEL = 7
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.4
24
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0001-i387-math_state_restore-isn-t-called-from-asm.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0001-i387-math_state_restore-isn-t-called-from-asm.patch
new file mode 100644
index 00000000..713171ef
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0001-i387-math_state_restore-isn-t-called-from-asm.patch
@@ -0,0 +1,53 @@
1From 4733009df6d45db10f1f7551e65147576f224a06 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Mon, 13 Feb 2012 13:47:25 -0800
4Subject: [PATCH 01/11] i387: math_state_restore() isn't called from asm
5
6commit be98c2cdb15ba26148cd2bd58a857d4f7759ed38 upstream.
7
8It was marked asmlinkage for some really old and stale legacy reasons.
9Fix that and the equally stale comment.
10
11Noticed when debugging the irq_fpu_usable() bugs.
12
13Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
14Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
15---
16 arch/x86/include/asm/i387.h | 2 +-
17 arch/x86/kernel/traps.c | 6 +++---
18 2 files changed, 4 insertions(+), 4 deletions(-)
19
20diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
21index c9e09ea..cba1432 100644
22--- a/arch/x86/include/asm/i387.h
23+++ b/arch/x86/include/asm/i387.h
24@@ -29,7 +29,7 @@ extern unsigned int sig_xstate_size;
25 extern void fpu_init(void);
26 extern void mxcsr_feature_mask_init(void);
27 extern int init_fpu(struct task_struct *child);
28-extern asmlinkage void math_state_restore(void);
29+extern void math_state_restore(void);
30 extern void __math_state_restore(void);
31 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
32
33diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
34index a8e3eb8..727e6c1 100644
35--- a/arch/x86/kernel/traps.c
36+++ b/arch/x86/kernel/traps.c
37@@ -590,10 +590,10 @@ void __math_state_restore(void)
38 * Careful.. There are problems with IBM-designed IRQ13 behaviour.
39 * Don't touch unless you *really* know how it works.
40 *
41- * Must be called with kernel preemption disabled (in this case,
42- * local interrupts are disabled at the call-site in entry.S).
43+ * Must be called with kernel preemption disabled (eg with local
44+ * local interrupts as in the case of do_device_not_available).
45 */
46-asmlinkage void math_state_restore(void)
47+void math_state_restore(void)
48 {
49 struct thread_info *thread = current_thread_info();
50 struct task_struct *tsk = thread->task;
51--
521.7.7.4
53
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0002-i387-make-irq_fpu_usable-tests-more-robust.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0002-i387-make-irq_fpu_usable-tests-more-robust.patch
new file mode 100644
index 00000000..e0d9cdf2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0002-i387-make-irq_fpu_usable-tests-more-robust.patch
@@ -0,0 +1,131 @@
1From 42f2560ed6e9b040ef64e18a5030bf2d2cb05d7f Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Mon, 13 Feb 2012 13:56:14 -0800
4Subject: [PATCH 02/11] i387: make irq_fpu_usable() tests more robust
5
6commit 5b1cbac37798805c1fee18c8cebe5c0a13975b17 upstream.
7
8Some code - especially the crypto layer - wants to use the x86
9FP/MMX/AVX register set in what may be interrupt (typically softirq)
10context.
11
12That *can* be ok, but the tests for when it was ok were somewhat
13suspect. We cannot touch the thread-specific status bits either, so
14we'd better check that we're not going to try to save FP state or
15anything like that.
16
17Now, it may be that the TS bit is always cleared *before* we set the
18USEDFPU bit (and only set when we had already cleared the USEDFP
19before), so the TS bit test may actually have been sufficient, but it
20certainly was not obviously so.
21
22So this explicitly verifies that we will not touch the TS_USEDFPU bit,
23and adds a few related sanity-checks. Because it seems that somehow
24AES-NI is corrupting user FP state. The cause is not clear, and this
25patch doesn't fix it, but while debugging it I really wanted the code to
26be more obviously correct and robust.
27
28Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
29Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
30---
31 arch/x86/include/asm/i387.h | 54 ++++++++++++++++++++++++++++++++++++------
32 arch/x86/kernel/traps.c | 1 +
33 2 files changed, 47 insertions(+), 8 deletions(-)
34
35diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
36index cba1432..a436582 100644
37--- a/arch/x86/include/asm/i387.h
38+++ b/arch/x86/include/asm/i387.h
39@@ -307,9 +307,54 @@ static inline void __clear_fpu(struct task_struct *tsk)
40 }
41 }
42
43+/*
44+ * Were we in an interrupt that interrupted kernel mode?
45+ *
46+ * We can do a kernel_fpu_begin/end() pair *ONLY* if that
47+ * pair does nothing at all: TS_USEDFPU must be clear (so
48+ * that we don't try to save the FPU state), and TS must
49+ * be set (so that the clts/stts pair does nothing that is
50+ * visible in the interrupted kernel thread).
51+ */
52+static inline bool interrupted_kernel_fpu_idle(void)
53+{
54+ return !(current_thread_info()->status & TS_USEDFPU) &&
55+ (read_cr0() & X86_CR0_TS);
56+}
57+
58+/*
59+ * Were we in user mode (or vm86 mode) when we were
60+ * interrupted?
61+ *
62+ * Doing kernel_fpu_begin/end() is ok if we are running
63+ * in an interrupt context from user mode - we'll just
64+ * save the FPU state as required.
65+ */
66+static inline bool interrupted_user_mode(void)
67+{
68+ struct pt_regs *regs = get_irq_regs();
69+ return regs && user_mode_vm(regs);
70+}
71+
72+/*
73+ * Can we use the FPU in kernel mode with the
74+ * whole "kernel_fpu_begin/end()" sequence?
75+ *
76+ * It's always ok in process context (ie "not interrupt")
77+ * but it is sometimes ok even from an irq.
78+ */
79+static inline bool irq_fpu_usable(void)
80+{
81+ return !in_interrupt() ||
82+ interrupted_user_mode() ||
83+ interrupted_kernel_fpu_idle();
84+}
85+
86 static inline void kernel_fpu_begin(void)
87 {
88 struct thread_info *me = current_thread_info();
89+
90+ WARN_ON_ONCE(!irq_fpu_usable());
91 preempt_disable();
92 if (me->status & TS_USEDFPU)
93 __save_init_fpu(me->task);
94@@ -323,14 +368,6 @@ static inline void kernel_fpu_end(void)
95 preempt_enable();
96 }
97
98-static inline bool irq_fpu_usable(void)
99-{
100- struct pt_regs *regs;
101-
102- return !in_interrupt() || !(regs = get_irq_regs()) || \
103- user_mode(regs) || (read_cr0() & X86_CR0_TS);
104-}
105-
106 /*
107 * Some instructions like VIA's padlock instructions generate a spurious
108 * DNA fault but don't modify SSE registers. And these instructions
109@@ -367,6 +404,7 @@ static inline void irq_ts_restore(int TS_state)
110 */
111 static inline void save_init_fpu(struct task_struct *tsk)
112 {
113+ WARN_ON_ONCE(task_thread_info(tsk)->status & TS_USEDFPU);
114 preempt_disable();
115 __save_init_fpu(tsk);
116 stts();
117diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
118index 727e6c1..41e0b8c 100644
119--- a/arch/x86/kernel/traps.c
120+++ b/arch/x86/kernel/traps.c
121@@ -622,6 +622,7 @@ EXPORT_SYMBOL_GPL(math_state_restore);
122 dotraplinkage void __kprobes
123 do_device_not_available(struct pt_regs *regs, long error_code)
124 {
125+ WARN_ON_ONCE(!user_mode_vm(regs));
126 #ifdef CONFIG_MATH_EMULATION
127 if (read_cr0() & X86_CR0_EM) {
128 struct math_emu_info info = { };
129--
1301.7.7.4
131
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0003-i387-fix-sense-of-sanity-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0003-i387-fix-sense-of-sanity-check.patch
new file mode 100644
index 00000000..1b5f9775
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0003-i387-fix-sense-of-sanity-check.patch
@@ -0,0 +1,37 @@
1From 0a7ea9d5aa1e2cab84a48c0380f7f8c305006224 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Wed, 15 Feb 2012 08:05:18 -0800
4Subject: [PATCH 03/11] i387: fix sense of sanity check
5
6commit c38e23456278e967f094b08247ffc3711b1029b2 upstream.
7
8The check for save_init_fpu() (introduced in commit 5b1cbac37798: "i387:
9make irq_fpu_usable() tests more robust") was the wrong way around, but
10I hadn't noticed, because my "tests" were bogus: the FPU exceptions are
11disabled by default, so even doing a divide by zero never actually
12triggers this code at all unless you do extra work to enable them.
13
14So if anybody did enable them, they'd get one spurious warning.
15
16Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 arch/x86/include/asm/i387.h | 2 +-
20 1 files changed, 1 insertions(+), 1 deletions(-)
21
22diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
23index a436582..262bea9 100644
24--- a/arch/x86/include/asm/i387.h
25+++ b/arch/x86/include/asm/i387.h
26@@ -404,7 +404,7 @@ static inline void irq_ts_restore(int TS_state)
27 */
28 static inline void save_init_fpu(struct task_struct *tsk)
29 {
30- WARN_ON_ONCE(task_thread_info(tsk)->status & TS_USEDFPU);
31+ WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU));
32 preempt_disable();
33 __save_init_fpu(tsk);
34 stts();
35--
361.7.7.4
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0004-i387-fix-x86-64-preemption-unsafe-user-stack-save-re.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0004-i387-fix-x86-64-preemption-unsafe-user-stack-save-re.patch
new file mode 100644
index 00000000..e4969143
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0004-i387-fix-x86-64-preemption-unsafe-user-stack-save-re.patch
@@ -0,0 +1,163 @@
1From a5c28716652f9f71c848452b67795e5af690a91f Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 16 Feb 2012 09:15:04 -0800
4Subject: [PATCH 04/11] i387: fix x86-64 preemption-unsafe user stack
5 save/restore
6
7commit 15d8791cae75dca27bfda8ecfe87dca9379d6bb0 upstream.
8
9Commit 5b1cbac37798 ("i387: make irq_fpu_usable() tests more robust")
10added a sanity check to the #NM handler to verify that we never cause
11the "Device Not Available" exception in kernel mode.
12
13However, that check actually pinpointed a (fundamental) race where we do
14cause that exception as part of the signal stack FPU state save/restore
15code.
16
17Because we use the floating point instructions themselves to save and
18restore state directly from user mode, we cannot do that atomically with
19testing the TS_USEDFPU bit: the user mode access itself may cause a page
20fault, which causes a task switch, which saves and restores the FP/MMX
21state from the kernel buffers.
22
23This kind of "recursive" FP state save is fine per se, but it means that
24when the signal stack save/restore gets restarted, it will now take the
25'#NM' exception we originally tried to avoid. With preemption this can
26happen even without the page fault - but because of the user access, we
27cannot just disable preemption around the save/restore instruction.
28
29There are various ways to solve this, including using the
30"enable/disable_page_fault()" helpers to not allow page faults at all
31during the sequence, and fall back to copying things by hand without the
32use of the native FP state save/restore instructions.
33
34However, the simplest thing to do is to just allow the #NM from kernel
35space, but fix the race in setting and clearing CR0.TS that this all
36exposed: the TS bit changes and the TS_USEDFPU bit absolutely have to be
37atomic wrt scheduling, so while the actual state save/restore can be
38interrupted and restarted, the act of actually clearing/setting CR0.TS
39and the TS_USEDFPU bit together must not.
40
41Instead of just adding random "preempt_disable/enable()" calls to what
42is already excessively ugly code, this introduces some helper functions
43that mostly mirror the "kernel_fpu_begin/end()" functionality, just for
44the user state instead.
45
46Those helper functions should probably eventually replace the other
47ad-hoc CR0.TS and TS_USEDFPU tests too, but I'll need to think about it
48some more: the task switching functionality in particular needs to
49expose the difference between the 'prev' and 'next' threads, while the
50new helper functions intentionally were written to only work with
51'current'.
52
53Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
54Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
55---
56 arch/x86/include/asm/i387.h | 42 ++++++++++++++++++++++++++++++++++++++++++
57 arch/x86/kernel/traps.c | 1 -
58 arch/x86/kernel/xsave.c | 10 +++-------
59 3 files changed, 45 insertions(+), 8 deletions(-)
60
61diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
62index 262bea9..6e87fa4 100644
63--- a/arch/x86/include/asm/i387.h
64+++ b/arch/x86/include/asm/i387.h
65@@ -400,6 +400,48 @@ static inline void irq_ts_restore(int TS_state)
66 }
67
68 /*
69+ * The question "does this thread have fpu access?"
70+ * is slightly racy, since preemption could come in
71+ * and revoke it immediately after the test.
72+ *
73+ * However, even in that very unlikely scenario,
74+ * we can just assume we have FPU access - typically
75+ * to save the FP state - we'll just take a #NM
76+ * fault and get the FPU access back.
77+ *
78+ * The actual user_fpu_begin/end() functions
79+ * need to be preemption-safe, though.
80+ *
81+ * NOTE! user_fpu_end() must be used only after you
82+ * have saved the FP state, and user_fpu_begin() must
83+ * be used only immediately before restoring it.
84+ * These functions do not do any save/restore on
85+ * their own.
86+ */
87+static inline int user_has_fpu(void)
88+{
89+ return current_thread_info()->status & TS_USEDFPU;
90+}
91+
92+static inline void user_fpu_end(void)
93+{
94+ preempt_disable();
95+ current_thread_info()->status &= ~TS_USEDFPU;
96+ stts();
97+ preempt_enable();
98+}
99+
100+static inline void user_fpu_begin(void)
101+{
102+ preempt_disable();
103+ if (!user_has_fpu()) {
104+ clts();
105+ current_thread_info()->status |= TS_USEDFPU;
106+ }
107+ preempt_enable();
108+}
109+
110+/*
111 * These disable preemption on their own and are safe
112 */
113 static inline void save_init_fpu(struct task_struct *tsk)
114diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
115index 41e0b8c..727e6c1 100644
116--- a/arch/x86/kernel/traps.c
117+++ b/arch/x86/kernel/traps.c
118@@ -622,7 +622,6 @@ EXPORT_SYMBOL_GPL(math_state_restore);
119 dotraplinkage void __kprobes
120 do_device_not_available(struct pt_regs *regs, long error_code)
121 {
122- WARN_ON_ONCE(!user_mode_vm(regs));
123 #ifdef CONFIG_MATH_EMULATION
124 if (read_cr0() & X86_CR0_EM) {
125 struct math_emu_info info = { };
126diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
127index a391134..86f1f09 100644
128--- a/arch/x86/kernel/xsave.c
129+++ b/arch/x86/kernel/xsave.c
130@@ -168,7 +168,7 @@ int save_i387_xstate(void __user *buf)
131 if (!used_math())
132 return 0;
133
134- if (task_thread_info(tsk)->status & TS_USEDFPU) {
135+ if (user_has_fpu()) {
136 if (use_xsave())
137 err = xsave_user(buf);
138 else
139@@ -176,8 +176,7 @@ int save_i387_xstate(void __user *buf)
140
141 if (err)
142 return err;
143- task_thread_info(tsk)->status &= ~TS_USEDFPU;
144- stts();
145+ user_fpu_end();
146 } else {
147 sanitize_i387_state(tsk);
148 if (__copy_to_user(buf, &tsk->thread.fpu.state->fxsave,
149@@ -292,10 +291,7 @@ int restore_i387_xstate(void __user *buf)
150 return err;
151 }
152
153- if (!(task_thread_info(current)->status & TS_USEDFPU)) {
154- clts();
155- task_thread_info(current)->status |= TS_USEDFPU;
156- }
157+ user_fpu_begin();
158 if (use_xsave())
159 err = restore_user_xstate(buf);
160 else
161--
1621.7.7.4
163
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0005-i387-move-TS_USEDFPU-clearing-out-of-__save_init_fpu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0005-i387-move-TS_USEDFPU-clearing-out-of-__save_init_fpu.patch
new file mode 100644
index 00000000..a8d1982d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0005-i387-move-TS_USEDFPU-clearing-out-of-__save_init_fpu.patch
@@ -0,0 +1,64 @@
1From 38358b6185298df66ef4ddb4ceaaa1baf8521b28 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 16 Feb 2012 12:22:48 -0800
4Subject: [PATCH 05/11] i387: move TS_USEDFPU clearing out of __save_init_fpu
5 and into callers
6
7commit b6c66418dcad0fcf83cd1d0a39482db37bf4fc41 upstream.
8
9Touching TS_USEDFPU without touching CR0.TS is confusing, so don't do
10it. By moving it into the callers, we always do the TS_USEDFPU next to
11the CR0.TS accesses in the source code, and it's much easier to see how
12the two go hand in hand.
13
14Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 arch/x86/include/asm/i387.h | 9 ++++++---
18 1 files changed, 6 insertions(+), 3 deletions(-)
19
20diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
21index 6e87fa4..55fb3aa 100644
22--- a/arch/x86/include/asm/i387.h
23+++ b/arch/x86/include/asm/i387.h
24@@ -259,7 +259,6 @@ static inline void fpu_save_init(struct fpu *fpu)
25 static inline void __save_init_fpu(struct task_struct *tsk)
26 {
27 fpu_save_init(&tsk->thread.fpu);
28- task_thread_info(tsk)->status &= ~TS_USEDFPU;
29 }
30
31 static inline int fpu_fxrstor_checking(struct fpu *fpu)
32@@ -290,6 +289,7 @@ static inline void __unlazy_fpu(struct task_struct *tsk)
33 {
34 if (task_thread_info(tsk)->status & TS_USEDFPU) {
35 __save_init_fpu(tsk);
36+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
37 stts();
38 } else
39 tsk->fpu_counter = 0;
40@@ -356,9 +356,11 @@ static inline void kernel_fpu_begin(void)
41
42 WARN_ON_ONCE(!irq_fpu_usable());
43 preempt_disable();
44- if (me->status & TS_USEDFPU)
45+ if (me->status & TS_USEDFPU) {
46 __save_init_fpu(me->task);
47- else
48+ me->status &= ~TS_USEDFPU;
49+ /* We do 'stts()' in kernel_fpu_end() */
50+ } else
51 clts();
52 }
53
54@@ -449,6 +451,7 @@ static inline void save_init_fpu(struct task_struct *tsk)
55 WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU));
56 preempt_disable();
57 __save_init_fpu(tsk);
58+ task_thread_info(tsk)->status &= ~TS_USEDFPU;
59 stts();
60 preempt_enable();
61 }
62--
631.7.7.4
64
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0006-i387-don-t-ever-touch-TS_USEDFPU-directly-use-helper.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0006-i387-don-t-ever-touch-TS_USEDFPU-directly-use-helper.patch
new file mode 100644
index 00000000..7daaa620
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0006-i387-don-t-ever-touch-TS_USEDFPU-directly-use-helper.patch
@@ -0,0 +1,228 @@
1From 29515b215b9bbbad0368a5039ba6e53ed3fa7f25 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 16 Feb 2012 13:33:12 -0800
4Subject: [PATCH 06/11] i387: don't ever touch TS_USEDFPU directly, use helper
5 functions
6
7commit 6d59d7a9f5b723a7ac1925c136e93ec83c0c3043 upstream.
8
9This creates three helper functions that do the TS_USEDFPU accesses, and
10makes everybody that used to do it by hand use those helpers instead.
11
12In addition, there's a couple of helper functions for the "change both
13CR0.TS and TS_USEDFPU at the same time" case, and the places that do
14that together have been changed to use those. That means that we have
15fewer random places that open-code this situation.
16
17The intent is partly to clarify the code without actually changing any
18semantics yet (since we clearly still have some hard to reproduce bug in
19this area), but also to make it much easier to use another approach
20entirely to caching the CR0.TS bit for software accesses.
21
22Right now we use a bit in the thread-info 'status' variable (this patch
23does not change that), but we might want to make it a full field of its
24own or even make it a per-cpu variable.
25
26Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
27Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28---
29 arch/x86/include/asm/i387.h | 75 +++++++++++++++++++++++++++++++-----------
30 arch/x86/kernel/traps.c | 2 +-
31 arch/x86/kernel/xsave.c | 2 +-
32 arch/x86/kvm/vmx.c | 2 +-
33 4 files changed, 58 insertions(+), 23 deletions(-)
34
35diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
36index 55fb3aa..730d7be 100644
37--- a/arch/x86/include/asm/i387.h
38+++ b/arch/x86/include/asm/i387.h
39@@ -280,6 +280,47 @@ static inline int restore_fpu_checking(struct task_struct *tsk)
40 }
41
42 /*
43+ * Software FPU state helpers. Careful: these need to
44+ * be preemption protection *and* they need to be
45+ * properly paired with the CR0.TS changes!
46+ */
47+static inline int __thread_has_fpu(struct thread_info *ti)
48+{
49+ return ti->status & TS_USEDFPU;
50+}
51+
52+/* Must be paired with an 'stts' after! */
53+static inline void __thread_clear_has_fpu(struct thread_info *ti)
54+{
55+ ti->status &= ~TS_USEDFPU;
56+}
57+
58+/* Must be paired with a 'clts' before! */
59+static inline void __thread_set_has_fpu(struct thread_info *ti)
60+{
61+ ti->status |= TS_USEDFPU;
62+}
63+
64+/*
65+ * Encapsulate the CR0.TS handling together with the
66+ * software flag.
67+ *
68+ * These generally need preemption protection to work,
69+ * do try to avoid using these on their own.
70+ */
71+static inline void __thread_fpu_end(struct thread_info *ti)
72+{
73+ __thread_clear_has_fpu(ti);
74+ stts();
75+}
76+
77+static inline void __thread_fpu_begin(struct thread_info *ti)
78+{
79+ clts();
80+ __thread_set_has_fpu(ti);
81+}
82+
83+/*
84 * Signal frame handlers...
85 */
86 extern int save_i387_xstate(void __user *buf);
87@@ -287,23 +328,21 @@ extern int restore_i387_xstate(void __user *buf);
88
89 static inline void __unlazy_fpu(struct task_struct *tsk)
90 {
91- if (task_thread_info(tsk)->status & TS_USEDFPU) {
92+ if (__thread_has_fpu(task_thread_info(tsk))) {
93 __save_init_fpu(tsk);
94- task_thread_info(tsk)->status &= ~TS_USEDFPU;
95- stts();
96+ __thread_fpu_end(task_thread_info(tsk));
97 } else
98 tsk->fpu_counter = 0;
99 }
100
101 static inline void __clear_fpu(struct task_struct *tsk)
102 {
103- if (task_thread_info(tsk)->status & TS_USEDFPU) {
104+ if (__thread_has_fpu(task_thread_info(tsk))) {
105 /* Ignore delayed exceptions from user space */
106 asm volatile("1: fwait\n"
107 "2:\n"
108 _ASM_EXTABLE(1b, 2b));
109- task_thread_info(tsk)->status &= ~TS_USEDFPU;
110- stts();
111+ __thread_fpu_end(task_thread_info(tsk));
112 }
113 }
114
115@@ -311,14 +350,14 @@ static inline void __clear_fpu(struct task_struct *tsk)
116 * Were we in an interrupt that interrupted kernel mode?
117 *
118 * We can do a kernel_fpu_begin/end() pair *ONLY* if that
119- * pair does nothing at all: TS_USEDFPU must be clear (so
120+ * pair does nothing at all: the thread must not have fpu (so
121 * that we don't try to save the FPU state), and TS must
122 * be set (so that the clts/stts pair does nothing that is
123 * visible in the interrupted kernel thread).
124 */
125 static inline bool interrupted_kernel_fpu_idle(void)
126 {
127- return !(current_thread_info()->status & TS_USEDFPU) &&
128+ return !__thread_has_fpu(current_thread_info()) &&
129 (read_cr0() & X86_CR0_TS);
130 }
131
132@@ -356,9 +395,9 @@ static inline void kernel_fpu_begin(void)
133
134 WARN_ON_ONCE(!irq_fpu_usable());
135 preempt_disable();
136- if (me->status & TS_USEDFPU) {
137+ if (__thread_has_fpu(me)) {
138 __save_init_fpu(me->task);
139- me->status &= ~TS_USEDFPU;
140+ __thread_clear_has_fpu(me);
141 /* We do 'stts()' in kernel_fpu_end() */
142 } else
143 clts();
144@@ -422,24 +461,21 @@ static inline void irq_ts_restore(int TS_state)
145 */
146 static inline int user_has_fpu(void)
147 {
148- return current_thread_info()->status & TS_USEDFPU;
149+ return __thread_has_fpu(current_thread_info());
150 }
151
152 static inline void user_fpu_end(void)
153 {
154 preempt_disable();
155- current_thread_info()->status &= ~TS_USEDFPU;
156- stts();
157+ __thread_fpu_end(current_thread_info());
158 preempt_enable();
159 }
160
161 static inline void user_fpu_begin(void)
162 {
163 preempt_disable();
164- if (!user_has_fpu()) {
165- clts();
166- current_thread_info()->status |= TS_USEDFPU;
167- }
168+ if (!user_has_fpu())
169+ __thread_fpu_begin(current_thread_info());
170 preempt_enable();
171 }
172
173@@ -448,11 +484,10 @@ static inline void user_fpu_begin(void)
174 */
175 static inline void save_init_fpu(struct task_struct *tsk)
176 {
177- WARN_ON_ONCE(!(task_thread_info(tsk)->status & TS_USEDFPU));
178+ WARN_ON_ONCE(!__thread_has_fpu(task_thread_info(tsk)));
179 preempt_disable();
180 __save_init_fpu(tsk);
181- task_thread_info(tsk)->status &= ~TS_USEDFPU;
182- stts();
183+ __thread_fpu_end(task_thread_info(tsk));
184 preempt_enable();
185 }
186
187diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
188index 727e6c1..bb5445c 100644
189--- a/arch/x86/kernel/traps.c
190+++ b/arch/x86/kernel/traps.c
191@@ -579,7 +579,7 @@ void __math_state_restore(void)
192 return;
193 }
194
195- thread->status |= TS_USEDFPU; /* So we fnsave on switch_to() */
196+ __thread_set_has_fpu(thread); /* clts in caller! */
197 tsk->fpu_counter++;
198 }
199
200diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
201index 86f1f09..a0bcd0d 100644
202--- a/arch/x86/kernel/xsave.c
203+++ b/arch/x86/kernel/xsave.c
204@@ -47,7 +47,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
205 if (!fx)
206 return;
207
208- BUG_ON(task_thread_info(tsk)->status & TS_USEDFPU);
209+ BUG_ON(__thread_has_fpu(task_thread_info(tsk)));
210
211 xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
212
213diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
214index 579a0b5..b2c612d 100644
215--- a/arch/x86/kvm/vmx.c
216+++ b/arch/x86/kvm/vmx.c
217@@ -1456,7 +1456,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
218 #ifdef CONFIG_X86_64
219 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
220 #endif
221- if (current_thread_info()->status & TS_USEDFPU)
222+ if (__thread_has_fpu(current_thread_info()))
223 clts();
224 load_gdt(&__get_cpu_var(host_gdt));
225 }
226--
2271.7.7.4
228
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0007-i387-do-not-preload-FPU-state-at-task-switch-time.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0007-i387-do-not-preload-FPU-state-at-task-switch-time.patch
new file mode 100644
index 00000000..c6553d93
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0007-i387-do-not-preload-FPU-state-at-task-switch-time.patch
@@ -0,0 +1,202 @@
1From ba6aaed5cc8f55b77644daf56e9ae3a75f042908 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 16 Feb 2012 15:45:23 -0800
4Subject: [PATCH 07/11] i387: do not preload FPU state at task switch time
5
6commit b3b0870ef3ffed72b92415423da864f440f57ad6 upstream.
7
8Yes, taking the trap to re-load the FPU/MMX state is expensive, but so
9is spending several days looking for a bug in the state save/restore
10code. And the preload code has some rather subtle interactions with
11both paravirtualization support and segment state restore, so it's not
12nearly as simple as it should be.
13
14Also, now that we no longer necessarily depend on a single bit (ie
15TS_USEDFPU) for keeping track of the state of the FPU, we migth be able
16to do better. If we are really switching between two processes that
17keep touching the FP state, save/restore is inevitable, but in the case
18of having one process that does most of the FPU usage, we may actually
19be able to do much better than the preloading.
20
21In particular, we may be able to keep track of which CPU the process ran
22on last, and also per CPU keep track of which process' FP state that CPU
23has. For modern CPU's that don't destroy the FPU contents on save time,
24that would allow us to do a lazy restore by just re-enabling the
25existing FPU state - with no restore cost at all!
26
27Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 arch/x86/include/asm/i387.h | 1 -
31 arch/x86/kernel/process_32.c | 20 --------------------
32 arch/x86/kernel/process_64.c | 23 -----------------------
33 arch/x86/kernel/traps.c | 35 +++++++++++------------------------
34 4 files changed, 11 insertions(+), 68 deletions(-)
35
36diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
37index 730d7be..3521c24 100644
38--- a/arch/x86/include/asm/i387.h
39+++ b/arch/x86/include/asm/i387.h
40@@ -30,7 +30,6 @@ extern void fpu_init(void);
41 extern void mxcsr_feature_mask_init(void);
42 extern int init_fpu(struct task_struct *child);
43 extern void math_state_restore(void);
44-extern void __math_state_restore(void);
45 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
46
47 extern user_regset_active_fn fpregs_active, xfpregs_active;
48diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
49index 795b79f..0cdb4fa 100644
50--- a/arch/x86/kernel/process_32.c
51+++ b/arch/x86/kernel/process_32.c
52@@ -297,23 +297,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
53 *next = &next_p->thread;
54 int cpu = smp_processor_id();
55 struct tss_struct *tss = &per_cpu(init_tss, cpu);
56- bool preload_fpu;
57
58 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
59
60- /*
61- * If the task has used fpu the last 5 timeslices, just do a full
62- * restore of the math state immediately to avoid the trap; the
63- * chances of needing FPU soon are obviously high now
64- */
65- preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
66-
67 __unlazy_fpu(prev_p);
68
69- /* we're going to use this soon, after a few expensive things */
70- if (preload_fpu)
71- prefetch(next->fpu.state);
72-
73 /*
74 * Reload esp0.
75 */
76@@ -352,11 +340,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
77 task_thread_info(next_p)->flags & _TIF_WORK_CTXSW_NEXT))
78 __switch_to_xtra(prev_p, next_p, tss);
79
80- /* If we're going to preload the fpu context, make sure clts
81- is run while we're batching the cpu state updates. */
82- if (preload_fpu)
83- clts();
84-
85 /*
86 * Leave lazy mode, flushing any hypercalls made here.
87 * This must be done before restoring TLS segments so
88@@ -366,9 +349,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
89 */
90 arch_end_context_switch(next_p);
91
92- if (preload_fpu)
93- __math_state_restore();
94-
95 /*
96 * Restore %gs if needed (which is common)
97 */
98diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
99index 3bd7e6e..370801e 100644
100--- a/arch/x86/kernel/process_64.c
101+++ b/arch/x86/kernel/process_64.c
102@@ -381,18 +381,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
103 int cpu = smp_processor_id();
104 struct tss_struct *tss = &per_cpu(init_tss, cpu);
105 unsigned fsindex, gsindex;
106- bool preload_fpu;
107-
108- /*
109- * If the task has used fpu the last 5 timeslices, just do a full
110- * restore of the math state immediately to avoid the trap; the
111- * chances of needing FPU soon are obviously high now
112- */
113- preload_fpu = tsk_used_math(next_p) && next_p->fpu_counter > 5;
114-
115- /* we're going to use this soon, after a few expensive things */
116- if (preload_fpu)
117- prefetch(next->fpu.state);
118
119 /*
120 * Reload esp0, LDT and the page table pointer:
121@@ -425,10 +413,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
122 /* Must be after DS reload */
123 __unlazy_fpu(prev_p);
124
125- /* Make sure cpu is ready for new context */
126- if (preload_fpu)
127- clts();
128-
129 /*
130 * Leave lazy mode, flushing any hypercalls made here.
131 * This must be done before restoring TLS segments so
132@@ -487,13 +471,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
133 task_thread_info(prev_p)->flags & _TIF_WORK_CTXSW_PREV))
134 __switch_to_xtra(prev_p, next_p, tss);
135
136- /*
137- * Preload the FPU context, now that we've determined that the
138- * task is likely to be using it.
139- */
140- if (preload_fpu)
141- __math_state_restore();
142-
143 return prev_p;
144 }
145
146diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
147index bb5445c..7767ed2 100644
148--- a/arch/x86/kernel/traps.c
149+++ b/arch/x86/kernel/traps.c
150@@ -562,28 +562,6 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
151 }
152
153 /*
154- * __math_state_restore assumes that cr0.TS is already clear and the
155- * fpu state is all ready for use. Used during context switch.
156- */
157-void __math_state_restore(void)
158-{
159- struct thread_info *thread = current_thread_info();
160- struct task_struct *tsk = thread->task;
161-
162- /*
163- * Paranoid restore. send a SIGSEGV if we fail to restore the state.
164- */
165- if (unlikely(restore_fpu_checking(tsk))) {
166- stts();
167- force_sig(SIGSEGV, tsk);
168- return;
169- }
170-
171- __thread_set_has_fpu(thread); /* clts in caller! */
172- tsk->fpu_counter++;
173-}
174-
175-/*
176 * 'math_state_restore()' saves the current math information in the
177 * old math state array, and gets the new ones from the current task
178 *
179@@ -613,9 +591,18 @@ void math_state_restore(void)
180 local_irq_disable();
181 }
182
183- clts(); /* Allow maths ops (or we recurse) */
184+ __thread_fpu_begin(thread);
185
186- __math_state_restore();
187+ /*
188+ * Paranoid restore. send a SIGSEGV if we fail to restore the state.
189+ */
190+ if (unlikely(restore_fpu_checking(tsk))) {
191+ __thread_fpu_end(thread);
192+ force_sig(SIGSEGV, tsk);
193+ return;
194+ }
195+
196+ tsk->fpu_counter++;
197 }
198 EXPORT_SYMBOL_GPL(math_state_restore);
199
200--
2011.7.7.4
202
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0008-i387-move-AMD-K7-K8-fpu-fxsave-fxrstor-workaround-fr.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0008-i387-move-AMD-K7-K8-fpu-fxsave-fxrstor-workaround-fr.patch
new file mode 100644
index 00000000..00458e1c
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0008-i387-move-AMD-K7-K8-fpu-fxsave-fxrstor-workaround-fr.patch
@@ -0,0 +1,133 @@
1From 9147fbe60acc9125e7b0deae409f1da5c3f8bdda Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Thu, 16 Feb 2012 19:11:15 -0800
4Subject: [PATCH 08/11] i387: move AMD K7/K8 fpu fxsave/fxrstor workaround
5 from save to restore
6
7commit 4903062b5485f0e2c286a23b44c9b59d9b017d53 upstream.
8
9The AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception is
10pending. In order to not leak FIP state from one process to another, we
11need to do a floating point load after the fxsave of the old process,
12and before the fxrstor of the new FPU state. That resets the state to
13the (uninteresting) kernel load, rather than some potentially sensitive
14user information.
15
16We used to do this directly after the FPU state save, but that is
17actually very inconvenient, since it
18
19 (a) corrupts what is potentially perfectly good FPU state that we might
20 want to lazy avoid restoring later and
21
22 (b) on x86-64 it resulted in a very annoying ordering constraint, where
23 "__unlazy_fpu()" in the task switch needs to be delayed until after
24 the DS segment has been reloaded just to get the new DS value.
25
26Coupling it to the fxrstor instead of the fxsave automatically avoids
27both of these issues, and also ensures that we only do it when actually
28necessary (the FP state after a save may never actually get used). It's
29simply a much more natural place for the leaked state cleanup.
30
31Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
32Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33---
34 arch/x86/include/asm/i387.h | 19 -------------------
35 arch/x86/kernel/process_64.c | 5 ++---
36 arch/x86/kernel/traps.c | 14 ++++++++++++++
37 3 files changed, 16 insertions(+), 22 deletions(-)
38
39diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
40index 3521c24..01b115d 100644
41--- a/arch/x86/include/asm/i387.h
42+++ b/arch/x86/include/asm/i387.h
43@@ -211,15 +211,6 @@ static inline void fpu_fxsave(struct fpu *fpu)
44
45 #endif /* CONFIG_X86_64 */
46
47-/* We need a safe address that is cheap to find and that is already
48- in L1 during context switch. The best choices are unfortunately
49- different for UP and SMP */
50-#ifdef CONFIG_SMP
51-#define safe_address (__per_cpu_offset[0])
52-#else
53-#define safe_address (kstat_cpu(0).cpustat.user)
54-#endif
55-
56 /*
57 * These must be called with preempt disabled
58 */
59@@ -243,16 +234,6 @@ static inline void fpu_save_init(struct fpu *fpu)
60
61 if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
62 asm volatile("fnclex");
63-
64- /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
65- is pending. Clear the x87 state here by setting it to fixed
66- values. safe_address is a random variable that should be in L1 */
67- alternative_input(
68- ASM_NOP8 ASM_NOP2,
69- "emms\n\t" /* clear stack tags */
70- "fildl %P[addr]", /* set F?P to defined value */
71- X86_FEATURE_FXSAVE_LEAK,
72- [addr] "m" (safe_address));
73 }
74
75 static inline void __save_init_fpu(struct task_struct *tsk)
76diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
77index 370801e..042b18f 100644
78--- a/arch/x86/kernel/process_64.c
79+++ b/arch/x86/kernel/process_64.c
80@@ -382,6 +382,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
81 struct tss_struct *tss = &per_cpu(init_tss, cpu);
82 unsigned fsindex, gsindex;
83
84+ __unlazy_fpu(prev_p);
85+
86 /*
87 * Reload esp0, LDT and the page table pointer:
88 */
89@@ -410,9 +412,6 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
90
91 load_TLS(next, cpu);
92
93- /* Must be after DS reload */
94- __unlazy_fpu(prev_p);
95-
96 /*
97 * Leave lazy mode, flushing any hypercalls made here.
98 * This must be done before restoring TLS segments so
99diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
100index 7767ed2..c24bb75 100644
101--- a/arch/x86/kernel/traps.c
102+++ b/arch/x86/kernel/traps.c
103@@ -576,6 +576,10 @@ void math_state_restore(void)
104 struct thread_info *thread = current_thread_info();
105 struct task_struct *tsk = thread->task;
106
107+ /* We need a safe address that is cheap to find and that is already
108+ in L1. We just brought in "thread->task", so use that */
109+#define safe_address (thread->task)
110+
111 if (!tsk_used_math(tsk)) {
112 local_irq_enable();
113 /*
114@@ -593,6 +597,16 @@ void math_state_restore(void)
115
116 __thread_fpu_begin(thread);
117
118+ /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
119+ is pending. Clear the x87 state here by setting it to fixed
120+ values. safe_address is a random variable that should be in L1 */
121+ alternative_input(
122+ ASM_NOP8 ASM_NOP2,
123+ "emms\n\t" /* clear stack tags */
124+ "fildl %P[addr]", /* set F?P to defined value */
125+ X86_FEATURE_FXSAVE_LEAK,
126+ [addr] "m" (safe_address));
127+
128 /*
129 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
130 */
131--
1321.7.7.4
133
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0009-i387-move-TS_USEDFPU-flag-from-thread_info-to-task_s.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0009-i387-move-TS_USEDFPU-flag-from-thread_info-to-task_s.patch
new file mode 100644
index 00000000..af43d215
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0009-i387-move-TS_USEDFPU-flag-from-thread_info-to-task_s.patch
@@ -0,0 +1,305 @@
1From 555558c5bf8e8d9919fbcbe4b1cfe920f692c0cb Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Fri, 17 Feb 2012 21:48:54 -0800
4Subject: [PATCH 09/11] i387: move TS_USEDFPU flag from thread_info to
5 task_struct
6
7commit f94edacf998516ac9d849f7bc6949a703977a7f3 upstream.
8
9This moves the bit that indicates whether a thread has ownership of the
10FPU from the TS_USEDFPU bit in thread_info->status to a word of its own
11(called 'has_fpu') in task_struct->thread.has_fpu.
12
13This fixes two independent bugs at the same time:
14
15 - changing 'thread_info->status' from the scheduler causes nasty
16 problems for the other users of that variable, since it is defined to
17 be thread-synchronous (that's what the "TS_" part of the naming was
18 supposed to indicate).
19
20 So perfectly valid code could (and did) do
21
22 ti->status |= TS_RESTORE_SIGMASK;
23
24 and the compiler was free to do that as separate load, or and store
25 instructions. Which can cause problems with preemption, since a task
26 switch could happen in between, and change the TS_USEDFPU bit. The
27 change to TS_USEDFPU would be overwritten by the final store.
28
29 In practice, this seldom happened, though, because the 'status' field
30 was seldom used more than once, so gcc would generally tend to
31 generate code that used a read-modify-write instruction and thus
32 happened to avoid this problem - RMW instructions are naturally low
33 fat and preemption-safe.
34
35 - On x86-32, the current_thread_info() pointer would, during interrupts
36 and softirqs, point to a *copy* of the real thread_info, because
37 x86-32 uses %esp to calculate the thread_info address, and thus the
38 separate irq (and softirq) stacks would cause these kinds of odd
39 thread_info copy aliases.
40
41 This is normally not a problem, since interrupts aren't supposed to
42 look at thread information anyway (what thread is running at
43 interrupt time really isn't very well-defined), but it confused the
44 heck out of irq_fpu_usable() and the code that tried to squirrel
45 away the FPU state.
46
47 (It also caused untold confusion for us poor kernel developers).
48
49It also turns out that using 'task_struct' is actually much more natural
50for most of the call sites that care about the FPU state, since they
51tend to work with the task struct for other reasons anyway (ie
52scheduling). And the FPU data that we are going to save/restore is
53found there too.
54
55Thanks to Arjan Van De Ven <arjan@linux.intel.com> for pointing us to
56the %esp issue.
57
58Cc: Arjan van de Ven <arjan@linux.intel.com>
59Reported-and-tested-by: Raphael Prevost <raphael@buro.asia>
60Acked-and-tested-by: Suresh Siddha <suresh.b.siddha@intel.com>
61Tested-by: Peter Anvin <hpa@zytor.com>
62Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
63Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
64---
65 arch/x86/include/asm/i387.h | 44 ++++++++++++++++++------------------
66 arch/x86/include/asm/processor.h | 1 +
67 arch/x86/include/asm/thread_info.h | 2 -
68 arch/x86/kernel/traps.c | 11 ++++-----
69 arch/x86/kernel/xsave.c | 2 +-
70 arch/x86/kvm/vmx.c | 2 +-
71 6 files changed, 30 insertions(+), 32 deletions(-)
72
73diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
74index 01b115d..f537667 100644
75--- a/arch/x86/include/asm/i387.h
76+++ b/arch/x86/include/asm/i387.h
77@@ -264,21 +264,21 @@ static inline int restore_fpu_checking(struct task_struct *tsk)
78 * be preemption protection *and* they need to be
79 * properly paired with the CR0.TS changes!
80 */
81-static inline int __thread_has_fpu(struct thread_info *ti)
82+static inline int __thread_has_fpu(struct task_struct *tsk)
83 {
84- return ti->status & TS_USEDFPU;
85+ return tsk->thread.has_fpu;
86 }
87
88 /* Must be paired with an 'stts' after! */
89-static inline void __thread_clear_has_fpu(struct thread_info *ti)
90+static inline void __thread_clear_has_fpu(struct task_struct *tsk)
91 {
92- ti->status &= ~TS_USEDFPU;
93+ tsk->thread.has_fpu = 0;
94 }
95
96 /* Must be paired with a 'clts' before! */
97-static inline void __thread_set_has_fpu(struct thread_info *ti)
98+static inline void __thread_set_has_fpu(struct task_struct *tsk)
99 {
100- ti->status |= TS_USEDFPU;
101+ tsk->thread.has_fpu = 1;
102 }
103
104 /*
105@@ -288,16 +288,16 @@ static inline void __thread_set_has_fpu(struct thread_info *ti)
106 * These generally need preemption protection to work,
107 * do try to avoid using these on their own.
108 */
109-static inline void __thread_fpu_end(struct thread_info *ti)
110+static inline void __thread_fpu_end(struct task_struct *tsk)
111 {
112- __thread_clear_has_fpu(ti);
113+ __thread_clear_has_fpu(tsk);
114 stts();
115 }
116
117-static inline void __thread_fpu_begin(struct thread_info *ti)
118+static inline void __thread_fpu_begin(struct task_struct *tsk)
119 {
120 clts();
121- __thread_set_has_fpu(ti);
122+ __thread_set_has_fpu(tsk);
123 }
124
125 /*
126@@ -308,21 +308,21 @@ extern int restore_i387_xstate(void __user *buf);
127
128 static inline void __unlazy_fpu(struct task_struct *tsk)
129 {
130- if (__thread_has_fpu(task_thread_info(tsk))) {
131+ if (__thread_has_fpu(tsk)) {
132 __save_init_fpu(tsk);
133- __thread_fpu_end(task_thread_info(tsk));
134+ __thread_fpu_end(tsk);
135 } else
136 tsk->fpu_counter = 0;
137 }
138
139 static inline void __clear_fpu(struct task_struct *tsk)
140 {
141- if (__thread_has_fpu(task_thread_info(tsk))) {
142+ if (__thread_has_fpu(tsk)) {
143 /* Ignore delayed exceptions from user space */
144 asm volatile("1: fwait\n"
145 "2:\n"
146 _ASM_EXTABLE(1b, 2b));
147- __thread_fpu_end(task_thread_info(tsk));
148+ __thread_fpu_end(tsk);
149 }
150 }
151
152@@ -337,7 +337,7 @@ static inline void __clear_fpu(struct task_struct *tsk)
153 */
154 static inline bool interrupted_kernel_fpu_idle(void)
155 {
156- return !__thread_has_fpu(current_thread_info()) &&
157+ return !__thread_has_fpu(current) &&
158 (read_cr0() & X86_CR0_TS);
159 }
160
161@@ -371,12 +371,12 @@ static inline bool irq_fpu_usable(void)
162
163 static inline void kernel_fpu_begin(void)
164 {
165- struct thread_info *me = current_thread_info();
166+ struct task_struct *me = current;
167
168 WARN_ON_ONCE(!irq_fpu_usable());
169 preempt_disable();
170 if (__thread_has_fpu(me)) {
171- __save_init_fpu(me->task);
172+ __save_init_fpu(me);
173 __thread_clear_has_fpu(me);
174 /* We do 'stts()' in kernel_fpu_end() */
175 } else
176@@ -441,13 +441,13 @@ static inline void irq_ts_restore(int TS_state)
177 */
178 static inline int user_has_fpu(void)
179 {
180- return __thread_has_fpu(current_thread_info());
181+ return __thread_has_fpu(current);
182 }
183
184 static inline void user_fpu_end(void)
185 {
186 preempt_disable();
187- __thread_fpu_end(current_thread_info());
188+ __thread_fpu_end(current);
189 preempt_enable();
190 }
191
192@@ -455,7 +455,7 @@ static inline void user_fpu_begin(void)
193 {
194 preempt_disable();
195 if (!user_has_fpu())
196- __thread_fpu_begin(current_thread_info());
197+ __thread_fpu_begin(current);
198 preempt_enable();
199 }
200
201@@ -464,10 +464,10 @@ static inline void user_fpu_begin(void)
202 */
203 static inline void save_init_fpu(struct task_struct *tsk)
204 {
205- WARN_ON_ONCE(!__thread_has_fpu(task_thread_info(tsk)));
206+ WARN_ON_ONCE(!__thread_has_fpu(tsk));
207 preempt_disable();
208 __save_init_fpu(tsk);
209- __thread_fpu_end(task_thread_info(tsk));
210+ __thread_fpu_end(tsk);
211 preempt_enable();
212 }
213
214diff --git a/arch/x86/include/asm/processor.h b/arch/x86/include/asm/processor.h
215index b650435..bb3ee36 100644
216--- a/arch/x86/include/asm/processor.h
217+++ b/arch/x86/include/asm/processor.h
218@@ -456,6 +456,7 @@ struct thread_struct {
219 unsigned long trap_no;
220 unsigned long error_code;
221 /* floating point and extended processor state */
222+ unsigned long has_fpu;
223 struct fpu fpu;
224 #ifdef CONFIG_X86_32
225 /* Virtual 86 mode info */
226diff --git a/arch/x86/include/asm/thread_info.h b/arch/x86/include/asm/thread_info.h
227index a1fe5c1..d7ef849 100644
228--- a/arch/x86/include/asm/thread_info.h
229+++ b/arch/x86/include/asm/thread_info.h
230@@ -242,8 +242,6 @@ static inline struct thread_info *current_thread_info(void)
231 * ever touches our thread-synchronous status, so we don't
232 * have to worry about atomic accesses.
233 */
234-#define TS_USEDFPU 0x0001 /* FPU was used by this task
235- this quantum (SMP) */
236 #define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/
237 #define TS_POLLING 0x0004 /* idle task polling need_resched,
238 skip sending interrupt */
239diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
240index c24bb75..a99badf 100644
241--- a/arch/x86/kernel/traps.c
242+++ b/arch/x86/kernel/traps.c
243@@ -573,12 +573,11 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
244 */
245 void math_state_restore(void)
246 {
247- struct thread_info *thread = current_thread_info();
248- struct task_struct *tsk = thread->task;
249+ struct task_struct *tsk = current;
250
251 /* We need a safe address that is cheap to find and that is already
252- in L1. We just brought in "thread->task", so use that */
253-#define safe_address (thread->task)
254+ in L1. We're just bringing in "tsk->thread.has_fpu", so use that */
255+#define safe_address (tsk->thread.has_fpu)
256
257 if (!tsk_used_math(tsk)) {
258 local_irq_enable();
259@@ -595,7 +594,7 @@ void math_state_restore(void)
260 local_irq_disable();
261 }
262
263- __thread_fpu_begin(thread);
264+ __thread_fpu_begin(tsk);
265
266 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
267 is pending. Clear the x87 state here by setting it to fixed
268@@ -611,7 +610,7 @@ void math_state_restore(void)
269 * Paranoid restore. send a SIGSEGV if we fail to restore the state.
270 */
271 if (unlikely(restore_fpu_checking(tsk))) {
272- __thread_fpu_end(thread);
273+ __thread_fpu_end(tsk);
274 force_sig(SIGSEGV, tsk);
275 return;
276 }
277diff --git a/arch/x86/kernel/xsave.c b/arch/x86/kernel/xsave.c
278index a0bcd0d..7110911 100644
279--- a/arch/x86/kernel/xsave.c
280+++ b/arch/x86/kernel/xsave.c
281@@ -47,7 +47,7 @@ void __sanitize_i387_state(struct task_struct *tsk)
282 if (!fx)
283 return;
284
285- BUG_ON(__thread_has_fpu(task_thread_info(tsk)));
286+ BUG_ON(__thread_has_fpu(tsk));
287
288 xstate_bv = tsk->thread.fpu.state->xsave.xsave_hdr.xstate_bv;
289
290diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
291index b2c612d..4ea7678 100644
292--- a/arch/x86/kvm/vmx.c
293+++ b/arch/x86/kvm/vmx.c
294@@ -1456,7 +1456,7 @@ static void __vmx_load_host_state(struct vcpu_vmx *vmx)
295 #ifdef CONFIG_X86_64
296 wrmsrl(MSR_KERNEL_GS_BASE, vmx->msr_host_kernel_gs_base);
297 #endif
298- if (__thread_has_fpu(current_thread_info()))
299+ if (__thread_has_fpu(current))
300 clts();
301 load_gdt(&__get_cpu_var(host_gdt));
302 }
303--
3041.7.7.4
305
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0010-i387-re-introduce-FPU-state-preloading-at-context-sw.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0010-i387-re-introduce-FPU-state-preloading-at-context-sw.patch
new file mode 100644
index 00000000..95d4a73e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0010-i387-re-introduce-FPU-state-preloading-at-context-sw.patch
@@ -0,0 +1,353 @@
1From 9016ec427136d5b5d025948319cf1114dc7734e4 Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Sat, 18 Feb 2012 12:56:35 -0800
4Subject: [PATCH 10/11] i387: re-introduce FPU state preloading at context
5 switch time
6
7commit 34ddc81a230b15c0e345b6b253049db731499f7e upstream.
8
9After all the FPU state cleanups and finally finding the problem that
10caused all our FPU save/restore problems, this re-introduces the
11preloading of FPU state that was removed in commit b3b0870ef3ff ("i387:
12do not preload FPU state at task switch time").
13
14However, instead of simply reverting the removal, this reimplements
15preloading with several fixes, most notably
16
17 - properly abstracted as a true FPU state switch, rather than as
18 open-coded save and restore with various hacks.
19
20 In particular, implementing it as a proper FPU state switch allows us
21 to optimize the CR0.TS flag accesses: there is no reason to set the
22 TS bit only to then almost immediately clear it again. CR0 accesses
23 are quite slow and expensive, don't flip the bit back and forth for
24 no good reason.
25
26 - Make sure that the same model works for both x86-32 and x86-64, so
27 that there are no gratuitous differences between the two due to the
28 way they save and restore segment state differently due to
29 architectural differences that really don't matter to the FPU state.
30
31 - Avoid exposing the "preload" state to the context switch routines,
32 and in particular allow the concept of lazy state restore: if nothing
33 else has used the FPU in the meantime, and the process is still on
34 the same CPU, we can avoid restoring state from memory entirely, just
35 re-expose the state that is still in the FPU unit.
36
37 That optimized lazy restore isn't actually implemented here, but the
38 infrastructure is set up for it. Of course, older CPU's that use
39 'fnsave' to save the state cannot take advantage of this, since the
40 state saving also trashes the state.
41
42In other words, there is now an actual _design_ to the FPU state saving,
43rather than just random historical baggage. Hopefully it's easier to
44follow as a result.
45
46Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
47Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
48---
49 arch/x86/include/asm/i387.h | 110 +++++++++++++++++++++++++++++++++++-------
50 arch/x86/kernel/process_32.c | 5 ++-
51 arch/x86/kernel/process_64.c | 5 ++-
52 arch/x86/kernel/traps.c | 55 ++++++++++++---------
53 4 files changed, 133 insertions(+), 42 deletions(-)
54
55diff --git a/arch/x86/include/asm/i387.h b/arch/x86/include/asm/i387.h
56index f537667..a850b4d 100644
57--- a/arch/x86/include/asm/i387.h
58+++ b/arch/x86/include/asm/i387.h
59@@ -29,6 +29,7 @@ extern unsigned int sig_xstate_size;
60 extern void fpu_init(void);
61 extern void mxcsr_feature_mask_init(void);
62 extern int init_fpu(struct task_struct *child);
63+extern void __math_state_restore(struct task_struct *);
64 extern void math_state_restore(void);
65 extern int dump_fpu(struct pt_regs *, struct user_i387_struct *);
66
67@@ -212,9 +213,10 @@ static inline void fpu_fxsave(struct fpu *fpu)
68 #endif /* CONFIG_X86_64 */
69
70 /*
71- * These must be called with preempt disabled
72+ * These must be called with preempt disabled. Returns
73+ * 'true' if the FPU state is still intact.
74 */
75-static inline void fpu_save_init(struct fpu *fpu)
76+static inline int fpu_save_init(struct fpu *fpu)
77 {
78 if (use_xsave()) {
79 fpu_xsave(fpu);
80@@ -223,22 +225,33 @@ static inline void fpu_save_init(struct fpu *fpu)
81 * xsave header may indicate the init state of the FP.
82 */
83 if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
84- return;
85+ return 1;
86 } else if (use_fxsr()) {
87 fpu_fxsave(fpu);
88 } else {
89 asm volatile("fnsave %[fx]; fwait"
90 : [fx] "=m" (fpu->state->fsave));
91- return;
92+ return 0;
93 }
94
95- if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES))
96+ /*
97+ * If exceptions are pending, we need to clear them so
98+ * that we don't randomly get exceptions later.
99+ *
100+ * FIXME! Is this perhaps only true for the old-style
101+ * irq13 case? Maybe we could leave the x87 state
102+ * intact otherwise?
103+ */
104+ if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
105 asm volatile("fnclex");
106+ return 0;
107+ }
108+ return 1;
109 }
110
111-static inline void __save_init_fpu(struct task_struct *tsk)
112+static inline int __save_init_fpu(struct task_struct *tsk)
113 {
114- fpu_save_init(&tsk->thread.fpu);
115+ return fpu_save_init(&tsk->thread.fpu);
116 }
117
118 static inline int fpu_fxrstor_checking(struct fpu *fpu)
119@@ -301,20 +314,79 @@ static inline void __thread_fpu_begin(struct task_struct *tsk)
120 }
121
122 /*
123- * Signal frame handlers...
124+ * FPU state switching for scheduling.
125+ *
126+ * This is a two-stage process:
127+ *
128+ * - switch_fpu_prepare() saves the old state and
129+ * sets the new state of the CR0.TS bit. This is
130+ * done within the context of the old process.
131+ *
132+ * - switch_fpu_finish() restores the new state as
133+ * necessary.
134 */
135-extern int save_i387_xstate(void __user *buf);
136-extern int restore_i387_xstate(void __user *buf);
137+typedef struct { int preload; } fpu_switch_t;
138+
139+/*
140+ * FIXME! We could do a totally lazy restore, but we need to
141+ * add a per-cpu "this was the task that last touched the FPU
142+ * on this CPU" variable, and the task needs to have a "I last
143+ * touched the FPU on this CPU" and check them.
144+ *
145+ * We don't do that yet, so "fpu_lazy_restore()" always returns
146+ * false, but some day..
147+ */
148+#define fpu_lazy_restore(tsk) (0)
149+#define fpu_lazy_state_intact(tsk) do { } while (0)
150+
151+static inline fpu_switch_t switch_fpu_prepare(struct task_struct *old, struct task_struct *new)
152+{
153+ fpu_switch_t fpu;
154+
155+ fpu.preload = tsk_used_math(new) && new->fpu_counter > 5;
156+ if (__thread_has_fpu(old)) {
157+ if (__save_init_fpu(old))
158+ fpu_lazy_state_intact(old);
159+ __thread_clear_has_fpu(old);
160+ old->fpu_counter++;
161+
162+ /* Don't change CR0.TS if we just switch! */
163+ if (fpu.preload) {
164+ __thread_set_has_fpu(new);
165+ prefetch(new->thread.fpu.state);
166+ } else
167+ stts();
168+ } else {
169+ old->fpu_counter = 0;
170+ if (fpu.preload) {
171+ if (fpu_lazy_restore(new))
172+ fpu.preload = 0;
173+ else
174+ prefetch(new->thread.fpu.state);
175+ __thread_fpu_begin(new);
176+ }
177+ }
178+ return fpu;
179+}
180
181-static inline void __unlazy_fpu(struct task_struct *tsk)
182+/*
183+ * By the time this gets called, we've already cleared CR0.TS and
184+ * given the process the FPU if we are going to preload the FPU
185+ * state - all we need to do is to conditionally restore the register
186+ * state itself.
187+ */
188+static inline void switch_fpu_finish(struct task_struct *new, fpu_switch_t fpu)
189 {
190- if (__thread_has_fpu(tsk)) {
191- __save_init_fpu(tsk);
192- __thread_fpu_end(tsk);
193- } else
194- tsk->fpu_counter = 0;
195+ if (fpu.preload)
196+ __math_state_restore(new);
197 }
198
199+/*
200+ * Signal frame handlers...
201+ */
202+extern int save_i387_xstate(void __user *buf);
203+extern int restore_i387_xstate(void __user *buf);
204+
205 static inline void __clear_fpu(struct task_struct *tsk)
206 {
207 if (__thread_has_fpu(tsk)) {
208@@ -474,7 +546,11 @@ static inline void save_init_fpu(struct task_struct *tsk)
209 static inline void unlazy_fpu(struct task_struct *tsk)
210 {
211 preempt_disable();
212- __unlazy_fpu(tsk);
213+ if (__thread_has_fpu(tsk)) {
214+ __save_init_fpu(tsk);
215+ __thread_fpu_end(tsk);
216+ } else
217+ tsk->fpu_counter = 0;
218 preempt_enable();
219 }
220
221diff --git a/arch/x86/kernel/process_32.c b/arch/x86/kernel/process_32.c
222index 0cdb4fa..8598296 100644
223--- a/arch/x86/kernel/process_32.c
224+++ b/arch/x86/kernel/process_32.c
225@@ -297,10 +297,11 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
226 *next = &next_p->thread;
227 int cpu = smp_processor_id();
228 struct tss_struct *tss = &per_cpu(init_tss, cpu);
229+ fpu_switch_t fpu;
230
231 /* never put a printk in __switch_to... printk() calls wake_up*() indirectly */
232
233- __unlazy_fpu(prev_p);
234+ fpu = switch_fpu_prepare(prev_p, next_p);
235
236 /*
237 * Reload esp0.
238@@ -355,6 +356,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
239 if (prev->gs | next->gs)
240 lazy_load_gs(next->gs);
241
242+ switch_fpu_finish(next_p, fpu);
243+
244 percpu_write(current_task, next_p);
245
246 return prev_p;
247diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
248index 042b18f..6a364a6 100644
249--- a/arch/x86/kernel/process_64.c
250+++ b/arch/x86/kernel/process_64.c
251@@ -381,8 +381,9 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
252 int cpu = smp_processor_id();
253 struct tss_struct *tss = &per_cpu(init_tss, cpu);
254 unsigned fsindex, gsindex;
255+ fpu_switch_t fpu;
256
257- __unlazy_fpu(prev_p);
258+ fpu = switch_fpu_prepare(prev_p, next_p);
259
260 /*
261 * Reload esp0, LDT and the page table pointer:
262@@ -452,6 +453,8 @@ __switch_to(struct task_struct *prev_p, struct task_struct *next_p)
263 wrmsrl(MSR_KERNEL_GS_BASE, next->gs);
264 prev->gsindex = gsindex;
265
266+ switch_fpu_finish(next_p, fpu);
267+
268 /*
269 * Switch the PDA and FPU contexts.
270 */
271diff --git a/arch/x86/kernel/traps.c b/arch/x86/kernel/traps.c
272index a99badf..31d9d0f 100644
273--- a/arch/x86/kernel/traps.c
274+++ b/arch/x86/kernel/traps.c
275@@ -562,6 +562,37 @@ asmlinkage void __attribute__((weak)) smp_threshold_interrupt(void)
276 }
277
278 /*
279+ * This gets called with the process already owning the
280+ * FPU state, and with CR0.TS cleared. It just needs to
281+ * restore the FPU register state.
282+ */
283+void __math_state_restore(struct task_struct *tsk)
284+{
285+ /* We need a safe address that is cheap to find and that is already
286+ in L1. We've just brought in "tsk->thread.has_fpu", so use that */
287+#define safe_address (tsk->thread.has_fpu)
288+
289+ /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
290+ is pending. Clear the x87 state here by setting it to fixed
291+ values. safe_address is a random variable that should be in L1 */
292+ alternative_input(
293+ ASM_NOP8 ASM_NOP2,
294+ "emms\n\t" /* clear stack tags */
295+ "fildl %P[addr]", /* set F?P to defined value */
296+ X86_FEATURE_FXSAVE_LEAK,
297+ [addr] "m" (safe_address));
298+
299+ /*
300+ * Paranoid restore. send a SIGSEGV if we fail to restore the state.
301+ */
302+ if (unlikely(restore_fpu_checking(tsk))) {
303+ __thread_fpu_end(tsk);
304+ force_sig(SIGSEGV, tsk);
305+ return;
306+ }
307+}
308+
309+/*
310 * 'math_state_restore()' saves the current math information in the
311 * old math state array, and gets the new ones from the current task
312 *
313@@ -575,10 +606,6 @@ void math_state_restore(void)
314 {
315 struct task_struct *tsk = current;
316
317- /* We need a safe address that is cheap to find and that is already
318- in L1. We're just bringing in "tsk->thread.has_fpu", so use that */
319-#define safe_address (tsk->thread.has_fpu)
320-
321 if (!tsk_used_math(tsk)) {
322 local_irq_enable();
323 /*
324@@ -595,25 +622,7 @@ void math_state_restore(void)
325 }
326
327 __thread_fpu_begin(tsk);
328-
329- /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception
330- is pending. Clear the x87 state here by setting it to fixed
331- values. safe_address is a random variable that should be in L1 */
332- alternative_input(
333- ASM_NOP8 ASM_NOP2,
334- "emms\n\t" /* clear stack tags */
335- "fildl %P[addr]", /* set F?P to defined value */
336- X86_FEATURE_FXSAVE_LEAK,
337- [addr] "m" (safe_address));
338-
339- /*
340- * Paranoid restore. send a SIGSEGV if we fail to restore the state.
341- */
342- if (unlikely(restore_fpu_checking(tsk))) {
343- __thread_fpu_end(tsk);
344- force_sig(SIGSEGV, tsk);
345- return;
346- }
347+ __math_state_restore(tsk);
348
349 tsk->fpu_counter++;
350 }
351--
3521.7.7.4
353
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0011-Linux-3.2.8.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0011-Linux-3.2.8.patch
new file mode 100644
index 00000000..e3189b68
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.8/0011-Linux-3.2.8.patch
@@ -0,0 +1,24 @@
1From 1de504ea25617f701ac3a246a1c9dfd2246d4900 Mon Sep 17 00:00:00 2001
2From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3Date: Mon, 27 Feb 2012 10:26:22 -0800
4Subject: [PATCH 11/11] Linux 3.2.8
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index d1bdc90..7df8a84 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 7
18+SUBLEVEL = 8
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.4
24
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0001-Security-tomoyo-add-.gitignore-file.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0001-Security-tomoyo-add-.gitignore-file.patch
new file mode 100644
index 00000000..aba9a7ce
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0001-Security-tomoyo-add-.gitignore-file.patch
@@ -0,0 +1,32 @@
1From ae9aea55d123e1091f239833f832de071ff00f22 Mon Sep 17 00:00:00 2001
2From: Greg Kroah-Hartman <gregkh@suse.de>
3Date: Fri, 9 Dec 2011 11:23:46 -0800
4Subject: [PATCH 01/73] Security: tomoyo: add .gitignore file
5
6commit 735e93c70434614bffac4a914ca1da72e37d43c0 upstream.
7
8This adds the .gitignore file for the autogenerated TOMOYO files to keep
9git from complaining after building things.
10
11Cc: Kentaro Takeda <takedakn@nttdata.co.jp>
12Cc: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
13Cc: James Morris <jmorris@namei.org>
14Acked-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
15Signed-off-by: James Morris <jmorris@namei.org>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 security/tomoyo/.gitignore | 2 ++
19 1 files changed, 2 insertions(+), 0 deletions(-)
20 create mode 100644 security/tomoyo/.gitignore
21
22diff --git a/security/tomoyo/.gitignore b/security/tomoyo/.gitignore
23new file mode 100644
24index 0000000..5caf1a6
25--- /dev/null
26+++ b/security/tomoyo/.gitignore
27@@ -0,0 +1,2 @@
28+builtin-policy.h
29+policy/
30--
311.7.7.4
32
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0002-powerpc-perf-power_pmu_start-restores-incorrect-valu.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0002-powerpc-perf-power_pmu_start-restores-incorrect-valu.patch
new file mode 100644
index 00000000..653f93c0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0002-powerpc-perf-power_pmu_start-restores-incorrect-valu.patch
@@ -0,0 +1,58 @@
1From 90f91ae1598200e5f650c5ddb1d7165398cf7f5a Mon Sep 17 00:00:00 2001
2From: Anton Blanchard <anton@samba.org>
3Date: Wed, 15 Feb 2012 18:48:22 +0000
4Subject: [PATCH 02/73] powerpc/perf: power_pmu_start restores incorrect
5 values, breaking frequency events
6
7commit 9a45a9407c69d068500923480884661e2b9cc421 upstream.
8
9perf on POWER stopped working after commit e050e3f0a71b (perf: Fix
10broken interrupt rate throttling). That patch exposed a bug in
11the POWER perf_events code.
12
13Since the PMCs count upwards and take an exception when the top bit
14is set, we want to write 0x80000000 - left in power_pmu_start. We were
15instead programming in left which effectively disables the counter
16until we eventually hit 0x80000000. This could take seconds or longer.
17
18With the patch applied I get the expected number of samples:
19
20 SAMPLE events: 9948
21
22Signed-off-by: Anton Blanchard <anton@samba.org>
23Acked-by: Paul Mackerras <paulus@samba.org>
24Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26---
27 arch/powerpc/kernel/perf_event.c | 8 +++++++-
28 1 files changed, 7 insertions(+), 1 deletions(-)
29
30diff --git a/arch/powerpc/kernel/perf_event.c b/arch/powerpc/kernel/perf_event.c
31index 10a140f..64483fd 100644
32--- a/arch/powerpc/kernel/perf_event.c
33+++ b/arch/powerpc/kernel/perf_event.c
34@@ -865,6 +865,7 @@ static void power_pmu_start(struct perf_event *event, int ef_flags)
35 {
36 unsigned long flags;
37 s64 left;
38+ unsigned long val;
39
40 if (!event->hw.idx || !event->hw.sample_period)
41 return;
42@@ -880,7 +881,12 @@ static void power_pmu_start(struct perf_event *event, int ef_flags)
43
44 event->hw.state = 0;
45 left = local64_read(&event->hw.period_left);
46- write_pmc(event->hw.idx, left);
47+
48+ val = 0;
49+ if (left < 0x80000000L)
50+ val = 0x80000000L - left;
51+
52+ write_pmc(event->hw.idx, val);
53
54 perf_event_update_userpage(event);
55 perf_pmu_enable(event->pmu);
56--
571.7.7.4
58
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0003-ARM-at91-USB-AT91-gadget-registration-for-module.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0003-ARM-at91-USB-AT91-gadget-registration-for-module.patch
new file mode 100644
index 00000000..cafbf0e3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0003-ARM-at91-USB-AT91-gadget-registration-for-module.patch
@@ -0,0 +1,78 @@
1From 4f89dcb180bf8f614410c8fd9cb2ab1d951155b1 Mon Sep 17 00:00:00 2001
2From: Nicolas Ferre <nicolas.ferre@atmel.com>
3Date: Fri, 27 Jan 2012 11:14:44 +0100
4Subject: [PATCH 03/73] ARM: at91: USB AT91 gadget registration for module
5
6commit e8c9dc93e27d891636defbc269f182a83e6abba8 upstream.
7
8Registration of at91_udc as a module will enable SoC
9related code.
10
11Fix following an idea from Karel Znamenacek.
12
13Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
14Acked-by: Karel Znamenacek <karel@ryston.cz>
15Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 arch/arm/mach-at91/at91rm9200_devices.c | 2 +-
19 arch/arm/mach-at91/at91sam9260_devices.c | 2 +-
20 arch/arm/mach-at91/at91sam9261_devices.c | 2 +-
21 arch/arm/mach-at91/at91sam9263_devices.c | 2 +-
22 4 files changed, 4 insertions(+), 4 deletions(-)
23
24diff --git a/arch/arm/mach-at91/at91rm9200_devices.c b/arch/arm/mach-at91/at91rm9200_devices.c
25index ad93068..143eebb 100644
26--- a/arch/arm/mach-at91/at91rm9200_devices.c
27+++ b/arch/arm/mach-at91/at91rm9200_devices.c
28@@ -83,7 +83,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
29 * USB Device (Gadget)
30 * -------------------------------------------------------------------- */
31
32-#ifdef CONFIG_USB_AT91
33+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
34 static struct at91_udc_data udc_data;
35
36 static struct resource udc_resources[] = {
37diff --git a/arch/arm/mach-at91/at91sam9260_devices.c b/arch/arm/mach-at91/at91sam9260_devices.c
38index 629fa97..2590988 100644
39--- a/arch/arm/mach-at91/at91sam9260_devices.c
40+++ b/arch/arm/mach-at91/at91sam9260_devices.c
41@@ -84,7 +84,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
42 * USB Device (Gadget)
43 * -------------------------------------------------------------------- */
44
45-#ifdef CONFIG_USB_AT91
46+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
47 static struct at91_udc_data udc_data;
48
49 static struct resource udc_resources[] = {
50diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
51index a178b58..daf3e66 100644
52--- a/arch/arm/mach-at91/at91sam9261_devices.c
53+++ b/arch/arm/mach-at91/at91sam9261_devices.c
54@@ -87,7 +87,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
55 * USB Device (Gadget)
56 * -------------------------------------------------------------------- */
57
58-#ifdef CONFIG_USB_AT91
59+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
60 static struct at91_udc_data udc_data;
61
62 static struct resource udc_resources[] = {
63diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
64index d5fbac9..32a7e43 100644
65--- a/arch/arm/mach-at91/at91sam9263_devices.c
66+++ b/arch/arm/mach-at91/at91sam9263_devices.c
67@@ -92,7 +92,7 @@ void __init at91_add_device_usbh(struct at91_usbh_data *data) {}
68 * USB Device (Gadget)
69 * -------------------------------------------------------------------- */
70
71-#ifdef CONFIG_USB_AT91
72+#if defined(CONFIG_USB_AT91) || defined(CONFIG_USB_AT91_MODULE)
73 static struct at91_udc_data udc_data;
74
75 static struct resource udc_resources[] = {
76--
771.7.7.4
78
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0004-drm-radeon-kms-fix-MSI-re-arm-on-rv370.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0004-drm-radeon-kms-fix-MSI-re-arm-on-rv370.patch
new file mode 100644
index 00000000..05d41bdb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0004-drm-radeon-kms-fix-MSI-re-arm-on-rv370.patch
@@ -0,0 +1,54 @@
1From 74d54f57ce5ae36b8e74cab2a349edb614f1b5cb Mon Sep 17 00:00:00 2001
2From: Alex Deucher <alexander.deucher@amd.com>
3Date: Mon, 13 Feb 2012 16:36:34 -0500
4Subject: [PATCH 04/73] drm/radeon/kms: fix MSI re-arm on rv370+
5
6commit b7f5b7dec3d539a84734f2bcb7e53fbb1532a40b upstream.
7
8MSI_REARM_EN register is a write only trigger register.
9There is no need RMW when re-arming.
10
11May fix:
12https://bugs.freedesktop.org/show_bug.cgi?id=41668
13
14Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
15Signed-off-by: Dave Airlie <airlied@redhat.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/gpu/drm/radeon/r100.c | 4 +---
19 drivers/gpu/drm/radeon/rs600.c | 4 +---
20 2 files changed, 2 insertions(+), 6 deletions(-)
21
22diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
23index 31b0d1a..fad7cd1 100644
24--- a/drivers/gpu/drm/radeon/r100.c
25+++ b/drivers/gpu/drm/radeon/r100.c
26@@ -789,9 +789,7 @@ int r100_irq_process(struct radeon_device *rdev)
27 WREG32(RADEON_AIC_CNTL, msi_rearm | RS400_MSI_REARM);
28 break;
29 default:
30- msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
31- WREG32(RADEON_MSI_REARM_EN, msi_rearm);
32- WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
33+ WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
34 break;
35 }
36 }
37diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
38index c259e21..ee898e9 100644
39--- a/drivers/gpu/drm/radeon/rs600.c
40+++ b/drivers/gpu/drm/radeon/rs600.c
41@@ -693,9 +693,7 @@ int rs600_irq_process(struct radeon_device *rdev)
42 WREG32(RADEON_BUS_CNTL, msi_rearm | RS600_MSI_REARM);
43 break;
44 default:
45- msi_rearm = RREG32(RADEON_MSI_REARM_EN) & ~RV370_MSI_REARM_EN;
46- WREG32(RADEON_MSI_REARM_EN, msi_rearm);
47- WREG32(RADEON_MSI_REARM_EN, msi_rearm | RV370_MSI_REARM_EN);
48+ WREG32(RADEON_MSI_REARM_EN, RV370_MSI_REARM_EN);
49 break;
50 }
51 }
52--
531.7.7.4
54
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0005-PCI-workaround-hard-wired-bus-number-V2.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0005-PCI-workaround-hard-wired-bus-number-V2.patch
new file mode 100644
index 00000000..188dc1b5
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0005-PCI-workaround-hard-wired-bus-number-V2.patch
@@ -0,0 +1,44 @@
1From 608951f12d572bd36c95a5629a9c5bb7b6cf244c Mon Sep 17 00:00:00 2001
2From: Yinghai Lu <yinghai.lu@oracle.com>
3Date: Mon, 30 Jan 2012 12:25:24 +0100
4Subject: [PATCH 05/73] PCI: workaround hard-wired bus number V2
5
6commit 71f6bd4a23130cd2f4b036010c5790b1295290b9 upstream.
7
8Fixes PCI device detection on IBM xSeries IBM 3850 M2 / x3950 M2
9when using ACPI resources (_CRS).
10This is default, a manual workaround (without this patch)
11would be pci=nocrs boot param.
12
13V2: Add dev_warn if the workaround is hit. This should reveal
14how common such setups are (via google) and point to possible
15problems if things are still not working as expected.
16-> Suggested by Jan Beulich.
17
18Tested-by: garyhade@us.ibm.com
19Signed-off-by: Yinghai Lu <yinghai.lu@oracle.com>
20Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/pci/probe.c | 5 +++++
24 1 files changed, 5 insertions(+), 0 deletions(-)
25
26diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
27index 04e74f4..dfee1b3 100644
28--- a/drivers/pci/probe.c
29+++ b/drivers/pci/probe.c
30@@ -651,6 +651,11 @@ int __devinit pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max,
31 dev_dbg(&dev->dev, "scanning [bus %02x-%02x] behind bridge, pass %d\n",
32 secondary, subordinate, pass);
33
34+ if (!primary && (primary != bus->number) && secondary && subordinate) {
35+ dev_warn(&dev->dev, "Primary bus is hard wired to 0\n");
36+ primary = bus->number;
37+ }
38+
39 /* Check if setup is sensible at all */
40 if (!pass &&
41 (primary != bus->number || secondary <= bus->number)) {
42--
431.7.7.4
44
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0006-mac80211-Fix-a-rwlock-bad-magic-bug.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0006-mac80211-Fix-a-rwlock-bad-magic-bug.patch
new file mode 100644
index 00000000..71ef771d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0006-mac80211-Fix-a-rwlock-bad-magic-bug.patch
@@ -0,0 +1,91 @@
1From c5ffed9245d22034d5b9d5f910c6217fdb00a469 Mon Sep 17 00:00:00 2001
2From: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
3Date: Thu, 9 Feb 2012 19:59:43 +0530
4Subject: [PATCH 06/73] mac80211: Fix a rwlock bad magic bug
5
6commit b57e6b560fc2a2742910ac5ca0eb2c46e45aeac2 upstream.
7
8read_lock(&tpt_trig->trig.leddev_list_lock) is accessed via the path
9ieee80211_open (->) ieee80211_do_open (->) ieee80211_mod_tpt_led_trig
10(->) ieee80211_start_tpt_led_trig (->) tpt_trig_timer before initializing
11it.
12the intilization of this read/write lock happens via the path
13ieee80211_led_init (->) led_trigger_register, but we are doing
14'ieee80211_led_init' after 'ieeee80211_if_add' where we
15register netdev_ops.
16so we access leddev_list_lock before initializing it and causes the
17following bug in chrome laptops with AR928X cards with the following
18script
19
20while true
21do
22sudo modprobe -v ath9k
23sleep 3
24sudo modprobe -r ath9k
25sleep 3
26done
27
28 BUG: rwlock bad magic on CPU#1, wpa_supplicant/358, f5b9eccc
29 Pid: 358, comm: wpa_supplicant Not tainted 3.0.13 #1
30 Call Trace:
31
32 [<8137b9df>] rwlock_bug+0x3d/0x47
33 [<81179830>] do_raw_read_lock+0x19/0x29
34 [<8137f063>] _raw_read_lock+0xd/0xf
35 [<f9081957>] tpt_trig_timer+0xc3/0x145 [mac80211]
36 [<f9081f3a>] ieee80211_mod_tpt_led_trig+0x152/0x174 [mac80211]
37 [<f9076a3f>] ieee80211_do_open+0x11e/0x42e [mac80211]
38 [<f9075390>] ? ieee80211_check_concurrent_iface+0x26/0x13c [mac80211]
39 [<f9076d97>] ieee80211_open+0x48/0x4c [mac80211]
40 [<812dbed8>] __dev_open+0x82/0xab
41 [<812dc0c9>] __dev_change_flags+0x9c/0x113
42 [<812dc1ae>] dev_change_flags+0x18/0x44
43 [<8132144f>] devinet_ioctl+0x243/0x51a
44 [<81321ba9>] inet_ioctl+0x93/0xac
45 [<812cc951>] sock_ioctl+0x1c6/0x1ea
46 [<812cc78b>] ? might_fault+0x20/0x20
47 [<810b1ebb>] do_vfs_ioctl+0x46e/0x4a2
48 [<810a6ebb>] ? fget_light+0x2f/0x70
49 [<812ce549>] ? sys_recvmsg+0x3e/0x48
50 [<810b1f35>] sys_ioctl+0x46/0x69
51 [<8137fa77>] sysenter_do_call+0x12/0x2
52
53Cc: Gary Morain <gmorain@google.com>
54Cc: Paul Stewart <pstew@google.com>
55Cc: Abhijit Pradhan <abhijit@qca.qualcomm.com>
56Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
57Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
58Acked-by: Johannes Berg <johannes.berg@intel.com>
59Tested-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
60Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
61Signed-off-by: John W. Linville <linville@tuxdriver.com>
62Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
63---
64 net/mac80211/main.c | 4 ++--
65 1 files changed, 2 insertions(+), 2 deletions(-)
66
67diff --git a/net/mac80211/main.c b/net/mac80211/main.c
68index a7536fd..7d9b21d 100644
69--- a/net/mac80211/main.c
70+++ b/net/mac80211/main.c
71@@ -885,6 +885,8 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
72 wiphy_debug(local->hw.wiphy, "Failed to initialize wep: %d\n",
73 result);
74
75+ ieee80211_led_init(local);
76+
77 rtnl_lock();
78
79 result = ieee80211_init_rate_ctrl_alg(local,
80@@ -906,8 +908,6 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
81
82 rtnl_unlock();
83
84- ieee80211_led_init(local);
85-
86 local->network_latency_notifier.notifier_call =
87 ieee80211_max_network_latency;
88 result = pm_qos_add_notifier(PM_QOS_NETWORK_LATENCY,
89--
901.7.7.4
91
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0007-ipheth-Add-iPhone-4S.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0007-ipheth-Add-iPhone-4S.patch
new file mode 100644
index 00000000..18143ec6
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0007-ipheth-Add-iPhone-4S.patch
@@ -0,0 +1,43 @@
1From 35c224c3c96801e94357ab4ea7158a5557a04c15 Mon Sep 17 00:00:00 2001
2From: Tim Gardner <tim.gardner@canonical.com>
3Date: Wed, 15 Feb 2012 07:50:15 +0000
4Subject: [PATCH 07/73] ipheth: Add iPhone 4S
5
6commit 72ba009b8a159e995e40d3b4e5d7d265acead983 upstream.
7
8BugLink: http://bugs.launchpad.net/bugs/900802
9
10Signed-off-by: Till Kamppeter <till.kamppeter@gmail.com>
11Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
12Signed-off-by: David S. Miller <davem@davemloft.net>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 drivers/net/usb/ipheth.c | 5 +++++
16 1 files changed, 5 insertions(+), 0 deletions(-)
17
18diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
19index 13c1f04..ad96164 100644
20--- a/drivers/net/usb/ipheth.c
21+++ b/drivers/net/usb/ipheth.c
22@@ -60,6 +60,7 @@
23 #define USB_PRODUCT_IPHONE_3GS 0x1294
24 #define USB_PRODUCT_IPHONE_4 0x1297
25 #define USB_PRODUCT_IPHONE_4_VZW 0x129c
26+#define USB_PRODUCT_IPHONE_4S 0x12a0
27
28 #define IPHETH_USBINTF_CLASS 255
29 #define IPHETH_USBINTF_SUBCLASS 253
30@@ -103,6 +104,10 @@ static struct usb_device_id ipheth_table[] = {
31 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
32 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
33 IPHETH_USBINTF_PROTO) },
34+ { USB_DEVICE_AND_INTERFACE_INFO(
35+ USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
36+ IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
37+ IPHETH_USBINTF_PROTO) },
38 { }
39 };
40 MODULE_DEVICE_TABLE(usb, ipheth_table);
41--
421.7.7.4
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0008-regmap-Fix-cache-defaults-initialization-from-raw-ca.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0008-regmap-Fix-cache-defaults-initialization-from-raw-ca.patch
new file mode 100644
index 00000000..d9b07d8f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0008-regmap-Fix-cache-defaults-initialization-from-raw-ca.patch
@@ -0,0 +1,53 @@
1From 2a66303d51a096182e881319aef517e4847de32b Mon Sep 17 00:00:00 2001
2From: Lars-Peter Clausen <lars@metafoo.de>
3Date: Wed, 15 Feb 2012 10:23:25 +0100
4Subject: [PATCH 08/73] regmap: Fix cache defaults initialization from raw
5 cache defaults
6
7commit 61cddc57dc14a5dffa0921d9a24fd68edbb374ac upstream.
8
9Currently registers with a value of 0 are ignored when initializing the register
10defaults from raw defaults. This worked in the past, because registers without a
11explicit default were assumed to have a default value of 0. This was changed in
12commit b03622a8 ("regmap: Ensure rbtree syncs registers set to zero properly").
13As a result registers, which have a raw default value of 0 are now assumed to
14have no default. This again can result in unnecessary writes when syncing the
15cache. It will also result in unnecessary reads for e.g. the first update
16operation. In the case where readback is not possible this will even let the
17update operation fail, if the register has not been written to before.
18
19So this patch removes the check. Instead it adds a check to ignore raw defaults
20for registers which are volatile, since those registers are not cached.
21
22Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
23Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 drivers/base/regmap/regcache.c | 4 ++--
27 1 files changed, 2 insertions(+), 2 deletions(-)
28
29diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c
30index 666f6f5..64004b0 100644
31--- a/drivers/base/regmap/regcache.c
32+++ b/drivers/base/regmap/regcache.c
33@@ -54,7 +54,7 @@ static int regcache_hw_init(struct regmap *map)
34 for (count = 0, i = 0; i < map->num_reg_defaults_raw; i++) {
35 val = regcache_get_val(map->reg_defaults_raw,
36 i, map->cache_word_size);
37- if (!val)
38+ if (regmap_volatile(map, i))
39 continue;
40 count++;
41 }
42@@ -69,7 +69,7 @@ static int regcache_hw_init(struct regmap *map)
43 for (i = 0, j = 0; i < map->num_reg_defaults_raw; i++) {
44 val = regcache_get_val(map->reg_defaults_raw,
45 i, map->cache_word_size);
46- if (!val)
47+ if (regmap_volatile(map, i))
48 continue;
49 map->reg_defaults[j].reg = i;
50 map->reg_defaults[j].def = val;
51--
521.7.7.4
53
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0009-eCryptfs-Copy-up-lower-inode-attrs-after-setting-low.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0009-eCryptfs-Copy-up-lower-inode-attrs-after-setting-low.patch
new file mode 100644
index 00000000..fc0e8152
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0009-eCryptfs-Copy-up-lower-inode-attrs-after-setting-low.patch
@@ -0,0 +1,43 @@
1From 6b6cd603f9bde174d9cf18060264204587d4a9fb Mon Sep 17 00:00:00 2001
2From: Tyler Hicks <tyhicks@canonical.com>
3Date: Tue, 7 Feb 2012 17:55:40 -0600
4Subject: [PATCH 09/73] eCryptfs: Copy up lower inode attrs after setting
5 lower xattr
6
7commit 545d680938be1e86a6c5250701ce9abaf360c495 upstream.
8
9After passing through a ->setxattr() call, eCryptfs needs to copy the
10inode attributes from the lower inode to the eCryptfs inode, as they
11may have changed in the lower filesystem's ->setxattr() path.
12
13One example is if an extended attribute containing a POSIX Access
14Control List is being set. The new ACL may cause the lower filesystem to
15modify the mode of the lower inode and the eCryptfs inode would need to
16be updated to reflect the new mode.
17
18https://launchpad.net/bugs/926292
19
20Signed-off-by: Tyler Hicks <tyhicks@canonical.com>
21Reported-by: Sebastien Bacher <seb128@ubuntu.com>
22Cc: John Johansen <john.johansen@canonical.com>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 fs/ecryptfs/inode.c | 2 ++
26 1 files changed, 2 insertions(+), 0 deletions(-)
27
28diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
29index d2039ca..af11098 100644
30--- a/fs/ecryptfs/inode.c
31+++ b/fs/ecryptfs/inode.c
32@@ -1104,6 +1104,8 @@ ecryptfs_setxattr(struct dentry *dentry, const char *name, const void *value,
33 }
34
35 rc = vfs_setxattr(lower_dentry, name, value, size, flags);
36+ if (!rc)
37+ fsstack_copy_attr_all(dentry->d_inode, lower_dentry->d_inode);
38 out:
39 return rc;
40 }
41--
421.7.7.4
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0010-S390-correct-ktime-to-tod-clock-comparator-conversio.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0010-S390-correct-ktime-to-tod-clock-comparator-conversio.patch
new file mode 100644
index 00000000..080ca0d4
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0010-S390-correct-ktime-to-tod-clock-comparator-conversio.patch
@@ -0,0 +1,44 @@
1From cadd96ffcc3e4c6db78a08d0ea95fec1ddaecf18 Mon Sep 17 00:00:00 2001
2From: Martin Schwidefsky <schwidefsky@de.ibm.com>
3Date: Fri, 17 Feb 2012 10:29:23 +0100
4Subject: [PATCH 10/73] S390: correct ktime to tod clock comparator conversion
5
6commit cf1eb40f8f5ea12c9e569e7282161fc7f194fd62 upstream.
7
8The conversion of the ktime to a value suitable for the clock comparator
9does not take changes to wall_to_monotonic into account. In fact the
10conversion just needs the boot clock (sched_clock_base_cc) and the
11total_sleep_time.
12
13This is applicable to 3.2+ kernels.
14
15Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 arch/s390/kernel/time.c | 7 +++++--
19 1 files changed, 5 insertions(+), 2 deletions(-)
20
21diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
22index ebbfab3..e03c555 100644
23--- a/arch/s390/kernel/time.c
24+++ b/arch/s390/kernel/time.c
25@@ -113,11 +113,14 @@ static void fixup_clock_comparator(unsigned long long delta)
26 static int s390_next_ktime(ktime_t expires,
27 struct clock_event_device *evt)
28 {
29+ struct timespec ts;
30 u64 nsecs;
31
32- nsecs = ktime_to_ns(ktime_sub(expires, ktime_get_monotonic_offset()));
33+ ts.tv_sec = ts.tv_nsec = 0;
34+ monotonic_to_bootbased(&ts);
35+ nsecs = ktime_to_ns(ktime_add(timespec_to_ktime(ts), expires));
36 do_div(nsecs, 125);
37- S390_lowcore.clock_comparator = TOD_UNIX_EPOCH + (nsecs << 9);
38+ S390_lowcore.clock_comparator = sched_clock_base_cc + (nsecs << 9);
39 set_clock_comparator(S390_lowcore.clock_comparator);
40 return 0;
41 }
42--
431.7.7.4
44
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0011-vfs-fix-d_inode_lookup-dentry-ref-leak.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0011-vfs-fix-d_inode_lookup-dentry-ref-leak.patch
new file mode 100644
index 00000000..16032350
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0011-vfs-fix-d_inode_lookup-dentry-ref-leak.patch
@@ -0,0 +1,35 @@
1From 3c40e5e0828215d90ab4374405019cd5d170615b Mon Sep 17 00:00:00 2001
2From: Miklos Szeredi <mszeredi@suse.cz>
3Date: Fri, 3 Feb 2012 14:25:18 +0100
4Subject: [PATCH 11/73] vfs: fix d_inode_lookup() dentry ref leak
5
6commit e188dc02d3a9c911be56eca5aa114fe7e9822d53 upstream.
7
8d_inode_lookup() leaks a dentry reference on IS_DEADDIR().
9
10Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
11Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
12Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
13---
14 fs/namei.c | 4 +++-
15 1 files changed, 3 insertions(+), 1 deletions(-)
16
17diff --git a/fs/namei.c b/fs/namei.c
18index 5008f01..744e942 100644
19--- a/fs/namei.c
20+++ b/fs/namei.c
21@@ -1094,8 +1094,10 @@ static struct dentry *d_inode_lookup(struct dentry *parent, struct dentry *dentr
22 struct dentry *old;
23
24 /* Don't create child dentry for a dead directory. */
25- if (unlikely(IS_DEADDIR(inode)))
26+ if (unlikely(IS_DEADDIR(inode))) {
27+ dput(dentry);
28 return ERR_PTR(-ENOENT);
29+ }
30
31 old = inode->i_op->lookup(inode, dentry, nd);
32 if (unlikely(old)) {
33--
341.7.7.4
35
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0012-ARM-7326-2-PL330-fix-null-pointer-dereference-in-pl3.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0012-ARM-7326-2-PL330-fix-null-pointer-dereference-in-pl3.patch
new file mode 100644
index 00000000..74fe49b2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0012-ARM-7326-2-PL330-fix-null-pointer-dereference-in-pl3.patch
@@ -0,0 +1,45 @@
1From 32818d15fe50ef5465fc635252ca4c2c1bcf1673 Mon Sep 17 00:00:00 2001
2From: Javi Merino <javi.merino@arm.com>
3Date: Wed, 15 Feb 2012 17:36:39 +0100
4Subject: [PATCH 12/73] ARM: 7326/2: PL330: fix null pointer dereference in
5 pl330_chan_ctrl()
6
7commit 46e33c606af8e0caeeca374103189663d877c0d6 upstream.
8
9This fixes the thrd->req_running field being accessed before thrd
10is checked for null. The error was introduced in
11
12 abb959f: ARM: 7237/1: PL330: Fix driver freeze
13
14Reference: <1326458191-23492-1-git-send-email-mans.rullgard@linaro.org>
15
16Signed-off-by: Mans Rullgard <mans.rullgard@linaro.org>
17Acked-by: Javi Merino <javi.merino@arm.com>
18Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 arch/arm/common/pl330.c | 3 ++-
22 1 files changed, 2 insertions(+), 1 deletions(-)
23
24diff --git a/arch/arm/common/pl330.c b/arch/arm/common/pl330.c
25index 8d8df74..67abef5 100644
26--- a/arch/arm/common/pl330.c
27+++ b/arch/arm/common/pl330.c
28@@ -1496,12 +1496,13 @@ int pl330_chan_ctrl(void *ch_id, enum pl330_chan_op op)
29 struct pl330_thread *thrd = ch_id;
30 struct pl330_dmac *pl330;
31 unsigned long flags;
32- int ret = 0, active = thrd->req_running;
33+ int ret = 0, active;
34
35 if (!thrd || thrd->free || thrd->dmac->state == DYING)
36 return -EINVAL;
37
38 pl330 = thrd->dmac;
39+ active = thrd->req_running;
40
41 spin_lock_irqsave(&pl330->lock, flags);
42
43--
441.7.7.4
45
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0013-ALSA-hda-Fix-redundant-jack-creations-for-cx5051.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0013-ALSA-hda-Fix-redundant-jack-creations-for-cx5051.patch
new file mode 100644
index 00000000..5ffcdc7d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0013-ALSA-hda-Fix-redundant-jack-creations-for-cx5051.patch
@@ -0,0 +1,68 @@
1From 2a8e5e8a2df18812c60720fa0534c29c9f1c17b6 Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Wed, 22 Feb 2012 17:02:38 +0100
4Subject: [PATCH 13/73] ALSA: hda - Fix redundant jack creations for cx5051
5
6[Note that since the patch isn't applicable (and unnecessary) to
73.3-rc, there is no corresponding upstream fix.]
8
9The cx5051 parser calls snd_hda_input_jack_add() in the init callback
10to create and initialize the jack detection instances. Since the init
11callback is called at each time when the device gets woken up after
12suspend or power-saving mode, the duplicated instances are accumulated
13at each call. This ends up with the kernel warnings with the too
14large array size.
15
16The fix is simply to move the calls of snd_hda_input_jack_add() into
17the parser section instead of the init callback.
18
19The fix is needed only up to 3.2 kernel, since the HD-audio jack layer
20was redesigned in the 3.3 kernel.
21
22Reported-by: Russell King <rmk+kernel@arm.linux.org.uk>
23Tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
24Signed-off-by: Takashi Iwai <tiwai@suse.de>
25Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26---
27 sound/pci/hda/patch_conexant.c | 11 ++++++++++-
28 1 files changed, 10 insertions(+), 1 deletions(-)
29
30diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
31index 7072251..08bad5b 100644
32--- a/sound/pci/hda/patch_conexant.c
33+++ b/sound/pci/hda/patch_conexant.c
34@@ -1899,6 +1899,10 @@ static void cxt5051_init_mic_port(struct hda_codec *codec, hda_nid_t nid,
35 snd_hda_codec_write(codec, nid, 0,
36 AC_VERB_SET_UNSOLICITED_ENABLE,
37 AC_USRSP_EN | event);
38+}
39+
40+static void cxt5051_init_mic_jack(struct hda_codec *codec, hda_nid_t nid)
41+{
42 snd_hda_input_jack_add(codec, nid, SND_JACK_MICROPHONE, NULL);
43 snd_hda_input_jack_report(codec, nid);
44 }
45@@ -1916,7 +1920,6 @@ static int cxt5051_init(struct hda_codec *codec)
46 struct conexant_spec *spec = codec->spec;
47
48 conexant_init(codec);
49- conexant_init_jacks(codec);
50
51 if (spec->auto_mic & AUTO_MIC_PORTB)
52 cxt5051_init_mic_port(codec, 0x17, CXT5051_PORTB_EVENT);
53@@ -2037,6 +2040,12 @@ static int patch_cxt5051(struct hda_codec *codec)
54 if (spec->beep_amp)
55 snd_hda_attach_beep_device(codec, spec->beep_amp);
56
57+ conexant_init_jacks(codec);
58+ if (spec->auto_mic & AUTO_MIC_PORTB)
59+ cxt5051_init_mic_jack(codec, 0x17);
60+ if (spec->auto_mic & AUTO_MIC_PORTC)
61+ cxt5051_init_mic_jack(codec, 0x18);
62+
63 return 0;
64 }
65
66--
671.7.7.4
68
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0014-mmc-core-check-for-zero-length-ioctl-data.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0014-mmc-core-check-for-zero-length-ioctl-data.patch
new file mode 100644
index 00000000..1e0fdb71
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0014-mmc-core-check-for-zero-length-ioctl-data.patch
@@ -0,0 +1,137 @@
1From f3d763847f78da07fb82f6d9e8242875cf6995d3 Mon Sep 17 00:00:00 2001
2From: Johan Rudholm <johan.rudholm@stericsson.com>
3Date: Wed, 23 Nov 2011 09:05:58 +0100
4Subject: [PATCH 14/73] mmc: core: check for zero length ioctl data
5
6commit 4d6144de8ba263eb3691a737c547e5b2fdc45287 upstream.
7
8If the read or write buffer size associated with the command sent
9through the mmc_blk_ioctl is zero, do not prepare data buffer.
10
11This enables a ioctl(2) call to for instance send a MMC_SWITCH to set
12a byte in the ext_csd.
13
14Signed-off-by: Johan Rudholm <johan.rudholm@stericsson.com>
15Signed-off-by: Chris Ball <cjb@laptop.org>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/mmc/card/block.c | 82 +++++++++++++++++++++++++---------------------
19 1 files changed, 45 insertions(+), 37 deletions(-)
20
21diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
22index 1e0e27c..e15e47d 100644
23--- a/drivers/mmc/card/block.c
24+++ b/drivers/mmc/card/block.c
25@@ -266,6 +266,9 @@ static struct mmc_blk_ioc_data *mmc_blk_ioctl_copy_from_user(
26 goto idata_err;
27 }
28
29+ if (!idata->buf_bytes)
30+ return idata;
31+
32 idata->buf = kzalloc(idata->buf_bytes, GFP_KERNEL);
33 if (!idata->buf) {
34 err = -ENOMEM;
35@@ -312,25 +315,6 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
36 if (IS_ERR(idata))
37 return PTR_ERR(idata);
38
39- cmd.opcode = idata->ic.opcode;
40- cmd.arg = idata->ic.arg;
41- cmd.flags = idata->ic.flags;
42-
43- data.sg = &sg;
44- data.sg_len = 1;
45- data.blksz = idata->ic.blksz;
46- data.blocks = idata->ic.blocks;
47-
48- sg_init_one(data.sg, idata->buf, idata->buf_bytes);
49-
50- if (idata->ic.write_flag)
51- data.flags = MMC_DATA_WRITE;
52- else
53- data.flags = MMC_DATA_READ;
54-
55- mrq.cmd = &cmd;
56- mrq.data = &data;
57-
58 md = mmc_blk_get(bdev->bd_disk);
59 if (!md) {
60 err = -EINVAL;
61@@ -343,6 +327,48 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
62 goto cmd_done;
63 }
64
65+ cmd.opcode = idata->ic.opcode;
66+ cmd.arg = idata->ic.arg;
67+ cmd.flags = idata->ic.flags;
68+
69+ if (idata->buf_bytes) {
70+ data.sg = &sg;
71+ data.sg_len = 1;
72+ data.blksz = idata->ic.blksz;
73+ data.blocks = idata->ic.blocks;
74+
75+ sg_init_one(data.sg, idata->buf, idata->buf_bytes);
76+
77+ if (idata->ic.write_flag)
78+ data.flags = MMC_DATA_WRITE;
79+ else
80+ data.flags = MMC_DATA_READ;
81+
82+ /* data.flags must already be set before doing this. */
83+ mmc_set_data_timeout(&data, card);
84+
85+ /* Allow overriding the timeout_ns for empirical tuning. */
86+ if (idata->ic.data_timeout_ns)
87+ data.timeout_ns = idata->ic.data_timeout_ns;
88+
89+ if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
90+ /*
91+ * Pretend this is a data transfer and rely on the
92+ * host driver to compute timeout. When all host
93+ * drivers support cmd.cmd_timeout for R1B, this
94+ * can be changed to:
95+ *
96+ * mrq.data = NULL;
97+ * cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
98+ */
99+ data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
100+ }
101+
102+ mrq.data = &data;
103+ }
104+
105+ mrq.cmd = &cmd;
106+
107 mmc_claim_host(card->host);
108
109 if (idata->ic.is_acmd) {
110@@ -351,24 +377,6 @@ static int mmc_blk_ioctl_cmd(struct block_device *bdev,
111 goto cmd_rel_host;
112 }
113
114- /* data.flags must already be set before doing this. */
115- mmc_set_data_timeout(&data, card);
116- /* Allow overriding the timeout_ns for empirical tuning. */
117- if (idata->ic.data_timeout_ns)
118- data.timeout_ns = idata->ic.data_timeout_ns;
119-
120- if ((cmd.flags & MMC_RSP_R1B) == MMC_RSP_R1B) {
121- /*
122- * Pretend this is a data transfer and rely on the host driver
123- * to compute timeout. When all host drivers support
124- * cmd.cmd_timeout for R1B, this can be changed to:
125- *
126- * mrq.data = NULL;
127- * cmd.cmd_timeout = idata->ic.cmd_timeout_ms;
128- */
129- data.timeout_ns = idata->ic.cmd_timeout_ms * 1000000;
130- }
131-
132 mmc_wait_for_req(card->host, &mrq);
133
134 if (cmd.error) {
135--
1361.7.7.4
137
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0015-NFSv4-Fix-an-Oops-in-the-NFSv4-getacl-code.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0015-NFSv4-Fix-an-Oops-in-the-NFSv4-getacl-code.patch
new file mode 100644
index 00000000..e205000e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0015-NFSv4-Fix-an-Oops-in-the-NFSv4-getacl-code.patch
@@ -0,0 +1,98 @@
1From 4a818b4288d5a897b0e928dd0cd1e1e29501159f Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <Trond.Myklebust@netapp.com>
3Date: Fri, 3 Feb 2012 18:30:53 -0500
4Subject: [PATCH 15/73] NFSv4: Fix an Oops in the NFSv4 getacl code
5
6commit 331818f1c468a24e581aedcbe52af799366a9dfe upstream.
7
8Commit bf118a342f10dafe44b14451a1392c3254629a1f (NFSv4: include bitmap
9in nfsv4 get acl data) introduces the 'acl_scratch' page for the case
10where we may need to decode multi-page data. However it fails to take
11into account the fact that the variable may be NULL (for the case where
12we're not doing multi-page decode), and it also attaches it to the
13encoding xdr_stream rather than the decoding one.
14
15The immediate result is an Oops in nfs4_xdr_enc_getacl due to the
16call to page_address() with a NULL page pointer.
17
18Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
19Cc: Andy Adamson <andros@netapp.com>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 fs/nfs/nfs4proc.c | 8 ++++----
23 fs/nfs/nfs4xdr.c | 5 ++++-
24 include/linux/nfs_xdr.h | 2 +-
25 3 files changed, 9 insertions(+), 6 deletions(-)
26
27diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
28index 055d702..2ee398a 100644
29--- a/fs/nfs/nfs4proc.c
30+++ b/fs/nfs/nfs4proc.c
31@@ -3568,8 +3568,8 @@ static ssize_t __nfs4_get_acl_uncached(struct inode *inode, void *buf, size_t bu
32 }
33 if (npages > 1) {
34 /* for decoding across pages */
35- args.acl_scratch = alloc_page(GFP_KERNEL);
36- if (!args.acl_scratch)
37+ res.acl_scratch = alloc_page(GFP_KERNEL);
38+ if (!res.acl_scratch)
39 goto out_free;
40 }
41 args.acl_len = npages * PAGE_SIZE;
42@@ -3605,8 +3605,8 @@ out_free:
43 for (i = 0; i < npages; i++)
44 if (pages[i])
45 __free_page(pages[i]);
46- if (args.acl_scratch)
47- __free_page(args.acl_scratch);
48+ if (res.acl_scratch)
49+ __free_page(res.acl_scratch);
50 return ret;
51 }
52
53diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
54index dcaf693..68adab4 100644
55--- a/fs/nfs/nfs4xdr.c
56+++ b/fs/nfs/nfs4xdr.c
57@@ -2522,7 +2522,6 @@ static void nfs4_xdr_enc_getacl(struct rpc_rqst *req, struct xdr_stream *xdr,
58
59 xdr_inline_pages(&req->rq_rcv_buf, replen << 2,
60 args->acl_pages, args->acl_pgbase, args->acl_len);
61- xdr_set_scratch_buffer(xdr, page_address(args->acl_scratch), PAGE_SIZE);
62
63 encode_nops(&hdr);
64 }
65@@ -6034,6 +6033,10 @@ nfs4_xdr_dec_getacl(struct rpc_rqst *rqstp, struct xdr_stream *xdr,
66 struct compound_hdr hdr;
67 int status;
68
69+ if (res->acl_scratch != NULL) {
70+ void *p = page_address(res->acl_scratch);
71+ xdr_set_scratch_buffer(xdr, p, PAGE_SIZE);
72+ }
73 status = decode_compound_hdr(xdr, &hdr);
74 if (status)
75 goto out;
76diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
77index 6c898af..41116ab 100644
78--- a/include/linux/nfs_xdr.h
79+++ b/include/linux/nfs_xdr.h
80@@ -602,7 +602,6 @@ struct nfs_getaclargs {
81 size_t acl_len;
82 unsigned int acl_pgbase;
83 struct page ** acl_pages;
84- struct page * acl_scratch;
85 struct nfs4_sequence_args seq_args;
86 };
87
88@@ -612,6 +611,7 @@ struct nfs_getaclres {
89 size_t acl_len;
90 size_t acl_data_offset;
91 int acl_flags;
92+ struct page * acl_scratch;
93 struct nfs4_sequence_res seq_res;
94 };
95
96--
971.7.7.4
98
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0016-NFSv4-Ensure-we-throw-out-bad-delegation-stateids-on.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0016-NFSv4-Ensure-we-throw-out-bad-delegation-stateids-on.patch
new file mode 100644
index 00000000..a40f9105
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0016-NFSv4-Ensure-we-throw-out-bad-delegation-stateids-on.patch
@@ -0,0 +1,33 @@
1From 0cea513e395f2a2d4dd650eeae8a1c08a7425296 Mon Sep 17 00:00:00 2001
2From: Trond Myklebust <Trond.Myklebust@netapp.com>
3Date: Thu, 9 Feb 2012 15:31:36 -0500
4Subject: [PATCH 16/73] NFSv4: Ensure we throw out bad delegation stateids on
5 NFS4ERR_BAD_STATEID
6
7commit b9f9a03150969e4bd9967c20bce67c4de769058f upstream.
8
9To ensure that we don't just reuse the bad delegation when we attempt to
10recover the nfs4_state that received the bad stateid error.
11
12Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 fs/nfs/nfs4state.c | 2 ++
16 1 files changed, 2 insertions(+), 0 deletions(-)
17
18diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
19index 6a7107a..a58eed7 100644
20--- a/fs/nfs/nfs4state.c
21+++ b/fs/nfs/nfs4state.c
22@@ -1071,6 +1071,8 @@ void nfs4_schedule_stateid_recovery(const struct nfs_server *server, struct nfs4
23 {
24 struct nfs_client *clp = server->nfs_client;
25
26+ if (test_and_clear_bit(NFS_DELEGATED_STATE, &state->flags))
27+ nfs_async_inode_return_delegation(state->inode, &state->stateid);
28 nfs4_state_mark_reclaim_nograce(clp, state);
29 nfs4_schedule_state_manager(clp);
30 }
31--
321.7.7.4
33
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0017-NFSv4-fix-server_scope-memory-leak.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0017-NFSv4-fix-server_scope-memory-leak.patch
new file mode 100644
index 00000000..7edf14cd
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0017-NFSv4-fix-server_scope-memory-leak.patch
@@ -0,0 +1,55 @@
1From 8ed3fe820fe9cf267d39d86cb76e4064cdf82da3 Mon Sep 17 00:00:00 2001
2From: Weston Andros Adamson <dros@netapp.com>
3Date: Thu, 16 Feb 2012 11:17:05 -0500
4Subject: [PATCH 17/73] NFSv4: fix server_scope memory leak
5
6commit abe9a6d57b4544ac208401f9c0a4262814db2be4 upstream.
7
8server_scope would never be freed if nfs4_check_cl_exchange_flags() returned
9non-zero
10
11Signed-off-by: Weston Andros Adamson <dros@netapp.com>
12Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 fs/nfs/nfs4proc.c | 15 +++++++++------
16 1 files changed, 9 insertions(+), 6 deletions(-)
17
18diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
19index 2ee398a..e527030 100644
20--- a/fs/nfs/nfs4proc.c
21+++ b/fs/nfs/nfs4proc.c
22@@ -4876,8 +4876,10 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
23 clp->cl_rpcclient->cl_auth->au_flavor);
24
25 res.server_scope = kzalloc(sizeof(struct server_scope), GFP_KERNEL);
26- if (unlikely(!res.server_scope))
27- return -ENOMEM;
28+ if (unlikely(!res.server_scope)) {
29+ status = -ENOMEM;
30+ goto out;
31+ }
32
33 status = rpc_call_sync(clp->cl_rpcclient, &msg, RPC_TASK_TIMEOUT);
34 if (!status)
35@@ -4894,12 +4896,13 @@ int nfs4_proc_exchange_id(struct nfs_client *clp, struct rpc_cred *cred)
36 clp->server_scope = NULL;
37 }
38
39- if (!clp->server_scope)
40+ if (!clp->server_scope) {
41 clp->server_scope = res.server_scope;
42- else
43- kfree(res.server_scope);
44+ goto out;
45+ }
46 }
47-
48+ kfree(res.server_scope);
49+out:
50 dprintk("<-- %s status= %d\n", __func__, status);
51 return status;
52 }
53--
541.7.7.4
55
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0018-ARM-7321-1-cache-v7-Disable-preemption-when-reading-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0018-ARM-7321-1-cache-v7-Disable-preemption-when-reading-.patch
new file mode 100644
index 00000000..e8d52aa0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0018-ARM-7321-1-cache-v7-Disable-preemption-when-reading-.patch
@@ -0,0 +1,61 @@
1From 1bbe8912e024ae0502c208159364de706ad5d999 Mon Sep 17 00:00:00 2001
2From: Stephen Boyd <sboyd@codeaurora.org>
3Date: Tue, 7 Feb 2012 19:42:07 +0100
4Subject: [PATCH 18/73] ARM: 7321/1: cache-v7: Disable preemption when reading
5 CCSIDR
6
7commit b46c0f74657d1fe1c1b0c1452631cc38a9e6987f upstream.
8
9armv7's flush_cache_all() flushes caches via set/way. To
10determine the cache attributes (line size, number of sets,
11etc.) the assembly first writes the CSSELR register to select a
12cache level and then reads the CCSIDR register. The CSSELR register
13is banked per-cpu and is used to determine which cache level CCSIDR
14reads. If the task is migrated between when the CSSELR is written and
15the CCSIDR is read the CCSIDR value may be for an unexpected cache
16level (for example L1 instead of L2) and incorrect cache flushing
17could occur.
18
19Disable interrupts across the write and read so that the correct
20cache attributes are read and used for the cache flushing
21routine. We disable interrupts instead of disabling preemption
22because the critical section is only 3 instructions and we want
23to call v7_dcache_flush_all from __v7_setup which doesn't have a
24full kernel stack with a struct thread_info.
25
26This fixes a problem we see in scm_call() when flush_cache_all()
27is called from preemptible context and sometimes the L2 cache is
28not properly flushed out.
29
30Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
31Acked-by: Catalin Marinas <catalin.marinas@arm.com>
32Reviewed-by: Nicolas Pitre <nico@linaro.org>
33Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
34Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
35---
36 arch/arm/mm/cache-v7.S | 6 ++++++
37 1 files changed, 6 insertions(+), 0 deletions(-)
38
39diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
40index 07c4bc8..7a24d39 100644
41--- a/arch/arm/mm/cache-v7.S
42+++ b/arch/arm/mm/cache-v7.S
43@@ -54,9 +54,15 @@ loop1:
44 and r1, r1, #7 @ mask of the bits for current cache only
45 cmp r1, #2 @ see what cache we have at this level
46 blt skip @ skip if no cache, or just i-cache
47+#ifdef CONFIG_PREEMPT
48+ save_and_disable_irqs r9 @ make cssr&csidr read atomic
49+#endif
50 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
51 isb @ isb to sych the new cssr&csidr
52 mrc p15, 1, r1, c0, c0, 0 @ read the new csidr
53+#ifdef CONFIG_PREEMPT
54+ restore_irqs_notrace r9
55+#endif
56 and r2, r1, #7 @ extract the length of the cache lines
57 add r2, r2, #4 @ add 4 (line length offset)
58 ldr r4, =0x3ff
59--
601.7.7.4
61
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0019-ARM-7325-1-fix-v7-boot-with-lockdep-enabled.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0019-ARM-7325-1-fix-v7-boot-with-lockdep-enabled.patch
new file mode 100644
index 00000000..8e5b0fbf
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0019-ARM-7325-1-fix-v7-boot-with-lockdep-enabled.patch
@@ -0,0 +1,61 @@
1From ceb484992b356b7f9b499cf56b8ba8da8289aa74 Mon Sep 17 00:00:00 2001
2From: Rabin Vincent <rabin@rab.in>
3Date: Wed, 15 Feb 2012 16:01:42 +0100
4Subject: [PATCH 19/73] ARM: 7325/1: fix v7 boot with lockdep enabled
5
6commit 8e43a905dd574f54c5715d978318290ceafbe275 upstream.
7
8Bootup with lockdep enabled has been broken on v7 since b46c0f74657d
9("ARM: 7321/1: cache-v7: Disable preemption when reading CCSIDR").
10
11This is because v7_setup (which is called very early during boot) calls
12v7_flush_dcache_all, and the save_and_disable_irqs added by that patch
13ends up attempting to call into lockdep C code (trace_hardirqs_off())
14when we are in no position to execute it (no stack, MMU off).
15
16Fix this by using a notrace variant of save_and_disable_irqs. The code
17already uses the notrace variant of restore_irqs.
18
19Reviewed-by: Nicolas Pitre <nico@linaro.org>
20Acked-by: Stephen Boyd <sboyd@codeaurora.org>
21Cc: Catalin Marinas <catalin.marinas@arm.com>
22Signed-off-by: Rabin Vincent <rabin@rab.in>
23Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 arch/arm/include/asm/assembler.h | 5 +++++
27 arch/arm/mm/cache-v7.S | 2 +-
28 2 files changed, 6 insertions(+), 1 deletions(-)
29
30diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
31index 29035e8..7bb8bf9 100644
32--- a/arch/arm/include/asm/assembler.h
33+++ b/arch/arm/include/asm/assembler.h
34@@ -137,6 +137,11 @@
35 disable_irq
36 .endm
37
38+ .macro save_and_disable_irqs_notrace, oldcpsr
39+ mrs \oldcpsr, cpsr
40+ disable_irq_notrace
41+ .endm
42+
43 /*
44 * Restore interrupt state previously stored in a register. We don't
45 * guarantee that this will preserve the flags.
46diff --git a/arch/arm/mm/cache-v7.S b/arch/arm/mm/cache-v7.S
47index 7a24d39..a655d3d 100644
48--- a/arch/arm/mm/cache-v7.S
49+++ b/arch/arm/mm/cache-v7.S
50@@ -55,7 +55,7 @@ loop1:
51 cmp r1, #2 @ see what cache we have at this level
52 blt skip @ skip if no cache, or just i-cache
53 #ifdef CONFIG_PREEMPT
54- save_and_disable_irqs r9 @ make cssr&csidr read atomic
55+ save_and_disable_irqs_notrace r9 @ make cssr&csidr read atomic
56 #endif
57 mcr p15, 2, r10, c0, c0, 0 @ select current cache level in cssr
58 isb @ isb to sych the new cssr&csidr
59--
601.7.7.4
61
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0020-3c59x-shorten-timer-period-for-slave-devices.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0020-3c59x-shorten-timer-period-for-slave-devices.patch
new file mode 100644
index 00000000..57ee5c2b
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0020-3c59x-shorten-timer-period-for-slave-devices.patch
@@ -0,0 +1,42 @@
1From 96dd4ee6793dd443256eda40dd38fa3e84a02c89 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <eric.dumazet@gmail.com>
3Date: Tue, 14 Feb 2012 10:27:09 +0000
4Subject: [PATCH 20/73] 3c59x: shorten timer period for slave devices
5
6[ Upstream commit 3013dc0cceb9baaf25d5624034eeaa259bf99004 ]
7
8Jean Delvare reported bonding on top of 3c59x adapters was not detecting
9network cable removal fast enough.
10
113c59x indeed uses a 60 seconds timer to check link status if carrier is
12on, and 5 seconds if carrier is off.
13
14This patch reduces timer period to 5 seconds if device is a bonding
15slave.
16
17Reported-by: Jean Delvare <jdelvare@suse.de>
18Acked-by: Jean Delvare <jdelvare@suse.de>
19Acked-by: Steffen Klassert <steffen.klassert@secunet.com>
20Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
21Signed-off-by: David S. Miller <davem@davemloft.net>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23---
24 drivers/net/ethernet/3com/3c59x.c | 2 +-
25 1 files changed, 1 insertions(+), 1 deletions(-)
26
27diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
28index b42c06b..e0c5529 100644
29--- a/drivers/net/ethernet/3com/3c59x.c
30+++ b/drivers/net/ethernet/3com/3c59x.c
31@@ -1842,7 +1842,7 @@ vortex_timer(unsigned long data)
32 ok = 1;
33 }
34
35- if (!netif_carrier_ok(dev))
36+ if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev))
37 next_tick = 5*HZ;
38
39 if (vp->medialock)
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0021-net-Don-t-proxy-arp-respond-if-iif-rt-dst.dev-if-pri.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0021-net-Don-t-proxy-arp-respond-if-iif-rt-dst.dev-if-pri.patch
new file mode 100644
index 00000000..d8f0bd36
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0021-net-Don-t-proxy-arp-respond-if-iif-rt-dst.dev-if-pri.patch
@@ -0,0 +1,43 @@
1From 1b22d2ddf4f62bc4f600f9b4c5d9d6ad65dcca14 Mon Sep 17 00:00:00 2001
2From: Thomas Graf <tgraf@suug.ch>
3Date: Fri, 10 Feb 2012 04:07:11 +0000
4Subject: [PATCH 21/73] net: Don't proxy arp respond if iif == rt->dst.dev if
5 private VLAN is disabled
6
7[ Upstream commit 70620c46ac2b45c24b0f22002fdf5ddd1f7daf81 ]
8
9Commit 653241 (net: RFC3069, private VLAN proxy arp support) changed
10the behavior of arp proxy to send arp replies back out on the interface
11the request came in even if the private VLAN feature is disabled.
12
13Previously we checked rt->dst.dev != skb->dev for in scenarios, when
14proxy arp is enabled on for the netdevice and also when individual proxy
15neighbour entries have been added.
16
17This patch adds the check back for the pneigh_lookup() scenario.
18
19Signed-off-by: Thomas Graf <tgraf@suug.ch>
20Acked-by: Jesper Dangaard Brouer <hawk@comx.dk>
21Signed-off-by: David S. Miller <davem@davemloft.net>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23---
24 net/ipv4/arp.c | 3 ++-
25 1 files changed, 2 insertions(+), 1 deletions(-)
26
27diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
28index 96a164a..59a7041 100644
29--- a/net/ipv4/arp.c
30+++ b/net/ipv4/arp.c
31@@ -867,7 +867,8 @@ static int arp_process(struct sk_buff *skb)
32 if (addr_type == RTN_UNICAST &&
33 (arp_fwd_proxy(in_dev, dev, rt) ||
34 arp_fwd_pvlan(in_dev, dev, rt, sip, tip) ||
35- pneigh_lookup(&arp_tbl, net, &tip, dev, 0))) {
36+ (rt->dst.dev != dev &&
37+ pneigh_lookup(&arp_tbl, net, &tip, dev, 0)))) {
38 n = neigh_event_ns(&arp_tbl, sha, &sip, dev);
39 if (n)
40 neigh_release(n);
41--
421.7.7.4
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0022-netpoll-netpoll_poll_dev-should-access-dev-flags.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0022-netpoll-netpoll_poll_dev-should-access-dev-flags.patch
new file mode 100644
index 00000000..e0047b45
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0022-netpoll-netpoll_poll_dev-should-access-dev-flags.patch
@@ -0,0 +1,35 @@
1From 39994fb222e62650dc945af466f15f0696f9db7b Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <eric.dumazet@gmail.com>
3Date: Tue, 14 Feb 2012 10:11:59 +0000
4Subject: [PATCH 22/73] netpoll: netpoll_poll_dev() should access dev->flags
5
6[ Upstream commit 58e05f357a039a94aa36475f8c110256f693a239 ]
7
8commit 5a698af53f (bond: service netpoll arp queue on master device)
9tested IFF_SLAVE flag against dev->priv_flags instead of dev->flags
10
11Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
12Cc: WANG Cong <amwang@redhat.com>
13Acked-by: Neil Horman <nhorman@tuxdriver.com>
14Signed-off-by: David S. Miller <davem@davemloft.net>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 net/core/netpoll.c | 2 +-
18 1 files changed, 1 insertions(+), 1 deletions(-)
19
20diff --git a/net/core/netpoll.c b/net/core/netpoll.c
21index 5d4d896..ab0633f 100644
22--- a/net/core/netpoll.c
23+++ b/net/core/netpoll.c
24@@ -194,7 +194,7 @@ static void netpoll_poll_dev(struct net_device *dev)
25
26 poll_napi(dev);
27
28- if (dev->priv_flags & IFF_SLAVE) {
29+ if (dev->flags & IFF_SLAVE) {
30 if (dev->npinfo) {
31 struct net_device *bond_dev = dev->master;
32 struct sk_buff *skb;
33--
341.7.7.4
35
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0023-net_sched-Bug-in-netem-reordering.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0023-net_sched-Bug-in-netem-reordering.patch
new file mode 100644
index 00000000..93a991dc
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0023-net_sched-Bug-in-netem-reordering.patch
@@ -0,0 +1,42 @@
1From a1845875b3f78fa493087da218c90d09b0294271 Mon Sep 17 00:00:00 2001
2From: Hagen Paul Pfeifer <hagen@jauu.net>
3Date: Wed, 4 Jan 2012 17:35:26 +0000
4Subject: [PATCH 23/73] net_sched: Bug in netem reordering
5
6[ Upstream commit eb10192447370f19a215a8c2749332afa1199d46 ]
7
8Not now, but it looks you are correct. q->qdisc is NULL until another
9additional qdisc is attached (beside tfifo). See 50612537e9ab2969312.
10The following patch should work.
11
12From: Hagen Paul Pfeifer <hagen@jauu.net>
13
14netem: catch NULL pointer by updating the real qdisc statistic
15
16Reported-by: Vijay Subramanian <subramanian.vijay@gmail.com>
17Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
18Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 net/sched/sch_netem.c | 4 ++--
23 1 files changed, 2 insertions(+), 2 deletions(-)
24
25diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
26index a4ab207..fd34012 100644
27--- a/net/sched/sch_netem.c
28+++ b/net/sched/sch_netem.c
29@@ -383,8 +383,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
30 q->counter = 0;
31
32 __skb_queue_head(&q->qdisc->q, skb);
33- q->qdisc->qstats.backlog += qdisc_pkt_len(skb);
34- q->qdisc->qstats.requeues++;
35+ sch->qstats.backlog += qdisc_pkt_len(skb);
36+ sch->qstats.requeues++;
37 ret = NET_XMIT_SUCCESS;
38 }
39
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0024-veth-Enforce-minimum-size-of-VETH_INFO_PEER.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0024-veth-Enforce-minimum-size-of-VETH_INFO_PEER.patch
new file mode 100644
index 00000000..dbab8e62
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0024-veth-Enforce-minimum-size-of-VETH_INFO_PEER.patch
@@ -0,0 +1,37 @@
1From b21abc775d2095a517f74f6df989569e3131e9c7 Mon Sep 17 00:00:00 2001
2From: Hagen Paul Pfeifer <hagen@jauu.net>
3Date: Wed, 15 Feb 2012 04:09:46 +0000
4Subject: [PATCH 24/73] veth: Enforce minimum size of VETH_INFO_PEER
5
6[ Upstream commit 237114384ab22c174ec4641e809f8e6cbcfce774 ]
7
8VETH_INFO_PEER carries struct ifinfomsg plus optional IFLA
9attributes. A minimal size of sizeof(struct ifinfomsg) must be
10enforced or we may risk accessing that struct beyond the limits
11of the netlink message.
12
13Signed-off-by: Thomas Graf <tgraf@suug.ch>
14Signed-off-by: David S. Miller <davem@davemloft.net>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 drivers/net/veth.c | 4 +++-
18 1 files changed, 3 insertions(+), 1 deletions(-)
19
20diff --git a/drivers/net/veth.c b/drivers/net/veth.c
21index ef883e9..b907398 100644
22--- a/drivers/net/veth.c
23+++ b/drivers/net/veth.c
24@@ -423,7 +423,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
25 unregister_netdevice_queue(peer, head);
26 }
27
28-static const struct nla_policy veth_policy[VETH_INFO_MAX + 1];
29+static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
30+ [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) },
31+};
32
33 static struct rtnl_link_ops veth_link_ops = {
34 .kind = DRV_NAME,
35--
361.7.7.4
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0025-via-velocity-S3-resume-fix.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0025-via-velocity-S3-resume-fix.patch
new file mode 100644
index 00000000..d486aaf8
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0025-via-velocity-S3-resume-fix.patch
@@ -0,0 +1,37 @@
1From d14d408060c6a2d35c115f8bbded2faa41d21de7 Mon Sep 17 00:00:00 2001
2From: David Lv <DavidLv@viatech.com.cn>
3Date: Sat, 4 Feb 2012 23:22:26 +0000
4Subject: [PATCH 25/73] via-velocity: S3 resume fix.
5
6[ Upstream commit b530b1930bbd9d005345133f0ff0c556d2a52b19 ]
7
8Initially diagnosed on Ubuntu 11.04 with kernel 2.6.38.
9
10velocity_close is not called during a suspend / resume cycle in this
11driver and it has no business playing directly with power states.
12
13Signed-off-by: David Lv <DavidLv@viatech.com.cn>
14Acked-by: Francois Romieu <romieu@fr.zoreil.com>
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/net/ethernet/via/via-velocity.c | 3 ---
19 1 files changed, 0 insertions(+), 3 deletions(-)
20
21diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c
22index 4535d7c..e015a57 100644
23--- a/drivers/net/ethernet/via/via-velocity.c
24+++ b/drivers/net/ethernet/via/via-velocity.c
25@@ -2489,9 +2489,6 @@ static int velocity_close(struct net_device *dev)
26 if (dev->irq != 0)
27 free_irq(dev->irq, dev);
28
29- /* Power down the chip */
30- pci_set_power_state(vptr->pdev, PCI_D3hot);
31-
32 velocity_free_rings(vptr);
33
34 vptr->flags &= (~VELOCITY_FLAGS_OPENED);
35--
361.7.7.4
37
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
new file mode 100644
index 00000000..9d576768
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0026-ipv4-reset-flowi-parameters-on-route-connect.patch
@@ -0,0 +1,90 @@
1From f4df037cf3ca933c941a0f87a9c9ec542c88031c Mon Sep 17 00:00:00 2001
2From: Julian Anastasov <ja@ssi.bg>
3Date: Sat, 4 Feb 2012 13:04:46 +0000
4Subject: [PATCH 26/73] ipv4: reset flowi parameters on route connect
5
6[ Upstream commit e6b45241c57a83197e5de9166b3b0d32ac562609 ]
7
8Eric Dumazet found that commit 813b3b5db83
9(ipv4: Use caller's on-stack flowi as-is in output
10route lookups.) that comes in 3.0 added a regression.
11The problem appears to be that resulting flowi4_oif is
12used incorrectly as input parameter to some routing lookups.
13The result is that when connecting to local port without
14listener if the IP address that is used is not on a loopback
15interface we incorrectly assign RTN_UNICAST to the output
16route because no route is matched by oif=lo. The RST packet
17can not be sent immediately by tcp_v4_send_reset because
18it expects RTN_LOCAL.
19
20 So, change ip_route_connect and ip_route_newports to
21update the flowi4 fields that are input parameters because
22we do not want unnecessary binding to oif.
23
24 To make it clear what are the input parameters that
25can be modified during lookup and to show which fields of
26floiw4 are reused add a new function to update the flowi4
27structure: flowi4_update_output.
28
29Thanks to Yurij M. Plotnikov for providing a bug report including a
30program to reproduce the problem.
31
32Thanks to Eric Dumazet for tracking the problem down to
33tcp_v4_send_reset and providing initial fix.
34
35Reported-by: Yurij M. Plotnikov <Yurij.Plotnikov@oktetlabs.ru>
36Signed-off-by: Julian Anastasov <ja@ssi.bg>
37Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
38Signed-off-by: David S. Miller <davem@davemloft.net>
39Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40---
41 include/net/flow.h | 10 ++++++++++
42 include/net/route.h | 4 ++++
43 2 files changed, 14 insertions(+), 0 deletions(-)
44
45diff --git a/include/net/flow.h b/include/net/flow.h
46index 57f15a7..2a7eefd 100644
47--- a/include/net/flow.h
48+++ b/include/net/flow.h
49@@ -90,6 +90,16 @@ static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
50 fl4->fl4_dport = dport;
51 fl4->fl4_sport = sport;
52 }
53+
54+/* Reset some input parameters after previous lookup */
55+static inline void flowi4_update_output(struct flowi4 *fl4, int oif, __u8 tos,
56+ __be32 daddr, __be32 saddr)
57+{
58+ fl4->flowi4_oif = oif;
59+ fl4->flowi4_tos = tos;
60+ fl4->daddr = daddr;
61+ fl4->saddr = saddr;
62+}
63
64
65 struct flowi6 {
66diff --git a/include/net/route.h b/include/net/route.h
67index 91855d1..b1c0d5b 100644
68--- a/include/net/route.h
69+++ b/include/net/route.h
70@@ -270,6 +270,7 @@ static inline struct rtable *ip_route_connect(struct flowi4 *fl4,
71 if (IS_ERR(rt))
72 return rt;
73 ip_rt_put(rt);
74+ flowi4_update_output(fl4, oif, tos, fl4->daddr, fl4->saddr);
75 }
76 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
77 return ip_route_output_flow(net, fl4, sk);
78@@ -284,6 +285,9 @@ static inline struct rtable *ip_route_newports(struct flowi4 *fl4, struct rtable
79 fl4->fl4_dport = dport;
80 fl4->fl4_sport = sport;
81 ip_rt_put(rt);
82+ flowi4_update_output(fl4, sk->sk_bound_dev_if,
83+ RT_CONN_FLAGS(sk), fl4->daddr,
84+ fl4->saddr);
85 security_sk_classify_flow(sk, flowi4_to_flowi(fl4));
86 return ip_route_output_flow(sock_net(sk), fl4, sk);
87 }
88--
891.7.7.4
90
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0027-tcp_v4_send_reset-binding-oif-to-iif-in-no-sock-case.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0027-tcp_v4_send_reset-binding-oif-to-iif-in-no-sock-case.patch
new file mode 100644
index 00000000..52ef35eb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0027-tcp_v4_send_reset-binding-oif-to-iif-in-no-sock-case.patch
@@ -0,0 +1,47 @@
1From 017d762758b89e117b10c21a8490b16e93cf487b Mon Sep 17 00:00:00 2001
2From: Shawn Lu <shawn.lu@ericsson.com>
3Date: Sat, 4 Feb 2012 12:38:09 +0000
4Subject: [PATCH 27/73] tcp_v4_send_reset: binding oif to iif in no sock case
5
6[ Upstream commit e2446eaab5585555a38ea0df4e01ff313dbb4ac9 ]
7
8Binding RST packet outgoing interface to incoming interface
9for tcp v4 when there is no socket associate with it.
10when sk is not NULL, using sk->sk_bound_dev_if instead.
11(suggested by Eric Dumazet).
12
13This has few benefits:
141. tcp_v6_send_reset already did that.
152. This helps tcp connect with SO_BINDTODEVICE set. When
16connection is lost, we still able to sending out RST using
17same interface.
183. we are sending reply, it is most likely to be succeed
19if iif is used
20
21Signed-off-by: Shawn Lu <shawn.lu@ericsson.com>
22Acked-by: Eric Dumazet <eric.dumazet@gmail.com>
23Signed-off-by: David S. Miller <davem@davemloft.net>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 net/ipv4/tcp_ipv4.c | 5 +++++
27 1 files changed, 5 insertions(+), 0 deletions(-)
28
29diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
30index c89e354..eb90aa8 100644
31--- a/net/ipv4/tcp_ipv4.c
32+++ b/net/ipv4/tcp_ipv4.c
33@@ -650,6 +650,11 @@ static void tcp_v4_send_reset(struct sock *sk, struct sk_buff *skb)
34 arg.iov[0].iov_len, IPPROTO_TCP, 0);
35 arg.csumoffset = offsetof(struct tcphdr, check) / 2;
36 arg.flags = (sk && inet_sk(sk)->transparent) ? IP_REPLY_ARG_NOSRCCHECK : 0;
37+ /* When socket is gone, all binding information is lost.
38+ * routing might fail in this case. using iif for oif to
39+ * make sure we can deliver it
40+ */
41+ arg.bound_dev_if = sk ? sk->sk_bound_dev_if : inet_iif(skb);
42
43 net = dev_net(skb_dst(skb)->dev);
44 arg.tos = ip_hdr(skb)->tos;
45--
461.7.7.4
47
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0028-ipv4-Fix-wrong-order-of-ip_rt_get_source-and-update-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0028-ipv4-Fix-wrong-order-of-ip_rt_get_source-and-update-.patch
new file mode 100644
index 00000000..a9e0a6a9
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0028-ipv4-Fix-wrong-order-of-ip_rt_get_source-and-update-.patch
@@ -0,0 +1,38 @@
1From 763fe579c154a7bcff5f40788b3b32ada3a1f8db Mon Sep 17 00:00:00 2001
2From: Li Wei <lw@cn.fujitsu.com>
3Date: Thu, 9 Feb 2012 21:15:25 +0000
4Subject: [PATCH 28/73] ipv4: Fix wrong order of ip_rt_get_source() and update
5 iph->daddr.
6
7[ Upstream commit 5dc7883f2a7c25f8df40d7479687153558cd531b ]
8
9This patch fix a bug which introduced by commit ac8a4810 (ipv4: Save
10nexthop address of LSRR/SSRR option to IPCB.).In that patch, we saved
11the nexthop of SRR in ip_option->nexthop and update iph->daddr until
12we get to ip_forward_options(), but we need to update it before
13ip_rt_get_source(), otherwise we may get a wrong src.
14
15Signed-off-by: Li Wei <lw@cn.fujitsu.com>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 net/ipv4/ip_options.c | 2 +-
20 1 files changed, 1 insertions(+), 1 deletions(-)
21
22diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
23index 1e60f76..42dd1a9 100644
24--- a/net/ipv4/ip_options.c
25+++ b/net/ipv4/ip_options.c
26@@ -573,8 +573,8 @@ void ip_forward_options(struct sk_buff *skb)
27 }
28 if (srrptr + 3 <= srrspace) {
29 opt->is_changed = 1;
30- ip_rt_get_source(&optptr[srrptr-1], skb, rt);
31 ip_hdr(skb)->daddr = opt->nexthop;
32+ ip_rt_get_source(&optptr[srrptr-1], skb, rt);
33 optptr[2] = srrptr+4;
34 } else if (net_ratelimit())
35 printk(KERN_CRIT "ip_forward(): Argh! Destination lost!\n");
36--
371.7.7.4
38
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0029-net-Make-qdisc_skb_cb-upper-size-bound-explicit.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0029-net-Make-qdisc_skb_cb-upper-size-bound-explicit.patch
new file mode 100644
index 00000000..651c2a00
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0029-net-Make-qdisc_skb_cb-upper-size-bound-explicit.patch
@@ -0,0 +1,90 @@
1From 79246cb05913bd4262514210136d087c1beb6d3b Mon Sep 17 00:00:00 2001
2From: "David S. Miller" <davem@davemloft.net>
3Date: Mon, 6 Feb 2012 15:14:37 -0500
4Subject: [PATCH 29/73] net: Make qdisc_skb_cb upper size bound explicit.
5
6[ Upstream commit 16bda13d90c8d5da243e2cfa1677e62ecce26860 ]
7
8Just like skb->cb[], so that qdisc_skb_cb can be encapsulated inside
9of other data structures.
10
11This is intended to be used by IPoIB so that it can remember
12addressing information stored at hard_header_ops->create() time that
13it can fetch when the packet gets to the transmit routine.
14
15Signed-off-by: David S. Miller <davem@davemloft.net>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 include/net/sch_generic.h | 9 ++++++++-
19 net/sched/sch_choke.c | 3 +--
20 net/sched/sch_netem.c | 3 +--
21 net/sched/sch_sfb.c | 3 +--
22 4 files changed, 11 insertions(+), 7 deletions(-)
23
24diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
25index f6bb08b..55ce96b 100644
26--- a/include/net/sch_generic.h
27+++ b/include/net/sch_generic.h
28@@ -220,9 +220,16 @@ struct tcf_proto {
29
30 struct qdisc_skb_cb {
31 unsigned int pkt_len;
32- long data[];
33+ unsigned char data[24];
34 };
35
36+static inline void qdisc_cb_private_validate(const struct sk_buff *skb, int sz)
37+{
38+ struct qdisc_skb_cb *qcb;
39+ BUILD_BUG_ON(sizeof(skb->cb) < sizeof(unsigned int) + sz);
40+ BUILD_BUG_ON(sizeof(qcb->data) < sz);
41+}
42+
43 static inline int qdisc_qlen(const struct Qdisc *q)
44 {
45 return q->q.qlen;
46diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
47index 3422b25..081ffb9 100644
48--- a/net/sched/sch_choke.c
49+++ b/net/sched/sch_choke.c
50@@ -225,8 +225,7 @@ struct choke_skb_cb {
51
52 static inline struct choke_skb_cb *choke_skb_cb(const struct sk_buff *skb)
53 {
54- BUILD_BUG_ON(sizeof(skb->cb) <
55- sizeof(struct qdisc_skb_cb) + sizeof(struct choke_skb_cb));
56+ qdisc_cb_private_validate(skb, sizeof(struct choke_skb_cb));
57 return (struct choke_skb_cb *)qdisc_skb_cb(skb)->data;
58 }
59
60diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
61index fd34012..7801b15 100644
62--- a/net/sched/sch_netem.c
63+++ b/net/sched/sch_netem.c
64@@ -118,8 +118,7 @@ struct netem_skb_cb {
65
66 static inline struct netem_skb_cb *netem_skb_cb(struct sk_buff *skb)
67 {
68- BUILD_BUG_ON(sizeof(skb->cb) <
69- sizeof(struct qdisc_skb_cb) + sizeof(struct netem_skb_cb));
70+ qdisc_cb_private_validate(skb, sizeof(struct netem_skb_cb));
71 return (struct netem_skb_cb *)qdisc_skb_cb(skb)->data;
72 }
73
74diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c
75index e83c272..17859ea 100644
76--- a/net/sched/sch_sfb.c
77+++ b/net/sched/sch_sfb.c
78@@ -93,8 +93,7 @@ struct sfb_skb_cb {
79
80 static inline struct sfb_skb_cb *sfb_skb_cb(const struct sk_buff *skb)
81 {
82- BUILD_BUG_ON(sizeof(skb->cb) <
83- sizeof(struct qdisc_skb_cb) + sizeof(struct sfb_skb_cb));
84+ qdisc_cb_private_validate(skb, sizeof(struct sfb_skb_cb));
85 return (struct sfb_skb_cb *)qdisc_skb_cb(skb)->data;
86 }
87
88--
891.7.7.4
90
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0030-IPoIB-Stop-lying-about-hard_header_len-and-use-skb-c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0030-IPoIB-Stop-lying-about-hard_header_len-and-use-skb-c.patch
new file mode 100644
index 00000000..8e881016
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0030-IPoIB-Stop-lying-about-hard_header_len-and-use-skb-c.patch
@@ -0,0 +1,213 @@
1From afd87adacb5de00768b2e54f0bd851278f2e6179 Mon Sep 17 00:00:00 2001
2From: Roland Dreier <roland@purestorage.com>
3Date: Tue, 7 Feb 2012 14:51:21 +0000
4Subject: [PATCH 30/73] IPoIB: Stop lying about hard_header_len and use
5 skb->cb to stash LL addresses
6
7[ Upstream commit 936d7de3d736e0737542641269436f4b5968e9ef ]
8
9Commit a0417fa3a18a ("net: Make qdisc_skb_cb upper size bound
10explicit.") made it possible for a netdev driver to use skb->cb
11between its header_ops.create method and its .ndo_start_xmit
12method. Use this in ipoib_hard_header() to stash away the LL address
13(GID + QPN), instead of the "ipoib_pseudoheader" hack. This allows
14IPoIB to stop lying about its hard_header_len, which will let us fix
15the L2 check for GRO.
16
17Signed-off-by: Roland Dreier <roland@purestorage.com>
18Signed-off-by: David S. Miller <davem@davemloft.net>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/infiniband/ulp/ipoib/ipoib.h | 6 ++-
22 drivers/infiniband/ulp/ipoib/ipoib_main.c | 55 ++++++++---------------
23 drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 9 +---
24 3 files changed, 24 insertions(+), 46 deletions(-)
25
26diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
27index b3cc1e0..86df632 100644
28--- a/drivers/infiniband/ulp/ipoib/ipoib.h
29+++ b/drivers/infiniband/ulp/ipoib/ipoib.h
30@@ -44,6 +44,7 @@
31 #include <linux/mutex.h>
32
33 #include <net/neighbour.h>
34+#include <net/sch_generic.h>
35
36 #include <linux/atomic.h>
37
38@@ -117,8 +118,9 @@ struct ipoib_header {
39 u16 reserved;
40 };
41
42-struct ipoib_pseudoheader {
43- u8 hwaddr[INFINIBAND_ALEN];
44+struct ipoib_cb {
45+ struct qdisc_skb_cb qdisc_cb;
46+ u8 hwaddr[INFINIBAND_ALEN];
47 };
48
49 /* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
50diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
51index 83695b4..fe2fdbb 100644
52--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
53+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
54@@ -658,7 +658,7 @@ static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev)
55 }
56
57 static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
58- struct ipoib_pseudoheader *phdr)
59+ struct ipoib_cb *cb)
60 {
61 struct ipoib_dev_priv *priv = netdev_priv(dev);
62 struct ipoib_path *path;
63@@ -666,17 +666,15 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
64
65 spin_lock_irqsave(&priv->lock, flags);
66
67- path = __path_find(dev, phdr->hwaddr + 4);
68+ path = __path_find(dev, cb->hwaddr + 4);
69 if (!path || !path->valid) {
70 int new_path = 0;
71
72 if (!path) {
73- path = path_rec_create(dev, phdr->hwaddr + 4);
74+ path = path_rec_create(dev, cb->hwaddr + 4);
75 new_path = 1;
76 }
77 if (path) {
78- /* put pseudoheader back on for next time */
79- skb_push(skb, sizeof *phdr);
80 __skb_queue_tail(&path->queue, skb);
81
82 if (!path->query && path_rec_start(dev, path)) {
83@@ -700,12 +698,10 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
84 be16_to_cpu(path->pathrec.dlid));
85
86 spin_unlock_irqrestore(&priv->lock, flags);
87- ipoib_send(dev, skb, path->ah, IPOIB_QPN(phdr->hwaddr));
88+ ipoib_send(dev, skb, path->ah, IPOIB_QPN(cb->hwaddr));
89 return;
90 } else if ((path->query || !path_rec_start(dev, path)) &&
91 skb_queue_len(&path->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
92- /* put pseudoheader back on for next time */
93- skb_push(skb, sizeof *phdr);
94 __skb_queue_tail(&path->queue, skb);
95 } else {
96 ++dev->stats.tx_dropped;
97@@ -774,16 +770,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
98 dev_kfree_skb_any(skb);
99 }
100 } else {
101- struct ipoib_pseudoheader *phdr =
102- (struct ipoib_pseudoheader *) skb->data;
103- skb_pull(skb, sizeof *phdr);
104+ struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
105
106- if (phdr->hwaddr[4] == 0xff) {
107+ if (cb->hwaddr[4] == 0xff) {
108 /* Add in the P_Key for multicast*/
109- phdr->hwaddr[8] = (priv->pkey >> 8) & 0xff;
110- phdr->hwaddr[9] = priv->pkey & 0xff;
111+ cb->hwaddr[8] = (priv->pkey >> 8) & 0xff;
112+ cb->hwaddr[9] = priv->pkey & 0xff;
113
114- ipoib_mcast_send(dev, phdr->hwaddr + 4, skb);
115+ ipoib_mcast_send(dev, cb->hwaddr + 4, skb);
116 } else {
117 /* unicast GID -- should be ARP or RARP reply */
118
119@@ -792,14 +786,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
120 ipoib_warn(priv, "Unicast, no %s: type %04x, QPN %06x %pI6\n",
121 skb_dst(skb) ? "neigh" : "dst",
122 be16_to_cpup((__be16 *) skb->data),
123- IPOIB_QPN(phdr->hwaddr),
124- phdr->hwaddr + 4);
125+ IPOIB_QPN(cb->hwaddr),
126+ cb->hwaddr + 4);
127 dev_kfree_skb_any(skb);
128 ++dev->stats.tx_dropped;
129 goto unlock;
130 }
131
132- unicast_arp_send(skb, dev, phdr);
133+ unicast_arp_send(skb, dev, cb);
134 }
135 }
136 unlock:
137@@ -825,8 +819,6 @@ static int ipoib_hard_header(struct sk_buff *skb,
138 const void *daddr, const void *saddr, unsigned len)
139 {
140 struct ipoib_header *header;
141- struct dst_entry *dst;
142- struct neighbour *n;
143
144 header = (struct ipoib_header *) skb_push(skb, sizeof *header);
145
146@@ -834,18 +826,13 @@ static int ipoib_hard_header(struct sk_buff *skb,
147 header->reserved = 0;
148
149 /*
150- * If we don't have a neighbour structure, stuff the
151- * destination address onto the front of the skb so we can
152- * figure out where to send the packet later.
153+ * If we don't have a dst_entry structure, stuff the
154+ * destination address into skb->cb so we can figure out where
155+ * to send the packet later.
156 */
157- dst = skb_dst(skb);
158- n = NULL;
159- if (dst)
160- n = dst_get_neighbour_raw(dst);
161- if ((!dst || !n) && daddr) {
162- struct ipoib_pseudoheader *phdr =
163- (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
164- memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
165+ if (!skb_dst(skb)) {
166+ struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
167+ memcpy(cb->hwaddr, daddr, INFINIBAND_ALEN);
168 }
169
170 return 0;
171@@ -1021,11 +1008,7 @@ static void ipoib_setup(struct net_device *dev)
172
173 dev->flags |= IFF_BROADCAST | IFF_MULTICAST;
174
175- /*
176- * We add in INFINIBAND_ALEN to allow for the destination
177- * address "pseudoheader" for skbs without neighbour struct.
178- */
179- dev->hard_header_len = IPOIB_ENCAP_LEN + INFINIBAND_ALEN;
180+ dev->hard_header_len = IPOIB_ENCAP_LEN;
181 dev->addr_len = INFINIBAND_ALEN;
182 dev->type = ARPHRD_INFINIBAND;
183 dev->tx_queue_len = ipoib_sendq_size * 2;
184diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
185index 873bff9..e5069b4 100644
186--- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
187+++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
188@@ -262,21 +262,14 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
189 netif_tx_lock_bh(dev);
190 while (!skb_queue_empty(&mcast->pkt_queue)) {
191 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
192- struct dst_entry *dst = skb_dst(skb);
193- struct neighbour *n = NULL;
194
195 netif_tx_unlock_bh(dev);
196
197 skb->dev = dev;
198- if (dst)
199- n = dst_get_neighbour_raw(dst);
200- if (!dst || !n) {
201- /* put pseudoheader back on for next time */
202- skb_push(skb, sizeof (struct ipoib_pseudoheader));
203- }
204
205 if (dev_queue_xmit(skb))
206 ipoib_warn(priv, "dev_queue_xmit failed to requeue packet\n");
207+
208 netif_tx_lock_bh(dev);
209 }
210 netif_tx_unlock_bh(dev);
211--
2121.7.7.4
213
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0031-gro-more-generic-L2-header-check.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0031-gro-more-generic-L2-header-check.patch
new file mode 100644
index 00000000..7314b141
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0031-gro-more-generic-L2-header-check.patch
@@ -0,0 +1,61 @@
1From 156f251f74fc547065adc2aef8955f70f3237a71 Mon Sep 17 00:00:00 2001
2From: Eric Dumazet <eric.dumazet@gmail.com>
3Date: Wed, 8 Feb 2012 08:51:50 +0000
4Subject: [PATCH 31/73] gro: more generic L2 header check
5
6[ Upstream commit 5ca3b72c5da47d95b83857b768def6172fbc080a ]
7
8Shlomo Pongratz reported GRO L2 header check was suited for Ethernet
9only, and failed on IB/ipoib traffic.
10
11He provided a patch faking a zeroed header to let GRO aggregates frames.
12
13Roland Dreier, Herbert Xu, and others suggested we change GRO L2 header
14check to be more generic, ie not assuming L2 header is 14 bytes, but
15taking into account hard_header_len.
16
17__napi_gro_receive() has special handling for the common case (Ethernet)
18to avoid a memcmp() call and use an inline optimized function instead.
19
20Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
21Reported-by: Shlomo Pongratz <shlomop@mellanox.com>
22Cc: Roland Dreier <roland@kernel.org>
23Cc: Or Gerlitz <ogerlitz@mellanox.com>
24Cc: Herbert Xu <herbert@gondor.apana.org.au>
25Tested-by: Sean Hefty <sean.hefty@intel.com>
26Signed-off-by: David S. Miller <davem@davemloft.net>
27Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
28---
29 net/core/dev.c | 10 ++++++++--
30 1 files changed, 8 insertions(+), 2 deletions(-)
31
32diff --git a/net/core/dev.c b/net/core/dev.c
33index 5a13edf..c56cacf 100644
34--- a/net/core/dev.c
35+++ b/net/core/dev.c
36@@ -3565,14 +3565,20 @@ static inline gro_result_t
37 __napi_gro_receive(struct napi_struct *napi, struct sk_buff *skb)
38 {
39 struct sk_buff *p;
40+ unsigned int maclen = skb->dev->hard_header_len;
41
42 for (p = napi->gro_list; p; p = p->next) {
43 unsigned long diffs;
44
45 diffs = (unsigned long)p->dev ^ (unsigned long)skb->dev;
46 diffs |= p->vlan_tci ^ skb->vlan_tci;
47- diffs |= compare_ether_header(skb_mac_header(p),
48- skb_gro_mac_header(skb));
49+ if (maclen == ETH_HLEN)
50+ diffs |= compare_ether_header(skb_mac_header(p),
51+ skb_gro_mac_header(skb));
52+ else if (!diffs)
53+ diffs = memcmp(skb_mac_header(p),
54+ skb_gro_mac_header(skb),
55+ maclen);
56 NAPI_GRO_CB(p)->same_flow = !diffs;
57 NAPI_GRO_CB(p)->flush = 0;
58 }
59--
601.7.7.4
61
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0032-tcp-allow-tcp_sacktag_one-to-tag-ranges-not-aligned-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0032-tcp-allow-tcp_sacktag_one-to-tag-ranges-not-aligned-.patch
new file mode 100644
index 00000000..5e48952a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0032-tcp-allow-tcp_sacktag_one-to-tag-ranges-not-aligned-.patch
@@ -0,0 +1,119 @@
1From aaa9bcd96008a3d7879c3a679625c7ff61b6360b Mon Sep 17 00:00:00 2001
2From: Neal Cardwell <ncardwell@google.com>
3Date: Sun, 12 Feb 2012 18:37:09 +0000
4Subject: [PATCH 32/73] tcp: allow tcp_sacktag_one() to tag ranges not aligned
5 with skbs
6
7[ Upstream commit cc9a672ee522d4805495b98680f4a3db5d0a0af9 ]
8
9This commit allows callers of tcp_sacktag_one() to pass in sequence
10ranges that do not align with skb boundaries, as tcp_shifted_skb()
11needs to do in an upcoming fix in this patch series.
12
13In fact, now tcp_sacktag_one() does not need to depend on an input skb
14at all, which makes its semantics and dependencies more clear.
15
16Signed-off-by: Neal Cardwell <ncardwell@google.com>
17Signed-off-by: David S. Miller <davem@davemloft.net>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 net/ipv4/tcp_input.c | 36 ++++++++++++++++++++++--------------
21 1 files changed, 22 insertions(+), 14 deletions(-)
22
23diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
24index 52b5c2d..41440f1 100644
25--- a/net/ipv4/tcp_input.c
26+++ b/net/ipv4/tcp_input.c
27@@ -1310,25 +1310,26 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
28 return in_sack;
29 }
30
31-static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
32- struct tcp_sacktag_state *state,
33+/* Mark the given newly-SACKed range as such, adjusting counters and hints. */
34+static u8 tcp_sacktag_one(struct sock *sk,
35+ struct tcp_sacktag_state *state, u8 sacked,
36+ u32 start_seq, u32 end_seq,
37 int dup_sack, int pcount)
38 {
39 struct tcp_sock *tp = tcp_sk(sk);
40- u8 sacked = TCP_SKB_CB(skb)->sacked;
41 int fack_count = state->fack_count;
42
43 /* Account D-SACK for retransmitted packet. */
44 if (dup_sack && (sacked & TCPCB_RETRANS)) {
45 if (tp->undo_marker && tp->undo_retrans &&
46- after(TCP_SKB_CB(skb)->end_seq, tp->undo_marker))
47+ after(end_seq, tp->undo_marker))
48 tp->undo_retrans--;
49 if (sacked & TCPCB_SACKED_ACKED)
50 state->reord = min(fack_count, state->reord);
51 }
52
53 /* Nothing to do; acked frame is about to be dropped (was ACKed). */
54- if (!after(TCP_SKB_CB(skb)->end_seq, tp->snd_una))
55+ if (!after(end_seq, tp->snd_una))
56 return sacked;
57
58 if (!(sacked & TCPCB_SACKED_ACKED)) {
59@@ -1347,13 +1348,13 @@ static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
60 /* New sack for not retransmitted frame,
61 * which was in hole. It is reordering.
62 */
63- if (before(TCP_SKB_CB(skb)->seq,
64+ if (before(start_seq,
65 tcp_highest_sack_seq(tp)))
66 state->reord = min(fack_count,
67 state->reord);
68
69 /* SACK enhanced F-RTO (RFC4138; Appendix B) */
70- if (!after(TCP_SKB_CB(skb)->end_seq, tp->frto_highmark))
71+ if (!after(end_seq, tp->frto_highmark))
72 state->flag |= FLAG_ONLY_ORIG_SACKED;
73 }
74
75@@ -1371,8 +1372,7 @@ static u8 tcp_sacktag_one(const struct sk_buff *skb, struct sock *sk,
76
77 /* Lost marker hint past SACKed? Tweak RFC3517 cnt */
78 if (!tcp_is_fack(tp) && (tp->lost_skb_hint != NULL) &&
79- before(TCP_SKB_CB(skb)->seq,
80- TCP_SKB_CB(tp->lost_skb_hint)->seq))
81+ before(start_seq, TCP_SKB_CB(tp->lost_skb_hint)->seq))
82 tp->lost_cnt_hint += pcount;
83
84 if (fack_count > tp->fackets_out)
85@@ -1428,7 +1428,11 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
86 }
87
88 /* We discard results */
89- tcp_sacktag_one(skb, sk, state, dup_sack, pcount);
90+ tcp_sacktag_one(sk, state,
91+ TCP_SKB_CB(skb)->sacked,
92+ TCP_SKB_CB(skb)->seq,
93+ TCP_SKB_CB(skb)->end_seq,
94+ dup_sack, pcount);
95
96 /* Difference in this won't matter, both ACKed by the same cumul. ACK */
97 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
98@@ -1667,10 +1671,14 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
99 break;
100
101 if (in_sack) {
102- TCP_SKB_CB(skb)->sacked = tcp_sacktag_one(skb, sk,
103- state,
104- dup_sack,
105- tcp_skb_pcount(skb));
106+ TCP_SKB_CB(skb)->sacked =
107+ tcp_sacktag_one(sk,
108+ state,
109+ TCP_SKB_CB(skb)->sacked,
110+ TCP_SKB_CB(skb)->seq,
111+ TCP_SKB_CB(skb)->end_seq,
112+ dup_sack,
113+ tcp_skb_pcount(skb));
114
115 if (!before(TCP_SKB_CB(skb)->seq,
116 tcp_highest_sack_seq(tp)))
117--
1181.7.7.4
119
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0033-tcp-fix-range-tcp_shifted_skb-passes-to-tcp_sacktag_.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0033-tcp-fix-range-tcp_shifted_skb-passes-to-tcp_sacktag_.patch
new file mode 100644
index 00000000..8793f225
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0033-tcp-fix-range-tcp_shifted_skb-passes-to-tcp_sacktag_.patch
@@ -0,0 +1,77 @@
1From 85a90ef604578b9825d3b7e9d1e3a103357bb668 Mon Sep 17 00:00:00 2001
2From: Neal Cardwell <ncardwell@google.com>
3Date: Sun, 12 Feb 2012 18:37:10 +0000
4Subject: [PATCH 33/73] tcp: fix range tcp_shifted_skb() passes to
5 tcp_sacktag_one()
6
7[ Upstream commit daef52bab1fd26e24e8e9578f8fb33ba1d0cb412 ]
8
9Fix the newly-SACKed range to be the range of newly-shifted bytes.
10
11Previously - since 832d11c5cd076abc0aa1eaf7be96c81d1a59ce41 -
12tcp_shifted_skb() incorrectly called tcp_sacktag_one() with the start
13and end sequence numbers of the skb it passes in set to the range just
14beyond the range that is newly-SACKed.
15
16This commit also removes a special-case adjustment to lost_cnt_hint in
17tcp_shifted_skb() since the pre-existing adjustment of lost_cnt_hint
18in tcp_sacktag_one() now properly handles this things now that the
19correct start sequence number is passed in.
20
21Signed-off-by: Neal Cardwell <ncardwell@google.com>
22Signed-off-by: David S. Miller <davem@davemloft.net>
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24---
25 net/ipv4/tcp_input.c | 19 ++++++++++---------
26 1 files changed, 10 insertions(+), 9 deletions(-)
27
28diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
29index 41440f1..b16fbf3 100644
30--- a/net/ipv4/tcp_input.c
31+++ b/net/ipv4/tcp_input.c
32@@ -1391,6 +1391,9 @@ static u8 tcp_sacktag_one(struct sock *sk,
33 return sacked;
34 }
35
36+/* Shift newly-SACKed bytes from this skb to the immediately previous
37+ * already-SACKed sk_buff. Mark the newly-SACKed bytes as such.
38+ */
39 static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
40 struct tcp_sacktag_state *state,
41 unsigned int pcount, int shifted, int mss,
42@@ -1398,12 +1401,11 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
43 {
44 struct tcp_sock *tp = tcp_sk(sk);
45 struct sk_buff *prev = tcp_write_queue_prev(sk, skb);
46+ u32 start_seq = TCP_SKB_CB(skb)->seq; /* start of newly-SACKed */
47+ u32 end_seq = start_seq + shifted; /* end of newly-SACKed */
48
49 BUG_ON(!pcount);
50
51- if (skb == tp->lost_skb_hint)
52- tp->lost_cnt_hint += pcount;
53-
54 TCP_SKB_CB(prev)->end_seq += shifted;
55 TCP_SKB_CB(skb)->seq += shifted;
56
57@@ -1427,12 +1429,11 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
58 skb_shinfo(skb)->gso_type = 0;
59 }
60
61- /* We discard results */
62- tcp_sacktag_one(sk, state,
63- TCP_SKB_CB(skb)->sacked,
64- TCP_SKB_CB(skb)->seq,
65- TCP_SKB_CB(skb)->end_seq,
66- dup_sack, pcount);
67+ /* Adjust counters and hints for the newly sacked sequence range but
68+ * discard the return value since prev is already marked.
69+ */
70+ tcp_sacktag_one(sk, state, TCP_SKB_CB(skb)->sacked,
71+ start_seq, end_seq, dup_sack, pcount);
72
73 /* Difference in this won't matter, both ACKed by the same cumul. ACK */
74 TCP_SKB_CB(prev)->sacked |= (TCP_SKB_CB(skb)->sacked & TCPCB_EVER_RETRANS);
75--
761.7.7.4
77
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0034-tcp-fix-tcp_shifted_skb-adjustment-of-lost_cnt_hint-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0034-tcp-fix-tcp_shifted_skb-adjustment-of-lost_cnt_hint-.patch
new file mode 100644
index 00000000..12a891cb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0034-tcp-fix-tcp_shifted_skb-adjustment-of-lost_cnt_hint-.patch
@@ -0,0 +1,42 @@
1From c90fa02e73e931f959428385077213180f5c69eb Mon Sep 17 00:00:00 2001
2From: Neal Cardwell <ncardwell@google.com>
3Date: Mon, 13 Feb 2012 20:22:08 +0000
4Subject: [PATCH 34/73] tcp: fix tcp_shifted_skb() adjustment of lost_cnt_hint
5 for FACK
6
7[ Upstream commit 0af2a0d0576205dda778d25c6c344fc6508fc81d ]
8
9This commit ensures that lost_cnt_hint is correctly updated in
10tcp_shifted_skb() for FACK TCP senders. The lost_cnt_hint adjustment
11in tcp_sacktag_one() only applies to non-FACK senders, so FACK senders
12need their own adjustment.
13
14This applies the spirit of 1e5289e121372a3494402b1b131b41bfe1cf9b7f -
15except now that the sequence range passed into tcp_sacktag_one() is
16correct we need only have a special case adjustment for FACK.
17
18Signed-off-by: Neal Cardwell <ncardwell@google.com>
19Signed-off-by: David S. Miller <davem@davemloft.net>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 net/ipv4/tcp_input.c | 4 ++++
23 1 files changed, 4 insertions(+), 0 deletions(-)
24
25diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
26index b16fbf3..53113b9 100644
27--- a/net/ipv4/tcp_input.c
28+++ b/net/ipv4/tcp_input.c
29@@ -1406,6 +1406,10 @@ static int tcp_shifted_skb(struct sock *sk, struct sk_buff *skb,
30
31 BUG_ON(!pcount);
32
33+ /* Adjust hint for FACK. Non-FACK is handled in tcp_sacktag_one(). */
34+ if (tcp_is_fack(tp) && (skb == tp->lost_skb_hint))
35+ tp->lost_cnt_hint += pcount;
36+
37 TCP_SKB_CB(prev)->end_seq += shifted;
38 TCP_SKB_CB(skb)->seq += shifted;
39
40--
411.7.7.4
42
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0035-USB-Added-Kamstrup-VID-PIDs-to-cp210x-serial-driver.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0035-USB-Added-Kamstrup-VID-PIDs-to-cp210x-serial-driver.patch
new file mode 100644
index 00000000..30e69cf0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0035-USB-Added-Kamstrup-VID-PIDs-to-cp210x-serial-driver.patch
@@ -0,0 +1,29 @@
1From 4a2448683921f6bb770e934ff6ab78a6e2dc78cf Mon Sep 17 00:00:00 2001
2From: Bruno Thomsen <bruno.thomsen@gmail.com>
3Date: Tue, 21 Feb 2012 23:41:37 +0100
4Subject: [PATCH 35/73] USB: Added Kamstrup VID/PIDs to cp210x serial driver.
5
6commit c6c1e4491dc8d1ed2509fa6aacffa7f34614fc38 upstream.
7
8Signed-off-by: Bruno Thomsen <bruno.thomsen@gmail.com>
9Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
10---
11 drivers/usb/serial/cp210x.c | 2 ++
12 1 files changed, 2 insertions(+), 0 deletions(-)
13
14diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
15index a515237..33d25d4 100644
16--- a/drivers/usb/serial/cp210x.c
17+++ b/drivers/usb/serial/cp210x.c
18@@ -136,6 +136,8 @@ static const struct usb_device_id id_table[] = {
19 { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
20 { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
21 { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
22+ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
23+ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
24 { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
25 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
26 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
27--
281.7.7.4
29
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0036-USB-option-cleanup-zte-3g-dongle-s-pid-in-option.c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0036-USB-option-cleanup-zte-3g-dongle-s-pid-in-option.c.patch
new file mode 100644
index 00000000..3c3862b0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0036-USB-option-cleanup-zte-3g-dongle-s-pid-in-option.c.patch
@@ -0,0 +1,246 @@
1From 4cc383ba35be70d24fb7d43dd67f15f6ec3c7ebc Mon Sep 17 00:00:00 2001
2From: Rui li <li.rui27@zte.com.cn>
3Date: Tue, 14 Feb 2012 10:35:01 +0800
4Subject: [PATCH 36/73] USB: option: cleanup zte 3g-dongle's pid in option.c
5
6commit b9e44fe5ecda4158c22bc1ea4bffa378a4f83f65 upstream.
7
8 1. Remove all old mass-storage ids's pid:
9 0x0026,0x0053,0x0098,0x0099,0x0149,0x0150,0x0160;
10 2. As the pid from 0x1401 to 0x1510 which have not surely assigned to
11 use for serial-port or mass-storage port,so i think it should be
12 removed now, and will re-add after it have assigned in future;
13 3. sort the pid to WCDMA and CDMA.
14
15Signed-off-by: Rui li <li.rui27@zte.com.cn>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/usb/serial/option.c | 143 ++++---------------------------------------
19 1 files changed, 13 insertions(+), 130 deletions(-)
20
21diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
22index 338d082..68fa8c7 100644
23--- a/drivers/usb/serial/option.c
24+++ b/drivers/usb/serial/option.c
25@@ -788,7 +788,6 @@ static const struct usb_device_id option_ids[] = {
26 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0012, 0xff, 0xff, 0xff),
27 .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
28 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0013, 0xff, 0xff, 0xff) },
29- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) },
30 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628, 0xff, 0xff, 0xff) },
31 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0016, 0xff, 0xff, 0xff) },
32 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0017, 0xff, 0xff, 0xff),
33@@ -803,7 +802,6 @@ static const struct usb_device_id option_ids[] = {
34 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0024, 0xff, 0xff, 0xff) },
35 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0025, 0xff, 0xff, 0xff),
36 .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
37- /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0026, 0xff, 0xff, 0xff) }, */
38 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0028, 0xff, 0xff, 0xff) },
39 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0029, 0xff, 0xff, 0xff) },
40 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0030, 0xff, 0xff, 0xff) },
41@@ -828,7 +826,6 @@ static const struct usb_device_id option_ids[] = {
42 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0051, 0xff, 0xff, 0xff) },
43 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0052, 0xff, 0xff, 0xff),
44 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
45- /* { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0053, 0xff, 0xff, 0xff) }, */
46 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0054, 0xff, 0xff, 0xff) },
47 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0055, 0xff, 0xff, 0xff),
48 .driver_info = (kernel_ulong_t)&net_intf1_blacklist },
49@@ -836,7 +833,6 @@ static const struct usb_device_id option_ids[] = {
50 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0057, 0xff, 0xff, 0xff) },
51 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0058, 0xff, 0xff, 0xff),
52 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
53- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
54 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0061, 0xff, 0xff, 0xff) },
55 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0062, 0xff, 0xff, 0xff) },
56 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0063, 0xff, 0xff, 0xff),
57@@ -846,7 +842,6 @@ static const struct usb_device_id option_ids[] = {
58 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0066, 0xff, 0xff, 0xff) },
59 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0067, 0xff, 0xff, 0xff) },
60 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0069, 0xff, 0xff, 0xff) },
61- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
62 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0076, 0xff, 0xff, 0xff) },
63 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0077, 0xff, 0xff, 0xff) },
64 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0078, 0xff, 0xff, 0xff) },
65@@ -865,8 +860,6 @@ static const struct usb_device_id option_ids[] = {
66 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) },
67 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) },
68 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) },
69- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xff) },
70- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xff) },
71 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff),
72 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
73 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
74@@ -887,28 +880,18 @@ static const struct usb_device_id option_ids[] = {
75 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0143, 0xff, 0xff, 0xff) },
76 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0144, 0xff, 0xff, 0xff) },
77 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0145, 0xff, 0xff, 0xff) },
78- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0146, 0xff, 0xff, 0xff) },
79- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
80 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0148, 0xff, 0xff, 0xff) },
81- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0149, 0xff, 0xff, 0xff) },
82- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0150, 0xff, 0xff, 0xff) },
83 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) },
84- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
85 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) },
86 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) },
87 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
88 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) },
89 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0158, 0xff, 0xff, 0xff) },
90 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0159, 0xff, 0xff, 0xff) },
91- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
92 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
93 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
94 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) },
95 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
96- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
97- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
98- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
99- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
100 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
101 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
102 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
103@@ -1083,127 +1066,27 @@ static const struct usb_device_id option_ids[] = {
104 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
105 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
106 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
107- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff) },
108- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff) },
109- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xff) },
110- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xff) },
111- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xff) },
112- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xff) },
113- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xff) },
114- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xff) },
115- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xff) },
116- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xff) },
117- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xff) },
118- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xff) },
119- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xff) },
120- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xff) },
121- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xff) },
122- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xff) },
123- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xff) },
124- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xff) },
125- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xff) },
126- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xff) },
127- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xff) },
128- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xff) },
129- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xff) },
130- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff) },
131- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff) },
132- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff) },
133- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xff) },
134- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff) },
135- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xff) },
136- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xff) },
137- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xff) },
138- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xff) },
139- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xff) },
140- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xff) },
141- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xff) },
142- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xff) },
143- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xff) },
144- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xff) },
145- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xff) },
146- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xff) },
147- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xff) },
148- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xff) },
149- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xff) },
150- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xff) },
151- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xff) },
152- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xff) },
153- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xff) },
154- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xff) },
155- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xff) },
156- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xff) },
157- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xff) },
158- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xff) },
159- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xff) },
160- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xff) },
161- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xff) },
162- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xff) },
163- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xff) },
164- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xff) },
165- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xff) },
166- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xff) },
167- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xff) },
168- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xff) },
169- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xff) },
170- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xff) },
171- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xff) },
172- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xff) },
173- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xff) },
174- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xff) },
175- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xff) },
176- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xff) },
177- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xff) },
178- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xff) },
179- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xff) },
180- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xff) },
181- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xff) },
182- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xff) },
183- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xff) },
184- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xff) },
185- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xff) },
186- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xff) },
187- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xff) },
188- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xff) },
189- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xff) },
190- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xff) },
191- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff) },
192- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xff) },
193- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xff) },
194- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xff) },
195- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xff) },
196- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xff) },
197- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xff) },
198- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xff) },
199- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xff) },
200- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xff) },
201- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xff) },
202- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xff) },
203- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xff) },
204- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xff) },
205- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xff) },
206- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xff) },
207- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xff) },
208- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xff) },
209- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xff) },
210- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xff) },
211- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xff) },
212- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xff) },
213- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xff) },
214- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xff) },
215- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xff) },
216- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xff) },
217+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
218+ 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
219+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
220+
221 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
222 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
223 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
224 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0060, 0xff, 0xff, 0xff) },
225 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0070, 0xff, 0xff, 0xff) },
226 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0073, 0xff, 0xff, 0xff) },
227+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
228 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0130, 0xff, 0xff, 0xff) },
229+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0133, 0xff, 0xff, 0xff) },
230 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0141, 0xff, 0xff, 0xff) },
231- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2002, 0xff,
232- 0xff, 0xff), .driver_info = (kernel_ulong_t)&zte_k3765_z_blacklist },
233- { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x2003, 0xff, 0xff, 0xff) },
234+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0147, 0xff, 0xff, 0xff) },
235+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
236+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
237+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
238+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
239+ { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
240+
241 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH, 0xff, 0xff, 0xff) },
242 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
243 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
244--
2451.7.7.4
246
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0037-USB-Serial-ti_usb_3410_5052-Add-Abbot-Diabetes-Care-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0037-USB-Serial-ti_usb_3410_5052-Add-Abbot-Diabetes-Care-.patch
new file mode 100644
index 00000000..cb9491de
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0037-USB-Serial-ti_usb_3410_5052-Add-Abbot-Diabetes-Care-.patch
@@ -0,0 +1,76 @@
1From f891ac47c26ed3a7efcf4bd641590e54869cd37e Mon Sep 17 00:00:00 2001
2From: Andrew Lunn <andrew@lunn.ch>
3Date: Mon, 20 Feb 2012 09:31:57 +0100
4Subject: [PATCH 37/73] USB: Serial: ti_usb_3410_5052: Add Abbot Diabetes Care
5 cable id
6
7commit 7fd25702ba616d9ba56e2a625472f29e5aff25ee upstream.
8
9This USB-serial cable with mini stereo jack enumerates as:
10Bus 001 Device 004: ID 1a61:3410 Abbott Diabetes Care
11
12It is a TI3410 inside.
13
14Signed-off-by: Andrew Lunn <andrew@lunn.ch>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 drivers/usb/serial/ti_usb_3410_5052.c | 6 ++++--
18 drivers/usb/serial/ti_usb_3410_5052.h | 4 ++++
19 2 files changed, 8 insertions(+), 2 deletions(-)
20
21diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
22index ea84456..21c82b0 100644
23--- a/drivers/usb/serial/ti_usb_3410_5052.c
24+++ b/drivers/usb/serial/ti_usb_3410_5052.c
25@@ -165,7 +165,7 @@ static unsigned int product_5052_count;
26 /* the array dimension is the number of default entries plus */
27 /* TI_EXTRA_VID_PID_COUNT user defined entries plus 1 terminating */
28 /* null entry */
29-static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = {
30+static struct usb_device_id ti_id_table_3410[14+TI_EXTRA_VID_PID_COUNT+1] = {
31 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
32 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
33 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
34@@ -179,6 +179,7 @@ static struct usb_device_id ti_id_table_3410[13+TI_EXTRA_VID_PID_COUNT+1] = {
35 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
36 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
37 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
38+ { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
39 };
40
41 static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
42@@ -188,7 +189,7 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
43 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
44 };
45
46-static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1] = {
47+static struct usb_device_id ti_id_table_combined[18+2*TI_EXTRA_VID_PID_COUNT+1] = {
48 { USB_DEVICE(TI_VENDOR_ID, TI_3410_PRODUCT_ID) },
49 { USB_DEVICE(TI_VENDOR_ID, TI_3410_EZ430_ID) },
50 { USB_DEVICE(MTS_VENDOR_ID, MTS_GSM_NO_FW_PRODUCT_ID) },
51@@ -206,6 +207,7 @@ static struct usb_device_id ti_id_table_combined[17+2*TI_EXTRA_VID_PID_COUNT+1]
52 { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
53 { USB_DEVICE(IBM_VENDOR_ID, IBM_454B_PRODUCT_ID) },
54 { USB_DEVICE(IBM_VENDOR_ID, IBM_454C_PRODUCT_ID) },
55+ { USB_DEVICE(ABBOTT_VENDOR_ID, ABBOTT_PRODUCT_ID) },
56 { }
57 };
58
59diff --git a/drivers/usb/serial/ti_usb_3410_5052.h b/drivers/usb/serial/ti_usb_3410_5052.h
60index 2aac195..f140f1b 100644
61--- a/drivers/usb/serial/ti_usb_3410_5052.h
62+++ b/drivers/usb/serial/ti_usb_3410_5052.h
63@@ -49,6 +49,10 @@
64 #define MTS_MT9234ZBA_PRODUCT_ID 0xF115
65 #define MTS_MT9234ZBAOLD_PRODUCT_ID 0x0319
66
67+/* Abbott Diabetics vendor and product ids */
68+#define ABBOTT_VENDOR_ID 0x1a61
69+#define ABBOTT_PRODUCT_ID 0x3410
70+
71 /* Commands */
72 #define TI_GET_VERSION 0x01
73 #define TI_GET_PORT_STATUS 0x02
74--
751.7.7.4
76
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0038-USB-Remove-duplicate-USB-3.0-hub-feature-defines.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0038-USB-Remove-duplicate-USB-3.0-hub-feature-defines.patch
new file mode 100644
index 00000000..cbdabc2f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0038-USB-Remove-duplicate-USB-3.0-hub-feature-defines.patch
@@ -0,0 +1,74 @@
1From d8c3ee4541529fe177c8afac31b890a7c2adecfd Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Thu, 5 Jan 2012 16:28:54 -0800
4Subject: [PATCH 38/73] USB: Remove duplicate USB 3.0 hub feature #defines.
5
6commit d9f5343e35d9138432657202afa8e3ddb2ade360 upstream.
7
8Somehow we ended up with duplicate hub feature #defines in ch11.h.
9Tatyana Brokhman first created the USB 3.0 hub feature macros in 2.6.38
10with commit 0eadcc09203349b11ca477ec367079b23d32ab91 "usb: USB3.0 ch11
11definitions". In 2.6.39, I modified a patch from John Youn that added
12similar macros in a different place in the same file, and committed
13dbe79bbe9dcb22cb3651c46f18943477141ca452 "USB 3.0 Hub Changes".
14
15Some of the #defines used different names for the same values. Others
16used exactly the same names with the same values, like these gems:
17
18 #define USB_PORT_FEAT_BH_PORT_RESET 28
19...
20 #define USB_PORT_FEAT_BH_PORT_RESET 28
21
22According to my very geeky husband (who looked it up in the C99 spec),
23it is allowed to have object-like macros with duplicate names as long as
24the replacement list is exactly the same. However, he recalled that
25some compilers will give warnings when they find duplicate macros. It's
26probably best to remove the duplicates in the stable tree, so that the
27code compiles for everyone.
28
29The macros are now fixed to move the feature requests that are specific
30to USB 3.0 hubs into a new section (out of the USB 2.0 hub feature
31section), and use the most common macro name.
32
33This patch should be backported to 2.6.39.
34
35Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
36Cc: Tatyana Brokhman <tlinder@codeaurora.org>
37Cc: John Youn <johnyoun@synopsys.com>
38Cc: Jamey Sharp <jamey@minilop.net>
39Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
40---
41 include/linux/usb/ch11.h | 10 ++--------
42 1 files changed, 2 insertions(+), 8 deletions(-)
43
44diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
45index 4ebaf08..1eb735b 100644
46--- a/include/linux/usb/ch11.h
47+++ b/include/linux/usb/ch11.h
48@@ -62,12 +62,6 @@
49 #define USB_PORT_FEAT_TEST 21
50 #define USB_PORT_FEAT_INDICATOR 22
51 #define USB_PORT_FEAT_C_PORT_L1 23
52-#define USB_PORT_FEAT_C_PORT_LINK_STATE 25
53-#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26
54-#define USB_PORT_FEAT_PORT_REMOTE_WAKE_MASK 27
55-#define USB_PORT_FEAT_BH_PORT_RESET 28
56-#define USB_PORT_FEAT_C_BH_PORT_RESET 29
57-#define USB_PORT_FEAT_FORCE_LINKPM_ACCEPT 30
58
59 /*
60 * Port feature selectors added by USB 3.0 spec.
61@@ -76,8 +70,8 @@
62 #define USB_PORT_FEAT_LINK_STATE 5
63 #define USB_PORT_FEAT_U1_TIMEOUT 23
64 #define USB_PORT_FEAT_U2_TIMEOUT 24
65-#define USB_PORT_FEAT_C_LINK_STATE 25
66-#define USB_PORT_FEAT_C_CONFIG_ERR 26
67+#define USB_PORT_FEAT_C_PORT_LINK_STATE 25
68+#define USB_PORT_FEAT_C_PORT_CONFIG_ERROR 26
69 #define USB_PORT_FEAT_REMOTE_WAKE_MASK 27
70 #define USB_PORT_FEAT_BH_PORT_RESET 28
71 #define USB_PORT_FEAT_C_BH_PORT_RESET 29
72--
731.7.7.4
74
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch
new file mode 100644
index 00000000..f8484578
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0039-USB-Fix-handoff-when-BIOS-disables-host-PCI-device.patch
@@ -0,0 +1,69 @@
1From 6dc2acf66f46c7aee7ae6617612fcf32fc6b0de5 Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Tue, 7 Feb 2012 15:11:46 -0800
4Subject: [PATCH 39/73] USB: Fix handoff when BIOS disables host PCI device.
5
6commit cab928ee1f221c9cc48d6615070fefe2e444384a upstream.
7
8On some systems with an Intel Panther Point xHCI host controller, the
9BIOS disables the xHCI PCI device during boot, and switches the xHCI
10ports over to EHCI. This allows the BIOS to access USB devices without
11having xHCI support.
12
13The downside is that the xHCI BIOS handoff mechanism will fail because
14memory mapped I/O is not enabled for the disabled PCI device.
15Jesse Barnes says this is expected behavior. The PCI core will enable
16BARs before quirks run, but it will leave it in an undefined state, and
17it may not have memory mapped I/O enabled.
18
19Make the generic USB quirk handler call pci_enable_device() to re-enable
20MMIO, and call pci_disable_device() once the host-specific BIOS handoff
21is finished. This will balance the ref counts in the PCI core. When
22the PCI probe function is called, usb_hcd_pci_probe() will call
23pci_enable_device() again.
24
25This should be back ported to kernels as old as 2.6.31. That was the
26first kernel with xHCI support, and no one has complained about BIOS
27handoffs failing due to memory mapped I/O being disabled on other hosts
28(EHCI, UHCI, or OHCI).
29
30Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
31Acked-by: Oliver Neukum <oneukum@suse.de>
32Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
33Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
34---
35 drivers/usb/host/pci-quirks.c | 11 +++++++++++
36 1 files changed, 11 insertions(+), 0 deletions(-)
37
38diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
39index ac53a66..7732d69 100644
40--- a/drivers/usb/host/pci-quirks.c
41+++ b/drivers/usb/host/pci-quirks.c
42@@ -872,7 +872,17 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
43 */
44 if (pdev->vendor == 0x184e) /* vendor Netlogic */
45 return;
46+ if (pdev->class != PCI_CLASS_SERIAL_USB_UHCI &&
47+ pdev->class != PCI_CLASS_SERIAL_USB_OHCI &&
48+ pdev->class != PCI_CLASS_SERIAL_USB_EHCI &&
49+ pdev->class != PCI_CLASS_SERIAL_USB_XHCI)
50+ return;
51
52+ if (pci_enable_device(pdev) < 0) {
53+ dev_warn(&pdev->dev, "Can't enable PCI device, "
54+ "BIOS handoff failed.\n");
55+ return;
56+ }
57 if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
58 quirk_usb_handoff_uhci(pdev);
59 else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
60@@ -881,5 +891,6 @@ static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
61 quirk_usb_disable_ehci(pdev);
62 else if (pdev->class == PCI_CLASS_SERIAL_USB_XHCI)
63 quirk_usb_handoff_xhci(pdev);
64+ pci_disable_device(pdev);
65 }
66 DECLARE_PCI_FIXUP_FINAL(PCI_ANY_ID, PCI_ANY_ID, quirk_usb_early_handoff);
67--
681.7.7.4
69
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0040-xhci-Fix-oops-caused-by-more-USB2-ports-than-USB3-po.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0040-xhci-Fix-oops-caused-by-more-USB2-ports-than-USB3-po.patch
new file mode 100644
index 00000000..a6470edc
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0040-xhci-Fix-oops-caused-by-more-USB2-ports-than-USB3-po.patch
@@ -0,0 +1,39 @@
1From 60e1345a34208c8024e01dc7481e090737720d90 Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Thu, 9 Feb 2012 14:43:44 -0800
4Subject: [PATCH 40/73] xhci: Fix oops caused by more USB2 ports than USB3
5 ports.
6
7commit 3278a55a1aebe2bbd47fbb5196209e5326a88b56 upstream.
8
9The code to set the device removable bits in the USB 2.0 roothub
10descriptor was accidentally looking at the USB 3.0 port registers
11instead of the USB 2.0 registers. This can cause an oops if there are
12more USB 2.0 registers than USB 3.0 registers.
13
14This should be backported to kernels as old as 2.6.39, that contain the
15commit 4bbb0ace9a3de8392527e3c87926309d541d3b00 "xhci: Return a USB 3.0
16hub descriptor for USB3 roothub."
17
18Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
19Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
20---
21 drivers/usb/host/xhci-hub.c | 2 +-
22 1 files changed, 1 insertions(+), 1 deletions(-)
23
24diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
25index 430e88f..a8b2980 100644
26--- a/drivers/usb/host/xhci-hub.c
27+++ b/drivers/usb/host/xhci-hub.c
28@@ -95,7 +95,7 @@ static void xhci_usb2_hub_descriptor(struct usb_hcd *hcd, struct xhci_hcd *xhci,
29 */
30 memset(port_removable, 0, sizeof(port_removable));
31 for (i = 0; i < ports; i++) {
32- portsc = xhci_readl(xhci, xhci->usb3_ports[i]);
33+ portsc = xhci_readl(xhci, xhci->usb2_ports[i]);
34 /* If a device is removable, PORTSC reports a 0, same as in the
35 * hub descriptor DeviceRemovable bits.
36 */
37--
381.7.7.4
39
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0041-xhci-Fix-encoding-for-HS-bulk-control-NAK-rate.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0041-xhci-Fix-encoding-for-HS-bulk-control-NAK-rate.patch
new file mode 100644
index 00000000..79b724db
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0041-xhci-Fix-encoding-for-HS-bulk-control-NAK-rate.patch
@@ -0,0 +1,98 @@
1From 0eec53088be92edf907c345ff96d94059d89f124 Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Mon, 13 Feb 2012 14:42:11 -0800
4Subject: [PATCH 41/73] xhci: Fix encoding for HS bulk/control NAK rate.
5
6commit 340a3504fd39dad753ba908fb6f894ee81fc3ae2 upstream.
7
8The xHCI 0.96 spec says that HS bulk and control endpoint NAK rate must
9be encoded as an exponent of two number of microframes. The endpoint
10descriptor has the NAK rate encoded in number of microframes. We were
11just copying the value from the endpoint descriptor into the endpoint
12context interval field, which was not correct. This lead to the VIA
13host rejecting the add of a bulk OUT endpoint from any USB 2.0 mass
14storage device.
15
16The fix is to use the correct encoding. Refactor the code to convert
17number of frames to an exponential number of microframes, and make sure
18we convert the number of microframes in HS bulk and control endpoints to
19an exponent.
20
21This should be back ported to kernels as old as 2.6.31, that contain the
22commit dfa49c4ad120a784ef1ff0717168aa79f55a483a "USB: xhci - fix math
23in xhci_get_endpoint_interval"
24
25Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
26Tested-by: Felipe Contreras <felipe.contreras@gmail.com>
27Suggested-by: Andiry Xu <andiry.xu@amd.com>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 drivers/usb/host/xhci-mem.c | 32 ++++++++++++++++++++++++--------
31 1 files changed, 24 insertions(+), 8 deletions(-)
32
33diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
34index 0e4b25f..c69cf54 100644
35--- a/drivers/usb/host/xhci-mem.c
36+++ b/drivers/usb/host/xhci-mem.c
37@@ -1140,26 +1140,42 @@ static unsigned int xhci_parse_exponent_interval(struct usb_device *udev,
38 }
39
40 /*
41- * Convert bInterval expressed in frames (in 1-255 range) to exponent of
42+ * Convert bInterval expressed in microframes (in 1-255 range) to exponent of
43 * microframes, rounded down to nearest power of 2.
44 */
45-static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
46- struct usb_host_endpoint *ep)
47+static unsigned int xhci_microframes_to_exponent(struct usb_device *udev,
48+ struct usb_host_endpoint *ep, unsigned int desc_interval,
49+ unsigned int min_exponent, unsigned int max_exponent)
50 {
51 unsigned int interval;
52
53- interval = fls(8 * ep->desc.bInterval) - 1;
54- interval = clamp_val(interval, 3, 10);
55- if ((1 << interval) != 8 * ep->desc.bInterval)
56+ interval = fls(desc_interval) - 1;
57+ interval = clamp_val(interval, min_exponent, max_exponent);
58+ if ((1 << interval) != desc_interval)
59 dev_warn(&udev->dev,
60 "ep %#x - rounding interval to %d microframes, ep desc says %d microframes\n",
61 ep->desc.bEndpointAddress,
62 1 << interval,
63- 8 * ep->desc.bInterval);
64+ desc_interval);
65
66 return interval;
67 }
68
69+static unsigned int xhci_parse_microframe_interval(struct usb_device *udev,
70+ struct usb_host_endpoint *ep)
71+{
72+ return xhci_microframes_to_exponent(udev, ep,
73+ ep->desc.bInterval, 0, 15);
74+}
75+
76+
77+static unsigned int xhci_parse_frame_interval(struct usb_device *udev,
78+ struct usb_host_endpoint *ep)
79+{
80+ return xhci_microframes_to_exponent(udev, ep,
81+ ep->desc.bInterval * 8, 3, 10);
82+}
83+
84 /* Return the polling or NAK interval.
85 *
86 * The polling interval is expressed in "microframes". If xHCI's Interval field
87@@ -1178,7 +1194,7 @@ static unsigned int xhci_get_endpoint_interval(struct usb_device *udev,
88 /* Max NAK rate */
89 if (usb_endpoint_xfer_control(&ep->desc) ||
90 usb_endpoint_xfer_bulk(&ep->desc)) {
91- interval = ep->desc.bInterval;
92+ interval = xhci_parse_microframe_interval(udev, ep);
93 break;
94 }
95 /* Fall through - SS and HS isoc/int have same decoding */
96--
971.7.7.4
98
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0042-USB-Don-t-fail-USB3-probe-on-missing-legacy-PCI-IRQ.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0042-USB-Don-t-fail-USB3-probe-on-missing-legacy-PCI-IRQ.patch
new file mode 100644
index 00000000..5f63bf74
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0042-USB-Don-t-fail-USB3-probe-on-missing-legacy-PCI-IRQ.patch
@@ -0,0 +1,80 @@
1From 4d5845033ef313d6d1008ac5dafe69dbab23cc11 Mon Sep 17 00:00:00 2001
2From: Sarah Sharp <sarah.a.sharp@linux.intel.com>
3Date: Mon, 13 Feb 2012 16:25:57 -0800
4Subject: [PATCH 42/73] USB: Don't fail USB3 probe on missing legacy PCI IRQ.
5
6commit 68d07f64b8a11a852d48d1b05b724c3e20c0d94b upstream.
7
8Intel has a PCI USB xhci host controller on a new platform. It doesn't
9have a line IRQ definition in BIOS. The Linux driver refuses to
10initialize this controller, but Windows works well because it only depends
11on MSI.
12
13Actually, Linux also can work for MSI. This patch avoids the line IRQ
14checking for USB3 HCDs in usb core PCI probe. It allows the xHCI driver
15to try to enable MSI or MSI-X first. It will fail the probe if MSI
16enabling failed and there's no legacy PCI IRQ.
17
18This patch should be backported to kernels as old as 2.6.32.
19
20Signed-off-by: Alex Shi <alex.shi@intel.com>
21Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
22Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23---
24 drivers/usb/core/hcd-pci.c | 5 ++++-
25 drivers/usb/core/hcd.c | 6 ++++--
26 drivers/usb/host/xhci.c | 5 +++++
27 3 files changed, 13 insertions(+), 3 deletions(-)
28
29diff --git a/drivers/usb/core/hcd-pci.c b/drivers/usb/core/hcd-pci.c
30index a004db3..61d08dd 100644
31--- a/drivers/usb/core/hcd-pci.c
32+++ b/drivers/usb/core/hcd-pci.c
33@@ -187,7 +187,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
34 return -ENODEV;
35 dev->current_state = PCI_D0;
36
37- if (!dev->irq) {
38+ /* The xHCI driver supports MSI and MSI-X,
39+ * so don't fail if the BIOS doesn't provide a legacy IRQ.
40+ */
41+ if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {
42 dev_err(&dev->dev,
43 "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
44 pci_name(dev));
45diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
46index 179e364..8cb9304 100644
47--- a/drivers/usb/core/hcd.c
48+++ b/drivers/usb/core/hcd.c
49@@ -2465,8 +2465,10 @@ int usb_add_hcd(struct usb_hcd *hcd,
50 && device_can_wakeup(&hcd->self.root_hub->dev))
51 dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
52
53- /* enable irqs just before we start the controller */
54- if (usb_hcd_is_primary_hcd(hcd)) {
55+ /* enable irqs just before we start the controller,
56+ * if the BIOS provides legacy PCI irqs.
57+ */
58+ if (usb_hcd_is_primary_hcd(hcd) && irqnum) {
59 retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);
60 if (retval)
61 goto err_request_irq;
62diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
63index b33f059..034f554 100644
64--- a/drivers/usb/host/xhci.c
65+++ b/drivers/usb/host/xhci.c
66@@ -352,6 +352,11 @@ static int xhci_try_enable_msi(struct usb_hcd *hcd)
67 /* hcd->irq is -1, we have MSI */
68 return 0;
69
70+ if (!pdev->irq) {
71+ xhci_err(xhci, "No msi-x/msi found and no IRQ in BIOS\n");
72+ return -EINVAL;
73+ }
74+
75 /* fall back to legacy interrupt*/
76 ret = request_irq(pdev->irq, &usb_hcd_irq, IRQF_SHARED,
77 hcd->irq_descr, hcd);
78--
791.7.7.4
80
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0043-USB-Set-hub-depth-after-USB3-hub-reset.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0043-USB-Set-hub-depth-after-USB3-hub-reset.patch
new file mode 100644
index 00000000..debbbc5e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0043-USB-Set-hub-depth-after-USB3-hub-reset.patch
@@ -0,0 +1,86 @@
1From 1a624979096199f383fc7785a509d1e38b608986 Mon Sep 17 00:00:00 2001
2From: Elric Fu <elricfu1@gmail.com>
3Date: Sat, 18 Feb 2012 13:32:27 +0800
4Subject: [PATCH 43/73] USB: Set hub depth after USB3 hub reset
5
6commit a45aa3b30583e7d54e7cf4fbcd0aa699348a6e5c upstream.
7
8The superspeed device attached to a USB 3.0 hub(such as VIA's)
9doesn't respond the address device command after resume. The
10root cause is the superspeed hub will miss the Hub Depth value
11that is used as an offset into the route string to locate the
12bits it uses to determine the downstream port number after
13reset, and all packets can't be routed to the device attached
14to the superspeed hub.
15
16Hub driver sends a Set Hub Depth request to the superspeed hub
17except for USB 3.0 root hub when the hub is initialized and
18doesn't send the request again after reset due to the resume
19process. So moving the code that sends the Set Hub Depth request
20to the superspeed hub from hub_configure() to hub_activate()
21is to cover those situations include initialization and reset.
22
23The patch should be backported to kernels as old as 2.6.39.
24
25Signed-off-by: Elric Fu <elricfu1@gmail.com>
26Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
27Acked-by: Alan Stern <stern@rowland.harvard.edu>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 drivers/usb/core/hub.c | 30 +++++++++++++++++-------------
31 1 files changed, 17 insertions(+), 13 deletions(-)
32
33diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
34index 7978146..bc06a8f 100644
35--- a/drivers/usb/core/hub.c
36+++ b/drivers/usb/core/hub.c
37@@ -705,10 +705,26 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
38 if (type == HUB_INIT3)
39 goto init3;
40
41- /* After a resume, port power should still be on.
42+ /* The superspeed hub except for root hub has to use Hub Depth
43+ * value as an offset into the route string to locate the bits
44+ * it uses to determine the downstream port number. So hub driver
45+ * should send a set hub depth request to superspeed hub after
46+ * the superspeed hub is set configuration in initialization or
47+ * reset procedure.
48+ *
49+ * After a resume, port power should still be on.
50 * For any other type of activation, turn it on.
51 */
52 if (type != HUB_RESUME) {
53+ if (hdev->parent && hub_is_superspeed(hdev)) {
54+ ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
55+ HUB_SET_DEPTH, USB_RT_HUB,
56+ hdev->level - 1, 0, NULL, 0,
57+ USB_CTRL_SET_TIMEOUT);
58+ if (ret < 0)
59+ dev_err(hub->intfdev,
60+ "set hub depth failed\n");
61+ }
62
63 /* Speed up system boot by using a delayed_work for the
64 * hub's initial power-up delays. This is pretty awkward
65@@ -987,18 +1003,6 @@ static int hub_configure(struct usb_hub *hub,
66 goto fail;
67 }
68
69- if (hub_is_superspeed(hdev) && (hdev->parent != NULL)) {
70- ret = usb_control_msg(hdev, usb_sndctrlpipe(hdev, 0),
71- HUB_SET_DEPTH, USB_RT_HUB,
72- hdev->level - 1, 0, NULL, 0,
73- USB_CTRL_SET_TIMEOUT);
74-
75- if (ret < 0) {
76- message = "can't set hub depth";
77- goto fail;
78- }
79- }
80-
81 /* Request the entire hub descriptor.
82 * hub->descriptor can handle USB_MAXCHILDREN ports,
83 * but the hub can/will return fewer bytes here.
84--
851.7.7.4
86
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0044-usb-storage-fix-freezing-of-the-scanning-thread.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0044-usb-storage-fix-freezing-of-the-scanning-thread.patch
new file mode 100644
index 00000000..731d030f
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0044-usb-storage-fix-freezing-of-the-scanning-thread.patch
@@ -0,0 +1,213 @@
1From 2ab9cc5409e9871927ef2799b41af3288cf7114c Mon Sep 17 00:00:00 2001
2From: Alan Stern <stern@rowland.harvard.edu>
3Date: Tue, 21 Feb 2012 13:16:32 -0500
4Subject: [PATCH 44/73] usb-storage: fix freezing of the scanning thread
5
6commit bb94a406682770a35305daaa241ccdb7cab399de upstream.
7
8This patch (as1521b) fixes the interaction between usb-storage's
9scanning thread and the freezer. The current implementation has a
10race: If the device is unplugged shortly after being plugged in and
11just as a system sleep begins, the scanning thread may get frozen
12before the khubd task. Khubd won't be able to freeze until the
13disconnect processing is complete, and the disconnect processing can't
14proceed until the scanning thread finishes, so the sleep transition
15will fail.
16
17The implementation in the 3.2 kernel suffers from an additional
18problem. There the scanning thread calls set_freezable_with_signal(),
19and the signals sent by the freezer will mess up the thread's I/O
20delays, which are all interruptible.
21
22The solution to both problems is the same: Replace the kernel thread
23used for scanning with a delayed-work routine on the system freezable
24work queue. Freezable work queues have the nice property that you can
25cancel a work item even while the work queue is frozen, and no signals
26are needed.
27
28The 3.2 version of this patch solves the problem in Bugzilla #42730.
29
30Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
31Acked-by: Seth Forshee <seth.forshee@canonical.com>
32Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
33---
34 drivers/usb/storage/usb.c | 89 ++++++++++++++++-----------------------------
35 drivers/usb/storage/usb.h | 7 ++--
36 2 files changed, 35 insertions(+), 61 deletions(-)
37
38diff --git a/drivers/usb/storage/usb.c b/drivers/usb/storage/usb.c
39index 9e069ef..db51ba1 100644
40--- a/drivers/usb/storage/usb.c
41+++ b/drivers/usb/storage/usb.c
42@@ -788,15 +788,19 @@ static void quiesce_and_remove_host(struct us_data *us)
43 struct Scsi_Host *host = us_to_host(us);
44
45 /* If the device is really gone, cut short reset delays */
46- if (us->pusb_dev->state == USB_STATE_NOTATTACHED)
47+ if (us->pusb_dev->state == USB_STATE_NOTATTACHED) {
48 set_bit(US_FLIDX_DISCONNECTING, &us->dflags);
49+ wake_up(&us->delay_wait);
50+ }
51
52- /* Prevent SCSI-scanning (if it hasn't started yet)
53- * and wait for the SCSI-scanning thread to stop.
54+ /* Prevent SCSI scanning (if it hasn't started yet)
55+ * or wait for the SCSI-scanning routine to stop.
56 */
57- set_bit(US_FLIDX_DONT_SCAN, &us->dflags);
58- wake_up(&us->delay_wait);
59- wait_for_completion(&us->scanning_done);
60+ cancel_delayed_work_sync(&us->scan_dwork);
61+
62+ /* Balance autopm calls if scanning was cancelled */
63+ if (test_bit(US_FLIDX_SCAN_PENDING, &us->dflags))
64+ usb_autopm_put_interface_no_suspend(us->pusb_intf);
65
66 /* Removing the host will perform an orderly shutdown: caches
67 * synchronized, disks spun down, etc.
68@@ -823,52 +827,28 @@ static void release_everything(struct us_data *us)
69 scsi_host_put(us_to_host(us));
70 }
71
72-/* Thread to carry out delayed SCSI-device scanning */
73-static int usb_stor_scan_thread(void * __us)
74+/* Delayed-work routine to carry out SCSI-device scanning */
75+static void usb_stor_scan_dwork(struct work_struct *work)
76 {
77- struct us_data *us = (struct us_data *)__us;
78+ struct us_data *us = container_of(work, struct us_data,
79+ scan_dwork.work);
80 struct device *dev = &us->pusb_intf->dev;
81
82- dev_dbg(dev, "device found\n");
83+ dev_dbg(dev, "starting scan\n");
84
85- set_freezable_with_signal();
86- /*
87- * Wait for the timeout to expire or for a disconnect
88- *
89- * We can't freeze in this thread or we risk causing khubd to
90- * fail to freeze, but we can't be non-freezable either. Nor can
91- * khubd freeze while waiting for scanning to complete as it may
92- * hold the device lock, causing a hang when suspending devices.
93- * So we request a fake signal when freezing and use
94- * interruptible sleep to kick us out of our wait early when
95- * freezing happens.
96- */
97- if (delay_use > 0) {
98- dev_dbg(dev, "waiting for device to settle "
99- "before scanning\n");
100- wait_event_interruptible_timeout(us->delay_wait,
101- test_bit(US_FLIDX_DONT_SCAN, &us->dflags),
102- delay_use * HZ);
103+ /* For bulk-only devices, determine the max LUN value */
104+ if (us->protocol == USB_PR_BULK && !(us->fflags & US_FL_SINGLE_LUN)) {
105+ mutex_lock(&us->dev_mutex);
106+ us->max_lun = usb_stor_Bulk_max_lun(us);
107+ mutex_unlock(&us->dev_mutex);
108 }
109+ scsi_scan_host(us_to_host(us));
110+ dev_dbg(dev, "scan complete\n");
111
112- /* If the device is still connected, perform the scanning */
113- if (!test_bit(US_FLIDX_DONT_SCAN, &us->dflags)) {
114-
115- /* For bulk-only devices, determine the max LUN value */
116- if (us->protocol == USB_PR_BULK &&
117- !(us->fflags & US_FL_SINGLE_LUN)) {
118- mutex_lock(&us->dev_mutex);
119- us->max_lun = usb_stor_Bulk_max_lun(us);
120- mutex_unlock(&us->dev_mutex);
121- }
122- scsi_scan_host(us_to_host(us));
123- dev_dbg(dev, "scan complete\n");
124-
125- /* Should we unbind if no devices were detected? */
126- }
127+ /* Should we unbind if no devices were detected? */
128
129 usb_autopm_put_interface(us->pusb_intf);
130- complete_and_exit(&us->scanning_done, 0);
131+ clear_bit(US_FLIDX_SCAN_PENDING, &us->dflags);
132 }
133
134 static unsigned int usb_stor_sg_tablesize(struct usb_interface *intf)
135@@ -915,7 +895,7 @@ int usb_stor_probe1(struct us_data **pus,
136 init_completion(&us->cmnd_ready);
137 init_completion(&(us->notify));
138 init_waitqueue_head(&us->delay_wait);
139- init_completion(&us->scanning_done);
140+ INIT_DELAYED_WORK(&us->scan_dwork, usb_stor_scan_dwork);
141
142 /* Associate the us_data structure with the USB device */
143 result = associate_dev(us, intf);
144@@ -946,7 +926,6 @@ EXPORT_SYMBOL_GPL(usb_stor_probe1);
145 /* Second part of general USB mass-storage probing */
146 int usb_stor_probe2(struct us_data *us)
147 {
148- struct task_struct *th;
149 int result;
150 struct device *dev = &us->pusb_intf->dev;
151
152@@ -987,20 +966,14 @@ int usb_stor_probe2(struct us_data *us)
153 goto BadDevice;
154 }
155
156- /* Start up the thread for delayed SCSI-device scanning */
157- th = kthread_create(usb_stor_scan_thread, us, "usb-stor-scan");
158- if (IS_ERR(th)) {
159- dev_warn(dev,
160- "Unable to start the device-scanning thread\n");
161- complete(&us->scanning_done);
162- quiesce_and_remove_host(us);
163- result = PTR_ERR(th);
164- goto BadDevice;
165- }
166-
167+ /* Submit the delayed_work for SCSI-device scanning */
168 usb_autopm_get_interface_no_resume(us->pusb_intf);
169- wake_up_process(th);
170+ set_bit(US_FLIDX_SCAN_PENDING, &us->dflags);
171
172+ if (delay_use > 0)
173+ dev_dbg(dev, "waiting for device to settle before scanning\n");
174+ queue_delayed_work(system_freezable_wq, &us->scan_dwork,
175+ delay_use * HZ);
176 return 0;
177
178 /* We come here if there are any problems */
179diff --git a/drivers/usb/storage/usb.h b/drivers/usb/storage/usb.h
180index 7b0f211..75f70f0 100644
181--- a/drivers/usb/storage/usb.h
182+++ b/drivers/usb/storage/usb.h
183@@ -47,6 +47,7 @@
184 #include <linux/blkdev.h>
185 #include <linux/completion.h>
186 #include <linux/mutex.h>
187+#include <linux/workqueue.h>
188 #include <scsi/scsi_host.h>
189
190 struct us_data;
191@@ -72,7 +73,7 @@ struct us_unusual_dev {
192 #define US_FLIDX_DISCONNECTING 3 /* disconnect in progress */
193 #define US_FLIDX_RESETTING 4 /* device reset in progress */
194 #define US_FLIDX_TIMED_OUT 5 /* SCSI midlayer timed out */
195-#define US_FLIDX_DONT_SCAN 6 /* don't scan (disconnect) */
196+#define US_FLIDX_SCAN_PENDING 6 /* scanning not yet done */
197 #define US_FLIDX_REDO_READ10 7 /* redo READ(10) command */
198 #define US_FLIDX_READ10_WORKED 8 /* previous READ(10) succeeded */
199
200@@ -147,8 +148,8 @@ struct us_data {
201 /* mutual exclusion and synchronization structures */
202 struct completion cmnd_ready; /* to sleep thread on */
203 struct completion notify; /* thread begin/end */
204- wait_queue_head_t delay_wait; /* wait during scan, reset */
205- struct completion scanning_done; /* wait for scan thread */
206+ wait_queue_head_t delay_wait; /* wait during reset */
207+ struct delayed_work scan_dwork; /* for async scanning */
208
209 /* subdriver information */
210 void *extra; /* Any extra data */
211--
2121.7.7.4
213
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0045-target-Allow-control-CDBs-with-data-1-page.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0045-target-Allow-control-CDBs-with-data-1-page.patch
new file mode 100644
index 00000000..c1367b96
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0045-target-Allow-control-CDBs-with-data-1-page.patch
@@ -0,0 +1,513 @@
1From d2227f84ba0e97906153ac83db13213fb2e3938d Mon Sep 17 00:00:00 2001
2From: Andy Grover <agrover@redhat.com>
3Date: Mon, 16 Jan 2012 16:57:08 -0800
4Subject: [PATCH 45/73] target: Allow control CDBs with data > 1 page
5
6commit 4949314c7283ea4f9ade182ca599583b89f7edd6 upstream.
7
8We need to handle >1 page control cdbs, so extend the code to do a vmap
9if bigger than 1 page. It seems like kmap() is still preferable if just
10a page, fewer TLB shootdowns(?), so keep using that when possible.
11
12Rename function pair for their new scope.
13
14Signed-off-by: Andy Grover <agrover@redhat.com>
15Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/target/target_core_alua.c | 8 +++---
19 drivers/target/target_core_cdb.c | 28 ++++++++++----------
20 drivers/target/target_core_device.c | 4 +-
21 drivers/target/target_core_pr.c | 38 +++++++++++++-------------
22 drivers/target/target_core_pscsi.c | 4 +-
23 drivers/target/target_core_transport.c | 45 ++++++++++++++++++++++++--------
24 include/target/target_core_base.h | 1 +
25 include/target/target_core_transport.h | 4 +-
26 8 files changed, 78 insertions(+), 54 deletions(-)
27
28diff --git a/drivers/target/target_core_alua.c b/drivers/target/target_core_alua.c
29index 1dcbef4..1d24512 100644
30--- a/drivers/target/target_core_alua.c
31+++ b/drivers/target/target_core_alua.c
32@@ -79,7 +79,7 @@ int target_emulate_report_target_port_groups(struct se_task *task)
33 return -EINVAL;
34 }
35
36- buf = transport_kmap_first_data_page(cmd);
37+ buf = transport_kmap_data_sg(cmd);
38
39 spin_lock(&su_dev->t10_alua.tg_pt_gps_lock);
40 list_for_each_entry(tg_pt_gp, &su_dev->t10_alua.tg_pt_gps_list,
41@@ -164,7 +164,7 @@ int target_emulate_report_target_port_groups(struct se_task *task)
42 buf[2] = ((rd_len >> 8) & 0xff);
43 buf[3] = (rd_len & 0xff);
44
45- transport_kunmap_first_data_page(cmd);
46+ transport_kunmap_data_sg(cmd);
47
48 task->task_scsi_status = GOOD;
49 transport_complete_task(task, 1);
50@@ -195,7 +195,7 @@ int target_emulate_set_target_port_groups(struct se_task *task)
51 cmd->scsi_sense_reason = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE;
52 return -EINVAL;
53 }
54- buf = transport_kmap_first_data_page(cmd);
55+ buf = transport_kmap_data_sg(cmd);
56
57 /*
58 * Determine if explict ALUA via SET_TARGET_PORT_GROUPS is allowed
59@@ -352,7 +352,7 @@ int target_emulate_set_target_port_groups(struct se_task *task)
60 }
61
62 out:
63- transport_kunmap_first_data_page(cmd);
64+ transport_kunmap_data_sg(cmd);
65 task->task_scsi_status = GOOD;
66 transport_complete_task(task, 1);
67 return 0;
68diff --git a/drivers/target/target_core_cdb.c b/drivers/target/target_core_cdb.c
69index 251e48f..8facd33 100644
70--- a/drivers/target/target_core_cdb.c
71+++ b/drivers/target/target_core_cdb.c
72@@ -82,7 +82,7 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
73 return -EINVAL;
74 }
75
76- buf = transport_kmap_first_data_page(cmd);
77+ buf = transport_kmap_data_sg(cmd);
78
79 if (dev == tpg->tpg_virt_lun0.lun_se_dev) {
80 buf[0] = 0x3f; /* Not connected */
81@@ -135,7 +135,7 @@ target_emulate_inquiry_std(struct se_cmd *cmd)
82 buf[4] = 31; /* Set additional length to 31 */
83
84 out:
85- transport_kunmap_first_data_page(cmd);
86+ transport_kunmap_data_sg(cmd);
87 return 0;
88 }
89
90@@ -726,7 +726,7 @@ int target_emulate_inquiry(struct se_task *task)
91 return -EINVAL;
92 }
93
94- buf = transport_kmap_first_data_page(cmd);
95+ buf = transport_kmap_data_sg(cmd);
96
97 buf[0] = dev->transport->get_device_type(dev);
98
99@@ -743,7 +743,7 @@ int target_emulate_inquiry(struct se_task *task)
100 ret = -EINVAL;
101
102 out_unmap:
103- transport_kunmap_first_data_page(cmd);
104+ transport_kunmap_data_sg(cmd);
105 out:
106 if (!ret) {
107 task->task_scsi_status = GOOD;
108@@ -765,7 +765,7 @@ int target_emulate_readcapacity(struct se_task *task)
109 else
110 blocks = (u32)blocks_long;
111
112- buf = transport_kmap_first_data_page(cmd);
113+ buf = transport_kmap_data_sg(cmd);
114
115 buf[0] = (blocks >> 24) & 0xff;
116 buf[1] = (blocks >> 16) & 0xff;
117@@ -781,7 +781,7 @@ int target_emulate_readcapacity(struct se_task *task)
118 if (dev->se_sub_dev->se_dev_attrib.emulate_tpu || dev->se_sub_dev->se_dev_attrib.emulate_tpws)
119 put_unaligned_be32(0xFFFFFFFF, &buf[0]);
120
121- transport_kunmap_first_data_page(cmd);
122+ transport_kunmap_data_sg(cmd);
123
124 task->task_scsi_status = GOOD;
125 transport_complete_task(task, 1);
126@@ -795,7 +795,7 @@ int target_emulate_readcapacity_16(struct se_task *task)
127 unsigned char *buf;
128 unsigned long long blocks = dev->transport->get_blocks(dev);
129
130- buf = transport_kmap_first_data_page(cmd);
131+ buf = transport_kmap_data_sg(cmd);
132
133 buf[0] = (blocks >> 56) & 0xff;
134 buf[1] = (blocks >> 48) & 0xff;
135@@ -816,7 +816,7 @@ int target_emulate_readcapacity_16(struct se_task *task)
136 if (dev->se_sub_dev->se_dev_attrib.emulate_tpu || dev->se_sub_dev->se_dev_attrib.emulate_tpws)
137 buf[14] = 0x80;
138
139- transport_kunmap_first_data_page(cmd);
140+ transport_kunmap_data_sg(cmd);
141
142 task->task_scsi_status = GOOD;
143 transport_complete_task(task, 1);
144@@ -1029,9 +1029,9 @@ int target_emulate_modesense(struct se_task *task)
145 offset = cmd->data_length;
146 }
147
148- rbuf = transport_kmap_first_data_page(cmd);
149+ rbuf = transport_kmap_data_sg(cmd);
150 memcpy(rbuf, buf, offset);
151- transport_kunmap_first_data_page(cmd);
152+ transport_kunmap_data_sg(cmd);
153
154 task->task_scsi_status = GOOD;
155 transport_complete_task(task, 1);
156@@ -1053,7 +1053,7 @@ int target_emulate_request_sense(struct se_task *task)
157 return -ENOSYS;
158 }
159
160- buf = transport_kmap_first_data_page(cmd);
161+ buf = transport_kmap_data_sg(cmd);
162
163 if (!core_scsi3_ua_clear_for_request_sense(cmd, &ua_asc, &ua_ascq)) {
164 /*
165@@ -1099,7 +1099,7 @@ int target_emulate_request_sense(struct se_task *task)
166 }
167
168 end:
169- transport_kunmap_first_data_page(cmd);
170+ transport_kunmap_data_sg(cmd);
171 task->task_scsi_status = GOOD;
172 transport_complete_task(task, 1);
173 return 0;
174@@ -1133,7 +1133,7 @@ int target_emulate_unmap(struct se_task *task)
175 dl = get_unaligned_be16(&cdb[0]);
176 bd_dl = get_unaligned_be16(&cdb[2]);
177
178- buf = transport_kmap_first_data_page(cmd);
179+ buf = transport_kmap_data_sg(cmd);
180
181 ptr = &buf[offset];
182 pr_debug("UNMAP: Sub: %s Using dl: %hu bd_dl: %hu size: %hu"
183@@ -1157,7 +1157,7 @@ int target_emulate_unmap(struct se_task *task)
184 }
185
186 err:
187- transport_kunmap_first_data_page(cmd);
188+ transport_kunmap_data_sg(cmd);
189 if (!ret) {
190 task->task_scsi_status = GOOD;
191 transport_complete_task(task, 1);
192diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
193index 9b86394..19f8aca 100644
194--- a/drivers/target/target_core_device.c
195+++ b/drivers/target/target_core_device.c
196@@ -658,7 +658,7 @@ int target_report_luns(struct se_task *se_task)
197 unsigned char *buf;
198 u32 cdb_offset = 0, lun_count = 0, offset = 8, i;
199
200- buf = transport_kmap_first_data_page(se_cmd);
201+ buf = (unsigned char *) transport_kmap_data_sg(se_cmd);
202
203 /*
204 * If no struct se_session pointer is present, this struct se_cmd is
205@@ -696,7 +696,7 @@ int target_report_luns(struct se_task *se_task)
206 * See SPC3 r07, page 159.
207 */
208 done:
209- transport_kunmap_first_data_page(se_cmd);
210+ transport_kunmap_data_sg(se_cmd);
211 lun_count *= 8;
212 buf[0] = ((lun_count >> 24) & 0xff);
213 buf[1] = ((lun_count >> 16) & 0xff);
214diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
215index 9119d92..778c1a6 100644
216--- a/drivers/target/target_core_pr.c
217+++ b/drivers/target/target_core_pr.c
218@@ -1538,7 +1538,7 @@ static int core_scsi3_decode_spec_i_port(
219 tidh_new->dest_local_nexus = 1;
220 list_add_tail(&tidh_new->dest_list, &tid_dest_list);
221
222- buf = transport_kmap_first_data_page(cmd);
223+ buf = transport_kmap_data_sg(cmd);
224 /*
225 * For a PERSISTENT RESERVE OUT specify initiator ports payload,
226 * first extract TransportID Parameter Data Length, and make sure
227@@ -1789,7 +1789,7 @@ static int core_scsi3_decode_spec_i_port(
228
229 }
230
231- transport_kunmap_first_data_page(cmd);
232+ transport_kunmap_data_sg(cmd);
233
234 /*
235 * Go ahead and create a registrations from tid_dest_list for the
236@@ -1837,7 +1837,7 @@ static int core_scsi3_decode_spec_i_port(
237
238 return 0;
239 out:
240- transport_kunmap_first_data_page(cmd);
241+ transport_kunmap_data_sg(cmd);
242 /*
243 * For the failure case, release everything from tid_dest_list
244 * including *dest_pr_reg and the configfs dependances..
245@@ -3429,14 +3429,14 @@ static int core_scsi3_emulate_pro_register_and_move(
246 * will be moved to for the TransportID containing SCSI initiator WWN
247 * information.
248 */
249- buf = transport_kmap_first_data_page(cmd);
250+ buf = transport_kmap_data_sg(cmd);
251 rtpi = (buf[18] & 0xff) << 8;
252 rtpi |= buf[19] & 0xff;
253 tid_len = (buf[20] & 0xff) << 24;
254 tid_len |= (buf[21] & 0xff) << 16;
255 tid_len |= (buf[22] & 0xff) << 8;
256 tid_len |= buf[23] & 0xff;
257- transport_kunmap_first_data_page(cmd);
258+ transport_kunmap_data_sg(cmd);
259 buf = NULL;
260
261 if ((tid_len + 24) != cmd->data_length) {
262@@ -3488,7 +3488,7 @@ static int core_scsi3_emulate_pro_register_and_move(
263 return -EINVAL;
264 }
265
266- buf = transport_kmap_first_data_page(cmd);
267+ buf = transport_kmap_data_sg(cmd);
268 proto_ident = (buf[24] & 0x0f);
269 #if 0
270 pr_debug("SPC-3 PR REGISTER_AND_MOVE: Extracted Protocol Identifier:"
271@@ -3522,7 +3522,7 @@ static int core_scsi3_emulate_pro_register_and_move(
272 goto out;
273 }
274
275- transport_kunmap_first_data_page(cmd);
276+ transport_kunmap_data_sg(cmd);
277 buf = NULL;
278
279 pr_debug("SPC-3 PR [%s] Extracted initiator %s identifier: %s"
280@@ -3787,13 +3787,13 @@ after_iport_check:
281 " REGISTER_AND_MOVE\n");
282 }
283
284- transport_kunmap_first_data_page(cmd);
285+ transport_kunmap_data_sg(cmd);
286
287 core_scsi3_put_pr_reg(dest_pr_reg);
288 return 0;
289 out:
290 if (buf)
291- transport_kunmap_first_data_page(cmd);
292+ transport_kunmap_data_sg(cmd);
293 if (dest_se_deve)
294 core_scsi3_lunacl_undepend_item(dest_se_deve);
295 if (dest_node_acl)
296@@ -3867,7 +3867,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task)
297 scope = (cdb[2] & 0xf0);
298 type = (cdb[2] & 0x0f);
299
300- buf = transport_kmap_first_data_page(cmd);
301+ buf = transport_kmap_data_sg(cmd);
302 /*
303 * From PERSISTENT_RESERVE_OUT parameter list (payload)
304 */
305@@ -3885,7 +3885,7 @@ int target_scsi3_emulate_pr_out(struct se_task *task)
306 aptpl = (buf[17] & 0x01);
307 unreg = (buf[17] & 0x02);
308 }
309- transport_kunmap_first_data_page(cmd);
310+ transport_kunmap_data_sg(cmd);
311 buf = NULL;
312
313 /*
314@@ -3985,7 +3985,7 @@ static int core_scsi3_pri_read_keys(struct se_cmd *cmd)
315 return -EINVAL;
316 }
317
318- buf = transport_kmap_first_data_page(cmd);
319+ buf = transport_kmap_data_sg(cmd);
320 buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
321 buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
322 buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff);
323@@ -4019,7 +4019,7 @@ static int core_scsi3_pri_read_keys(struct se_cmd *cmd)
324 buf[6] = ((add_len >> 8) & 0xff);
325 buf[7] = (add_len & 0xff);
326
327- transport_kunmap_first_data_page(cmd);
328+ transport_kunmap_data_sg(cmd);
329
330 return 0;
331 }
332@@ -4045,7 +4045,7 @@ static int core_scsi3_pri_read_reservation(struct se_cmd *cmd)
333 return -EINVAL;
334 }
335
336- buf = transport_kmap_first_data_page(cmd);
337+ buf = transport_kmap_data_sg(cmd);
338 buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
339 buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
340 buf[2] = ((su_dev->t10_pr.pr_generation >> 8) & 0xff);
341@@ -4104,7 +4104,7 @@ static int core_scsi3_pri_read_reservation(struct se_cmd *cmd)
342
343 err:
344 spin_unlock(&se_dev->dev_reservation_lock);
345- transport_kunmap_first_data_page(cmd);
346+ transport_kunmap_data_sg(cmd);
347
348 return 0;
349 }
350@@ -4128,7 +4128,7 @@ static int core_scsi3_pri_report_capabilities(struct se_cmd *cmd)
351 return -EINVAL;
352 }
353
354- buf = transport_kmap_first_data_page(cmd);
355+ buf = transport_kmap_data_sg(cmd);
356
357 buf[0] = ((add_len << 8) & 0xff);
358 buf[1] = (add_len & 0xff);
359@@ -4160,7 +4160,7 @@ static int core_scsi3_pri_report_capabilities(struct se_cmd *cmd)
360 buf[4] |= 0x02; /* PR_TYPE_WRITE_EXCLUSIVE */
361 buf[5] |= 0x01; /* PR_TYPE_EXCLUSIVE_ACCESS_ALLREG */
362
363- transport_kunmap_first_data_page(cmd);
364+ transport_kunmap_data_sg(cmd);
365
366 return 0;
367 }
368@@ -4190,7 +4190,7 @@ static int core_scsi3_pri_read_full_status(struct se_cmd *cmd)
369 return -EINVAL;
370 }
371
372- buf = transport_kmap_first_data_page(cmd);
373+ buf = transport_kmap_data_sg(cmd);
374
375 buf[0] = ((su_dev->t10_pr.pr_generation >> 24) & 0xff);
376 buf[1] = ((su_dev->t10_pr.pr_generation >> 16) & 0xff);
377@@ -4311,7 +4311,7 @@ static int core_scsi3_pri_read_full_status(struct se_cmd *cmd)
378 buf[6] = ((add_len >> 8) & 0xff);
379 buf[7] = (add_len & 0xff);
380
381- transport_kunmap_first_data_page(cmd);
382+ transport_kunmap_data_sg(cmd);
383
384 return 0;
385 }
386diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c
387index 8b15e56..5c12137 100644
388--- a/drivers/target/target_core_pscsi.c
389+++ b/drivers/target/target_core_pscsi.c
390@@ -695,7 +695,7 @@ static int pscsi_transport_complete(struct se_task *task)
391
392 if (task->task_se_cmd->se_deve->lun_flags &
393 TRANSPORT_LUNFLAGS_READ_ONLY) {
394- unsigned char *buf = transport_kmap_first_data_page(task->task_se_cmd);
395+ unsigned char *buf = transport_kmap_data_sg(task->task_se_cmd);
396
397 if (cdb[0] == MODE_SENSE_10) {
398 if (!(buf[3] & 0x80))
399@@ -705,7 +705,7 @@ static int pscsi_transport_complete(struct se_task *task)
400 buf[2] |= 0x80;
401 }
402
403- transport_kunmap_first_data_page(task->task_se_cmd);
404+ transport_kunmap_data_sg(task->task_se_cmd);
405 }
406 }
407 after_mode_sense:
408diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
409index 861628e..e4ddb93 100644
410--- a/drivers/target/target_core_transport.c
411+++ b/drivers/target/target_core_transport.c
412@@ -3053,11 +3053,6 @@ static int transport_generic_cmd_sequencer(
413 (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB)))
414 goto out_unsupported_cdb;
415
416- /* Let's limit control cdbs to a page, for simplicity's sake. */
417- if ((cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB) &&
418- size > PAGE_SIZE)
419- goto out_invalid_cdb_field;
420-
421 transport_set_supported_SAM_opcode(cmd);
422 return ret;
423
424@@ -3435,9 +3430,11 @@ int transport_generic_map_mem_to_cmd(
425 }
426 EXPORT_SYMBOL(transport_generic_map_mem_to_cmd);
427
428-void *transport_kmap_first_data_page(struct se_cmd *cmd)
429+void *transport_kmap_data_sg(struct se_cmd *cmd)
430 {
431 struct scatterlist *sg = cmd->t_data_sg;
432+ struct page **pages;
433+ int i;
434
435 BUG_ON(!sg);
436 /*
437@@ -3445,15 +3442,41 @@ void *transport_kmap_first_data_page(struct se_cmd *cmd)
438 * tcm_loop who may be using a contig buffer from the SCSI midlayer for
439 * control CDBs passed as SGLs via transport_generic_map_mem_to_cmd()
440 */
441- return kmap(sg_page(sg)) + sg->offset;
442+ if (!cmd->t_data_nents)
443+ return NULL;
444+ else if (cmd->t_data_nents == 1)
445+ return kmap(sg_page(sg)) + sg->offset;
446+
447+ /* >1 page. use vmap */
448+ pages = kmalloc(sizeof(*pages) * cmd->t_data_nents, GFP_KERNEL);
449+ if (!pages)
450+ return NULL;
451+
452+ /* convert sg[] to pages[] */
453+ for_each_sg(cmd->t_data_sg, sg, cmd->t_data_nents, i) {
454+ pages[i] = sg_page(sg);
455+ }
456+
457+ cmd->t_data_vmap = vmap(pages, cmd->t_data_nents, VM_MAP, PAGE_KERNEL);
458+ kfree(pages);
459+ if (!cmd->t_data_vmap)
460+ return NULL;
461+
462+ return cmd->t_data_vmap + cmd->t_data_sg[0].offset;
463 }
464-EXPORT_SYMBOL(transport_kmap_first_data_page);
465+EXPORT_SYMBOL(transport_kmap_data_sg);
466
467-void transport_kunmap_first_data_page(struct se_cmd *cmd)
468+void transport_kunmap_data_sg(struct se_cmd *cmd)
469 {
470- kunmap(sg_page(cmd->t_data_sg));
471+ if (!cmd->t_data_nents)
472+ return;
473+ else if (cmd->t_data_nents == 1)
474+ kunmap(sg_page(cmd->t_data_sg));
475+
476+ vunmap(cmd->t_data_vmap);
477+ cmd->t_data_vmap = NULL;
478 }
479-EXPORT_SYMBOL(transport_kunmap_first_data_page);
480+EXPORT_SYMBOL(transport_kunmap_data_sg);
481
482 static int
483 transport_generic_get_mem(struct se_cmd *cmd)
484diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
485index a79886c..94bbec3 100644
486--- a/include/target/target_core_base.h
487+++ b/include/target/target_core_base.h
488@@ -486,6 +486,7 @@ struct se_cmd {
489
490 struct scatterlist *t_data_sg;
491 unsigned int t_data_nents;
492+ void *t_data_vmap;
493 struct scatterlist *t_bidi_data_sg;
494 unsigned int t_bidi_data_nents;
495
496diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
497index dac4f2d..72751e8 100644
498--- a/include/target/target_core_transport.h
499+++ b/include/target/target_core_transport.h
500@@ -129,8 +129,8 @@ extern void transport_init_se_cmd(struct se_cmd *,
501 struct target_core_fabric_ops *,
502 struct se_session *, u32, int, int,
503 unsigned char *);
504-void *transport_kmap_first_data_page(struct se_cmd *cmd);
505-void transport_kunmap_first_data_page(struct se_cmd *cmd);
506+void *transport_kmap_data_sg(struct se_cmd *);
507+void transport_kunmap_data_sg(struct se_cmd *);
508 extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
509 extern int transport_handle_cdb_direct(struct se_cmd *);
510 extern int transport_generic_handle_cdb_map(struct se_cmd *);
511--
5121.7.7.4
513
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0046-ASoC-wm8962-Fix-sidetone-enumeration-texts.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0046-ASoC-wm8962-Fix-sidetone-enumeration-texts.patch
new file mode 100644
index 00000000..c0096a2e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0046-ASoC-wm8962-Fix-sidetone-enumeration-texts.patch
@@ -0,0 +1,31 @@
1From 8fb548906ee57c17c6a770007075b92b1a9d89b6 Mon Sep 17 00:00:00 2001
2From: Mark Brown <broonie@opensource.wolfsonmicro.com>
3Date: Mon, 13 Feb 2012 22:00:47 -0800
4Subject: [PATCH 46/73] ASoC: wm8962: Fix sidetone enumeration texts
5
6commit 31794bc37bf2db84f085da52b72bfba65739b2d2 upstream.
7
8The sidetone enumeration texts have left and right swapped.
9
10Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
11Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12---
13 sound/soc/codecs/wm8962.c | 2 +-
14 1 files changed, 1 insertions(+), 1 deletions(-)
15
16diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
17index d795294..07dd7eb 100644
18--- a/sound/soc/codecs/wm8962.c
19+++ b/sound/soc/codecs/wm8962.c
20@@ -2559,7 +2559,7 @@ static int dsp2_event(struct snd_soc_dapm_widget *w,
21 return 0;
22 }
23
24-static const char *st_text[] = { "None", "Right", "Left" };
25+static const char *st_text[] = { "None", "Left", "Right" };
26
27 static const struct soc_enum str_enum =
28 SOC_ENUM_SINGLE(WM8962_DAC_DSP_MIXING_1, 2, 3, st_text);
29--
301.7.7.4
31
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0047-ALSA-hda-realtek-Fix-overflow-of-vol-sw-check-bitmap.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0047-ALSA-hda-realtek-Fix-overflow-of-vol-sw-check-bitmap.patch
new file mode 100644
index 00000000..1c122649
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0047-ALSA-hda-realtek-Fix-overflow-of-vol-sw-check-bitmap.patch
@@ -0,0 +1,61 @@
1From 0da0c63e05b5f7de8298753d79304cd137351590 Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Thu, 16 Feb 2012 16:38:07 +0100
4Subject: [PATCH 47/73] ALSA: hda/realtek - Fix overflow of vol/sw check
5 bitmap
6
7commit c14c95f62ecb8710af14ae0d48e01991b70bb6f4 upstream.
8
9The bitmap introduced in the commit [527e4d73: ALSA: hda/realtek - Fix
10missing volume controls with ALC260] is too narrow for some codecs,
11which may have more NIDs than 0x20, thus it may overflow the bitmap
12array on them.
13
14Just double the number to cover all and also add a sanity-check code
15to be safer.
16
17Signed-off-by: Takashi Iwai <tiwai@suse.de>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 sound/pci/hda/patch_realtek.c | 11 ++++++++---
21 1 files changed, 8 insertions(+), 3 deletions(-)
22
23diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
24index 9c197d4..ceda0ac 100644
25--- a/sound/pci/hda/patch_realtek.c
26+++ b/sound/pci/hda/patch_realtek.c
27@@ -79,6 +79,8 @@ enum {
28 ALC_AUTOMUTE_MIXER, /* mute/unmute mixer widget AMP */
29 };
30
31+#define MAX_VOL_NIDS 0x40
32+
33 struct alc_spec {
34 /* codec parameterization */
35 const struct snd_kcontrol_new *mixers[5]; /* mixer arrays */
36@@ -117,8 +119,8 @@ struct alc_spec {
37 const hda_nid_t *capsrc_nids;
38 hda_nid_t dig_in_nid; /* digital-in NID; optional */
39 hda_nid_t mixer_nid; /* analog-mixer NID */
40- DECLARE_BITMAP(vol_ctls, 0x20 << 1);
41- DECLARE_BITMAP(sw_ctls, 0x20 << 1);
42+ DECLARE_BITMAP(vol_ctls, MAX_VOL_NIDS << 1);
43+ DECLARE_BITMAP(sw_ctls, MAX_VOL_NIDS << 1);
44
45 /* capture setup for dynamic dual-adc switch */
46 hda_nid_t cur_adc;
47@@ -3068,7 +3070,10 @@ static int alc_auto_fill_dac_nids(struct hda_codec *codec)
48 static inline unsigned int get_ctl_pos(unsigned int data)
49 {
50 hda_nid_t nid = get_amp_nid_(data);
51- unsigned int dir = get_amp_direction_(data);
52+ unsigned int dir;
53+ if (snd_BUG_ON(nid >= MAX_VOL_NIDS))
54+ return 0;
55+ dir = get_amp_direction_(data);
56 return (nid << 1) | dir;
57 }
58
59--
601.7.7.4
61
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0048-ALSA-hda-realtek-Fix-surround-output-regression-on-A.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0048-ALSA-hda-realtek-Fix-surround-output-regression-on-A.patch
new file mode 100644
index 00000000..b30fe7a9
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0048-ALSA-hda-realtek-Fix-surround-output-regression-on-A.patch
@@ -0,0 +1,53 @@
1From 8f421627d178f1346bb68c9e7b32b2bd5844ce1d Mon Sep 17 00:00:00 2001
2From: Takashi Iwai <tiwai@suse.de>
3Date: Fri, 17 Feb 2012 10:12:38 +0100
4Subject: [PATCH 48/73] ALSA: hda/realtek - Fix surround output regression on
5 Acer Aspire 5935
6
7commit ef8d60fb79614a86a82720dc2402631dbcafb315 upstream.
8
9The previous fix for the speaker on Acer Aspire 59135 introduced
10another problem for surround outputs. It changed the connections on
11the line-in/mic pins for limiting the routes, but it left the modified
12connections. Thus wrong connection indices were written when set to
134ch or 6ch mode.
14
15This patch fixes it by restoring the right connections just after
16parsing the tree but before the initialization.
17
18Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=42740
19
20Signed-off-by: Takashi Iwai <tiwai@suse.de>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 sound/pci/hda/patch_realtek.c | 8 ++++++++
24 1 files changed, 8 insertions(+), 0 deletions(-)
25
26diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
27index ceda0ac..c4c8d78 100644
28--- a/sound/pci/hda/patch_realtek.c
29+++ b/sound/pci/hda/patch_realtek.c
30@@ -4229,12 +4229,20 @@ static void alc889_fixup_dac_route(struct hda_codec *codec,
31 const struct alc_fixup *fix, int action)
32 {
33 if (action == ALC_FIXUP_ACT_PRE_PROBE) {
34+ /* fake the connections during parsing the tree */
35 hda_nid_t conn1[2] = { 0x0c, 0x0d };
36 hda_nid_t conn2[2] = { 0x0e, 0x0f };
37 snd_hda_override_conn_list(codec, 0x14, 2, conn1);
38 snd_hda_override_conn_list(codec, 0x15, 2, conn1);
39 snd_hda_override_conn_list(codec, 0x18, 2, conn2);
40 snd_hda_override_conn_list(codec, 0x1a, 2, conn2);
41+ } else if (action == ALC_FIXUP_ACT_PROBE) {
42+ /* restore the connections */
43+ hda_nid_t conn[5] = { 0x0c, 0x0d, 0x0e, 0x0f, 0x26 };
44+ snd_hda_override_conn_list(codec, 0x14, 5, conn);
45+ snd_hda_override_conn_list(codec, 0x15, 5, conn);
46+ snd_hda_override_conn_list(codec, 0x18, 5, conn);
47+ snd_hda_override_conn_list(codec, 0x1a, 5, conn);
48 }
49 }
50
51--
521.7.7.4
53
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0049-NOMMU-Lock-i_mmap_mutex-for-access-to-the-VMA-prio-l.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0049-NOMMU-Lock-i_mmap_mutex-for-access-to-the-VMA-prio-l.patch
new file mode 100644
index 00000000..b8b70032
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0049-NOMMU-Lock-i_mmap_mutex-for-access-to-the-VMA-prio-l.patch
@@ -0,0 +1,76 @@
1From 8f6c3d1a5873d9190bd6259357900ddebc308626 Mon Sep 17 00:00:00 2001
2From: David Howells <dhowells@redhat.com>
3Date: Thu, 23 Feb 2012 13:50:35 +0000
4Subject: [PATCH 49/73] NOMMU: Lock i_mmap_mutex for access to the VMA prio
5 list
6
7commit 918e556ec214ed2f584e4cac56d7b29e4bb6bf27 upstream.
8
9Lock i_mmap_mutex for access to the VMA prio list to prevent concurrent
10access. Currently, certain parts of the mmap handling are protected by
11the region mutex, but not all.
12
13Reported-by: Al Viro <viro@zeniv.linux.org.uk>
14Signed-off-by: David Howells <dhowells@redhat.com>
15Acked-by: Al Viro <viro@zeniv.linux.org.uk>
16Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 mm/nommu.c | 7 +++++++
20 1 files changed, 7 insertions(+), 0 deletions(-)
21
22diff --git a/mm/nommu.c b/mm/nommu.c
23index b982290..ee7e57e 100644
24--- a/mm/nommu.c
25+++ b/mm/nommu.c
26@@ -696,9 +696,11 @@ static void add_vma_to_mm(struct mm_struct *mm, struct vm_area_struct *vma)
27 if (vma->vm_file) {
28 mapping = vma->vm_file->f_mapping;
29
30+ mutex_lock(&mapping->i_mmap_mutex);
31 flush_dcache_mmap_lock(mapping);
32 vma_prio_tree_insert(vma, &mapping->i_mmap);
33 flush_dcache_mmap_unlock(mapping);
34+ mutex_unlock(&mapping->i_mmap_mutex);
35 }
36
37 /* add the VMA to the tree */
38@@ -760,9 +762,11 @@ static void delete_vma_from_mm(struct vm_area_struct *vma)
39 if (vma->vm_file) {
40 mapping = vma->vm_file->f_mapping;
41
42+ mutex_lock(&mapping->i_mmap_mutex);
43 flush_dcache_mmap_lock(mapping);
44 vma_prio_tree_remove(vma, &mapping->i_mmap);
45 flush_dcache_mmap_unlock(mapping);
46+ mutex_unlock(&mapping->i_mmap_mutex);
47 }
48
49 /* remove from the MM's tree and list */
50@@ -2052,6 +2056,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
51 high = (size + PAGE_SIZE - 1) >> PAGE_SHIFT;
52
53 down_write(&nommu_region_sem);
54+ mutex_lock(&inode->i_mapping->i_mmap_mutex);
55
56 /* search for VMAs that fall within the dead zone */
57 vma_prio_tree_foreach(vma, &iter, &inode->i_mapping->i_mmap,
58@@ -2059,6 +2064,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
59 /* found one - only interested if it's shared out of the page
60 * cache */
61 if (vma->vm_flags & VM_SHARED) {
62+ mutex_unlock(&inode->i_mapping->i_mmap_mutex);
63 up_write(&nommu_region_sem);
64 return -ETXTBSY; /* not quite true, but near enough */
65 }
66@@ -2086,6 +2092,7 @@ int nommu_shrink_inode_mappings(struct inode *inode, size_t size,
67 }
68 }
69
70+ mutex_unlock(&inode->i_mapping->i_mmap_mutex);
71 up_write(&nommu_region_sem);
72 return 0;
73 }
74--
751.7.7.4
76
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0050-hwmon-max6639-Fix-FAN_FROM_REG-calculation.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0050-hwmon-max6639-Fix-FAN_FROM_REG-calculation.patch
new file mode 100644
index 00000000..d83fb349
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0050-hwmon-max6639-Fix-FAN_FROM_REG-calculation.patch
@@ -0,0 +1,46 @@
1From 8003623db5dfe0819e0fb83863392d6465569d60 Mon Sep 17 00:00:00 2001
2From: Chris D Schimp <silverchris@gmail.com>
3Date: Mon, 20 Feb 2012 16:59:24 -0500
4Subject: [PATCH 50/73] hwmon: (max6639) Fix FAN_FROM_REG calculation
5
6commit b63d97a36edb1aecf8c13e5f5783feff4d64c24b upstream.
7
8RPM calculation from tachometer value does not depend on PPR.
9Also, do not report negative RPM values.
10
11Signed-off-by: Chris D Schimp <silverchris@gmail.com>
12[guenter.roeck@ericsson.com: do not report negative RPM values]
13Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
14Acked-by: Roland Stigge <stigge@antcom.de>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 drivers/hwmon/max6639.c | 6 +++---
18 1 files changed, 3 insertions(+), 3 deletions(-)
19
20diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
21index f20d997..1b844db 100644
22--- a/drivers/hwmon/max6639.c
23+++ b/drivers/hwmon/max6639.c
24@@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2e, 0x2f, I2C_CLIENT_END };
25
26 static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };
27
28-#define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \
29- (val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val)))
30+#define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \
31+ 0 : (rpm_ranges[rpm_range] * 30) / (val))
32 #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)
33
34 /*
35@@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct device *dev,
36 return PTR_ERR(data);
37
38 return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],
39- data->ppr, data->rpm_range));
40+ data->rpm_range));
41 }
42
43 static ssize_t show_alarm(struct device *dev,
44--
451.7.7.4
46
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0051-hwmon-max6639-Fix-PPR-register-initialization-to-set.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0051-hwmon-max6639-Fix-PPR-register-initialization-to-set.patch
new file mode 100644
index 00000000..effff923
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0051-hwmon-max6639-Fix-PPR-register-initialization-to-set.patch
@@ -0,0 +1,65 @@
1From b7b3a0104a6e22b03733289ec2665e2acf19170c Mon Sep 17 00:00:00 2001
2From: Chris D Schimp <silverchris@gmail.com>
3Date: Mon, 20 Feb 2012 17:44:59 -0500
4Subject: [PATCH 51/73] hwmon: (max6639) Fix PPR register initialization to
5 set both channels
6
7commit 2f2da1ac0ba5b6cc6e1957c4da5ff20e67d8442b upstream.
8
9Initialize PPR register for both channels, and set correct PPR register bits.
10Also remove unnecessary variable initializations.
11
12Signed-off-by: Chris D Schimp <silverchris@gmail.com>
13[guenter.roeck@ericsson.com: Merged two patches into one]
14Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
15Acked-by: Roland Stigge <stigge@antcom.de>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/hwmon/max6639.c | 16 +++++++++-------
19 1 files changed, 9 insertions(+), 7 deletions(-)
20
21diff --git a/drivers/hwmon/max6639.c b/drivers/hwmon/max6639.c
22index 1b844db..8c3df04 100644
23--- a/drivers/hwmon/max6639.c
24+++ b/drivers/hwmon/max6639.c
25@@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client)
26 struct max6639_data *data = i2c_get_clientdata(client);
27 struct max6639_platform_data *max6639_info =
28 client->dev.platform_data;
29- int i = 0;
30+ int i;
31 int rpm_range = 1; /* default: 4000 RPM */
32- int err = 0;
33+ int err;
34
35 /* Reset chip to default values, see below for GCONFIG setup */
36 err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
37@@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client)
38 else
39 data->ppr = 2;
40 data->ppr -= 1;
41- err = i2c_smbus_write_byte_data(client,
42- MAX6639_REG_FAN_PPR(i),
43- data->ppr << 5);
44- if (err)
45- goto exit;
46
47 if (max6639_info)
48 rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
49@@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client)
50
51 for (i = 0; i < 2; i++) {
52
53+ /* Set Fan pulse per revolution */
54+ err = i2c_smbus_write_byte_data(client,
55+ MAX6639_REG_FAN_PPR(i),
56+ data->ppr << 6);
57+ if (err)
58+ goto exit;
59+
60 /* Fans config PWM, RPM */
61 err = i2c_smbus_write_byte_data(client,
62 MAX6639_REG_FAN_CONFIG1(i),
63--
641.7.7.4
65
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0052-hwmon-ads1015-Fix-file-leak-in-probe-function.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0052-hwmon-ads1015-Fix-file-leak-in-probe-function.patch
new file mode 100644
index 00000000..9d8c30d0
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0052-hwmon-ads1015-Fix-file-leak-in-probe-function.patch
@@ -0,0 +1,43 @@
1From 4651f6ab6be87e326d7ed3820be6cedfca323e51 Mon Sep 17 00:00:00 2001
2From: Guenter Roeck <guenter.roeck@ericsson.com>
3Date: Wed, 22 Feb 2012 08:13:52 -0800
4Subject: [PATCH 52/73] hwmon: (ads1015) Fix file leak in probe function
5
6commit 363434b5dc352464ac7601547891e5fc9105f124 upstream.
7
8An error while creating sysfs attribute files in the driver's probe function
9results in an error abort, but already created files are not removed. This patch
10fixes the problem.
11
12Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
13Cc: Dirk Eibach <eibach@gdsys.de>
14Acked-by: Jean Delvare <khali@linux-fr.org>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 drivers/hwmon/ads1015.c | 3 +--
18 1 files changed, 1 insertions(+), 2 deletions(-)
19
20diff --git a/drivers/hwmon/ads1015.c b/drivers/hwmon/ads1015.c
21index eedca3c..dd87ae9 100644
22--- a/drivers/hwmon/ads1015.c
23+++ b/drivers/hwmon/ads1015.c
24@@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client,
25 continue;
26 err = device_create_file(&client->dev, &ads1015_in[k].dev_attr);
27 if (err)
28- goto exit_free;
29+ goto exit_remove;
30 }
31
32 data->hwmon_dev = hwmon_device_register(&client->dev);
33@@ -285,7 +285,6 @@ static int ads1015_probe(struct i2c_client *client,
34 exit_remove:
35 for (k = 0; k < ADS1015_CHANNELS; ++k)
36 device_remove_file(&client->dev, &ads1015_in[k].dev_attr);
37-exit_free:
38 kfree(data);
39 exit:
40 return err;
41--
421.7.7.4
43
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0053-ARM-omap-fix-oops-in-drivers-video-omap2-dss-dpi.c.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0053-ARM-omap-fix-oops-in-drivers-video-omap2-dss-dpi.c.patch
new file mode 100644
index 00000000..2366787d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0053-ARM-omap-fix-oops-in-drivers-video-omap2-dss-dpi.c.patch
@@ -0,0 +1,113 @@
1From 527cba8ab2a3c44aab030065446ebc8dbaa26f9c Mon Sep 17 00:00:00 2001
2From: Russell King <rmk+kernel@arm.linux.org.uk>
3Date: Tue, 7 Feb 2012 09:44:55 +0000
4Subject: [PATCH 53/73] ARM: omap: fix oops in drivers/video/omap2/dss/dpi.c
5
6commit 40410715715178ec196314dd0c19150c06901f80 upstream.
7
8When a PMIC is not found, this driver is unable to obtain its
9'vdds_dsi_reg' regulator. Even through its initialization function
10fails, other code still calls its enable function, which fails to
11check whether it has this regulator before asking for it to be enabled.
12
13This fixes the oops, however a better fix would be to sort out the
14upper layers to prevent them calling into a module which failed to
15initialize.
16
17Unable to handle kernel NULL pointer dereference at virtual address 00000038
18pgd = c0004000
19[00000038] *pgd=00000000
20Internal error: Oops: 5 [#1] PREEMPT
21Modules linked in:
22CPU: 0 Not tainted (3.3.0-rc2+ #228)
23PC is at regulator_enable+0x10/0x70
24LR is at omapdss_dpi_display_enable+0x54/0x15c
25pc : [<c01b9a08>] lr : [<c01af994>] psr: 60000013
26sp : c181fd90 ip : c181fdb0 fp : c181fdac
27r10: c042eff0 r9 : 00000060 r8 : c044a164
28r7 : c042c0e4 r6 : c042bd60 r5 : 00000000 r4 : c042bd60
29r3 : c084de48 r2 : c181e000 r1 : c042bd60 r0 : 00000000
30Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
31Control: 10c5387d Table: 80004019 DAC: 00000015
32Process swapper (pid: 1, stack limit = 0xc181e2e8)
33Stack: (0xc181fd90 to 0xc1820000)
34fd80: c001754c c042bd60 00000000 c042bd60
35fda0: c181fdcc c181fdb0 c01af994 c01b9a04 c0016104 c042bd60 c042bd60 c044a338
36fdc0: c181fdec c181fdd0 c01b5ed0 c01af94c c042bd60 c042bd60 c1aa8000 c1aa8a0c
37fde0: c181fe04 c181fdf0 c01b5f54 c01b5ea8 c02fc18c c042bd60 c181fe3c c181fe08
38fe00: c01b2a18 c01b5f48 c01aed14 c02fc160 c01df8ec 00000002 c042bd60 00000003
39fe20: c042bd60 c1aa8000 c1aa8a0c c042eff8 c181fe84 c181fe40 c01b3874 c01b29fc
40fe40: c042eff8 00000000 c042f000 c0449db8 c044ed78 00000000 c181fe74 c042eff8
41fe60: c042eff8 c0449db8 c0449db8 c044ed78 00000000 00000000 c181fe94 c181fe88
42fe80: c01e452c c01b35e8 c181feb4 c181fe98 c01e2fdc c01e4518 c042eff8 c0449db8
43fea0: c0449db8 c181fef0 c181fecc c181feb8 c01e3104 c01e2f48 c042eff8 c042f02c
44fec0: c181feec c181fed0 c01e3190 c01e30c0 c01e311c 00000000 c01e311c c0449db8
45fee0: c181ff14 c181fef0 c01e1998 c01e3128 c18330a8 c1892290 c04165e8 c0449db8
46ff00: c0449db8 c1ab60c0 c181ff24 c181ff18 c01e2e28 c01e194c c181ff54 c181ff28
47ff20: c01e2218 c01e2e14 c039afed c181ff38 c04165e8 c041660c c0449db8 00000013
48ff40: 00000000 c03ffdb8 c181ff7c c181ff58 c01e384c c01e217c c181ff7c c04165e8
49ff60: c041660c c003a37c 00000013 00000000 c181ff8c c181ff80 c01e488c c01e3790
50ff80: c181ff9c c181ff90 c03ffdcc c01e484c c181ffdc c181ffa0 c0008798 c03ffdc4
51ffa0: c181ffc4 c181ffb0 c0056440 c0187810 c003a37c c04165e8 c041660c c003a37c
52ffc0: 00000013 00000000 00000000 00000000 c181fff4 c181ffe0 c03ea284 c0008708
53ffe0: 00000000 c03ea208 00000000 c181fff8 c003a37c c03ea214 1073cec0 01f7ee08
54Backtrace:
55[<c01b99f8>] (regulator_enable+0x0/0x70) from [<c01af994>] (omapdss_dpi_display_enable+0x54/0x15c)
56 r6:c042bd60 r5:00000000 r4:c042bd60
57[<c01af940>] (omapdss_dpi_display_enable+0x0/0x15c) from [<c01b5ed0>] (generic_dpi_panel_power_on+0x34/0x78)
58 r6:c044a338 r5:c042bd60 r4:c042bd60
59[<c01b5e9c>] (generic_dpi_panel_power_on+0x0/0x78) from [<c01b5f54>] (generic_dpi_panel_enable+0x18/0x28)
60 r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:c042bd60
61[<c01b5f3c>] (generic_dpi_panel_enable+0x0/0x28) from [<c01b2a18>] (omapfb_init_display+0x28/0x150)
62 r4:c042bd60
63[<c01b29f0>] (omapfb_init_display+0x0/0x150) from [<c01b3874>] (omapfb_probe+0x298/0x318)
64 r8:c042eff8 r7:c1aa8a0c r6:c1aa8000 r5:c042bd60 r4:00000003
65[<c01b35dc>] (omapfb_probe+0x0/0x318) from [<c01e452c>] (platform_drv_probe+0x20/0x24)
66[<c01e450c>] (platform_drv_probe+0x0/0x24) from [<c01e2fdc>] (really_probe+0xa0/0x178)
67[<c01e2f3c>] (really_probe+0x0/0x178) from [<c01e3104>] (driver_probe_device+0x50/0x68)
68 r7:c181fef0 r6:c0449db8 r5:c0449db8 r4:c042eff8
69[<c01e30b4>] (driver_probe_device+0x0/0x68) from [<c01e3190>] (__driver_attach+0x74/0x98)
70 r5:c042f02c r4:c042eff8
71[<c01e311c>] (__driver_attach+0x0/0x98) from [<c01e1998>] (bus_for_each_dev+0x58/0x98)
72 r6:c0449db8 r5:c01e311c r4:00000000
73[<c01e1940>] (bus_for_each_dev+0x0/0x98) from [<c01e2e28>] (driver_attach+0x20/0x28)
74 r7:c1ab60c0 r6:c0449db8 r5:c0449db8 r4:c04165e8
75[<c01e2e08>] (driver_attach+0x0/0x28) from [<c01e2218>] (bus_add_driver+0xa8/0x22c)
76[<c01e2170>] (bus_add_driver+0x0/0x22c) from [<c01e384c>] (driver_register+0xc8/0x154)
77[<c01e3784>] (driver_register+0x0/0x154) from [<c01e488c>] (platform_driver_register+0x4c/0x60)
78 r8:00000000 r7:00000013 r6:c003a37c r5:c041660c r4:c04165e8
79[<c01e4840>] (platform_driver_register+0x0/0x60) from [<c03ffdcc>] (omapfb_init+0x14/0x34)
80[<c03ffdb8>] (omapfb_init+0x0/0x34) from [<c0008798>] (do_one_initcall+0x9c/0x164)
81[<c00086fc>] (do_one_initcall+0x0/0x164) from [<c03ea284>] (kernel_init+0x7c/0x120)
82[<c03ea208>] (kernel_init+0x0/0x120) from [<c003a37c>] (do_exit+0x0/0x2d8)
83 r5:c03ea208 r4:00000000
84Code: e1a0c00d e92dd870 e24cb004 e24dd004 (e5906038)
85---[ end trace 9e2474c2e193b223 ]---
86
87Acked-by: Tony Lindgren <tony@atomide.com>
88Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
89Cc: Igor Grinberg <grinberg@compulab.co.il>
90Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
91---
92 drivers/video/omap2/dss/dpi.c | 5 +++++
93 1 files changed, 5 insertions(+), 0 deletions(-)
94
95diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
96index 976ac23..c04205c 100644
97--- a/drivers/video/omap2/dss/dpi.c
98+++ b/drivers/video/omap2/dss/dpi.c
99@@ -180,6 +180,11 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
100 {
101 int r;
102
103+ if (cpu_is_omap34xx() && !dpi.vdds_dsi_reg) {
104+ DSSERR("no VDSS_DSI regulator\n");
105+ return -ENODEV;
106+ }
107+
108 if (dssdev->manager == NULL) {
109 DSSERR("failed to enable display: no manager\n");
110 return -ENODEV;
111--
1121.7.7.4
113
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0054-ARM-omap-fix-oops-in-arch-arm-mach-omap2-vp.c-when-p.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0054-ARM-omap-fix-oops-in-arch-arm-mach-omap2-vp.c-when-p.patch
new file mode 100644
index 00000000..6d70b402
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0054-ARM-omap-fix-oops-in-arch-arm-mach-omap2-vp.c-when-p.patch
@@ -0,0 +1,74 @@
1From 758e4d3da5bc2a30a7618cb8f1710e096dac0e53 Mon Sep 17 00:00:00 2001
2From: Russell King <rmk+kernel@arm.linux.org.uk>
3Date: Tue, 7 Feb 2012 09:42:11 +0000
4Subject: [PATCH 54/73] ARM: omap: fix oops in arch/arm/mach-omap2/vp.c when
5 pmic is not found
6
7commit d980e0f8d858c6963d676013e976ff00ab7acb2b upstream.
8
9When the PMIC is not found, voltdm->pmic will be NULL. vp.c's
10initialization function tries to dereferences this, which causes an
11oops:
12
13Unable to handle kernel NULL pointer dereference at virtual address 00000000
14pgd = c0004000
15[00000000] *pgd=00000000
16Internal error: Oops: 5 [#1] PREEMPT
17Modules linked in:
18CPU: 0 Not tainted (3.3.0-rc2+ #204)
19PC is at omap_vp_init+0x5c/0x15c
20LR is at omap_vp_init+0x58/0x15c
21pc : [<c03db880>] lr : [<c03db87c>] psr: 60000013
22sp : c181ff30 ip : c181ff68 fp : c181ff64
23r10: c0407808 r9 : c040786c r8 : c0407814
24r7 : c0026868 r6 : c00264fc r5 : c040ad6c r4 : 00000000
25r3 : 00000040 r2 : 000032c8 r1 : 0000fa00 r0 : 000032c8
26Flags: nZCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
27Control: 10c5387d Table: 80004019 DAC: 00000015
28Process swapper (pid: 1, stack limit = 0xc181e2e8)
29Stack: (0xc181ff30 to 0xc1820000)
30ff20: c0381d00 c02e9c6d c0383582 c040786c
31ff40: c040ad6c c00264fc c0026868 c0407814 00000000 c03d9de4 c181ff8c c181ff68
32ff60: c03db448 c03db830 c02e982c c03fdfb8 c03fe004 c0039988 00000013 00000000
33ff80: c181ff9c c181ff90 c03d9df8 c03db390 c181ffdc c181ffa0 c0008798 c03d9df0
34ffa0: c181ffc4 c181ffb0 c0055a44 c0187050 c0039988 c03fdfb8 c03fe004 c0039988
35ffc0: 00000013 00000000 00000000 00000000 c181fff4 c181ffe0 c03d1284 c0008708
36ffe0: 00000000 c03d1208 00000000 c181fff8 c0039988 c03d1214 1077ce40 01f7ee08
37Backtrace:
38[<c03db824>] (omap_vp_init+0x0/0x15c) from [<c03db448>] (omap_voltage_late_init+0xc4/0xfc)
39[<c03db384>] (omap_voltage_late_init+0x0/0xfc) from [<c03d9df8>] (omap2_common_pm_late_init+0x14/0x54)
40 r8:00000000 r7:00000013 r6:c0039988 r5:c03fe004 r4:c03fdfb8
41[<c03d9de4>] (omap2_common_pm_late_init+0x0/0x54) from [<c0008798>] (do_one_initcall+0x9c/0x164)
42[<c00086fc>] (do_one_initcall+0x0/0x164) from [<c03d1284>] (kernel_init+0x7c/0x120)
43[<c03d1208>] (kernel_init+0x0/0x120) from [<c0039988>] (do_exit+0x0/0x2cc)
44 r5:c03d1208 r4:00000000
45Code: e5ca300b e5900034 ebf69027 e5994024 (e5941000)
46---[ end trace aed617dddaf32c3d ]---
47Kernel panic - not syncing: Attempted to kill init!
48
49Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
50Cc: Igor Grinberg <grinberg@compulab.co.il>
51Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
52---
53 arch/arm/mach-omap2/vp.c | 5 +++++
54 1 files changed, 5 insertions(+), 0 deletions(-)
55
56diff --git a/arch/arm/mach-omap2/vp.c b/arch/arm/mach-omap2/vp.c
57index 66bd700..3b52027 100644
58--- a/arch/arm/mach-omap2/vp.c
59+++ b/arch/arm/mach-omap2/vp.c
60@@ -41,6 +41,11 @@ void __init omap_vp_init(struct voltagedomain *voltdm)
61 u32 val, sys_clk_rate, timeout, waittime;
62 u32 vddmin, vddmax, vstepmin, vstepmax;
63
64+ if (!voltdm->pmic || !voltdm->pmic->uv_to_vsel) {
65+ pr_err("%s: No PMIC info for vdd_%s\n", __func__, voltdm->name);
66+ return;
67+ }
68+
69 if (!voltdm->read || !voltdm->write) {
70 pr_err("%s: No read/write API for accessing vdd_%s regs\n",
71 __func__, voltdm->name);
72--
731.7.7.4
74
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0055-x86-amd-Fix-L1i-and-L2-cache-sharing-information-for.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0055-x86-amd-Fix-L1i-and-L2-cache-sharing-information-for.patch
new file mode 100644
index 00000000..4a6f533d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0055-x86-amd-Fix-L1i-and-L2-cache-sharing-information-for.patch
@@ -0,0 +1,100 @@
1From 03fedc5c56706c1bd0528a2dfab590f3b7cd9d1d Mon Sep 17 00:00:00 2001
2From: Andreas Herrmann <andreas.herrmann3@amd.com>
3Date: Wed, 8 Feb 2012 20:52:29 +0100
4Subject: [PATCH 55/73] x86/amd: Fix L1i and L2 cache sharing information for
5 AMD family 15h processors
6
7commit 32c3233885eb10ac9cb9410f2f8cd64b8df2b2a1 upstream.
8
9For L1 instruction cache and L2 cache the shared CPU information
10is wrong. On current AMD family 15h CPUs those caches are shared
11between both cores of a compute unit.
12
13This fixes https://bugzilla.kernel.org/show_bug.cgi?id=42607
14
15Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
16Cc: Petkov Borislav <Borislav.Petkov@amd.com>
17Cc: Dave Jones <davej@redhat.com>
18Link: http://lkml.kernel.org/r/20120208195229.GA17523@alberich.amd.com
19Signed-off-by: Ingo Molnar <mingo@elte.hu>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 arch/x86/kernel/cpu/intel_cacheinfo.c | 44 +++++++++++++++++++++++++++------
23 1 files changed, 36 insertions(+), 8 deletions(-)
24
25diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
26index a3b0811..0e89635 100644
27--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
28+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
29@@ -326,8 +326,7 @@ static void __cpuinit amd_calc_l3_indices(struct amd_northbridge *nb)
30 l3->indices = (max(max3(sc0, sc1, sc2), sc3) << 10) - 1;
31 }
32
33-static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf,
34- int index)
35+static void __cpuinit amd_init_l3_cache(struct _cpuid4_info_regs *this_leaf, int index)
36 {
37 int node;
38
39@@ -725,14 +724,16 @@ static DEFINE_PER_CPU(struct _cpuid4_info *, ici_cpuid4_info);
40 #define CPUID4_INFO_IDX(x, y) (&((per_cpu(ici_cpuid4_info, x))[y]))
41
42 #ifdef CONFIG_SMP
43-static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
44+
45+static int __cpuinit cache_shared_amd_cpu_map_setup(unsigned int cpu, int index)
46 {
47- struct _cpuid4_info *this_leaf, *sibling_leaf;
48- unsigned long num_threads_sharing;
49- int index_msb, i, sibling;
50+ struct _cpuid4_info *this_leaf;
51+ int ret, i, sibling;
52 struct cpuinfo_x86 *c = &cpu_data(cpu);
53
54- if ((index == 3) && (c->x86_vendor == X86_VENDOR_AMD)) {
55+ ret = 0;
56+ if (index == 3) {
57+ ret = 1;
58 for_each_cpu(i, cpu_llc_shared_mask(cpu)) {
59 if (!per_cpu(ici_cpuid4_info, i))
60 continue;
61@@ -743,8 +744,35 @@ static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
62 set_bit(sibling, this_leaf->shared_cpu_map);
63 }
64 }
65- return;
66+ } else if ((c->x86 == 0x15) && ((index == 1) || (index == 2))) {
67+ ret = 1;
68+ for_each_cpu(i, cpu_sibling_mask(cpu)) {
69+ if (!per_cpu(ici_cpuid4_info, i))
70+ continue;
71+ this_leaf = CPUID4_INFO_IDX(i, index);
72+ for_each_cpu(sibling, cpu_sibling_mask(cpu)) {
73+ if (!cpu_online(sibling))
74+ continue;
75+ set_bit(sibling, this_leaf->shared_cpu_map);
76+ }
77+ }
78 }
79+
80+ return ret;
81+}
82+
83+static void __cpuinit cache_shared_cpu_map_setup(unsigned int cpu, int index)
84+{
85+ struct _cpuid4_info *this_leaf, *sibling_leaf;
86+ unsigned long num_threads_sharing;
87+ int index_msb, i;
88+ struct cpuinfo_x86 *c = &cpu_data(cpu);
89+
90+ if (c->x86_vendor == X86_VENDOR_AMD) {
91+ if (cache_shared_amd_cpu_map_setup(cpu, index))
92+ return;
93+ }
94+
95 this_leaf = CPUID4_INFO_IDX(cpu, index);
96 num_threads_sharing = 1 + this_leaf->base.eax.split.num_threads_sharing;
97
98--
991.7.7.4
100
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0056-ath9k-stop-on-rates-with-idx-1-in-ath9k-rate-control.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0056-ath9k-stop-on-rates-with-idx-1-in-ath9k-rate-control.patch
new file mode 100644
index 00000000..eb8d50a2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0056-ath9k-stop-on-rates-with-idx-1-in-ath9k-rate-control.patch
@@ -0,0 +1,41 @@
1From 72633f08ad74b93530b8e038041c450492a00ed5 Mon Sep 17 00:00:00 2001
2From: Pavel Roskin <proski@gnu.org>
3Date: Sat, 11 Feb 2012 10:01:53 -0500
4Subject: [PATCH 56/73] ath9k: stop on rates with idx -1 in ath9k rate
5 control's .tx_status
6
7commit 2504a6423b9ab4c36df78227055995644de19edb upstream.
8
9Rate control algorithms are supposed to stop processing when they
10encounter a rate with the index -1. Checking for rate->count not being
11zero is not enough.
12
13Allowing a rate with negative index leads to memory corruption in
14ath_debug_stat_rc().
15
16One consequence of the bug is discussed at
17https://bugzilla.redhat.com/show_bug.cgi?id=768639
18
19Signed-off-by: Pavel Roskin <proski@gnu.org>
20Signed-off-by: John W. Linville <linville@tuxdriver.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22---
23 drivers/net/wireless/ath/ath9k/rc.c | 2 +-
24 1 files changed, 1 insertions(+), 1 deletions(-)
25
26diff --git a/drivers/net/wireless/ath/ath9k/rc.c b/drivers/net/wireless/ath/ath9k/rc.c
27index 528d5f3..64af11f 100644
28--- a/drivers/net/wireless/ath/ath9k/rc.c
29+++ b/drivers/net/wireless/ath/ath9k/rc.c
30@@ -1347,7 +1347,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
31 fc = hdr->frame_control;
32 for (i = 0; i < sc->hw->max_rates; i++) {
33 struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];
34- if (!rate->count)
35+ if (rate->idx < 0 || !rate->count)
36 break;
37
38 final_ts_idx = i;
39--
401.7.7.4
41
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0057-genirq-Unmask-oneshot-irqs-when-thread-was-not-woken.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0057-genirq-Unmask-oneshot-irqs-when-thread-was-not-woken.patch
new file mode 100644
index 00000000..247270a1
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0057-genirq-Unmask-oneshot-irqs-when-thread-was-not-woken.patch
@@ -0,0 +1,81 @@
1From aa0eb3474beae8f6d9dcc2311dc02bea50cfd7b7 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Tue, 7 Feb 2012 17:58:03 +0100
4Subject: [PATCH 57/73] genirq: Unmask oneshot irqs when thread was not woken
5
6commit ac5637611150281f398bb7a47e3fcb69a09e7803 upstream.
7
8When the primary handler of an interrupt which is marked IRQ_ONESHOT
9returns IRQ_HANDLED or IRQ_NONE, then the interrupt thread is not
10woken and the unmask logic of the interrupt line is never
11invoked. This keeps the interrupt masked forever.
12
13This was not noticed as most IRQ_ONESHOT users wake the thread
14unconditionally (usually because they cannot access the underlying
15device from hard interrupt context). Though this behaviour was nowhere
16documented and not necessarily intentional. Some drivers can avoid the
17thread wakeup in certain cases and run into the situation where the
18interrupt line s kept masked.
19
20Handle it gracefully.
21
22Reported-and-tested-by: Lothar Wassmann <lw@karo-electronics.de>
23Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 kernel/irq/chip.c | 25 +++++++++++++++++++++++--
27 1 files changed, 23 insertions(+), 2 deletions(-)
28
29diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
30index f7c543a..b742edc 100644
31--- a/kernel/irq/chip.c
32+++ b/kernel/irq/chip.c
33@@ -330,6 +330,24 @@ out_unlock:
34 }
35 EXPORT_SYMBOL_GPL(handle_simple_irq);
36
37+/*
38+ * Called unconditionally from handle_level_irq() and only for oneshot
39+ * interrupts from handle_fasteoi_irq()
40+ */
41+static void cond_unmask_irq(struct irq_desc *desc)
42+{
43+ /*
44+ * We need to unmask in the following cases:
45+ * - Standard level irq (IRQF_ONESHOT is not set)
46+ * - Oneshot irq which did not wake the thread (caused by a
47+ * spurious interrupt or a primary handler handling it
48+ * completely).
49+ */
50+ if (!irqd_irq_disabled(&desc->irq_data) &&
51+ irqd_irq_masked(&desc->irq_data) && !desc->threads_oneshot)
52+ unmask_irq(desc);
53+}
54+
55 /**
56 * handle_level_irq - Level type irq handler
57 * @irq: the interrupt number
58@@ -362,8 +380,8 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
59
60 handle_irq_event(desc);
61
62- if (!irqd_irq_disabled(&desc->irq_data) && !(desc->istate & IRQS_ONESHOT))
63- unmask_irq(desc);
64+ cond_unmask_irq(desc);
65+
66 out_unlock:
67 raw_spin_unlock(&desc->lock);
68 }
69@@ -417,6 +435,9 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
70 preflow_handler(desc);
71 handle_irq_event(desc);
72
73+ if (desc->istate & IRQS_ONESHOT)
74+ cond_unmask_irq(desc);
75+
76 out_eoi:
77 desc->irq_data.chip->irq_eoi(&desc->irq_data);
78 out_unlock:
79--
801.7.7.4
81
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0058-genirq-Handle-pending-irqs-in-irq_startup.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0058-genirq-Handle-pending-irqs-in-irq_startup.patch
new file mode 100644
index 00000000..4569e02a
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0058-genirq-Handle-pending-irqs-in-irq_startup.patch
@@ -0,0 +1,117 @@
1From 37ef0e621b065f2d9e1c37ff42a37d6bd74bf039 Mon Sep 17 00:00:00 2001
2From: Thomas Gleixner <tglx@linutronix.de>
3Date: Wed, 8 Feb 2012 11:57:52 +0100
4Subject: [PATCH 58/73] genirq: Handle pending irqs in irq_startup()
5
6commit b4bc724e82e80478cba5fe9825b62e71ddf78757 upstream.
7
8An interrupt might be pending when irq_startup() is called, but the
9startup code does not invoke the resend logic. In some cases this
10prevents the device from issuing another interrupt which renders the
11device non functional.
12
13Call the resend function in irq_startup() to keep things going.
14
15Reported-and-tested-by: Russell King <rmk+kernel@arm.linux.org.uk>
16Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 kernel/irq/autoprobe.c | 4 ++--
20 kernel/irq/chip.c | 17 ++++++++++-------
21 kernel/irq/internals.h | 2 +-
22 kernel/irq/manage.c | 2 +-
23 4 files changed, 14 insertions(+), 11 deletions(-)
24
25diff --git a/kernel/irq/autoprobe.c b/kernel/irq/autoprobe.c
26index 342d8f4..0119b9d 100644
27--- a/kernel/irq/autoprobe.c
28+++ b/kernel/irq/autoprobe.c
29@@ -53,7 +53,7 @@ unsigned long probe_irq_on(void)
30 if (desc->irq_data.chip->irq_set_type)
31 desc->irq_data.chip->irq_set_type(&desc->irq_data,
32 IRQ_TYPE_PROBE);
33- irq_startup(desc);
34+ irq_startup(desc, false);
35 }
36 raw_spin_unlock_irq(&desc->lock);
37 }
38@@ -70,7 +70,7 @@ unsigned long probe_irq_on(void)
39 raw_spin_lock_irq(&desc->lock);
40 if (!desc->action && irq_settings_can_probe(desc)) {
41 desc->istate |= IRQS_AUTODETECT | IRQS_WAITING;
42- if (irq_startup(desc))
43+ if (irq_startup(desc, false))
44 desc->istate |= IRQS_PENDING;
45 }
46 raw_spin_unlock_irq(&desc->lock);
47diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
48index b742edc..fb7db75 100644
49--- a/kernel/irq/chip.c
50+++ b/kernel/irq/chip.c
51@@ -157,19 +157,22 @@ static void irq_state_set_masked(struct irq_desc *desc)
52 irqd_set(&desc->irq_data, IRQD_IRQ_MASKED);
53 }
54
55-int irq_startup(struct irq_desc *desc)
56+int irq_startup(struct irq_desc *desc, bool resend)
57 {
58+ int ret = 0;
59+
60 irq_state_clr_disabled(desc);
61 desc->depth = 0;
62
63 if (desc->irq_data.chip->irq_startup) {
64- int ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
65+ ret = desc->irq_data.chip->irq_startup(&desc->irq_data);
66 irq_state_clr_masked(desc);
67- return ret;
68+ } else {
69+ irq_enable(desc);
70 }
71-
72- irq_enable(desc);
73- return 0;
74+ if (resend)
75+ check_irq_resend(desc, desc->irq_data.irq);
76+ return ret;
77 }
78
79 void irq_shutdown(struct irq_desc *desc)
80@@ -646,7 +649,7 @@ __irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
81 irq_settings_set_noprobe(desc);
82 irq_settings_set_norequest(desc);
83 irq_settings_set_nothread(desc);
84- irq_startup(desc);
85+ irq_startup(desc, true);
86 }
87 out:
88 irq_put_desc_busunlock(desc, flags);
89diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h
90index a73dd6c..e1a8b64 100644
91--- a/kernel/irq/internals.h
92+++ b/kernel/irq/internals.h
93@@ -67,7 +67,7 @@ extern int __irq_set_trigger(struct irq_desc *desc, unsigned int irq,
94 extern void __disable_irq(struct irq_desc *desc, unsigned int irq, bool susp);
95 extern void __enable_irq(struct irq_desc *desc, unsigned int irq, bool resume);
96
97-extern int irq_startup(struct irq_desc *desc);
98+extern int irq_startup(struct irq_desc *desc, bool resend);
99 extern void irq_shutdown(struct irq_desc *desc);
100 extern void irq_enable(struct irq_desc *desc);
101 extern void irq_disable(struct irq_desc *desc);
102diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
103index 1da999f..cf2d7ae 100644
104--- a/kernel/irq/manage.c
105+++ b/kernel/irq/manage.c
106@@ -1027,7 +1027,7 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new)
107 desc->istate |= IRQS_ONESHOT;
108
109 if (irq_settings_can_autoenable(desc))
110- irq_startup(desc);
111+ irq_startup(desc, true);
112 else
113 /* Undo nested disables: */
114 desc->depth = 1;
115--
1161.7.7.4
117
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0059-scsi_scan-Fix-Poison-overwritten-warning-caused-by-u.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0059-scsi_scan-Fix-Poison-overwritten-warning-caused-by-u.patch
new file mode 100644
index 00000000..1f9fcd1d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0059-scsi_scan-Fix-Poison-overwritten-warning-caused-by-u.patch
@@ -0,0 +1,104 @@
1From 0234f0569820c617e90b0ced54a345705cee031b Mon Sep 17 00:00:00 2001
2From: Huajun Li <huajun.li.lee@gmail.com>
3Date: Sun, 12 Feb 2012 19:59:14 +0800
4Subject: [PATCH 59/73] scsi_scan: Fix 'Poison overwritten' warning caused by
5 using freed 'shost'
6
7commit 267a6ad4aefaafbde607804c60945bcf97f91c1b upstream.
8
9In do_scan_async(), calling scsi_autopm_put_host(shost) may reference
10freed shost, and cause Posison overwitten warning.
11Yes, this case can happen, for example, an USB is disconnected just
12when do_scan_async() thread starts to run, then scsi_host_put() called
13in scsi_finish_async_scan() will lead to shost be freed(because the
14refcount of shost->shost_gendev decreases to 1 after USB disconnects),
15at this point, if references shost again, system will show following
16warning msg.
17
18To make scsi_autopm_put_host(shost) always reference a valid shost,
19put it just before scsi_host_put() in function
20scsi_finish_async_scan().
21
22[ 299.281565] =============================================================================
23[ 299.281634] BUG kmalloc-4096 (Tainted: G I ): Poison overwritten
24[ 299.281682] -----------------------------------------------------------------------------
25[ 299.281684]
26[ 299.281752] INFO: 0xffff880056c305d0-0xffff880056c305d0. First byte
270x6a instead of 0x6b
28[ 299.281816] INFO: Allocated in scsi_host_alloc+0x4a/0x490 age=1688
29cpu=1 pid=2004
30[ 299.281870] __slab_alloc+0x617/0x6c1
31[ 299.281901] __kmalloc+0x28c/0x2e0
32[ 299.281931] scsi_host_alloc+0x4a/0x490
33[ 299.281966] usb_stor_probe1+0x5b/0xc40 [usb_storage]
34[ 299.282010] storage_probe+0xa4/0xe0 [usb_storage]
35[ 299.282062] usb_probe_interface+0x172/0x330 [usbcore]
36[ 299.282105] driver_probe_device+0x257/0x3b0
37[ 299.282138] __driver_attach+0x103/0x110
38[ 299.282171] bus_for_each_dev+0x8e/0xe0
39[ 299.282201] driver_attach+0x26/0x30
40[ 299.282230] bus_add_driver+0x1c4/0x430
41[ 299.282260] driver_register+0xb6/0x230
42[ 299.282298] usb_register_driver+0xe5/0x270 [usbcore]
43[ 299.282337] 0xffffffffa04ab03d
44[ 299.282364] do_one_initcall+0x47/0x230
45[ 299.282396] sys_init_module+0xa0f/0x1fe0
46[ 299.282429] INFO: Freed in scsi_host_dev_release+0x18a/0x1d0 age=85
47cpu=0 pid=2008
48[ 299.282482] __slab_free+0x3c/0x2a1
49[ 299.282510] kfree+0x296/0x310
50[ 299.282536] scsi_host_dev_release+0x18a/0x1d0
51[ 299.282574] device_release+0x74/0x100
52[ 299.282606] kobject_release+0xc7/0x2a0
53[ 299.282637] kobject_put+0x54/0xa0
54[ 299.282668] put_device+0x27/0x40
55[ 299.282694] scsi_host_put+0x1d/0x30
56[ 299.282723] do_scan_async+0x1fc/0x2b0
57[ 299.282753] kthread+0xdf/0xf0
58[ 299.282782] kernel_thread_helper+0x4/0x10
59[ 299.282817] INFO: Slab 0xffffea00015b0c00 objects=7 used=7 fp=0x
60 (null) flags=0x100000000004080
61[ 299.282882] INFO: Object 0xffff880056c30000 @offset=0 fp=0x (null)
62[ 299.282884]
63...
64
65Signed-off-by: Huajun Li <huajun.li.lee@gmail.com>
66Acked-by: Alan Stern <stern@rowland.harvard.edu>
67Signed-off-by: James Bottomley <JBottomley@Parallels.com>
68Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
69---
70 drivers/scsi/scsi_scan.c | 4 ++--
71 1 files changed, 2 insertions(+), 2 deletions(-)
72
73diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
74index b3c6d95..6e7ea4a 100644
75--- a/drivers/scsi/scsi_scan.c
76+++ b/drivers/scsi/scsi_scan.c
77@@ -1815,6 +1815,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data)
78 }
79 spin_unlock(&async_scan_lock);
80
81+ scsi_autopm_put_host(shost);
82 scsi_host_put(shost);
83 kfree(data);
84 }
85@@ -1841,7 +1842,6 @@ static int do_scan_async(void *_data)
86
87 do_scsi_scan_host(shost);
88 scsi_finish_async_scan(data);
89- scsi_autopm_put_host(shost);
90 return 0;
91 }
92
93@@ -1869,7 +1869,7 @@ void scsi_scan_host(struct Scsi_Host *shost)
94 p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
95 if (IS_ERR(p))
96 do_scan_async(data);
97- /* scsi_autopm_put_host(shost) is called in do_scan_async() */
98+ /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
99 }
100 EXPORT_SYMBOL(scsi_scan_host);
101
102--
1031.7.7.4
104
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0060-scsi_pm-Fix-bug-in-the-SCSI-power-management-handler.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0060-scsi_pm-Fix-bug-in-the-SCSI-power-management-handler.patch
new file mode 100644
index 00000000..9eb67f65
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0060-scsi_pm-Fix-bug-in-the-SCSI-power-management-handler.patch
@@ -0,0 +1,106 @@
1From 8c1c1c37c29906c94fb030261e1687c8197cc2af Mon Sep 17 00:00:00 2001
2From: Alan Stern <stern@rowland.harvard.edu>
3Date: Fri, 17 Feb 2012 16:25:08 -0500
4Subject: [PATCH 60/73] scsi_pm: Fix bug in the SCSI power management handler
5
6commit fea6d607e154cf96ab22254ccb48addfd43d4cb5 upstream.
7
8This patch (as1520) fixes a bug in the SCSI layer's power management
9implementation.
10
11LUN scanning can be carried out asynchronously in do_scan_async(), and
12sd uses an asynchronous thread for the time-consuming parts of disk
13probing in sd_probe_async(). Currently nothing coordinates these
14async threads with system sleep transitions; they can and do attempt
15to continue scanning/probing SCSI devices even after the host adapter
16has been suspended. As one might expect, the outcome is not ideal.
17
18This is what the "prepare" stage of system suspend was created for.
19After the prepare callback has been called for a host, target, or
20device, drivers are not allowed to register any children underneath
21them. Currently the SCSI prepare callback is not implemented; this
22patch rectifies that omission.
23
24For SCSI hosts, the prepare routine calls scsi_complete_async_scans()
25to wait until async scanning is finished. It might be slightly more
26efficient to wait only until the host in question has been scanned,
27but there's currently no way to do that. Besides, during a sleep
28transition we will ultimately have to wait until all the host scanning
29has finished anyway.
30
31For SCSI devices, the prepare routine calls async_synchronize_full()
32to wait until sd probing is finished. The routine does nothing for
33SCSI targets, because asynchronous target scanning is done only as
34part of host scanning.
35
36Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
37Signed-off-by: James Bottomley <JBottomley@Parallels.com>
38Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
39---
40 drivers/scsi/scsi_pm.c | 16 ++++++++++++++++
41 drivers/scsi/scsi_priv.h | 1 +
42 2 files changed, 17 insertions(+), 0 deletions(-)
43
44diff --git a/drivers/scsi/scsi_pm.c b/drivers/scsi/scsi_pm.c
45index d329f8b..2aeaf5c 100644
46--- a/drivers/scsi/scsi_pm.c
47+++ b/drivers/scsi/scsi_pm.c
48@@ -7,6 +7,7 @@
49
50 #include <linux/pm_runtime.h>
51 #include <linux/export.h>
52+#include <linux/async.h>
53
54 #include <scsi/scsi.h>
55 #include <scsi/scsi_device.h>
56@@ -69,6 +70,19 @@ static int scsi_bus_resume_common(struct device *dev)
57 return err;
58 }
59
60+static int scsi_bus_prepare(struct device *dev)
61+{
62+ if (scsi_is_sdev_device(dev)) {
63+ /* sd probing uses async_schedule. Wait until it finishes. */
64+ async_synchronize_full();
65+
66+ } else if (scsi_is_host_device(dev)) {
67+ /* Wait until async scanning is finished */
68+ scsi_complete_async_scans();
69+ }
70+ return 0;
71+}
72+
73 static int scsi_bus_suspend(struct device *dev)
74 {
75 return scsi_bus_suspend_common(dev, PMSG_SUSPEND);
76@@ -87,6 +101,7 @@ static int scsi_bus_poweroff(struct device *dev)
77 #else /* CONFIG_PM_SLEEP */
78
79 #define scsi_bus_resume_common NULL
80+#define scsi_bus_prepare NULL
81 #define scsi_bus_suspend NULL
82 #define scsi_bus_freeze NULL
83 #define scsi_bus_poweroff NULL
84@@ -195,6 +210,7 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
85 #endif /* CONFIG_PM_RUNTIME */
86
87 const struct dev_pm_ops scsi_bus_pm_ops = {
88+ .prepare = scsi_bus_prepare,
89 .suspend = scsi_bus_suspend,
90 .resume = scsi_bus_resume_common,
91 .freeze = scsi_bus_freeze,
92diff --git a/drivers/scsi/scsi_priv.h b/drivers/scsi/scsi_priv.h
93index 2a58895..5b475d0 100644
94--- a/drivers/scsi/scsi_priv.h
95+++ b/drivers/scsi/scsi_priv.h
96@@ -110,6 +110,7 @@ extern void scsi_exit_procfs(void);
97 #endif /* CONFIG_PROC_FS */
98
99 /* scsi_scan.c */
100+extern int scsi_complete_async_scans(void);
101 extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
102 unsigned int, unsigned int, int);
103 extern void scsi_forget_host(struct Scsi_Host *);
104--
1051.7.7.4
106
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0061-ipvs-fix-matching-of-fwmark-templates-during-schedul.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0061-ipvs-fix-matching-of-fwmark-templates-during-schedul.patch
new file mode 100644
index 00000000..ed64dbc2
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0061-ipvs-fix-matching-of-fwmark-templates-during-schedul.patch
@@ -0,0 +1,47 @@
1From 9b83c78d644ae794f0ec3cf7a4722c613b947913 Mon Sep 17 00:00:00 2001
2From: Simon Horman <horms@verge.net.au>
3Date: Fri, 27 Jan 2012 10:45:27 +0900
4Subject: [PATCH 61/73] ipvs: fix matching of fwmark templates during
5 scheduling
6
7commit e0aac52e17a3db68fe2ceae281780a70fc69957f upstream.
8
9 Commit f11017ec2d1859c661f4e2b12c4a8d250e1f47cf (2.6.37)
10moved the fwmark variable in subcontext that is invalidated before
11reaching the ip_vs_ct_in_get call. As vaddr is provided as pointer
12in the param structure make sure the fwmark variable is in
13same context. As the fwmark templates can not be matched,
14more and more template connections are created and the
15controlled connections can not go to single real server.
16
17Signed-off-by: Julian Anastasov <ja@ssi.bg>
18Signed-off-by: Simon Horman <horms@verge.net.au>
19Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
20Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21---
22 net/netfilter/ipvs/ip_vs_core.c | 2 +-
23 1 files changed, 1 insertions(+), 1 deletions(-)
24
25diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
26index 093cc32..6dc7d7d 100644
27--- a/net/netfilter/ipvs/ip_vs_core.c
28+++ b/net/netfilter/ipvs/ip_vs_core.c
29@@ -232,6 +232,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
30 __be16 dport = 0; /* destination port to forward */
31 unsigned int flags;
32 struct ip_vs_conn_param param;
33+ const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
34 union nf_inet_addr snet; /* source network of the client,
35 after masking */
36
37@@ -267,7 +268,6 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
38 {
39 int protocol = iph.protocol;
40 const union nf_inet_addr *vaddr = &iph.daddr;
41- const union nf_inet_addr fwmark = { .ip = htonl(svc->fwmark) };
42 __be16 vport = 0;
43
44 if (dst_port == svc->port) {
45--
461.7.7.4
47
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0062-jme-Fix-FIFO-flush-issue.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0062-jme-Fix-FIFO-flush-issue.patch
new file mode 100644
index 00000000..6efc1c28
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0062-jme-Fix-FIFO-flush-issue.patch
@@ -0,0 +1,63 @@
1From 5fbc730462e4c65e83bc343c4d3f97292b867ff7 Mon Sep 17 00:00:00 2001
2From: Guo-Fu Tseng <cooldavid@cooldavid.org>
3Date: Wed, 22 Feb 2012 08:58:10 +0000
4Subject: [PATCH 62/73] jme: Fix FIFO flush issue
5
6commit ba9adbe67e288823ac1deb7f11576ab5653f833e upstream.
7
8Set the RX FIFO flush watermark lower.
9According to Federico and JMicron's reply,
10setting it to 16QW would be stable on most platforms.
11Otherwise, user might experience packet drop issue.
12
13Reported-by: Federico Quagliata <federico@quagliata.org>
14Fixed-by: Federico Quagliata <federico@quagliata.org>
15Signed-off-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
16Signed-off-by: David S. Miller <davem@davemloft.net>
17Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
18---
19 drivers/net/ethernet/jme.c | 10 +---------
20 drivers/net/ethernet/jme.h | 2 +-
21 2 files changed, 2 insertions(+), 10 deletions(-)
22
23diff --git a/drivers/net/ethernet/jme.c b/drivers/net/ethernet/jme.c
24index 76b8457..ab784e0 100644
25--- a/drivers/net/ethernet/jme.c
26+++ b/drivers/net/ethernet/jme.c
27@@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu)
28 ((new_mtu) < IPV6_MIN_MTU))
29 return -EINVAL;
30
31- if (new_mtu > 4000) {
32- jme->reg_rxcs &= ~RXCS_FIFOTHNP;
33- jme->reg_rxcs |= RXCS_FIFOTHNP_64QW;
34- jme_restart_rx_engine(jme);
35- } else {
36- jme->reg_rxcs &= ~RXCS_FIFOTHNP;
37- jme->reg_rxcs |= RXCS_FIFOTHNP_128QW;
38- jme_restart_rx_engine(jme);
39- }
40
41 netdev->mtu = new_mtu;
42 netdev_update_features(netdev);
43
44+ jme_restart_rx_engine(jme);
45 jme_reset_link(jme);
46
47 return 0;
48diff --git a/drivers/net/ethernet/jme.h b/drivers/net/ethernet/jme.h
49index 4304072..3efc897 100644
50--- a/drivers/net/ethernet/jme.h
51+++ b/drivers/net/ethernet/jme.h
52@@ -730,7 +730,7 @@ enum jme_rxcs_values {
53 RXCS_RETRYCNT_60 = 0x00000F00,
54
55 RXCS_DEFAULT = RXCS_FIFOTHTP_128T |
56- RXCS_FIFOTHNP_128QW |
57+ RXCS_FIFOTHNP_16QW |
58 RXCS_DMAREQSZ_128B |
59 RXCS_RETRYGAP_256ns |
60 RXCS_RETRYCNT_32,
61--
621.7.7.4
63
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0063-davinci_emac-Do-not-free-all-rx-dma-descriptors-duri.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0063-davinci_emac-Do-not-free-all-rx-dma-descriptors-duri.patch
new file mode 100644
index 00000000..15ff4503
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0063-davinci_emac-Do-not-free-all-rx-dma-descriptors-duri.patch
@@ -0,0 +1,72 @@
1From df9a5f8f94f3276aaa8c960a46f6838f7fdab974 Mon Sep 17 00:00:00 2001
2From: Christian Riesch <christian.riesch@omicron.at>
3Date: Thu, 23 Feb 2012 01:14:17 +0000
4Subject: [PATCH 63/73] davinci_emac: Do not free all rx dma descriptors
5 during init
6
7commit 5d69703263d588dbb03f4e57091afd8942d96e6d upstream.
8
9This patch fixes a regression that was introduced by
10
11commit 0a5f38467765ee15478db90d81e40c269c8dda20
12davinci_emac: Add Carrier Link OK check in Davinci RX Handler
13
14Said commit adds a check whether the carrier link is ok. If the link is
15not ok, the skb is freed and no new dma descriptor added to the rx dma
16channel. This causes trouble during initialization when the carrier
17status has not yet been updated. If a lot of packets are received while
18netif_carrier_ok returns false, all dma descriptors are freed and the
19rx dma transfer is stopped.
20
21The bug occurs when the board is connected to a network with lots of
22traffic and the ifconfig down/up is done, e.g., when reconfiguring
23the interface with DHCP.
24
25The bug can be reproduced by flood pinging the davinci board while doing
26ifconfig eth0 down
27ifconfig eth0 up
28on the board.
29
30After that, the rx path stops working and the overrun value reported
31by ifconfig is counting up.
32
33This patch reverts commit 0a5f38467765ee15478db90d81e40c269c8dda20
34and instead issues warnings only if cpdma_chan_submit returns -ENOMEM.
35
36Signed-off-by: Christian Riesch <christian.riesch@omicron.at>
37Cc: Cyril Chemparathy <cyril@ti.com>
38Cc: Sascha Hauer <s.hauer@pengutronix.de>
39Tested-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com>
40Signed-off-by: David S. Miller <davem@davemloft.net>
41Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
42---
43 drivers/net/ethernet/ti/davinci_emac.c | 6 ++++--
44 1 files changed, 4 insertions(+), 2 deletions(-)
45
46diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
47index 815c797..22f2788 100644
48--- a/drivers/net/ethernet/ti/davinci_emac.c
49+++ b/drivers/net/ethernet/ti/davinci_emac.c
50@@ -1007,7 +1007,7 @@ static void emac_rx_handler(void *token, int len, int status)
51 int ret;
52
53 /* free and bail if we are shutting down */
54- if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) {
55+ if (unlikely(!netif_running(ndev))) {
56 dev_kfree_skb_any(skb);
57 return;
58 }
59@@ -1036,7 +1036,9 @@ static void emac_rx_handler(void *token, int len, int status)
60 recycle:
61 ret = cpdma_chan_submit(priv->rxchan, skb, skb->data,
62 skb_tailroom(skb), GFP_KERNEL);
63- if (WARN_ON(ret < 0))
64+
65+ WARN_ON(ret == -ENOMEM);
66+ if (unlikely(ret < 0))
67 dev_kfree_skb_any(skb);
68 }
69
70--
711.7.7.4
72
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0064-builddeb-Don-t-create-files-in-tmp-with-predictable-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0064-builddeb-Don-t-create-files-in-tmp-with-predictable-.patch
new file mode 100644
index 00000000..93fd429e
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0064-builddeb-Don-t-create-files-in-tmp-with-predictable-.patch
@@ -0,0 +1,47 @@
1From c3d65b135f856651b2fa8606a7799a9f33d8f113 Mon Sep 17 00:00:00 2001
2From: Ben Hutchings <ben@decadent.org.uk>
3Date: Wed, 15 Feb 2012 14:17:29 +0000
4Subject: [PATCH 64/73] builddeb: Don't create files in /tmp with predictable
5 names
6
7commit 6c635224602d760c1208ada337562f40d8ae93a5 upstream.
8
9The current use of /tmp for file lists is insecure. Put them under
10$objtree/debian instead.
11
12Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
13Acked-by: maximilian attems <max@stro.at>
14Signed-off-by: Michal Marek <mmarek@suse.cz>
15Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
16---
17 scripts/package/builddeb | 12 ++++++------
18 1 files changed, 6 insertions(+), 6 deletions(-)
19
20diff --git a/scripts/package/builddeb b/scripts/package/builddeb
21index f6cbc3d..3c6c0b1 100644
22--- a/scripts/package/builddeb
23+++ b/scripts/package/builddeb
24@@ -238,14 +238,14 @@ EOF
25 fi
26
27 # Build header package
28-(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > /tmp/files$$)
29-(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> /tmp/files$$)
30-(cd $objtree; find .config Module.symvers include scripts -type f >> /tmp/objfiles$$)
31+(cd $srctree; find . -name Makefile -o -name Kconfig\* -o -name \*.pl > "$objtree/debian/hdrsrcfiles")
32+(cd $srctree; find arch/$SRCARCH/include include scripts -type f >> "$objtree/debian/hdrsrcfiles")
33+(cd $objtree; find .config Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
34 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
35 mkdir -p "$destdir"
36-(cd $srctree; tar -c -f - -T /tmp/files$$) | (cd $destdir; tar -xf -)
37-(cd $objtree; tar -c -f - -T /tmp/objfiles$$) | (cd $destdir; tar -xf -)
38-rm -f /tmp/files$$ /tmp/objfiles$$
39+(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
40+(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
41+rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"
42 arch=$(dpkg --print-architecture)
43
44 cat <<EOF >> debian/control
45--
461.7.7.4
47
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0065-can-sja1000-fix-isr-hang-when-hw-is-unplugged-under-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0065-can-sja1000-fix-isr-hang-when-hw-is-unplugged-under-.patch
new file mode 100644
index 00000000..49156d35
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0065-can-sja1000-fix-isr-hang-when-hw-is-unplugged-under-.patch
@@ -0,0 +1,67 @@
1From 9bda01cc81b40639565e63223d7c5413bb15b99a Mon Sep 17 00:00:00 2001
2From: Oliver Hartkopp <socketcan@hartkopp.net>
3Date: Wed, 15 Feb 2012 17:51:56 +0100
4Subject: [PATCH 65/73] can: sja1000: fix isr hang when hw is unplugged under
5 load
6
7commit a7762b10c12a70c5dbf2253142764b728ac88c3a upstream.
8
9In the case of hotplug enabled devices (PCMCIA/PCIeC) the removal of the
10hardware can cause an infinite loop in the common sja1000 isr.
11
12Use the already retrieved status register to indicate a possible hardware
13removal and double check by reading the mode register in sja1000_is_absent.
14
15Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
16Acked-by: Wolfgang Grandegger <wg@grandegger.com>
17Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 drivers/net/can/sja1000/sja1000.c | 13 ++++++++++++-
21 1 files changed, 12 insertions(+), 1 deletions(-)
22
23diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
24index 04a3f1b..192b0d1 100644
25--- a/drivers/net/can/sja1000/sja1000.c
26+++ b/drivers/net/can/sja1000/sja1000.c
27@@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
28 spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
29 }
30
31+static int sja1000_is_absent(struct sja1000_priv *priv)
32+{
33+ return (priv->read_reg(priv, REG_MOD) == 0xFF);
34+}
35+
36 static int sja1000_probe_chip(struct net_device *dev)
37 {
38 struct sja1000_priv *priv = netdev_priv(dev);
39
40- if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) {
41+ if (priv->reg_base && sja1000_is_absent(priv)) {
42 printk(KERN_INFO "%s: probing @0x%lX failed\n",
43 DRV_NAME, dev->base_addr);
44 return 0;
45@@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
46 while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
47 n++;
48 status = priv->read_reg(priv, REG_SR);
49+ /* check for absent controller due to hw unplug */
50+ if (status == 0xFF && sja1000_is_absent(priv))
51+ return IRQ_NONE;
52
53 if (isrc & IRQ_WUI)
54 dev_warn(dev->dev.parent, "wakeup interrupt\n");
55@@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
56 while (status & SR_RBS) {
57 sja1000_rx(dev);
58 status = priv->read_reg(priv, REG_SR);
59+ /* check for absent controller */
60+ if (status == 0xFF && sja1000_is_absent(priv))
61+ return IRQ_NONE;
62 }
63 }
64 if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {
65--
661.7.7.4
67
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0066-hdpvr-fix-race-conditon-during-start-of-streaming.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0066-hdpvr-fix-race-conditon-during-start-of-streaming.patch
new file mode 100644
index 00000000..142e5c3d
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0066-hdpvr-fix-race-conditon-during-start-of-streaming.patch
@@ -0,0 +1,39 @@
1From 81fa1b30877282eb79de420b7e29d09737ab86eb Mon Sep 17 00:00:00 2001
2From: Janne Grunau <j@jannau.net>
3Date: Thu, 2 Feb 2012 13:35:21 -0300
4Subject: [PATCH 66/73] hdpvr: fix race conditon during start of streaming
5
6commit afa159538af61f1a65d48927f4e949fe514fb4fc upstream.
7
8status has to be set to STREAMING before the streaming worker is
9queued. hdpvr_transmit_buffers() will exit immediately otherwise.
10
11Reported-by: Joerg Desch <vvd.joede@googlemail.com>
12Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
13Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
14---
15 drivers/media/video/hdpvr/hdpvr-video.c | 3 ++-
16 1 files changed, 2 insertions(+), 1 deletions(-)
17
18diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
19index 087f7c0..41fd57b 100644
20--- a/drivers/media/video/hdpvr/hdpvr-video.c
21+++ b/drivers/media/video/hdpvr/hdpvr-video.c
22@@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)
23
24 hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
25
26+ dev->status = STATUS_STREAMING;
27+
28 INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
29 queue_work(dev->workqueue, &dev->worker);
30
31 v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
32 "streaming started\n");
33- dev->status = STATUS_STREAMING;
34
35 return 0;
36 }
37--
381.7.7.4
39
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0067-imon-don-t-wedge-hardware-after-early-callbacks.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0067-imon-don-t-wedge-hardware-after-early-callbacks.patch
new file mode 100644
index 00000000..5c568cdb
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0067-imon-don-t-wedge-hardware-after-early-callbacks.patch
@@ -0,0 +1,107 @@
1From 7171d39d2187d3a59f8a2452bce6691755c0b153 Mon Sep 17 00:00:00 2001
2From: Jarod Wilson <jarod@redhat.com>
3Date: Thu, 26 Jan 2012 12:04:11 -0300
4Subject: [PATCH 67/73] imon: don't wedge hardware after early callbacks
5
6commit 8791d63af0cf113725ae4cb8cba9492814c59a93 upstream.
7
8This patch is just a minor update to one titled "imon: Input from ffdc
9device type ignored" from Corinna Vinschen. An earlier patch to prevent
10an oops when we got early callbacks also has the nasty side-effect of
11wedging imon hardware, as we don't acknowledge the urb. Rework the check
12slightly here to bypass processing the packet, as the driver isn't yet
13fully initialized, but still acknowlege the urb and submit a new rx_urb.
14Do this for both interfaces -- irrelevant for ffdc hardware, but
15relevant for newer hardware, though newer hardware doesn't spew the
16constant stream of data as soon as the hardware is initialized like the
17older ffdc devices, so they'd be less likely to trigger this anyway...
18
19Tested with both an ffdc device and an 0042 device.
20
21Reported-by: Corinna Vinschen <vinschen@redhat.com>
22Signed-off-by: Jarod Wilson <jarod@redhat.com>
23Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
24Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
25---
26 drivers/media/rc/imon.c | 26 ++++++++++++++++++++++----
27 1 files changed, 22 insertions(+), 4 deletions(-)
28
29diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c
30index 6ed9646..3f175eb 100644
31--- a/drivers/media/rc/imon.c
32+++ b/drivers/media/rc/imon.c
33@@ -47,7 +47,7 @@
34 #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
35 #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
36 #define MOD_NAME "imon"
37-#define MOD_VERSION "0.9.3"
38+#define MOD_VERSION "0.9.4"
39
40 #define DISPLAY_MINOR_BASE 144
41 #define DEVICE_NAME "lcd%d"
42@@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb)
43 return;
44
45 ictx = (struct imon_context *)urb->context;
46- if (!ictx || !ictx->dev_present_intf0)
47+ if (!ictx)
48 return;
49
50+ /*
51+ * if we get a callback before we're done configuring the hardware, we
52+ * can't yet process the data, as there's nowhere to send it, but we
53+ * still need to submit a new rx URB to avoid wedging the hardware
54+ */
55+ if (!ictx->dev_present_intf0)
56+ goto out;
57+
58 switch (urb->status) {
59 case -ENOENT: /* usbcore unlink successful! */
60 return;
61@@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
62 break;
63 }
64
65+out:
66 usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
67 }
68
69@@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb)
70 return;
71
72 ictx = (struct imon_context *)urb->context;
73- if (!ictx || !ictx->dev_present_intf1)
74+ if (!ictx)
75 return;
76
77+ /*
78+ * if we get a callback before we're done configuring the hardware, we
79+ * can't yet process the data, as there's nowhere to send it, but we
80+ * still need to submit a new rx URB to avoid wedging the hardware
81+ */
82+ if (!ictx->dev_present_intf1)
83+ goto out;
84+
85 switch (urb->status) {
86 case -ENOENT: /* usbcore unlink successful! */
87 return;
88@@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
89 break;
90 }
91
92+out:
93 usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
94 }
95
96@@ -2242,7 +2260,7 @@ find_endpoint_failed:
97 mutex_unlock(&ictx->lock);
98 usb_free_urb(rx_urb);
99 rx_urb_alloc_failed:
100- dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret);
101+ dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);
102
103 return NULL;
104 }
105--
1061.7.7.4
107
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch
new file mode 100644
index 00000000..ca1f37f3
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0068-hwmon-f75375s-Fix-register-write-order-when-setting-.patch
@@ -0,0 +1,48 @@
1From a93a91746fe70854f5301c526d1eec16312bebc3 Mon Sep 17 00:00:00 2001
2From: Nikolaus Schulz <schulz@macnetix.de>
3Date: Wed, 22 Feb 2012 23:18:44 +0100
4Subject: [PATCH 68/73] hwmon: (f75375s) Fix register write order when setting
5 fans to full speed
6
7commit c1c1a3d012fe5e82a9a025fb4b5a4f8ee67a53f6 upstream.
8
9By hwmon sysfs interface convention, setting pwm_enable to zero sets a fan
10to full speed. In the f75375s driver, this need be done by enabling
11manual fan control, plus duty mode for the F875387 chip, and then setting
12the maximum duty cycle. Fix a bug where the two necessary register writes
13were swapped, effectively discarding the setting to full-speed.
14
15Signed-off-by: Nikolaus Schulz <mail@microschulz.de>
16Cc: Riku Voipio <riku.voipio@iki.fi>
17Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
18Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
19---
20 drivers/hwmon/f75375s.c | 5 +++--
21 1 files changed, 3 insertions(+), 2 deletions(-)
22
23diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c
24index e4ab491..040a820 100644
25--- a/drivers/hwmon/f75375s.c
26+++ b/drivers/hwmon/f75375s.c
27@@ -304,8 +304,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
28 case 0: /* Full speed */
29 fanmode |= (3 << FAN_CTRL_MODE(nr));
30 data->pwm[nr] = 255;
31- f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
32- data->pwm[nr]);
33 break;
34 case 1: /* PWM */
35 fanmode |= (3 << FAN_CTRL_MODE(nr));
36@@ -318,6 +316,9 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
37 }
38 f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
39 data->pwm_enable[nr] = val;
40+ if (val == 0)
41+ f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
42+ data->pwm[nr]);
43 return 0;
44 }
45
46--
471.7.7.4
48
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0069-epoll-introduce-POLLFREE-to-flush-signalfd_wqh-befor.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0069-epoll-introduce-POLLFREE-to-flush-signalfd_wqh-befor.patch
new file mode 100644
index 00000000..ae8e8dfe
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0069-epoll-introduce-POLLFREE-to-flush-signalfd_wqh-befor.patch
@@ -0,0 +1,164 @@
1From 7741374fa2e5b7fa48f674bdbac6e1d5edf55c5a Mon Sep 17 00:00:00 2001
2From: Oleg Nesterov <oleg@redhat.com>
3Date: Fri, 24 Feb 2012 20:07:11 +0100
4Subject: [PATCH 69/73] epoll: introduce POLLFREE to flush ->signalfd_wqh
5 before kfree()
6
7commit d80e731ecab420ddcb79ee9d0ac427acbc187b4b upstream.
8
9This patch is intentionally incomplete to simplify the review.
10It ignores ep_unregister_pollwait() which plays with the same wqh.
11See the next change.
12
13epoll assumes that the EPOLL_CTL_ADD'ed file controls everything
14f_op->poll() needs. In particular it assumes that the wait queue
15can't go away until eventpoll_release(). This is not true in case
16of signalfd, the task which does EPOLL_CTL_ADD uses its ->sighand
17which is not connected to the file.
18
19This patch adds the special event, POLLFREE, currently only for
20epoll. It expects that init_poll_funcptr()'ed hook should do the
21necessary cleanup. Perhaps it should be defined as EPOLLFREE in
22eventpoll.
23
24__cleanup_sighand() is changed to do wake_up_poll(POLLFREE) if
25->signalfd_wqh is not empty, we add the new signalfd_cleanup()
26helper.
27
28ep_poll_callback(POLLFREE) simply does list_del_init(task_list).
29This make this poll entry inconsistent, but we don't care. If you
30share epoll fd which contains our sigfd with another process you
31should blame yourself. signalfd is "really special". I simply do
32not know how we can define the "right" semantics if it used with
33epoll.
34
35The main problem is, epoll calls signalfd_poll() once to establish
36the connection with the wait queue, after that signalfd_poll(NULL)
37returns the different/inconsistent results depending on who does
38EPOLL_CTL_MOD/signalfd_read/etc. IOW: apart from sigmask, signalfd
39has nothing to do with the file, it works with the current thread.
40
41In short: this patch is the hack which tries to fix the symptoms.
42It also assumes that nobody can take tasklist_lock under epoll
43locks, this seems to be true.
44
45Note:
46
47 - we do not have wake_up_all_poll() but wake_up_poll()
48 is fine, poll/epoll doesn't use WQ_FLAG_EXCLUSIVE.
49
50 - signalfd_cleanup() uses POLLHUP along with POLLFREE,
51 we need a couple of simple changes in eventpoll.c to
52 make sure it can't be "lost".
53
54Reported-by: Maxime Bizon <mbizon@freebox.fr>
55Signed-off-by: Oleg Nesterov <oleg@redhat.com>
56Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
57Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
58---
59 fs/eventpoll.c | 4 ++++
60 fs/signalfd.c | 11 +++++++++++
61 include/asm-generic/poll.h | 2 ++
62 include/linux/signalfd.h | 5 ++++-
63 kernel/fork.c | 5 ++++-
64 5 files changed, 25 insertions(+), 2 deletions(-)
65
66diff --git a/fs/eventpoll.c b/fs/eventpoll.c
67index 828e750..ede66ad 100644
68--- a/fs/eventpoll.c
69+++ b/fs/eventpoll.c
70@@ -827,6 +827,10 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
71 struct epitem *epi = ep_item_from_wait(wait);
72 struct eventpoll *ep = epi->ep;
73
74+ /* the caller holds eppoll_entry->whead->lock */
75+ if ((unsigned long)key & POLLFREE)
76+ list_del_init(&wait->task_list);
77+
78 spin_lock_irqsave(&ep->lock, flags);
79
80 /*
81diff --git a/fs/signalfd.c b/fs/signalfd.c
82index 492465b..79c1eea 100644
83--- a/fs/signalfd.c
84+++ b/fs/signalfd.c
85@@ -30,6 +30,17 @@
86 #include <linux/signalfd.h>
87 #include <linux/syscalls.h>
88
89+void signalfd_cleanup(struct sighand_struct *sighand)
90+{
91+ wait_queue_head_t *wqh = &sighand->signalfd_wqh;
92+
93+ if (likely(!waitqueue_active(wqh)))
94+ return;
95+
96+ /* wait_queue_t->func(POLLFREE) should do remove_wait_queue() */
97+ wake_up_poll(wqh, POLLHUP | POLLFREE);
98+}
99+
100 struct signalfd_ctx {
101 sigset_t sigmask;
102 };
103diff --git a/include/asm-generic/poll.h b/include/asm-generic/poll.h
104index 44bce83..9ce7f44 100644
105--- a/include/asm-generic/poll.h
106+++ b/include/asm-generic/poll.h
107@@ -28,6 +28,8 @@
108 #define POLLRDHUP 0x2000
109 #endif
110
111+#define POLLFREE 0x4000 /* currently only for epoll */
112+
113 struct pollfd {
114 int fd;
115 short events;
116diff --git a/include/linux/signalfd.h b/include/linux/signalfd.h
117index 3ff4961..247399b 100644
118--- a/include/linux/signalfd.h
119+++ b/include/linux/signalfd.h
120@@ -61,13 +61,16 @@ static inline void signalfd_notify(struct task_struct *tsk, int sig)
121 wake_up(&tsk->sighand->signalfd_wqh);
122 }
123
124+extern void signalfd_cleanup(struct sighand_struct *sighand);
125+
126 #else /* CONFIG_SIGNALFD */
127
128 static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
129
130+static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
131+
132 #endif /* CONFIG_SIGNALFD */
133
134 #endif /* __KERNEL__ */
135
136 #endif /* _LINUX_SIGNALFD_H */
137-
138diff --git a/kernel/fork.c b/kernel/fork.c
139index da4a6a1..0acf42c0 100644
140--- a/kernel/fork.c
141+++ b/kernel/fork.c
142@@ -66,6 +66,7 @@
143 #include <linux/user-return-notifier.h>
144 #include <linux/oom.h>
145 #include <linux/khugepaged.h>
146+#include <linux/signalfd.h>
147
148 #include <asm/pgtable.h>
149 #include <asm/pgalloc.h>
150@@ -910,8 +911,10 @@ static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk)
151
152 void __cleanup_sighand(struct sighand_struct *sighand)
153 {
154- if (atomic_dec_and_test(&sighand->count))
155+ if (atomic_dec_and_test(&sighand->count)) {
156+ signalfd_cleanup(sighand);
157 kmem_cache_free(sighand_cachep, sighand);
158+ }
159 }
160
161
162--
1631.7.7.4
164
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0070-epoll-ep_unregister_pollwait-can-use-the-freed-pwq-w.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0070-epoll-ep_unregister_pollwait-can-use-the-freed-pwq-w.patch
new file mode 100644
index 00000000..f847fc28
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0070-epoll-ep_unregister_pollwait-can-use-the-freed-pwq-w.patch
@@ -0,0 +1,116 @@
1From e6aa5c0ba6e2383b2952a9f340e58a990bf15111 Mon Sep 17 00:00:00 2001
2From: Oleg Nesterov <oleg@redhat.com>
3Date: Fri, 24 Feb 2012 20:07:29 +0100
4Subject: [PATCH 70/73] epoll: ep_unregister_pollwait() can use the freed
5 pwq->whead
6
7commit 971316f0503a5c50633d07b83b6db2f15a3a5b00 upstream.
8
9signalfd_cleanup() ensures that ->signalfd_wqh is not used, but
10this is not enough. eppoll_entry->whead still points to the memory
11we are going to free, ep_unregister_pollwait()->remove_wait_queue()
12is obviously unsafe.
13
14Change ep_poll_callback(POLLFREE) to set eppoll_entry->whead = NULL,
15change ep_unregister_pollwait() to check pwq->whead != NULL under
16rcu_read_lock() before remove_wait_queue(). We add the new helper,
17ep_remove_wait_queue(), for this.
18
19This works because sighand_cachep is SLAB_DESTROY_BY_RCU and because
20->signalfd_wqh is initialized in sighand_ctor(), not in copy_sighand.
21ep_unregister_pollwait()->remove_wait_queue() can play with already
22freed and potentially reused ->sighand, but this is fine. This memory
23must have the valid ->signalfd_wqh until rcu_read_unlock().
24
25Reported-by: Maxime Bizon <mbizon@freebox.fr>
26Signed-off-by: Oleg Nesterov <oleg@redhat.com>
27Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
28Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29---
30 fs/eventpoll.c | 30 +++++++++++++++++++++++++++---
31 fs/signalfd.c | 6 +++++-
32 2 files changed, 32 insertions(+), 4 deletions(-)
33
34diff --git a/fs/eventpoll.c b/fs/eventpoll.c
35index ede66ad..12a772b 100644
36--- a/fs/eventpoll.c
37+++ b/fs/eventpoll.c
38@@ -299,6 +299,11 @@ static inline int ep_is_linked(struct list_head *p)
39 return !list_empty(p);
40 }
41
42+static inline struct eppoll_entry *ep_pwq_from_wait(wait_queue_t *p)
43+{
44+ return container_of(p, struct eppoll_entry, wait);
45+}
46+
47 /* Get the "struct epitem" from a wait queue pointer */
48 static inline struct epitem *ep_item_from_wait(wait_queue_t *p)
49 {
50@@ -446,6 +451,18 @@ static void ep_poll_safewake(wait_queue_head_t *wq)
51 put_cpu();
52 }
53
54+static void ep_remove_wait_queue(struct eppoll_entry *pwq)
55+{
56+ wait_queue_head_t *whead;
57+
58+ rcu_read_lock();
59+ /* If it is cleared by POLLFREE, it should be rcu-safe */
60+ whead = rcu_dereference(pwq->whead);
61+ if (whead)
62+ remove_wait_queue(whead, &pwq->wait);
63+ rcu_read_unlock();
64+}
65+
66 /*
67 * This function unregisters poll callbacks from the associated file
68 * descriptor. Must be called with "mtx" held (or "epmutex" if called from
69@@ -460,7 +477,7 @@ static void ep_unregister_pollwait(struct eventpoll *ep, struct epitem *epi)
70 pwq = list_first_entry(lsthead, struct eppoll_entry, llink);
71
72 list_del(&pwq->llink);
73- remove_wait_queue(pwq->whead, &pwq->wait);
74+ ep_remove_wait_queue(pwq);
75 kmem_cache_free(pwq_cache, pwq);
76 }
77 }
78@@ -827,9 +844,16 @@ static int ep_poll_callback(wait_queue_t *wait, unsigned mode, int sync, void *k
79 struct epitem *epi = ep_item_from_wait(wait);
80 struct eventpoll *ep = epi->ep;
81
82- /* the caller holds eppoll_entry->whead->lock */
83- if ((unsigned long)key & POLLFREE)
84+ if ((unsigned long)key & POLLFREE) {
85+ ep_pwq_from_wait(wait)->whead = NULL;
86+ /*
87+ * whead = NULL above can race with ep_remove_wait_queue()
88+ * which can do another remove_wait_queue() after us, so we
89+ * can't use __remove_wait_queue(). whead->lock is held by
90+ * the caller.
91+ */
92 list_del_init(&wait->task_list);
93+ }
94
95 spin_lock_irqsave(&ep->lock, flags);
96
97diff --git a/fs/signalfd.c b/fs/signalfd.c
98index 79c1eea..7ae2a57 100644
99--- a/fs/signalfd.c
100+++ b/fs/signalfd.c
101@@ -33,7 +33,11 @@
102 void signalfd_cleanup(struct sighand_struct *sighand)
103 {
104 wait_queue_head_t *wqh = &sighand->signalfd_wqh;
105-
106+ /*
107+ * The lockless check can race with remove_wait_queue() in progress,
108+ * but in this case its caller should run under rcu_read_lock() and
109+ * sighand_cachep is SLAB_DESTROY_BY_RCU, we can safely return.
110+ */
111 if (likely(!waitqueue_active(wqh)))
112 return;
113
114--
1151.7.7.4
116
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0071-epoll-limit-paths.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0071-epoll-limit-paths.patch
new file mode 100644
index 00000000..b6b53bad
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0071-epoll-limit-paths.patch
@@ -0,0 +1,475 @@
1From 203aa5260edca2ab1872ad8b08386d874f7132f3 Mon Sep 17 00:00:00 2001
2From: Jason Baron <jbaron@redhat.com>
3Date: Thu, 12 Jan 2012 17:17:43 -0800
4Subject: [PATCH 71/73] epoll: limit paths
5
6commit 28d82dc1c4edbc352129f97f4ca22624d1fe61de upstream.
7
8The current epoll code can be tickled to run basically indefinitely in
9both loop detection path check (on ep_insert()), and in the wakeup paths.
10The programs that tickle this behavior set up deeply linked networks of
11epoll file descriptors that cause the epoll algorithms to traverse them
12indefinitely. A couple of these sample programs have been previously
13posted in this thread: https://lkml.org/lkml/2011/2/25/297.
14
15To fix the loop detection path check algorithms, I simply keep track of
16the epoll nodes that have been already visited. Thus, the loop detection
17becomes proportional to the number of epoll file descriptor and links.
18This dramatically decreases the run-time of the loop check algorithm. In
19one diabolical case I tried it reduced the run-time from 15 mintues (all
20in kernel time) to .3 seconds.
21
22Fixing the wakeup paths could be done at wakeup time in a similar manner
23by keeping track of nodes that have already been visited, but the
24complexity is harder, since there can be multiple wakeups on different
25cpus...Thus, I've opted to limit the number of possible wakeup paths when
26the paths are created.
27
28This is accomplished, by noting that the end file descriptor points that
29are found during the loop detection pass (from the newly added link), are
30actually the sources for wakeup events. I keep a list of these file
31descriptors and limit the number and length of these paths that emanate
32from these 'source file descriptors'. In the current implemetation I
33allow 1000 paths of length 1, 500 of length 2, 100 of length 3, 50 of
34length 4 and 10 of length 5. Note that it is sufficient to check the
35'source file descriptors' reachable from the newly added link, since no
36other 'source file descriptors' will have newly added links. This allows
37us to check only the wakeup paths that may have gotten too long, and not
38re-check all possible wakeup paths on the system.
39
40In terms of the path limit selection, I think its first worth noting that
41the most common case for epoll, is probably the model where you have 1
42epoll file descriptor that is monitoring n number of 'source file
43descriptors'. In this case, each 'source file descriptor' has a 1 path of
44length 1. Thus, I believe that the limits I'm proposing are quite
45reasonable and in fact may be too generous. Thus, I'm hoping that the
46proposed limits will not prevent any workloads that currently work to
47fail.
48
49In terms of locking, I have extended the use of the 'epmutex' to all
50epoll_ctl add and remove operations. Currently its only used in a subset
51of the add paths. I need to hold the epmutex, so that we can correctly
52traverse a coherent graph, to check the number of paths. I believe that
53this additional locking is probably ok, since its in the setup/teardown
54paths, and doesn't affect the running paths, but it certainly is going to
55add some extra overhead. Also, worth noting is that the epmuex was
56recently added to the ep_ctl add operations in the initial path loop
57detection code using the argument that it was not on a critical path.
58
59Another thing to note here, is the length of epoll chains that is allowed.
60Currently, eventpoll.c defines:
61
62/* Maximum number of nesting allowed inside epoll sets */
63#define EP_MAX_NESTS 4
64
65This basically means that I am limited to a graph depth of 5 (EP_MAX_NESTS
66+ 1). However, this limit is currently only enforced during the loop
67check detection code, and only when the epoll file descriptors are added
68in a certain order. Thus, this limit is currently easily bypassed. The
69newly added check for wakeup paths, stricly limits the wakeup paths to a
70length of 5, regardless of the order in which ep's are linked together.
71Thus, a side-effect of the new code is a more consistent enforcement of
72the graph depth.
73
74Thus far, I've tested this, using the sample programs previously
75mentioned, which now either return quickly or return -EINVAL. I've also
76testing using the piptest.c epoll tester, which showed no difference in
77performance. I've also created a number of different epoll networks and
78tested that they behave as expectded.
79
80I believe this solves the original diabolical test cases, while still
81preserving the sane epoll nesting.
82
83Signed-off-by: Jason Baron <jbaron@redhat.com>
84Cc: Nelson Elhage <nelhage@ksplice.com>
85Cc: Davide Libenzi <davidel@xmailserver.org>
86Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
87Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
88Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
89---
90 fs/eventpoll.c | 234 ++++++++++++++++++++++++++++++++++++++++-----
91 include/linux/eventpoll.h | 1 +
92 include/linux/fs.h | 1 +
93 3 files changed, 211 insertions(+), 25 deletions(-)
94
95diff --git a/fs/eventpoll.c b/fs/eventpoll.c
96index 12a772b..ea54cde 100644
97--- a/fs/eventpoll.c
98+++ b/fs/eventpoll.c
99@@ -197,6 +197,12 @@ struct eventpoll {
100
101 /* The user that created the eventpoll descriptor */
102 struct user_struct *user;
103+
104+ struct file *file;
105+
106+ /* used to optimize loop detection check */
107+ int visited;
108+ struct list_head visited_list_link;
109 };
110
111 /* Wait structure used by the poll hooks */
112@@ -255,6 +261,15 @@ static struct kmem_cache *epi_cache __read_mostly;
113 /* Slab cache used to allocate "struct eppoll_entry" */
114 static struct kmem_cache *pwq_cache __read_mostly;
115
116+/* Visited nodes during ep_loop_check(), so we can unset them when we finish */
117+static LIST_HEAD(visited_list);
118+
119+/*
120+ * List of files with newly added links, where we may need to limit the number
121+ * of emanating paths. Protected by the epmutex.
122+ */
123+static LIST_HEAD(tfile_check_list);
124+
125 #ifdef CONFIG_SYSCTL
126
127 #include <linux/sysctl.h>
128@@ -276,6 +291,12 @@ ctl_table epoll_table[] = {
129 };
130 #endif /* CONFIG_SYSCTL */
131
132+static const struct file_operations eventpoll_fops;
133+
134+static inline int is_file_epoll(struct file *f)
135+{
136+ return f->f_op == &eventpoll_fops;
137+}
138
139 /* Setup the structure that is used as key for the RB tree */
140 static inline void ep_set_ffd(struct epoll_filefd *ffd,
141@@ -728,12 +749,6 @@ static const struct file_operations eventpoll_fops = {
142 .llseek = noop_llseek,
143 };
144
145-/* Fast test to see if the file is an eventpoll file */
146-static inline int is_file_epoll(struct file *f)
147-{
148- return f->f_op == &eventpoll_fops;
149-}
150-
151 /*
152 * This is called from eventpoll_release() to unlink files from the eventpoll
153 * interface. We need to have this facility to cleanup correctly files that are
154@@ -954,6 +969,99 @@ static void ep_rbtree_insert(struct eventpoll *ep, struct epitem *epi)
155 rb_insert_color(&epi->rbn, &ep->rbr);
156 }
157
158+
159+
160+#define PATH_ARR_SIZE 5
161+/*
162+ * These are the number paths of length 1 to 5, that we are allowing to emanate
163+ * from a single file of interest. For example, we allow 1000 paths of length
164+ * 1, to emanate from each file of interest. This essentially represents the
165+ * potential wakeup paths, which need to be limited in order to avoid massive
166+ * uncontrolled wakeup storms. The common use case should be a single ep which
167+ * is connected to n file sources. In this case each file source has 1 path
168+ * of length 1. Thus, the numbers below should be more than sufficient. These
169+ * path limits are enforced during an EPOLL_CTL_ADD operation, since a modify
170+ * and delete can't add additional paths. Protected by the epmutex.
171+ */
172+static const int path_limits[PATH_ARR_SIZE] = { 1000, 500, 100, 50, 10 };
173+static int path_count[PATH_ARR_SIZE];
174+
175+static int path_count_inc(int nests)
176+{
177+ if (++path_count[nests] > path_limits[nests])
178+ return -1;
179+ return 0;
180+}
181+
182+static void path_count_init(void)
183+{
184+ int i;
185+
186+ for (i = 0; i < PATH_ARR_SIZE; i++)
187+ path_count[i] = 0;
188+}
189+
190+static int reverse_path_check_proc(void *priv, void *cookie, int call_nests)
191+{
192+ int error = 0;
193+ struct file *file = priv;
194+ struct file *child_file;
195+ struct epitem *epi;
196+
197+ list_for_each_entry(epi, &file->f_ep_links, fllink) {
198+ child_file = epi->ep->file;
199+ if (is_file_epoll(child_file)) {
200+ if (list_empty(&child_file->f_ep_links)) {
201+ if (path_count_inc(call_nests)) {
202+ error = -1;
203+ break;
204+ }
205+ } else {
206+ error = ep_call_nested(&poll_loop_ncalls,
207+ EP_MAX_NESTS,
208+ reverse_path_check_proc,
209+ child_file, child_file,
210+ current);
211+ }
212+ if (error != 0)
213+ break;
214+ } else {
215+ printk(KERN_ERR "reverse_path_check_proc: "
216+ "file is not an ep!\n");
217+ }
218+ }
219+ return error;
220+}
221+
222+/**
223+ * reverse_path_check - The tfile_check_list is list of file *, which have
224+ * links that are proposed to be newly added. We need to
225+ * make sure that those added links don't add too many
226+ * paths such that we will spend all our time waking up
227+ * eventpoll objects.
228+ *
229+ * Returns: Returns zero if the proposed links don't create too many paths,
230+ * -1 otherwise.
231+ */
232+static int reverse_path_check(void)
233+{
234+ int length = 0;
235+ int error = 0;
236+ struct file *current_file;
237+
238+ /* let's call this for all tfiles */
239+ list_for_each_entry(current_file, &tfile_check_list, f_tfile_llink) {
240+ length++;
241+ path_count_init();
242+ error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
243+ reverse_path_check_proc, current_file,
244+ current_file, current);
245+ if (error)
246+ break;
247+ }
248+ return error;
249+}
250+
251 /*
252 * Must be called with "mtx" held.
253 */
254@@ -1015,6 +1123,11 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
255 */
256 ep_rbtree_insert(ep, epi);
257
258+ /* now check if we've created too many backpaths */
259+ error = -EINVAL;
260+ if (reverse_path_check())
261+ goto error_remove_epi;
262+
263 /* We have to drop the new item inside our item list to keep track of it */
264 spin_lock_irqsave(&ep->lock, flags);
265
266@@ -1039,6 +1152,14 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
267
268 return 0;
269
270+error_remove_epi:
271+ spin_lock(&tfile->f_lock);
272+ if (ep_is_linked(&epi->fllink))
273+ list_del_init(&epi->fllink);
274+ spin_unlock(&tfile->f_lock);
275+
276+ rb_erase(&epi->rbn, &ep->rbr);
277+
278 error_unregister:
279 ep_unregister_pollwait(ep, epi);
280
281@@ -1303,18 +1424,36 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
282 int error = 0;
283 struct file *file = priv;
284 struct eventpoll *ep = file->private_data;
285+ struct eventpoll *ep_tovisit;
286 struct rb_node *rbp;
287 struct epitem *epi;
288
289 mutex_lock_nested(&ep->mtx, call_nests + 1);
290+ ep->visited = 1;
291+ list_add(&ep->visited_list_link, &visited_list);
292 for (rbp = rb_first(&ep->rbr); rbp; rbp = rb_next(rbp)) {
293 epi = rb_entry(rbp, struct epitem, rbn);
294 if (unlikely(is_file_epoll(epi->ffd.file))) {
295+ ep_tovisit = epi->ffd.file->private_data;
296+ if (ep_tovisit->visited)
297+ continue;
298 error = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
299- ep_loop_check_proc, epi->ffd.file,
300- epi->ffd.file->private_data, current);
301+ ep_loop_check_proc, epi->ffd.file,
302+ ep_tovisit, current);
303 if (error != 0)
304 break;
305+ } else {
306+ /*
307+ * If we've reached a file that is not associated with
308+ * an ep, then we need to check if the newly added
309+ * links are going to add too many wakeup paths. We do
310+ * this by adding it to the tfile_check_list, if it's
311+ * not already there, and calling reverse_path_check()
312+ * during ep_insert().
313+ */
314+ if (list_empty(&epi->ffd.file->f_tfile_llink))
315+ list_add(&epi->ffd.file->f_tfile_llink,
316+ &tfile_check_list);
317 }
318 }
319 mutex_unlock(&ep->mtx);
320@@ -1335,8 +1474,31 @@ static int ep_loop_check_proc(void *priv, void *cookie, int call_nests)
321 */
322 static int ep_loop_check(struct eventpoll *ep, struct file *file)
323 {
324- return ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
325+ int ret;
326+ struct eventpoll *ep_cur, *ep_next;
327+
328+ ret = ep_call_nested(&poll_loop_ncalls, EP_MAX_NESTS,
329 ep_loop_check_proc, file, ep, current);
330+ /* clear visited list */
331+ list_for_each_entry_safe(ep_cur, ep_next, &visited_list,
332+ visited_list_link) {
333+ ep_cur->visited = 0;
334+ list_del(&ep_cur->visited_list_link);
335+ }
336+ return ret;
337+}
338+
339+static void clear_tfile_check_list(void)
340+{
341+ struct file *file;
342+
343+ /* first clear the tfile_check_list */
344+ while (!list_empty(&tfile_check_list)) {
345+ file = list_first_entry(&tfile_check_list, struct file,
346+ f_tfile_llink);
347+ list_del_init(&file->f_tfile_llink);
348+ }
349+ INIT_LIST_HEAD(&tfile_check_list);
350 }
351
352 /*
353@@ -1344,8 +1506,9 @@ static int ep_loop_check(struct eventpoll *ep, struct file *file)
354 */
355 SYSCALL_DEFINE1(epoll_create1, int, flags)
356 {
357- int error;
358+ int error, fd;
359 struct eventpoll *ep = NULL;
360+ struct file *file;
361
362 /* Check the EPOLL_* constant for consistency. */
363 BUILD_BUG_ON(EPOLL_CLOEXEC != O_CLOEXEC);
364@@ -1362,11 +1525,25 @@ SYSCALL_DEFINE1(epoll_create1, int, flags)
365 * Creates all the items needed to setup an eventpoll file. That is,
366 * a file structure and a free file descriptor.
367 */
368- error = anon_inode_getfd("[eventpoll]", &eventpoll_fops, ep,
369+ fd = get_unused_fd_flags(O_RDWR | (flags & O_CLOEXEC));
370+ if (fd < 0) {
371+ error = fd;
372+ goto out_free_ep;
373+ }
374+ file = anon_inode_getfile("[eventpoll]", &eventpoll_fops, ep,
375 O_RDWR | (flags & O_CLOEXEC));
376- if (error < 0)
377- ep_free(ep);
378-
379+ if (IS_ERR(file)) {
380+ error = PTR_ERR(file);
381+ goto out_free_fd;
382+ }
383+ fd_install(fd, file);
384+ ep->file = file;
385+ return fd;
386+
387+out_free_fd:
388+ put_unused_fd(fd);
389+out_free_ep:
390+ ep_free(ep);
391 return error;
392 }
393
394@@ -1432,21 +1609,27 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
395 /*
396 * When we insert an epoll file descriptor, inside another epoll file
397 * descriptor, there is the change of creating closed loops, which are
398- * better be handled here, than in more critical paths.
399+ * better be handled here, than in more critical paths. While we are
400+ * checking for loops we also determine the list of files reachable
401+ * and hang them on the tfile_check_list, so we can check that we
402+ * haven't created too many possible wakeup paths.
403 *
404- * We hold epmutex across the loop check and the insert in this case, in
405- * order to prevent two separate inserts from racing and each doing the
406- * insert "at the same time" such that ep_loop_check passes on both
407- * before either one does the insert, thereby creating a cycle.
408+ * We need to hold the epmutex across both ep_insert and ep_remove
409+ * b/c we want to make sure we are looking at a coherent view of
410+ * epoll network.
411 */
412- if (unlikely(is_file_epoll(tfile) && op == EPOLL_CTL_ADD)) {
413+ if (op == EPOLL_CTL_ADD || op == EPOLL_CTL_DEL) {
414 mutex_lock(&epmutex);
415 did_lock_epmutex = 1;
416- error = -ELOOP;
417- if (ep_loop_check(ep, tfile) != 0)
418- goto error_tgt_fput;
419 }
420-
421+ if (op == EPOLL_CTL_ADD) {
422+ if (is_file_epoll(tfile)) {
423+ error = -ELOOP;
424+ if (ep_loop_check(ep, tfile) != 0)
425+ goto error_tgt_fput;
426+ } else
427+ list_add(&tfile->f_tfile_llink, &tfile_check_list);
428+ }
429
430 mutex_lock_nested(&ep->mtx, 0);
431
432@@ -1465,6 +1648,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
433 error = ep_insert(ep, &epds, tfile, fd);
434 } else
435 error = -EEXIST;
436+ clear_tfile_check_list();
437 break;
438 case EPOLL_CTL_DEL:
439 if (epi)
440@@ -1483,7 +1667,7 @@ SYSCALL_DEFINE4(epoll_ctl, int, epfd, int, op, int, fd,
441 mutex_unlock(&ep->mtx);
442
443 error_tgt_fput:
444- if (unlikely(did_lock_epmutex))
445+ if (did_lock_epmutex)
446 mutex_unlock(&epmutex);
447
448 fput(tfile);
449diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h
450index f362733..657ab55 100644
451--- a/include/linux/eventpoll.h
452+++ b/include/linux/eventpoll.h
453@@ -61,6 +61,7 @@ struct file;
454 static inline void eventpoll_init_file(struct file *file)
455 {
456 INIT_LIST_HEAD(&file->f_ep_links);
457+ INIT_LIST_HEAD(&file->f_tfile_llink);
458 }
459
460
461diff --git a/include/linux/fs.h b/include/linux/fs.h
462index e0bc4ff..10b2288 100644
463--- a/include/linux/fs.h
464+++ b/include/linux/fs.h
465@@ -1001,6 +1001,7 @@ struct file {
466 #ifdef CONFIG_EPOLL
467 /* Used by fs/eventpoll.c to link all the hooks to this file */
468 struct list_head f_ep_links;
469+ struct list_head f_tfile_llink;
470 #endif /* #ifdef CONFIG_EPOLL */
471 struct address_space *f_mapping;
472 #ifdef CONFIG_DEBUG_WRITECOUNT
473--
4741.7.7.4
475
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0072-cdrom-use-copy_to_user-without-the-underscores.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0072-cdrom-use-copy_to_user-without-the-underscores.patch
new file mode 100644
index 00000000..b5eb4025
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0072-cdrom-use-copy_to_user-without-the-underscores.patch
@@ -0,0 +1,56 @@
1From c1dd346c39c2a7d3ca7b9670e9504ae19d4e927a Mon Sep 17 00:00:00 2001
2From: Dan Carpenter <dan.carpenter@oracle.com>
3Date: Mon, 6 Feb 2012 10:20:45 +0100
4Subject: [PATCH 72/73] cdrom: use copy_to_user() without the underscores
5
6commit 822bfa51ce44f2c63c300fdb76dc99c4d5a5ca9f upstream.
7
8"nframes" comes from the user and "nframes * CD_FRAMESIZE_RAW" can wrap
9on 32 bit systems. That would have been ok if we used the same wrapped
10value for the copy, but we use a shifted value. We should just use the
11checked version of copy_to_user() because it's not going to make a
12difference to the speed.
13
14Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
15Signed-off-by: Jens Axboe <axboe@kernel.dk>
16Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
17---
18 drivers/cdrom/cdrom.c | 8 +-------
19 1 files changed, 1 insertions(+), 7 deletions(-)
20
21diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
22index cedb231..2678b6f 100644
23--- a/drivers/cdrom/cdrom.c
24+++ b/drivers/cdrom/cdrom.c
25@@ -2120,11 +2120,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
26 if (!nr)
27 return -ENOMEM;
28
29- if (!access_ok(VERIFY_WRITE, ubuf, nframes * CD_FRAMESIZE_RAW)) {
30- ret = -EFAULT;
31- goto out;
32- }
33-
34 cgc.data_direction = CGC_DATA_READ;
35 while (nframes > 0) {
36 if (nr > nframes)
37@@ -2133,7 +2128,7 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
38 ret = cdrom_read_block(cdi, &cgc, lba, nr, 1, CD_FRAMESIZE_RAW);
39 if (ret)
40 break;
41- if (__copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
42+ if (copy_to_user(ubuf, cgc.buffer, CD_FRAMESIZE_RAW * nr)) {
43 ret = -EFAULT;
44 break;
45 }
46@@ -2141,7 +2136,6 @@ static int cdrom_read_cdda_old(struct cdrom_device_info *cdi, __u8 __user *ubuf,
47 nframes -= nr;
48 lba += nr;
49 }
50-out:
51 kfree(cgc.buffer);
52 return ret;
53 }
54--
551.7.7.4
56
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0073-Linux-3.2.9.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0073-Linux-3.2.9.patch
new file mode 100644
index 00000000..a22af089
--- /dev/null
+++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.9/0073-Linux-3.2.9.patch
@@ -0,0 +1,24 @@
1From 44fb3170ae46f8de964a4bb5b0504e865a6dd7da Mon Sep 17 00:00:00 2001
2From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
3Date: Wed, 29 Feb 2012 16:32:49 -0800
4Subject: [PATCH 73/73] Linux 3.2.9
5
6---
7 Makefile | 2 +-
8 1 files changed, 1 insertions(+), 1 deletions(-)
9
10diff --git a/Makefile b/Makefile
11index 7df8a84..5f1739b 100644
12--- a/Makefile
13+++ b/Makefile
14@@ -1,6 +1,6 @@
15 VERSION = 3
16 PATCHLEVEL = 2
17-SUBLEVEL = 8
18+SUBLEVEL = 9
19 EXTRAVERSION =
20 NAME = Saber-toothed Squirrel
21
22--
231.7.7.4
24