aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-05-15 04:41:07 -0400
committerArnd Bergmann <arnd@arndb.de>2012-05-15 04:41:07 -0400
commit423b742bec02b6c8d4e060517ce05b4cd3fd91c1 (patch)
tree3d4e090581970646d0afc92166bd490cc4977021
parentbe944f1e79063e4f27b46c74f10c86b2387afa9f (diff)
parentf5520363532690f56e12126029864d9383d5203f (diff)
Merge branch 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux into next/boards
* 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux: ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree kirkwood: Add iconnect support orion/kirkwood: create a generic function for gpio led blinking kirkwood/orion: fix orion_gpio_set_blink ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt kirkwood: Allow nand to be configured via. devicetree mtd: Add orion_nand devicetree bindings ARM: kirkwood: Basic support for DNS-320 and DNS-325 Includes an update to v3.4-rc7 Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--Documentation/devicetree/bindings/mtd/orion-nand.txt50
-rw-r--r--MAINTAINERS3
-rw-r--r--Makefile2
-rw-r--r--arch/arm/boot/dts/kirkwood-dns320.dts64
-rw-r--r--arch/arm/boot/dts/kirkwood-dns325.dts59
-rw-r--r--arch/arm/boot/dts/kirkwood-ib62x0.dts44
-rw-r--r--arch/arm/boot/dts/kirkwood-iconnect.dts26
-rw-r--r--arch/arm/boot/dts/kirkwood.dtsi15
-rw-r--r--arch/arm/kernel/ptrace.c24
-rw-r--r--arch/arm/kernel/smp.c4
-rw-r--r--arch/arm/kernel/sys_arm.c2
-rw-r--r--arch/arm/mach-exynos/Kconfig3
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c2
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c4
-rw-r--r--arch/arm/mach-kirkwood/Kconfig22
-rw-r--r--arch/arm/mach-kirkwood/Makefile3
-rw-r--r--arch/arm/mach-kirkwood/Makefile.boot4
-rw-r--r--arch/arm/mach-kirkwood/board-dnskw.c275
-rw-r--r--arch/arm/mach-kirkwood/board-dt.c14
-rw-r--r--arch/arm/mach-kirkwood/board-ib62x0.c143
-rw-r--r--arch/arm/mach-kirkwood/board-iconnect.c165
-rw-r--r--arch/arm/mach-kirkwood/common.c12
-rw-r--r--arch/arm/mach-kirkwood/common.h18
-rw-r--r--arch/arm/mach-omap1/ams-delta-fiq.c2
-rw-r--r--arch/arm/mach-omap2/board-igep0020.c2
-rw-r--r--arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h8
-rw-r--r--arch/arm/mach-orion5x/dns323-setup.c25
-rw-r--r--arch/arm/mach-orion5x/mpp.h4
-rw-r--r--arch/arm/plat-orion/gpio.c27
-rw-r--r--arch/arm/plat-orion/include/plat/gpio.h2
-rw-r--r--arch/ia64/kvm/kvm-ia64.c2
-rw-r--r--arch/m68k/platform/520x/config.c6
-rw-r--r--arch/m68k/platform/523x/config.c6
-rw-r--r--arch/m68k/platform/5249/config.c6
-rw-r--r--arch/m68k/platform/527x/config.c6
-rw-r--r--arch/m68k/platform/528x/config.c6
-rw-r--r--arch/m68k/platform/532x/config.c6
-rw-r--r--arch/m68k/platform/coldfire/device.c6
-rw-r--r--arch/parisc/include/asm/hardware.h3
-rw-r--r--arch/parisc/include/asm/page.h6
-rw-r--r--arch/parisc/include/asm/pdc.h7
-rw-r--r--arch/parisc/include/asm/pgtable.h2
-rw-r--r--arch/parisc/include/asm/spinlock.h2
-rw-r--r--arch/parisc/kernel/pdc_cons.c1
-rw-r--r--arch/parisc/kernel/time.c1
-rw-r--r--arch/powerpc/include/asm/exception-64s.h7
-rw-r--r--arch/powerpc/kernel/entry_64.S62
-rw-r--r--arch/powerpc/kernel/exceptions-64s.S2
-rw-r--r--arch/powerpc/kernel/irq.c21
-rw-r--r--arch/powerpc/kernel/traps.c10
-rw-r--r--arch/powerpc/kvm/book3s_64_mmu_hv.c22
-rw-r--r--arch/powerpc/kvm/book3s_hv.c2
-rw-r--r--arch/sparc/kernel/central.c2
-rw-r--r--arch/sparc/mm/ultra.S6
-rw-r--r--arch/x86/kernel/kvm.c9
-rw-r--r--arch/x86/kernel/process_64.c1
-rw-r--r--arch/x86/kernel/setup_percpu.c14
-rw-r--r--arch/x86/kvm/x86.c1
-rw-r--r--arch/x86/xen/enlighten.c42
-rw-r--r--arch/x86/xen/mmu.c7
-rw-r--r--drivers/base/regmap/regmap.c4
-rw-r--r--drivers/block/drbd/drbd_nl.c2
-rw-r--r--drivers/gpio/gpio-omap.c9
-rw-r--r--drivers/gpio/gpio-pch.c57
-rw-r--r--drivers/gpio/gpio-samsung.c18
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c9
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.c199
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.h1
-rw-r--r--drivers/leds/leds-netxbig.c4
-rw-r--r--drivers/leds/leds-ns2.c2
-rw-r--r--drivers/md/dm-log-userspace-transfer.c2
-rw-r--r--drivers/md/dm-mpath.c4
-rw-r--r--drivers/md/dm-thin.c16
-rw-r--r--drivers/mtd/nand/orion_nand.c47
-rw-r--r--drivers/net/bonding/bond_3ad.c18
-rw-r--r--drivers/net/bonding/bond_3ad.h2
-rw-r--r--drivers/net/bonding/bond_main.c16
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c23
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c2
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c24
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe.h3
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c43
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c10
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c7
-rw-r--r--drivers/net/ethernet/realtek/r8169.c16
-rw-r--r--drivers/net/ethernet/sfc/efx.c2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/macvtap.c43
-rw-r--r--drivers/net/usb/cdc_ether.c14
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c4
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rx.c21
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h1
-rw-r--r--drivers/parisc/sba_iommu.c1
-rw-r--r--drivers/regulator/core.c5
-rw-r--r--drivers/regulator/max8997.c2
-rw-r--r--drivers/scsi/hosts.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c15
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c18
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h6
-rw-r--r--drivers/scsi/virtio_scsi.c24
-rw-r--r--drivers/target/target_core_tpg.c22
-rw-r--r--drivers/vhost/net.c7
-rw-r--r--drivers/video/console/sticore.c2
-rw-r--r--drivers/video/uvesafb.c2
-rw-r--r--drivers/video/xen-fbfront.c27
-rw-r--r--drivers/xen/Kconfig22
-rw-r--r--fs/cifs/cifsfs.c2
-rw-r--r--fs/proc/task_mmu.c12
-rw-r--r--include/linux/etherdevice.h11
-rw-r--r--include/linux/netdevice.h9
-rw-r--r--include/net/sctp/sctp.h13
-rw-r--r--kernel/compat.c63
-rw-r--r--kernel/fork.c3
-rw-r--r--mm/hugetlb.c1
-rw-r--r--mm/memcontrol.c6
-rw-r--r--mm/nobootmem.c3
-rw-r--r--mm/page_alloc.c2
-rw-r--r--mm/percpu.c22
-rw-r--r--net/8021q/vlan_dev.c2
-rw-r--r--net/core/dev.c36
-rw-r--r--net/core/pktgen.c10
-rw-r--r--net/ipv4/fib_trie.c2
-rw-r--r--net/openvswitch/datapath.c27
-rw-r--r--net/openvswitch/flow.c3
-rw-r--r--net/sctp/output.c4
-rw-r--r--net/sctp/transport.c17
-rw-r--r--net/sunrpc/auth_gss/gss_mech_switch.c7
-rw-r--r--sound/pci/echoaudio/echoaudio_dsp.c2
-rw-r--r--sound/pci/hda/hda_codec.c4
-rw-r--r--sound/pci/hda/hda_intel.c20
-rw-r--r--sound/pci/hda/patch_realtek.c16
-rw-r--r--sound/pci/rme9652/hdsp.c1
-rw-r--r--sound/soc/sh/migor.c2
142 files changed, 1736 insertions, 672 deletions
diff --git a/Documentation/devicetree/bindings/mtd/orion-nand.txt b/Documentation/devicetree/bindings/mtd/orion-nand.txt
new file mode 100644
index 000000000000..b2356b7d2fa4
--- /dev/null
+++ b/Documentation/devicetree/bindings/mtd/orion-nand.txt
@@ -0,0 +1,50 @@
1NAND support for Marvell Orion SoC platforms
2
3Required properties:
4- compatible : "mrvl,orion-nand".
5- reg : Base physical address of the NAND and length of memory mapped
6 region
7
8Optional properties:
9- cle : Address line number connected to CLE. Default is 0
10- ale : Address line number connected to ALE. Default is 1
11- bank-width : Width in bytes of the device. Default is 1
12- chip-delay : Chip dependent delay for transferring data from array to read
13 registers in usecs
14
15The device tree may optionally contain sub-nodes describing partitions of the
16address space. See partition.txt for more detail.
17
18Example:
19
20nand@f4000000 {
21 #address-cells = <1>;
22 #size-cells = <1>;
23 cle = <0>;
24 ale = <1>;
25 bank-width = <1>;
26 chip-delay = <25>;
27 compatible = "mrvl,orion-nand";
28 reg = <0xf4000000 0x400>;
29
30 partition@0 {
31 label = "u-boot";
32 reg = <0x0000000 0x100000>;
33 read-only;
34 };
35
36 partition@100000 {
37 label = "uImage";
38 reg = <0x0100000 0x200000>;
39 };
40
41 partition@300000 {
42 label = "dtb";
43 reg = <0x0300000 0x100000>;
44 };
45
46 partition@400000 {
47 label = "root";
48 reg = <0x0400000 0x7d00000>;
49 };
50};
diff --git a/MAINTAINERS b/MAINTAINERS
index 707163365a93..b36270986501 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -1968,7 +1968,9 @@ S: Maintained
1968F: drivers/net/ethernet/ti/cpmac.c 1968F: drivers/net/ethernet/ti/cpmac.c
1969 1969
1970CPU FREQUENCY DRIVERS 1970CPU FREQUENCY DRIVERS
1971M: Rafael J. Wysocki <rjw@sisk.pl>
1971L: cpufreq@vger.kernel.org 1972L: cpufreq@vger.kernel.org
1973L: linux-pm@vger.kernel.org
1972S: Maintained 1974S: Maintained
1973F: drivers/cpufreq/ 1975F: drivers/cpufreq/
1974F: include/linux/cpufreq.h 1976F: include/linux/cpufreq.h
@@ -4034,6 +4036,7 @@ F: Documentation/scsi/53c700.txt
4034F: drivers/scsi/53c700* 4036F: drivers/scsi/53c700*
4035 4037
4036LED SUBSYSTEM 4038LED SUBSYSTEM
4039M: Bryan Wu <bryan.wu@canonical.com>
4037M: Richard Purdie <rpurdie@rpsys.net> 4040M: Richard Purdie <rpurdie@rpsys.net>
4038S: Maintained 4041S: Maintained
4039F: drivers/leds/ 4042F: drivers/leds/
diff --git a/Makefile b/Makefile
index 9e384ae6c403..48bd1f50dcc3 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
1VERSION = 3 1VERSION = 3
2PATCHLEVEL = 4 2PATCHLEVEL = 4
3SUBLEVEL = 0 3SUBLEVEL = 0
4EXTRAVERSION = -rc6 4EXTRAVERSION = -rc7
5NAME = Saber-toothed Squirrel 5NAME = Saber-toothed Squirrel
6 6
7# *DOCUMENTATION* 7# *DOCUMENTATION*
diff --git a/arch/arm/boot/dts/kirkwood-dns320.dts b/arch/arm/boot/dts/kirkwood-dns320.dts
new file mode 100644
index 000000000000..dc09a735b04a
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns320.dts
@@ -0,0 +1,64 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-320 NAS (Rev A1)";
7 compatible = "dlink,dns-320-a1", "dlink,dns-320", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x8000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <166666667>;
21 status = "okay";
22 };
23
24 serial@12100 {
25 clock-frequency = <166666667>;
26 status = "okay";
27 };
28
29 nand@3000000 {
30 status = "okay";
31
32 partition@0 {
33 label = "u-boot";
34 reg = <0x0000000 0x100000>;
35 read-only;
36 };
37
38 partition@100000 {
39 label = "uImage";
40 reg = <0x0100000 0x500000>;
41 };
42
43 partition@600000 {
44 label = "ramdisk";
45 reg = <0x0600000 0x500000>;
46 };
47
48 partition@b00000 {
49 label = "image";
50 reg = <0x0b00000 0x6600000>;
51 };
52
53 partition@7100000 {
54 label = "mini firmware";
55 reg = <0x7100000 0xa00000>;
56 };
57
58 partition@7b00000 {
59 label = "config";
60 reg = <0x7b00000 0x500000>;
61 };
62 };
63 };
64};
diff --git a/arch/arm/boot/dts/kirkwood-dns325.dts b/arch/arm/boot/dts/kirkwood-dns325.dts
new file mode 100644
index 000000000000..c2a5562525d2
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-dns325.dts
@@ -0,0 +1,59 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "D-Link DNS-325 NAS (Rev A1)";
7 compatible = "dlink,dns-325-a1", "dlink,dns-325", "dlink,dns-kirkwood", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 read-only;
31 };
32
33 partition@100000 {
34 label = "uImage";
35 reg = <0x0100000 0x500000>;
36 };
37
38 partition@600000 {
39 label = "ramdisk";
40 reg = <0x0600000 0x500000>;
41 };
42
43 partition@b00000 {
44 label = "image";
45 reg = <0x0b00000 0x6600000>;
46 };
47
48 partition@7100000 {
49 label = "mini firmware";
50 reg = <0x7100000 0xa00000>;
51 };
52
53 partition@7b00000 {
54 label = "config";
55 reg = <0x7b00000 0x500000>;
56 };
57 };
58 };
59};
diff --git a/arch/arm/boot/dts/kirkwood-ib62x0.dts b/arch/arm/boot/dts/kirkwood-ib62x0.dts
new file mode 100644
index 000000000000..ada0f0c23085
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-ib62x0.dts
@@ -0,0 +1,44 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "RaidSonic ICY BOX IB-NAS62x0 (Rev B)";
7 compatible = "raidsonic,ib-nas6210-b", "raidsonic,ib-nas6220-b", "raidsonic,ib-nas6210", "raidsonic,ib-nas6220", "raidsonic,ib-nas62x0", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk";
16 };
17
18 ocp@f1000000 {
19 serial@12000 {
20 clock-frequency = <200000000>;
21 status = "okay";
22 };
23
24 nand@3000000 {
25 status = "okay";
26
27 partition@0 {
28 label = "u-boot";
29 reg = <0x0000000 0x100000>;
30 };
31
32 partition@100000 {
33 label = "uImage";
34 reg = <0x0100000 0x600000>;
35 };
36
37 partition@700000 {
38 label = "root";
39 reg = <0x0700000 0xf900000>;
40 };
41
42 };
43 };
44};
diff --git a/arch/arm/boot/dts/kirkwood-iconnect.dts b/arch/arm/boot/dts/kirkwood-iconnect.dts
new file mode 100644
index 000000000000..1ba75d4adecc
--- /dev/null
+++ b/arch/arm/boot/dts/kirkwood-iconnect.dts
@@ -0,0 +1,26 @@
1/dts-v1/;
2
3/include/ "kirkwood.dtsi"
4
5/ {
6 model = "Iomega Iconnect";
7 compatible = "iom,iconnect-1.1", "iom,iconnect", "mrvl,kirkwood-88f6281", "mrvl,kirkwood";
8
9 memory {
10 device_type = "memory";
11 reg = <0x00000000 0x10000000>;
12 };
13
14 chosen {
15 bootargs = "console=ttyS0,115200n8 earlyprintk mtdparts=orion_nand:0xc0000@0x0(uboot),0x20000@0xa0000(env),0x300000@0x100000(zImage),0x300000@0x540000(initrd),0x1f400000@0x980000(boot)";
16 linux,initrd-start = <0x4500040>;
17 linux,initrd-end = <0x4800000>;
18 };
19
20 ocp@f1000000 {
21 serial@12000 {
22 clock-frequency = <200000000>;
23 status = "ok";
24 };
25 };
26};
diff --git a/arch/arm/boot/dts/kirkwood.dtsi b/arch/arm/boot/dts/kirkwood.dtsi
index 3474ef890945..926528b81baa 100644
--- a/arch/arm/boot/dts/kirkwood.dtsi
+++ b/arch/arm/boot/dts/kirkwood.dtsi
@@ -5,7 +5,7 @@
5 5
6 ocp@f1000000 { 6 ocp@f1000000 {
7 compatible = "simple-bus"; 7 compatible = "simple-bus";
8 ranges = <0 0xf1000000 0x1000000>; 8 ranges = <0 0xf1000000 0x4000000>;
9 #address-cells = <1>; 9 #address-cells = <1>;
10 #size-cells = <1>; 10 #size-cells = <1>;
11 11
@@ -32,5 +32,18 @@
32 reg = <0x10300 0x20>; 32 reg = <0x10300 0x20>;
33 interrupts = <53>; 33 interrupts = <53>;
34 }; 34 };
35
36 nand@3000000 {
37 #address-cells = <1>;
38 #size-cells = <1>;
39 cle = <0>;
40 ale = <1>;
41 bank-width = <1>;
42 compatible = "mrvl,orion-nand";
43 reg = <0x3000000 0x400>;
44 chip-delay = <25>;
45 /* set partition map and/or chip-delay in board dts */
46 status = "disabled";
47 };
35 }; 48 };
36}; 49};
diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
index 80abafb9bf33..9650c143afc1 100644
--- a/arch/arm/kernel/ptrace.c
+++ b/arch/arm/kernel/ptrace.c
@@ -906,27 +906,14 @@ long arch_ptrace(struct task_struct *child, long request,
906 return ret; 906 return ret;
907} 907}
908 908
909#ifdef __ARMEB__
910#define AUDIT_ARCH_NR AUDIT_ARCH_ARMEB
911#else
912#define AUDIT_ARCH_NR AUDIT_ARCH_ARM
913#endif
914
915asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno) 909asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
916{ 910{
917 unsigned long ip; 911 unsigned long ip;
918 912
919 /* 913 if (why)
920 * Save IP. IP is used to denote syscall entry/exit:
921 * IP = 0 -> entry, = 1 -> exit
922 */
923 ip = regs->ARM_ip;
924 regs->ARM_ip = why;
925
926 if (!ip)
927 audit_syscall_exit(regs); 914 audit_syscall_exit(regs);
928 else 915 else
929 audit_syscall_entry(AUDIT_ARCH_NR, scno, regs->ARM_r0, 916 audit_syscall_entry(AUDIT_ARCH_ARM, scno, regs->ARM_r0,
930 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3); 917 regs->ARM_r1, regs->ARM_r2, regs->ARM_r3);
931 918
932 if (!test_thread_flag(TIF_SYSCALL_TRACE)) 919 if (!test_thread_flag(TIF_SYSCALL_TRACE))
@@ -936,6 +923,13 @@ asmlinkage int syscall_trace(int why, struct pt_regs *regs, int scno)
936 923
937 current_thread_info()->syscall = scno; 924 current_thread_info()->syscall = scno;
938 925
926 /*
927 * IP is used to denote syscall entry/exit:
928 * IP = 0 -> entry, =1 -> exit
929 */
930 ip = regs->ARM_ip;
931 regs->ARM_ip = why;
932
939 /* the 0x80 provides a way for the tracing parent to distinguish 933 /* the 0x80 provides a way for the tracing parent to distinguish
940 between a syscall stop and SIGTRAP delivery */ 934 between a syscall stop and SIGTRAP delivery */
941 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD) 935 ptrace_notify(SIGTRAP | ((current->ptrace & PT_TRACESYSGOOD)
diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
index f6a4d32b0421..8f4644659777 100644
--- a/arch/arm/kernel/smp.c
+++ b/arch/arm/kernel/smp.c
@@ -251,8 +251,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
251 struct mm_struct *mm = &init_mm; 251 struct mm_struct *mm = &init_mm;
252 unsigned int cpu = smp_processor_id(); 252 unsigned int cpu = smp_processor_id();
253 253
254 printk("CPU%u: Booted secondary processor\n", cpu);
255
256 /* 254 /*
257 * All kernel threads share the same mm context; grab a 255 * All kernel threads share the same mm context; grab a
258 * reference and switch to it. 256 * reference and switch to it.
@@ -264,6 +262,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
264 enter_lazy_tlb(mm, current); 262 enter_lazy_tlb(mm, current);
265 local_flush_tlb_all(); 263 local_flush_tlb_all();
266 264
265 printk("CPU%u: Booted secondary processor\n", cpu);
266
267 cpu_init(); 267 cpu_init();
268 preempt_disable(); 268 preempt_disable();
269 trace_hardirqs_off(); 269 trace_hardirqs_off();
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
index d2b177905cdb..76cbb055dd05 100644
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
115 "Ir" (THREAD_START_SP - sizeof(regs)), 115 "Ir" (THREAD_START_SP - sizeof(regs)),
116 "r" (&regs), 116 "r" (&regs),
117 "Ir" (sizeof(regs)) 117 "Ir" (sizeof(regs))
118 : "r0", "r1", "r2", "r3", "ip", "lr", "memory"); 118 : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
119 119
120 out: 120 out:
121 return ret; 121 return ret;
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index 366daff79458..2808e471cdcc 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -233,6 +233,9 @@ config MACH_ARMLEX4210
233config MACH_UNIVERSAL_C210 233config MACH_UNIVERSAL_C210
234 bool "Mobile UNIVERSAL_C210 Board" 234 bool "Mobile UNIVERSAL_C210 Board"
235 select CPU_EXYNOS4210 235 select CPU_EXYNOS4210
236 select S5P_HRT
237 select CLKSRC_MMIO
238 select HAVE_SCHED_CLOCK
236 select S5P_GPIO_INT 239 select S5P_GPIO_INT
237 select S5P_DEV_FIMC0 240 select S5P_DEV_FIMC0
238 select S5P_DEV_FIMC1 241 select S5P_DEV_FIMC1
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 5cd7a8b8868c..7ac6ff4c46bd 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -678,7 +678,7 @@ static struct clk exynos5_clk_pdma1 = {
678 .name = "dma", 678 .name = "dma",
679 .devname = "dma-pl330.1", 679 .devname = "dma-pl330.1",
680 .enable = exynos5_clk_ip_fsys_ctrl, 680 .enable = exynos5_clk_ip_fsys_ctrl,
681 .ctrlbit = (1 << 1), 681 .ctrlbit = (1 << 2),
682}; 682};
683 683
684static struct clk exynos5_clk_mdma1 = { 684static struct clk exynos5_clk_mdma1 = {
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index a6959bbfef89..08e5a8e45bdb 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -41,6 +41,7 @@
41#include <plat/pd.h> 41#include <plat/pd.h>
42#include <plat/regs-fb-v4.h> 42#include <plat/regs-fb-v4.h>
43#include <plat/fimc-core.h> 43#include <plat/fimc-core.h>
44#include <plat/s5p-time.h>
44#include <plat/camport.h> 45#include <plat/camport.h>
45#include <plat/mipi_csis.h> 46#include <plat/mipi_csis.h>
46 47
@@ -1091,6 +1092,7 @@ static void __init universal_map_io(void)
1091 exynos_init_io(NULL, 0); 1092 exynos_init_io(NULL, 0);
1092 s3c24xx_init_clocks(24000000); 1093 s3c24xx_init_clocks(24000000);
1093 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 1094 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
1095 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
1094} 1096}
1095 1097
1096static void s5p_tv_setup(void) 1098static void s5p_tv_setup(void)
@@ -1146,7 +1148,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1146 .map_io = universal_map_io, 1148 .map_io = universal_map_io,
1147 .handle_irq = gic_handle_irq, 1149 .handle_irq = gic_handle_irq,
1148 .init_machine = universal_machine_init, 1150 .init_machine = universal_machine_init,
1149 .timer = &exynos4_timer, 1151 .timer = &s5p_timer,
1150 .reserve = &universal_reserve, 1152 .reserve = &universal_reserve,
1151 .restart = exynos4_restart, 1153 .restart = exynos4_restart,
1152MACHINE_END 1154MACHINE_END
diff --git a/arch/arm/mach-kirkwood/Kconfig b/arch/arm/mach-kirkwood/Kconfig
index 90ceab761929..199764fe0fb0 100644
--- a/arch/arm/mach-kirkwood/Kconfig
+++ b/arch/arm/mach-kirkwood/Kconfig
@@ -58,6 +58,28 @@ config MACH_DREAMPLUG_DT
58 Say 'Y' here if you want your kernel to support the 58 Say 'Y' here if you want your kernel to support the
59 Marvell DreamPlug (Flattened Device Tree). 59 Marvell DreamPlug (Flattened Device Tree).
60 60
61config MACH_ICONNECT_DT
62 bool "Iomega Iconnect (Flattened Device Tree)"
63 select ARCH_KIRKWOOD_DT
64 help
65 Say 'Y' here to enable Iomega Iconnect support.
66
67config MACH_DLINK_KIRKWOOD_DT
68 bool "D-Link Kirkwood-based NAS (Flattened Device Tree)"
69 select ARCH_KIRKWOOD_DT
70 help
71 Say 'Y' here if you want your kernel to support the
72 Kirkwood-based D-Link NASes such as DNS-320 & DNS-325,
73 using Flattened Device Tree.
74
75config MACH_IB62X0_DT
76 bool "RaidSonic IB-NAS6210, IB-NAS6220 (Flattened Device Tree)"
77 select ARCH_KIRKWOOD_DT
78 help
79 Say 'Y' here if you want your kernel to support the
80 RaidSonic IB-NAS6210 & IB-NAS6220 devices, using
81 Flattened Device Tree.
82
61config MACH_TS219 83config MACH_TS219
62 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS" 84 bool "QNAP TS-110, TS-119, TS-119P+, TS-210, TS-219, TS-219P and TS-219P+ Turbo NAS"
63 help 85 help
diff --git a/arch/arm/mach-kirkwood/Makefile b/arch/arm/mach-kirkwood/Makefile
index e299a9576bf0..d2b05907b10e 100644
--- a/arch/arm/mach-kirkwood/Makefile
+++ b/arch/arm/mach-kirkwood/Makefile
@@ -22,3 +22,6 @@ obj-$(CONFIG_MACH_T5325) += t5325-setup.o
22obj-$(CONFIG_CPU_IDLE) += cpuidle.o 22obj-$(CONFIG_CPU_IDLE) += cpuidle.o
23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o 23obj-$(CONFIG_ARCH_KIRKWOOD_DT) += board-dt.o
24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o 24obj-$(CONFIG_MACH_DREAMPLUG_DT) += board-dreamplug.o
25obj-$(CONFIG_MACH_ICONNECT_DT) += board-iconnect.o
26obj-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += board-dnskw.o
27obj-$(CONFIG_MACH_IB62X0_DT) += board-ib62x0.o
diff --git a/arch/arm/mach-kirkwood/Makefile.boot b/arch/arm/mach-kirkwood/Makefile.boot
index 16f938522304..02edbdf5b065 100644
--- a/arch/arm/mach-kirkwood/Makefile.boot
+++ b/arch/arm/mach-kirkwood/Makefile.boot
@@ -3,3 +3,7 @@ params_phys-y := 0x00000100
3initrd_phys-y := 0x00800000 3initrd_phys-y := 0x00800000
4 4
5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb 5dtb-$(CONFIG_MACH_DREAMPLUG_DT) += kirkwood-dreamplug.dtb
6dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns320.dtb
7dtb-$(CONFIG_MACH_DLINK_KIRKWOOD_DT) += kirkwood-dns325.dtb
8dtb-$(CONFIG_MACH_ICONNECT_DT) += kirkwood-iconnect.dtb
9dtb-$(CONFIG_MACH_IB62X0_DT) += kirkwood-ib62x0.dtb
diff --git a/arch/arm/mach-kirkwood/board-dnskw.c b/arch/arm/mach-kirkwood/board-dnskw.c
new file mode 100644
index 000000000000..58c2d68f9443
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-dnskw.c
@@ -0,0 +1,275 @@
1/*
2 * Copyright 2012 (C), Jamie Lentin <jm@lentin.co.uk>
3 *
4 * arch/arm/mach-kirkwood/board-dnskw.c
5 *
6 * D-link DNS-320 & DNS-325 NAS Init for drivers not converted to
7 * flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/i2c.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/of.h>
21#include <linux/gpio.h>
22#include <linux/input.h>
23#include <linux/gpio_keys.h>
24#include <linux/gpio-fan.h>
25#include <linux/leds.h>
26#include <asm/mach-types.h>
27#include <asm/mach/arch.h>
28#include <asm/mach/map.h>
29#include <mach/kirkwood.h>
30#include <mach/bridge-regs.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data dnskw_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
36};
37
38static struct mv_sata_platform_data dnskw_sata_data = {
39 .n_ports = 2,
40};
41
42static unsigned int dnskw_mpp_config[] __initdata = {
43 MPP13_UART1_TXD, /* Custom ... */
44 MPP14_UART1_RXD, /* ... Controller (DNS-320 only) */
45 MPP20_SATA1_ACTn, /* LED: White Right HDD */
46 MPP21_SATA0_ACTn, /* LED: White Left HDD */
47 MPP24_GPIO,
48 MPP25_GPIO,
49 MPP26_GPIO, /* LED: Power */
50 MPP27_GPIO, /* LED: Red Right HDD */
51 MPP28_GPIO, /* LED: Red Left HDD */
52 MPP29_GPIO, /* LED: Red USB (DNS-325 only) */
53 MPP30_GPIO,
54 MPP31_GPIO,
55 MPP32_GPIO,
56 MPP33_GPO,
57 MPP34_GPIO, /* Button: Front power */
58 MPP35_GPIO, /* LED: Red USB (DNS-320 only) */
59 MPP36_GPIO, /* Power: Turn off board */
60 MPP37_GPIO, /* Power: Turn back on after power failure */
61 MPP38_GPIO,
62 MPP39_GPIO, /* Power: SATA0 */
63 MPP40_GPIO, /* Power: SATA1 */
64 MPP41_GPIO, /* SATA0 present */
65 MPP42_GPIO, /* SATA1 present */
66 MPP43_GPIO, /* LED: White USB */
67 MPP44_GPIO, /* Fan: Tachometer Pin */
68 MPP45_GPIO, /* Fan: high speed */
69 MPP46_GPIO, /* Fan: low speed */
70 MPP47_GPIO, /* Button: Back unmount */
71 MPP48_GPIO, /* Button: Back reset */
72 MPP49_GPIO, /* Temp Alarm (DNS-325) Pin of U5 (DNS-320) */
73 0
74};
75
76static struct gpio_led dns325_led_pins[] = {
77 {
78 .name = "dns325:white:power",
79 .gpio = 26,
80 .active_low = 1,
81 .default_trigger = "default-on",
82 },
83 {
84 .name = "dns325:white:usb",
85 .gpio = 43,
86 .active_low = 1,
87 },
88 {
89 .name = "dns325:red:l_hdd",
90 .gpio = 28,
91 .active_low = 1,
92 },
93 {
94 .name = "dns325:red:r_hdd",
95 .gpio = 27,
96 .active_low = 1,
97 },
98 {
99 .name = "dns325:red:usb",
100 .gpio = 29,
101 .active_low = 1,
102 },
103};
104
105static struct gpio_led_platform_data dns325_led_data = {
106 .num_leds = ARRAY_SIZE(dns325_led_pins),
107 .leds = dns325_led_pins,
108};
109
110static struct platform_device dns325_led_device = {
111 .name = "leds-gpio",
112 .id = -1,
113 .dev = {
114 .platform_data = &dns325_led_data,
115 },
116};
117
118static struct gpio_led dns320_led_pins[] = {
119 {
120 .name = "dns320:blue:power",
121 .gpio = 26,
122 .active_low = 1,
123 .default_trigger = "default-on",
124 },
125 {
126 .name = "dns320:blue:usb",
127 .gpio = 43,
128 .active_low = 1,
129 },
130 {
131 .name = "dns320:orange:l_hdd",
132 .gpio = 28,
133 .active_low = 1,
134 },
135 {
136 .name = "dns320:orange:r_hdd",
137 .gpio = 27,
138 .active_low = 1,
139 },
140 {
141 .name = "dns320:orange:usb",
142 .gpio = 35,
143 .active_low = 1,
144 },
145};
146
147static struct gpio_led_platform_data dns320_led_data = {
148 .num_leds = ARRAY_SIZE(dns320_led_pins),
149 .leds = dns320_led_pins,
150};
151
152static struct platform_device dns320_led_device = {
153 .name = "leds-gpio",
154 .id = -1,
155 .dev = {
156 .platform_data = &dns320_led_data,
157 },
158};
159
160static struct i2c_board_info dns325_i2c_board_info[] __initdata = {
161 {
162 I2C_BOARD_INFO("lm75", 0x48),
163 },
164 /* Something at 0x0c also */
165};
166
167static struct gpio_keys_button dnskw_button_pins[] = {
168 {
169 .code = KEY_POWER,
170 .gpio = 34,
171 .desc = "Power button",
172 .active_low = 1,
173 },
174 {
175 .code = KEY_EJECTCD,
176 .gpio = 47,
177 .desc = "USB unmount button",
178 .active_low = 1,
179 },
180 {
181 .code = KEY_RESTART,
182 .gpio = 48,
183 .desc = "Reset button",
184 .active_low = 1,
185 },
186};
187
188static struct gpio_keys_platform_data dnskw_button_data = {
189 .buttons = dnskw_button_pins,
190 .nbuttons = ARRAY_SIZE(dnskw_button_pins),
191};
192
193static struct platform_device dnskw_button_device = {
194 .name = "gpio-keys",
195 .id = -1,
196 .num_resources = 0,
197 .dev = {
198 .platform_data = &dnskw_button_data,
199 }
200};
201
202/* Fan: ADDA AD045HB-G73 40mm 6000rpm@5v */
203static struct gpio_fan_speed dnskw_fan_speed[] = {
204 { 0, 0 },
205 { 3000, 1 },
206 { 6000, 2 },
207};
208static unsigned dnskw_fan_pins[] = {46, 45};
209
210static struct gpio_fan_platform_data dnskw_fan_data = {
211 .num_ctrl = ARRAY_SIZE(dnskw_fan_pins),
212 .ctrl = dnskw_fan_pins,
213 .num_speed = ARRAY_SIZE(dnskw_fan_speed),
214 .speed = dnskw_fan_speed,
215};
216
217static struct platform_device dnskw_fan_device = {
218 .name = "gpio-fan",
219 .id = -1,
220 .dev = {
221 .platform_data = &dnskw_fan_data,
222 },
223};
224
225static void dnskw_power_off(void)
226{
227 gpio_set_value(36, 1);
228}
229
230/* Register any GPIO for output and set the value */
231static void __init dnskw_gpio_register(unsigned gpio, char *name, int def)
232{
233 if (gpio_request(gpio, name) == 0 &&
234 gpio_direction_output(gpio, 0) == 0) {
235 gpio_set_value(gpio, def);
236 if (gpio_export(gpio, 0) != 0)
237 pr_err("dnskw: Failed to export GPIO %s\n", name);
238 } else
239 pr_err("dnskw: Failed to register %s\n", name);
240}
241
242void __init dnskw_init(void)
243{
244 kirkwood_mpp_conf(dnskw_mpp_config);
245
246 kirkwood_ehci_init();
247 kirkwood_ge00_init(&dnskw_ge00_data);
248 kirkwood_sata_init(&dnskw_sata_data);
249 kirkwood_i2c_init();
250
251 platform_device_register(&dnskw_button_device);
252 platform_device_register(&dnskw_fan_device);
253
254 if (of_machine_is_compatible("dlink,dns-325")) {
255 i2c_register_board_info(0, dns325_i2c_board_info,
256 ARRAY_SIZE(dns325_i2c_board_info));
257 platform_device_register(&dns325_led_device);
258
259 } else if (of_machine_is_compatible("dlink,dns-320"))
260 platform_device_register(&dns320_led_device);
261
262 /* Register power-off GPIO. */
263 if (gpio_request(36, "dnskw:power:off") == 0
264 && gpio_direction_output(36, 0) == 0)
265 pm_power_off = dnskw_power_off;
266 else
267 pr_err("dnskw: failed to configure power-off GPIO\n");
268
269 /* Ensure power is supplied to both HDDs */
270 dnskw_gpio_register(39, "dnskw:power:sata0", 1);
271 dnskw_gpio_register(40, "dnskw:power:sata1", 1);
272
273 /* Set NAS to turn back on after a power failure */
274 dnskw_gpio_register(37, "dnskw:power:recover", 1);
275}
diff --git a/arch/arm/mach-kirkwood/board-dt.c b/arch/arm/mach-kirkwood/board-dt.c
index 1c672d9e6656..10d1969b9e3a 100644
--- a/arch/arm/mach-kirkwood/board-dt.c
+++ b/arch/arm/mach-kirkwood/board-dt.c
@@ -14,6 +14,7 @@
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/of.h> 15#include <linux/of.h>
16#include <linux/of_platform.h> 16#include <linux/of_platform.h>
17#include <linux/kexec.h>
17#include <asm/mach/arch.h> 18#include <asm/mach/arch.h>
18#include <asm/mach/map.h> 19#include <asm/mach/map.h>
19#include <mach/bridge-regs.h> 20#include <mach/bridge-regs.h>
@@ -55,11 +56,24 @@ static void __init kirkwood_dt_init(void)
55 if (of_machine_is_compatible("globalscale,dreamplug")) 56 if (of_machine_is_compatible("globalscale,dreamplug"))
56 dreamplug_init(); 57 dreamplug_init();
57 58
59 if (of_machine_is_compatible("dlink,dns-kirkwood"))
60 dnskw_init();
61
62 if (of_machine_is_compatible("iom,iconnect"))
63 iconnect_init();
64
65 if (of_machine_is_compatible("raidsonic,ib-nas62x0"))
66 ib62x0_init();
67
58 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL); 68 of_platform_populate(NULL, kirkwood_dt_match_table, NULL, NULL);
59} 69}
60 70
61static const char *kirkwood_dt_board_compat[] = { 71static const char *kirkwood_dt_board_compat[] = {
62 "globalscale,dreamplug", 72 "globalscale,dreamplug",
73 "dlink,dns-320",
74 "dlink,dns-325",
75 "iom,iconnect",
76 "raidsonic,ib-nas62x0",
63 NULL 77 NULL
64}; 78};
65 79
diff --git a/arch/arm/mach-kirkwood/board-ib62x0.c b/arch/arm/mach-kirkwood/board-ib62x0.c
new file mode 100644
index 000000000000..eddf1df8891f
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-ib62x0.c
@@ -0,0 +1,143 @@
1/*
2 * Copyright 2012 (C), Simon Baatz <gmbnomis@gmail.com>
3 *
4 * arch/arm/mach-kirkwood/board-ib62x0.c
5 *
6 * RaidSonic ICY BOX IB-NAS6210 & IB-NAS6220 init for drivers not
7 * converted to flattened device tree yet.
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#include <linux/kernel.h>
15#include <linux/init.h>
16#include <linux/platform_device.h>
17#include <linux/mtd/partitions.h>
18#include <linux/ata_platform.h>
19#include <linux/mv643xx_eth.h>
20#include <linux/gpio.h>
21#include <linux/gpio_keys.h>
22#include <linux/input.h>
23#include <linux/leds.h>
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26#include <mach/kirkwood.h>
27#include "common.h"
28#include "mpp.h"
29
30#define IB62X0_GPIO_POWER_OFF 24
31
32static struct mv643xx_eth_platform_data ib62x0_ge00_data = {
33 .phy_addr = MV643XX_ETH_PHY_ADDR(8),
34};
35
36static struct mv_sata_platform_data ib62x0_sata_data = {
37 .n_ports = 2,
38};
39
40static unsigned int ib62x0_mpp_config[] __initdata = {
41 MPP0_NF_IO2,
42 MPP1_NF_IO3,
43 MPP2_NF_IO4,
44 MPP3_NF_IO5,
45 MPP4_NF_IO6,
46 MPP5_NF_IO7,
47 MPP18_NF_IO0,
48 MPP19_NF_IO1,
49 MPP22_GPIO, /* OS LED red */
50 MPP24_GPIO, /* Power off device */
51 MPP25_GPIO, /* OS LED green */
52 MPP27_GPIO, /* USB transfer LED */
53 MPP28_GPIO, /* Reset button */
54 MPP29_GPIO, /* USB Copy button */
55 0
56};
57
58static struct gpio_led ib62x0_led_pins[] = {
59 {
60 .name = "ib62x0:green:os",
61 .default_trigger = "default-on",
62 .gpio = 25,
63 .active_low = 0,
64 },
65 {
66 .name = "ib62x0:red:os",
67 .default_trigger = "none",
68 .gpio = 22,
69 .active_low = 0,
70 },
71 {
72 .name = "ib62x0:red:usb_copy",
73 .default_trigger = "none",
74 .gpio = 27,
75 .active_low = 0,
76 },
77};
78
79static struct gpio_led_platform_data ib62x0_led_data = {
80 .leds = ib62x0_led_pins,
81 .num_leds = ARRAY_SIZE(ib62x0_led_pins),
82};
83
84static struct platform_device ib62x0_led_device = {
85 .name = "leds-gpio",
86 .id = -1,
87 .dev = {
88 .platform_data = &ib62x0_led_data,
89 }
90};
91
92static struct gpio_keys_button ib62x0_button_pins[] = {
93 {
94 .code = KEY_COPY,
95 .gpio = 29,
96 .desc = "USB Copy",
97 .active_low = 1,
98 },
99 {
100 .code = KEY_RESTART,
101 .gpio = 28,
102 .desc = "Reset",
103 .active_low = 1,
104 },
105};
106
107static struct gpio_keys_platform_data ib62x0_button_data = {
108 .buttons = ib62x0_button_pins,
109 .nbuttons = ARRAY_SIZE(ib62x0_button_pins),
110};
111
112static struct platform_device ib62x0_button_device = {
113 .name = "gpio-keys",
114 .id = -1,
115 .num_resources = 0,
116 .dev = {
117 .platform_data = &ib62x0_button_data,
118 }
119};
120
121static void ib62x0_power_off(void)
122{
123 gpio_set_value(IB62X0_GPIO_POWER_OFF, 1);
124}
125
126void __init ib62x0_init(void)
127{
128 /*
129 * Basic setup. Needs to be called early.
130 */
131 kirkwood_mpp_conf(ib62x0_mpp_config);
132
133 kirkwood_ehci_init();
134 kirkwood_ge00_init(&ib62x0_ge00_data);
135 kirkwood_sata_init(&ib62x0_sata_data);
136 platform_device_register(&ib62x0_led_device);
137 platform_device_register(&ib62x0_button_device);
138 if (gpio_request(IB62X0_GPIO_POWER_OFF, "ib62x0:power:off") == 0 &&
139 gpio_direction_output(IB62X0_GPIO_POWER_OFF, 0) == 0)
140 pm_power_off = ib62x0_power_off;
141 else
142 pr_err("board-ib62x0: failed to configure power-off GPIO\n");
143}
diff --git a/arch/arm/mach-kirkwood/board-iconnect.c b/arch/arm/mach-kirkwood/board-iconnect.c
new file mode 100644
index 000000000000..2222c5739519
--- /dev/null
+++ b/arch/arm/mach-kirkwood/board-iconnect.c
@@ -0,0 +1,165 @@
1/*
2 * arch/arm/mach-kirkwood/board-iconnect.c
3 *
4 * Iomega i-connect Board Setup
5 *
6 * This file is licensed under the terms of the GNU General Public
7 * License version 2. This program is licensed "as is" without any
8 * warranty of any kind, whether express or implied.
9 */
10
11#include <linux/kernel.h>
12#include <linux/init.h>
13#include <linux/platform_device.h>
14#include <linux/of.h>
15#include <linux/of_address.h>
16#include <linux/of_fdt.h>
17#include <linux/of_irq.h>
18#include <linux/of_platform.h>
19#include <linux/mtd/partitions.h>
20#include <linux/mv643xx_eth.h>
21#include <linux/gpio.h>
22#include <linux/leds.h>
23#include <linux/spi/flash.h>
24#include <linux/spi/spi.h>
25#include <linux/spi/orion_spi.h>
26#include <linux/i2c.h>
27#include <linux/input.h>
28#include <linux/gpio_keys.h>
29#include <asm/mach/arch.h>
30#include <mach/kirkwood.h>
31#include "common.h"
32#include "mpp.h"
33
34static struct mv643xx_eth_platform_data iconnect_ge00_data = {
35 .phy_addr = MV643XX_ETH_PHY_ADDR(11),
36};
37
38static struct gpio_led iconnect_led_pins[] = {
39 {
40 .name = "led_level",
41 .gpio = 41,
42 .default_trigger = "default-on",
43 }, {
44 .name = "power:blue",
45 .gpio = 42,
46 .default_trigger = "timer",
47 }, {
48 .name = "power:red",
49 .gpio = 43,
50 }, {
51 .name = "usb1:blue",
52 .gpio = 44,
53 }, {
54 .name = "usb2:blue",
55 .gpio = 45,
56 }, {
57 .name = "usb3:blue",
58 .gpio = 46,
59 }, {
60 .name = "usb4:blue",
61 .gpio = 47,
62 }, {
63 .name = "otb:blue",
64 .gpio = 48,
65 },
66};
67
68static struct gpio_led_platform_data iconnect_led_data = {
69 .leds = iconnect_led_pins,
70 .num_leds = ARRAY_SIZE(iconnect_led_pins),
71 .gpio_blink_set = orion_gpio_led_blink_set,
72};
73
74static struct platform_device iconnect_leds = {
75 .name = "leds-gpio",
76 .id = -1,
77 .dev = {
78 .platform_data = &iconnect_led_data,
79 }
80};
81
82static unsigned int iconnect_mpp_config[] __initdata = {
83 MPP12_GPIO,
84 MPP35_GPIO,
85 MPP41_GPIO,
86 MPP42_GPIO,
87 MPP43_GPIO,
88 MPP44_GPIO,
89 MPP45_GPIO,
90 MPP46_GPIO,
91 MPP47_GPIO,
92 MPP48_GPIO,
93 0
94};
95
96static struct i2c_board_info __initdata iconnect_board_info[] = {
97 {
98 I2C_BOARD_INFO("lm63", 0x4c),
99 },
100};
101
102static struct mtd_partition iconnect_nand_parts[] = {
103 {
104 .name = "flash",
105 .offset = 0,
106 .size = MTDPART_SIZ_FULL,
107 },
108};
109
110/* yikes... theses are the original input buttons */
111/* but I'm not convinced by the sw event choices */
112static struct gpio_keys_button iconnect_buttons[] = {
113 {
114 .type = EV_SW,
115 .code = SW_LID,
116 .gpio = 12,
117 .desc = "Reset Button",
118 .active_low = 1,
119 .debounce_interval = 100,
120 }, {
121 .type = EV_SW,
122 .code = SW_TABLET_MODE,
123 .gpio = 35,
124 .desc = "OTB Button",
125 .active_low = 1,
126 .debounce_interval = 100,
127 },
128};
129
130static struct gpio_keys_platform_data iconnect_button_data = {
131 .buttons = iconnect_buttons,
132 .nbuttons = ARRAY_SIZE(iconnect_buttons),
133};
134
135static struct platform_device iconnect_button_device = {
136 .name = "gpio-keys",
137 .id = -1,
138 .num_resources = 0,
139 .dev = {
140 .platform_data = &iconnect_button_data,
141 },
142};
143
144void __init iconnect_init(void)
145{
146 kirkwood_mpp_conf(iconnect_mpp_config);
147 kirkwood_nand_init(ARRAY_AND_SIZE(iconnect_nand_parts), 25);
148 kirkwood_i2c_init();
149 i2c_register_board_info(0, iconnect_board_info,
150 ARRAY_SIZE(iconnect_board_info));
151
152 kirkwood_ehci_init();
153 kirkwood_ge00_init(&iconnect_ge00_data);
154
155 platform_device_register(&iconnect_button_device);
156 platform_device_register(&iconnect_leds);
157}
158
159static int __init iconnect_pci_init(void)
160{
161 if (of_machine_is_compatible("iom,iconnect"))
162 kirkwood_pcie_init(KW_PCIE0);
163 return 0;
164}
165subsys_initcall(iconnect_pci_init);
diff --git a/arch/arm/mach-kirkwood/common.c b/arch/arm/mach-kirkwood/common.c
index a02cae881f2f..3ad037385a5e 100644
--- a/arch/arm/mach-kirkwood/common.c
+++ b/arch/arm/mach-kirkwood/common.c
@@ -15,6 +15,7 @@
15#include <linux/ata_platform.h> 15#include <linux/ata_platform.h>
16#include <linux/mtd/nand.h> 16#include <linux/mtd/nand.h>
17#include <linux/dma-mapping.h> 17#include <linux/dma-mapping.h>
18#include <linux/of.h>
18#include <net/dsa.h> 19#include <net/dsa.h>
19#include <asm/page.h> 20#include <asm/page.h>
20#include <asm/timex.h> 21#include <asm/timex.h>
@@ -482,6 +483,9 @@ static int __init kirkwood_clock_gate(void)
482 unsigned int curr = readl(CLOCK_GATING_CTRL); 483 unsigned int curr = readl(CLOCK_GATING_CTRL);
483 u32 dev, rev; 484 u32 dev, rev;
484 485
486#ifdef CONFIG_OF
487 struct device_node *np;
488#endif
485 kirkwood_pcie_id(&dev, &rev); 489 kirkwood_pcie_id(&dev, &rev);
486 printk(KERN_DEBUG "Gating clock of unused units\n"); 490 printk(KERN_DEBUG "Gating clock of unused units\n");
487 printk(KERN_DEBUG "before: 0x%08x\n", curr); 491 printk(KERN_DEBUG "before: 0x%08x\n", curr);
@@ -489,6 +493,14 @@ static int __init kirkwood_clock_gate(void)
489 /* Make sure those units are accessible */ 493 /* Make sure those units are accessible */
490 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL); 494 writel(curr | CGC_SATA0 | CGC_SATA1 | CGC_PEX0 | CGC_PEX1, CLOCK_GATING_CTRL);
491 495
496#ifdef CONFIG_OF
497 np = of_find_compatible_node(NULL, NULL, "mrvl,orion-nand");
498 if (np && of_device_is_available(np)) {
499 kirkwood_clk_ctrl |= CGC_RUNIT;
500 of_node_put(np);
501 }
502#endif
503
492 /* For SATA: first shutdown the phy */ 504 /* For SATA: first shutdown the phy */
493 if (!(kirkwood_clk_ctrl & CGC_SATA0)) { 505 if (!(kirkwood_clk_ctrl & CGC_SATA0)) {
494 /* Disable PLL and IVREF */ 506 /* Disable PLL and IVREF */
diff --git a/arch/arm/mach-kirkwood/common.h b/arch/arm/mach-kirkwood/common.h
index fa8e7689c436..a34c41a5172e 100644
--- a/arch/arm/mach-kirkwood/common.h
+++ b/arch/arm/mach-kirkwood/common.h
@@ -58,6 +58,24 @@ void dreamplug_init(void);
58static inline void dreamplug_init(void) {}; 58static inline void dreamplug_init(void) {};
59#endif 59#endif
60 60
61#ifdef CONFIG_MACH_DLINK_KIRKWOOD_DT
62void dnskw_init(void);
63#else
64static inline void dnskw_init(void) {};
65#endif
66
67#ifdef CONFIG_MACH_ICONNECT_DT
68void iconnect_init(void);
69#else
70static inline void iconnect_init(void) {};
71#endif
72
73#ifdef CONFIG_MACH_IB62X0_DT
74void ib62x0_init(void);
75#else
76static inline void ib62x0_init(void) {};
77#endif
78
61/* early init functions not converted to fdt yet */ 79/* early init functions not converted to fdt yet */
62char *kirkwood_id(void); 80char *kirkwood_id(void);
63void kirkwood_l2_init(void); 81void kirkwood_l2_init(void);
diff --git a/arch/arm/mach-omap1/ams-delta-fiq.c b/arch/arm/mach-omap1/ams-delta-fiq.c
index fcce7ff37630..cfd98b186fcc 100644
--- a/arch/arm/mach-omap1/ams-delta-fiq.c
+++ b/arch/arm/mach-omap1/ams-delta-fiq.c
@@ -48,7 +48,7 @@ static irqreturn_t deferred_fiq(int irq, void *dev_id)
48 struct irq_chip *irq_chip = NULL; 48 struct irq_chip *irq_chip = NULL;
49 int gpio, irq_num, fiq_count; 49 int gpio, irq_num, fiq_count;
50 50
51 irq_desc = irq_to_desc(IH_GPIO_BASE); 51 irq_desc = irq_to_desc(gpio_to_irq(AMS_DELTA_GPIO_PIN_KEYBRD_CLK));
52 if (irq_desc) 52 if (irq_desc)
53 irq_chip = irq_desc->irq_data.chip; 53 irq_chip = irq_desc->irq_data.chip;
54 54
diff --git a/arch/arm/mach-omap2/board-igep0020.c b/arch/arm/mach-omap2/board-igep0020.c
index 16ec5c89e035..55dfcccf1a8a 100644
--- a/arch/arm/mach-omap2/board-igep0020.c
+++ b/arch/arm/mach-omap2/board-igep0020.c
@@ -629,7 +629,7 @@ static struct regulator_consumer_supply dummy_supplies[] = {
629 629
630static void __init igep_init(void) 630static void __init igep_init(void)
631{ 631{
632 regulator_register_fixed(0, dummy_supplies, ARRAY_SIZE(dummy_supplies)); 632 regulator_register_fixed(1, dummy_supplies, ARRAY_SIZE(dummy_supplies));
633 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB); 633 omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
634 634
635 /* Get IGEP2 hardware revision */ 635 /* Get IGEP2 hardware revision */
diff --git a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
index 1e2d3322f33e..c88420de1151 100644
--- a/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
+++ b/arch/arm/mach-omap2/include/mach/ctrl_module_pad_core_44xx.h
@@ -941,10 +941,10 @@
941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29) 941#define OMAP4_DSI2_LANEENABLE_MASK (0x7 << 29)
942#define OMAP4_DSI1_LANEENABLE_SHIFT 24 942#define OMAP4_DSI1_LANEENABLE_SHIFT 24
943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24) 943#define OMAP4_DSI1_LANEENABLE_MASK (0x1f << 24)
944#define OMAP4_DSI2_PIPD_SHIFT 19 944#define OMAP4_DSI1_PIPD_SHIFT 19
945#define OMAP4_DSI2_PIPD_MASK (0x1f << 19) 945#define OMAP4_DSI1_PIPD_MASK (0x1f << 19)
946#define OMAP4_DSI1_PIPD_SHIFT 14 946#define OMAP4_DSI2_PIPD_SHIFT 14
947#define OMAP4_DSI1_PIPD_MASK (0x1f << 14) 947#define OMAP4_DSI2_PIPD_MASK (0x1f << 14)
948 948
949/* CONTROL_MCBSPLP */ 949/* CONTROL_MCBSPLP */
950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31 950#define OMAP4_ALBCTRLRX_FSX_SHIFT 31
diff --git a/arch/arm/mach-orion5x/dns323-setup.c b/arch/arm/mach-orion5x/dns323-setup.c
index c3ed15b8ea25..13d2bece1bae 100644
--- a/arch/arm/mach-orion5x/dns323-setup.c
+++ b/arch/arm/mach-orion5x/dns323-setup.c
@@ -253,27 +253,6 @@ error_fail:
253 * GPIO LEDs (simple - doesn't use hardware blinking support) 253 * GPIO LEDs (simple - doesn't use hardware blinking support)
254 */ 254 */
255 255
256#define ORION_BLINK_HALF_PERIOD 100 /* ms */
257
258static int dns323_gpio_blink_set(unsigned gpio, int state,
259 unsigned long *delay_on, unsigned long *delay_off)
260{
261
262 if (delay_on && delay_off && !*delay_on && !*delay_off)
263 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
264
265 switch(state) {
266 case GPIO_LED_NO_BLINK_LOW:
267 case GPIO_LED_NO_BLINK_HIGH:
268 orion_gpio_set_blink(gpio, 0);
269 gpio_set_value(gpio, state);
270 break;
271 case GPIO_LED_BLINK:
272 orion_gpio_set_blink(gpio, 1);
273 }
274 return 0;
275}
276
277static struct gpio_led dns323ab_leds[] = { 256static struct gpio_led dns323ab_leds[] = {
278 { 257 {
279 .name = "power:blue", 258 .name = "power:blue",
@@ -312,13 +291,13 @@ static struct gpio_led dns323c_leds[] = {
312static struct gpio_led_platform_data dns323ab_led_data = { 291static struct gpio_led_platform_data dns323ab_led_data = {
313 .num_leds = ARRAY_SIZE(dns323ab_leds), 292 .num_leds = ARRAY_SIZE(dns323ab_leds),
314 .leds = dns323ab_leds, 293 .leds = dns323ab_leds,
315 .gpio_blink_set = dns323_gpio_blink_set, 294 .gpio_blink_set = orion_gpio_led_blink_set,
316}; 295};
317 296
318static struct gpio_led_platform_data dns323c_led_data = { 297static struct gpio_led_platform_data dns323c_led_data = {
319 .num_leds = ARRAY_SIZE(dns323c_leds), 298 .num_leds = ARRAY_SIZE(dns323c_leds),
320 .leds = dns323c_leds, 299 .leds = dns323c_leds,
321 .gpio_blink_set = dns323_gpio_blink_set, 300 .gpio_blink_set = orion_gpio_led_blink_set,
322}; 301};
323 302
324static struct platform_device dns323_gpio_leds = { 303static struct platform_device dns323_gpio_leds = {
diff --git a/arch/arm/mach-orion5x/mpp.h b/arch/arm/mach-orion5x/mpp.h
index eac68978a2c2..db70e79a1198 100644
--- a/arch/arm/mach-orion5x/mpp.h
+++ b/arch/arm/mach-orion5x/mpp.h
@@ -65,8 +65,8 @@
65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1) 65#define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1)
66 66
67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1) 67#define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1)
68#define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1) 68#define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1)
69#define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1) 69#define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1)
70 70
71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1) 71#define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1)
72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1) 72#define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c
index 10d160888133..af95af257301 100644
--- a/arch/arm/plat-orion/gpio.c
+++ b/arch/arm/plat-orion/gpio.c
@@ -16,6 +16,7 @@
16#include <linux/bitops.h> 16#include <linux/bitops.h>
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/gpio.h> 18#include <linux/gpio.h>
19#include <linux/leds.h>
19 20
20/* 21/*
21 * GPIO unit register offsets. 22 * GPIO unit register offsets.
@@ -289,12 +290,34 @@ void orion_gpio_set_blink(unsigned pin, int blink)
289 return; 290 return;
290 291
291 spin_lock_irqsave(&ochip->lock, flags); 292 spin_lock_irqsave(&ochip->lock, flags);
292 __set_level(ochip, pin, 0); 293 __set_level(ochip, pin & 31, 0);
293 __set_blinking(ochip, pin, blink); 294 __set_blinking(ochip, pin & 31, blink);
294 spin_unlock_irqrestore(&ochip->lock, flags); 295 spin_unlock_irqrestore(&ochip->lock, flags);
295} 296}
296EXPORT_SYMBOL(orion_gpio_set_blink); 297EXPORT_SYMBOL(orion_gpio_set_blink);
297 298
299#define ORION_BLINK_HALF_PERIOD 100 /* ms */
300
301int orion_gpio_led_blink_set(unsigned gpio, int state,
302 unsigned long *delay_on, unsigned long *delay_off)
303{
304
305 if (delay_on && delay_off && !*delay_on && !*delay_off)
306 *delay_on = *delay_off = ORION_BLINK_HALF_PERIOD;
307
308 switch (state) {
309 case GPIO_LED_NO_BLINK_LOW:
310 case GPIO_LED_NO_BLINK_HIGH:
311 orion_gpio_set_blink(gpio, 0);
312 gpio_set_value(gpio, state);
313 break;
314 case GPIO_LED_BLINK:
315 orion_gpio_set_blink(gpio, 1);
316 }
317 return 0;
318}
319EXPORT_SYMBOL_GPL(orion_gpio_led_blink_set);
320
298 321
299/***************************************************************************** 322/*****************************************************************************
300 * Orion GPIO IRQ 323 * Orion GPIO IRQ
diff --git a/arch/arm/plat-orion/include/plat/gpio.h b/arch/arm/plat-orion/include/plat/gpio.h
index 3abf30428bee..bec0c98ce41f 100644
--- a/arch/arm/plat-orion/include/plat/gpio.h
+++ b/arch/arm/plat-orion/include/plat/gpio.h
@@ -19,6 +19,8 @@
19 */ 19 */
20void orion_gpio_set_unused(unsigned pin); 20void orion_gpio_set_unused(unsigned pin);
21void orion_gpio_set_blink(unsigned pin, int blink); 21void orion_gpio_set_blink(unsigned pin, int blink);
22int orion_gpio_led_blink_set(unsigned gpio, int state,
23 unsigned long *delay_on, unsigned long *delay_off);
22 24
23#define GPIO_INPUT_OK (1 << 0) 25#define GPIO_INPUT_OK (1 << 0)
24#define GPIO_OUTPUT_OK (1 << 1) 26#define GPIO_OUTPUT_OK (1 << 1)
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index f5104b7c52cd..463fb3bbe11e 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1174,7 +1174,7 @@ out:
1174 1174
1175bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu) 1175bool kvm_vcpu_compatible(struct kvm_vcpu *vcpu)
1176{ 1176{
1177 return irqchip_in_kernel(vcpu->kcm) == (vcpu->arch.apic != NULL); 1177 return irqchip_in_kernel(vcpu->kvm) == (vcpu->arch.apic != NULL);
1178} 1178}
1179 1179
1180int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu) 1180int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
diff --git a/arch/m68k/platform/520x/config.c b/arch/m68k/platform/520x/config.c
index 235947844f27..09df4b89e8be 100644
--- a/arch/m68k/platform/520x/config.c
+++ b/arch/m68k/platform/520x/config.c
@@ -22,7 +22,7 @@
22 22
23/***************************************************************************/ 23/***************************************************************************/
24 24
25#ifdef CONFIG_SPI_COLDFIRE_QSPI 25#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
26 26
27static void __init m520x_qspi_init(void) 27static void __init m520x_qspi_init(void)
28{ 28{
@@ -35,7 +35,7 @@ static void __init m520x_qspi_init(void)
35 writew(par, MCF_GPIO_PAR_UART); 35 writew(par, MCF_GPIO_PAR_UART);
36} 36}
37 37
38#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 38#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
39 39
40/***************************************************************************/ 40/***************************************************************************/
41 41
@@ -79,7 +79,7 @@ void __init config_BSP(char *commandp, int size)
79 mach_sched_init = hw_timer_init; 79 mach_sched_init = hw_timer_init;
80 m520x_uarts_init(); 80 m520x_uarts_init();
81 m520x_fec_init(); 81 m520x_fec_init();
82#ifdef CONFIG_SPI_COLDFIRE_QSPI 82#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
83 m520x_qspi_init(); 83 m520x_qspi_init();
84#endif 84#endif
85} 85}
diff --git a/arch/m68k/platform/523x/config.c b/arch/m68k/platform/523x/config.c
index c8b405d5a961..d47dfd8f50a2 100644
--- a/arch/m68k/platform/523x/config.c
+++ b/arch/m68k/platform/523x/config.c
@@ -22,7 +22,7 @@
22 22
23/***************************************************************************/ 23/***************************************************************************/
24 24
25#ifdef CONFIG_SPI_COLDFIRE_QSPI 25#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
26 26
27static void __init m523x_qspi_init(void) 27static void __init m523x_qspi_init(void)
28{ 28{
@@ -36,7 +36,7 @@ static void __init m523x_qspi_init(void)
36 writew(par, MCFGPIO_PAR_TIMER); 36 writew(par, MCFGPIO_PAR_TIMER);
37} 37}
38 38
39#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 39#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
40 40
41/***************************************************************************/ 41/***************************************************************************/
42 42
@@ -58,7 +58,7 @@ void __init config_BSP(char *commandp, int size)
58{ 58{
59 mach_sched_init = hw_timer_init; 59 mach_sched_init = hw_timer_init;
60 m523x_fec_init(); 60 m523x_fec_init();
61#ifdef CONFIG_SPI_COLDFIRE_QSPI 61#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
62 m523x_qspi_init(); 62 m523x_qspi_init();
63#endif 63#endif
64} 64}
diff --git a/arch/m68k/platform/5249/config.c b/arch/m68k/platform/5249/config.c
index bbf05135bb98..300e729a58d0 100644
--- a/arch/m68k/platform/5249/config.c
+++ b/arch/m68k/platform/5249/config.c
@@ -51,7 +51,7 @@ static struct platform_device *m5249_devices[] __initdata = {
51 51
52/***************************************************************************/ 52/***************************************************************************/
53 53
54#ifdef CONFIG_SPI_COLDFIRE_QSPI 54#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
55 55
56static void __init m5249_qspi_init(void) 56static void __init m5249_qspi_init(void)
57{ 57{
@@ -61,7 +61,7 @@ static void __init m5249_qspi_init(void)
61 mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI); 61 mcf_mapirq2imr(MCF_IRQ_QSPI, MCFINTC_QSPI);
62} 62}
63 63
64#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 64#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
65 65
66/***************************************************************************/ 66/***************************************************************************/
67 67
@@ -90,7 +90,7 @@ void __init config_BSP(char *commandp, int size)
90#ifdef CONFIG_M5249C3 90#ifdef CONFIG_M5249C3
91 m5249_smc91x_init(); 91 m5249_smc91x_init();
92#endif 92#endif
93#ifdef CONFIG_SPI_COLDFIRE_QSPI 93#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
94 m5249_qspi_init(); 94 m5249_qspi_init();
95#endif 95#endif
96} 96}
diff --git a/arch/m68k/platform/527x/config.c b/arch/m68k/platform/527x/config.c
index f91a53294c35..b3cb378c5e94 100644
--- a/arch/m68k/platform/527x/config.c
+++ b/arch/m68k/platform/527x/config.c
@@ -23,7 +23,7 @@
23 23
24/***************************************************************************/ 24/***************************************************************************/
25 25
26#ifdef CONFIG_SPI_COLDFIRE_QSPI 26#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
27 27
28static void __init m527x_qspi_init(void) 28static void __init m527x_qspi_init(void)
29{ 29{
@@ -42,7 +42,7 @@ static void __init m527x_qspi_init(void)
42#endif 42#endif
43} 43}
44 44
45#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 45#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
46 46
47/***************************************************************************/ 47/***************************************************************************/
48 48
@@ -90,7 +90,7 @@ void __init config_BSP(char *commandp, int size)
90 mach_sched_init = hw_timer_init; 90 mach_sched_init = hw_timer_init;
91 m527x_uarts_init(); 91 m527x_uarts_init();
92 m527x_fec_init(); 92 m527x_fec_init();
93#ifdef CONFIG_SPI_COLDFIRE_QSPI 93#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
94 m527x_qspi_init(); 94 m527x_qspi_init();
95#endif 95#endif
96} 96}
diff --git a/arch/m68k/platform/528x/config.c b/arch/m68k/platform/528x/config.c
index d4492926614c..c5f11ba49be5 100644
--- a/arch/m68k/platform/528x/config.c
+++ b/arch/m68k/platform/528x/config.c
@@ -24,7 +24,7 @@
24 24
25/***************************************************************************/ 25/***************************************************************************/
26 26
27#ifdef CONFIG_SPI_COLDFIRE_QSPI 27#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
28 28
29static void __init m528x_qspi_init(void) 29static void __init m528x_qspi_init(void)
30{ 30{
@@ -32,7 +32,7 @@ static void __init m528x_qspi_init(void)
32 __raw_writeb(0x07, MCFGPIO_PQSPAR); 32 __raw_writeb(0x07, MCFGPIO_PQSPAR);
33} 33}
34 34
35#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 35#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
36 36
37/***************************************************************************/ 37/***************************************************************************/
38 38
@@ -98,7 +98,7 @@ void __init config_BSP(char *commandp, int size)
98 mach_sched_init = hw_timer_init; 98 mach_sched_init = hw_timer_init;
99 m528x_uarts_init(); 99 m528x_uarts_init();
100 m528x_fec_init(); 100 m528x_fec_init();
101#ifdef CONFIG_SPI_COLDFIRE_QSPI 101#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
102 m528x_qspi_init(); 102 m528x_qspi_init();
103#endif 103#endif
104} 104}
diff --git a/arch/m68k/platform/532x/config.c b/arch/m68k/platform/532x/config.c
index 2bec3477b739..37082d02f2bd 100644
--- a/arch/m68k/platform/532x/config.c
+++ b/arch/m68k/platform/532x/config.c
@@ -30,7 +30,7 @@
30 30
31/***************************************************************************/ 31/***************************************************************************/
32 32
33#ifdef CONFIG_SPI_COLDFIRE_QSPI 33#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
34 34
35static void __init m532x_qspi_init(void) 35static void __init m532x_qspi_init(void)
36{ 36{
@@ -38,7 +38,7 @@ static void __init m532x_qspi_init(void)
38 writew(0x01f0, MCF_GPIO_PAR_QSPI); 38 writew(0x01f0, MCF_GPIO_PAR_QSPI);
39} 39}
40 40
41#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 41#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
42 42
43/***************************************************************************/ 43/***************************************************************************/
44 44
@@ -77,7 +77,7 @@ void __init config_BSP(char *commandp, int size)
77 mach_sched_init = hw_timer_init; 77 mach_sched_init = hw_timer_init;
78 m532x_uarts_init(); 78 m532x_uarts_init();
79 m532x_fec_init(); 79 m532x_fec_init();
80#ifdef CONFIG_SPI_COLDFIRE_QSPI 80#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
81 m532x_qspi_init(); 81 m532x_qspi_init();
82#endif 82#endif
83 83
diff --git a/arch/m68k/platform/coldfire/device.c b/arch/m68k/platform/coldfire/device.c
index 7af97362b95c..3aa77ddea89d 100644
--- a/arch/m68k/platform/coldfire/device.c
+++ b/arch/m68k/platform/coldfire/device.c
@@ -121,7 +121,7 @@ static struct platform_device mcf_fec1 = {
121#endif /* MCFFEC_BASE1 */ 121#endif /* MCFFEC_BASE1 */
122#endif /* CONFIG_FEC */ 122#endif /* CONFIG_FEC */
123 123
124#ifdef CONFIG_SPI_COLDFIRE_QSPI 124#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
125/* 125/*
126 * The ColdFire QSPI module is an SPI protocol hardware block used 126 * The ColdFire QSPI module is an SPI protocol hardware block used
127 * on a number of different ColdFire CPUs. 127 * on a number of different ColdFire CPUs.
@@ -274,7 +274,7 @@ static struct platform_device mcf_qspi = {
274 .resource = mcf_qspi_resources, 274 .resource = mcf_qspi_resources,
275 .dev.platform_data = &mcf_qspi_data, 275 .dev.platform_data = &mcf_qspi_data,
276}; 276};
277#endif /* CONFIG_SPI_COLDFIRE_QSPI */ 277#endif /* IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI) */
278 278
279static struct platform_device *mcf_devices[] __initdata = { 279static struct platform_device *mcf_devices[] __initdata = {
280 &mcf_uart, 280 &mcf_uart,
@@ -284,7 +284,7 @@ static struct platform_device *mcf_devices[] __initdata = {
284 &mcf_fec1, 284 &mcf_fec1,
285#endif 285#endif
286#endif 286#endif
287#ifdef CONFIG_SPI_COLDFIRE_QSPI 287#if IS_ENABLED(CONFIG_SPI_COLDFIRE_QSPI)
288 &mcf_qspi, 288 &mcf_qspi,
289#endif 289#endif
290}; 290};
diff --git a/arch/parisc/include/asm/hardware.h b/arch/parisc/include/asm/hardware.h
index 4e9626836bab..d1d864b81bae 100644
--- a/arch/parisc/include/asm/hardware.h
+++ b/arch/parisc/include/asm/hardware.h
@@ -2,7 +2,6 @@
2#define _PARISC_HARDWARE_H 2#define _PARISC_HARDWARE_H
3 3
4#include <linux/mod_devicetable.h> 4#include <linux/mod_devicetable.h>
5#include <asm/pdc.h>
6 5
7#define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID 6#define HWTYPE_ANY_ID PA_HWTYPE_ANY_ID
8#define HVERSION_ANY_ID PA_HVERSION_ANY_ID 7#define HVERSION_ANY_ID PA_HVERSION_ANY_ID
@@ -95,12 +94,14 @@ struct bc_module {
95#define HPHW_MC 15 94#define HPHW_MC 15
96#define HPHW_FAULTY 31 95#define HPHW_FAULTY 31
97 96
97struct parisc_device_id;
98 98
99/* hardware.c: */ 99/* hardware.c: */
100extern const char *parisc_hardware_description(struct parisc_device_id *id); 100extern const char *parisc_hardware_description(struct parisc_device_id *id);
101extern enum cpu_type parisc_get_cpu_type(unsigned long hversion); 101extern enum cpu_type parisc_get_cpu_type(unsigned long hversion);
102 102
103struct pci_dev; 103struct pci_dev;
104struct hardware_path;
104 105
105/* drivers.c: */ 106/* drivers.c: */
106extern struct parisc_device *alloc_pa_dev(unsigned long hpa, 107extern struct parisc_device *alloc_pa_dev(unsigned long hpa,
diff --git a/arch/parisc/include/asm/page.h b/arch/parisc/include/asm/page.h
index a84cc1f925f6..4e0e7dbf0f3f 100644
--- a/arch/parisc/include/asm/page.h
+++ b/arch/parisc/include/asm/page.h
@@ -160,5 +160,11 @@ extern int npmem_ranges;
160 160
161#include <asm-generic/memory_model.h> 161#include <asm-generic/memory_model.h>
162#include <asm-generic/getorder.h> 162#include <asm-generic/getorder.h>
163#include <asm/pdc.h>
164
165#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)
166
167/* DEFINITION OF THE ZERO-PAGE (PAG0) */
168/* based on work by Jason Eckhardt (jason@equator.com) */
163 169
164#endif /* _PARISC_PAGE_H */ 170#endif /* _PARISC_PAGE_H */
diff --git a/arch/parisc/include/asm/pdc.h b/arch/parisc/include/asm/pdc.h
index 4ca510b3c6f8..7f0f2d23059d 100644
--- a/arch/parisc/include/asm/pdc.h
+++ b/arch/parisc/include/asm/pdc.h
@@ -343,8 +343,6 @@
343 343
344#ifdef __KERNEL__ 344#ifdef __KERNEL__
345 345
346#include <asm/page.h> /* for __PAGE_OFFSET */
347
348extern int pdc_type; 346extern int pdc_type;
349 347
350/* Values for pdc_type */ 348/* Values for pdc_type */
@@ -677,11 +675,6 @@ static inline char * os_id_to_string(u16 os_id) {
677 675
678#endif /* __KERNEL__ */ 676#endif /* __KERNEL__ */
679 677
680#define PAGE0 ((struct zeropage *)__PAGE_OFFSET)
681
682/* DEFINITION OF THE ZERO-PAGE (PAG0) */
683/* based on work by Jason Eckhardt (jason@equator.com) */
684
685/* flags of the device_path */ 678/* flags of the device_path */
686#define PF_AUTOBOOT 0x80 679#define PF_AUTOBOOT 0x80
687#define PF_AUTOSEARCH 0x40 680#define PF_AUTOSEARCH 0x40
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index 22dadeb58695..ee99f2339356 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -44,6 +44,8 @@ struct vm_area_struct;
44 44
45#endif /* !__ASSEMBLY__ */ 45#endif /* !__ASSEMBLY__ */
46 46
47#include <asm/page.h>
48
47#define pte_ERROR(e) \ 49#define pte_ERROR(e) \
48 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e)) 50 printk("%s:%d: bad pte %08lx.\n", __FILE__, __LINE__, pte_val(e))
49#define pmd_ERROR(e) \ 51#define pmd_ERROR(e) \
diff --git a/arch/parisc/include/asm/spinlock.h b/arch/parisc/include/asm/spinlock.h
index 804aa28ab1d6..3516e0b27044 100644
--- a/arch/parisc/include/asm/spinlock.h
+++ b/arch/parisc/include/asm/spinlock.h
@@ -1,6 +1,8 @@
1#ifndef __ASM_SPINLOCK_H 1#ifndef __ASM_SPINLOCK_H
2#define __ASM_SPINLOCK_H 2#define __ASM_SPINLOCK_H
3 3
4#include <asm/barrier.h>
5#include <asm/ldcw.h>
4#include <asm/processor.h> 6#include <asm/processor.h>
5#include <asm/spinlock_types.h> 7#include <asm/spinlock_types.h>
6 8
diff --git a/arch/parisc/kernel/pdc_cons.c b/arch/parisc/kernel/pdc_cons.c
index 0b3393381a81..47341aa208f2 100644
--- a/arch/parisc/kernel/pdc_cons.c
+++ b/arch/parisc/kernel/pdc_cons.c
@@ -50,6 +50,7 @@
50#include <linux/init.h> 50#include <linux/init.h>
51#include <linux/major.h> 51#include <linux/major.h>
52#include <linux/tty.h> 52#include <linux/tty.h>
53#include <asm/page.h> /* for PAGE0 */
53#include <asm/pdc.h> /* for iodc_call() proto and friends */ 54#include <asm/pdc.h> /* for iodc_call() proto and friends */
54 55
55static DEFINE_SPINLOCK(pdc_console_lock); 56static DEFINE_SPINLOCK(pdc_console_lock);
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c
index 7c0774397b89..70e105d62423 100644
--- a/arch/parisc/kernel/time.c
+++ b/arch/parisc/kernel/time.c
@@ -29,6 +29,7 @@
29#include <asm/uaccess.h> 29#include <asm/uaccess.h>
30#include <asm/io.h> 30#include <asm/io.h>
31#include <asm/irq.h> 31#include <asm/irq.h>
32#include <asm/page.h>
32#include <asm/param.h> 33#include <asm/param.h>
33#include <asm/pdc.h> 34#include <asm/pdc.h>
34#include <asm/led.h> 35#include <asm/led.h>
diff --git a/arch/powerpc/include/asm/exception-64s.h b/arch/powerpc/include/asm/exception-64s.h
index 548da3aa0a30..d58fc4e4149c 100644
--- a/arch/powerpc/include/asm/exception-64s.h
+++ b/arch/powerpc/include/asm/exception-64s.h
@@ -288,13 +288,6 @@ label##_hv: \
288/* Exception addition: Hard disable interrupts */ 288/* Exception addition: Hard disable interrupts */
289#define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11) 289#define DISABLE_INTS SOFT_DISABLE_INTS(r10,r11)
290 290
291/* Exception addition: Keep interrupt state */
292#define ENABLE_INTS \
293 ld r11,PACAKMSR(r13); \
294 ld r12,_MSR(r1); \
295 rlwimi r11,r12,0,MSR_EE; \
296 mtmsrd r11,1
297
298#define ADD_NVGPRS \ 291#define ADD_NVGPRS \
299 bl .save_nvgprs 292 bl .save_nvgprs
300 293
diff --git a/arch/powerpc/kernel/entry_64.S b/arch/powerpc/kernel/entry_64.S
index f8a7a1a1a9f4..ef2074c3e906 100644
--- a/arch/powerpc/kernel/entry_64.S
+++ b/arch/powerpc/kernel/entry_64.S
@@ -588,23 +588,19 @@ _GLOBAL(ret_from_except_lite)
588fast_exc_return_irq: 588fast_exc_return_irq:
589restore: 589restore:
590 /* 590 /*
591 * This is the main kernel exit path, we first check if we 591 * This is the main kernel exit path. First we check if we
592 * have to change our interrupt state. 592 * are about to re-enable interrupts
593 */ 593 */
594 ld r5,SOFTE(r1) 594 ld r5,SOFTE(r1)
595 lbz r6,PACASOFTIRQEN(r13) 595 lbz r6,PACASOFTIRQEN(r13)
596 cmpwi cr1,r5,0 596 cmpwi cr0,r5,0
597 cmpw cr0,r5,r6 597 beq restore_irq_off
598 beq cr0,4f
599 598
600 /* We do, handle disable first, which is easy */ 599 /* We are enabling, were we already enabled ? Yes, just return */
601 bne cr1,3f; 600 cmpwi cr0,r6,1
602 li r0,0 601 beq cr0,do_restore
603 stb r0,PACASOFTIRQEN(r13);
604 TRACE_DISABLE_INTS
605 b 4f
606 602
6073: /* 603 /*
608 * We are about to soft-enable interrupts (we are hard disabled 604 * We are about to soft-enable interrupts (we are hard disabled
609 * at this point). We check if there's anything that needs to 605 * at this point). We check if there's anything that needs to
610 * be replayed first. 606 * be replayed first.
@@ -626,7 +622,7 @@ restore_no_replay:
626 /* 622 /*
627 * Final return path. BookE is handled in a different file 623 * Final return path. BookE is handled in a different file
628 */ 624 */
6294: 625do_restore:
630#ifdef CONFIG_PPC_BOOK3E 626#ifdef CONFIG_PPC_BOOK3E
631 b .exception_return_book3e 627 b .exception_return_book3e
632#else 628#else
@@ -700,6 +696,25 @@ fast_exception_return:
700#endif /* CONFIG_PPC_BOOK3E */ 696#endif /* CONFIG_PPC_BOOK3E */
701 697
702 /* 698 /*
699 * We are returning to a context with interrupts soft disabled.
700 *
701 * However, we may also about to hard enable, so we need to
702 * make sure that in this case, we also clear PACA_IRQ_HARD_DIS
703 * or that bit can get out of sync and bad things will happen
704 */
705restore_irq_off:
706 ld r3,_MSR(r1)
707 lbz r7,PACAIRQHAPPENED(r13)
708 andi. r0,r3,MSR_EE
709 beq 1f
710 rlwinm r7,r7,0,~PACA_IRQ_HARD_DIS
711 stb r7,PACAIRQHAPPENED(r13)
7121: li r0,0
713 stb r0,PACASOFTIRQEN(r13);
714 TRACE_DISABLE_INTS
715 b do_restore
716
717 /*
703 * Something did happen, check if a re-emit is needed 718 * Something did happen, check if a re-emit is needed
704 * (this also clears paca->irq_happened) 719 * (this also clears paca->irq_happened)
705 */ 720 */
@@ -748,6 +763,9 @@ restore_check_irq_replay:
748#endif /* CONFIG_PPC_BOOK3E */ 763#endif /* CONFIG_PPC_BOOK3E */
7491: b .ret_from_except /* What else to do here ? */ 7641: b .ret_from_except /* What else to do here ? */
750 765
766
767
7683:
751do_work: 769do_work:
752#ifdef CONFIG_PREEMPT 770#ifdef CONFIG_PREEMPT
753 andi. r0,r3,MSR_PR /* Returning to user mode? */ 771 andi. r0,r3,MSR_PR /* Returning to user mode? */
@@ -767,16 +785,6 @@ do_work:
767 SOFT_DISABLE_INTS(r3,r4) 785 SOFT_DISABLE_INTS(r3,r4)
7681: bl .preempt_schedule_irq 7861: bl .preempt_schedule_irq
769 787
770 /* Hard-disable interrupts again (and update PACA) */
771#ifdef CONFIG_PPC_BOOK3E
772 wrteei 0
773#else
774 ld r10,PACAKMSR(r13) /* Get kernel MSR without EE */
775 mtmsrd r10,1
776#endif /* CONFIG_PPC_BOOK3E */
777 li r0,PACA_IRQ_HARD_DIS
778 stb r0,PACAIRQHAPPENED(r13)
779
780 /* Re-test flags and eventually loop */ 788 /* Re-test flags and eventually loop */
781 clrrdi r9,r1,THREAD_SHIFT 789 clrrdi r9,r1,THREAD_SHIFT
782 ld r4,TI_FLAGS(r9) 790 ld r4,TI_FLAGS(r9)
@@ -787,14 +795,6 @@ do_work:
787user_work: 795user_work:
788#endif /* CONFIG_PREEMPT */ 796#endif /* CONFIG_PREEMPT */
789 797
790 /* Enable interrupts */
791#ifdef CONFIG_PPC_BOOK3E
792 wrteei 1
793#else
794 ori r10,r10,MSR_EE
795 mtmsrd r10,1
796#endif /* CONFIG_PPC_BOOK3E */
797
798 andi. r0,r4,_TIF_NEED_RESCHED 798 andi. r0,r4,_TIF_NEED_RESCHED
799 beq 1f 799 beq 1f
800 bl .restore_interrupts 800 bl .restore_interrupts
diff --git a/arch/powerpc/kernel/exceptions-64s.S b/arch/powerpc/kernel/exceptions-64s.S
index cb705fdbb458..8f880bc77c56 100644
--- a/arch/powerpc/kernel/exceptions-64s.S
+++ b/arch/powerpc/kernel/exceptions-64s.S
@@ -768,8 +768,8 @@ alignment_common:
768 std r3,_DAR(r1) 768 std r3,_DAR(r1)
769 std r4,_DSISR(r1) 769 std r4,_DSISR(r1)
770 bl .save_nvgprs 770 bl .save_nvgprs
771 DISABLE_INTS
771 addi r3,r1,STACK_FRAME_OVERHEAD 772 addi r3,r1,STACK_FRAME_OVERHEAD
772 ENABLE_INTS
773 bl .alignment_exception 773 bl .alignment_exception
774 b .ret_from_except 774 b .ret_from_except
775 775
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 43eb74fcedde..641da9e868ce 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -229,6 +229,19 @@ notrace void arch_local_irq_restore(unsigned long en)
229 */ 229 */
230 if (unlikely(irq_happened != PACA_IRQ_HARD_DIS)) 230 if (unlikely(irq_happened != PACA_IRQ_HARD_DIS))
231 __hard_irq_disable(); 231 __hard_irq_disable();
232#ifdef CONFIG_TRACE_IRQFLAG
233 else {
234 /*
235 * We should already be hard disabled here. We had bugs
236 * where that wasn't the case so let's dbl check it and
237 * warn if we are wrong. Only do that when IRQ tracing
238 * is enabled as mfmsr() can be costly.
239 */
240 if (WARN_ON(mfmsr() & MSR_EE))
241 __hard_irq_disable();
242 }
243#endif /* CONFIG_TRACE_IRQFLAG */
244
232 set_soft_enabled(0); 245 set_soft_enabled(0);
233 246
234 /* 247 /*
@@ -260,11 +273,17 @@ EXPORT_SYMBOL(arch_local_irq_restore);
260 * if they are currently disabled. This is typically called before 273 * if they are currently disabled. This is typically called before
261 * schedule() or do_signal() when returning to userspace. We do it 274 * schedule() or do_signal() when returning to userspace. We do it
262 * in C to avoid the burden of dealing with lockdep etc... 275 * in C to avoid the burden of dealing with lockdep etc...
276 *
277 * NOTE: This is called with interrupts hard disabled but not marked
278 * as such in paca->irq_happened, so we need to resync this.
263 */ 279 */
264void restore_interrupts(void) 280void restore_interrupts(void)
265{ 281{
266 if (irqs_disabled()) 282 if (irqs_disabled()) {
283 local_paca->irq_happened |= PACA_IRQ_HARD_DIS;
267 local_irq_enable(); 284 local_irq_enable();
285 } else
286 __hard_irq_enable();
268} 287}
269 288
270#endif /* CONFIG_PPC64 */ 289#endif /* CONFIG_PPC64 */
diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c
index 6aa0c663e247..158972341a2d 100644
--- a/arch/powerpc/kernel/traps.c
+++ b/arch/powerpc/kernel/traps.c
@@ -248,7 +248,7 @@ void _exception(int signr, struct pt_regs *regs, int code, unsigned long addr)
248 addr, regs->nip, regs->link, code); 248 addr, regs->nip, regs->link, code);
249 } 249 }
250 250
251 if (!arch_irq_disabled_regs(regs)) 251 if (arch_irqs_disabled() && !arch_irq_disabled_regs(regs))
252 local_irq_enable(); 252 local_irq_enable();
253 253
254 memset(&info, 0, sizeof(info)); 254 memset(&info, 0, sizeof(info));
@@ -1019,7 +1019,9 @@ void __kprobes program_check_exception(struct pt_regs *regs)
1019 return; 1019 return;
1020 } 1020 }
1021 1021
1022 local_irq_enable(); 1022 /* We restore the interrupt state now */
1023 if (!arch_irq_disabled_regs(regs))
1024 local_irq_enable();
1023 1025
1024#ifdef CONFIG_MATH_EMULATION 1026#ifdef CONFIG_MATH_EMULATION
1025 /* (reason & REASON_ILLEGAL) would be the obvious thing here, 1027 /* (reason & REASON_ILLEGAL) would be the obvious thing here,
@@ -1069,6 +1071,10 @@ void alignment_exception(struct pt_regs *regs)
1069{ 1071{
1070 int sig, code, fixed = 0; 1072 int sig, code, fixed = 0;
1071 1073
1074 /* We restore the interrupt state now */
1075 if (!arch_irq_disabled_regs(regs))
1076 local_irq_enable();
1077
1072 /* we don't implement logging of alignment exceptions */ 1078 /* we don't implement logging of alignment exceptions */
1073 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS)) 1079 if (!(current->thread.align_ctl & PR_UNALIGN_SIGBUS))
1074 fixed = fix_alignment(regs); 1080 fixed = fix_alignment(regs);
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c
index ddc485a529f2..c3beaeef3f60 100644
--- a/arch/powerpc/kvm/book3s_64_mmu_hv.c
+++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c
@@ -258,6 +258,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn,
258 !(memslot->userspace_addr & (s - 1))) { 258 !(memslot->userspace_addr & (s - 1))) {
259 start &= ~(s - 1); 259 start &= ~(s - 1);
260 pgsize = s; 260 pgsize = s;
261 get_page(hpage);
262 put_page(page);
261 page = hpage; 263 page = hpage;
262 } 264 }
263 } 265 }
@@ -281,11 +283,8 @@ static long kvmppc_get_guest_page(struct kvm *kvm, unsigned long gfn,
281 err = 0; 283 err = 0;
282 284
283 out: 285 out:
284 if (got) { 286 if (got)
285 if (PageHuge(page))
286 page = compound_head(page);
287 put_page(page); 287 put_page(page);
288 }
289 return err; 288 return err;
290 289
291 up_err: 290 up_err:
@@ -678,8 +677,15 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu,
678 SetPageDirty(page); 677 SetPageDirty(page);
679 678
680 out_put: 679 out_put:
681 if (page) 680 if (page) {
682 put_page(page); 681 /*
682 * We drop pages[0] here, not page because page might
683 * have been set to the head page of a compound, but
684 * we have to drop the reference on the correct tail
685 * page to match the get inside gup()
686 */
687 put_page(pages[0]);
688 }
683 return ret; 689 return ret;
684 690
685 out_unlock: 691 out_unlock:
@@ -979,6 +985,7 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa,
979 pa = *physp; 985 pa = *physp;
980 } 986 }
981 page = pfn_to_page(pa >> PAGE_SHIFT); 987 page = pfn_to_page(pa >> PAGE_SHIFT);
988 get_page(page);
982 } else { 989 } else {
983 hva = gfn_to_hva_memslot(memslot, gfn); 990 hva = gfn_to_hva_memslot(memslot, gfn);
984 npages = get_user_pages_fast(hva, 1, 1, pages); 991 npages = get_user_pages_fast(hva, 1, 1, pages);
@@ -991,8 +998,6 @@ void *kvmppc_pin_guest_page(struct kvm *kvm, unsigned long gpa,
991 page = compound_head(page); 998 page = compound_head(page);
992 psize <<= compound_order(page); 999 psize <<= compound_order(page);
993 } 1000 }
994 if (!kvm->arch.using_mmu_notifiers)
995 get_page(page);
996 offset = gpa & (psize - 1); 1001 offset = gpa & (psize - 1);
997 if (nb_ret) 1002 if (nb_ret)
998 *nb_ret = psize - offset; 1003 *nb_ret = psize - offset;
@@ -1003,7 +1008,6 @@ void kvmppc_unpin_guest_page(struct kvm *kvm, void *va)
1003{ 1008{
1004 struct page *page = virt_to_page(va); 1009 struct page *page = virt_to_page(va);
1005 1010
1006 page = compound_head(page);
1007 put_page(page); 1011 put_page(page);
1008} 1012}
1009 1013
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
index 01294a5099dd..108d1f580177 100644
--- a/arch/powerpc/kvm/book3s_hv.c
+++ b/arch/powerpc/kvm/book3s_hv.c
@@ -1192,8 +1192,6 @@ static void unpin_slot(struct kvm *kvm, int slot_id)
1192 continue; 1192 continue;
1193 pfn = physp[j] >> PAGE_SHIFT; 1193 pfn = physp[j] >> PAGE_SHIFT;
1194 page = pfn_to_page(pfn); 1194 page = pfn_to_page(pfn);
1195 if (PageHuge(page))
1196 page = compound_head(page);
1197 SetPageDirty(page); 1195 SetPageDirty(page);
1198 put_page(page); 1196 put_page(page);
1199 } 1197 }
diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
index 38d48a59879c..9708851a8b9f 100644
--- a/arch/sparc/kernel/central.c
+++ b/arch/sparc/kernel/central.c
@@ -269,4 +269,4 @@ static int __init sunfire_init(void)
269 return 0; 269 return 0;
270} 270}
271 271
272subsys_initcall(sunfire_init); 272fs_initcall(sunfire_init);
diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S
index b57a5942ba64..874162a11ceb 100644
--- a/arch/sparc/mm/ultra.S
+++ b/arch/sparc/mm/ultra.S
@@ -495,11 +495,11 @@ xcall_fetch_glob_regs:
495 stx %o7, [%g1 + GR_SNAP_O7] 495 stx %o7, [%g1 + GR_SNAP_O7]
496 stx %i7, [%g1 + GR_SNAP_I7] 496 stx %i7, [%g1 + GR_SNAP_I7]
497 /* Don't try this at home kids... */ 497 /* Don't try this at home kids... */
498 rdpr %cwp, %g2 498 rdpr %cwp, %g3
499 sub %g2, 1, %g7 499 sub %g3, 1, %g7
500 wrpr %g7, %cwp 500 wrpr %g7, %cwp
501 mov %i7, %g7 501 mov %i7, %g7
502 wrpr %g2, %cwp 502 wrpr %g3, %cwp
503 stx %g7, [%g1 + GR_SNAP_RPC] 503 stx %g7, [%g1 + GR_SNAP_RPC]
504 sethi %hi(trap_block), %g7 504 sethi %hi(trap_block), %g7
505 or %g7, %lo(trap_block), %g7 505 or %g7, %lo(trap_block), %g7
diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
index b8ba6e4a27e4..e554e5ad2fe8 100644
--- a/arch/x86/kernel/kvm.c
+++ b/arch/x86/kernel/kvm.c
@@ -79,7 +79,6 @@ struct kvm_task_sleep_node {
79 u32 token; 79 u32 token;
80 int cpu; 80 int cpu;
81 bool halted; 81 bool halted;
82 struct mm_struct *mm;
83}; 82};
84 83
85static struct kvm_task_sleep_head { 84static struct kvm_task_sleep_head {
@@ -126,9 +125,7 @@ void kvm_async_pf_task_wait(u32 token)
126 125
127 n.token = token; 126 n.token = token;
128 n.cpu = smp_processor_id(); 127 n.cpu = smp_processor_id();
129 n.mm = current->active_mm;
130 n.halted = idle || preempt_count() > 1; 128 n.halted = idle || preempt_count() > 1;
131 atomic_inc(&n.mm->mm_count);
132 init_waitqueue_head(&n.wq); 129 init_waitqueue_head(&n.wq);
133 hlist_add_head(&n.link, &b->list); 130 hlist_add_head(&n.link, &b->list);
134 spin_unlock(&b->lock); 131 spin_unlock(&b->lock);
@@ -161,9 +158,6 @@ EXPORT_SYMBOL_GPL(kvm_async_pf_task_wait);
161static void apf_task_wake_one(struct kvm_task_sleep_node *n) 158static void apf_task_wake_one(struct kvm_task_sleep_node *n)
162{ 159{
163 hlist_del_init(&n->link); 160 hlist_del_init(&n->link);
164 if (!n->mm)
165 return;
166 mmdrop(n->mm);
167 if (n->halted) 161 if (n->halted)
168 smp_send_reschedule(n->cpu); 162 smp_send_reschedule(n->cpu);
169 else if (waitqueue_active(&n->wq)) 163 else if (waitqueue_active(&n->wq))
@@ -207,7 +201,7 @@ again:
207 * async PF was not yet handled. 201 * async PF was not yet handled.
208 * Add dummy entry for the token. 202 * Add dummy entry for the token.
209 */ 203 */
210 n = kmalloc(sizeof(*n), GFP_ATOMIC); 204 n = kzalloc(sizeof(*n), GFP_ATOMIC);
211 if (!n) { 205 if (!n) {
212 /* 206 /*
213 * Allocation failed! Busy wait while other cpu 207 * Allocation failed! Busy wait while other cpu
@@ -219,7 +213,6 @@ again:
219 } 213 }
220 n->token = token; 214 n->token = token;
221 n->cpu = smp_processor_id(); 215 n->cpu = smp_processor_id();
222 n->mm = NULL;
223 init_waitqueue_head(&n->wq); 216 init_waitqueue_head(&n->wq);
224 hlist_add_head(&n->link, &b->list); 217 hlist_add_head(&n->link, &b->list);
225 } else 218 } else
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c
index 733ca39f367e..43d8b48b23e6 100644
--- a/arch/x86/kernel/process_64.c
+++ b/arch/x86/kernel/process_64.c
@@ -423,6 +423,7 @@ void set_personality_ia32(bool x32)
423 current_thread_info()->status |= TS_COMPAT; 423 current_thread_info()->status |= TS_COMPAT;
424 } 424 }
425} 425}
426EXPORT_SYMBOL_GPL(set_personality_ia32);
426 427
427unsigned long get_wchan(struct task_struct *p) 428unsigned long get_wchan(struct task_struct *p)
428{ 429{
diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
index 71f4727da373..5a98aa272184 100644
--- a/arch/x86/kernel/setup_percpu.c
+++ b/arch/x86/kernel/setup_percpu.c
@@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
185#endif 185#endif
186 rc = -EINVAL; 186 rc = -EINVAL;
187 if (pcpu_chosen_fc != PCPU_FC_PAGE) { 187 if (pcpu_chosen_fc != PCPU_FC_PAGE) {
188 const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
189 const size_t dyn_size = PERCPU_MODULE_RESERVE + 188 const size_t dyn_size = PERCPU_MODULE_RESERVE +
190 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE; 189 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
190 size_t atom_size;
191 191
192 /*
193 * On 64bit, use PMD_SIZE for atom_size so that embedded
194 * percpu areas are aligned to PMD. This, in the future,
195 * can also allow using PMD mappings in vmalloc area. Use
196 * PAGE_SIZE on 32bit as vmalloc space is highly contended
197 * and large vmalloc area allocs can easily fail.
198 */
199#ifdef CONFIG_X86_64
200 atom_size = PMD_SIZE;
201#else
202 atom_size = PAGE_SIZE;
203#endif
192 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE, 204 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
193 dyn_size, atom_size, 205 dyn_size, atom_size,
194 pcpu_cpu_distance, 206 pcpu_cpu_distance,
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 91a5e989abcf..185a2b823a2d 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6581,6 +6581,7 @@ void kvm_arch_async_page_present(struct kvm_vcpu *vcpu,
6581 kvm_inject_page_fault(vcpu, &fault); 6581 kvm_inject_page_fault(vcpu, &fault);
6582 } 6582 }
6583 vcpu->arch.apf.halted = false; 6583 vcpu->arch.apf.halted = false;
6584 vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE;
6584} 6585}
6585 6586
6586bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu) 6587bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
index a8f8844b8d32..95dccce8e979 100644
--- a/arch/x86/xen/enlighten.c
+++ b/arch/x86/xen/enlighten.c
@@ -63,6 +63,7 @@
63#include <asm/stackprotector.h> 63#include <asm/stackprotector.h>
64#include <asm/hypervisor.h> 64#include <asm/hypervisor.h>
65#include <asm/mwait.h> 65#include <asm/mwait.h>
66#include <asm/pci_x86.h>
66 67
67#ifdef CONFIG_ACPI 68#ifdef CONFIG_ACPI
68#include <linux/acpi.h> 69#include <linux/acpi.h>
@@ -809,9 +810,40 @@ static void xen_io_delay(void)
809} 810}
810 811
811#ifdef CONFIG_X86_LOCAL_APIC 812#ifdef CONFIG_X86_LOCAL_APIC
813static unsigned long xen_set_apic_id(unsigned int x)
814{
815 WARN_ON(1);
816 return x;
817}
818static unsigned int xen_get_apic_id(unsigned long x)
819{
820 return ((x)>>24) & 0xFFu;
821}
812static u32 xen_apic_read(u32 reg) 822static u32 xen_apic_read(u32 reg)
813{ 823{
814 return 0; 824 struct xen_platform_op op = {
825 .cmd = XENPF_get_cpuinfo,
826 .interface_version = XENPF_INTERFACE_VERSION,
827 .u.pcpu_info.xen_cpuid = 0,
828 };
829 int ret = 0;
830
831 /* Shouldn't need this as APIC is turned off for PV, and we only
832 * get called on the bootup processor. But just in case. */
833 if (!xen_initial_domain() || smp_processor_id())
834 return 0;
835
836 if (reg == APIC_LVR)
837 return 0x10;
838
839 if (reg != APIC_ID)
840 return 0;
841
842 ret = HYPERVISOR_dom0_op(&op);
843 if (ret)
844 return 0;
845
846 return op.u.pcpu_info.apic_id << 24;
815} 847}
816 848
817static void xen_apic_write(u32 reg, u32 val) 849static void xen_apic_write(u32 reg, u32 val)
@@ -849,6 +881,8 @@ static void set_xen_basic_apic_ops(void)
849 apic->icr_write = xen_apic_icr_write; 881 apic->icr_write = xen_apic_icr_write;
850 apic->wait_icr_idle = xen_apic_wait_icr_idle; 882 apic->wait_icr_idle = xen_apic_wait_icr_idle;
851 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle; 883 apic->safe_wait_icr_idle = xen_safe_apic_wait_icr_idle;
884 apic->set_apic_id = xen_set_apic_id;
885 apic->get_apic_id = xen_get_apic_id;
852} 886}
853 887
854#endif 888#endif
@@ -1365,8 +1399,10 @@ asmlinkage void __init xen_start_kernel(void)
1365 /* Make sure ACS will be enabled */ 1399 /* Make sure ACS will be enabled */
1366 pci_request_acs(); 1400 pci_request_acs();
1367 } 1401 }
1368 1402#ifdef CONFIG_PCI
1369 1403 /* PCI BIOS service won't work from a PV guest. */
1404 pci_probe &= ~PCI_PROBE_BIOS;
1405#endif
1370 xen_raw_console_write("about to get started...\n"); 1406 xen_raw_console_write("about to get started...\n");
1371 1407
1372 xen_setup_runstate_info(0); 1408 xen_setup_runstate_info(0);
diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
index b8e279479a6b..69f5857660ac 100644
--- a/arch/x86/xen/mmu.c
+++ b/arch/x86/xen/mmu.c
@@ -353,8 +353,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
353{ 353{
354 if (val & _PAGE_PRESENT) { 354 if (val & _PAGE_PRESENT) {
355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT; 355 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
356 unsigned long pfn = mfn_to_pfn(mfn);
357
356 pteval_t flags = val & PTE_FLAGS_MASK; 358 pteval_t flags = val & PTE_FLAGS_MASK;
357 val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags; 359 if (unlikely(pfn == ~0))
360 val = flags & ~_PAGE_PRESENT;
361 else
362 val = ((pteval_t)pfn << PAGE_SHIFT) | flags;
358 } 363 }
359 364
360 return val; 365 return val;
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 7a3f535e481c..bb80853ff27a 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -775,9 +775,11 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
775 map->format.parse_val(val + i); 775 map->format.parse_val(val + i);
776 } else { 776 } else {
777 for (i = 0; i < val_count; i++) { 777 for (i = 0; i < val_count; i++) {
778 ret = regmap_read(map, reg + i, val + (i * val_bytes)); 778 unsigned int ival;
779 ret = regmap_read(map, reg + i, &ival);
779 if (ret != 0) 780 if (ret != 0)
780 return ret; 781 return ret;
782 memcpy(val + (i * val_bytes), &ival, val_bytes);
781 } 783 }
782 } 784 }
783 785
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index abfaacaaf346..946166e13953 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2297,7 +2297,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms
2297 return; 2297 return;
2298 } 2298 }
2299 2299
2300 if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { 2300 if (!capable(CAP_SYS_ADMIN)) {
2301 retcode = ERR_PERM; 2301 retcode = ERR_PERM;
2302 goto fail; 2302 goto fail;
2303 } 2303 }
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 1adc2ec1e383..4461540653a8 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -965,18 +965,15 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
965 } 965 }
966 966
967 _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); 967 _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv);
968 _gpio_rmw(base, bank->regs->irqstatus, l, 968 _gpio_rmw(base, bank->regs->irqstatus, l, !bank->regs->irqenable_inv);
969 bank->regs->irqenable_inv == false);
970 _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->debounce_en != 0);
971 _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->ctrl != 0);
972 if (bank->regs->debounce_en) 969 if (bank->regs->debounce_en)
973 _gpio_rmw(base, bank->regs->debounce_en, 0, 1); 970 __raw_writel(0, base + bank->regs->debounce_en);
974 971
975 /* Save OE default value (0xffffffff) in the context */ 972 /* Save OE default value (0xffffffff) in the context */
976 bank->context.oe = __raw_readl(bank->base + bank->regs->direction); 973 bank->context.oe = __raw_readl(bank->base + bank->regs->direction);
977 /* Initialize interface clk ungated, module enabled */ 974 /* Initialize interface clk ungated, module enabled */
978 if (bank->regs->ctrl) 975 if (bank->regs->ctrl)
979 _gpio_rmw(base, bank->regs->ctrl, 0, 1); 976 __raw_writel(0, base + bank->regs->ctrl);
980} 977}
981 978
982static __devinit void 979static __devinit void
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c
index e8729cc2ba2b..2cd958e0b822 100644
--- a/drivers/gpio/gpio-pch.c
+++ b/drivers/gpio/gpio-pch.c
@@ -230,16 +230,12 @@ static void pch_gpio_setup(struct pch_gpio *chip)
230 230
231static int pch_irq_type(struct irq_data *d, unsigned int type) 231static int pch_irq_type(struct irq_data *d, unsigned int type)
232{ 232{
233 u32 im;
234 u32 __iomem *im_reg;
235 u32 ien;
236 u32 im_pos;
237 int ch;
238 unsigned long flags;
239 u32 val;
240 int irq = d->irq;
241 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 233 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
242 struct pch_gpio *chip = gc->private; 234 struct pch_gpio *chip = gc->private;
235 u32 im, im_pos, val;
236 u32 __iomem *im_reg;
237 unsigned long flags;
238 int ch, irq = d->irq;
243 239
244 ch = irq - chip->irq_base; 240 ch = irq - chip->irq_base;
245 if (irq <= chip->irq_base + 7) { 241 if (irq <= chip->irq_base + 7) {
@@ -270,30 +266,22 @@ static int pch_irq_type(struct irq_data *d, unsigned int type)
270 case IRQ_TYPE_LEVEL_LOW: 266 case IRQ_TYPE_LEVEL_LOW:
271 val = PCH_LEVEL_L; 267 val = PCH_LEVEL_L;
272 break; 268 break;
273 case IRQ_TYPE_PROBE:
274 goto end;
275 default: 269 default:
276 dev_warn(chip->dev, "%s: unknown type(%dd)", 270 goto unlock;
277 __func__, type);
278 goto end;
279 } 271 }
280 272
281 /* Set interrupt mode */ 273 /* Set interrupt mode */
282 im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); 274 im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4));
283 iowrite32(im | (val << (im_pos * 4)), im_reg); 275 iowrite32(im | (val << (im_pos * 4)), im_reg);
284 276
285 /* iclr */ 277 /* And the handler */
286 iowrite32(BIT(ch), &chip->reg->iclr); 278 if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH))
279 __irq_set_handler_locked(d->irq, handle_level_irq);
280 else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING))
281 __irq_set_handler_locked(d->irq, handle_edge_irq);
287 282
288 /* IMASKCLR */ 283unlock:
289 iowrite32(BIT(ch), &chip->reg->imaskclr);
290
291 /* Enable interrupt */
292 ien = ioread32(&chip->reg->ien);
293 iowrite32(ien | BIT(ch), &chip->reg->ien);
294end:
295 spin_unlock_irqrestore(&chip->spinlock, flags); 284 spin_unlock_irqrestore(&chip->spinlock, flags);
296
297 return 0; 285 return 0;
298} 286}
299 287
@@ -313,18 +301,24 @@ static void pch_irq_mask(struct irq_data *d)
313 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); 301 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask);
314} 302}
315 303
304static void pch_irq_ack(struct irq_data *d)
305{
306 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d);
307 struct pch_gpio *chip = gc->private;
308
309 iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->iclr);
310}
311
316static irqreturn_t pch_gpio_handler(int irq, void *dev_id) 312static irqreturn_t pch_gpio_handler(int irq, void *dev_id)
317{ 313{
318 struct pch_gpio *chip = dev_id; 314 struct pch_gpio *chip = dev_id;
319 u32 reg_val = ioread32(&chip->reg->istatus); 315 u32 reg_val = ioread32(&chip->reg->istatus);
320 int i; 316 int i, ret = IRQ_NONE;
321 int ret = IRQ_NONE;
322 317
323 for (i = 0; i < gpio_pins[chip->ioh]; i++) { 318 for (i = 0; i < gpio_pins[chip->ioh]; i++) {
324 if (reg_val & BIT(i)) { 319 if (reg_val & BIT(i)) {
325 dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", 320 dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n",
326 __func__, i, irq, reg_val); 321 __func__, i, irq, reg_val);
327 iowrite32(BIT(i), &chip->reg->iclr);
328 generic_handle_irq(chip->irq_base + i); 322 generic_handle_irq(chip->irq_base + i);
329 ret = IRQ_HANDLED; 323 ret = IRQ_HANDLED;
330 } 324 }
@@ -343,6 +337,7 @@ static __devinit void pch_gpio_alloc_generic_chip(struct pch_gpio *chip,
343 gc->private = chip; 337 gc->private = chip;
344 ct = gc->chip_types; 338 ct = gc->chip_types;
345 339
340 ct->chip.irq_ack = pch_irq_ack;
346 ct->chip.irq_mask = pch_irq_mask; 341 ct->chip.irq_mask = pch_irq_mask;
347 ct->chip.irq_unmask = pch_irq_unmask; 342 ct->chip.irq_unmask = pch_irq_unmask;
348 ct->chip.irq_set_type = pch_irq_type; 343 ct->chip.irq_set_type = pch_irq_type;
@@ -357,6 +352,7 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev,
357 s32 ret; 352 s32 ret;
358 struct pch_gpio *chip; 353 struct pch_gpio *chip;
359 int irq_base; 354 int irq_base;
355 u32 msk;
360 356
361 chip = kzalloc(sizeof(*chip), GFP_KERNEL); 357 chip = kzalloc(sizeof(*chip), GFP_KERNEL);
362 if (chip == NULL) 358 if (chip == NULL)
@@ -408,8 +404,13 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev,
408 } 404 }
409 chip->irq_base = irq_base; 405 chip->irq_base = irq_base;
410 406
407 /* Mask all interrupts, but enable them */
408 msk = (1 << gpio_pins[chip->ioh]) - 1;
409 iowrite32(msk, &chip->reg->imask);
410 iowrite32(msk, &chip->reg->ien);
411
411 ret = request_irq(pdev->irq, pch_gpio_handler, 412 ret = request_irq(pdev->irq, pch_gpio_handler,
412 IRQF_SHARED, KBUILD_MODNAME, chip); 413 IRQF_SHARED, KBUILD_MODNAME, chip);
413 if (ret != 0) { 414 if (ret != 0) {
414 dev_err(&pdev->dev, 415 dev_err(&pdev->dev,
415 "%s request_irq failed\n", __func__); 416 "%s request_irq failed\n", __func__);
@@ -418,8 +419,6 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev,
418 419
419 pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); 420 pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]);
420 421
421 /* Initialize interrupt ien register */
422 iowrite32(0, &chip->reg->ien);
423end: 422end:
424 return 0; 423 return 0;
425 424
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c
index 19d6fc0229c3..e991d9171961 100644
--- a/drivers/gpio/gpio-samsung.c
+++ b/drivers/gpio/gpio-samsung.c
@@ -452,12 +452,14 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = {
452}; 452};
453#endif 453#endif
454 454
455#if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5)
455static struct samsung_gpio_cfg exynos_gpio_cfg = { 456static struct samsung_gpio_cfg exynos_gpio_cfg = {
456 .set_pull = exynos_gpio_setpull, 457 .set_pull = exynos_gpio_setpull,
457 .get_pull = exynos_gpio_getpull, 458 .get_pull = exynos_gpio_getpull,
458 .set_config = samsung_gpio_setcfg_4bit, 459 .set_config = samsung_gpio_setcfg_4bit,
459 .get_config = samsung_gpio_getcfg_4bit, 460 .get_config = samsung_gpio_getcfg_4bit,
460}; 461};
462#endif
461 463
462#if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) 464#if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450)
463static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { 465static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = {
@@ -2123,8 +2125,8 @@ static struct samsung_gpio_chip s5pv210_gpios_4bit[] = {
2123 * uses the above macro and depends on the banks being listed in order here. 2125 * uses the above macro and depends on the banks being listed in order here.
2124 */ 2126 */
2125 2127
2126static struct samsung_gpio_chip exynos4_gpios_1[] = {
2127#ifdef CONFIG_ARCH_EXYNOS4 2128#ifdef CONFIG_ARCH_EXYNOS4
2129static struct samsung_gpio_chip exynos4_gpios_1[] = {
2128 { 2130 {
2129 .chip = { 2131 .chip = {
2130 .base = EXYNOS4_GPA0(0), 2132 .base = EXYNOS4_GPA0(0),
@@ -2222,11 +2224,11 @@ static struct samsung_gpio_chip exynos4_gpios_1[] = {
2222 .label = "GPF3", 2224 .label = "GPF3",
2223 }, 2225 },
2224 }, 2226 },
2225#endif
2226}; 2227};
2228#endif
2227 2229
2228static struct samsung_gpio_chip exynos4_gpios_2[] = {
2229#ifdef CONFIG_ARCH_EXYNOS4 2230#ifdef CONFIG_ARCH_EXYNOS4
2231static struct samsung_gpio_chip exynos4_gpios_2[] = {
2230 { 2232 {
2231 .chip = { 2233 .chip = {
2232 .base = EXYNOS4_GPJ0(0), 2234 .base = EXYNOS4_GPJ0(0),
@@ -2367,11 +2369,11 @@ static struct samsung_gpio_chip exynos4_gpios_2[] = {
2367 .to_irq = samsung_gpiolib_to_irq, 2369 .to_irq = samsung_gpiolib_to_irq,
2368 }, 2370 },
2369 }, 2371 },
2370#endif
2371}; 2372};
2373#endif
2372 2374
2373static struct samsung_gpio_chip exynos4_gpios_3[] = {
2374#ifdef CONFIG_ARCH_EXYNOS4 2375#ifdef CONFIG_ARCH_EXYNOS4
2376static struct samsung_gpio_chip exynos4_gpios_3[] = {
2375 { 2377 {
2376 .chip = { 2378 .chip = {
2377 .base = EXYNOS4_GPZ(0), 2379 .base = EXYNOS4_GPZ(0),
@@ -2379,8 +2381,8 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = {
2379 .label = "GPZ", 2381 .label = "GPZ",
2380 }, 2382 },
2381 }, 2383 },
2382#endif
2383}; 2384};
2385#endif
2384 2386
2385#ifdef CONFIG_ARCH_EXYNOS5 2387#ifdef CONFIG_ARCH_EXYNOS5
2386static struct samsung_gpio_chip exynos5_gpios_1[] = { 2388static struct samsung_gpio_chip exynos5_gpios_1[] = {
@@ -2719,7 +2721,9 @@ static __init int samsung_gpiolib_init(void)
2719{ 2721{
2720 struct samsung_gpio_chip *chip; 2722 struct samsung_gpio_chip *chip;
2721 int i, nr_chips; 2723 int i, nr_chips;
2724#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
2722 void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; 2725 void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4;
2726#endif
2723 int group = 0; 2727 int group = 0;
2724 2728
2725 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); 2729 samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs));
@@ -2971,6 +2975,7 @@ static __init int samsung_gpiolib_init(void)
2971 2975
2972 return 0; 2976 return 0;
2973 2977
2978#if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250)
2974err_ioremap4: 2979err_ioremap4:
2975 iounmap(gpio_base3); 2980 iounmap(gpio_base3);
2976err_ioremap3: 2981err_ioremap3:
@@ -2979,6 +2984,7 @@ err_ioremap2:
2979 iounmap(gpio_base1); 2984 iounmap(gpio_base1);
2980err_ioremap1: 2985err_ioremap1:
2981 return -ENOMEM; 2986 return -ENOMEM;
2987#endif
2982} 2988}
2983core_initcall(samsung_gpiolib_init); 2989core_initcall(samsung_gpiolib_init);
2984 2990
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c
index 80fce51e2f43..62892a826ede 100644
--- a/drivers/gpu/drm/i915/intel_ringbuffer.c
+++ b/drivers/gpu/drm/i915/intel_ringbuffer.c
@@ -398,10 +398,8 @@ static int init_render_ring(struct intel_ring_buffer *ring)
398 return ret; 398 return ret;
399 } 399 }
400 400
401 if (INTEL_INFO(dev)->gen >= 6) {
402 I915_WRITE(INSTPM,
403 INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
404 401
402 if (IS_GEN6(dev)) {
405 /* From the Sandybridge PRM, volume 1 part 3, page 24: 403 /* From the Sandybridge PRM, volume 1 part 3, page 24:
406 * "If this bit is set, STCunit will have LRA as replacement 404 * "If this bit is set, STCunit will have LRA as replacement
407 * policy. [...] This bit must be reset. LRA replacement 405 * policy. [...] This bit must be reset. LRA replacement
@@ -411,6 +409,11 @@ static int init_render_ring(struct intel_ring_buffer *ring)
411 CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); 409 CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT);
412 } 410 }
413 411
412 if (INTEL_INFO(dev)->gen >= 6) {
413 I915_WRITE(INSTPM,
414 INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING);
415 }
416
414 return ret; 417 return ret;
415} 418}
416 419
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
index 232d77d07d8b..ae5e748f39bb 100644
--- a/drivers/gpu/drm/i915/intel_sdvo.c
+++ b/drivers/gpu/drm/i915/intel_sdvo.c
@@ -1220,8 +1220,14 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in
1220 1220
1221static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) 1221static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo)
1222{ 1222{
1223 struct drm_device *dev = intel_sdvo->base.base.dev;
1223 u8 response[2]; 1224 u8 response[2];
1224 1225
1226 /* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise
1227 * on the line. */
1228 if (IS_I945G(dev) || IS_I945GM(dev))
1229 return false;
1230
1225 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, 1231 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT,
1226 &response, 2) && response[0]; 1232 &response, 2) && response[0];
1227} 1233}
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c
index e2be95af2e52..77e564667b5c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.c
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c
@@ -29,10 +29,6 @@
29#include "nouveau_i2c.h" 29#include "nouveau_i2c.h"
30#include "nouveau_hw.h" 30#include "nouveau_hw.h"
31 31
32#define T_TIMEOUT 2200000
33#define T_RISEFALL 1000
34#define T_HOLD 5000
35
36static void 32static void
37i2c_drive_scl(void *data, int state) 33i2c_drive_scl(void *data, int state)
38{ 34{
@@ -113,175 +109,6 @@ i2c_sense_sda(void *data)
113 return 0; 109 return 0;
114} 110}
115 111
116static void
117i2c_delay(struct nouveau_i2c_chan *port, u32 nsec)
118{
119 udelay((nsec + 500) / 1000);
120}
121
122static bool
123i2c_raise_scl(struct nouveau_i2c_chan *port)
124{
125 u32 timeout = T_TIMEOUT / T_RISEFALL;
126
127 i2c_drive_scl(port, 1);
128 do {
129 i2c_delay(port, T_RISEFALL);
130 } while (!i2c_sense_scl(port) && --timeout);
131
132 return timeout != 0;
133}
134
135static int
136i2c_start(struct nouveau_i2c_chan *port)
137{
138 int ret = 0;
139
140 port->state = i2c_sense_scl(port);
141 port->state |= i2c_sense_sda(port) << 1;
142 if (port->state != 3) {
143 i2c_drive_scl(port, 0);
144 i2c_drive_sda(port, 1);
145 if (!i2c_raise_scl(port))
146 ret = -EBUSY;
147 }
148
149 i2c_drive_sda(port, 0);
150 i2c_delay(port, T_HOLD);
151 i2c_drive_scl(port, 0);
152 i2c_delay(port, T_HOLD);
153 return ret;
154}
155
156static void
157i2c_stop(struct nouveau_i2c_chan *port)
158{
159 i2c_drive_scl(port, 0);
160 i2c_drive_sda(port, 0);
161 i2c_delay(port, T_RISEFALL);
162
163 i2c_drive_scl(port, 1);
164 i2c_delay(port, T_HOLD);
165 i2c_drive_sda(port, 1);
166 i2c_delay(port, T_HOLD);
167}
168
169static int
170i2c_bitw(struct nouveau_i2c_chan *port, int sda)
171{
172 i2c_drive_sda(port, sda);
173 i2c_delay(port, T_RISEFALL);
174
175 if (!i2c_raise_scl(port))
176 return -ETIMEDOUT;
177 i2c_delay(port, T_HOLD);
178
179 i2c_drive_scl(port, 0);
180 i2c_delay(port, T_HOLD);
181 return 0;
182}
183
184static int
185i2c_bitr(struct nouveau_i2c_chan *port)
186{
187 int sda;
188
189 i2c_drive_sda(port, 1);
190 i2c_delay(port, T_RISEFALL);
191
192 if (!i2c_raise_scl(port))
193 return -ETIMEDOUT;
194 i2c_delay(port, T_HOLD);
195
196 sda = i2c_sense_sda(port);
197
198 i2c_drive_scl(port, 0);
199 i2c_delay(port, T_HOLD);
200 return sda;
201}
202
203static int
204i2c_get_byte(struct nouveau_i2c_chan *port, u8 *byte, bool last)
205{
206 int i, bit;
207
208 *byte = 0;
209 for (i = 7; i >= 0; i--) {
210 bit = i2c_bitr(port);
211 if (bit < 0)
212 return bit;
213 *byte |= bit << i;
214 }
215
216 return i2c_bitw(port, last ? 1 : 0);
217}
218
219static int
220i2c_put_byte(struct nouveau_i2c_chan *port, u8 byte)
221{
222 int i, ret;
223 for (i = 7; i >= 0; i--) {
224 ret = i2c_bitw(port, !!(byte & (1 << i)));
225 if (ret < 0)
226 return ret;
227 }
228
229 ret = i2c_bitr(port);
230 if (ret == 1) /* nack */
231 ret = -EIO;
232 return ret;
233}
234
235static int
236i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg)
237{
238 u32 addr = msg->addr << 1;
239 if (msg->flags & I2C_M_RD)
240 addr |= 1;
241 return i2c_put_byte(port, addr);
242}
243
244static int
245i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
246{
247 struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap;
248 struct i2c_msg *msg = msgs;
249 int ret = 0, mcnt = num;
250
251 while (!ret && mcnt--) {
252 u8 remaining = msg->len;
253 u8 *ptr = msg->buf;
254
255 ret = i2c_start(port);
256 if (ret == 0)
257 ret = i2c_addr(port, msg);
258
259 if (msg->flags & I2C_M_RD) {
260 while (!ret && remaining--)
261 ret = i2c_get_byte(port, ptr++, !remaining);
262 } else {
263 while (!ret && remaining--)
264 ret = i2c_put_byte(port, *ptr++);
265 }
266
267 msg++;
268 }
269
270 i2c_stop(port);
271 return (ret < 0) ? ret : num;
272}
273
274static u32
275i2c_bit_func(struct i2c_adapter *adap)
276{
277 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
278}
279
280const struct i2c_algorithm nouveau_i2c_bit_algo = {
281 .master_xfer = i2c_bit_xfer,
282 .functionality = i2c_bit_func
283};
284
285static const uint32_t nv50_i2c_port[] = { 112static const uint32_t nv50_i2c_port[] = {
286 0x00e138, 0x00e150, 0x00e168, 0x00e180, 113 0x00e138, 0x00e150, 0x00e168, 0x00e180,
287 0x00e254, 0x00e274, 0x00e764, 0x00e780, 114 0x00e254, 0x00e274, 0x00e764, 0x00e780,
@@ -384,12 +211,10 @@ nouveau_i2c_init(struct drm_device *dev)
384 case 0: /* NV04:NV50 */ 211 case 0: /* NV04:NV50 */
385 port->drive = entry[0]; 212 port->drive = entry[0];
386 port->sense = entry[1]; 213 port->sense = entry[1];
387 port->adapter.algo = &nouveau_i2c_bit_algo;
388 break; 214 break;
389 case 4: /* NV4E */ 215 case 4: /* NV4E */
390 port->drive = 0x600800 + entry[1]; 216 port->drive = 0x600800 + entry[1];
391 port->sense = port->drive; 217 port->sense = port->drive;
392 port->adapter.algo = &nouveau_i2c_bit_algo;
393 break; 218 break;
394 case 5: /* NV50- */ 219 case 5: /* NV50- */
395 port->drive = entry[0] & 0x0f; 220 port->drive = entry[0] & 0x0f;
@@ -402,7 +227,6 @@ nouveau_i2c_init(struct drm_device *dev)
402 port->drive = 0x00d014 + (port->drive * 0x20); 227 port->drive = 0x00d014 + (port->drive * 0x20);
403 port->sense = port->drive; 228 port->sense = port->drive;
404 } 229 }
405 port->adapter.algo = &nouveau_i2c_bit_algo;
406 break; 230 break;
407 case 6: /* NV50- DP AUX */ 231 case 6: /* NV50- DP AUX */
408 port->drive = entry[0]; 232 port->drive = entry[0];
@@ -413,7 +237,7 @@ nouveau_i2c_init(struct drm_device *dev)
413 break; 237 break;
414 } 238 }
415 239
416 if (!port->adapter.algo) { 240 if (!port->adapter.algo && !port->drive) {
417 NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", 241 NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n",
418 i, port->type, port->drive, port->sense); 242 i, port->type, port->drive, port->sense);
419 kfree(port); 243 kfree(port);
@@ -429,7 +253,26 @@ nouveau_i2c_init(struct drm_device *dev)
429 port->dcb = ROM32(entry[0]); 253 port->dcb = ROM32(entry[0]);
430 i2c_set_adapdata(&port->adapter, i2c); 254 i2c_set_adapdata(&port->adapter, i2c);
431 255
432 ret = i2c_add_adapter(&port->adapter); 256 if (port->adapter.algo != &nouveau_dp_i2c_algo) {
257 port->adapter.algo_data = &port->bit;
258 port->bit.udelay = 10;
259 port->bit.timeout = usecs_to_jiffies(2200);
260 port->bit.data = port;
261 port->bit.setsda = i2c_drive_sda;
262 port->bit.setscl = i2c_drive_scl;
263 port->bit.getsda = i2c_sense_sda;
264 port->bit.getscl = i2c_sense_scl;
265
266 i2c_drive_scl(port, 0);
267 i2c_drive_sda(port, 1);
268 i2c_drive_scl(port, 1);
269
270 ret = i2c_bit_add_bus(&port->adapter);
271 } else {
272 port->adapter.algo = &nouveau_dp_i2c_algo;
273 ret = i2c_add_adapter(&port->adapter);
274 }
275
433 if (ret) { 276 if (ret) {
434 NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); 277 NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret);
435 kfree(port); 278 kfree(port);
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.h b/drivers/gpu/drm/nouveau/nouveau_i2c.h
index 4d2e4e9031be..1d083893a4d7 100644
--- a/drivers/gpu/drm/nouveau/nouveau_i2c.h
+++ b/drivers/gpu/drm/nouveau/nouveau_i2c.h
@@ -34,6 +34,7 @@
34struct nouveau_i2c_chan { 34struct nouveau_i2c_chan {
35 struct i2c_adapter adapter; 35 struct i2c_adapter adapter;
36 struct drm_device *dev; 36 struct drm_device *dev;
37 struct i2c_algo_bit_data bit;
37 struct list_head head; 38 struct list_head head;
38 u8 index; 39 u8 index;
39 u8 type; 40 u8 type;
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c
index d8433f2d53bc..73973fdbd8be 100644
--- a/drivers/leds/leds-netxbig.c
+++ b/drivers/leds/leds-netxbig.c
@@ -112,7 +112,7 @@ err_free_addr:
112 return err; 112 return err;
113} 113}
114 114
115static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) 115static void gpio_ext_free(struct netxbig_gpio_ext *gpio_ext)
116{ 116{
117 int i; 117 int i;
118 118
@@ -294,7 +294,7 @@ static ssize_t netxbig_led_sata_show(struct device *dev,
294 294
295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); 295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store);
296 296
297static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) 297static void delete_netxbig_led(struct netxbig_led_data *led_dat)
298{ 298{
299 if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) 299 if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE)
300 device_remove_file(led_dat->cdev.dev, &dev_attr_sata); 300 device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c
index 2f0a14421a73..01cf89ec6944 100644
--- a/drivers/leds/leds-ns2.c
+++ b/drivers/leds/leds-ns2.c
@@ -255,7 +255,7 @@ err_free_cmd:
255 return ret; 255 return ret;
256} 256}
257 257
258static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) 258static void delete_ns2_led(struct ns2_led_data *led_dat)
259{ 259{
260 device_remove_file(led_dat->cdev.dev, &dev_attr_sata); 260 device_remove_file(led_dat->cdev.dev, &dev_attr_sata);
261 led_classdev_unregister(&led_dat->cdev); 261 led_classdev_unregister(&led_dat->cdev);
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c
index 1f23e048f077..08d9a207259a 100644
--- a/drivers/md/dm-log-userspace-transfer.c
+++ b/drivers/md/dm-log-userspace-transfer.c
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp)
134{ 134{
135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); 135 struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1);
136 136
137 if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) 137 if (!capable(CAP_SYS_ADMIN))
138 return; 138 return;
139 139
140 spin_lock(&receiving_list_lock); 140 spin_lock(&receiving_list_lock);
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 922a3385eead..754f38f8a692 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m)
718 return 0; 718 return 0;
719 719
720 m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); 720 m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL);
721 request_module("scsi_dh_%s", m->hw_handler_name); 721 if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name),
722 if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { 722 "scsi_dh_%s", m->hw_handler_name)) {
723 ti->error = "unknown hardware handler type"; 723 ti->error = "unknown hardware handler type";
724 ret = -EINVAL; 724 ret = -EINVAL;
725 goto fail; 725 goto fail;
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c
index 213ae32a0fc4..2fd87b544a93 100644
--- a/drivers/md/dm-thin.c
+++ b/drivers/md/dm-thin.c
@@ -279,8 +279,10 @@ static void __cell_release(struct cell *cell, struct bio_list *inmates)
279 279
280 hlist_del(&cell->list); 280 hlist_del(&cell->list);
281 281
282 bio_list_add(inmates, cell->holder); 282 if (inmates) {
283 bio_list_merge(inmates, &cell->bios); 283 bio_list_add(inmates, cell->holder);
284 bio_list_merge(inmates, &cell->bios);
285 }
284 286
285 mempool_free(cell, prison->cell_pool); 287 mempool_free(cell, prison->cell_pool);
286} 288}
@@ -303,9 +305,10 @@ static void cell_release(struct cell *cell, struct bio_list *bios)
303 */ 305 */
304static void __cell_release_singleton(struct cell *cell, struct bio *bio) 306static void __cell_release_singleton(struct cell *cell, struct bio *bio)
305{ 307{
306 hlist_del(&cell->list);
307 BUG_ON(cell->holder != bio); 308 BUG_ON(cell->holder != bio);
308 BUG_ON(!bio_list_empty(&cell->bios)); 309 BUG_ON(!bio_list_empty(&cell->bios));
310
311 __cell_release(cell, NULL);
309} 312}
310 313
311static void cell_release_singleton(struct cell *cell, struct bio *bio) 314static void cell_release_singleton(struct cell *cell, struct bio *bio)
@@ -1177,6 +1180,7 @@ static void no_space(struct cell *cell)
1177static void process_discard(struct thin_c *tc, struct bio *bio) 1180static void process_discard(struct thin_c *tc, struct bio *bio)
1178{ 1181{
1179 int r; 1182 int r;
1183 unsigned long flags;
1180 struct pool *pool = tc->pool; 1184 struct pool *pool = tc->pool;
1181 struct cell *cell, *cell2; 1185 struct cell *cell, *cell2;
1182 struct cell_key key, key2; 1186 struct cell_key key, key2;
@@ -1218,7 +1222,9 @@ static void process_discard(struct thin_c *tc, struct bio *bio)
1218 m->bio = bio; 1222 m->bio = bio;
1219 1223
1220 if (!ds_add_work(&pool->all_io_ds, &m->list)) { 1224 if (!ds_add_work(&pool->all_io_ds, &m->list)) {
1225 spin_lock_irqsave(&pool->lock, flags);
1221 list_add(&m->list, &pool->prepared_discards); 1226 list_add(&m->list, &pool->prepared_discards);
1227 spin_unlock_irqrestore(&pool->lock, flags);
1222 wake_worker(pool); 1228 wake_worker(pool);
1223 } 1229 }
1224 } else { 1230 } else {
@@ -2626,8 +2632,10 @@ static int thin_endio(struct dm_target *ti,
2626 if (h->all_io_entry) { 2632 if (h->all_io_entry) {
2627 INIT_LIST_HEAD(&work); 2633 INIT_LIST_HEAD(&work);
2628 ds_dec(h->all_io_entry, &work); 2634 ds_dec(h->all_io_entry, &work);
2635 spin_lock_irqsave(&pool->lock, flags);
2629 list_for_each_entry_safe(m, tmp, &work, list) 2636 list_for_each_entry_safe(m, tmp, &work, list)
2630 list_add(&m->list, &pool->prepared_discards); 2637 list_add(&m->list, &pool->prepared_discards);
2638 spin_unlock_irqrestore(&pool->lock, flags);
2631 } 2639 }
2632 2640
2633 mempool_free(h, pool->endio_hook_pool); 2641 mempool_free(h, pool->endio_hook_pool);
@@ -2759,6 +2767,6 @@ static void dm_thin_exit(void)
2759module_init(dm_thin_init); 2767module_init(dm_thin_init);
2760module_exit(dm_thin_exit); 2768module_exit(dm_thin_exit);
2761 2769
2762MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); 2770MODULE_DESCRIPTION(DM_NAME " thin provisioning target");
2763MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); 2771MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>");
2764MODULE_LICENSE("GPL"); 2772MODULE_LICENSE("GPL");
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c
index 1d3bfb26080c..0f50ef38b87b 100644
--- a/drivers/mtd/nand/orion_nand.c
+++ b/drivers/mtd/nand/orion_nand.c
@@ -13,6 +13,7 @@
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <linux/module.h> 14#include <linux/module.h>
15#include <linux/platform_device.h> 15#include <linux/platform_device.h>
16#include <linux/of.h>
16#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
17#include <linux/mtd/nand.h> 18#include <linux/mtd/nand.h>
18#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
@@ -74,11 +75,13 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len)
74static int __init orion_nand_probe(struct platform_device *pdev) 75static int __init orion_nand_probe(struct platform_device *pdev)
75{ 76{
76 struct mtd_info *mtd; 77 struct mtd_info *mtd;
78 struct mtd_part_parser_data ppdata = {};
77 struct nand_chip *nc; 79 struct nand_chip *nc;
78 struct orion_nand_data *board; 80 struct orion_nand_data *board;
79 struct resource *res; 81 struct resource *res;
80 void __iomem *io_base; 82 void __iomem *io_base;
81 int ret = 0; 83 int ret = 0;
84 u32 val = 0;
82 85
83 nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL); 86 nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL);
84 if (!nc) { 87 if (!nc) {
@@ -101,7 +104,32 @@ static int __init orion_nand_probe(struct platform_device *pdev)
101 goto no_res; 104 goto no_res;
102 } 105 }
103 106
104 board = pdev->dev.platform_data; 107 if (pdev->dev.of_node) {
108 board = devm_kzalloc(&pdev->dev, sizeof(struct orion_nand_data),
109 GFP_KERNEL);
110 if (!board) {
111 printk(KERN_ERR "orion_nand: failed to allocate board structure.\n");
112 ret = -ENOMEM;
113 goto no_res;
114 }
115 if (!of_property_read_u32(pdev->dev.of_node, "cle", &val))
116 board->cle = (u8)val;
117 else
118 board->cle = 0;
119 if (!of_property_read_u32(pdev->dev.of_node, "ale", &val))
120 board->ale = (u8)val;
121 else
122 board->ale = 1;
123 if (!of_property_read_u32(pdev->dev.of_node,
124 "bank-width", &val))
125 board->width = (u8)val * 8;
126 else
127 board->width = 8;
128 if (!of_property_read_u32(pdev->dev.of_node,
129 "chip-delay", &val))
130 board->chip_delay = (u8)val;
131 } else
132 board = pdev->dev.platform_data;
105 133
106 mtd->priv = nc; 134 mtd->priv = nc;
107 mtd->owner = THIS_MODULE; 135 mtd->owner = THIS_MODULE;
@@ -115,6 +143,10 @@ static int __init orion_nand_probe(struct platform_device *pdev)
115 if (board->chip_delay) 143 if (board->chip_delay)
116 nc->chip_delay = board->chip_delay; 144 nc->chip_delay = board->chip_delay;
117 145
146 WARN(board->width > 16,
147 "%d bit bus width out of range",
148 board->width);
149
118 if (board->width == 16) 150 if (board->width == 16)
119 nc->options |= NAND_BUSWIDTH_16; 151 nc->options |= NAND_BUSWIDTH_16;
120 152
@@ -129,8 +161,9 @@ static int __init orion_nand_probe(struct platform_device *pdev)
129 } 161 }
130 162
131 mtd->name = "orion_nand"; 163 mtd->name = "orion_nand";
132 ret = mtd_device_parse_register(mtd, NULL, NULL, board->parts, 164 ppdata.of_node = pdev->dev.of_node;
133 board->nr_parts); 165 ret = mtd_device_parse_register(mtd, NULL, &ppdata,
166 board->parts, board->nr_parts);
134 if (ret) { 167 if (ret) {
135 nand_release(mtd); 168 nand_release(mtd);
136 goto no_dev; 169 goto no_dev;
@@ -161,11 +194,19 @@ static int __devexit orion_nand_remove(struct platform_device *pdev)
161 return 0; 194 return 0;
162} 195}
163 196
197#ifdef CONFIG_OF
198static struct of_device_id orion_nand_of_match_table[] = {
199 { .compatible = "mrvl,orion-nand", },
200 {},
201};
202#endif
203
164static struct platform_driver orion_nand_driver = { 204static struct platform_driver orion_nand_driver = {
165 .remove = __devexit_p(orion_nand_remove), 205 .remove = __devexit_p(orion_nand_remove),
166 .driver = { 206 .driver = {
167 .name = "orion_nand", 207 .name = "orion_nand",
168 .owner = THIS_MODULE, 208 .owner = THIS_MODULE,
209 .of_match_table = of_match_ptr(orion_nand_of_match_table),
169 }, 210 },
170}; 211};
171 212
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 793b00138275..3463b469e657 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -2173,9 +2173,10 @@ re_arm:
2173 * received frames (loopback). Since only the payload is given to this 2173 * received frames (loopback). Since only the payload is given to this
2174 * function, it check for loopback. 2174 * function, it check for loopback.
2175 */ 2175 */
2176static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) 2176static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length)
2177{ 2177{
2178 struct port *port; 2178 struct port *port;
2179 int ret = RX_HANDLER_ANOTHER;
2179 2180
2180 if (length >= sizeof(struct lacpdu)) { 2181 if (length >= sizeof(struct lacpdu)) {
2181 2182
@@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2184 if (!port->slave) { 2185 if (!port->slave) {
2185 pr_warning("%s: Warning: port of slave %s is uninitialized\n", 2186 pr_warning("%s: Warning: port of slave %s is uninitialized\n",
2186 slave->dev->name, slave->dev->master->name); 2187 slave->dev->name, slave->dev->master->name);
2187 return; 2188 return ret;
2188 } 2189 }
2189 2190
2190 switch (lacpdu->subtype) { 2191 switch (lacpdu->subtype) {
2191 case AD_TYPE_LACPDU: 2192 case AD_TYPE_LACPDU:
2193 ret = RX_HANDLER_CONSUMED;
2192 pr_debug("Received LACPDU on port %d\n", 2194 pr_debug("Received LACPDU on port %d\n",
2193 port->actor_port_number); 2195 port->actor_port_number);
2194 /* Protect against concurrent state machines */ 2196 /* Protect against concurrent state machines */
@@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2198 break; 2200 break;
2199 2201
2200 case AD_TYPE_MARKER: 2202 case AD_TYPE_MARKER:
2203 ret = RX_HANDLER_CONSUMED;
2201 // No need to convert fields to Little Endian since we don't use the marker's fields. 2204 // No need to convert fields to Little Endian since we don't use the marker's fields.
2202 2205
2203 switch (((struct bond_marker *)lacpdu)->tlv_type) { 2206 switch (((struct bond_marker *)lacpdu)->tlv_type) {
@@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u
2219 } 2222 }
2220 } 2223 }
2221 } 2224 }
2225 return ret;
2222} 2226}
2223 2227
2224/** 2228/**
@@ -2456,18 +2460,20 @@ out:
2456 return NETDEV_TX_OK; 2460 return NETDEV_TX_OK;
2457} 2461}
2458 2462
2459void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 2463int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
2460 struct slave *slave) 2464 struct slave *slave)
2461{ 2465{
2466 int ret = RX_HANDLER_ANOTHER;
2462 if (skb->protocol != PKT_TYPE_LACPDU) 2467 if (skb->protocol != PKT_TYPE_LACPDU)
2463 return; 2468 return ret;
2464 2469
2465 if (!pskb_may_pull(skb, sizeof(struct lacpdu))) 2470 if (!pskb_may_pull(skb, sizeof(struct lacpdu)))
2466 return; 2471 return ret;
2467 2472
2468 read_lock(&bond->lock); 2473 read_lock(&bond->lock);
2469 bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); 2474 ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len);
2470 read_unlock(&bond->lock); 2475 read_unlock(&bond->lock);
2476 return ret;
2471} 2477}
2472 2478
2473/* 2479/*
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h
index 235b2cc58b28..5ee7e3c45db7 100644
--- a/drivers/net/bonding/bond_3ad.h
+++ b/drivers/net/bonding/bond_3ad.h
@@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave);
274void bond_3ad_handle_link_change(struct slave *slave, char link); 274void bond_3ad_handle_link_change(struct slave *slave, char link);
275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
277void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 277int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
278 struct slave *slave); 278 struct slave *slave);
279int bond_3ad_set_carrier(struct bonding *bond); 279int bond_3ad_set_carrier(struct bonding *bond);
280void bond_3ad_update_lacp_rate(struct bonding *bond); 280void bond_3ad_update_lacp_rate(struct bonding *bond);
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 62d2409bb293..bc13b3d77432 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1444 struct sk_buff *skb = *pskb; 1444 struct sk_buff *skb = *pskb;
1445 struct slave *slave; 1445 struct slave *slave;
1446 struct bonding *bond; 1446 struct bonding *bond;
1447 void (*recv_probe)(struct sk_buff *, struct bonding *, 1447 int (*recv_probe)(struct sk_buff *, struct bonding *,
1448 struct slave *); 1448 struct slave *);
1449 int ret = RX_HANDLER_ANOTHER;
1449 1450
1450 skb = skb_share_check(skb, GFP_ATOMIC); 1451 skb = skb_share_check(skb, GFP_ATOMIC);
1451 if (unlikely(!skb)) 1452 if (unlikely(!skb))
@@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1464 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); 1465 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
1465 1466
1466 if (likely(nskb)) { 1467 if (likely(nskb)) {
1467 recv_probe(nskb, bond, slave); 1468 ret = recv_probe(nskb, bond, slave);
1468 dev_kfree_skb(nskb); 1469 dev_kfree_skb(nskb);
1470 if (ret == RX_HANDLER_CONSUMED) {
1471 consume_skb(skb);
1472 return ret;
1473 }
1469 } 1474 }
1470 } 1475 }
1471 1476
@@ -1487,7 +1492,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb)
1487 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); 1492 memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN);
1488 } 1493 }
1489 1494
1490 return RX_HANDLER_ANOTHER; 1495 return ret;
1491} 1496}
1492 1497
1493/* enslave device <slave> to bond device <master> */ 1498/* enslave device <slave> to bond device <master> */
@@ -2723,7 +2728,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2723 } 2728 }
2724} 2729}
2725 2730
2726static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2731static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2727 struct slave *slave) 2732 struct slave *slave)
2728{ 2733{
2729 struct arphdr *arp; 2734 struct arphdr *arp;
@@ -2731,7 +2736,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2731 __be32 sip, tip; 2736 __be32 sip, tip;
2732 2737
2733 if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) 2738 if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2734 return; 2739 return RX_HANDLER_ANOTHER;
2735 2740
2736 read_lock(&bond->lock); 2741 read_lock(&bond->lock);
2737 2742
@@ -2776,6 +2781,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2776 2781
2777out_unlock: 2782out_unlock:
2778 read_unlock(&bond->lock); 2783 read_unlock(&bond->lock);
2784 return RX_HANDLER_ANOTHER;
2779} 2785}
2780 2786
2781/* 2787/*
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index e077d2508727..6af310195bae 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp)
9122 return bnx2x_prev_mcp_done(bp); 9122 return bnx2x_prev_mcp_done(bp);
9123} 9123}
9124 9124
9125/* previous driver DMAE transaction may have occurred when pre-boot stage ended
9126 * and boot began, or when kdump kernel was loaded. Either case would invalidate
9127 * the addresses of the transaction, resulting in was-error bit set in the pci
9128 * causing all hw-to-host pcie transactions to timeout. If this happened we want
9129 * to clear the interrupt which detected this from the pglueb and the was done
9130 * bit
9131 */
9132static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp)
9133{
9134 u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS);
9135 if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) {
9136 BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing");
9137 REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp));
9138 }
9139}
9140
9125static int __devinit bnx2x_prev_unload(struct bnx2x *bp) 9141static int __devinit bnx2x_prev_unload(struct bnx2x *bp)
9126{ 9142{
9127 int time_counter = 10; 9143 int time_counter = 10;
9128 u32 rc, fw, hw_lock_reg, hw_lock_val; 9144 u32 rc, fw, hw_lock_reg, hw_lock_val;
9129 BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); 9145 BNX2X_DEV_INFO("Entering Previous Unload Flow\n");
9130 9146
9131 /* Release previously held locks */ 9147 /* clear hw from errors which may have resulted from an interrupted
9148 * dmae transaction.
9149 */
9150 bnx2x_prev_interrupted_dmae(bp);
9151
9152 /* Release previously held locks */
9132 hw_lock_reg = (BP_FUNC(bp) <= 5) ? 9153 hw_lock_reg = (BP_FUNC(bp) <= 5) ?
9133 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : 9154 (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) :
9134 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); 9155 (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8);
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index c9069a28832b..f4d2da0db1b1 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -3335,6 +3335,8 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3335 goto out_shutdown_ports; 3335 goto out_shutdown_ports;
3336 } 3336 }
3337 3337
3338 /* Handle any events that might be pending. */
3339 tasklet_hi_schedule(&adapter->neq_tasklet);
3338 3340
3339 ret = 0; 3341 ret = 0;
3340 goto out; 3342 goto out;
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 4348b6fd44fa..37caa8885c2a 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -3380,7 +3380,7 @@ static void e1000_dump(struct e1000_adapter *adapter)
3380 for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { 3380 for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) {
3381 struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); 3381 struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i);
3382 struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; 3382 struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i];
3383 struct my_u { u64 a; u64 b; }; 3383 struct my_u { __le64 a; __le64 b; };
3384 struct my_u *u = (struct my_u *)tx_desc; 3384 struct my_u *u = (struct my_u *)tx_desc;
3385 const char *type; 3385 const char *type;
3386 3386
@@ -3424,7 +3424,7 @@ rx_ring_summary:
3424 for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { 3424 for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) {
3425 struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); 3425 struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i);
3426 struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; 3426 struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i];
3427 struct my_u { u64 a; u64 b; }; 3427 struct my_u { __le64 a; __le64 b; };
3428 struct my_u *u = (struct my_u *)rx_desc; 3428 struct my_u *u = (struct my_u *)rx_desc;
3429 const char *type; 3429 const char *type;
3430 3430
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 5ec31598ee47..8683ca4748c8 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1111,9 +1111,12 @@ msi_only:
1111 adapter->flags |= IGB_FLAG_HAS_MSI; 1111 adapter->flags |= IGB_FLAG_HAS_MSI;
1112out: 1112out:
1113 /* Notify the stack of the (possibly) reduced queue counts. */ 1113 /* Notify the stack of the (possibly) reduced queue counts. */
1114 rtnl_lock();
1114 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 1115 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
1115 return netif_set_real_num_rx_queues(adapter->netdev, 1116 err = netif_set_real_num_rx_queues(adapter->netdev,
1116 adapter->num_rx_queues); 1117 adapter->num_rx_queues);
1118 rtnl_unlock();
1119 return err;
1117} 1120}
1118 1121
1119/** 1122/**
@@ -2771,8 +2774,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
2771 2774
2772 txdctl |= E1000_TXDCTL_QUEUE_ENABLE; 2775 txdctl |= E1000_TXDCTL_QUEUE_ENABLE;
2773 wr32(E1000_TXDCTL(reg_idx), txdctl); 2776 wr32(E1000_TXDCTL(reg_idx), txdctl);
2774
2775 netdev_tx_reset_queue(txring_txq(ring));
2776} 2777}
2777 2778
2778/** 2779/**
@@ -3282,6 +3283,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring)
3282 igb_unmap_and_free_tx_resource(tx_ring, buffer_info); 3283 igb_unmap_and_free_tx_resource(tx_ring, buffer_info);
3283 } 3284 }
3284 3285
3286 netdev_tx_reset_queue(txring_txq(tx_ring));
3287
3285 size = sizeof(struct igb_tx_buffer) * tx_ring->count; 3288 size = sizeof(struct igb_tx_buffer) * tx_ring->count;
3286 memset(tx_ring->tx_buffer_info, 0, size); 3289 memset(tx_ring->tx_buffer_info, 0, size);
3287 3290
@@ -6796,18 +6799,7 @@ static int igb_resume(struct device *dev)
6796 pci_enable_wake(pdev, PCI_D3hot, 0); 6799 pci_enable_wake(pdev, PCI_D3hot, 0);
6797 pci_enable_wake(pdev, PCI_D3cold, 0); 6800 pci_enable_wake(pdev, PCI_D3cold, 0);
6798 6801
6799 if (!rtnl_is_locked()) { 6802 if (igb_init_interrupt_scheme(adapter)) {
6800 /*
6801 * shut up ASSERT_RTNL() warning in
6802 * netif_set_real_num_tx/rx_queues.
6803 */
6804 rtnl_lock();
6805 err = igb_init_interrupt_scheme(adapter);
6806 rtnl_unlock();
6807 } else {
6808 err = igb_init_interrupt_scheme(adapter);
6809 }
6810 if (err) {
6811 dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); 6803 dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
6812 return -ENOMEM; 6804 return -ENOMEM;
6813 } 6805 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
index 74e192107f9a..81b155589532 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h
@@ -574,9 +574,6 @@ extern struct ixgbe_info ixgbe_82599_info;
574extern struct ixgbe_info ixgbe_X540_info; 574extern struct ixgbe_info ixgbe_X540_info;
575#ifdef CONFIG_IXGBE_DCB 575#ifdef CONFIG_IXGBE_DCB
576extern const struct dcbnl_rtnl_ops dcbnl_ops; 576extern const struct dcbnl_rtnl_ops dcbnl_ops;
577extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
578 struct ixgbe_dcb_config *dst_dcb_cfg,
579 int tc_max);
580#endif 577#endif
581 578
582extern char ixgbe_driver_name[]; 579extern char ixgbe_driver_name[];
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
index 652e4b09546d..32e5c02ff6d0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c
@@ -44,18 +44,26 @@
44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ 44#define DCB_NO_HW_CHG 1 /* DCB configuration did not change */
45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ 45#define DCB_HW_CHG 2 /* DCB configuration changed, no reset */
46 46
47int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg, 47static int ixgbe_copy_dcb_cfg(struct ixgbe_adapter *adapter, int tc_max)
48 struct ixgbe_dcb_config *dcfg, int tc_max)
49{ 48{
49 struct ixgbe_dcb_config *scfg = &adapter->temp_dcb_cfg;
50 struct ixgbe_dcb_config *dcfg = &adapter->dcb_cfg;
50 struct tc_configuration *src = NULL; 51 struct tc_configuration *src = NULL;
51 struct tc_configuration *dst = NULL; 52 struct tc_configuration *dst = NULL;
52 int i, j; 53 int i, j;
53 int tx = DCB_TX_CONFIG; 54 int tx = DCB_TX_CONFIG;
54 int rx = DCB_RX_CONFIG; 55 int rx = DCB_RX_CONFIG;
55 int changes = 0; 56 int changes = 0;
57#ifdef IXGBE_FCOE
58 struct dcb_app app = {
59 .selector = DCB_APP_IDTYPE_ETHTYPE,
60 .protocol = ETH_P_FCOE,
61 };
62 u8 up = dcb_getapp(adapter->netdev, &app);
56 63
57 if (!scfg || !dcfg) 64 if (up && !(up & (1 << adapter->fcoe.up)))
58 return changes; 65 changes |= BIT_APP_UPCHG;
66#endif
59 67
60 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { 68 for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) {
61 src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; 69 src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0];
@@ -332,28 +340,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
332 struct ixgbe_adapter *adapter = netdev_priv(netdev); 340 struct ixgbe_adapter *adapter = netdev_priv(netdev);
333 int ret = DCB_NO_HW_CHG; 341 int ret = DCB_NO_HW_CHG;
334 int i; 342 int i;
335#ifdef IXGBE_FCOE
336 struct dcb_app app = {
337 .selector = DCB_APP_IDTYPE_ETHTYPE,
338 .protocol = ETH_P_FCOE,
339 };
340 u8 up;
341
342 /* In IEEE mode, use the IEEE Ethertype selector value */
343 if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) {
344 app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE;
345 up = dcb_ieee_getapp_mask(netdev, &app);
346 } else {
347 up = dcb_getapp(netdev, &app);
348 }
349#endif
350 343
351 /* Fail command if not in CEE mode */ 344 /* Fail command if not in CEE mode */
352 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) 345 if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE))
353 return ret; 346 return ret;
354 347
355 adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, 348 adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(adapter,
356 &adapter->dcb_cfg,
357 MAX_TRAFFIC_CLASS); 349 MAX_TRAFFIC_CLASS);
358 if (!adapter->dcb_set_bitmap) 350 if (!adapter->dcb_set_bitmap)
359 return ret; 351 return ret;
@@ -440,8 +432,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev)
440 * FCoE is using changes. This happens if the APP info 432 * FCoE is using changes. This happens if the APP info
441 * changes or the up2tc mapping is updated. 433 * changes or the up2tc mapping is updated.
442 */ 434 */
443 if ((up && !(up & (1 << adapter->fcoe.up))) || 435 if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) {
444 (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) { 436 struct dcb_app app = {
437 .selector = DCB_APP_IDTYPE_ETHTYPE,
438 .protocol = ETH_P_FCOE,
439 };
440 u8 up = dcb_getapp(netdev, &app);
441
445 adapter->fcoe.up = ffs(up) - 1; 442 adapter->fcoe.up = ffs(up) - 1;
446 ixgbe_dcbnl_devreset(netdev); 443 ixgbe_dcbnl_devreset(netdev);
447 ret = DCB_HW_CHG_RST; 444 ret = DCB_HW_CHG_RST;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 31a2bf76a346..cfe7d269590c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -1780,6 +1780,8 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring,
1780 rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); 1780 rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc);
1781 } 1781 }
1782 1782
1783 netdev_tx_reset_queue(txring_txq(tx_ring));
1784
1783 /* re-map buffers to ring, store next to clean values */ 1785 /* re-map buffers to ring, store next to clean values */
1784 ixgbe_alloc_rx_buffers(rx_ring, count); 1786 ixgbe_alloc_rx_buffers(rx_ring, count);
1785 rx_ring->next_to_clean = rx_ntc; 1787 rx_ring->next_to_clean = rx_ntc;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 88f6b2e9b72d..467948e9ecd9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2671,8 +2671,6 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter,
2671 /* enable queue */ 2671 /* enable queue */
2672 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); 2672 IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl);
2673 2673
2674 netdev_tx_reset_queue(txring_txq(ring));
2675
2676 /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ 2674 /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */
2677 if (hw->mac.type == ixgbe_mac_82598EB && 2675 if (hw->mac.type == ixgbe_mac_82598EB &&
2678 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) 2676 !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP))
@@ -4167,6 +4165,8 @@ static void ixgbe_clean_tx_ring(struct ixgbe_ring *tx_ring)
4167 ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); 4165 ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info);
4168 } 4166 }
4169 4167
4168 netdev_tx_reset_queue(txring_txq(tx_ring));
4169
4170 size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; 4170 size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count;
4171 memset(tx_ring->tx_buffer_info, 0, size); 4171 memset(tx_ring->tx_buffer_info, 0, size);
4172 4172
@@ -4418,8 +4418,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
4418 adapter->dcb_cfg.pfc_mode_enable = false; 4418 adapter->dcb_cfg.pfc_mode_enable = false;
4419 adapter->dcb_set_bitmap = 0x00; 4419 adapter->dcb_set_bitmap = 0x00;
4420 adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; 4420 adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE;
4421 ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg, 4421 memcpy(&adapter->temp_dcb_cfg, &adapter->dcb_cfg,
4422 MAX_TRAFFIC_CLASS); 4422 sizeof(adapter->temp_dcb_cfg));
4423 4423
4424#endif 4424#endif
4425 4425
@@ -4866,10 +4866,12 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
4866 netif_device_detach(netdev); 4866 netif_device_detach(netdev);
4867 4867
4868 if (netif_running(netdev)) { 4868 if (netif_running(netdev)) {
4869 rtnl_lock();
4869 ixgbe_down(adapter); 4870 ixgbe_down(adapter);
4870 ixgbe_free_irq(adapter); 4871 ixgbe_free_irq(adapter);
4871 ixgbe_free_all_tx_resources(adapter); 4872 ixgbe_free_all_tx_resources(adapter);
4872 ixgbe_free_all_rx_resources(adapter); 4873 ixgbe_free_all_rx_resources(adapter);
4874 rtnl_unlock();
4873 } 4875 }
4874 4876
4875 ixgbe_clear_interrupt_scheme(adapter); 4877 ixgbe_clear_interrupt_scheme(adapter);
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index f8dda009d3c0..5e313e9a252f 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -618,10 +618,8 @@ static void ks8851_irq_work(struct work_struct *work)
618 netif_dbg(ks, intr, ks->netdev, 618 netif_dbg(ks, intr, ks->netdev,
619 "%s: status 0x%04x\n", __func__, status); 619 "%s: status 0x%04x\n", __func__, status);
620 620
621 if (status & IRQ_LCI) { 621 if (status & IRQ_LCI)
622 /* should do something about checking link status */
623 handled |= IRQ_LCI; 622 handled |= IRQ_LCI;
624 }
625 623
626 if (status & IRQ_LDI) { 624 if (status & IRQ_LDI) {
627 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); 625 u16 pmecr = ks8851_rdreg16(ks, KS_PMECR);
@@ -684,6 +682,9 @@ static void ks8851_irq_work(struct work_struct *work)
684 682
685 mutex_unlock(&ks->lock); 683 mutex_unlock(&ks->lock);
686 684
685 if (status & IRQ_LCI)
686 mii_check_link(&ks->mii);
687
687 if (status & IRQ_TXI) 688 if (status & IRQ_TXI)
688 netif_wake_queue(ks->netdev); 689 netif_wake_queue(ks->netdev);
689 690
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index f54509377efa..ce6b44d1f252 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -61,8 +61,12 @@
61#define R8169_MSG_DEFAULT \ 61#define R8169_MSG_DEFAULT \
62 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) 62 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
63 63
64#define TX_BUFFS_AVAIL(tp) \ 64#define TX_SLOTS_AVAIL(tp) \
65 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 65 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)
66
67/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
68#define TX_FRAGS_READY_FOR(tp,nr_frags) \
69 (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))
66 70
67/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 71/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
68 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ 72 The RTL chips use a 64 element hash table based on the Ethernet CRC. */
@@ -5115,7 +5119,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5115 u32 opts[2]; 5119 u32 opts[2];
5116 int frags; 5120 int frags;
5117 5121
5118 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 5122 if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
5119 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); 5123 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
5120 goto err_stop_0; 5124 goto err_stop_0;
5121 } 5125 }
@@ -5169,7 +5173,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5169 5173
5170 mmiowb(); 5174 mmiowb();
5171 5175
5172 if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { 5176 if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5173 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must 5177 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
5174 * not miss a ring update when it notices a stopped queue. 5178 * not miss a ring update when it notices a stopped queue.
5175 */ 5179 */
@@ -5183,7 +5187,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5183 * can't. 5187 * can't.
5184 */ 5188 */
5185 smp_mb(); 5189 smp_mb();
5186 if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) 5190 if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS))
5187 netif_wake_queue(dev); 5191 netif_wake_queue(dev);
5188 } 5192 }
5189 5193
@@ -5306,7 +5310,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
5306 */ 5310 */
5307 smp_mb(); 5311 smp_mb();
5308 if (netif_queue_stopped(dev) && 5312 if (netif_queue_stopped(dev) &&
5309 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 5313 TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5310 netif_wake_queue(dev); 5314 netif_wake_queue(dev);
5311 } 5315 }
5312 /* 5316 /*
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 3cbfbffe3f00..4a0005342e65 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1349,7 +1349,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
1349 } 1349 }
1350 1350
1351 /* RSS might be usable on VFs even if it is disabled on the PF */ 1351 /* RSS might be usable on VFs even if it is disabled on the PF */
1352 efx->rss_spread = (efx->n_rx_channels > 1 ? 1352 efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?
1353 efx->n_rx_channels : efx_vf_size(efx)); 1353 efx->n_rx_channels : efx_vf_size(efx));
1354 1354
1355 return 0; 1355 return 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index f975afdc315c..025367a94add 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -259,7 +259,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
259 259
260xmit_world: 260xmit_world:
261 skb->ip_summed = ip_summed; 261 skb->ip_summed = ip_summed;
262 skb_set_dev(skb, vlan->lowerdev); 262 skb->dev = vlan->lowerdev;
263 return dev_queue_xmit(skb); 263 return dev_queue_xmit(skb);
264} 264}
265 265
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 0427c6561c84..cb8fd5069dbe 100644
--- a/drivers/net/macvtap.c
+++ b/drivers/net/macvtap.c
@@ -1,5 +1,6 @@
1#include <linux/etherdevice.h> 1#include <linux/etherdevice.h>
2#include <linux/if_macvlan.h> 2#include <linux/if_macvlan.h>
3#include <linux/if_vlan.h>
3#include <linux/interrupt.h> 4#include <linux/interrupt.h>
4#include <linux/nsproxy.h> 5#include <linux/nsproxy.h>
5#include <linux/compat.h> 6#include <linux/compat.h>
@@ -759,6 +760,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
759 struct macvlan_dev *vlan; 760 struct macvlan_dev *vlan;
760 int ret; 761 int ret;
761 int vnet_hdr_len = 0; 762 int vnet_hdr_len = 0;
763 int vlan_offset = 0;
764 int copied;
762 765
763 if (q->flags & IFF_VNET_HDR) { 766 if (q->flags & IFF_VNET_HDR) {
764 struct virtio_net_hdr vnet_hdr; 767 struct virtio_net_hdr vnet_hdr;
@@ -773,18 +776,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
773 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) 776 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
774 return -EFAULT; 777 return -EFAULT;
775 } 778 }
779 copied = vnet_hdr_len;
780
781 if (!vlan_tx_tag_present(skb))
782 len = min_t(int, skb->len, len);
783 else {
784 int copy;
785 struct {
786 __be16 h_vlan_proto;
787 __be16 h_vlan_TCI;
788 } veth;
789 veth.h_vlan_proto = htons(ETH_P_8021Q);
790 veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
791
792 vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
793 len = min_t(int, skb->len + VLAN_HLEN, len);
794
795 copy = min_t(int, vlan_offset, len);
796 ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
797 len -= copy;
798 copied += copy;
799 if (ret || !len)
800 goto done;
801
802 copy = min_t(int, sizeof(veth), len);
803 ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
804 len -= copy;
805 copied += copy;
806 if (ret || !len)
807 goto done;
808 }
776 809
777 len = min_t(int, skb->len, len); 810 ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
778 811 copied += len;
779 ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len);
780 812
813done:
781 rcu_read_lock_bh(); 814 rcu_read_lock_bh();
782 vlan = rcu_dereference_bh(q->vlan); 815 vlan = rcu_dereference_bh(q->vlan);
783 if (vlan) 816 if (vlan)
784 macvlan_count_rx(vlan, len, ret == 0, 0); 817 macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
785 rcu_read_unlock_bh(); 818 rcu_read_unlock_bh();
786 819
787 return ret ? ret : (len + vnet_hdr_len); 820 return ret ? ret : copied;
788} 821}
789 822
790static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, 823static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb,
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
index 90a30026a931..00880edba048 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -83,6 +83,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
83 struct cdc_state *info = (void *) &dev->data; 83 struct cdc_state *info = (void *) &dev->data;
84 int status; 84 int status;
85 int rndis; 85 int rndis;
86 bool android_rndis_quirk = false;
86 struct usb_driver *driver = driver_of(intf); 87 struct usb_driver *driver = driver_of(intf);
87 struct usb_cdc_mdlm_desc *desc = NULL; 88 struct usb_cdc_mdlm_desc *desc = NULL;
88 struct usb_cdc_mdlm_detail_desc *detail = NULL; 89 struct usb_cdc_mdlm_detail_desc *detail = NULL;
@@ -195,6 +196,11 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
195 info->control, 196 info->control,
196 info->u->bSlaveInterface0, 197 info->u->bSlaveInterface0,
197 info->data); 198 info->data);
199 /* fall back to hard-wiring for RNDIS */
200 if (rndis) {
201 android_rndis_quirk = true;
202 goto next_desc;
203 }
198 goto bad_desc; 204 goto bad_desc;
199 } 205 }
200 if (info->control != intf) { 206 if (info->control != intf) {
@@ -271,11 +277,15 @@ next_desc:
271 /* Microsoft ActiveSync based and some regular RNDIS devices lack the 277 /* Microsoft ActiveSync based and some regular RNDIS devices lack the
272 * CDC descriptors, so we'll hard-wire the interfaces and not check 278 * CDC descriptors, so we'll hard-wire the interfaces and not check
273 * for descriptors. 279 * for descriptors.
280 *
281 * Some Android RNDIS devices have a CDC Union descriptor pointing
282 * to non-existing interfaces. Ignore that and attempt the same
283 * hard-wired 0 and 1 interfaces.
274 */ 284 */
275 if (rndis && !info->u) { 285 if (rndis && (!info->u || android_rndis_quirk)) {
276 info->control = usb_ifnum_to_if(dev->udev, 0); 286 info->control = usb_ifnum_to_if(dev->udev, 0);
277 info->data = usb_ifnum_to_if(dev->udev, 1); 287 info->data = usb_ifnum_to_if(dev->udev, 1);
278 if (!info->control || !info->data) { 288 if (!info->control || !info->data || info->control != intf) {
279 dev_dbg(&intf->dev, 289 dev_dbg(&intf->dev,
280 "rndis: master #0/%p slave #1/%p\n", 290 "rndis: master #0/%p slave #1/%p\n",
281 info->control, 291 info->control,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index deb6cfb2959a..600aca9fe6b1 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -373,7 +373,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah,
373 else 373 else
374 spur_subchannel_sd = 0; 374 spur_subchannel_sd = 0;
375 375
376 spur_freq_sd = (freq_offset << 9) / 11; 376 spur_freq_sd = ((freq_offset + 10) << 9) / 11;
377 377
378 } else { 378 } else {
379 if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, 379 if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL,
@@ -382,7 +382,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah,
382 else 382 else
383 spur_subchannel_sd = 1; 383 spur_subchannel_sd = 1;
384 384
385 spur_freq_sd = (freq_offset << 9) / 11; 385 spur_freq_sd = ((freq_offset - 10) << 9) / 11;
386 386
387 } 387 }
388 388
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index eb3829b03cd3..e2b34e1563f4 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -2637,6 +2637,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
2637 /* after stopping the bus, exit thread */ 2637 /* after stopping the bus, exit thread */
2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); 2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev);
2639 bus->dpc_tsk = NULL; 2639 bus->dpc_tsk = NULL;
2640 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2640 break; 2641 break;
2641 } 2642 }
2642 2643
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
index f4b84d1596e3..22474608a70b 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c
@@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
773 struct sk_buff *skb; 773 struct sk_buff *skb;
774 __le16 fc = hdr->frame_control; 774 __le16 fc = hdr->frame_control;
775 struct iwl_rxon_context *ctx; 775 struct iwl_rxon_context *ctx;
776 struct page *p; 776 unsigned int hdrlen, fraglen;
777 int offset;
778 777
779 /* We only process data packets if the interface is open */ 778 /* We only process data packets if the interface is open */
780 if (unlikely(!priv->is_open)) { 779 if (unlikely(!priv->is_open)) {
@@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv,
788 iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) 787 iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats))
789 return; 788 return;
790 789
791 skb = dev_alloc_skb(128); 790 /* Dont use dev_alloc_skb(), we'll have enough headroom once
791 * ieee80211_hdr pulled.
792 */
793 skb = alloc_skb(128, GFP_ATOMIC);
792 if (!skb) { 794 if (!skb) {
793 IWL_ERR(priv, "dev_alloc_skb failed\n"); 795 IWL_ERR(priv, "alloc_skb failed\n");
794 return; 796 return;
795 } 797 }
798 hdrlen = min_t(unsigned int, len, skb_tailroom(skb));
799 memcpy(skb_put(skb, hdrlen), hdr, hdrlen);
800 fraglen = len - hdrlen;
796 801
797 offset = (void *)hdr - rxb_addr(rxb); 802 if (fraglen) {
798 p = rxb_steal_page(rxb); 803 int offset = (void *)hdr + hdrlen - rxb_addr(rxb);
799 skb_add_rx_frag(skb, 0, p, offset, len, len);
800 804
805 skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset,
806 fraglen, rxb->truesize);
807 }
801 iwl_update_stats(priv, false, fc, len); 808 iwl_update_stats(priv, false, fc, len);
802 809
803 /* 810 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
index 8b1a7988e176..aa7aea168138 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c
@@ -374,8 +374,9 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans,
374 if (WARN_ON(!rxb)) 374 if (WARN_ON(!rxb))
375 return; 375 return;
376 376
377 rxcb.truesize = PAGE_SIZE << hw_params(trans).rx_page_order;
377 dma_unmap_page(trans->dev, rxb->page_dma, 378 dma_unmap_page(trans->dev, rxb->page_dma,
378 PAGE_SIZE << hw_params(trans).rx_page_order, 379 rxcb.truesize,
379 DMA_FROM_DEVICE); 380 DMA_FROM_DEVICE);
380 381
381 rxcb._page = rxb->page; 382 rxcb._page = rxb->page;
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index 0c81cbaa8088..fdf97886a5e4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -260,6 +260,7 @@ static inline void iwl_free_resp(struct iwl_host_cmd *cmd)
260 260
261struct iwl_rx_cmd_buffer { 261struct iwl_rx_cmd_buffer {
262 struct page *_page; 262 struct page *_page;
263 unsigned int truesize;
263}; 264};
264 265
265static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) 266static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r)
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c
index 8644d5372e7f..42cfcd9eb9aa 100644
--- a/drivers/parisc/sba_iommu.c
+++ b/drivers/parisc/sba_iommu.c
@@ -44,6 +44,7 @@
44#include <asm/ropes.h> 44#include <asm/ropes.h>
45#include <asm/mckinley.h> /* for proc_mckinley_root */ 45#include <asm/mckinley.h> /* for proc_mckinley_root */
46#include <asm/runway.h> /* for proc_runway_root */ 46#include <asm/runway.h> /* for proc_runway_root */
47#include <asm/page.h> /* for PAGE0 */
47#include <asm/pdc.h> /* for PDC_MODEL_* */ 48#include <asm/pdc.h> /* for PDC_MODEL_* */
48#include <asm/pdcpat.h> /* for is_pdc_pat() */ 49#include <asm/pdcpat.h> /* for is_pdc_pat() */
49#include <asm/parisc-device.h> 50#include <asm/parisc-device.h>
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index e70dd382a009..046fb1bd8619 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator)
1431 1431
1432 rc = devres_destroy(regulator->dev, devm_regulator_release, 1432 rc = devres_destroy(regulator->dev, devm_regulator_release,
1433 devm_regulator_match, regulator); 1433 devm_regulator_match, regulator);
1434 WARN_ON(rc); 1434 if (rc == 0)
1435 regulator_put(regulator);
1436 else
1437 WARN_ON(rc);
1435} 1438}
1436EXPORT_SYMBOL_GPL(devm_regulator_put); 1439EXPORT_SYMBOL_GPL(devm_regulator_put);
1437 1440
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index 96579296f04d..17a58c56eebf 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -684,7 +684,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
684 } 684 }
685 685
686 new_val++; 686 new_val++;
687 } while (desc->min + desc->step + new_val <= desc->max); 687 } while (desc->min + desc->step * new_val <= desc->max);
688 688
689 new_idx = tmp_idx; 689 new_idx = tmp_idx;
690 new_val = tmp_val; 690 new_val = tmp_val;
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c
index 351dc0b86fab..a3a056a9db67 100644
--- a/drivers/scsi/hosts.c
+++ b/drivers/scsi/hosts.c
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev,
218 218
219 if (!shost->shost_gendev.parent) 219 if (!shost->shost_gendev.parent)
220 shost->shost_gendev.parent = dev ? dev : &platform_bus; 220 shost->shost_gendev.parent = dev ? dev : &platform_bus;
221 if (!dma_dev)
222 dma_dev = shost->shost_gendev.parent;
223
221 shost->dma_dev = dma_dev; 224 shost->dma_dev = dma_dev;
222 225
223 error = device_add(&shost->shost_gendev); 226 error = device_add(&shost->shost_gendev);
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c
index f74cc0602f3b..bc3cc6d91117 100644
--- a/drivers/scsi/qla2xxx/qla_bsg.c
+++ b/drivers/scsi/qla2xxx/qla_bsg.c
@@ -1367,6 +1367,9 @@ qla2x00_read_optrom(struct fc_bsg_job *bsg_job)
1367 struct qla_hw_data *ha = vha->hw; 1367 struct qla_hw_data *ha = vha->hw;
1368 int rval = 0; 1368 int rval = 0;
1369 1369
1370 if (ha->flags.isp82xx_reset_hdlr_active)
1371 return -EBUSY;
1372
1370 rval = qla2x00_optrom_setup(bsg_job, vha, 0); 1373 rval = qla2x00_optrom_setup(bsg_job, vha, 0);
1371 if (rval) 1374 if (rval)
1372 return rval; 1375 return rval;
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index 897731b93df2..62324a1d5573 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -15,7 +15,7 @@
15 * | Mailbox commands | 0x113e | 0x112c-0x112e | 15 * | Mailbox commands | 0x113e | 0x112c-0x112e |
16 * | | | 0x113a | 16 * | | | 0x113a |
17 * | Device Discovery | 0x2086 | 0x2020-0x2022 | 17 * | Device Discovery | 0x2086 | 0x2020-0x2022 |
18 * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | 18 * | Queue Command and IO tracing | 0x3030 | 0x3006,0x3008 |
19 * | | | 0x302d-0x302e | 19 * | | | 0x302d-0x302e |
20 * | DPC Thread | 0x401c | | 20 * | DPC Thread | 0x401c | |
21 * | Async Events | 0x505d | 0x502b-0x502f | 21 * | Async Events | 0x505d | 0x502b-0x502f |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index f79844ce7122..ce42288049b5 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -1715,13 +1715,24 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt)
1715 res = DID_ERROR << 16; 1715 res = DID_ERROR << 16;
1716 break; 1716 break;
1717 } 1717 }
1718 } else { 1718 } else if (lscsi_status != SAM_STAT_TASK_SET_FULL &&
1719 lscsi_status != SAM_STAT_BUSY) {
1720 /*
1721 * scsi status of task set and busy are considered to be
1722 * task not completed.
1723 */
1724
1719 ql_dbg(ql_dbg_io, fcport->vha, 0x301f, 1725 ql_dbg(ql_dbg_io, fcport->vha, 0x301f,
1720 "Dropped frame(s) detected (0x%x " 1726 "Dropped frame(s) detected (0x%x "
1721 "of 0x%x bytes).\n", resid, scsi_bufflen(cp)); 1727 "of 0x%x bytes).\n", resid,
1728 scsi_bufflen(cp));
1722 1729
1723 res = DID_ERROR << 16 | lscsi_status; 1730 res = DID_ERROR << 16 | lscsi_status;
1724 goto check_scsi_status; 1731 goto check_scsi_status;
1732 } else {
1733 ql_dbg(ql_dbg_io, fcport->vha, 0x3030,
1734 "scsi_status: 0x%x, lscsi_status: 0x%x\n",
1735 scsi_status, lscsi_status);
1725 } 1736 }
1726 1737
1727 res = DID_OK << 16 | lscsi_status; 1738 res = DID_OK << 16 | lscsi_status;
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
index f0528539bbbc..de722a933438 100644
--- a/drivers/scsi/qla2xxx/qla_nx.c
+++ b/drivers/scsi/qla2xxx/qla_nx.c
@@ -3125,6 +3125,7 @@ qla82xx_need_reset_handler(scsi_qla_host_t *vha)
3125 ql_log(ql_log_info, vha, 0x00b7, 3125 ql_log(ql_log_info, vha, 0x00b7,
3126 "HW State: COLD/RE-INIT.\n"); 3126 "HW State: COLD/RE-INIT.\n");
3127 qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); 3127 qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD);
3128 qla82xx_set_rst_ready(ha);
3128 if (ql2xmdenable) { 3129 if (ql2xmdenable) {
3129 if (qla82xx_md_collect(vha)) 3130 if (qla82xx_md_collect(vha))
3130 ql_log(ql_log_warn, vha, 0xb02c, 3131 ql_log(ql_log_warn, vha, 0xb02c,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index a2f999273a5f..7db803377c64 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -3577,9 +3577,25 @@ void qla2x00_relogin(struct scsi_qla_host *vha)
3577 continue; 3577 continue;
3578 /* Attempt a retry. */ 3578 /* Attempt a retry. */
3579 status = 1; 3579 status = 1;
3580 } else 3580 } else {
3581 status = qla2x00_fabric_login(vha, 3581 status = qla2x00_fabric_login(vha,
3582 fcport, &next_loopid); 3582 fcport, &next_loopid);
3583 if (status == QLA_SUCCESS) {
3584 int status2;
3585 uint8_t opts;
3586
3587 opts = 0;
3588 if (fcport->flags &
3589 FCF_FCP2_DEVICE)
3590 opts |= BIT_1;
3591 status2 =
3592 qla2x00_get_port_database(
3593 vha, fcport,
3594 opts);
3595 if (status2 != QLA_SUCCESS)
3596 status = 1;
3597 }
3598 }
3583 } else 3599 } else
3584 status = qla2x00_local_device_login(vha, 3600 status = qla2x00_local_device_login(vha,
3585 fcport); 3601 fcport);
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 3c13c0a6be63..a683e766d1ae 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -1017,6 +1017,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha)
1017 !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) 1017 !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha))
1018 return; 1018 return;
1019 1019
1020 if (ha->flags.isp82xx_reset_hdlr_active)
1021 return;
1022
1020 ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, 1023 ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr,
1021 ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); 1024 ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header));
1022 if (hdr.version == __constant_cpu_to_le16(0xffff)) 1025 if (hdr.version == __constant_cpu_to_le16(0xffff))
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index 29d780c38040..f5fdb16bec9b 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,9 +7,9 @@
7/* 7/*
8 * Driver version 8 * Driver version
9 */ 9 */
10#define QLA2XXX_VERSION "8.03.07.13-k" 10#define QLA2XXX_VERSION "8.04.00.03-k"
11 11
12#define QLA_DRIVER_MAJOR_VER 8 12#define QLA_DRIVER_MAJOR_VER 8
13#define QLA_DRIVER_MINOR_VER 3 13#define QLA_DRIVER_MINOR_VER 4
14#define QLA_DRIVER_PATCH_VER 7 14#define QLA_DRIVER_PATCH_VER 0
15#define QLA_DRIVER_BETA_VER 3 15#define QLA_DRIVER_BETA_VER 3
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c
index efccd72c4a3e..1b3843117268 100644
--- a/drivers/scsi/virtio_scsi.c
+++ b/drivers/scsi/virtio_scsi.c
@@ -175,7 +175,8 @@ static void virtscsi_complete_free(void *buf)
175 175
176 if (cmd->comp) 176 if (cmd->comp)
177 complete_all(cmd->comp); 177 complete_all(cmd->comp);
178 mempool_free(cmd, virtscsi_cmd_pool); 178 else
179 mempool_free(cmd, virtscsi_cmd_pool);
179} 180}
180 181
181static void virtscsi_ctrl_done(struct virtqueue *vq) 182static void virtscsi_ctrl_done(struct virtqueue *vq)
@@ -311,21 +312,22 @@ out:
311static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) 312static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd)
312{ 313{
313 DECLARE_COMPLETION_ONSTACK(comp); 314 DECLARE_COMPLETION_ONSTACK(comp);
314 int ret; 315 int ret = FAILED;
315 316
316 cmd->comp = &comp; 317 cmd->comp = &comp;
317 ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, 318 if (virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd,
318 sizeof cmd->req.tmf, sizeof cmd->resp.tmf, 319 sizeof cmd->req.tmf, sizeof cmd->resp.tmf,
319 GFP_NOIO); 320 GFP_NOIO) < 0)
320 if (ret < 0) 321 goto out;
321 return FAILED;
322 322
323 wait_for_completion(&comp); 323 wait_for_completion(&comp);
324 if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK && 324 if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK ||
325 cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) 325 cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED)
326 return FAILED; 326 ret = SUCCESS;
327 327
328 return SUCCESS; 328out:
329 mempool_free(cmd, virtscsi_cmd_pool);
330 return ret;
329} 331}
330 332
331static int virtscsi_device_reset(struct scsi_cmnd *sc) 333static int virtscsi_device_reset(struct scsi_cmnd *sc)
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c
index 70c3ffb981e7..e320ec24aa1b 100644
--- a/drivers/target/target_core_tpg.c
+++ b/drivers/target/target_core_tpg.c
@@ -60,7 +60,6 @@ static void core_clear_initiator_node_from_tpg(
60 int i; 60 int i;
61 struct se_dev_entry *deve; 61 struct se_dev_entry *deve;
62 struct se_lun *lun; 62 struct se_lun *lun;
63 struct se_lun_acl *acl, *acl_tmp;
64 63
65 spin_lock_irq(&nacl->device_list_lock); 64 spin_lock_irq(&nacl->device_list_lock);
66 for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { 65 for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) {
@@ -81,28 +80,7 @@ static void core_clear_initiator_node_from_tpg(
81 core_update_device_list_for_node(lun, NULL, deve->mapped_lun, 80 core_update_device_list_for_node(lun, NULL, deve->mapped_lun,
82 TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); 81 TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0);
83 82
84 spin_lock(&lun->lun_acl_lock);
85 list_for_each_entry_safe(acl, acl_tmp,
86 &lun->lun_acl_list, lacl_list) {
87 if (!strcmp(acl->initiatorname, nacl->initiatorname) &&
88 (acl->mapped_lun == deve->mapped_lun))
89 break;
90 }
91
92 if (!acl) {
93 pr_err("Unable to locate struct se_lun_acl for %s,"
94 " mapped_lun: %u\n", nacl->initiatorname,
95 deve->mapped_lun);
96 spin_unlock(&lun->lun_acl_lock);
97 spin_lock_irq(&nacl->device_list_lock);
98 continue;
99 }
100
101 list_del(&acl->lacl_list);
102 spin_unlock(&lun->lun_acl_lock);
103
104 spin_lock_irq(&nacl->device_list_lock); 83 spin_lock_irq(&nacl->device_list_lock);
105 kfree(acl);
106 } 84 }
107 spin_unlock_irq(&nacl->device_list_lock); 85 spin_unlock_irq(&nacl->device_list_lock);
108} 86}
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 1f21d2a1e528..5c170100de9c 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -24,6 +24,7 @@
24#include <linux/if_arp.h> 24#include <linux/if_arp.h>
25#include <linux/if_tun.h> 25#include <linux/if_tun.h>
26#include <linux/if_macvlan.h> 26#include <linux/if_macvlan.h>
27#include <linux/if_vlan.h>
27 28
28#include <net/sock.h> 29#include <net/sock.h>
29 30
@@ -283,8 +284,12 @@ static int peek_head_len(struct sock *sk)
283 284
284 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); 285 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags);
285 head = skb_peek(&sk->sk_receive_queue); 286 head = skb_peek(&sk->sk_receive_queue);
286 if (likely(head)) 287 if (likely(head)) {
287 len = head->len; 288 len = head->len;
289 if (vlan_tx_tag_present(head))
290 len += VLAN_HLEN;
291 }
292
288 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); 293 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags);
289 return len; 294 return len;
290} 295}
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c
index 6468a297e341..39571f9e0162 100644
--- a/drivers/video/console/sticore.c
+++ b/drivers/video/console/sticore.c
@@ -22,7 +22,9 @@
22#include <linux/font.h> 22#include <linux/font.h>
23 23
24#include <asm/hardware.h> 24#include <asm/hardware.h>
25#include <asm/page.h>
25#include <asm/parisc-device.h> 26#include <asm/parisc-device.h>
27#include <asm/pdc.h>
26#include <asm/cacheflush.h> 28#include <asm/cacheflush.h>
27#include <asm/grfioctl.h> 29#include <asm/grfioctl.h>
28 30
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c
index 26e83d7fdd6f..b0e2a4261afe 100644
--- a/drivers/video/uvesafb.c
+++ b/drivers/video/uvesafb.c
@@ -73,7 +73,7 @@ static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *ns
73 struct uvesafb_task *utask; 73 struct uvesafb_task *utask;
74 struct uvesafb_ktask *task; 74 struct uvesafb_ktask *task;
75 75
76 if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) 76 if (!capable(CAP_SYS_ADMIN))
77 return; 77 return;
78 78
79 if (msg->seq >= UVESAFB_TASKS_MAX) 79 if (msg->seq >= UVESAFB_TASKS_MAX)
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c
index cb4529c40d74..b7f5173ff9e9 100644
--- a/drivers/video/xen-fbfront.c
+++ b/drivers/video/xen-fbfront.c
@@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
365 struct fb_info *fb_info; 365 struct fb_info *fb_info;
366 int fb_size; 366 int fb_size;
367 int val; 367 int val;
368 int ret; 368 int ret = 0;
369 369
370 info = kzalloc(sizeof(*info), GFP_KERNEL); 370 info = kzalloc(sizeof(*info), GFP_KERNEL);
371 if (info == NULL) { 371 if (info == NULL) {
@@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev,
458 xenfb_init_shared_page(info, fb_info); 458 xenfb_init_shared_page(info, fb_info);
459 459
460 ret = xenfb_connect_backend(dev, info); 460 ret = xenfb_connect_backend(dev, info);
461 if (ret < 0) 461 if (ret < 0) {
462 goto error; 462 xenbus_dev_fatal(dev, ret, "xenfb_connect_backend");
463 goto error_fb;
464 }
463 465
464 ret = register_framebuffer(fb_info); 466 ret = register_framebuffer(fb_info);
465 if (ret) { 467 if (ret) {
466 fb_deferred_io_cleanup(fb_info);
467 fb_dealloc_cmap(&fb_info->cmap);
468 framebuffer_release(fb_info);
469 xenbus_dev_fatal(dev, ret, "register_framebuffer"); 468 xenbus_dev_fatal(dev, ret, "register_framebuffer");
470 goto error; 469 goto error_fb;
471 } 470 }
472 info->fb_info = fb_info; 471 info->fb_info = fb_info;
473 472
474 xenfb_make_preferred_console(); 473 xenfb_make_preferred_console();
475 return 0; 474 return 0;
476 475
477 error_nomem: 476error_fb:
478 ret = -ENOMEM; 477 fb_deferred_io_cleanup(fb_info);
479 xenbus_dev_fatal(dev, ret, "allocating device memory"); 478 fb_dealloc_cmap(&fb_info->cmap);
480 error: 479 framebuffer_release(fb_info);
480error_nomem:
481 if (!ret) {
482 ret = -ENOMEM;
483 xenbus_dev_fatal(dev, ret, "allocating device memory");
484 }
485error:
481 xenfb_remove(dev); 486 xenfb_remove(dev);
482 return ret; 487 return ret;
483} 488}
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig
index 94243136f6bf..ea20c51d24c7 100644
--- a/drivers/xen/Kconfig
+++ b/drivers/xen/Kconfig
@@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR
183 depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ 183 depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ
184 default m 184 default m
185 help 185 help
186 This ACPI processor uploads Power Management information to the Xen hypervisor. 186 This ACPI processor uploads Power Management information to the Xen
187 187 hypervisor.
188 To do that the driver parses the Power Management data and uploads said 188
189 information to the Xen hypervisor. Then the Xen hypervisor can select the 189 To do that the driver parses the Power Management data and uploads
190 proper Cx and Pxx states. It also registers itslef as the SMM so that 190 said information to the Xen hypervisor. Then the Xen hypervisor can
191 other drivers (such as ACPI cpufreq scaling driver) will not load. 191 select the proper Cx and Pxx states. It also registers itslef as the
192 192 SMM so that other drivers (such as ACPI cpufreq scaling driver) will
193 To compile this driver as a module, choose M here: the 193 not load.
194 module will be called xen_acpi_processor If you do not know what to choose, 194
195 select M here. If the CPUFREQ drivers are built in, select Y here. 195 To compile this driver as a module, choose M here: the module will be
196 called xen_acpi_processor If you do not know what to choose, select
197 M here. If the CPUFREQ drivers are built in, select Y here.
196 198
197endmenu 199endmenu
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index ca6a3796a33b..541ef81f6ae8 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -699,7 +699,7 @@ static loff_t cifs_llseek(struct file *file, loff_t offset, int origin)
699 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate 699 * origin == SEEK_END || SEEK_DATA || SEEK_HOLE => we must revalidate
700 * the cached file length 700 * the cached file length
701 */ 701 */
702 if (origin != SEEK_SET || origin != SEEK_CUR) { 702 if (origin != SEEK_SET && origin != SEEK_CUR) {
703 int rc; 703 int rc;
704 struct inode *inode = file->f_path.dentry->d_inode; 704 struct inode *inode = file->f_path.dentry->d_inode;
705 705
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 2d60492d6df8..1030a716d155 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -747,6 +747,8 @@ static void pte_to_pagemap_entry(pagemap_entry_t *pme, pte_t pte)
747 else if (pte_present(pte)) 747 else if (pte_present(pte))
748 *pme = make_pme(PM_PFRAME(pte_pfn(pte)) 748 *pme = make_pme(PM_PFRAME(pte_pfn(pte))
749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 749 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
750 else
751 *pme = make_pme(PM_NOT_PRESENT);
750} 752}
751 753
752#ifdef CONFIG_TRANSPARENT_HUGEPAGE 754#ifdef CONFIG_TRANSPARENT_HUGEPAGE
@@ -761,6 +763,8 @@ static void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
761 if (pmd_present(pmd)) 763 if (pmd_present(pmd))
762 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset) 764 *pme = make_pme(PM_PFRAME(pmd_pfn(pmd) + offset)
763 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 765 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
766 else
767 *pme = make_pme(PM_NOT_PRESENT);
764} 768}
765#else 769#else
766static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme, 770static inline void thp_pmd_to_pagemap_entry(pagemap_entry_t *pme,
@@ -801,8 +805,10 @@ static int pagemap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end,
801 805
802 /* check to see if we've left 'vma' behind 806 /* check to see if we've left 'vma' behind
803 * and need a new, higher one */ 807 * and need a new, higher one */
804 if (vma && (addr >= vma->vm_end)) 808 if (vma && (addr >= vma->vm_end)) {
805 vma = find_vma(walk->mm, addr); 809 vma = find_vma(walk->mm, addr);
810 pme = make_pme(PM_NOT_PRESENT);
811 }
806 812
807 /* check that 'vma' actually covers this address, 813 /* check that 'vma' actually covers this address,
808 * and that it isn't a huge page vma */ 814 * and that it isn't a huge page vma */
@@ -830,6 +836,8 @@ static void huge_pte_to_pagemap_entry(pagemap_entry_t *pme,
830 if (pte_present(pte)) 836 if (pte_present(pte))
831 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset) 837 *pme = make_pme(PM_PFRAME(pte_pfn(pte) + offset)
832 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT); 838 | PM_PSHIFT(PAGE_SHIFT) | PM_PRESENT);
839 else
840 *pme = make_pme(PM_NOT_PRESENT);
833} 841}
834 842
835/* This function walks within one hugetlb entry in the single call */ 843/* This function walks within one hugetlb entry in the single call */
@@ -839,7 +847,7 @@ static int pagemap_hugetlb_range(pte_t *pte, unsigned long hmask,
839{ 847{
840 struct pagemapread *pm = walk->private; 848 struct pagemapread *pm = walk->private;
841 int err = 0; 849 int err = 0;
842 pagemap_entry_t pme = make_pme(PM_NOT_PRESENT); 850 pagemap_entry_t pme;
843 851
844 for (; addr != end; addr += PAGE_SIZE) { 852 for (; addr != end; addr += PAGE_SIZE) {
845 int offset = (addr & ~hmask) >> PAGE_SHIFT; 853 int offset = (addr & ~hmask) >> PAGE_SHIFT;
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 8a1835855faa..fe5136d81454 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -159,7 +159,8 @@ static inline void eth_hw_addr_random(struct net_device *dev)
159 * @addr1: Pointer to a six-byte array containing the Ethernet address 159 * @addr1: Pointer to a six-byte array containing the Ethernet address
160 * @addr2: Pointer other six-byte array containing the Ethernet address 160 * @addr2: Pointer other six-byte array containing the Ethernet address
161 * 161 *
162 * Compare two ethernet addresses, returns 0 if equal 162 * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
163 * Unlike memcmp(), it doesn't return a value suitable for sorting.
163 */ 164 */
164static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) 165static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2)
165{ 166{
@@ -184,10 +185,10 @@ static inline unsigned long zap_last_2bytes(unsigned long value)
184 * @addr1: Pointer to an array of 8 bytes 185 * @addr1: Pointer to an array of 8 bytes
185 * @addr2: Pointer to an other array of 8 bytes 186 * @addr2: Pointer to an other array of 8 bytes
186 * 187 *
187 * Compare two ethernet addresses, returns 0 if equal. 188 * Compare two ethernet addresses, returns 0 if equal, non-zero otherwise.
188 * Same result than "memcmp(addr1, addr2, ETH_ALEN)" but without conditional 189 * Unlike memcmp(), it doesn't return a value suitable for sorting.
189 * branches, and possibly long word memory accesses on CPU allowing cheap 190 * The function doesn't need any conditional branches and possibly uses
190 * unaligned memory reads. 191 * word memory accesses on CPU allowing cheap unaligned memory reads.
191 * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2} 192 * arrays = { byte1, byte2, byte3, byte4, byte6, byte7, pad1, pad2}
192 * 193 *
193 * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits. 194 * Please note that alignment of addr1 & addr2 is only guaranted to be 16 bits.
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 5cbaa20f1659..33900a53c990 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1403,15 +1403,6 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev)
1403 return 0; 1403 return 0;
1404} 1404}
1405 1405
1406#ifndef CONFIG_NET_NS
1407static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1408{
1409 skb->dev = dev;
1410}
1411#else /* CONFIG_NET_NS */
1412void skb_set_dev(struct sk_buff *skb, struct net_device *dev);
1413#endif
1414
1415static inline bool netdev_uses_trailer_tags(struct net_device *dev) 1406static inline bool netdev_uses_trailer_tags(struct net_device *dev)
1416{ 1407{
1417#ifdef CONFIG_NET_DSA_TAG_TRAILER 1408#ifdef CONFIG_NET_DSA_TAG_TRAILER
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 6ee44b24864a..a2ef81466b00 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -704,4 +704,17 @@ static inline void sctp_v4_map_v6(union sctp_addr *addr)
704 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff); 704 addr->v6.sin6_addr.s6_addr32[2] = htonl(0x0000ffff);
705} 705}
706 706
707/* The cookie is always 0 since this is how it's used in the
708 * pmtu code.
709 */
710static inline struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
711{
712 if (t->dst && !dst_check(t->dst, 0)) {
713 dst_release(t->dst);
714 t->dst = NULL;
715 }
716
717 return t->dst;
718}
719
707#endif /* __net_sctp_h__ */ 720#endif /* __net_sctp_h__ */
diff --git a/kernel/compat.c b/kernel/compat.c
index 74ff8498809a..d2c67aa49ae6 100644
--- a/kernel/compat.c
+++ b/kernel/compat.c
@@ -372,25 +372,54 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
372 372
373#ifdef __ARCH_WANT_SYS_SIGPROCMASK 373#ifdef __ARCH_WANT_SYS_SIGPROCMASK
374 374
375asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set, 375/*
376 compat_old_sigset_t __user *oset) 376 * sys_sigprocmask SIG_SETMASK sets the first (compat) word of the
377 * blocked set of signals to the supplied signal set
378 */
379static inline void compat_sig_setmask(sigset_t *blocked, compat_sigset_word set)
377{ 380{
378 old_sigset_t s; 381 memcpy(blocked->sig, &set, sizeof(set));
379 long ret; 382}
380 mm_segment_t old_fs;
381 383
382 if (set && get_user(s, set)) 384asmlinkage long compat_sys_sigprocmask(int how,
383 return -EFAULT; 385 compat_old_sigset_t __user *nset,
384 old_fs = get_fs(); 386 compat_old_sigset_t __user *oset)
385 set_fs(KERNEL_DS); 387{
386 ret = sys_sigprocmask(how, 388 old_sigset_t old_set, new_set;
387 set ? (old_sigset_t __user *) &s : NULL, 389 sigset_t new_blocked;
388 oset ? (old_sigset_t __user *) &s : NULL); 390
389 set_fs(old_fs); 391 old_set = current->blocked.sig[0];
390 if (ret == 0) 392
391 if (oset) 393 if (nset) {
392 ret = put_user(s, oset); 394 if (get_user(new_set, nset))
393 return ret; 395 return -EFAULT;
396 new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
397
398 new_blocked = current->blocked;
399
400 switch (how) {
401 case SIG_BLOCK:
402 sigaddsetmask(&new_blocked, new_set);
403 break;
404 case SIG_UNBLOCK:
405 sigdelsetmask(&new_blocked, new_set);
406 break;
407 case SIG_SETMASK:
408 compat_sig_setmask(&new_blocked, new_set);
409 break;
410 default:
411 return -EINVAL;
412 }
413
414 set_current_blocked(&new_blocked);
415 }
416
417 if (oset) {
418 if (put_user(old_set, oset))
419 return -EFAULT;
420 }
421
422 return 0;
394} 423}
395 424
396#endif 425#endif
diff --git a/kernel/fork.c b/kernel/fork.c
index b9372a0bff18..687a15d56243 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -47,6 +47,7 @@
47#include <linux/audit.h> 47#include <linux/audit.h>
48#include <linux/memcontrol.h> 48#include <linux/memcontrol.h>
49#include <linux/ftrace.h> 49#include <linux/ftrace.h>
50#include <linux/proc_fs.h>
50#include <linux/profile.h> 51#include <linux/profile.h>
51#include <linux/rmap.h> 52#include <linux/rmap.h>
52#include <linux/ksm.h> 53#include <linux/ksm.h>
@@ -1464,6 +1465,8 @@ bad_fork_cleanup_io:
1464 if (p->io_context) 1465 if (p->io_context)
1465 exit_io_context(p); 1466 exit_io_context(p);
1466bad_fork_cleanup_namespaces: 1467bad_fork_cleanup_namespaces:
1468 if (unlikely(clone_flags & CLONE_NEWPID))
1469 pid_ns_release_proc(p->nsproxy->pid_ns);
1467 exit_task_namespaces(p); 1470 exit_task_namespaces(p);
1468bad_fork_cleanup_mm: 1471bad_fork_cleanup_mm:
1469 if (p->mm) 1472 if (p->mm)
diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 5a16423a512c..ae8f708e3d75 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -2498,7 +2498,6 @@ retry_avoidcopy:
2498 if (outside_reserve) { 2498 if (outside_reserve) {
2499 BUG_ON(huge_pte_none(pte)); 2499 BUG_ON(huge_pte_none(pte));
2500 if (unmap_ref_private(mm, vma, old_page, address)) { 2500 if (unmap_ref_private(mm, vma, old_page, address)) {
2501 BUG_ON(page_count(old_page) != 1);
2502 BUG_ON(huge_pte_none(pte)); 2501 BUG_ON(huge_pte_none(pte));
2503 spin_lock(&mm->page_table_lock); 2502 spin_lock(&mm->page_table_lock);
2504 ptep = huge_pte_offset(mm, address & huge_page_mask(h)); 2503 ptep = huge_pte_offset(mm, address & huge_page_mask(h));
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 31ab9c3f0178..b659260c56ad 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4507,6 +4507,12 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
4507swap_buffers: 4507swap_buffers:
4508 /* Swap primary and spare array */ 4508 /* Swap primary and spare array */
4509 thresholds->spare = thresholds->primary; 4509 thresholds->spare = thresholds->primary;
4510 /* If all events are unregistered, free the spare array */
4511 if (!new) {
4512 kfree(thresholds->spare);
4513 thresholds->spare = NULL;
4514 }
4515
4510 rcu_assign_pointer(thresholds->primary, new); 4516 rcu_assign_pointer(thresholds->primary, new);
4511 4517
4512 /* To be sure that nobody uses thresholds */ 4518 /* To be sure that nobody uses thresholds */
diff --git a/mm/nobootmem.c b/mm/nobootmem.c
index e53bb8a256b1..1983fb1c7026 100644
--- a/mm/nobootmem.c
+++ b/mm/nobootmem.c
@@ -82,8 +82,7 @@ void __init free_bootmem_late(unsigned long addr, unsigned long size)
82 82
83static void __init __free_pages_memory(unsigned long start, unsigned long end) 83static void __init __free_pages_memory(unsigned long start, unsigned long end)
84{ 84{
85 int i; 85 unsigned long i, start_aligned, end_aligned;
86 unsigned long start_aligned, end_aligned;
87 int order = ilog2(BITS_PER_LONG); 86 int order = ilog2(BITS_PER_LONG);
88 87
89 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1); 88 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index a712fb9e04ce..918330f71dba 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -5203,7 +5203,7 @@ int percpu_pagelist_fraction_sysctl_handler(ctl_table *table, int write,
5203 int ret; 5203 int ret;
5204 5204
5205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos); 5205 ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
5206 if (!write || (ret == -EINVAL)) 5206 if (!write || (ret < 0))
5207 return ret; 5207 return ret;
5208 for_each_populated_zone(zone) { 5208 for_each_populated_zone(zone) {
5209 for_each_possible_cpu(cpu) { 5209 for_each_possible_cpu(cpu) {
diff --git a/mm/percpu.c b/mm/percpu.c
index f47af9123af7..bb4be7435ce3 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -1132,20 +1132,20 @@ static void pcpu_dump_alloc_info(const char *lvl,
1132 for (alloc_end += gi->nr_units / upa; 1132 for (alloc_end += gi->nr_units / upa;
1133 alloc < alloc_end; alloc++) { 1133 alloc < alloc_end; alloc++) {
1134 if (!(alloc % apl)) { 1134 if (!(alloc % apl)) {
1135 printk("\n"); 1135 printk(KERN_CONT "\n");
1136 printk("%spcpu-alloc: ", lvl); 1136 printk("%spcpu-alloc: ", lvl);
1137 } 1137 }
1138 printk("[%0*d] ", group_width, group); 1138 printk(KERN_CONT "[%0*d] ", group_width, group);
1139 1139
1140 for (unit_end += upa; unit < unit_end; unit++) 1140 for (unit_end += upa; unit < unit_end; unit++)
1141 if (gi->cpu_map[unit] != NR_CPUS) 1141 if (gi->cpu_map[unit] != NR_CPUS)
1142 printk("%0*d ", cpu_width, 1142 printk(KERN_CONT "%0*d ", cpu_width,
1143 gi->cpu_map[unit]); 1143 gi->cpu_map[unit]);
1144 else 1144 else
1145 printk("%s ", empty_str); 1145 printk(KERN_CONT "%s ", empty_str);
1146 } 1146 }
1147 } 1147 }
1148 printk("\n"); 1148 printk(KERN_CONT "\n");
1149} 1149}
1150 1150
1151/** 1151/**
@@ -1650,6 +1650,16 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
1650 areas[group] = ptr; 1650 areas[group] = ptr;
1651 1651
1652 base = min(ptr, base); 1652 base = min(ptr, base);
1653 }
1654
1655 /*
1656 * Copy data and free unused parts. This should happen after all
1657 * allocations are complete; otherwise, we may end up with
1658 * overlapping groups.
1659 */
1660 for (group = 0; group < ai->nr_groups; group++) {
1661 struct pcpu_group_info *gi = &ai->groups[group];
1662 void *ptr = areas[group];
1653 1663
1654 for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) { 1664 for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) {
1655 if (gi->cpu_map[i] == NR_CPUS) { 1665 if (gi->cpu_map[i] == NR_CPUS) {
@@ -1885,6 +1895,8 @@ void __init setup_per_cpu_areas(void)
1885 fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)); 1895 fc = __alloc_bootmem(unit_size, PAGE_SIZE, __pa(MAX_DMA_ADDRESS));
1886 if (!ai || !fc) 1896 if (!ai || !fc)
1887 panic("Failed to allocate memory for percpu areas."); 1897 panic("Failed to allocate memory for percpu areas.");
1898 /* kmemleak tracks the percpu allocations separately */
1899 kmemleak_free(fc);
1888 1900
1889 ai->dyn_size = unit_size; 1901 ai->dyn_size = unit_size;
1890 ai->unit_size = unit_size; 1902 ai->unit_size = unit_size;
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index 9988d4abb372..9757c193c86b 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -157,7 +157,7 @@ static netdev_tx_t vlan_dev_hard_start_xmit(struct sk_buff *skb,
157 skb = __vlan_hwaccel_put_tag(skb, vlan_tci); 157 skb = __vlan_hwaccel_put_tag(skb, vlan_tci);
158 } 158 }
159 159
160 skb_set_dev(skb, vlan_dev_priv(dev)->real_dev); 160 skb->dev = vlan_dev_priv(dev)->real_dev;
161 len = skb->len; 161 len = skb->len;
162 if (netpoll_tx_running(dev)) 162 if (netpoll_tx_running(dev))
163 return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev); 163 return skb->dev->netdev_ops->ndo_start_xmit(skb, skb->dev);
diff --git a/net/core/dev.c b/net/core/dev.c
index 9bb8f87c4cda..99e1d759f41e 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1617,10 +1617,14 @@ int dev_forward_skb(struct net_device *dev, struct sk_buff *skb)
1617 return NET_RX_DROP; 1617 return NET_RX_DROP;
1618 } 1618 }
1619 skb->skb_iif = 0; 1619 skb->skb_iif = 0;
1620 skb_set_dev(skb, dev); 1620 skb->dev = dev;
1621 skb_dst_drop(skb);
1621 skb->tstamp.tv64 = 0; 1622 skb->tstamp.tv64 = 0;
1622 skb->pkt_type = PACKET_HOST; 1623 skb->pkt_type = PACKET_HOST;
1623 skb->protocol = eth_type_trans(skb, dev); 1624 skb->protocol = eth_type_trans(skb, dev);
1625 skb->mark = 0;
1626 secpath_reset(skb);
1627 nf_reset(skb);
1624 return netif_rx(skb); 1628 return netif_rx(skb);
1625} 1629}
1626EXPORT_SYMBOL_GPL(dev_forward_skb); 1630EXPORT_SYMBOL_GPL(dev_forward_skb);
@@ -1869,36 +1873,6 @@ void netif_device_attach(struct net_device *dev)
1869} 1873}
1870EXPORT_SYMBOL(netif_device_attach); 1874EXPORT_SYMBOL(netif_device_attach);
1871 1875
1872/**
1873 * skb_dev_set -- assign a new device to a buffer
1874 * @skb: buffer for the new device
1875 * @dev: network device
1876 *
1877 * If an skb is owned by a device already, we have to reset
1878 * all data private to the namespace a device belongs to
1879 * before assigning it a new device.
1880 */
1881#ifdef CONFIG_NET_NS
1882void skb_set_dev(struct sk_buff *skb, struct net_device *dev)
1883{
1884 skb_dst_drop(skb);
1885 if (skb->dev && !net_eq(dev_net(skb->dev), dev_net(dev))) {
1886 secpath_reset(skb);
1887 nf_reset(skb);
1888 skb_init_secmark(skb);
1889 skb->mark = 0;
1890 skb->priority = 0;
1891 skb->nf_trace = 0;
1892 skb->ipvs_property = 0;
1893#ifdef CONFIG_NET_SCHED
1894 skb->tc_index = 0;
1895#endif
1896 }
1897 skb->dev = dev;
1898}
1899EXPORT_SYMBOL(skb_set_dev);
1900#endif /* CONFIG_NET_NS */
1901
1902static void skb_warn_bad_offload(const struct sk_buff *skb) 1876static void skb_warn_bad_offload(const struct sk_buff *skb)
1903{ 1877{
1904 static const netdev_features_t null_features = 0; 1878 static const netdev_features_t null_features = 0;
diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 4d8ce93cd503..77a59980b579 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -1931,7 +1931,7 @@ static int pktgen_device_event(struct notifier_block *unused,
1931{ 1931{
1932 struct net_device *dev = ptr; 1932 struct net_device *dev = ptr;
1933 1933
1934 if (!net_eq(dev_net(dev), &init_net)) 1934 if (!net_eq(dev_net(dev), &init_net) || pktgen_exiting)
1935 return NOTIFY_DONE; 1935 return NOTIFY_DONE;
1936 1936
1937 /* It is OK that we do not hold the group lock right now, 1937 /* It is OK that we do not hold the group lock right now,
@@ -3755,12 +3755,18 @@ static void __exit pg_cleanup(void)
3755{ 3755{
3756 struct pktgen_thread *t; 3756 struct pktgen_thread *t;
3757 struct list_head *q, *n; 3757 struct list_head *q, *n;
3758 struct list_head list;
3758 3759
3759 /* Stop all interfaces & threads */ 3760 /* Stop all interfaces & threads */
3760 pktgen_exiting = true; 3761 pktgen_exiting = true;
3761 3762
3762 list_for_each_safe(q, n, &pktgen_threads) { 3763 mutex_lock(&pktgen_thread_lock);
3764 list_splice(&list, &pktgen_threads);
3765 mutex_unlock(&pktgen_thread_lock);
3766
3767 list_for_each_safe(q, n, &list) {
3763 t = list_entry(q, struct pktgen_thread, th_list); 3768 t = list_entry(q, struct pktgen_thread, th_list);
3769 list_del(&t->th_list);
3764 kthread_stop(t->tsk); 3770 kthread_stop(t->tsk);
3765 kfree(t); 3771 kfree(t);
3766 } 3772 }
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index bce36f1a37b4..30b88d7b4bd6 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -1370,6 +1370,8 @@ static int check_leaf(struct fib_table *tb, struct trie *t, struct leaf *l,
1370 1370
1371 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos) 1371 if (fa->fa_tos && fa->fa_tos != flp->flowi4_tos)
1372 continue; 1372 continue;
1373 if (fi->fib_dead)
1374 continue;
1373 if (fa->fa_info->fib_scope < flp->flowi4_scope) 1375 if (fa->fa_info->fib_scope < flp->flowi4_scope)
1374 continue; 1376 continue;
1375 fib_alias_accessed(fa); 1377 fib_alias_accessed(fa);
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c
index e44e631ea952..777716bc80f7 100644
--- a/net/openvswitch/datapath.c
+++ b/net/openvswitch/datapath.c
@@ -421,6 +421,19 @@ static int validate_sample(const struct nlattr *attr,
421 return validate_actions(actions, key, depth + 1); 421 return validate_actions(actions, key, depth + 1);
422} 422}
423 423
424static int validate_tp_port(const struct sw_flow_key *flow_key)
425{
426 if (flow_key->eth.type == htons(ETH_P_IP)) {
427 if (flow_key->ipv4.tp.src && flow_key->ipv4.tp.dst)
428 return 0;
429 } else if (flow_key->eth.type == htons(ETH_P_IPV6)) {
430 if (flow_key->ipv6.tp.src && flow_key->ipv6.tp.dst)
431 return 0;
432 }
433
434 return -EINVAL;
435}
436
424static int validate_set(const struct nlattr *a, 437static int validate_set(const struct nlattr *a,
425 const struct sw_flow_key *flow_key) 438 const struct sw_flow_key *flow_key)
426{ 439{
@@ -462,18 +475,13 @@ static int validate_set(const struct nlattr *a,
462 if (flow_key->ip.proto != IPPROTO_TCP) 475 if (flow_key->ip.proto != IPPROTO_TCP)
463 return -EINVAL; 476 return -EINVAL;
464 477
465 if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) 478 return validate_tp_port(flow_key);
466 return -EINVAL;
467
468 break;
469 479
470 case OVS_KEY_ATTR_UDP: 480 case OVS_KEY_ATTR_UDP:
471 if (flow_key->ip.proto != IPPROTO_UDP) 481 if (flow_key->ip.proto != IPPROTO_UDP)
472 return -EINVAL; 482 return -EINVAL;
473 483
474 if (!flow_key->ipv4.tp.src || !flow_key->ipv4.tp.dst) 484 return validate_tp_port(flow_key);
475 return -EINVAL;
476 break;
477 485
478 default: 486 default:
479 return -EINVAL; 487 return -EINVAL;
@@ -1641,10 +1649,9 @@ static int ovs_vport_cmd_set(struct sk_buff *skb, struct genl_info *info)
1641 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq, 1649 reply = ovs_vport_cmd_build_info(vport, info->snd_pid, info->snd_seq,
1642 OVS_VPORT_CMD_NEW); 1650 OVS_VPORT_CMD_NEW);
1643 if (IS_ERR(reply)) { 1651 if (IS_ERR(reply)) {
1644 err = PTR_ERR(reply);
1645 netlink_set_err(init_net.genl_sock, 0, 1652 netlink_set_err(init_net.genl_sock, 0,
1646 ovs_dp_vport_multicast_group.id, err); 1653 ovs_dp_vport_multicast_group.id, PTR_ERR(reply));
1647 return 0; 1654 goto exit_unlock;
1648 } 1655 }
1649 1656
1650 genl_notify(reply, genl_info_net(info), info->snd_pid, 1657 genl_notify(reply, genl_info_net(info), info->snd_pid,
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c
index 1252c3081ef1..2a11ec2383ee 100644
--- a/net/openvswitch/flow.c
+++ b/net/openvswitch/flow.c
@@ -183,7 +183,8 @@ void ovs_flow_used(struct sw_flow *flow, struct sk_buff *skb)
183 u8 tcp_flags = 0; 183 u8 tcp_flags = 0;
184 184
185 if (flow->key.eth.type == htons(ETH_P_IP) && 185 if (flow->key.eth.type == htons(ETH_P_IP) &&
186 flow->key.ip.proto == IPPROTO_TCP) { 186 flow->key.ip.proto == IPPROTO_TCP &&
187 likely(skb->len >= skb_transport_offset(skb) + sizeof(struct tcphdr))) {
187 u8 *tcp = (u8 *)tcp_hdr(skb); 188 u8 *tcp = (u8 *)tcp_hdr(skb);
188 tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK; 189 tcp_flags = *(tcp + TCP_FLAGS_OFFSET) & TCP_FLAG_MASK;
189 } 190 }
diff --git a/net/sctp/output.c b/net/sctp/output.c
index 817174eb5f41..8fc4dcd294ab 100644
--- a/net/sctp/output.c
+++ b/net/sctp/output.c
@@ -377,9 +377,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
377 */ 377 */
378 skb_set_owner_w(nskb, sk); 378 skb_set_owner_w(nskb, sk);
379 379
380 /* The 'obsolete' field of dst is set to 2 when a dst is freed. */ 380 if (!sctp_transport_dst_check(tp)) {
381 if (!dst || (dst->obsolete > 1)) {
382 dst_release(dst);
383 sctp_transport_route(tp, NULL, sctp_sk(sk)); 381 sctp_transport_route(tp, NULL, sctp_sk(sk));
384 if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) { 382 if (asoc && (asoc->param_flags & SPP_PMTUD_ENABLE)) {
385 sctp_assoc_sync_pmtu(asoc); 383 sctp_assoc_sync_pmtu(asoc);
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 3889330b7b04..b026ba0c6992 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -226,23 +226,6 @@ void sctp_transport_pmtu(struct sctp_transport *transport, struct sock *sk)
226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT; 226 transport->pathmtu = SCTP_DEFAULT_MAXSEGMENT;
227} 227}
228 228
229/* this is a complete rip-off from __sk_dst_check
230 * the cookie is always 0 since this is how it's used in the
231 * pmtu code
232 */
233static struct dst_entry *sctp_transport_dst_check(struct sctp_transport *t)
234{
235 struct dst_entry *dst = t->dst;
236
237 if (dst && dst->obsolete && dst->ops->check(dst, 0) == NULL) {
238 dst_release(t->dst);
239 t->dst = NULL;
240 return NULL;
241 }
242
243 return dst;
244}
245
246void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu) 229void sctp_transport_update_pmtu(struct sctp_transport *t, u32 pmtu)
247{ 230{
248 struct dst_entry *dst; 231 struct dst_entry *dst;
diff --git a/net/sunrpc/auth_gss/gss_mech_switch.c b/net/sunrpc/auth_gss/gss_mech_switch.c
index ca8cad8251c7..782bfe1b6465 100644
--- a/net/sunrpc/auth_gss/gss_mech_switch.c
+++ b/net/sunrpc/auth_gss/gss_mech_switch.c
@@ -242,12 +242,13 @@ EXPORT_SYMBOL_GPL(gss_mech_get_by_pseudoflavor);
242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr) 242int gss_mech_list_pseudoflavors(rpc_authflavor_t *array_ptr)
243{ 243{
244 struct gss_api_mech *pos = NULL; 244 struct gss_api_mech *pos = NULL;
245 int i = 0; 245 int j, i = 0;
246 246
247 spin_lock(&registered_mechs_lock); 247 spin_lock(&registered_mechs_lock);
248 list_for_each_entry(pos, &registered_mechs, gm_list) { 248 list_for_each_entry(pos, &registered_mechs, gm_list) {
249 array_ptr[i] = pos->gm_pfs->pseudoflavor; 249 for (j=0; j < pos->gm_pf_num; j++) {
250 i++; 250 array_ptr[i++] = pos->gm_pfs[j].pseudoflavor;
251 }
251 } 252 }
252 spin_unlock(&registered_mechs_lock); 253 spin_unlock(&registered_mechs_lock);
253 return i; 254 return i;
diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c
index 64417a733220..d8c670c9d62c 100644
--- a/sound/pci/echoaudio/echoaudio_dsp.c
+++ b/sound/pci/echoaudio/echoaudio_dsp.c
@@ -475,7 +475,7 @@ static int load_firmware(struct echoaudio *chip)
475 const struct firmware *fw; 475 const struct firmware *fw;
476 int box_type, err; 476 int box_type, err;
477 477
478 if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page)) 478 if (snd_BUG_ON(!chip->comm_page))
479 return -EPERM; 479 return -EPERM;
480 480
481 /* See if the ASIC is present and working - only if the DSP is already loaded */ 481 /* See if the ASIC is present and working - only if the DSP is already loaded */
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
index 7a8fcc4c15f8..841475cc13b6 100644
--- a/sound/pci/hda/hda_codec.c
+++ b/sound/pci/hda/hda_codec.c
@@ -5444,10 +5444,6 @@ int snd_hda_suspend(struct hda_bus *bus)
5444 list_for_each_entry(codec, &bus->codec_list, list) { 5444 list_for_each_entry(codec, &bus->codec_list, list) {
5445 if (hda_codec_is_power_on(codec)) 5445 if (hda_codec_is_power_on(codec))
5446 hda_call_codec_suspend(codec); 5446 hda_call_codec_suspend(codec);
5447 else /* forcibly change the power to D3 even if not used */
5448 hda_set_power_state(codec,
5449 codec->afg ? codec->afg : codec->mfg,
5450 AC_PWRST_D3);
5451 if (codec->patch_ops.post_suspend) 5447 if (codec->patch_ops.post_suspend)
5452 codec->patch_ops.post_suspend(codec); 5448 codec->patch_ops.post_suspend(codec);
5453 } 5449 }
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index c19e71a94e1b..1f350522bed4 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -783,11 +783,13 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
783{ 783{
784 struct azx *chip = bus->private_data; 784 struct azx *chip = bus->private_data;
785 unsigned long timeout; 785 unsigned long timeout;
786 unsigned long loopcounter;
786 int do_poll = 0; 787 int do_poll = 0;
787 788
788 again: 789 again:
789 timeout = jiffies + msecs_to_jiffies(1000); 790 timeout = jiffies + msecs_to_jiffies(1000);
790 for (;;) { 791
792 for (loopcounter = 0;; loopcounter++) {
791 if (chip->polling_mode || do_poll) { 793 if (chip->polling_mode || do_poll) {
792 spin_lock_irq(&chip->reg_lock); 794 spin_lock_irq(&chip->reg_lock);
793 azx_update_rirb(chip); 795 azx_update_rirb(chip);
@@ -803,7 +805,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
803 } 805 }
804 if (time_after(jiffies, timeout)) 806 if (time_after(jiffies, timeout))
805 break; 807 break;
806 if (bus->needs_damn_long_delay) 808 if (bus->needs_damn_long_delay || loopcounter > 3000)
807 msleep(2); /* temporary workaround */ 809 msleep(2); /* temporary workaround */
808 else { 810 else {
809 udelay(10); 811 udelay(10);
@@ -2351,6 +2353,17 @@ static void azx_power_notify(struct hda_bus *bus)
2351 * power management 2353 * power management
2352 */ 2354 */
2353 2355
2356static int snd_hda_codecs_inuse(struct hda_bus *bus)
2357{
2358 struct hda_codec *codec;
2359
2360 list_for_each_entry(codec, &bus->codec_list, list) {
2361 if (snd_hda_codec_needs_resume(codec))
2362 return 1;
2363 }
2364 return 0;
2365}
2366
2354static int azx_suspend(struct pci_dev *pci, pm_message_t state) 2367static int azx_suspend(struct pci_dev *pci, pm_message_t state)
2355{ 2368{
2356 struct snd_card *card = pci_get_drvdata(pci); 2369 struct snd_card *card = pci_get_drvdata(pci);
@@ -2397,7 +2410,8 @@ static int azx_resume(struct pci_dev *pci)
2397 return -EIO; 2410 return -EIO;
2398 azx_init_pci(chip); 2411 azx_init_pci(chip);
2399 2412
2400 azx_init_chip(chip, 1); 2413 if (snd_hda_codecs_inuse(chip->bus))
2414 azx_init_chip(chip, 1);
2401 2415
2402 snd_hda_resume(chip->bus); 2416 snd_hda_resume(chip->bus);
2403 snd_power_change_state(card, SNDRV_CTL_POWER_D0); 2417 snd_power_change_state(card, SNDRV_CTL_POWER_D0);
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 818f90bc7d57..7810913d07a0 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -5405,6 +5405,8 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
5405 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G", 5405 SND_PCI_QUIRK(0x1025, 0x0142, "Acer Aspire 7730G",
5406 ALC882_FIXUP_ACER_ASPIRE_4930G), 5406 ALC882_FIXUP_ACER_ASPIRE_4930G),
5407 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210), 5407 SND_PCI_QUIRK(0x1025, 0x0155, "Packard-Bell M5120", ALC882_FIXUP_PB_M5210),
5408 SND_PCI_QUIRK(0x1025, 0x021e, "Acer Aspire 5739G",
5409 ALC882_FIXUP_ACER_ASPIRE_4930G),
5408 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE), 5410 SND_PCI_QUIRK(0x1025, 0x0259, "Acer Aspire 5935", ALC889_FIXUP_DAC_ROUTE),
5409 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G), 5411 SND_PCI_QUIRK(0x1025, 0x026b, "Acer Aspire 8940G", ALC882_FIXUP_ACER_ASPIRE_8930G),
5410 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736), 5412 SND_PCI_QUIRK(0x1025, 0x0296, "Acer Aspire 7736z", ALC882_FIXUP_ACER_ASPIRE_7736),
@@ -5438,6 +5440,7 @@ static const struct snd_pci_quirk alc882_fixup_tbl[] = {
5438 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF), 5440 SND_PCI_QUIRK(0x106b, 0x4a00, "Macbook 5,2", ALC889_FIXUP_IMAC91_VREF),
5439 5441
5440 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD), 5442 SND_PCI_QUIRK(0x1071, 0x8258, "Evesham Voyaeger", ALC882_FIXUP_EAPD),
5443 SND_PCI_QUIRK(0x1462, 0x7350, "MSI-7350", ALC889_FIXUP_CD),
5441 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3), 5444 SND_PCI_QUIRK_VENDOR(0x1462, "MSI", ALC882_FIXUP_GPIO3),
5442 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD), 5445 SND_PCI_QUIRK(0x1458, 0xa002, "Gigabyte EP45-DS3", ALC889_FIXUP_CD),
5443 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX), 5446 SND_PCI_QUIRK(0x147b, 0x107a, "Abit AW9D-MAX", ALC882_FIXUP_ABIT_AW9D_MAX),
@@ -5638,13 +5641,13 @@ static int patch_alc262(struct hda_codec *codec)
5638 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80); 5641 snd_hda_codec_write(codec, 0x1a, 0, AC_VERB_SET_PROC_COEF, tmp | 0x80);
5639 } 5642 }
5640#endif 5643#endif
5641 alc_auto_parse_customize_define(codec);
5642
5643 alc_fix_pll_init(codec, 0x20, 0x0a, 10); 5644 alc_fix_pll_init(codec, 0x20, 0x0a, 10);
5644 5645
5645 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups); 5646 alc_pick_fixup(codec, NULL, alc262_fixup_tbl, alc262_fixups);
5646 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 5647 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
5647 5648
5649 alc_auto_parse_customize_define(codec);
5650
5648 /* automatic parse from the BIOS config */ 5651 /* automatic parse from the BIOS config */
5649 err = alc262_parse_auto_config(codec); 5652 err = alc262_parse_auto_config(codec);
5650 if (err < 0) 5653 if (err < 0)
@@ -6249,8 +6252,6 @@ static int patch_alc269(struct hda_codec *codec)
6249 6252
6250 spec->mixer_nid = 0x0b; 6253 spec->mixer_nid = 0x0b;
6251 6254
6252 alc_auto_parse_customize_define(codec);
6253
6254 err = alc_codec_rename_from_preset(codec); 6255 err = alc_codec_rename_from_preset(codec);
6255 if (err < 0) 6256 if (err < 0)
6256 goto error; 6257 goto error;
@@ -6283,6 +6284,8 @@ static int patch_alc269(struct hda_codec *codec)
6283 alc269_fixup_tbl, alc269_fixups); 6284 alc269_fixup_tbl, alc269_fixups);
6284 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6285 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6285 6286
6287 alc_auto_parse_customize_define(codec);
6288
6286 /* automatic parse from the BIOS config */ 6289 /* automatic parse from the BIOS config */
6287 err = alc269_parse_auto_config(codec); 6290 err = alc269_parse_auto_config(codec);
6288 if (err < 0) 6291 if (err < 0)
@@ -6859,8 +6862,6 @@ static int patch_alc662(struct hda_codec *codec)
6859 /* handle multiple HPs as is */ 6862 /* handle multiple HPs as is */
6860 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP; 6863 spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
6861 6864
6862 alc_auto_parse_customize_define(codec);
6863
6864 alc_fix_pll_init(codec, 0x20, 0x04, 15); 6865 alc_fix_pll_init(codec, 0x20, 0x04, 15);
6865 6866
6866 err = alc_codec_rename_from_preset(codec); 6867 err = alc_codec_rename_from_preset(codec);
@@ -6877,6 +6878,9 @@ static int patch_alc662(struct hda_codec *codec)
6877 alc_pick_fixup(codec, alc662_fixup_models, 6878 alc_pick_fixup(codec, alc662_fixup_models,
6878 alc662_fixup_tbl, alc662_fixups); 6879 alc662_fixup_tbl, alc662_fixups);
6879 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE); 6880 alc_apply_fixup(codec, ALC_FIXUP_ACT_PRE_PROBE);
6881
6882 alc_auto_parse_customize_define(codec);
6883
6880 /* automatic parse from the BIOS config */ 6884 /* automatic parse from the BIOS config */
6881 err = alc662_parse_auto_config(codec); 6885 err = alc662_parse_auto_config(codec);
6882 if (err < 0) 6886 if (err < 0)
diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index b68cdec03b9e..0b2aea2ce172 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -5170,6 +5170,7 @@ static int snd_hdsp_create_hwdep(struct snd_card *card, struct hdsp *hdsp)
5170 strcpy(hw->name, "HDSP hwdep interface"); 5170 strcpy(hw->name, "HDSP hwdep interface");
5171 5171
5172 hw->ops.ioctl = snd_hdsp_hwdep_ioctl; 5172 hw->ops.ioctl = snd_hdsp_hwdep_ioctl;
5173 hw->ops.ioctl_compat = snd_hdsp_hwdep_ioctl;
5173 5174
5174 return 0; 5175 return 0;
5175} 5176}
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c
index 9d9ad8d61c0a..8526e1edaf45 100644
--- a/sound/soc/sh/migor.c
+++ b/sound/soc/sh/migor.c
@@ -35,7 +35,7 @@ static unsigned long siumckb_recalc(struct clk *clk)
35 return codec_freq; 35 return codec_freq;
36} 36}
37 37
38static struct clk_ops siumckb_clk_ops = { 38static struct sh_clk_ops siumckb_clk_ops = {
39 .recalc = siumckb_recalc, 39 .recalc = siumckb_recalc,
40}; 40};
41 41