diff options
author | Mark Brown <broonie@linaro.org> | 2013-11-04 01:04:05 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-11-04 01:04:05 -0500 |
commit | ca89bc248e2fac44d6374a48b8d38b068c7a1bdf (patch) | |
tree | 0c10af2a5f22a1ad0283023d403022ce6b84ebc4 | |
parent | 9645083ca5ef365b7b750cf219bb20b61bb925f8 (diff) | |
parent | 7b5bfb82882b9b1c8423ce0ed6852ca3762d967a (diff) |
Merge remote-tracking branch 'asoc/fix/ak4642' into asoc-linus
259 files changed, 2268 insertions, 1126 deletions
diff --git a/Documentation/connector/ucon.c b/Documentation/connector/ucon.c index 4848db8c71ff..8a4da64e02a8 100644 --- a/Documentation/connector/ucon.c +++ b/Documentation/connector/ucon.c | |||
@@ -71,7 +71,7 @@ static int netlink_send(int s, struct cn_msg *msg) | |||
71 | nlh->nlmsg_seq = seq++; | 71 | nlh->nlmsg_seq = seq++; |
72 | nlh->nlmsg_pid = getpid(); | 72 | nlh->nlmsg_pid = getpid(); |
73 | nlh->nlmsg_type = NLMSG_DONE; | 73 | nlh->nlmsg_type = NLMSG_DONE; |
74 | nlh->nlmsg_len = NLMSG_LENGTH(size - sizeof(*nlh)); | 74 | nlh->nlmsg_len = size; |
75 | nlh->nlmsg_flags = 0; | 75 | nlh->nlmsg_flags = 0; |
76 | 76 | ||
77 | m = NLMSG_DATA(nlh); | 77 | m = NLMSG_DATA(nlh); |
diff --git a/MAINTAINERS b/MAINTAINERS index a7c34ef3509d..3438384d270c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -1009,6 +1009,7 @@ ARM/Marvell Armada 370 and Armada XP SOC support | |||
1009 | M: Jason Cooper <jason@lakedaemon.net> | 1009 | M: Jason Cooper <jason@lakedaemon.net> |
1010 | M: Andrew Lunn <andrew@lunn.ch> | 1010 | M: Andrew Lunn <andrew@lunn.ch> |
1011 | M: Gregory Clement <gregory.clement@free-electrons.com> | 1011 | M: Gregory Clement <gregory.clement@free-electrons.com> |
1012 | M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | ||
1012 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1013 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1013 | S: Maintained | 1014 | S: Maintained |
1014 | F: arch/arm/mach-mvebu/ | 1015 | F: arch/arm/mach-mvebu/ |
@@ -1016,6 +1017,7 @@ F: arch/arm/mach-mvebu/ | |||
1016 | ARM/Marvell Dove/Kirkwood/MV78xx0/Orion SOC support | 1017 | ARM/Marvell Dove/Kirkwood/MV78xx0/Orion SOC support |
1017 | M: Jason Cooper <jason@lakedaemon.net> | 1018 | M: Jason Cooper <jason@lakedaemon.net> |
1018 | M: Andrew Lunn <andrew@lunn.ch> | 1019 | M: Andrew Lunn <andrew@lunn.ch> |
1020 | M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> | ||
1019 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 1021 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
1020 | S: Maintained | 1022 | S: Maintained |
1021 | F: arch/arm/mach-dove/ | 1023 | F: arch/arm/mach-dove/ |
@@ -1148,6 +1150,13 @@ F: drivers/net/ethernet/i825xx/ether1* | |||
1148 | F: drivers/net/ethernet/seeq/ether3* | 1150 | F: drivers/net/ethernet/seeq/ether3* |
1149 | F: drivers/scsi/arm/ | 1151 | F: drivers/scsi/arm/ |
1150 | 1152 | ||
1153 | ARM/Rockchip SoC support | ||
1154 | M: Heiko Stuebner <heiko@sntech.de> | ||
1155 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | ||
1156 | S: Maintained | ||
1157 | F: arch/arm/mach-rockchip/ | ||
1158 | F: drivers/*/*rockchip* | ||
1159 | |||
1151 | ARM/SHARK MACHINE SUPPORT | 1160 | ARM/SHARK MACHINE SUPPORT |
1152 | M: Alexander Schulz <alex@shark-linux.de> | 1161 | M: Alexander Schulz <alex@shark-linux.de> |
1153 | W: http://www.shark-linux.de/shark.html | 1162 | W: http://www.shark-linux.de/shark.html |
@@ -1791,6 +1800,7 @@ F: include/net/bluetooth/ | |||
1791 | 1800 | ||
1792 | BONDING DRIVER | 1801 | BONDING DRIVER |
1793 | M: Jay Vosburgh <fubar@us.ibm.com> | 1802 | M: Jay Vosburgh <fubar@us.ibm.com> |
1803 | M: Veaceslav Falico <vfalico@redhat.com> | ||
1794 | M: Andy Gospodarek <andy@greyhouse.net> | 1804 | M: Andy Gospodarek <andy@greyhouse.net> |
1795 | L: netdev@vger.kernel.org | 1805 | L: netdev@vger.kernel.org |
1796 | W: http://sourceforge.net/projects/bonding/ | 1806 | W: http://sourceforge.net/projects/bonding/ |
@@ -2718,6 +2728,8 @@ T: git git://git.linaro.org/people/sumitsemwal/linux-dma-buf.git | |||
2718 | DMA GENERIC OFFLOAD ENGINE SUBSYSTEM | 2728 | DMA GENERIC OFFLOAD ENGINE SUBSYSTEM |
2719 | M: Vinod Koul <vinod.koul@intel.com> | 2729 | M: Vinod Koul <vinod.koul@intel.com> |
2720 | M: Dan Williams <dan.j.williams@intel.com> | 2730 | M: Dan Williams <dan.j.williams@intel.com> |
2731 | L: dmaengine@vger.kernel.org | ||
2732 | Q: https://patchwork.kernel.org/project/linux-dmaengine/list/ | ||
2721 | S: Supported | 2733 | S: Supported |
2722 | F: drivers/dma/ | 2734 | F: drivers/dma/ |
2723 | F: include/linux/dma* | 2735 | F: include/linux/dma* |
@@ -2821,7 +2833,7 @@ M: Terje Bergström <tbergstrom@nvidia.com> | |||
2821 | L: dri-devel@lists.freedesktop.org | 2833 | L: dri-devel@lists.freedesktop.org |
2822 | L: linux-tegra@vger.kernel.org | 2834 | L: linux-tegra@vger.kernel.org |
2823 | T: git git://anongit.freedesktop.org/tegra/linux.git | 2835 | T: git git://anongit.freedesktop.org/tegra/linux.git |
2824 | S: Maintained | 2836 | S: Supported |
2825 | F: drivers/gpu/host1x/ | 2837 | F: drivers/gpu/host1x/ |
2826 | F: include/uapi/drm/tegra_drm.h | 2838 | F: include/uapi/drm/tegra_drm.h |
2827 | F: Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt | 2839 | F: Documentation/devicetree/bindings/gpu/nvidia,tegra20-host1x.txt |
@@ -4357,7 +4369,10 @@ F: arch/x86/kernel/microcode_intel.c | |||
4357 | 4369 | ||
4358 | INTEL I/OAT DMA DRIVER | 4370 | INTEL I/OAT DMA DRIVER |
4359 | M: Dan Williams <dan.j.williams@intel.com> | 4371 | M: Dan Williams <dan.j.williams@intel.com> |
4360 | S: Maintained | 4372 | M: Dave Jiang <dave.jiang@intel.com> |
4373 | L: dmaengine@vger.kernel.org | ||
4374 | Q: https://patchwork.kernel.org/project/linux-dmaengine/list/ | ||
4375 | S: Supported | ||
4361 | F: drivers/dma/ioat* | 4376 | F: drivers/dma/ioat* |
4362 | 4377 | ||
4363 | INTEL IOMMU (VT-d) | 4378 | INTEL IOMMU (VT-d) |
@@ -7822,6 +7837,13 @@ F: Documentation/sound/alsa/soc/ | |||
7822 | F: sound/soc/ | 7837 | F: sound/soc/ |
7823 | F: include/sound/soc* | 7838 | F: include/sound/soc* |
7824 | 7839 | ||
7840 | SOUND - DMAENGINE HELPERS | ||
7841 | M: Lars-Peter Clausen <lars@metafoo.de> | ||
7842 | S: Supported | ||
7843 | F: include/sound/dmaengine_pcm.h | ||
7844 | F: sound/core/pcm_dmaengine.c | ||
7845 | F: sound/soc/soc-generic-dmaengine-pcm.c | ||
7846 | |||
7825 | SPARC + UltraSPARC (sparc/sparc64) | 7847 | SPARC + UltraSPARC (sparc/sparc64) |
7826 | M: "David S. Miller" <davem@davemloft.net> | 7848 | M: "David S. Miller" <davem@davemloft.net> |
7827 | L: sparclinux@vger.kernel.org | 7849 | L: sparclinux@vger.kernel.org |
@@ -8294,14 +8316,72 @@ L: linux-media@vger.kernel.org | |||
8294 | S: Maintained | 8316 | S: Maintained |
8295 | F: drivers/media/rc/ttusbir.c | 8317 | F: drivers/media/rc/ttusbir.c |
8296 | 8318 | ||
8297 | TEGRA SUPPORT | 8319 | TEGRA ARCHITECTURE SUPPORT |
8298 | M: Stephen Warren <swarren@wwwdotorg.org> | 8320 | M: Stephen Warren <swarren@wwwdotorg.org> |
8321 | M: Thierry Reding <thierry.reding@gmail.com> | ||
8299 | L: linux-tegra@vger.kernel.org | 8322 | L: linux-tegra@vger.kernel.org |
8300 | Q: http://patchwork.ozlabs.org/project/linux-tegra/list/ | 8323 | Q: http://patchwork.ozlabs.org/project/linux-tegra/list/ |
8301 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git | 8324 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/swarren/linux-tegra.git |
8302 | S: Supported | 8325 | S: Supported |
8303 | N: [^a-z]tegra | 8326 | N: [^a-z]tegra |
8304 | 8327 | ||
8328 | TEGRA ASOC DRIVER | ||
8329 | M: Stephen Warren <swarren@wwwdotorg.org> | ||
8330 | S: Supported | ||
8331 | F: sound/soc/tegra/ | ||
8332 | |||
8333 | TEGRA CLOCK DRIVER | ||
8334 | M: Peter De Schrijver <pdeschrijver@nvidia.com> | ||
8335 | M: Prashant Gaikwad <pgaikwad@nvidia.com> | ||
8336 | S: Supported | ||
8337 | F: drivers/clk/tegra/ | ||
8338 | |||
8339 | TEGRA DMA DRIVER | ||
8340 | M: Laxman Dewangan <ldewangan@nvidia.com> | ||
8341 | S: Supported | ||
8342 | F: drivers/dma/tegra20-apb-dma.c | ||
8343 | |||
8344 | TEGRA GPIO DRIVER | ||
8345 | M: Stephen Warren <swarren@wwwdotorg.org> | ||
8346 | S: Supported | ||
8347 | F: drivers/gpio/gpio-tegra.c | ||
8348 | |||
8349 | TEGRA I2C DRIVER | ||
8350 | M: Laxman Dewangan <ldewangan@nvidia.com> | ||
8351 | S: Supported | ||
8352 | F: drivers/i2c/busses/i2c-tegra.c | ||
8353 | |||
8354 | TEGRA IOMMU DRIVERS | ||
8355 | M: Hiroshi Doyu <hdoyu@nvidia.com> | ||
8356 | S: Supported | ||
8357 | F: drivers/iommu/tegra* | ||
8358 | |||
8359 | TEGRA KBC DRIVER | ||
8360 | M: Rakesh Iyer <riyer@nvidia.com> | ||
8361 | M: Laxman Dewangan <ldewangan@nvidia.com> | ||
8362 | S: Supported | ||
8363 | F: drivers/input/keyboard/tegra-kbc.c | ||
8364 | |||
8365 | TEGRA PINCTRL DRIVER | ||
8366 | M: Stephen Warren <swarren@wwwdotorg.org> | ||
8367 | S: Supported | ||
8368 | F: drivers/pinctrl/pinctrl-tegra* | ||
8369 | |||
8370 | TEGRA PWM DRIVER | ||
8371 | M: Thierry Reding <thierry.reding@gmail.com> | ||
8372 | S: Supported | ||
8373 | F: drivers/pwm/pwm-tegra.c | ||
8374 | |||
8375 | TEGRA SERIAL DRIVER | ||
8376 | M: Laxman Dewangan <ldewangan@nvidia.com> | ||
8377 | S: Supported | ||
8378 | F: drivers/tty/serial/serial-tegra.c | ||
8379 | |||
8380 | TEGRA SPI DRIVER | ||
8381 | M: Laxman Dewangan <ldewangan@nvidia.com> | ||
8382 | S: Supported | ||
8383 | F: drivers/spi/spi-tegra* | ||
8384 | |||
8305 | TEHUTI ETHERNET DRIVER | 8385 | TEHUTI ETHERNET DRIVER |
8306 | M: Andy Gospodarek <andy@greyhouse.net> | 8386 | M: Andy Gospodarek <andy@greyhouse.net> |
8307 | L: netdev@vger.kernel.org | 8387 | L: netdev@vger.kernel.org |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 3 | 1 | VERSION = 3 |
2 | PATCHLEVEL = 12 | 2 | PATCHLEVEL = 12 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = One Giant Leap for Frogkind | 5 | NAME = One Giant Leap for Frogkind |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/boot/dts/integratorcp.dts b/arch/arm/boot/dts/integratorcp.dts index ff1aea0ee043..72693a69f830 100644 --- a/arch/arm/boot/dts/integratorcp.dts +++ b/arch/arm/boot/dts/integratorcp.dts | |||
@@ -9,11 +9,6 @@ | |||
9 | model = "ARM Integrator/CP"; | 9 | model = "ARM Integrator/CP"; |
10 | compatible = "arm,integrator-cp"; | 10 | compatible = "arm,integrator-cp"; |
11 | 11 | ||
12 | aliases { | ||
13 | arm,timer-primary = &timer2; | ||
14 | arm,timer-secondary = &timer1; | ||
15 | }; | ||
16 | |||
17 | chosen { | 12 | chosen { |
18 | bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; | 13 | bootargs = "root=/dev/ram0 console=ttyAMA0,38400n8 earlyprintk"; |
19 | }; | 14 | }; |
@@ -24,14 +19,18 @@ | |||
24 | }; | 19 | }; |
25 | 20 | ||
26 | timer0: timer@13000000 { | 21 | timer0: timer@13000000 { |
22 | /* TIMER0 runs @ 25MHz */ | ||
27 | compatible = "arm,integrator-cp-timer"; | 23 | compatible = "arm,integrator-cp-timer"; |
24 | status = "disabled"; | ||
28 | }; | 25 | }; |
29 | 26 | ||
30 | timer1: timer@13000100 { | 27 | timer1: timer@13000100 { |
28 | /* TIMER1 runs @ 1MHz */ | ||
31 | compatible = "arm,integrator-cp-timer"; | 29 | compatible = "arm,integrator-cp-timer"; |
32 | }; | 30 | }; |
33 | 31 | ||
34 | timer2: timer@13000200 { | 32 | timer2: timer@13000200 { |
33 | /* TIMER2 runs @ 1MHz */ | ||
35 | compatible = "arm,integrator-cp-timer"; | 34 | compatible = "arm,integrator-cp-timer"; |
36 | }; | 35 | }; |
37 | 36 | ||
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index f50d223a0bd3..99b44e0e8d86 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c | |||
@@ -930,4 +930,5 @@ void bpf_jit_free(struct sk_filter *fp) | |||
930 | { | 930 | { |
931 | if (fp->bpf_func != sk_run_filter) | 931 | if (fp->bpf_func != sk_run_filter) |
932 | module_free(NULL, fp->bpf_func); | 932 | module_free(NULL, fp->bpf_func); |
933 | kfree(fp); | ||
933 | } | 934 | } |
diff --git a/arch/parisc/configs/712_defconfig b/arch/parisc/configs/712_defconfig index 0f90569b9d85..9387cc2693f6 100644 --- a/arch/parisc/configs/712_defconfig +++ b/arch/parisc/configs/712_defconfig | |||
@@ -40,6 +40,8 @@ CONFIG_IP_NF_QUEUE=m | |||
40 | CONFIG_LLC2=m | 40 | CONFIG_LLC2=m |
41 | CONFIG_NET_PKTGEN=m | 41 | CONFIG_NET_PKTGEN=m |
42 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 42 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
43 | CONFIG_DEVTMPFS=y | ||
44 | CONFIG_DEVTMPFS_MOUNT=y | ||
43 | # CONFIG_STANDALONE is not set | 45 | # CONFIG_STANDALONE is not set |
44 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 46 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
45 | CONFIG_PARPORT=y | 47 | CONFIG_PARPORT=y |
diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig index b647b182dacc..90025322b75e 100644 --- a/arch/parisc/configs/a500_defconfig +++ b/arch/parisc/configs/a500_defconfig | |||
@@ -79,6 +79,8 @@ CONFIG_IP_DCCP=m | |||
79 | CONFIG_LLC2=m | 79 | CONFIG_LLC2=m |
80 | CONFIG_NET_PKTGEN=m | 80 | CONFIG_NET_PKTGEN=m |
81 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 81 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
82 | CONFIG_DEVTMPFS=y | ||
83 | CONFIG_DEVTMPFS_MOUNT=y | ||
82 | # CONFIG_STANDALONE is not set | 84 | # CONFIG_STANDALONE is not set |
83 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 85 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
84 | CONFIG_BLK_DEV_UMEM=m | 86 | CONFIG_BLK_DEV_UMEM=m |
diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig index e289f5bf3148..f1a0c25bef8d 100644 --- a/arch/parisc/configs/b180_defconfig +++ b/arch/parisc/configs/b180_defconfig | |||
@@ -4,6 +4,7 @@ CONFIG_IKCONFIG=y | |||
4 | CONFIG_IKCONFIG_PROC=y | 4 | CONFIG_IKCONFIG_PROC=y |
5 | CONFIG_LOG_BUF_SHIFT=16 | 5 | CONFIG_LOG_BUF_SHIFT=16 |
6 | CONFIG_SYSFS_DEPRECATED_V2=y | 6 | CONFIG_SYSFS_DEPRECATED_V2=y |
7 | CONFIG_BLK_DEV_INITRD=y | ||
7 | CONFIG_SLAB=y | 8 | CONFIG_SLAB=y |
8 | CONFIG_MODULES=y | 9 | CONFIG_MODULES=y |
9 | CONFIG_MODVERSIONS=y | 10 | CONFIG_MODVERSIONS=y |
@@ -27,6 +28,8 @@ CONFIG_IP_PNP_BOOTP=y | |||
27 | # CONFIG_INET_LRO is not set | 28 | # CONFIG_INET_LRO is not set |
28 | CONFIG_IPV6=y | 29 | CONFIG_IPV6=y |
29 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 30 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
31 | CONFIG_DEVTMPFS=y | ||
32 | CONFIG_DEVTMPFS_MOUNT=y | ||
30 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 33 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
31 | CONFIG_PARPORT=y | 34 | CONFIG_PARPORT=y |
32 | CONFIG_PARPORT_PC=y | 35 | CONFIG_PARPORT_PC=y |
diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig index 311ca367b622..ec1b014952b6 100644 --- a/arch/parisc/configs/c3000_defconfig +++ b/arch/parisc/configs/c3000_defconfig | |||
@@ -5,6 +5,7 @@ CONFIG_IKCONFIG=y | |||
5 | CONFIG_IKCONFIG_PROC=y | 5 | CONFIG_IKCONFIG_PROC=y |
6 | CONFIG_LOG_BUF_SHIFT=16 | 6 | CONFIG_LOG_BUF_SHIFT=16 |
7 | CONFIG_SYSFS_DEPRECATED_V2=y | 7 | CONFIG_SYSFS_DEPRECATED_V2=y |
8 | CONFIG_BLK_DEV_INITRD=y | ||
8 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set | 9 | # CONFIG_CC_OPTIMIZE_FOR_SIZE is not set |
9 | CONFIG_EXPERT=y | 10 | CONFIG_EXPERT=y |
10 | CONFIG_KALLSYMS_ALL=y | 11 | CONFIG_KALLSYMS_ALL=y |
@@ -39,6 +40,8 @@ CONFIG_NETFILTER_DEBUG=y | |||
39 | CONFIG_IP_NF_QUEUE=m | 40 | CONFIG_IP_NF_QUEUE=m |
40 | CONFIG_NET_PKTGEN=m | 41 | CONFIG_NET_PKTGEN=m |
41 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 42 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
43 | CONFIG_DEVTMPFS=y | ||
44 | CONFIG_DEVTMPFS_MOUNT=y | ||
42 | # CONFIG_STANDALONE is not set | 45 | # CONFIG_STANDALONE is not set |
43 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 46 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
44 | CONFIG_BLK_DEV_UMEM=m | 47 | CONFIG_BLK_DEV_UMEM=m |
diff --git a/arch/parisc/configs/c8000_defconfig b/arch/parisc/configs/c8000_defconfig index f11006361297..e1c8d2015c89 100644 --- a/arch/parisc/configs/c8000_defconfig +++ b/arch/parisc/configs/c8000_defconfig | |||
@@ -62,6 +62,8 @@ CONFIG_TIPC=m | |||
62 | CONFIG_LLC2=m | 62 | CONFIG_LLC2=m |
63 | CONFIG_DNS_RESOLVER=y | 63 | CONFIG_DNS_RESOLVER=y |
64 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 64 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
65 | CONFIG_DEVTMPFS=y | ||
66 | CONFIG_DEVTMPFS_MOUNT=y | ||
65 | # CONFIG_STANDALONE is not set | 67 | # CONFIG_STANDALONE is not set |
66 | CONFIG_PARPORT=y | 68 | CONFIG_PARPORT=y |
67 | CONFIG_PARPORT_PC=y | 69 | CONFIG_PARPORT_PC=y |
diff --git a/arch/parisc/configs/default_defconfig b/arch/parisc/configs/default_defconfig index dfe88f6c95c4..ba61495e1fa4 100644 --- a/arch/parisc/configs/default_defconfig +++ b/arch/parisc/configs/default_defconfig | |||
@@ -49,6 +49,8 @@ CONFIG_INET6_ESP=y | |||
49 | CONFIG_INET6_IPCOMP=y | 49 | CONFIG_INET6_IPCOMP=y |
50 | CONFIG_LLC2=m | 50 | CONFIG_LLC2=m |
51 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 51 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
52 | CONFIG_DEVTMPFS=y | ||
53 | CONFIG_DEVTMPFS_MOUNT=y | ||
52 | # CONFIG_STANDALONE is not set | 54 | # CONFIG_STANDALONE is not set |
53 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set | 55 | # CONFIG_PREVENT_FIRMWARE_BUILD is not set |
54 | CONFIG_PARPORT=y | 56 | CONFIG_PARPORT=y |
diff --git a/arch/parisc/kernel/cache.c b/arch/parisc/kernel/cache.c index b521c0adf4ec..c035673209f7 100644 --- a/arch/parisc/kernel/cache.c +++ b/arch/parisc/kernel/cache.c | |||
@@ -602,7 +602,6 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long | |||
602 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); | 602 | __flush_cache_page(vma, vmaddr, PFN_PHYS(pfn)); |
603 | } | 603 | } |
604 | } | 604 | } |
605 | EXPORT_SYMBOL_GPL(flush_cache_page); | ||
606 | 605 | ||
607 | #ifdef CONFIG_PARISC_TMPALIAS | 606 | #ifdef CONFIG_PARISC_TMPALIAS |
608 | 607 | ||
diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S index 37aabd772fbb..d2d58258aea6 100644 --- a/arch/parisc/kernel/head.S +++ b/arch/parisc/kernel/head.S | |||
@@ -195,6 +195,8 @@ common_stext: | |||
195 | ldw MEM_PDC_HI(%r0),%r6 | 195 | ldw MEM_PDC_HI(%r0),%r6 |
196 | depd %r6, 31, 32, %r3 /* move to upper word */ | 196 | depd %r6, 31, 32, %r3 /* move to upper word */ |
197 | 197 | ||
198 | mfctl %cr30,%r6 /* PCX-W2 firmware bug */ | ||
199 | |||
198 | ldo PDC_PSW(%r0),%arg0 /* 21 */ | 200 | ldo PDC_PSW(%r0),%arg0 /* 21 */ |
199 | ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ | 201 | ldo PDC_PSW_SET_DEFAULTS(%r0),%arg1 /* 2 */ |
200 | ldo PDC_PSW_WIDE_BIT(%r0),%arg2 /* 2 */ | 202 | ldo PDC_PSW_WIDE_BIT(%r0),%arg2 /* 2 */ |
@@ -203,6 +205,8 @@ common_stext: | |||
203 | copy %r0,%arg3 | 205 | copy %r0,%arg3 |
204 | 206 | ||
205 | stext_pdc_ret: | 207 | stext_pdc_ret: |
208 | mtctl %r6,%cr30 /* restore task thread info */ | ||
209 | |||
206 | /* restore rfi target address*/ | 210 | /* restore rfi target address*/ |
207 | ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10 | 211 | ldd TI_TASK-THREAD_SZ_ALGN(%sp), %r10 |
208 | tophys_r1 %r10 | 212 | tophys_r1 %r10 |
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index bf56e33f8257..2345bdb4d917 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -691,4 +691,5 @@ void bpf_jit_free(struct sk_filter *fp) | |||
691 | { | 691 | { |
692 | if (fp->bpf_func != sk_run_filter) | 692 | if (fp->bpf_func != sk_run_filter) |
693 | module_free(NULL, fp->bpf_func); | 693 | module_free(NULL, fp->bpf_func); |
694 | kfree(fp); | ||
694 | } | 695 | } |
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h index 9b60a36c348d..2204400d0bd5 100644 --- a/arch/s390/include/asm/pgtable.h +++ b/arch/s390/include/asm/pgtable.h | |||
@@ -748,7 +748,9 @@ static inline void pgste_set_key(pte_t *ptep, pgste_t pgste, pte_t entry) | |||
748 | 748 | ||
749 | static inline void pgste_set_pte(pte_t *ptep, pte_t entry) | 749 | static inline void pgste_set_pte(pte_t *ptep, pte_t entry) |
750 | { | 750 | { |
751 | if (!MACHINE_HAS_ESOP && (pte_val(entry) & _PAGE_WRITE)) { | 751 | if (!MACHINE_HAS_ESOP && |
752 | (pte_val(entry) & _PAGE_PRESENT) && | ||
753 | (pte_val(entry) & _PAGE_WRITE)) { | ||
752 | /* | 754 | /* |
753 | * Without enhanced suppression-on-protection force | 755 | * Without enhanced suppression-on-protection force |
754 | * the dirty bit on for all writable ptes. | 756 | * the dirty bit on for all writable ptes. |
diff --git a/arch/s390/include/asm/timex.h b/arch/s390/include/asm/timex.h index 8ad8af915032..819b94d22720 100644 --- a/arch/s390/include/asm/timex.h +++ b/arch/s390/include/asm/timex.h | |||
@@ -71,30 +71,30 @@ static inline void local_tick_enable(unsigned long long comp) | |||
71 | 71 | ||
72 | typedef unsigned long long cycles_t; | 72 | typedef unsigned long long cycles_t; |
73 | 73 | ||
74 | static inline unsigned long long get_tod_clock(void) | ||
75 | { | ||
76 | unsigned long long clk; | ||
77 | |||
78 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES | ||
79 | asm volatile(".insn s,0xb27c0000,%0" : "=Q" (clk) : : "cc"); | ||
80 | #else | ||
81 | asm volatile("stck %0" : "=Q" (clk) : : "cc"); | ||
82 | #endif | ||
83 | return clk; | ||
84 | } | ||
85 | |||
86 | static inline void get_tod_clock_ext(char *clk) | 74 | static inline void get_tod_clock_ext(char *clk) |
87 | { | 75 | { |
88 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); | 76 | asm volatile("stcke %0" : "=Q" (*clk) : : "cc"); |
89 | } | 77 | } |
90 | 78 | ||
91 | static inline unsigned long long get_tod_clock_xt(void) | 79 | static inline unsigned long long get_tod_clock(void) |
92 | { | 80 | { |
93 | unsigned char clk[16]; | 81 | unsigned char clk[16]; |
94 | get_tod_clock_ext(clk); | 82 | get_tod_clock_ext(clk); |
95 | return *((unsigned long long *)&clk[1]); | 83 | return *((unsigned long long *)&clk[1]); |
96 | } | 84 | } |
97 | 85 | ||
86 | static inline unsigned long long get_tod_clock_fast(void) | ||
87 | { | ||
88 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES | ||
89 | unsigned long long clk; | ||
90 | |||
91 | asm volatile("stckf %0" : "=Q" (clk) : : "cc"); | ||
92 | return clk; | ||
93 | #else | ||
94 | return get_tod_clock(); | ||
95 | #endif | ||
96 | } | ||
97 | |||
98 | static inline cycles_t get_cycles(void) | 98 | static inline cycles_t get_cycles(void) |
99 | { | 99 | { |
100 | return (cycles_t) get_tod_clock() >> 2; | 100 | return (cycles_t) get_tod_clock() >> 2; |
@@ -125,7 +125,7 @@ extern u64 sched_clock_base_cc; | |||
125 | */ | 125 | */ |
126 | static inline unsigned long long get_tod_clock_monotonic(void) | 126 | static inline unsigned long long get_tod_clock_monotonic(void) |
127 | { | 127 | { |
128 | return get_tod_clock_xt() - sched_clock_base_cc; | 128 | return get_tod_clock() - sched_clock_base_cc; |
129 | } | 129 | } |
130 | 130 | ||
131 | /** | 131 | /** |
diff --git a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c index 1389b637dae5..adaa9e9478d8 100644 --- a/arch/s390/kernel/compat_signal.c +++ b/arch/s390/kernel/compat_signal.c | |||
@@ -99,7 +99,7 @@ int copy_siginfo_to_user32(compat_siginfo_t __user *to, siginfo_t *from) | |||
99 | break; | 99 | break; |
100 | } | 100 | } |
101 | } | 101 | } |
102 | return err; | 102 | return err ? -EFAULT : 0; |
103 | } | 103 | } |
104 | 104 | ||
105 | int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | 105 | int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) |
@@ -148,7 +148,7 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
148 | break; | 148 | break; |
149 | } | 149 | } |
150 | } | 150 | } |
151 | return err; | 151 | return err ? -EFAULT : 0; |
152 | } | 152 | } |
153 | 153 | ||
154 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) | 154 | static int save_sigregs32(struct pt_regs *regs, _sigregs32 __user *sregs) |
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index f1279dc2e1bc..17d62fe5d7b7 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -867,7 +867,7 @@ static inline void | |||
867 | debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level, | 867 | debug_finish_entry(debug_info_t * id, debug_entry_t* active, int level, |
868 | int exception) | 868 | int exception) |
869 | { | 869 | { |
870 | active->id.stck = get_tod_clock(); | 870 | active->id.stck = get_tod_clock_fast(); |
871 | active->id.fields.cpuid = smp_processor_id(); | 871 | active->id.fields.cpuid = smp_processor_id(); |
872 | active->caller = __builtin_return_address(0); | 872 | active->caller = __builtin_return_address(0); |
873 | active->id.fields.exception = exception; | 873 | active->id.fields.exception = exception; |
diff --git a/arch/s390/kvm/interrupt.c b/arch/s390/kvm/interrupt.c index 7f35cb33e510..7f1f7ac5cf7f 100644 --- a/arch/s390/kvm/interrupt.c +++ b/arch/s390/kvm/interrupt.c | |||
@@ -385,7 +385,7 @@ static int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu) | |||
385 | } | 385 | } |
386 | 386 | ||
387 | if ((!rc) && (vcpu->arch.sie_block->ckc < | 387 | if ((!rc) && (vcpu->arch.sie_block->ckc < |
388 | get_tod_clock() + vcpu->arch.sie_block->epoch)) { | 388 | get_tod_clock_fast() + vcpu->arch.sie_block->epoch)) { |
389 | if ((!psw_extint_disabled(vcpu)) && | 389 | if ((!psw_extint_disabled(vcpu)) && |
390 | (vcpu->arch.sie_block->gcr[0] & 0x800ul)) | 390 | (vcpu->arch.sie_block->gcr[0] & 0x800ul)) |
391 | rc = 1; | 391 | rc = 1; |
@@ -425,7 +425,7 @@ int kvm_s390_handle_wait(struct kvm_vcpu *vcpu) | |||
425 | goto no_timer; | 425 | goto no_timer; |
426 | } | 426 | } |
427 | 427 | ||
428 | now = get_tod_clock() + vcpu->arch.sie_block->epoch; | 428 | now = get_tod_clock_fast() + vcpu->arch.sie_block->epoch; |
429 | if (vcpu->arch.sie_block->ckc < now) { | 429 | if (vcpu->arch.sie_block->ckc < now) { |
430 | __unset_cpu_idle(vcpu); | 430 | __unset_cpu_idle(vcpu); |
431 | return 0; | 431 | return 0; |
@@ -515,7 +515,7 @@ void kvm_s390_deliver_pending_interrupts(struct kvm_vcpu *vcpu) | |||
515 | } | 515 | } |
516 | 516 | ||
517 | if ((vcpu->arch.sie_block->ckc < | 517 | if ((vcpu->arch.sie_block->ckc < |
518 | get_tod_clock() + vcpu->arch.sie_block->epoch)) | 518 | get_tod_clock_fast() + vcpu->arch.sie_block->epoch)) |
519 | __try_deliver_ckc_interrupt(vcpu); | 519 | __try_deliver_ckc_interrupt(vcpu); |
520 | 520 | ||
521 | if (atomic_read(&fi->active)) { | 521 | if (atomic_read(&fi->active)) { |
diff --git a/arch/s390/lib/delay.c b/arch/s390/lib/delay.c index 57c87d7d7ede..a9f3d0042d58 100644 --- a/arch/s390/lib/delay.c +++ b/arch/s390/lib/delay.c | |||
@@ -44,7 +44,7 @@ static void __udelay_disabled(unsigned long long usecs) | |||
44 | do { | 44 | do { |
45 | set_clock_comparator(end); | 45 | set_clock_comparator(end); |
46 | vtime_stop_cpu(); | 46 | vtime_stop_cpu(); |
47 | } while (get_tod_clock() < end); | 47 | } while (get_tod_clock_fast() < end); |
48 | lockdep_on(); | 48 | lockdep_on(); |
49 | __ctl_load(cr0, 0, 0); | 49 | __ctl_load(cr0, 0, 0); |
50 | __ctl_load(cr6, 6, 6); | 50 | __ctl_load(cr6, 6, 6); |
@@ -55,7 +55,7 @@ static void __udelay_enabled(unsigned long long usecs) | |||
55 | { | 55 | { |
56 | u64 clock_saved, end; | 56 | u64 clock_saved, end; |
57 | 57 | ||
58 | end = get_tod_clock() + (usecs << 12); | 58 | end = get_tod_clock_fast() + (usecs << 12); |
59 | do { | 59 | do { |
60 | clock_saved = 0; | 60 | clock_saved = 0; |
61 | if (end < S390_lowcore.clock_comparator) { | 61 | if (end < S390_lowcore.clock_comparator) { |
@@ -65,7 +65,7 @@ static void __udelay_enabled(unsigned long long usecs) | |||
65 | vtime_stop_cpu(); | 65 | vtime_stop_cpu(); |
66 | if (clock_saved) | 66 | if (clock_saved) |
67 | local_tick_enable(clock_saved); | 67 | local_tick_enable(clock_saved); |
68 | } while (get_tod_clock() < end); | 68 | } while (get_tod_clock_fast() < end); |
69 | } | 69 | } |
70 | 70 | ||
71 | /* | 71 | /* |
@@ -109,8 +109,8 @@ void udelay_simple(unsigned long long usecs) | |||
109 | { | 109 | { |
110 | u64 end; | 110 | u64 end; |
111 | 111 | ||
112 | end = get_tod_clock() + (usecs << 12); | 112 | end = get_tod_clock_fast() + (usecs << 12); |
113 | while (get_tod_clock() < end) | 113 | while (get_tod_clock_fast() < end) |
114 | cpu_relax(); | 114 | cpu_relax(); |
115 | } | 115 | } |
116 | 116 | ||
@@ -120,10 +120,10 @@ void __ndelay(unsigned long long nsecs) | |||
120 | 120 | ||
121 | nsecs <<= 9; | 121 | nsecs <<= 9; |
122 | do_div(nsecs, 125); | 122 | do_div(nsecs, 125); |
123 | end = get_tod_clock() + nsecs; | 123 | end = get_tod_clock_fast() + nsecs; |
124 | if (nsecs & ~0xfffUL) | 124 | if (nsecs & ~0xfffUL) |
125 | __udelay(nsecs >> 12); | 125 | __udelay(nsecs >> 12); |
126 | while (get_tod_clock() < end) | 126 | while (get_tod_clock_fast() < end) |
127 | barrier(); | 127 | barrier(); |
128 | } | 128 | } |
129 | EXPORT_SYMBOL(__ndelay); | 129 | EXPORT_SYMBOL(__ndelay); |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 709239285869..a5df511e27a2 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -881,7 +881,9 @@ void bpf_jit_free(struct sk_filter *fp) | |||
881 | struct bpf_binary_header *header = (void *)addr; | 881 | struct bpf_binary_header *header = (void *)addr; |
882 | 882 | ||
883 | if (fp->bpf_func == sk_run_filter) | 883 | if (fp->bpf_func == sk_run_filter) |
884 | return; | 884 | goto free_filter; |
885 | set_memory_rw(addr, header->pages); | 885 | set_memory_rw(addr, header->pages); |
886 | module_free(NULL, header); | 886 | module_free(NULL, header); |
887 | free_filter: | ||
888 | kfree(fp); | ||
887 | } | 889 | } |
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index 9c7be59e6f5a..218b6b23c378 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -808,4 +808,5 @@ void bpf_jit_free(struct sk_filter *fp) | |||
808 | { | 808 | { |
809 | if (fp->bpf_func != sk_run_filter) | 809 | if (fp->bpf_func != sk_run_filter) |
810 | module_free(NULL, fp->bpf_func); | 810 | module_free(NULL, fp->bpf_func); |
811 | kfree(fp); | ||
811 | } | 812 | } |
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c index 79c216aa0e2b..516593e1ce33 100644 --- a/arch/x86/net/bpf_jit_comp.c +++ b/arch/x86/net/bpf_jit_comp.c | |||
@@ -772,13 +772,21 @@ out: | |||
772 | return; | 772 | return; |
773 | } | 773 | } |
774 | 774 | ||
775 | static void bpf_jit_free_deferred(struct work_struct *work) | ||
776 | { | ||
777 | struct sk_filter *fp = container_of(work, struct sk_filter, work); | ||
778 | unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; | ||
779 | struct bpf_binary_header *header = (void *)addr; | ||
780 | |||
781 | set_memory_rw(addr, header->pages); | ||
782 | module_free(NULL, header); | ||
783 | kfree(fp); | ||
784 | } | ||
785 | |||
775 | void bpf_jit_free(struct sk_filter *fp) | 786 | void bpf_jit_free(struct sk_filter *fp) |
776 | { | 787 | { |
777 | if (fp->bpf_func != sk_run_filter) { | 788 | if (fp->bpf_func != sk_run_filter) { |
778 | unsigned long addr = (unsigned long)fp->bpf_func & PAGE_MASK; | 789 | INIT_WORK(&fp->work, bpf_jit_free_deferred); |
779 | struct bpf_binary_header *header = (void *)addr; | 790 | schedule_work(&fp->work); |
780 | |||
781 | set_memory_rw(addr, header->pages); | ||
782 | module_free(NULL, header); | ||
783 | } | 791 | } |
784 | } | 792 | } |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 9d715ae5ff6b..8e28f923cf7f 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -1343,7 +1343,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1343 | if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) | 1343 | if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) |
1344 | host->flags |= ATA_HOST_PARALLEL_SCAN; | 1344 | host->flags |= ATA_HOST_PARALLEL_SCAN; |
1345 | else | 1345 | else |
1346 | printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n"); | 1346 | dev_info(&pdev->dev, "SSS flag set, parallel bus scan disabled\n"); |
1347 | 1347 | ||
1348 | if (pi.flags & ATA_FLAG_EM) | 1348 | if (pi.flags & ATA_FLAG_EM) |
1349 | ahci_reset_em(host); | 1349 | ahci_reset_em(host); |
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c index 2daaee05cab1..7d3b85385bfc 100644 --- a/drivers/ata/ahci_platform.c +++ b/drivers/ata/ahci_platform.c | |||
@@ -184,7 +184,7 @@ static int ahci_probe(struct platform_device *pdev) | |||
184 | if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) | 184 | if (!(hpriv->cap & HOST_CAP_SSS) || ahci_ignore_sss) |
185 | host->flags |= ATA_HOST_PARALLEL_SCAN; | 185 | host->flags |= ATA_HOST_PARALLEL_SCAN; |
186 | else | 186 | else |
187 | printk(KERN_INFO "ahci: SSS flag set, parallel bus scan disabled\n"); | 187 | dev_info(dev, "SSS flag set, parallel bus scan disabled\n"); |
188 | 188 | ||
189 | if (pi.flags & ATA_FLAG_EM) | 189 | if (pi.flags & ATA_FLAG_EM) |
190 | ahci_reset_em(host); | 190 | ahci_reset_em(host); |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index acfd0f711069..aaac4fb0d564 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -778,8 +778,16 @@ static void ahci_start_port(struct ata_port *ap) | |||
778 | rc = ap->ops->transmit_led_message(ap, | 778 | rc = ap->ops->transmit_led_message(ap, |
779 | emp->led_state, | 779 | emp->led_state, |
780 | 4); | 780 | 4); |
781 | /* | ||
782 | * If busy, give a breather but do not | ||
783 | * release EH ownership by using msleep() | ||
784 | * instead of ata_msleep(). EM Transmit | ||
785 | * bit is busy for the whole host and | ||
786 | * releasing ownership will cause other | ||
787 | * ports to fail the same way. | ||
788 | */ | ||
781 | if (rc == -EBUSY) | 789 | if (rc == -EBUSY) |
782 | ata_msleep(ap, 1); | 790 | msleep(1); |
783 | else | 791 | else |
784 | break; | 792 | break; |
785 | } | 793 | } |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index c69fcce505c0..370462fa8e01 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1322,14 +1322,14 @@ void ata_eh_qc_complete(struct ata_queued_cmd *qc) | |||
1322 | * should be retried. To be used from EH. | 1322 | * should be retried. To be used from EH. |
1323 | * | 1323 | * |
1324 | * SCSI midlayer limits the number of retries to scmd->allowed. | 1324 | * SCSI midlayer limits the number of retries to scmd->allowed. |
1325 | * scmd->retries is decremented for commands which get retried | 1325 | * scmd->allowed is incremented for commands which get retried |
1326 | * due to unrelated failures (qc->err_mask is zero). | 1326 | * due to unrelated failures (qc->err_mask is zero). |
1327 | */ | 1327 | */ |
1328 | void ata_eh_qc_retry(struct ata_queued_cmd *qc) | 1328 | void ata_eh_qc_retry(struct ata_queued_cmd *qc) |
1329 | { | 1329 | { |
1330 | struct scsi_cmnd *scmd = qc->scsicmd; | 1330 | struct scsi_cmnd *scmd = qc->scsicmd; |
1331 | if (!qc->err_mask && scmd->retries) | 1331 | if (!qc->err_mask) |
1332 | scmd->retries--; | 1332 | scmd->allowed++; |
1333 | __ata_eh_qc_complete(qc); | 1333 | __ata_eh_qc_complete(qc); |
1334 | } | 1334 | } |
1335 | 1335 | ||
diff --git a/drivers/ata/pata_isapnp.c b/drivers/ata/pata_isapnp.c index 4bceb8803a10..b33d1f99b3a4 100644 --- a/drivers/ata/pata_isapnp.c +++ b/drivers/ata/pata_isapnp.c | |||
@@ -78,7 +78,7 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *dev | |||
78 | 78 | ||
79 | ap->ioaddr.cmd_addr = cmd_addr; | 79 | ap->ioaddr.cmd_addr = cmd_addr; |
80 | 80 | ||
81 | if (pnp_port_valid(idev, 1) == 0) { | 81 | if (pnp_port_valid(idev, 1)) { |
82 | ctl_addr = devm_ioport_map(&idev->dev, | 82 | ctl_addr = devm_ioport_map(&idev->dev, |
83 | pnp_port_start(idev, 1), 1); | 83 | pnp_port_start(idev, 1), 1); |
84 | ap->ioaddr.altstatus_addr = ctl_addr; | 84 | ap->ioaddr.altstatus_addr = ctl_addr; |
diff --git a/drivers/connector/cn_proc.c b/drivers/connector/cn_proc.c index 08ae128cce9b..c73fc2b74de2 100644 --- a/drivers/connector/cn_proc.c +++ b/drivers/connector/cn_proc.c | |||
@@ -65,6 +65,7 @@ void proc_fork_connector(struct task_struct *task) | |||
65 | 65 | ||
66 | msg = (struct cn_msg *)buffer; | 66 | msg = (struct cn_msg *)buffer; |
67 | ev = (struct proc_event *)msg->data; | 67 | ev = (struct proc_event *)msg->data; |
68 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
68 | get_seq(&msg->seq, &ev->cpu); | 69 | get_seq(&msg->seq, &ev->cpu); |
69 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 70 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
70 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 71 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -80,6 +81,7 @@ void proc_fork_connector(struct task_struct *task) | |||
80 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 81 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
81 | msg->ack = 0; /* not used */ | 82 | msg->ack = 0; /* not used */ |
82 | msg->len = sizeof(*ev); | 83 | msg->len = sizeof(*ev); |
84 | msg->flags = 0; /* not used */ | ||
83 | /* If cn_netlink_send() failed, the data is not sent */ | 85 | /* If cn_netlink_send() failed, the data is not sent */ |
84 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 86 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
85 | } | 87 | } |
@@ -96,6 +98,7 @@ void proc_exec_connector(struct task_struct *task) | |||
96 | 98 | ||
97 | msg = (struct cn_msg *)buffer; | 99 | msg = (struct cn_msg *)buffer; |
98 | ev = (struct proc_event *)msg->data; | 100 | ev = (struct proc_event *)msg->data; |
101 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
99 | get_seq(&msg->seq, &ev->cpu); | 102 | get_seq(&msg->seq, &ev->cpu); |
100 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 103 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
101 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 104 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -106,6 +109,7 @@ void proc_exec_connector(struct task_struct *task) | |||
106 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 109 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
107 | msg->ack = 0; /* not used */ | 110 | msg->ack = 0; /* not used */ |
108 | msg->len = sizeof(*ev); | 111 | msg->len = sizeof(*ev); |
112 | msg->flags = 0; /* not used */ | ||
109 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 113 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
110 | } | 114 | } |
111 | 115 | ||
@@ -122,6 +126,7 @@ void proc_id_connector(struct task_struct *task, int which_id) | |||
122 | 126 | ||
123 | msg = (struct cn_msg *)buffer; | 127 | msg = (struct cn_msg *)buffer; |
124 | ev = (struct proc_event *)msg->data; | 128 | ev = (struct proc_event *)msg->data; |
129 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
125 | ev->what = which_id; | 130 | ev->what = which_id; |
126 | ev->event_data.id.process_pid = task->pid; | 131 | ev->event_data.id.process_pid = task->pid; |
127 | ev->event_data.id.process_tgid = task->tgid; | 132 | ev->event_data.id.process_tgid = task->tgid; |
@@ -145,6 +150,7 @@ void proc_id_connector(struct task_struct *task, int which_id) | |||
145 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 150 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
146 | msg->ack = 0; /* not used */ | 151 | msg->ack = 0; /* not used */ |
147 | msg->len = sizeof(*ev); | 152 | msg->len = sizeof(*ev); |
153 | msg->flags = 0; /* not used */ | ||
148 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 154 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
149 | } | 155 | } |
150 | 156 | ||
@@ -160,6 +166,7 @@ void proc_sid_connector(struct task_struct *task) | |||
160 | 166 | ||
161 | msg = (struct cn_msg *)buffer; | 167 | msg = (struct cn_msg *)buffer; |
162 | ev = (struct proc_event *)msg->data; | 168 | ev = (struct proc_event *)msg->data; |
169 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
163 | get_seq(&msg->seq, &ev->cpu); | 170 | get_seq(&msg->seq, &ev->cpu); |
164 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 171 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
165 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 172 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -170,6 +177,7 @@ void proc_sid_connector(struct task_struct *task) | |||
170 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 177 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
171 | msg->ack = 0; /* not used */ | 178 | msg->ack = 0; /* not used */ |
172 | msg->len = sizeof(*ev); | 179 | msg->len = sizeof(*ev); |
180 | msg->flags = 0; /* not used */ | ||
173 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 181 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
174 | } | 182 | } |
175 | 183 | ||
@@ -185,6 +193,7 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id) | |||
185 | 193 | ||
186 | msg = (struct cn_msg *)buffer; | 194 | msg = (struct cn_msg *)buffer; |
187 | ev = (struct proc_event *)msg->data; | 195 | ev = (struct proc_event *)msg->data; |
196 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
188 | get_seq(&msg->seq, &ev->cpu); | 197 | get_seq(&msg->seq, &ev->cpu); |
189 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 198 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
190 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 199 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -203,6 +212,7 @@ void proc_ptrace_connector(struct task_struct *task, int ptrace_id) | |||
203 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 212 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
204 | msg->ack = 0; /* not used */ | 213 | msg->ack = 0; /* not used */ |
205 | msg->len = sizeof(*ev); | 214 | msg->len = sizeof(*ev); |
215 | msg->flags = 0; /* not used */ | ||
206 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 216 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
207 | } | 217 | } |
208 | 218 | ||
@@ -218,6 +228,7 @@ void proc_comm_connector(struct task_struct *task) | |||
218 | 228 | ||
219 | msg = (struct cn_msg *)buffer; | 229 | msg = (struct cn_msg *)buffer; |
220 | ev = (struct proc_event *)msg->data; | 230 | ev = (struct proc_event *)msg->data; |
231 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
221 | get_seq(&msg->seq, &ev->cpu); | 232 | get_seq(&msg->seq, &ev->cpu); |
222 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 233 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
223 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 234 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -229,6 +240,7 @@ void proc_comm_connector(struct task_struct *task) | |||
229 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 240 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
230 | msg->ack = 0; /* not used */ | 241 | msg->ack = 0; /* not used */ |
231 | msg->len = sizeof(*ev); | 242 | msg->len = sizeof(*ev); |
243 | msg->flags = 0; /* not used */ | ||
232 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 244 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
233 | } | 245 | } |
234 | 246 | ||
@@ -244,6 +256,7 @@ void proc_coredump_connector(struct task_struct *task) | |||
244 | 256 | ||
245 | msg = (struct cn_msg *)buffer; | 257 | msg = (struct cn_msg *)buffer; |
246 | ev = (struct proc_event *)msg->data; | 258 | ev = (struct proc_event *)msg->data; |
259 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
247 | get_seq(&msg->seq, &ev->cpu); | 260 | get_seq(&msg->seq, &ev->cpu); |
248 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 261 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
249 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 262 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -254,6 +267,7 @@ void proc_coredump_connector(struct task_struct *task) | |||
254 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 267 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
255 | msg->ack = 0; /* not used */ | 268 | msg->ack = 0; /* not used */ |
256 | msg->len = sizeof(*ev); | 269 | msg->len = sizeof(*ev); |
270 | msg->flags = 0; /* not used */ | ||
257 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 271 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
258 | } | 272 | } |
259 | 273 | ||
@@ -269,6 +283,7 @@ void proc_exit_connector(struct task_struct *task) | |||
269 | 283 | ||
270 | msg = (struct cn_msg *)buffer; | 284 | msg = (struct cn_msg *)buffer; |
271 | ev = (struct proc_event *)msg->data; | 285 | ev = (struct proc_event *)msg->data; |
286 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
272 | get_seq(&msg->seq, &ev->cpu); | 287 | get_seq(&msg->seq, &ev->cpu); |
273 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 288 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
274 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 289 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -281,6 +296,7 @@ void proc_exit_connector(struct task_struct *task) | |||
281 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 296 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
282 | msg->ack = 0; /* not used */ | 297 | msg->ack = 0; /* not used */ |
283 | msg->len = sizeof(*ev); | 298 | msg->len = sizeof(*ev); |
299 | msg->flags = 0; /* not used */ | ||
284 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 300 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
285 | } | 301 | } |
286 | 302 | ||
@@ -304,6 +320,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack) | |||
304 | 320 | ||
305 | msg = (struct cn_msg *)buffer; | 321 | msg = (struct cn_msg *)buffer; |
306 | ev = (struct proc_event *)msg->data; | 322 | ev = (struct proc_event *)msg->data; |
323 | memset(&ev->event_data, 0, sizeof(ev->event_data)); | ||
307 | msg->seq = rcvd_seq; | 324 | msg->seq = rcvd_seq; |
308 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ | 325 | ktime_get_ts(&ts); /* get high res monotonic timestamp */ |
309 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); | 326 | put_unaligned(timespec_to_ns(&ts), (__u64 *)&ev->timestamp_ns); |
@@ -313,6 +330,7 @@ static void cn_proc_ack(int err, int rcvd_seq, int rcvd_ack) | |||
313 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); | 330 | memcpy(&msg->id, &cn_proc_event_id, sizeof(msg->id)); |
314 | msg->ack = rcvd_ack + 1; | 331 | msg->ack = rcvd_ack + 1; |
315 | msg->len = sizeof(*ev); | 332 | msg->len = sizeof(*ev); |
333 | msg->flags = 0; /* not used */ | ||
316 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); | 334 | cn_netlink_send(msg, CN_IDX_PROC, GFP_KERNEL); |
317 | } | 335 | } |
318 | 336 | ||
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index 6ecfa758942c..a36749f1e44a 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c | |||
@@ -109,7 +109,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 __group, gfp_t gfp_mask) | |||
109 | 109 | ||
110 | data = nlmsg_data(nlh); | 110 | data = nlmsg_data(nlh); |
111 | 111 | ||
112 | memcpy(data, msg, sizeof(*data) + msg->len); | 112 | memcpy(data, msg, size); |
113 | 113 | ||
114 | NETLINK_CB(skb).dst_group = group; | 114 | NETLINK_CB(skb).dst_group = group; |
115 | 115 | ||
@@ -157,17 +157,18 @@ static int cn_call_callback(struct sk_buff *skb) | |||
157 | static void cn_rx_skb(struct sk_buff *__skb) | 157 | static void cn_rx_skb(struct sk_buff *__skb) |
158 | { | 158 | { |
159 | struct nlmsghdr *nlh; | 159 | struct nlmsghdr *nlh; |
160 | int err; | ||
161 | struct sk_buff *skb; | 160 | struct sk_buff *skb; |
161 | int len, err; | ||
162 | 162 | ||
163 | skb = skb_get(__skb); | 163 | skb = skb_get(__skb); |
164 | 164 | ||
165 | if (skb->len >= NLMSG_HDRLEN) { | 165 | if (skb->len >= NLMSG_HDRLEN) { |
166 | nlh = nlmsg_hdr(skb); | 166 | nlh = nlmsg_hdr(skb); |
167 | len = nlmsg_len(nlh); | ||
167 | 168 | ||
168 | if (nlh->nlmsg_len < sizeof(struct cn_msg) || | 169 | if (len < (int)sizeof(struct cn_msg) || |
169 | skb->len < nlh->nlmsg_len || | 170 | skb->len < nlh->nlmsg_len || |
170 | nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) { | 171 | len > CONNECTOR_MAX_MSG_SIZE) { |
171 | kfree_skb(skb); | 172 | kfree_skb(skb); |
172 | return; | 173 | return; |
173 | } | 174 | } |
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index d2c3253e015e..506fd23c7550 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
@@ -986,12 +986,12 @@ static int __init acpi_cpufreq_init(void) | |||
986 | { | 986 | { |
987 | int ret; | 987 | int ret; |
988 | 988 | ||
989 | if (acpi_disabled) | ||
990 | return -ENODEV; | ||
991 | |||
989 | /* don't keep reloading if cpufreq_driver exists */ | 992 | /* don't keep reloading if cpufreq_driver exists */ |
990 | if (cpufreq_get_current_driver()) | 993 | if (cpufreq_get_current_driver()) |
991 | return 0; | 994 | return -EEXIST; |
992 | |||
993 | if (acpi_disabled) | ||
994 | return 0; | ||
995 | 995 | ||
996 | pr_debug("acpi_cpufreq_init\n"); | 996 | pr_debug("acpi_cpufreq_init\n"); |
997 | 997 | ||
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index badf6206b2b2..eb3fdc755000 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c | |||
@@ -48,7 +48,7 @@ static inline int32_t div_fp(int32_t x, int32_t y) | |||
48 | } | 48 | } |
49 | 49 | ||
50 | struct sample { | 50 | struct sample { |
51 | int core_pct_busy; | 51 | int32_t core_pct_busy; |
52 | u64 aperf; | 52 | u64 aperf; |
53 | u64 mperf; | 53 | u64 mperf; |
54 | int freq; | 54 | int freq; |
@@ -68,7 +68,7 @@ struct _pid { | |||
68 | int32_t i_gain; | 68 | int32_t i_gain; |
69 | int32_t d_gain; | 69 | int32_t d_gain; |
70 | int deadband; | 70 | int deadband; |
71 | int last_err; | 71 | int32_t last_err; |
72 | }; | 72 | }; |
73 | 73 | ||
74 | struct cpudata { | 74 | struct cpudata { |
@@ -153,16 +153,15 @@ static inline void pid_d_gain_set(struct _pid *pid, int percent) | |||
153 | pid->d_gain = div_fp(int_tofp(percent), int_tofp(100)); | 153 | pid->d_gain = div_fp(int_tofp(percent), int_tofp(100)); |
154 | } | 154 | } |
155 | 155 | ||
156 | static signed int pid_calc(struct _pid *pid, int busy) | 156 | static signed int pid_calc(struct _pid *pid, int32_t busy) |
157 | { | 157 | { |
158 | signed int err, result; | 158 | signed int result; |
159 | int32_t pterm, dterm, fp_error; | 159 | int32_t pterm, dterm, fp_error; |
160 | int32_t integral_limit; | 160 | int32_t integral_limit; |
161 | 161 | ||
162 | err = pid->setpoint - busy; | 162 | fp_error = int_tofp(pid->setpoint) - busy; |
163 | fp_error = int_tofp(err); | ||
164 | 163 | ||
165 | if (abs(err) <= pid->deadband) | 164 | if (abs(fp_error) <= int_tofp(pid->deadband)) |
166 | return 0; | 165 | return 0; |
167 | 166 | ||
168 | pterm = mul_fp(pid->p_gain, fp_error); | 167 | pterm = mul_fp(pid->p_gain, fp_error); |
@@ -176,8 +175,8 @@ static signed int pid_calc(struct _pid *pid, int busy) | |||
176 | if (pid->integral < -integral_limit) | 175 | if (pid->integral < -integral_limit) |
177 | pid->integral = -integral_limit; | 176 | pid->integral = -integral_limit; |
178 | 177 | ||
179 | dterm = mul_fp(pid->d_gain, (err - pid->last_err)); | 178 | dterm = mul_fp(pid->d_gain, fp_error - pid->last_err); |
180 | pid->last_err = err; | 179 | pid->last_err = fp_error; |
181 | 180 | ||
182 | result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; | 181 | result = pterm + mul_fp(pid->integral, pid->i_gain) + dterm; |
183 | 182 | ||
@@ -367,12 +366,13 @@ static int intel_pstate_turbo_pstate(void) | |||
367 | static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) | 366 | static void intel_pstate_get_min_max(struct cpudata *cpu, int *min, int *max) |
368 | { | 367 | { |
369 | int max_perf = cpu->pstate.turbo_pstate; | 368 | int max_perf = cpu->pstate.turbo_pstate; |
369 | int max_perf_adj; | ||
370 | int min_perf; | 370 | int min_perf; |
371 | if (limits.no_turbo) | 371 | if (limits.no_turbo) |
372 | max_perf = cpu->pstate.max_pstate; | 372 | max_perf = cpu->pstate.max_pstate; |
373 | 373 | ||
374 | max_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf)); | 374 | max_perf_adj = fp_toint(mul_fp(int_tofp(max_perf), limits.max_perf)); |
375 | *max = clamp_t(int, max_perf, | 375 | *max = clamp_t(int, max_perf_adj, |
376 | cpu->pstate.min_pstate, cpu->pstate.turbo_pstate); | 376 | cpu->pstate.min_pstate, cpu->pstate.turbo_pstate); |
377 | 377 | ||
378 | min_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.min_perf)); | 378 | min_perf = fp_toint(mul_fp(int_tofp(max_perf), limits.min_perf)); |
@@ -436,8 +436,9 @@ static inline void intel_pstate_calc_busy(struct cpudata *cpu, | |||
436 | struct sample *sample) | 436 | struct sample *sample) |
437 | { | 437 | { |
438 | u64 core_pct; | 438 | u64 core_pct; |
439 | core_pct = div64_u64(sample->aperf * 100, sample->mperf); | 439 | core_pct = div64_u64(int_tofp(sample->aperf * 100), |
440 | sample->freq = cpu->pstate.max_pstate * core_pct * 1000; | 440 | sample->mperf); |
441 | sample->freq = fp_toint(cpu->pstate.max_pstate * core_pct * 1000); | ||
441 | 442 | ||
442 | sample->core_pct_busy = core_pct; | 443 | sample->core_pct_busy = core_pct; |
443 | } | 444 | } |
@@ -469,22 +470,19 @@ static inline void intel_pstate_set_sample_time(struct cpudata *cpu) | |||
469 | mod_timer_pinned(&cpu->timer, jiffies + delay); | 470 | mod_timer_pinned(&cpu->timer, jiffies + delay); |
470 | } | 471 | } |
471 | 472 | ||
472 | static inline int intel_pstate_get_scaled_busy(struct cpudata *cpu) | 473 | static inline int32_t intel_pstate_get_scaled_busy(struct cpudata *cpu) |
473 | { | 474 | { |
474 | int32_t busy_scaled; | ||
475 | int32_t core_busy, max_pstate, current_pstate; | 475 | int32_t core_busy, max_pstate, current_pstate; |
476 | 476 | ||
477 | core_busy = int_tofp(cpu->samples[cpu->sample_ptr].core_pct_busy); | 477 | core_busy = cpu->samples[cpu->sample_ptr].core_pct_busy; |
478 | max_pstate = int_tofp(cpu->pstate.max_pstate); | 478 | max_pstate = int_tofp(cpu->pstate.max_pstate); |
479 | current_pstate = int_tofp(cpu->pstate.current_pstate); | 479 | current_pstate = int_tofp(cpu->pstate.current_pstate); |
480 | busy_scaled = mul_fp(core_busy, div_fp(max_pstate, current_pstate)); | 480 | return mul_fp(core_busy, div_fp(max_pstate, current_pstate)); |
481 | |||
482 | return fp_toint(busy_scaled); | ||
483 | } | 481 | } |
484 | 482 | ||
485 | static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu) | 483 | static inline void intel_pstate_adjust_busy_pstate(struct cpudata *cpu) |
486 | { | 484 | { |
487 | int busy_scaled; | 485 | int32_t busy_scaled; |
488 | struct _pid *pid; | 486 | struct _pid *pid; |
489 | signed int ctl = 0; | 487 | signed int ctl = 0; |
490 | int steps; | 488 | int steps; |
diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 3519111c566b..10b577fcf48d 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c | |||
@@ -305,6 +305,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
305 | edma_alloc_slot(EDMA_CTLR(echan->ch_num), | 305 | edma_alloc_slot(EDMA_CTLR(echan->ch_num), |
306 | EDMA_SLOT_ANY); | 306 | EDMA_SLOT_ANY); |
307 | if (echan->slot[i] < 0) { | 307 | if (echan->slot[i] < 0) { |
308 | kfree(edesc); | ||
308 | dev_err(dev, "Failed to allocate slot\n"); | 309 | dev_err(dev, "Failed to allocate slot\n"); |
309 | kfree(edesc); | 310 | kfree(edesc); |
310 | return NULL; | 311 | return NULL; |
@@ -346,6 +347,7 @@ static struct dma_async_tx_descriptor *edma_prep_slave_sg( | |||
346 | ccnt = sg_dma_len(sg) / (acnt * bcnt); | 347 | ccnt = sg_dma_len(sg) / (acnt * bcnt); |
347 | if (ccnt > (SZ_64K - 1)) { | 348 | if (ccnt > (SZ_64K - 1)) { |
348 | dev_err(dev, "Exceeded max SG segment size\n"); | 349 | dev_err(dev, "Exceeded max SG segment size\n"); |
350 | kfree(edesc); | ||
349 | return NULL; | 351 | return NULL; |
350 | } | 352 | } |
351 | cidx = acnt * bcnt; | 353 | cidx = acnt * bcnt; |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index e572dd20bdee..05ad9ba0a67e 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
@@ -402,9 +402,16 @@ long drm_ioctl(struct file *filp, | |||
402 | cmd = ioctl->cmd_drv; | 402 | cmd = ioctl->cmd_drv; |
403 | } | 403 | } |
404 | else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { | 404 | else if ((nr >= DRM_COMMAND_END) || (nr < DRM_COMMAND_BASE)) { |
405 | u32 drv_size; | ||
406 | |||
405 | ioctl = &drm_ioctls[nr]; | 407 | ioctl = &drm_ioctls[nr]; |
406 | cmd = ioctl->cmd; | 408 | |
409 | drv_size = _IOC_SIZE(ioctl->cmd); | ||
407 | usize = asize = _IOC_SIZE(cmd); | 410 | usize = asize = _IOC_SIZE(cmd); |
411 | if (drv_size > asize) | ||
412 | asize = drv_size; | ||
413 | |||
414 | cmd = ioctl->cmd; | ||
408 | } else | 415 | } else |
409 | goto err_i1; | 416 | goto err_i1; |
410 | 417 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 69d8ed5416c3..2ad27880cd04 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -505,6 +505,8 @@ static int i915_drm_freeze(struct drm_device *dev) | |||
505 | intel_modeset_suspend_hw(dev); | 505 | intel_modeset_suspend_hw(dev); |
506 | } | 506 | } |
507 | 507 | ||
508 | i915_gem_suspend_gtt_mappings(dev); | ||
509 | |||
508 | i915_save_state(dev); | 510 | i915_save_state(dev); |
509 | 511 | ||
510 | intel_opregion_fini(dev); | 512 | intel_opregion_fini(dev); |
@@ -648,7 +650,8 @@ static int i915_drm_thaw(struct drm_device *dev) | |||
648 | mutex_lock(&dev->struct_mutex); | 650 | mutex_lock(&dev->struct_mutex); |
649 | i915_gem_restore_gtt_mappings(dev); | 651 | i915_gem_restore_gtt_mappings(dev); |
650 | mutex_unlock(&dev->struct_mutex); | 652 | mutex_unlock(&dev->struct_mutex); |
651 | } | 653 | } else if (drm_core_check_feature(dev, DRIVER_MODESET)) |
654 | i915_check_and_clear_faults(dev); | ||
652 | 655 | ||
653 | __i915_drm_thaw(dev); | 656 | __i915_drm_thaw(dev); |
654 | 657 | ||
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 35874b3a86dc..ab0f2c0a440c 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -497,10 +497,12 @@ struct i915_address_space { | |||
497 | 497 | ||
498 | /* FIXME: Need a more generic return type */ | 498 | /* FIXME: Need a more generic return type */ |
499 | gen6_gtt_pte_t (*pte_encode)(dma_addr_t addr, | 499 | gen6_gtt_pte_t (*pte_encode)(dma_addr_t addr, |
500 | enum i915_cache_level level); | 500 | enum i915_cache_level level, |
501 | bool valid); /* Create a valid PTE */ | ||
501 | void (*clear_range)(struct i915_address_space *vm, | 502 | void (*clear_range)(struct i915_address_space *vm, |
502 | unsigned int first_entry, | 503 | unsigned int first_entry, |
503 | unsigned int num_entries); | 504 | unsigned int num_entries, |
505 | bool use_scratch); | ||
504 | void (*insert_entries)(struct i915_address_space *vm, | 506 | void (*insert_entries)(struct i915_address_space *vm, |
505 | struct sg_table *st, | 507 | struct sg_table *st, |
506 | unsigned int first_entry, | 508 | unsigned int first_entry, |
@@ -2065,6 +2067,8 @@ void i915_ppgtt_bind_object(struct i915_hw_ppgtt *ppgtt, | |||
2065 | void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt, | 2067 | void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt, |
2066 | struct drm_i915_gem_object *obj); | 2068 | struct drm_i915_gem_object *obj); |
2067 | 2069 | ||
2070 | void i915_check_and_clear_faults(struct drm_device *dev); | ||
2071 | void i915_gem_suspend_gtt_mappings(struct drm_device *dev); | ||
2068 | void i915_gem_restore_gtt_mappings(struct drm_device *dev); | 2072 | void i915_gem_restore_gtt_mappings(struct drm_device *dev); |
2069 | int __must_check i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj); | 2073 | int __must_check i915_gem_gtt_prepare_object(struct drm_i915_gem_object *obj); |
2070 | void i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj, | 2074 | void i915_gem_gtt_bind_object(struct drm_i915_gem_object *obj, |
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index 212f6d8c35ec..1f7b4caefb6e 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
@@ -58,9 +58,10 @@ | |||
58 | #define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6) | 58 | #define HSW_WT_ELLC_LLC_AGE0 HSW_CACHEABILITY_CONTROL(0x6) |
59 | 59 | ||
60 | static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr, | 60 | static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr, |
61 | enum i915_cache_level level) | 61 | enum i915_cache_level level, |
62 | bool valid) | ||
62 | { | 63 | { |
63 | gen6_gtt_pte_t pte = GEN6_PTE_VALID; | 64 | gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0; |
64 | pte |= GEN6_PTE_ADDR_ENCODE(addr); | 65 | pte |= GEN6_PTE_ADDR_ENCODE(addr); |
65 | 66 | ||
66 | switch (level) { | 67 | switch (level) { |
@@ -79,9 +80,10 @@ static gen6_gtt_pte_t snb_pte_encode(dma_addr_t addr, | |||
79 | } | 80 | } |
80 | 81 | ||
81 | static gen6_gtt_pte_t ivb_pte_encode(dma_addr_t addr, | 82 | static gen6_gtt_pte_t ivb_pte_encode(dma_addr_t addr, |
82 | enum i915_cache_level level) | 83 | enum i915_cache_level level, |
84 | bool valid) | ||
83 | { | 85 | { |
84 | gen6_gtt_pte_t pte = GEN6_PTE_VALID; | 86 | gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0; |
85 | pte |= GEN6_PTE_ADDR_ENCODE(addr); | 87 | pte |= GEN6_PTE_ADDR_ENCODE(addr); |
86 | 88 | ||
87 | switch (level) { | 89 | switch (level) { |
@@ -105,9 +107,10 @@ static gen6_gtt_pte_t ivb_pte_encode(dma_addr_t addr, | |||
105 | #define BYT_PTE_SNOOPED_BY_CPU_CACHES (1 << 2) | 107 | #define BYT_PTE_SNOOPED_BY_CPU_CACHES (1 << 2) |
106 | 108 | ||
107 | static gen6_gtt_pte_t byt_pte_encode(dma_addr_t addr, | 109 | static gen6_gtt_pte_t byt_pte_encode(dma_addr_t addr, |
108 | enum i915_cache_level level) | 110 | enum i915_cache_level level, |
111 | bool valid) | ||
109 | { | 112 | { |
110 | gen6_gtt_pte_t pte = GEN6_PTE_VALID; | 113 | gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0; |
111 | pte |= GEN6_PTE_ADDR_ENCODE(addr); | 114 | pte |= GEN6_PTE_ADDR_ENCODE(addr); |
112 | 115 | ||
113 | /* Mark the page as writeable. Other platforms don't have a | 116 | /* Mark the page as writeable. Other platforms don't have a |
@@ -122,9 +125,10 @@ static gen6_gtt_pte_t byt_pte_encode(dma_addr_t addr, | |||
122 | } | 125 | } |
123 | 126 | ||
124 | static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr, | 127 | static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr, |
125 | enum i915_cache_level level) | 128 | enum i915_cache_level level, |
129 | bool valid) | ||
126 | { | 130 | { |
127 | gen6_gtt_pte_t pte = GEN6_PTE_VALID; | 131 | gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0; |
128 | pte |= HSW_PTE_ADDR_ENCODE(addr); | 132 | pte |= HSW_PTE_ADDR_ENCODE(addr); |
129 | 133 | ||
130 | if (level != I915_CACHE_NONE) | 134 | if (level != I915_CACHE_NONE) |
@@ -134,9 +138,10 @@ static gen6_gtt_pte_t hsw_pte_encode(dma_addr_t addr, | |||
134 | } | 138 | } |
135 | 139 | ||
136 | static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr, | 140 | static gen6_gtt_pte_t iris_pte_encode(dma_addr_t addr, |
137 | enum i915_cache_level level) | 141 | enum i915_cache_level level, |
142 | bool valid) | ||
138 | { | 143 | { |
139 | gen6_gtt_pte_t pte = GEN6_PTE_VALID; | 144 | gen6_gtt_pte_t pte = valid ? GEN6_PTE_VALID : 0; |
140 | pte |= HSW_PTE_ADDR_ENCODE(addr); | 145 | pte |= HSW_PTE_ADDR_ENCODE(addr); |
141 | 146 | ||
142 | switch (level) { | 147 | switch (level) { |
@@ -236,7 +241,8 @@ static int gen6_ppgtt_enable(struct drm_device *dev) | |||
236 | /* PPGTT support for Sandybdrige/Gen6 and later */ | 241 | /* PPGTT support for Sandybdrige/Gen6 and later */ |
237 | static void gen6_ppgtt_clear_range(struct i915_address_space *vm, | 242 | static void gen6_ppgtt_clear_range(struct i915_address_space *vm, |
238 | unsigned first_entry, | 243 | unsigned first_entry, |
239 | unsigned num_entries) | 244 | unsigned num_entries, |
245 | bool use_scratch) | ||
240 | { | 246 | { |
241 | struct i915_hw_ppgtt *ppgtt = | 247 | struct i915_hw_ppgtt *ppgtt = |
242 | container_of(vm, struct i915_hw_ppgtt, base); | 248 | container_of(vm, struct i915_hw_ppgtt, base); |
@@ -245,7 +251,7 @@ static void gen6_ppgtt_clear_range(struct i915_address_space *vm, | |||
245 | unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES; | 251 | unsigned first_pte = first_entry % I915_PPGTT_PT_ENTRIES; |
246 | unsigned last_pte, i; | 252 | unsigned last_pte, i; |
247 | 253 | ||
248 | scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC); | 254 | scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC, true); |
249 | 255 | ||
250 | while (num_entries) { | 256 | while (num_entries) { |
251 | last_pte = first_pte + num_entries; | 257 | last_pte = first_pte + num_entries; |
@@ -282,7 +288,7 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, | |||
282 | dma_addr_t page_addr; | 288 | dma_addr_t page_addr; |
283 | 289 | ||
284 | page_addr = sg_page_iter_dma_address(&sg_iter); | 290 | page_addr = sg_page_iter_dma_address(&sg_iter); |
285 | pt_vaddr[act_pte] = vm->pte_encode(page_addr, cache_level); | 291 | pt_vaddr[act_pte] = vm->pte_encode(page_addr, cache_level, true); |
286 | if (++act_pte == I915_PPGTT_PT_ENTRIES) { | 292 | if (++act_pte == I915_PPGTT_PT_ENTRIES) { |
287 | kunmap_atomic(pt_vaddr); | 293 | kunmap_atomic(pt_vaddr); |
288 | act_pt++; | 294 | act_pt++; |
@@ -367,7 +373,7 @@ static int gen6_ppgtt_init(struct i915_hw_ppgtt *ppgtt) | |||
367 | } | 373 | } |
368 | 374 | ||
369 | ppgtt->base.clear_range(&ppgtt->base, 0, | 375 | ppgtt->base.clear_range(&ppgtt->base, 0, |
370 | ppgtt->num_pd_entries * I915_PPGTT_PT_ENTRIES); | 376 | ppgtt->num_pd_entries * I915_PPGTT_PT_ENTRIES, true); |
371 | 377 | ||
372 | ppgtt->pd_offset = first_pd_entry_in_global_pt * sizeof(gen6_gtt_pte_t); | 378 | ppgtt->pd_offset = first_pd_entry_in_global_pt * sizeof(gen6_gtt_pte_t); |
373 | 379 | ||
@@ -444,7 +450,8 @@ void i915_ppgtt_unbind_object(struct i915_hw_ppgtt *ppgtt, | |||
444 | { | 450 | { |
445 | ppgtt->base.clear_range(&ppgtt->base, | 451 | ppgtt->base.clear_range(&ppgtt->base, |
446 | i915_gem_obj_ggtt_offset(obj) >> PAGE_SHIFT, | 452 | i915_gem_obj_ggtt_offset(obj) >> PAGE_SHIFT, |
447 | obj->base.size >> PAGE_SHIFT); | 453 | obj->base.size >> PAGE_SHIFT, |
454 | true); | ||
448 | } | 455 | } |
449 | 456 | ||
450 | extern int intel_iommu_gfx_mapped; | 457 | extern int intel_iommu_gfx_mapped; |
@@ -485,15 +492,65 @@ static void undo_idling(struct drm_i915_private *dev_priv, bool interruptible) | |||
485 | dev_priv->mm.interruptible = interruptible; | 492 | dev_priv->mm.interruptible = interruptible; |
486 | } | 493 | } |
487 | 494 | ||
495 | void i915_check_and_clear_faults(struct drm_device *dev) | ||
496 | { | ||
497 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
498 | struct intel_ring_buffer *ring; | ||
499 | int i; | ||
500 | |||
501 | if (INTEL_INFO(dev)->gen < 6) | ||
502 | return; | ||
503 | |||
504 | for_each_ring(ring, dev_priv, i) { | ||
505 | u32 fault_reg; | ||
506 | fault_reg = I915_READ(RING_FAULT_REG(ring)); | ||
507 | if (fault_reg & RING_FAULT_VALID) { | ||
508 | DRM_DEBUG_DRIVER("Unexpected fault\n" | ||
509 | "\tAddr: 0x%08lx\\n" | ||
510 | "\tAddress space: %s\n" | ||
511 | "\tSource ID: %d\n" | ||
512 | "\tType: %d\n", | ||
513 | fault_reg & PAGE_MASK, | ||
514 | fault_reg & RING_FAULT_GTTSEL_MASK ? "GGTT" : "PPGTT", | ||
515 | RING_FAULT_SRCID(fault_reg), | ||
516 | RING_FAULT_FAULT_TYPE(fault_reg)); | ||
517 | I915_WRITE(RING_FAULT_REG(ring), | ||
518 | fault_reg & ~RING_FAULT_VALID); | ||
519 | } | ||
520 | } | ||
521 | POSTING_READ(RING_FAULT_REG(&dev_priv->ring[RCS])); | ||
522 | } | ||
523 | |||
524 | void i915_gem_suspend_gtt_mappings(struct drm_device *dev) | ||
525 | { | ||
526 | struct drm_i915_private *dev_priv = dev->dev_private; | ||
527 | |||
528 | /* Don't bother messing with faults pre GEN6 as we have little | ||
529 | * documentation supporting that it's a good idea. | ||
530 | */ | ||
531 | if (INTEL_INFO(dev)->gen < 6) | ||
532 | return; | ||
533 | |||
534 | i915_check_and_clear_faults(dev); | ||
535 | |||
536 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, | ||
537 | dev_priv->gtt.base.start / PAGE_SIZE, | ||
538 | dev_priv->gtt.base.total / PAGE_SIZE, | ||
539 | false); | ||
540 | } | ||
541 | |||
488 | void i915_gem_restore_gtt_mappings(struct drm_device *dev) | 542 | void i915_gem_restore_gtt_mappings(struct drm_device *dev) |
489 | { | 543 | { |
490 | struct drm_i915_private *dev_priv = dev->dev_private; | 544 | struct drm_i915_private *dev_priv = dev->dev_private; |
491 | struct drm_i915_gem_object *obj; | 545 | struct drm_i915_gem_object *obj; |
492 | 546 | ||
547 | i915_check_and_clear_faults(dev); | ||
548 | |||
493 | /* First fill our portion of the GTT with scratch pages */ | 549 | /* First fill our portion of the GTT with scratch pages */ |
494 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, | 550 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, |
495 | dev_priv->gtt.base.start / PAGE_SIZE, | 551 | dev_priv->gtt.base.start / PAGE_SIZE, |
496 | dev_priv->gtt.base.total / PAGE_SIZE); | 552 | dev_priv->gtt.base.total / PAGE_SIZE, |
553 | true); | ||
497 | 554 | ||
498 | list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { | 555 | list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) { |
499 | i915_gem_clflush_object(obj, obj->pin_display); | 556 | i915_gem_clflush_object(obj, obj->pin_display); |
@@ -536,7 +593,7 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, | |||
536 | 593 | ||
537 | for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) { | 594 | for_each_sg_page(st->sgl, &sg_iter, st->nents, 0) { |
538 | addr = sg_page_iter_dma_address(&sg_iter); | 595 | addr = sg_page_iter_dma_address(&sg_iter); |
539 | iowrite32(vm->pte_encode(addr, level), >t_entries[i]); | 596 | iowrite32(vm->pte_encode(addr, level, true), >t_entries[i]); |
540 | i++; | 597 | i++; |
541 | } | 598 | } |
542 | 599 | ||
@@ -548,7 +605,7 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, | |||
548 | */ | 605 | */ |
549 | if (i != 0) | 606 | if (i != 0) |
550 | WARN_ON(readl(>t_entries[i-1]) != | 607 | WARN_ON(readl(>t_entries[i-1]) != |
551 | vm->pte_encode(addr, level)); | 608 | vm->pte_encode(addr, level, true)); |
552 | 609 | ||
553 | /* This next bit makes the above posting read even more important. We | 610 | /* This next bit makes the above posting read even more important. We |
554 | * want to flush the TLBs only after we're certain all the PTE updates | 611 | * want to flush the TLBs only after we're certain all the PTE updates |
@@ -560,7 +617,8 @@ static void gen6_ggtt_insert_entries(struct i915_address_space *vm, | |||
560 | 617 | ||
561 | static void gen6_ggtt_clear_range(struct i915_address_space *vm, | 618 | static void gen6_ggtt_clear_range(struct i915_address_space *vm, |
562 | unsigned int first_entry, | 619 | unsigned int first_entry, |
563 | unsigned int num_entries) | 620 | unsigned int num_entries, |
621 | bool use_scratch) | ||
564 | { | 622 | { |
565 | struct drm_i915_private *dev_priv = vm->dev->dev_private; | 623 | struct drm_i915_private *dev_priv = vm->dev->dev_private; |
566 | gen6_gtt_pte_t scratch_pte, __iomem *gtt_base = | 624 | gen6_gtt_pte_t scratch_pte, __iomem *gtt_base = |
@@ -573,7 +631,8 @@ static void gen6_ggtt_clear_range(struct i915_address_space *vm, | |||
573 | first_entry, num_entries, max_entries)) | 631 | first_entry, num_entries, max_entries)) |
574 | num_entries = max_entries; | 632 | num_entries = max_entries; |
575 | 633 | ||
576 | scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC); | 634 | scratch_pte = vm->pte_encode(vm->scratch.addr, I915_CACHE_LLC, use_scratch); |
635 | |||
577 | for (i = 0; i < num_entries; i++) | 636 | for (i = 0; i < num_entries; i++) |
578 | iowrite32(scratch_pte, >t_base[i]); | 637 | iowrite32(scratch_pte, >t_base[i]); |
579 | readl(gtt_base); | 638 | readl(gtt_base); |
@@ -594,7 +653,8 @@ static void i915_ggtt_insert_entries(struct i915_address_space *vm, | |||
594 | 653 | ||
595 | static void i915_ggtt_clear_range(struct i915_address_space *vm, | 654 | static void i915_ggtt_clear_range(struct i915_address_space *vm, |
596 | unsigned int first_entry, | 655 | unsigned int first_entry, |
597 | unsigned int num_entries) | 656 | unsigned int num_entries, |
657 | bool unused) | ||
598 | { | 658 | { |
599 | intel_gtt_clear_range(first_entry, num_entries); | 659 | intel_gtt_clear_range(first_entry, num_entries); |
600 | } | 660 | } |
@@ -622,7 +682,8 @@ void i915_gem_gtt_unbind_object(struct drm_i915_gem_object *obj) | |||
622 | 682 | ||
623 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, | 683 | dev_priv->gtt.base.clear_range(&dev_priv->gtt.base, |
624 | entry, | 684 | entry, |
625 | obj->base.size >> PAGE_SHIFT); | 685 | obj->base.size >> PAGE_SHIFT, |
686 | true); | ||
626 | 687 | ||
627 | obj->has_global_gtt_mapping = 0; | 688 | obj->has_global_gtt_mapping = 0; |
628 | } | 689 | } |
@@ -709,11 +770,11 @@ void i915_gem_setup_global_gtt(struct drm_device *dev, | |||
709 | const unsigned long count = (hole_end - hole_start) / PAGE_SIZE; | 770 | const unsigned long count = (hole_end - hole_start) / PAGE_SIZE; |
710 | DRM_DEBUG_KMS("clearing unused GTT space: [%lx, %lx]\n", | 771 | DRM_DEBUG_KMS("clearing unused GTT space: [%lx, %lx]\n", |
711 | hole_start, hole_end); | 772 | hole_start, hole_end); |
712 | ggtt_vm->clear_range(ggtt_vm, hole_start / PAGE_SIZE, count); | 773 | ggtt_vm->clear_range(ggtt_vm, hole_start / PAGE_SIZE, count, true); |
713 | } | 774 | } |
714 | 775 | ||
715 | /* And finally clear the reserved guard page */ | 776 | /* And finally clear the reserved guard page */ |
716 | ggtt_vm->clear_range(ggtt_vm, end / PAGE_SIZE - 1, 1); | 777 | ggtt_vm->clear_range(ggtt_vm, end / PAGE_SIZE - 1, 1, true); |
717 | } | 778 | } |
718 | 779 | ||
719 | static bool | 780 | static bool |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 38f96f65d87a..ef9b35479f01 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -604,6 +604,10 @@ | |||
604 | #define ARB_MODE_SWIZZLE_IVB (1<<5) | 604 | #define ARB_MODE_SWIZZLE_IVB (1<<5) |
605 | #define RENDER_HWS_PGA_GEN7 (0x04080) | 605 | #define RENDER_HWS_PGA_GEN7 (0x04080) |
606 | #define RING_FAULT_REG(ring) (0x4094 + 0x100*(ring)->id) | 606 | #define RING_FAULT_REG(ring) (0x4094 + 0x100*(ring)->id) |
607 | #define RING_FAULT_GTTSEL_MASK (1<<11) | ||
608 | #define RING_FAULT_SRCID(x) ((x >> 3) & 0xff) | ||
609 | #define RING_FAULT_FAULT_TYPE(x) ((x >> 1) & 0x3) | ||
610 | #define RING_FAULT_VALID (1<<0) | ||
607 | #define DONE_REG 0x40b0 | 611 | #define DONE_REG 0x40b0 |
608 | #define BSD_HWS_PGA_GEN7 (0x04180) | 612 | #define BSD_HWS_PGA_GEN7 (0x04180) |
609 | #define BLT_HWS_PGA_GEN7 (0x04280) | 613 | #define BLT_HWS_PGA_GEN7 (0x04280) |
@@ -4279,7 +4283,9 @@ | |||
4279 | #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN) | 4283 | #define FDI_RX_CHICKEN(pipe) _PIPE(pipe, _FDI_RXA_CHICKEN, _FDI_RXB_CHICKEN) |
4280 | 4284 | ||
4281 | #define SOUTH_DSPCLK_GATE_D 0xc2020 | 4285 | #define SOUTH_DSPCLK_GATE_D 0xc2020 |
4286 | #define PCH_DPLUNIT_CLOCK_GATE_DISABLE (1<<30) | ||
4282 | #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) | 4287 | #define PCH_DPLSUNIT_CLOCK_GATE_DISABLE (1<<29) |
4288 | #define PCH_CPUNIT_CLOCK_GATE_DISABLE (1<<14) | ||
4283 | #define PCH_LP_PARTITION_LEVEL_DISABLE (1<<12) | 4289 | #define PCH_LP_PARTITION_LEVEL_DISABLE (1<<12) |
4284 | 4290 | ||
4285 | /* CPU: FDI_TX */ | 4291 | /* CPU: FDI_TX */ |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index f4c5e95b2d6f..26c2ea3e985c 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -4759,7 +4759,9 @@ static void cpt_init_clock_gating(struct drm_device *dev) | |||
4759 | * gating for the panel power sequencer or it will fail to | 4759 | * gating for the panel power sequencer or it will fail to |
4760 | * start up when no ports are active. | 4760 | * start up when no ports are active. |
4761 | */ | 4761 | */ |
4762 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE); | 4762 | I915_WRITE(SOUTH_DSPCLK_GATE_D, PCH_DPLSUNIT_CLOCK_GATE_DISABLE | |
4763 | PCH_DPLUNIT_CLOCK_GATE_DISABLE | | ||
4764 | PCH_CPUNIT_CLOCK_GATE_DISABLE); | ||
4763 | I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | | 4765 | I915_WRITE(SOUTH_CHICKEN2, I915_READ(SOUTH_CHICKEN2) | |
4764 | DPLS_EDP_PPS_FIX_DIS); | 4766 | DPLS_EDP_PPS_FIX_DIS); |
4765 | /* The below fixes the weird display corruption, a few pixels shifted | 4767 | /* The below fixes the weird display corruption, a few pixels shifted |
diff --git a/drivers/gpu/drm/radeon/atombios_encoders.c b/drivers/gpu/drm/radeon/atombios_encoders.c index 32923d2f6002..5e891b226acf 100644 --- a/drivers/gpu/drm/radeon/atombios_encoders.c +++ b/drivers/gpu/drm/radeon/atombios_encoders.c | |||
@@ -707,24 +707,37 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
707 | switch (connector->connector_type) { | 707 | switch (connector->connector_type) { |
708 | case DRM_MODE_CONNECTOR_DVII: | 708 | case DRM_MODE_CONNECTOR_DVII: |
709 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ | 709 | case DRM_MODE_CONNECTOR_HDMIB: /* HDMI-B is basically DL-DVI; analog works fine */ |
710 | if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) || | 710 | if (radeon_audio != 0) { |
711 | (drm_detect_hdmi_monitor(radeon_connector->edid) && | 711 | if (radeon_connector->use_digital && |
712 | (radeon_connector->audio == RADEON_AUDIO_AUTO))) | 712 | (radeon_connector->audio == RADEON_AUDIO_ENABLE)) |
713 | return ATOM_ENCODER_MODE_HDMI; | 713 | return ATOM_ENCODER_MODE_HDMI; |
714 | else if (radeon_connector->use_digital) | 714 | else if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
715 | (radeon_connector->audio == RADEON_AUDIO_AUTO)) | ||
716 | return ATOM_ENCODER_MODE_HDMI; | ||
717 | else if (radeon_connector->use_digital) | ||
718 | return ATOM_ENCODER_MODE_DVI; | ||
719 | else | ||
720 | return ATOM_ENCODER_MODE_CRT; | ||
721 | } else if (radeon_connector->use_digital) { | ||
715 | return ATOM_ENCODER_MODE_DVI; | 722 | return ATOM_ENCODER_MODE_DVI; |
716 | else | 723 | } else { |
717 | return ATOM_ENCODER_MODE_CRT; | 724 | return ATOM_ENCODER_MODE_CRT; |
725 | } | ||
718 | break; | 726 | break; |
719 | case DRM_MODE_CONNECTOR_DVID: | 727 | case DRM_MODE_CONNECTOR_DVID: |
720 | case DRM_MODE_CONNECTOR_HDMIA: | 728 | case DRM_MODE_CONNECTOR_HDMIA: |
721 | default: | 729 | default: |
722 | if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) || | 730 | if (radeon_audio != 0) { |
723 | (drm_detect_hdmi_monitor(radeon_connector->edid) && | 731 | if (radeon_connector->audio == RADEON_AUDIO_ENABLE) |
724 | (radeon_connector->audio == RADEON_AUDIO_AUTO))) | 732 | return ATOM_ENCODER_MODE_HDMI; |
725 | return ATOM_ENCODER_MODE_HDMI; | 733 | else if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
726 | else | 734 | (radeon_connector->audio == RADEON_AUDIO_AUTO)) |
735 | return ATOM_ENCODER_MODE_HDMI; | ||
736 | else | ||
737 | return ATOM_ENCODER_MODE_DVI; | ||
738 | } else { | ||
727 | return ATOM_ENCODER_MODE_DVI; | 739 | return ATOM_ENCODER_MODE_DVI; |
740 | } | ||
728 | break; | 741 | break; |
729 | case DRM_MODE_CONNECTOR_LVDS: | 742 | case DRM_MODE_CONNECTOR_LVDS: |
730 | return ATOM_ENCODER_MODE_LVDS; | 743 | return ATOM_ENCODER_MODE_LVDS; |
@@ -732,14 +745,19 @@ atombios_get_encoder_mode(struct drm_encoder *encoder) | |||
732 | case DRM_MODE_CONNECTOR_DisplayPort: | 745 | case DRM_MODE_CONNECTOR_DisplayPort: |
733 | dig_connector = radeon_connector->con_priv; | 746 | dig_connector = radeon_connector->con_priv; |
734 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || | 747 | if ((dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_DISPLAYPORT) || |
735 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) | 748 | (dig_connector->dp_sink_type == CONNECTOR_OBJECT_ID_eDP)) { |
736 | return ATOM_ENCODER_MODE_DP; | 749 | return ATOM_ENCODER_MODE_DP; |
737 | else if ((radeon_connector->audio == RADEON_AUDIO_ENABLE) || | 750 | } else if (radeon_audio != 0) { |
738 | (drm_detect_hdmi_monitor(radeon_connector->edid) && | 751 | if (radeon_connector->audio == RADEON_AUDIO_ENABLE) |
739 | (radeon_connector->audio == RADEON_AUDIO_AUTO))) | 752 | return ATOM_ENCODER_MODE_HDMI; |
740 | return ATOM_ENCODER_MODE_HDMI; | 753 | else if (drm_detect_hdmi_monitor(radeon_connector->edid) && |
741 | else | 754 | (radeon_connector->audio == RADEON_AUDIO_AUTO)) |
755 | return ATOM_ENCODER_MODE_HDMI; | ||
756 | else | ||
757 | return ATOM_ENCODER_MODE_DVI; | ||
758 | } else { | ||
742 | return ATOM_ENCODER_MODE_DVI; | 759 | return ATOM_ENCODER_MODE_DVI; |
760 | } | ||
743 | break; | 761 | break; |
744 | case DRM_MODE_CONNECTOR_eDP: | 762 | case DRM_MODE_CONNECTOR_eDP: |
745 | return ATOM_ENCODER_MODE_DP; | 763 | return ATOM_ENCODER_MODE_DP; |
@@ -1655,7 +1673,7 @@ radeon_atom_encoder_dpms_dig(struct drm_encoder *encoder, int mode) | |||
1655 | * does the same thing and more. | 1673 | * does the same thing and more. |
1656 | */ | 1674 | */ |
1657 | if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) && | 1675 | if ((rdev->family != CHIP_RV710) && (rdev->family != CHIP_RV730) && |
1658 | (rdev->family != CHIP_RS880)) | 1676 | (rdev->family != CHIP_RS780) && (rdev->family != CHIP_RS880)) |
1659 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); | 1677 | atombios_dig_transmitter_setup(encoder, ATOM_TRANSMITTER_ACTION_ENABLE_OUTPUT, 0, 0); |
1660 | } | 1678 | } |
1661 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { | 1679 | if (ENCODER_MODE_IS_DP(atombios_get_encoder_mode(encoder)) && connector) { |
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index b874ccdf52f7..9cd2bc989ac7 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -1694,6 +1694,7 @@ static int cik_init_microcode(struct radeon_device *rdev) | |||
1694 | fw_name); | 1694 | fw_name); |
1695 | release_firmware(rdev->smc_fw); | 1695 | release_firmware(rdev->smc_fw); |
1696 | rdev->smc_fw = NULL; | 1696 | rdev->smc_fw = NULL; |
1697 | err = 0; | ||
1697 | } else if (rdev->smc_fw->size != smc_req_size) { | 1698 | } else if (rdev->smc_fw->size != smc_req_size) { |
1698 | printk(KERN_ERR | 1699 | printk(KERN_ERR |
1699 | "cik_smc: Bogus length %zu in firmware \"%s\"\n", | 1700 | "cik_smc: Bogus length %zu in firmware \"%s\"\n", |
@@ -3182,6 +3183,7 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
3182 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); | 3183 | r = radeon_ib_get(rdev, ring->idx, &ib, NULL, 256); |
3183 | if (r) { | 3184 | if (r) { |
3184 | DRM_ERROR("radeon: failed to get ib (%d).\n", r); | 3185 | DRM_ERROR("radeon: failed to get ib (%d).\n", r); |
3186 | radeon_scratch_free(rdev, scratch); | ||
3185 | return r; | 3187 | return r; |
3186 | } | 3188 | } |
3187 | ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1); | 3189 | ib.ptr[0] = PACKET3(PACKET3_SET_UCONFIG_REG, 1); |
@@ -3198,6 +3200,8 @@ int cik_ib_test(struct radeon_device *rdev, struct radeon_ring *ring) | |||
3198 | r = radeon_fence_wait(ib.fence, false); | 3200 | r = radeon_fence_wait(ib.fence, false); |
3199 | if (r) { | 3201 | if (r) { |
3200 | DRM_ERROR("radeon: fence wait failed (%d).\n", r); | 3202 | DRM_ERROR("radeon: fence wait failed (%d).\n", r); |
3203 | radeon_scratch_free(rdev, scratch); | ||
3204 | radeon_ib_free(rdev, &ib); | ||
3201 | return r; | 3205 | return r; |
3202 | } | 3206 | } |
3203 | for (i = 0; i < rdev->usec_timeout; i++) { | 3207 | for (i = 0; i < rdev->usec_timeout; i++) { |
diff --git a/drivers/gpu/drm/radeon/dce6_afmt.c b/drivers/gpu/drm/radeon/dce6_afmt.c index 85a69d2ea3d2..9fcd338c0fcf 100644 --- a/drivers/gpu/drm/radeon/dce6_afmt.c +++ b/drivers/gpu/drm/radeon/dce6_afmt.c | |||
@@ -113,6 +113,9 @@ void dce6_afmt_write_speaker_allocation(struct drm_encoder *encoder) | |||
113 | u8 *sadb; | 113 | u8 *sadb; |
114 | int sad_count; | 114 | int sad_count; |
115 | 115 | ||
116 | /* XXX: setting this register causes hangs on some asics */ | ||
117 | return; | ||
118 | |||
116 | if (!dig->afmt->pin) | 119 | if (!dig->afmt->pin) |
117 | return; | 120 | return; |
118 | 121 | ||
diff --git a/drivers/gpu/drm/radeon/evergreen_hdmi.c b/drivers/gpu/drm/radeon/evergreen_hdmi.c index f815c20640bd..fe1de855775e 100644 --- a/drivers/gpu/drm/radeon/evergreen_hdmi.c +++ b/drivers/gpu/drm/radeon/evergreen_hdmi.c | |||
@@ -67,6 +67,9 @@ static void dce4_afmt_write_speaker_allocation(struct drm_encoder *encoder) | |||
67 | u8 *sadb; | 67 | u8 *sadb; |
68 | int sad_count; | 68 | int sad_count; |
69 | 69 | ||
70 | /* XXX: setting this register causes hangs on some asics */ | ||
71 | return; | ||
72 | |||
70 | list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { | 73 | list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { |
71 | if (connector->encoder == encoder) | 74 | if (connector->encoder == encoder) |
72 | radeon_connector = to_radeon_connector(connector); | 75 | radeon_connector = to_radeon_connector(connector); |
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 93c1f9ef5da9..cac2866d79da 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -804,6 +804,7 @@ int ni_init_microcode(struct radeon_device *rdev) | |||
804 | fw_name); | 804 | fw_name); |
805 | release_firmware(rdev->smc_fw); | 805 | release_firmware(rdev->smc_fw); |
806 | rdev->smc_fw = NULL; | 806 | rdev->smc_fw = NULL; |
807 | err = 0; | ||
807 | } else if (rdev->smc_fw->size != smc_req_size) { | 808 | } else if (rdev->smc_fw->size != smc_req_size) { |
808 | printk(KERN_ERR | 809 | printk(KERN_ERR |
809 | "ni_mc: Bogus length %zu in firmware \"%s\"\n", | 810 | "ni_mc: Bogus length %zu in firmware \"%s\"\n", |
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c index 2a1b1876b431..f9be22062df1 100644 --- a/drivers/gpu/drm/radeon/r600.c +++ b/drivers/gpu/drm/radeon/r600.c | |||
@@ -2302,6 +2302,7 @@ int r600_init_microcode(struct radeon_device *rdev) | |||
2302 | fw_name); | 2302 | fw_name); |
2303 | release_firmware(rdev->smc_fw); | 2303 | release_firmware(rdev->smc_fw); |
2304 | rdev->smc_fw = NULL; | 2304 | rdev->smc_fw = NULL; |
2305 | err = 0; | ||
2305 | } else if (rdev->smc_fw->size != smc_req_size) { | 2306 | } else if (rdev->smc_fw->size != smc_req_size) { |
2306 | printk(KERN_ERR | 2307 | printk(KERN_ERR |
2307 | "smc: Bogus length %zu in firmware \"%s\"\n", | 2308 | "smc: Bogus length %zu in firmware \"%s\"\n", |
diff --git a/drivers/gpu/drm/radeon/r600_hdmi.c b/drivers/gpu/drm/radeon/r600_hdmi.c index 5b729319f27b..06022e3b9c3b 100644 --- a/drivers/gpu/drm/radeon/r600_hdmi.c +++ b/drivers/gpu/drm/radeon/r600_hdmi.c | |||
@@ -309,6 +309,9 @@ static void dce3_2_afmt_write_speaker_allocation(struct drm_encoder *encoder) | |||
309 | u8 *sadb; | 309 | u8 *sadb; |
310 | int sad_count; | 310 | int sad_count; |
311 | 311 | ||
312 | /* XXX: setting this register causes hangs on some asics */ | ||
313 | return; | ||
314 | |||
312 | list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { | 315 | list_for_each_entry(connector, &encoder->dev->mode_config.connector_list, head) { |
313 | if (connector->encoder == encoder) | 316 | if (connector->encoder == encoder) |
314 | radeon_connector = to_radeon_connector(connector); | 317 | radeon_connector = to_radeon_connector(connector); |
diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c index 79159b5da05b..64565732cb98 100644 --- a/drivers/gpu/drm/radeon/radeon_connectors.c +++ b/drivers/gpu/drm/radeon/radeon_connectors.c | |||
@@ -1658,9 +1658,12 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1658 | drm_object_attach_property(&radeon_connector->base.base, | 1658 | drm_object_attach_property(&radeon_connector->base.base, |
1659 | rdev->mode_info.underscan_vborder_property, | 1659 | rdev->mode_info.underscan_vborder_property, |
1660 | 0); | 1660 | 0); |
1661 | drm_object_attach_property(&radeon_connector->base.base, | 1661 | if (radeon_audio != 0) |
1662 | rdev->mode_info.audio_property, | 1662 | drm_object_attach_property(&radeon_connector->base.base, |
1663 | RADEON_AUDIO_DISABLE); | 1663 | rdev->mode_info.audio_property, |
1664 | (radeon_audio == 1) ? | ||
1665 | RADEON_AUDIO_AUTO : | ||
1666 | RADEON_AUDIO_DISABLE); | ||
1664 | subpixel_order = SubPixelHorizontalRGB; | 1667 | subpixel_order = SubPixelHorizontalRGB; |
1665 | connector->interlace_allowed = true; | 1668 | connector->interlace_allowed = true; |
1666 | if (connector_type == DRM_MODE_CONNECTOR_HDMIB) | 1669 | if (connector_type == DRM_MODE_CONNECTOR_HDMIB) |
@@ -1754,10 +1757,12 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1754 | rdev->mode_info.underscan_vborder_property, | 1757 | rdev->mode_info.underscan_vborder_property, |
1755 | 0); | 1758 | 0); |
1756 | } | 1759 | } |
1757 | if (ASIC_IS_DCE2(rdev)) { | 1760 | if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) { |
1758 | drm_object_attach_property(&radeon_connector->base.base, | 1761 | drm_object_attach_property(&radeon_connector->base.base, |
1759 | rdev->mode_info.audio_property, | 1762 | rdev->mode_info.audio_property, |
1760 | RADEON_AUDIO_DISABLE); | 1763 | (radeon_audio == 1) ? |
1764 | RADEON_AUDIO_AUTO : | ||
1765 | RADEON_AUDIO_DISABLE); | ||
1761 | } | 1766 | } |
1762 | if (connector_type == DRM_MODE_CONNECTOR_DVII) { | 1767 | if (connector_type == DRM_MODE_CONNECTOR_DVII) { |
1763 | radeon_connector->dac_load_detect = true; | 1768 | radeon_connector->dac_load_detect = true; |
@@ -1799,10 +1804,12 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1799 | rdev->mode_info.underscan_vborder_property, | 1804 | rdev->mode_info.underscan_vborder_property, |
1800 | 0); | 1805 | 0); |
1801 | } | 1806 | } |
1802 | if (ASIC_IS_DCE2(rdev)) { | 1807 | if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) { |
1803 | drm_object_attach_property(&radeon_connector->base.base, | 1808 | drm_object_attach_property(&radeon_connector->base.base, |
1804 | rdev->mode_info.audio_property, | 1809 | rdev->mode_info.audio_property, |
1805 | RADEON_AUDIO_DISABLE); | 1810 | (radeon_audio == 1) ? |
1811 | RADEON_AUDIO_AUTO : | ||
1812 | RADEON_AUDIO_DISABLE); | ||
1806 | } | 1813 | } |
1807 | subpixel_order = SubPixelHorizontalRGB; | 1814 | subpixel_order = SubPixelHorizontalRGB; |
1808 | connector->interlace_allowed = true; | 1815 | connector->interlace_allowed = true; |
@@ -1843,10 +1850,12 @@ radeon_add_atom_connector(struct drm_device *dev, | |||
1843 | rdev->mode_info.underscan_vborder_property, | 1850 | rdev->mode_info.underscan_vborder_property, |
1844 | 0); | 1851 | 0); |
1845 | } | 1852 | } |
1846 | if (ASIC_IS_DCE2(rdev)) { | 1853 | if (ASIC_IS_DCE2(rdev) && (radeon_audio != 0)) { |
1847 | drm_object_attach_property(&radeon_connector->base.base, | 1854 | drm_object_attach_property(&radeon_connector->base.base, |
1848 | rdev->mode_info.audio_property, | 1855 | rdev->mode_info.audio_property, |
1849 | RADEON_AUDIO_DISABLE); | 1856 | (radeon_audio == 1) ? |
1857 | RADEON_AUDIO_AUTO : | ||
1858 | RADEON_AUDIO_DISABLE); | ||
1850 | } | 1859 | } |
1851 | connector->interlace_allowed = true; | 1860 | connector->interlace_allowed = true; |
1852 | /* in theory with a DP to VGA converter... */ | 1861 | /* in theory with a DP to VGA converter... */ |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 66c222836631..80285e35bc65 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
@@ -85,9 +85,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) | |||
85 | VRAM, also but everything into VRAM on AGP cards to avoid | 85 | VRAM, also but everything into VRAM on AGP cards to avoid |
86 | image corruptions */ | 86 | image corruptions */ |
87 | if (p->ring == R600_RING_TYPE_UVD_INDEX && | 87 | if (p->ring == R600_RING_TYPE_UVD_INDEX && |
88 | p->rdev->family < CHIP_PALM && | ||
89 | (i == 0 || drm_pci_device_is_agp(p->rdev->ddev))) { | 88 | (i == 0 || drm_pci_device_is_agp(p->rdev->ddev))) { |
90 | 89 | /* TODO: is this still needed for NI+ ? */ | |
91 | p->relocs[i].lobj.domain = | 90 | p->relocs[i].lobj.domain = |
92 | RADEON_GEM_DOMAIN_VRAM; | 91 | RADEON_GEM_DOMAIN_VRAM; |
93 | 92 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index cdd12dcd988b..9c14a1ba1de4 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -153,7 +153,7 @@ int radeon_benchmarking = 0; | |||
153 | int radeon_testing = 0; | 153 | int radeon_testing = 0; |
154 | int radeon_connector_table = 0; | 154 | int radeon_connector_table = 0; |
155 | int radeon_tv = 1; | 155 | int radeon_tv = 1; |
156 | int radeon_audio = 1; | 156 | int radeon_audio = -1; |
157 | int radeon_disp_priority = 0; | 157 | int radeon_disp_priority = 0; |
158 | int radeon_hw_i2c = 0; | 158 | int radeon_hw_i2c = 0; |
159 | int radeon_pcie_gen2 = -1; | 159 | int radeon_pcie_gen2 = -1; |
@@ -196,7 +196,7 @@ module_param_named(connector_table, radeon_connector_table, int, 0444); | |||
196 | MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); | 196 | MODULE_PARM_DESC(tv, "TV enable (0 = disable)"); |
197 | module_param_named(tv, radeon_tv, int, 0444); | 197 | module_param_named(tv, radeon_tv, int, 0444); |
198 | 198 | ||
199 | MODULE_PARM_DESC(audio, "Audio enable (1 = enable)"); | 199 | MODULE_PARM_DESC(audio, "Audio enable (-1 = auto, 0 = disable, 1 = enable)"); |
200 | module_param_named(audio, radeon_audio, int, 0444); | 200 | module_param_named(audio, radeon_audio, int, 0444); |
201 | 201 | ||
202 | MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)"); | 202 | MODULE_PARM_DESC(disp_priority, "Display Priority (0 = auto, 1 = normal, 2 = high)"); |
diff --git a/drivers/gpu/drm/radeon/radeon_uvd.c b/drivers/gpu/drm/radeon/radeon_uvd.c index 4f2e73f79638..308eff5be1b4 100644 --- a/drivers/gpu/drm/radeon/radeon_uvd.c +++ b/drivers/gpu/drm/radeon/radeon_uvd.c | |||
@@ -476,7 +476,8 @@ static int radeon_uvd_cs_reloc(struct radeon_cs_parser *p, | |||
476 | return -EINVAL; | 476 | return -EINVAL; |
477 | } | 477 | } |
478 | 478 | ||
479 | if (p->rdev->family < CHIP_PALM && (cmd == 0 || cmd == 0x3) && | 479 | /* TODO: is this still necessary on NI+ ? */ |
480 | if ((cmd == 0 || cmd == 0x3) && | ||
480 | (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) { | 481 | (start >> 28) != (p->rdev->uvd.gpu_addr >> 28)) { |
481 | DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n", | 482 | DRM_ERROR("msg/fb buffer %LX-%LX out of 256MB segment!\n", |
482 | start, end); | 483 | start, end); |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index d4652af425b8..d96f7cbca0a1 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -1681,6 +1681,7 @@ static int si_init_microcode(struct radeon_device *rdev) | |||
1681 | fw_name); | 1681 | fw_name); |
1682 | release_firmware(rdev->smc_fw); | 1682 | release_firmware(rdev->smc_fw); |
1683 | rdev->smc_fw = NULL; | 1683 | rdev->smc_fw = NULL; |
1684 | err = 0; | ||
1684 | } else if (rdev->smc_fw->size != smc_req_size) { | 1685 | } else if (rdev->smc_fw->size != smc_req_size) { |
1685 | printk(KERN_ERR | 1686 | printk(KERN_ERR |
1686 | "si_smc: Bogus length %zu in firmware \"%s\"\n", | 1687 | "si_smc: Bogus length %zu in firmware \"%s\"\n", |
diff --git a/drivers/gpu/drm/radeon/uvd_v1_0.c b/drivers/gpu/drm/radeon/uvd_v1_0.c index 3100fa9cb52f..7266805d9786 100644 --- a/drivers/gpu/drm/radeon/uvd_v1_0.c +++ b/drivers/gpu/drm/radeon/uvd_v1_0.c | |||
@@ -212,8 +212,8 @@ int uvd_v1_0_start(struct radeon_device *rdev) | |||
212 | /* enable VCPU clock */ | 212 | /* enable VCPU clock */ |
213 | WREG32(UVD_VCPU_CNTL, 1 << 9); | 213 | WREG32(UVD_VCPU_CNTL, 1 << 9); |
214 | 214 | ||
215 | /* enable UMC and NC0 */ | 215 | /* enable UMC */ |
216 | WREG32_P(UVD_LMI_CTRL2, 1 << 13, ~((1 << 8) | (1 << 13))); | 216 | WREG32_P(UVD_LMI_CTRL2, 0, ~(1 << 8)); |
217 | 217 | ||
218 | /* boot up the VCPU */ | 218 | /* boot up the VCPU */ |
219 | WREG32(UVD_SOFT_RESET, 0); | 219 | WREG32(UVD_SOFT_RESET, 0); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index 1a90f0a2f7e5..0508f93b9795 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
@@ -740,9 +740,17 @@ static void vmw_postclose(struct drm_device *dev, | |||
740 | struct vmw_fpriv *vmw_fp; | 740 | struct vmw_fpriv *vmw_fp; |
741 | 741 | ||
742 | vmw_fp = vmw_fpriv(file_priv); | 742 | vmw_fp = vmw_fpriv(file_priv); |
743 | ttm_object_file_release(&vmw_fp->tfile); | 743 | |
744 | if (vmw_fp->locked_master) | 744 | if (vmw_fp->locked_master) { |
745 | struct vmw_master *vmaster = | ||
746 | vmw_master(vmw_fp->locked_master); | ||
747 | |||
748 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | ||
749 | ttm_vt_unlock(&vmaster->lock); | ||
745 | drm_master_put(&vmw_fp->locked_master); | 750 | drm_master_put(&vmw_fp->locked_master); |
751 | } | ||
752 | |||
753 | ttm_object_file_release(&vmw_fp->tfile); | ||
746 | kfree(vmw_fp); | 754 | kfree(vmw_fp); |
747 | } | 755 | } |
748 | 756 | ||
@@ -925,14 +933,13 @@ static void vmw_master_drop(struct drm_device *dev, | |||
925 | 933 | ||
926 | vmw_fp->locked_master = drm_master_get(file_priv->master); | 934 | vmw_fp->locked_master = drm_master_get(file_priv->master); |
927 | ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile); | 935 | ret = ttm_vt_lock(&vmaster->lock, false, vmw_fp->tfile); |
928 | vmw_execbuf_release_pinned_bo(dev_priv); | ||
929 | |||
930 | if (unlikely((ret != 0))) { | 936 | if (unlikely((ret != 0))) { |
931 | DRM_ERROR("Unable to lock TTM at VT switch.\n"); | 937 | DRM_ERROR("Unable to lock TTM at VT switch.\n"); |
932 | drm_master_put(&vmw_fp->locked_master); | 938 | drm_master_put(&vmw_fp->locked_master); |
933 | } | 939 | } |
934 | 940 | ||
935 | ttm_lock_set_kill(&vmaster->lock, true, SIGTERM); | 941 | ttm_lock_set_kill(&vmaster->lock, false, SIGTERM); |
942 | vmw_execbuf_release_pinned_bo(dev_priv); | ||
936 | 943 | ||
937 | if (!dev_priv->enable_fb) { | 944 | if (!dev_priv->enable_fb) { |
938 | ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); | 945 | ret = ttm_bo_evict_mm(&dev_priv->bdev, TTM_PL_VRAM); |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c index 0e67cf41065d..37fb4befec82 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_resource.c | |||
@@ -970,7 +970,7 @@ void vmw_resource_unreserve(struct vmw_resource *res, | |||
970 | if (new_backup) | 970 | if (new_backup) |
971 | res->backup_offset = new_backup_offset; | 971 | res->backup_offset = new_backup_offset; |
972 | 972 | ||
973 | if (!res->func->may_evict) | 973 | if (!res->func->may_evict || res->id == -1) |
974 | return; | 974 | return; |
975 | 975 | ||
976 | write_lock(&dev_priv->resource_lock); | 976 | write_lock(&dev_priv->resource_lock); |
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index 5a8c01112a23..e80da62363bc 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -319,7 +319,7 @@ static s32 item_sdata(struct hid_item *item) | |||
319 | 319 | ||
320 | static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) | 320 | static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) |
321 | { | 321 | { |
322 | __u32 raw_value; | 322 | __s32 raw_value; |
323 | switch (item->tag) { | 323 | switch (item->tag) { |
324 | case HID_GLOBAL_ITEM_TAG_PUSH: | 324 | case HID_GLOBAL_ITEM_TAG_PUSH: |
325 | 325 | ||
@@ -370,10 +370,11 @@ static int hid_parser_global(struct hid_parser *parser, struct hid_item *item) | |||
370 | return 0; | 370 | return 0; |
371 | 371 | ||
372 | case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: | 372 | case HID_GLOBAL_ITEM_TAG_UNIT_EXPONENT: |
373 | /* Units exponent negative numbers are given through a | 373 | /* Many devices provide unit exponent as a two's complement |
374 | * two's complement. | 374 | * nibble due to the common misunderstanding of HID |
375 | * See "6.2.2.7 Global Items" for more information. */ | 375 | * specification 1.11, 6.2.2.7 Global Items. Attempt to handle |
376 | raw_value = item_udata(item); | 376 | * both this and the standard encoding. */ |
377 | raw_value = item_sdata(item); | ||
377 | if (!(raw_value & 0xfffffff0)) | 378 | if (!(raw_value & 0xfffffff0)) |
378 | parser->global.unit_exponent = hid_snto32(raw_value, 4); | 379 | parser->global.unit_exponent = hid_snto32(raw_value, 4); |
379 | else | 380 | else |
@@ -1870,6 +1871,7 @@ static const struct hid_device_id hid_have_special_driver[] = { | |||
1870 | 1871 | ||
1871 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, | 1872 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_PRESENTER_8K_BT) }, |
1872 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | 1873 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
1874 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | ||
1873 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, | 1875 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
1874 | { } | 1876 | { } |
1875 | }; | 1877 | }; |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index 9cbc7ab07dfa..f0296a50be5f 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -633,6 +633,7 @@ | |||
633 | #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 | 633 | #define USB_DEVICE_ID_NEXTWINDOW_TOUCHSCREEN 0x0003 |
634 | 634 | ||
635 | #define USB_VENDOR_ID_NINTENDO 0x057e | 635 | #define USB_VENDOR_ID_NINTENDO 0x057e |
636 | #define USB_VENDOR_ID_NINTENDO2 0x054c | ||
636 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 | 637 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306 |
637 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 | 638 | #define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330 |
638 | 639 | ||
@@ -792,6 +793,8 @@ | |||
792 | #define USB_DEVICE_ID_SYNAPTICS_COMP_TP 0x0009 | 793 | #define USB_DEVICE_ID_SYNAPTICS_COMP_TP 0x0009 |
793 | #define USB_DEVICE_ID_SYNAPTICS_WTP 0x0010 | 794 | #define USB_DEVICE_ID_SYNAPTICS_WTP 0x0010 |
794 | #define USB_DEVICE_ID_SYNAPTICS_DPAD 0x0013 | 795 | #define USB_DEVICE_ID_SYNAPTICS_DPAD 0x0013 |
796 | #define USB_DEVICE_ID_SYNAPTICS_LTS1 0x0af8 | ||
797 | #define USB_DEVICE_ID_SYNAPTICS_LTS2 0x1d10 | ||
795 | 798 | ||
796 | #define USB_VENDOR_ID_THINGM 0x27b8 | 799 | #define USB_VENDOR_ID_THINGM 0x27b8 |
797 | #define USB_DEVICE_ID_BLINK1 0x01ed | 800 | #define USB_DEVICE_ID_BLINK1 0x01ed |
@@ -919,4 +922,7 @@ | |||
919 | #define USB_VENDOR_ID_PRIMAX 0x0461 | 922 | #define USB_VENDOR_ID_PRIMAX 0x0461 |
920 | #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 | 923 | #define USB_DEVICE_ID_PRIMAX_KEYBOARD 0x4e05 |
921 | 924 | ||
925 | #define USB_VENDOR_ID_SIS 0x0457 | ||
926 | #define USB_DEVICE_ID_SIS_TS 0x1013 | ||
927 | |||
922 | #endif | 928 | #endif |
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c index 8741d953dcc8..d97f2323af57 100644 --- a/drivers/hid/hid-input.c +++ b/drivers/hid/hid-input.c | |||
@@ -192,6 +192,7 @@ static int hidinput_setkeycode(struct input_dev *dev, | |||
192 | return -EINVAL; | 192 | return -EINVAL; |
193 | } | 193 | } |
194 | 194 | ||
195 | |||
195 | /** | 196 | /** |
196 | * hidinput_calc_abs_res - calculate an absolute axis resolution | 197 | * hidinput_calc_abs_res - calculate an absolute axis resolution |
197 | * @field: the HID report field to calculate resolution for | 198 | * @field: the HID report field to calculate resolution for |
@@ -234,23 +235,17 @@ __s32 hidinput_calc_abs_res(const struct hid_field *field, __u16 code) | |||
234 | case ABS_MT_TOOL_Y: | 235 | case ABS_MT_TOOL_Y: |
235 | case ABS_MT_TOUCH_MAJOR: | 236 | case ABS_MT_TOUCH_MAJOR: |
236 | case ABS_MT_TOUCH_MINOR: | 237 | case ABS_MT_TOUCH_MINOR: |
237 | if (field->unit & 0xffffff00) /* Not a length */ | 238 | if (field->unit == 0x11) { /* If centimeters */ |
238 | return 0; | ||
239 | unit_exponent += hid_snto32(field->unit >> 4, 4) - 1; | ||
240 | switch (field->unit & 0xf) { | ||
241 | case 0x1: /* If centimeters */ | ||
242 | /* Convert to millimeters */ | 239 | /* Convert to millimeters */ |
243 | unit_exponent += 1; | 240 | unit_exponent += 1; |
244 | break; | 241 | } else if (field->unit == 0x13) { /* If inches */ |
245 | case 0x3: /* If inches */ | ||
246 | /* Convert to millimeters */ | 242 | /* Convert to millimeters */ |
247 | prev = physical_extents; | 243 | prev = physical_extents; |
248 | physical_extents *= 254; | 244 | physical_extents *= 254; |
249 | if (physical_extents < prev) | 245 | if (physical_extents < prev) |
250 | return 0; | 246 | return 0; |
251 | unit_exponent -= 1; | 247 | unit_exponent -= 1; |
252 | break; | 248 | } else { |
253 | default: | ||
254 | return 0; | 249 | return 0; |
255 | } | 250 | } |
256 | break; | 251 | break; |
diff --git a/drivers/hid/hid-wiimote-core.c b/drivers/hid/hid-wiimote-core.c index abb20db2b443..1446f526ee8b 100644 --- a/drivers/hid/hid-wiimote-core.c +++ b/drivers/hid/hid-wiimote-core.c | |||
@@ -834,7 +834,8 @@ static void wiimote_init_set_type(struct wiimote_data *wdata, | |||
834 | goto done; | 834 | goto done; |
835 | } | 835 | } |
836 | 836 | ||
837 | if (vendor == USB_VENDOR_ID_NINTENDO) { | 837 | if (vendor == USB_VENDOR_ID_NINTENDO || |
838 | vendor == USB_VENDOR_ID_NINTENDO2) { | ||
838 | if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { | 839 | if (product == USB_DEVICE_ID_NINTENDO_WIIMOTE) { |
839 | devtype = WIIMOTE_DEV_GEN10; | 840 | devtype = WIIMOTE_DEV_GEN10; |
840 | goto done; | 841 | goto done; |
@@ -1855,6 +1856,8 @@ static void wiimote_hid_remove(struct hid_device *hdev) | |||
1855 | static const struct hid_device_id wiimote_hid_devices[] = { | 1856 | static const struct hid_device_id wiimote_hid_devices[] = { |
1856 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, | 1857 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
1857 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | 1858 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, |
1859 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO2, | ||
1860 | USB_DEVICE_ID_NINTENDO_WIIMOTE) }, | ||
1858 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, | 1861 | { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_NINTENDO, |
1859 | USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, | 1862 | USB_DEVICE_ID_NINTENDO_WIIMOTE2) }, |
1860 | { } | 1863 | { } |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 07345521f421..3fca3be08337 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -110,6 +110,9 @@ static const struct hid_blacklist { | |||
110 | { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT }, | 110 | { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X, HID_QUIRK_MULTI_INPUT }, |
111 | { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT }, | 111 | { USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_EASYPEN_M610X, HID_QUIRK_MULTI_INPUT }, |
112 | { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS }, | 112 | { USB_VENDOR_ID_NTRIG, USB_DEVICE_ID_NTRIG_DUOSENSE, HID_QUIRK_NO_INIT_REPORTS }, |
113 | { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS1, HID_QUIRK_NO_INIT_REPORTS }, | ||
114 | { USB_VENDOR_ID_SYNAPTICS, USB_DEVICE_ID_SYNAPTICS_LTS2, HID_QUIRK_NO_INIT_REPORTS }, | ||
115 | { USB_VENDOR_ID_SIS, USB_DEVICE_ID_SIS_TS, HID_QUIRK_NO_INIT_REPORTS }, | ||
113 | 116 | ||
114 | { 0, 0 } | 117 | { 0, 0 } |
115 | }; | 118 | }; |
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index 5ceda710f516..b84791f03a27 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
@@ -31,6 +31,17 @@ config INFINIBAND_USER_ACCESS | |||
31 | libibverbs, libibcm and a hardware driver library from | 31 | libibverbs, libibcm and a hardware driver library from |
32 | <http://www.openfabrics.org/git/>. | 32 | <http://www.openfabrics.org/git/>. |
33 | 33 | ||
34 | config INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
35 | bool "Experimental and unstable ABI for userspace access to flow steering verbs" | ||
36 | depends on INFINIBAND_USER_ACCESS | ||
37 | depends on STAGING | ||
38 | ---help--- | ||
39 | The final ABI for userspace access to flow steering verbs | ||
40 | has not been defined. To use the current ABI, *WHICH WILL | ||
41 | CHANGE IN THE FUTURE*, say Y here. | ||
42 | |||
43 | If unsure, say N. | ||
44 | |||
34 | config INFINIBAND_USER_MEM | 45 | config INFINIBAND_USER_MEM |
35 | bool | 46 | bool |
36 | depends on INFINIBAND_USER_ACCESS != n | 47 | depends on INFINIBAND_USER_ACCESS != n |
diff --git a/drivers/infiniband/core/uverbs.h b/drivers/infiniband/core/uverbs.h index d040b877475f..d8f9c6c272d7 100644 --- a/drivers/infiniband/core/uverbs.h +++ b/drivers/infiniband/core/uverbs.h | |||
@@ -217,7 +217,9 @@ IB_UVERBS_DECLARE_CMD(destroy_srq); | |||
217 | IB_UVERBS_DECLARE_CMD(create_xsrq); | 217 | IB_UVERBS_DECLARE_CMD(create_xsrq); |
218 | IB_UVERBS_DECLARE_CMD(open_xrcd); | 218 | IB_UVERBS_DECLARE_CMD(open_xrcd); |
219 | IB_UVERBS_DECLARE_CMD(close_xrcd); | 219 | IB_UVERBS_DECLARE_CMD(close_xrcd); |
220 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
220 | IB_UVERBS_DECLARE_CMD(create_flow); | 221 | IB_UVERBS_DECLARE_CMD(create_flow); |
221 | IB_UVERBS_DECLARE_CMD(destroy_flow); | 222 | IB_UVERBS_DECLARE_CMD(destroy_flow); |
223 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
222 | 224 | ||
223 | #endif /* UVERBS_H */ | 225 | #endif /* UVERBS_H */ |
diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index f2b81b9ee0d6..2f0f01b70e3b 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c | |||
@@ -54,7 +54,9 @@ static struct uverbs_lock_class qp_lock_class = { .name = "QP-uobj" }; | |||
54 | static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" }; | 54 | static struct uverbs_lock_class ah_lock_class = { .name = "AH-uobj" }; |
55 | static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" }; | 55 | static struct uverbs_lock_class srq_lock_class = { .name = "SRQ-uobj" }; |
56 | static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" }; | 56 | static struct uverbs_lock_class xrcd_lock_class = { .name = "XRCD-uobj" }; |
57 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
57 | static struct uverbs_lock_class rule_lock_class = { .name = "RULE-uobj" }; | 58 | static struct uverbs_lock_class rule_lock_class = { .name = "RULE-uobj" }; |
59 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
58 | 60 | ||
59 | #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \ | 61 | #define INIT_UDATA(udata, ibuf, obuf, ilen, olen) \ |
60 | do { \ | 62 | do { \ |
@@ -2599,6 +2601,7 @@ out_put: | |||
2599 | return ret ? ret : in_len; | 2601 | return ret ? ret : in_len; |
2600 | } | 2602 | } |
2601 | 2603 | ||
2604 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
2602 | static int kern_spec_to_ib_spec(struct ib_kern_spec *kern_spec, | 2605 | static int kern_spec_to_ib_spec(struct ib_kern_spec *kern_spec, |
2603 | union ib_flow_spec *ib_spec) | 2606 | union ib_flow_spec *ib_spec) |
2604 | { | 2607 | { |
@@ -2824,6 +2827,7 @@ ssize_t ib_uverbs_destroy_flow(struct ib_uverbs_file *file, | |||
2824 | 2827 | ||
2825 | return ret ? ret : in_len; | 2828 | return ret ? ret : in_len; |
2826 | } | 2829 | } |
2830 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
2827 | 2831 | ||
2828 | static int __uverbs_create_xsrq(struct ib_uverbs_file *file, | 2832 | static int __uverbs_create_xsrq(struct ib_uverbs_file *file, |
2829 | struct ib_uverbs_create_xsrq *cmd, | 2833 | struct ib_uverbs_create_xsrq *cmd, |
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c index 75ad86c4abf8..2df31f68ea09 100644 --- a/drivers/infiniband/core/uverbs_main.c +++ b/drivers/infiniband/core/uverbs_main.c | |||
@@ -115,8 +115,10 @@ static ssize_t (*uverbs_cmd_table[])(struct ib_uverbs_file *file, | |||
115 | [IB_USER_VERBS_CMD_CLOSE_XRCD] = ib_uverbs_close_xrcd, | 115 | [IB_USER_VERBS_CMD_CLOSE_XRCD] = ib_uverbs_close_xrcd, |
116 | [IB_USER_VERBS_CMD_CREATE_XSRQ] = ib_uverbs_create_xsrq, | 116 | [IB_USER_VERBS_CMD_CREATE_XSRQ] = ib_uverbs_create_xsrq, |
117 | [IB_USER_VERBS_CMD_OPEN_QP] = ib_uverbs_open_qp, | 117 | [IB_USER_VERBS_CMD_OPEN_QP] = ib_uverbs_open_qp, |
118 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
118 | [IB_USER_VERBS_CMD_CREATE_FLOW] = ib_uverbs_create_flow, | 119 | [IB_USER_VERBS_CMD_CREATE_FLOW] = ib_uverbs_create_flow, |
119 | [IB_USER_VERBS_CMD_DESTROY_FLOW] = ib_uverbs_destroy_flow | 120 | [IB_USER_VERBS_CMD_DESTROY_FLOW] = ib_uverbs_destroy_flow |
121 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
120 | }; | 122 | }; |
121 | 123 | ||
122 | static void ib_uverbs_add_one(struct ib_device *device); | 124 | static void ib_uverbs_add_one(struct ib_device *device); |
@@ -605,6 +607,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, | |||
605 | if (!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command))) | 607 | if (!(file->device->ib_dev->uverbs_cmd_mask & (1ull << hdr.command))) |
606 | return -ENOSYS; | 608 | return -ENOSYS; |
607 | 609 | ||
610 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
608 | if (hdr.command >= IB_USER_VERBS_CMD_THRESHOLD) { | 611 | if (hdr.command >= IB_USER_VERBS_CMD_THRESHOLD) { |
609 | struct ib_uverbs_cmd_hdr_ex hdr_ex; | 612 | struct ib_uverbs_cmd_hdr_ex hdr_ex; |
610 | 613 | ||
@@ -621,6 +624,7 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, | |||
621 | (hdr_ex.out_words + | 624 | (hdr_ex.out_words + |
622 | hdr_ex.provider_out_words) * 4); | 625 | hdr_ex.provider_out_words) * 4); |
623 | } else { | 626 | } else { |
627 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
624 | if (hdr.in_words * 4 != count) | 628 | if (hdr.in_words * 4 != count) |
625 | return -EINVAL; | 629 | return -EINVAL; |
626 | 630 | ||
@@ -628,7 +632,9 @@ static ssize_t ib_uverbs_write(struct file *filp, const char __user *buf, | |||
628 | buf + sizeof(hdr), | 632 | buf + sizeof(hdr), |
629 | hdr.in_words * 4, | 633 | hdr.in_words * 4, |
630 | hdr.out_words * 4); | 634 | hdr.out_words * 4); |
635 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
631 | } | 636 | } |
637 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
632 | } | 638 | } |
633 | 639 | ||
634 | static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma) | 640 | static int ib_uverbs_mmap(struct file *filp, struct vm_area_struct *vma) |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index d6c5a73becf4..f0612645de99 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1691,9 +1691,11 @@ static void *mlx4_ib_add(struct mlx4_dev *dev) | |||
1691 | ibdev->ib_dev.create_flow = mlx4_ib_create_flow; | 1691 | ibdev->ib_dev.create_flow = mlx4_ib_create_flow; |
1692 | ibdev->ib_dev.destroy_flow = mlx4_ib_destroy_flow; | 1692 | ibdev->ib_dev.destroy_flow = mlx4_ib_destroy_flow; |
1693 | 1693 | ||
1694 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
1694 | ibdev->ib_dev.uverbs_cmd_mask |= | 1695 | ibdev->ib_dev.uverbs_cmd_mask |= |
1695 | (1ull << IB_USER_VERBS_CMD_CREATE_FLOW) | | 1696 | (1ull << IB_USER_VERBS_CMD_CREATE_FLOW) | |
1696 | (1ull << IB_USER_VERBS_CMD_DESTROY_FLOW); | 1697 | (1ull << IB_USER_VERBS_CMD_DESTROY_FLOW); |
1698 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
1697 | } | 1699 | } |
1698 | 1700 | ||
1699 | mlx4_ib_alloc_eqs(dev, ibdev); | 1701 | mlx4_ib_alloc_eqs(dev, ibdev); |
diff --git a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c index 3591855cc5b5..6df23502059a 100644 --- a/drivers/infiniband/ulp/isert/ib_isert.c +++ b/drivers/infiniband/ulp/isert/ib_isert.c | |||
@@ -594,7 +594,7 @@ isert_connect_release(struct isert_conn *isert_conn) | |||
594 | 594 | ||
595 | pr_debug("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); | 595 | pr_debug("Entering isert_connect_release(): >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n"); |
596 | 596 | ||
597 | if (device->use_frwr) | 597 | if (device && device->use_frwr) |
598 | isert_conn_free_frwr_pool(isert_conn); | 598 | isert_conn_free_frwr_pool(isert_conn); |
599 | 599 | ||
600 | if (isert_conn->conn_qp) { | 600 | if (isert_conn->conn_qp) { |
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index b6a74bcbb08f..2a7f0dd6abab 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -1000,7 +1000,7 @@ static void request_write(struct cached_dev *dc, struct search *s) | |||
1000 | 1000 | ||
1001 | if (bio->bi_rw & REQ_FLUSH) { | 1001 | if (bio->bi_rw & REQ_FLUSH) { |
1002 | /* Also need to send a flush to the backing device */ | 1002 | /* Also need to send a flush to the backing device */ |
1003 | struct bio *flush = bio_alloc_bioset(0, GFP_NOIO, | 1003 | struct bio *flush = bio_alloc_bioset(GFP_NOIO, 0, |
1004 | dc->disk.bio_split); | 1004 | dc->disk.bio_split); |
1005 | 1005 | ||
1006 | flush->bi_rw = WRITE_FLUSH; | 1006 | flush->bi_rw = WRITE_FLUSH; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index adf4d7e1d5e1..561a65f82e26 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
@@ -8111,6 +8111,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||
8111 | u64 *p; | 8111 | u64 *p; |
8112 | int lo, hi; | 8112 | int lo, hi; |
8113 | int rv = 1; | 8113 | int rv = 1; |
8114 | unsigned long flags; | ||
8114 | 8115 | ||
8115 | if (bb->shift < 0) | 8116 | if (bb->shift < 0) |
8116 | /* badblocks are disabled */ | 8117 | /* badblocks are disabled */ |
@@ -8125,7 +8126,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||
8125 | sectors = next - s; | 8126 | sectors = next - s; |
8126 | } | 8127 | } |
8127 | 8128 | ||
8128 | write_seqlock_irq(&bb->lock); | 8129 | write_seqlock_irqsave(&bb->lock, flags); |
8129 | 8130 | ||
8130 | p = bb->page; | 8131 | p = bb->page; |
8131 | lo = 0; | 8132 | lo = 0; |
@@ -8241,7 +8242,7 @@ static int md_set_badblocks(struct badblocks *bb, sector_t s, int sectors, | |||
8241 | bb->changed = 1; | 8242 | bb->changed = 1; |
8242 | if (!acknowledged) | 8243 | if (!acknowledged) |
8243 | bb->unacked_exist = 1; | 8244 | bb->unacked_exist = 1; |
8244 | write_sequnlock_irq(&bb->lock); | 8245 | write_sequnlock_irqrestore(&bb->lock, flags); |
8245 | 8246 | ||
8246 | return rv; | 8247 | return rv; |
8247 | } | 8248 | } |
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d60412c7f995..aacf6bf352d8 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1479,6 +1479,7 @@ static int raid1_spare_active(struct mddev *mddev) | |||
1479 | } | 1479 | } |
1480 | } | 1480 | } |
1481 | if (rdev | 1481 | if (rdev |
1482 | && rdev->recovery_offset == MaxSector | ||
1482 | && !test_bit(Faulty, &rdev->flags) | 1483 | && !test_bit(Faulty, &rdev->flags) |
1483 | && !test_and_set_bit(In_sync, &rdev->flags)) { | 1484 | && !test_and_set_bit(In_sync, &rdev->flags)) { |
1484 | count++; | 1485 | count++; |
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index df7b0a06b0ea..73dc8a377522 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
@@ -1782,6 +1782,7 @@ static int raid10_spare_active(struct mddev *mddev) | |||
1782 | } | 1782 | } |
1783 | sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); | 1783 | sysfs_notify_dirent_safe(tmp->replacement->sysfs_state); |
1784 | } else if (tmp->rdev | 1784 | } else if (tmp->rdev |
1785 | && tmp->rdev->recovery_offset == MaxSector | ||
1785 | && !test_bit(Faulty, &tmp->rdev->flags) | 1786 | && !test_bit(Faulty, &tmp->rdev->flags) |
1786 | && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { | 1787 | && !test_and_set_bit(In_sync, &tmp->rdev->flags)) { |
1787 | count++; | 1788 | count++; |
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 7ff4f252ca1a..f8b906843926 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -778,6 +778,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
778 | bi->bi_io_vec[0].bv_len = STRIPE_SIZE; | 778 | bi->bi_io_vec[0].bv_len = STRIPE_SIZE; |
779 | bi->bi_io_vec[0].bv_offset = 0; | 779 | bi->bi_io_vec[0].bv_offset = 0; |
780 | bi->bi_size = STRIPE_SIZE; | 780 | bi->bi_size = STRIPE_SIZE; |
781 | /* | ||
782 | * If this is discard request, set bi_vcnt 0. We don't | ||
783 | * want to confuse SCSI because SCSI will replace payload | ||
784 | */ | ||
785 | if (rw & REQ_DISCARD) | ||
786 | bi->bi_vcnt = 0; | ||
781 | if (rrdev) | 787 | if (rrdev) |
782 | set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); | 788 | set_bit(R5_DOUBLE_LOCKED, &sh->dev[i].flags); |
783 | 789 | ||
@@ -816,6 +822,12 @@ static void ops_run_io(struct stripe_head *sh, struct stripe_head_state *s) | |||
816 | rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; | 822 | rbi->bi_io_vec[0].bv_len = STRIPE_SIZE; |
817 | rbi->bi_io_vec[0].bv_offset = 0; | 823 | rbi->bi_io_vec[0].bv_offset = 0; |
818 | rbi->bi_size = STRIPE_SIZE; | 824 | rbi->bi_size = STRIPE_SIZE; |
825 | /* | ||
826 | * If this is discard request, set bi_vcnt 0. We don't | ||
827 | * want to confuse SCSI because SCSI will replace payload | ||
828 | */ | ||
829 | if (rw & REQ_DISCARD) | ||
830 | rbi->bi_vcnt = 0; | ||
819 | if (conf->mddev->gendisk) | 831 | if (conf->mddev->gendisk) |
820 | trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), | 832 | trace_block_bio_remap(bdev_get_queue(rbi->bi_bdev), |
821 | rbi, disk_devt(conf->mddev->gendisk), | 833 | rbi, disk_devt(conf->mddev->gendisk), |
@@ -2910,6 +2922,14 @@ static void handle_stripe_clean_event(struct r5conf *conf, | |||
2910 | } | 2922 | } |
2911 | /* now that discard is done we can proceed with any sync */ | 2923 | /* now that discard is done we can proceed with any sync */ |
2912 | clear_bit(STRIPE_DISCARD, &sh->state); | 2924 | clear_bit(STRIPE_DISCARD, &sh->state); |
2925 | /* | ||
2926 | * SCSI discard will change some bio fields and the stripe has | ||
2927 | * no updated data, so remove it from hash list and the stripe | ||
2928 | * will be reinitialized | ||
2929 | */ | ||
2930 | spin_lock_irq(&conf->device_lock); | ||
2931 | remove_hash(sh); | ||
2932 | spin_unlock_irq(&conf->device_lock); | ||
2913 | if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) | 2933 | if (test_bit(STRIPE_SYNC_REQUESTED, &sh->state)) |
2914 | set_bit(STRIPE_HANDLE, &sh->state); | 2934 | set_bit(STRIPE_HANDLE, &sh->state); |
2915 | 2935 | ||
diff --git a/drivers/media/dvb-frontends/tda10071.c b/drivers/media/dvb-frontends/tda10071.c index 2521f7e23018..e79749cfec81 100644 --- a/drivers/media/dvb-frontends/tda10071.c +++ b/drivers/media/dvb-frontends/tda10071.c | |||
@@ -912,14 +912,8 @@ static int tda10071_init(struct dvb_frontend *fe) | |||
912 | { 0xd5, 0x03, 0x03 }, | 912 | { 0xd5, 0x03, 0x03 }, |
913 | }; | 913 | }; |
914 | 914 | ||
915 | /* firmware status */ | 915 | if (priv->warm) { |
916 | ret = tda10071_rd_reg(priv, 0x51, &tmp); | ||
917 | if (ret) | ||
918 | goto error; | ||
919 | |||
920 | if (!tmp) { | ||
921 | /* warm state - wake up device from sleep */ | 916 | /* warm state - wake up device from sleep */ |
922 | priv->warm = 1; | ||
923 | 917 | ||
924 | for (i = 0; i < ARRAY_SIZE(tab); i++) { | 918 | for (i = 0; i < ARRAY_SIZE(tab); i++) { |
925 | ret = tda10071_wr_reg_mask(priv, tab[i].reg, | 919 | ret = tda10071_wr_reg_mask(priv, tab[i].reg, |
@@ -937,7 +931,6 @@ static int tda10071_init(struct dvb_frontend *fe) | |||
937 | goto error; | 931 | goto error; |
938 | } else { | 932 | } else { |
939 | /* cold state - try to download firmware */ | 933 | /* cold state - try to download firmware */ |
940 | priv->warm = 0; | ||
941 | 934 | ||
942 | /* request the firmware, this will block and timeout */ | 935 | /* request the firmware, this will block and timeout */ |
943 | ret = request_firmware(&fw, fw_file, priv->i2c->dev.parent); | 936 | ret = request_firmware(&fw, fw_file, priv->i2c->dev.parent); |
diff --git a/drivers/media/i2c/ad9389b.c b/drivers/media/i2c/ad9389b.c index bb0c99d7a4f1..b06a7e54ee0d 100644 --- a/drivers/media/i2c/ad9389b.c +++ b/drivers/media/i2c/ad9389b.c | |||
@@ -628,16 +628,13 @@ static int ad9389b_s_stream(struct v4l2_subdev *sd, int enable) | |||
628 | 628 | ||
629 | static const struct v4l2_dv_timings_cap ad9389b_timings_cap = { | 629 | static const struct v4l2_dv_timings_cap ad9389b_timings_cap = { |
630 | .type = V4L2_DV_BT_656_1120, | 630 | .type = V4L2_DV_BT_656_1120, |
631 | .bt = { | 631 | /* keep this initialization for compatibility with GCC < 4.4.6 */ |
632 | .max_width = 1920, | 632 | .reserved = { 0 }, |
633 | .max_height = 1200, | 633 | V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 170000000, |
634 | .min_pixelclock = 25000000, | 634 | V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | |
635 | .max_pixelclock = 170000000, | ||
636 | .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | | ||
637 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, | 635 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, |
638 | .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE | | 636 | V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING | |
639 | V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM, | 637 | V4L2_DV_BT_CAP_CUSTOM) |
640 | }, | ||
641 | }; | 638 | }; |
642 | 639 | ||
643 | static int ad9389b_s_dv_timings(struct v4l2_subdev *sd, | 640 | static int ad9389b_s_dv_timings(struct v4l2_subdev *sd, |
diff --git a/drivers/media/i2c/adv7511.c b/drivers/media/i2c/adv7511.c index 7a576097471f..7c8d971f1f61 100644 --- a/drivers/media/i2c/adv7511.c +++ b/drivers/media/i2c/adv7511.c | |||
@@ -119,16 +119,14 @@ static int adv7511_s_clock_freq(struct v4l2_subdev *sd, u32 freq); | |||
119 | 119 | ||
120 | static const struct v4l2_dv_timings_cap adv7511_timings_cap = { | 120 | static const struct v4l2_dv_timings_cap adv7511_timings_cap = { |
121 | .type = V4L2_DV_BT_656_1120, | 121 | .type = V4L2_DV_BT_656_1120, |
122 | .bt = { | 122 | /* keep this initialization for compatibility with GCC < 4.4.6 */ |
123 | .max_width = ADV7511_MAX_WIDTH, | 123 | .reserved = { 0 }, |
124 | .max_height = ADV7511_MAX_HEIGHT, | 124 | V4L2_INIT_BT_TIMINGS(0, ADV7511_MAX_WIDTH, 0, ADV7511_MAX_HEIGHT, |
125 | .min_pixelclock = ADV7511_MIN_PIXELCLOCK, | 125 | ADV7511_MIN_PIXELCLOCK, ADV7511_MAX_PIXELCLOCK, |
126 | .max_pixelclock = ADV7511_MAX_PIXELCLOCK, | 126 | V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | |
127 | .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | | ||
128 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, | 127 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, |
129 | .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE | | 128 | V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING | |
130 | V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM, | 129 | V4L2_DV_BT_CAP_CUSTOM) |
131 | }, | ||
132 | }; | 130 | }; |
133 | 131 | ||
134 | static inline struct adv7511_state *get_adv7511_state(struct v4l2_subdev *sd) | 132 | static inline struct adv7511_state *get_adv7511_state(struct v4l2_subdev *sd) |
@@ -1126,6 +1124,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * | |||
1126 | state->i2c_edid = i2c_new_dummy(client->adapter, state->i2c_edid_addr >> 1); | 1124 | state->i2c_edid = i2c_new_dummy(client->adapter, state->i2c_edid_addr >> 1); |
1127 | if (state->i2c_edid == NULL) { | 1125 | if (state->i2c_edid == NULL) { |
1128 | v4l2_err(sd, "failed to register edid i2c client\n"); | 1126 | v4l2_err(sd, "failed to register edid i2c client\n"); |
1127 | err = -ENOMEM; | ||
1129 | goto err_entity; | 1128 | goto err_entity; |
1130 | } | 1129 | } |
1131 | 1130 | ||
@@ -1133,6 +1132,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id * | |||
1133 | state->work_queue = create_singlethread_workqueue(sd->name); | 1132 | state->work_queue = create_singlethread_workqueue(sd->name); |
1134 | if (state->work_queue == NULL) { | 1133 | if (state->work_queue == NULL) { |
1135 | v4l2_err(sd, "could not create workqueue\n"); | 1134 | v4l2_err(sd, "could not create workqueue\n"); |
1135 | err = -ENOMEM; | ||
1136 | goto err_unreg_cec; | 1136 | goto err_unreg_cec; |
1137 | } | 1137 | } |
1138 | 1138 | ||
diff --git a/drivers/media/i2c/adv7842.c b/drivers/media/i2c/adv7842.c index d1748901337c..22f729d66a96 100644 --- a/drivers/media/i2c/adv7842.c +++ b/drivers/media/i2c/adv7842.c | |||
@@ -546,30 +546,24 @@ static inline bool is_digital_input(struct v4l2_subdev *sd) | |||
546 | 546 | ||
547 | static const struct v4l2_dv_timings_cap adv7842_timings_cap_analog = { | 547 | static const struct v4l2_dv_timings_cap adv7842_timings_cap_analog = { |
548 | .type = V4L2_DV_BT_656_1120, | 548 | .type = V4L2_DV_BT_656_1120, |
549 | .bt = { | 549 | /* keep this initialization for compatibility with GCC < 4.4.6 */ |
550 | .max_width = 1920, | 550 | .reserved = { 0 }, |
551 | .max_height = 1200, | 551 | V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 170000000, |
552 | .min_pixelclock = 25000000, | 552 | V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | |
553 | .max_pixelclock = 170000000, | ||
554 | .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | | ||
555 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, | 553 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, |
556 | .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE | | 554 | V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING | |
557 | V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM, | 555 | V4L2_DV_BT_CAP_CUSTOM) |
558 | }, | ||
559 | }; | 556 | }; |
560 | 557 | ||
561 | static const struct v4l2_dv_timings_cap adv7842_timings_cap_digital = { | 558 | static const struct v4l2_dv_timings_cap adv7842_timings_cap_digital = { |
562 | .type = V4L2_DV_BT_656_1120, | 559 | .type = V4L2_DV_BT_656_1120, |
563 | .bt = { | 560 | /* keep this initialization for compatibility with GCC < 4.4.6 */ |
564 | .max_width = 1920, | 561 | .reserved = { 0 }, |
565 | .max_height = 1200, | 562 | V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1200, 25000000, 225000000, |
566 | .min_pixelclock = 25000000, | 563 | V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | |
567 | .max_pixelclock = 225000000, | ||
568 | .standards = V4L2_DV_BT_STD_CEA861 | V4L2_DV_BT_STD_DMT | | ||
569 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, | 564 | V4L2_DV_BT_STD_GTF | V4L2_DV_BT_STD_CVT, |
570 | .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE | | 565 | V4L2_DV_BT_CAP_PROGRESSIVE | V4L2_DV_BT_CAP_REDUCED_BLANKING | |
571 | V4L2_DV_BT_CAP_REDUCED_BLANKING | V4L2_DV_BT_CAP_CUSTOM, | 566 | V4L2_DV_BT_CAP_CUSTOM) |
572 | }, | ||
573 | }; | 567 | }; |
574 | 568 | ||
575 | static inline const struct v4l2_dv_timings_cap * | 569 | static inline const struct v4l2_dv_timings_cap * |
diff --git a/drivers/media/i2c/ths8200.c b/drivers/media/i2c/ths8200.c index a58a8f663ffb..d9f65d7e3e58 100644 --- a/drivers/media/i2c/ths8200.c +++ b/drivers/media/i2c/ths8200.c | |||
@@ -46,14 +46,10 @@ struct ths8200_state { | |||
46 | 46 | ||
47 | static const struct v4l2_dv_timings_cap ths8200_timings_cap = { | 47 | static const struct v4l2_dv_timings_cap ths8200_timings_cap = { |
48 | .type = V4L2_DV_BT_656_1120, | 48 | .type = V4L2_DV_BT_656_1120, |
49 | .bt = { | 49 | /* keep this initialization for compatibility with GCC < 4.4.6 */ |
50 | .max_width = 1920, | 50 | .reserved = { 0 }, |
51 | .max_height = 1080, | 51 | V4L2_INIT_BT_TIMINGS(0, 1920, 0, 1080, 25000000, 148500000, |
52 | .min_pixelclock = 25000000, | 52 | V4L2_DV_BT_STD_CEA861, V4L2_DV_BT_CAP_PROGRESSIVE) |
53 | .max_pixelclock = 148500000, | ||
54 | .standards = V4L2_DV_BT_STD_CEA861, | ||
55 | .capabilities = V4L2_DV_BT_CAP_PROGRESSIVE, | ||
56 | }, | ||
57 | }; | 53 | }; |
58 | 54 | ||
59 | static inline struct ths8200_state *to_state(struct v4l2_subdev *sd) | 55 | static inline struct ths8200_state *to_state(struct v4l2_subdev *sd) |
diff --git a/drivers/media/pci/saa7134/saa7134-video.c b/drivers/media/pci/saa7134/saa7134-video.c index e12bbd8c3f0b..fb60da85bc2c 100644 --- a/drivers/media/pci/saa7134/saa7134-video.c +++ b/drivers/media/pci/saa7134/saa7134-video.c | |||
@@ -1455,6 +1455,7 @@ static int video_release(struct file *file) | |||
1455 | 1455 | ||
1456 | /* stop video capture */ | 1456 | /* stop video capture */ |
1457 | if (res_check(fh, RESOURCE_VIDEO)) { | 1457 | if (res_check(fh, RESOURCE_VIDEO)) { |
1458 | pm_qos_remove_request(&dev->qos_request); | ||
1458 | videobuf_streamoff(&fh->cap); | 1459 | videobuf_streamoff(&fh->cap); |
1459 | res_free(dev,fh,RESOURCE_VIDEO); | 1460 | res_free(dev,fh,RESOURCE_VIDEO); |
1460 | } | 1461 | } |
diff --git a/drivers/media/platform/s5p-jpeg/jpeg-core.c b/drivers/media/platform/s5p-jpeg/jpeg-core.c index 15d23968d1de..9b88a4601007 100644 --- a/drivers/media/platform/s5p-jpeg/jpeg-core.c +++ b/drivers/media/platform/s5p-jpeg/jpeg-core.c | |||
@@ -1423,6 +1423,7 @@ static int s5p_jpeg_probe(struct platform_device *pdev) | |||
1423 | jpeg->vfd_decoder->release = video_device_release; | 1423 | jpeg->vfd_decoder->release = video_device_release; |
1424 | jpeg->vfd_decoder->lock = &jpeg->lock; | 1424 | jpeg->vfd_decoder->lock = &jpeg->lock; |
1425 | jpeg->vfd_decoder->v4l2_dev = &jpeg->v4l2_dev; | 1425 | jpeg->vfd_decoder->v4l2_dev = &jpeg->v4l2_dev; |
1426 | jpeg->vfd_decoder->vfl_dir = VFL_DIR_M2M; | ||
1426 | 1427 | ||
1427 | ret = video_register_device(jpeg->vfd_decoder, VFL_TYPE_GRABBER, -1); | 1428 | ret = video_register_device(jpeg->vfd_decoder, VFL_TYPE_GRABBER, -1); |
1428 | if (ret) { | 1429 | if (ret) { |
diff --git a/drivers/media/platform/sh_vou.c b/drivers/media/platform/sh_vou.c index 7a9c5e9329f2..4f30341dc2ab 100644 --- a/drivers/media/platform/sh_vou.c +++ b/drivers/media/platform/sh_vou.c | |||
@@ -776,7 +776,7 @@ static int sh_vou_try_fmt_vid_out(struct file *file, void *priv, | |||
776 | v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1, | 776 | v4l_bound_align_image(&pix->width, 0, VOU_MAX_IMAGE_WIDTH, 1, |
777 | &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0); | 777 | &pix->height, 0, VOU_MAX_IMAGE_HEIGHT, 1, 0); |
778 | 778 | ||
779 | for (i = 0; ARRAY_SIZE(vou_fmt); i++) | 779 | for (i = 0; i < ARRAY_SIZE(vou_fmt); i++) |
780 | if (vou_fmt[i].pfmt == pix->pixelformat) | 780 | if (vou_fmt[i].pfmt == pix->pixelformat) |
781 | return 0; | 781 | return 0; |
782 | 782 | ||
diff --git a/drivers/media/platform/soc_camera/mx3_camera.c b/drivers/media/platform/soc_camera/mx3_camera.c index 8f9f6211c52e..f975b7008692 100644 --- a/drivers/media/platform/soc_camera/mx3_camera.c +++ b/drivers/media/platform/soc_camera/mx3_camera.c | |||
@@ -266,7 +266,6 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
266 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; | 266 | struct idmac_channel *ichan = mx3_cam->idmac_channel[0]; |
267 | struct idmac_video_param *video = &ichan->params.video; | 267 | struct idmac_video_param *video = &ichan->params.video; |
268 | const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt; | 268 | const struct soc_mbus_pixelfmt *host_fmt = icd->current_fmt->host_fmt; |
269 | unsigned long flags; | ||
270 | dma_cookie_t cookie; | 269 | dma_cookie_t cookie; |
271 | size_t new_size; | 270 | size_t new_size; |
272 | 271 | ||
@@ -328,7 +327,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
328 | memset(vb2_plane_vaddr(vb, 0), 0xaa, vb2_get_plane_payload(vb, 0)); | 327 | memset(vb2_plane_vaddr(vb, 0), 0xaa, vb2_get_plane_payload(vb, 0)); |
329 | #endif | 328 | #endif |
330 | 329 | ||
331 | spin_lock_irqsave(&mx3_cam->lock, flags); | 330 | spin_lock_irq(&mx3_cam->lock); |
332 | list_add_tail(&buf->queue, &mx3_cam->capture); | 331 | list_add_tail(&buf->queue, &mx3_cam->capture); |
333 | 332 | ||
334 | if (!mx3_cam->active) | 333 | if (!mx3_cam->active) |
@@ -351,7 +350,7 @@ static void mx3_videobuf_queue(struct vb2_buffer *vb) | |||
351 | if (mx3_cam->active == buf) | 350 | if (mx3_cam->active == buf) |
352 | mx3_cam->active = NULL; | 351 | mx3_cam->active = NULL; |
353 | 352 | ||
354 | spin_unlock_irqrestore(&mx3_cam->lock, flags); | 353 | spin_unlock_irq(&mx3_cam->lock); |
355 | error: | 354 | error: |
356 | vb2_buffer_done(vb, VB2_BUF_STATE_ERROR); | 355 | vb2_buffer_done(vb, VB2_BUF_STATE_ERROR); |
357 | } | 356 | } |
diff --git a/drivers/media/tuners/e4000.c b/drivers/media/tuners/e4000.c index ad9309da4a91..6c96e4898777 100644 --- a/drivers/media/tuners/e4000.c +++ b/drivers/media/tuners/e4000.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include "e4000_priv.h" | 21 | #include "e4000_priv.h" |
22 | #include <linux/math64.h> | ||
22 | 23 | ||
23 | /* write multiple registers */ | 24 | /* write multiple registers */ |
24 | static int e4000_wr_regs(struct e4000_priv *priv, u8 reg, u8 *val, int len) | 25 | static int e4000_wr_regs(struct e4000_priv *priv, u8 reg, u8 *val, int len) |
@@ -233,7 +234,7 @@ static int e4000_set_params(struct dvb_frontend *fe) | |||
233 | * or more. | 234 | * or more. |
234 | */ | 235 | */ |
235 | f_vco = c->frequency * e4000_pll_lut[i].mul; | 236 | f_vco = c->frequency * e4000_pll_lut[i].mul; |
236 | sigma_delta = 0x10000UL * (f_vco % priv->cfg->clock) / priv->cfg->clock; | 237 | sigma_delta = div_u64(0x10000ULL * (f_vco % priv->cfg->clock), priv->cfg->clock); |
237 | buf[0] = f_vco / priv->cfg->clock; | 238 | buf[0] = f_vco / priv->cfg->clock; |
238 | buf[1] = (sigma_delta >> 0) & 0xff; | 239 | buf[1] = (sigma_delta >> 0) & 0xff; |
239 | buf[2] = (sigma_delta >> 8) & 0xff; | 240 | buf[2] = (sigma_delta >> 8) & 0xff; |
diff --git a/drivers/media/usb/stkwebcam/stk-webcam.c b/drivers/media/usb/stkwebcam/stk-webcam.c index c43c8d32be40..be77482c3070 100644 --- a/drivers/media/usb/stkwebcam/stk-webcam.c +++ b/drivers/media/usb/stkwebcam/stk-webcam.c | |||
@@ -111,6 +111,13 @@ static const struct dmi_system_id stk_upside_down_dmi_table[] = { | |||
111 | DMI_MATCH(DMI_PRODUCT_NAME, "F3JC") | 111 | DMI_MATCH(DMI_PRODUCT_NAME, "F3JC") |
112 | } | 112 | } |
113 | }, | 113 | }, |
114 | { | ||
115 | .ident = "T12Rg-H", | ||
116 | .matches = { | ||
117 | DMI_MATCH(DMI_SYS_VENDOR, "HCL Infosystems Limited"), | ||
118 | DMI_MATCH(DMI_PRODUCT_NAME, "T12Rg-H") | ||
119 | } | ||
120 | }, | ||
114 | {} | 121 | {} |
115 | }; | 122 | }; |
116 | 123 | ||
diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c index 81695d48c13e..c3bb2502225b 100644 --- a/drivers/media/usb/uvc/uvc_driver.c +++ b/drivers/media/usb/uvc/uvc_driver.c | |||
@@ -2090,6 +2090,15 @@ static struct usb_device_id uvc_ids[] = { | |||
2090 | .bInterfaceSubClass = 1, | 2090 | .bInterfaceSubClass = 1, |
2091 | .bInterfaceProtocol = 0, | 2091 | .bInterfaceProtocol = 0, |
2092 | .driver_info = UVC_QUIRK_PROBE_MINMAX }, | 2092 | .driver_info = UVC_QUIRK_PROBE_MINMAX }, |
2093 | /* Microsoft Lifecam NX-3000 */ | ||
2094 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | ||
2095 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
2096 | .idVendor = 0x045e, | ||
2097 | .idProduct = 0x0721, | ||
2098 | .bInterfaceClass = USB_CLASS_VIDEO, | ||
2099 | .bInterfaceSubClass = 1, | ||
2100 | .bInterfaceProtocol = 0, | ||
2101 | .driver_info = UVC_QUIRK_PROBE_DEF }, | ||
2093 | /* Microsoft Lifecam VX-7000 */ | 2102 | /* Microsoft Lifecam VX-7000 */ |
2094 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2103 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
2095 | | USB_DEVICE_ID_MATCH_INT_INFO, | 2104 | | USB_DEVICE_ID_MATCH_INT_INFO, |
@@ -2174,6 +2183,15 @@ static struct usb_device_id uvc_ids[] = { | |||
2174 | .bInterfaceSubClass = 1, | 2183 | .bInterfaceSubClass = 1, |
2175 | .bInterfaceProtocol = 0, | 2184 | .bInterfaceProtocol = 0, |
2176 | .driver_info = UVC_QUIRK_PROBE_DEF }, | 2185 | .driver_info = UVC_QUIRK_PROBE_DEF }, |
2186 | /* Dell SP2008WFP Monitor */ | ||
2187 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | ||
2188 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
2189 | .idVendor = 0x05a9, | ||
2190 | .idProduct = 0x2641, | ||
2191 | .bInterfaceClass = USB_CLASS_VIDEO, | ||
2192 | .bInterfaceSubClass = 1, | ||
2193 | .bInterfaceProtocol = 0, | ||
2194 | .driver_info = UVC_QUIRK_PROBE_DEF }, | ||
2177 | /* Dell Alienware X51 */ | 2195 | /* Dell Alienware X51 */ |
2178 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | 2196 | { .match_flags = USB_DEVICE_ID_MATCH_DEVICE |
2179 | | USB_DEVICE_ID_MATCH_INT_INFO, | 2197 | | USB_DEVICE_ID_MATCH_INT_INFO, |
diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c index 594c75eab5a5..de0e87f0b2c3 100644 --- a/drivers/media/v4l2-core/videobuf2-core.c +++ b/drivers/media/v4l2-core/videobuf2-core.c | |||
@@ -353,7 +353,9 @@ static int __verify_length(struct vb2_buffer *vb, const struct v4l2_buffer *b) | |||
353 | 353 | ||
354 | if (b->m.planes[plane].bytesused > length) | 354 | if (b->m.planes[plane].bytesused > length) |
355 | return -EINVAL; | 355 | return -EINVAL; |
356 | if (b->m.planes[plane].data_offset >= | 356 | |
357 | if (b->m.planes[plane].data_offset > 0 && | ||
358 | b->m.planes[plane].data_offset >= | ||
357 | b->m.planes[plane].bytesused) | 359 | b->m.planes[plane].bytesused) |
358 | return -EINVAL; | 360 | return -EINVAL; |
359 | } | 361 | } |
diff --git a/drivers/media/v4l2-core/videobuf2-dma-contig.c b/drivers/media/v4l2-core/videobuf2-dma-contig.c index fd56f2563201..646f08f4f504 100644 --- a/drivers/media/v4l2-core/videobuf2-dma-contig.c +++ b/drivers/media/v4l2-core/videobuf2-dma-contig.c | |||
@@ -423,6 +423,39 @@ static inline int vma_is_io(struct vm_area_struct *vma) | |||
423 | return !!(vma->vm_flags & (VM_IO | VM_PFNMAP)); | 423 | return !!(vma->vm_flags & (VM_IO | VM_PFNMAP)); |
424 | } | 424 | } |
425 | 425 | ||
426 | static int vb2_dc_get_user_pfn(unsigned long start, int n_pages, | ||
427 | struct vm_area_struct *vma, unsigned long *res) | ||
428 | { | ||
429 | unsigned long pfn, start_pfn, prev_pfn; | ||
430 | unsigned int i; | ||
431 | int ret; | ||
432 | |||
433 | if (!vma_is_io(vma)) | ||
434 | return -EFAULT; | ||
435 | |||
436 | ret = follow_pfn(vma, start, &pfn); | ||
437 | if (ret) | ||
438 | return ret; | ||
439 | |||
440 | start_pfn = pfn; | ||
441 | start += PAGE_SIZE; | ||
442 | |||
443 | for (i = 1; i < n_pages; ++i, start += PAGE_SIZE) { | ||
444 | prev_pfn = pfn; | ||
445 | ret = follow_pfn(vma, start, &pfn); | ||
446 | |||
447 | if (ret) { | ||
448 | pr_err("no page for address %lu\n", start); | ||
449 | return ret; | ||
450 | } | ||
451 | if (pfn != prev_pfn + 1) | ||
452 | return -EINVAL; | ||
453 | } | ||
454 | |||
455 | *res = start_pfn; | ||
456 | return 0; | ||
457 | } | ||
458 | |||
426 | static int vb2_dc_get_user_pages(unsigned long start, struct page **pages, | 459 | static int vb2_dc_get_user_pages(unsigned long start, struct page **pages, |
427 | int n_pages, struct vm_area_struct *vma, int write) | 460 | int n_pages, struct vm_area_struct *vma, int write) |
428 | { | 461 | { |
@@ -433,6 +466,9 @@ static int vb2_dc_get_user_pages(unsigned long start, struct page **pages, | |||
433 | unsigned long pfn; | 466 | unsigned long pfn; |
434 | int ret = follow_pfn(vma, start, &pfn); | 467 | int ret = follow_pfn(vma, start, &pfn); |
435 | 468 | ||
469 | if (!pfn_valid(pfn)) | ||
470 | return -EINVAL; | ||
471 | |||
436 | if (ret) { | 472 | if (ret) { |
437 | pr_err("no page for address %lu\n", start); | 473 | pr_err("no page for address %lu\n", start); |
438 | return ret; | 474 | return ret; |
@@ -468,16 +504,49 @@ static void vb2_dc_put_userptr(void *buf_priv) | |||
468 | struct vb2_dc_buf *buf = buf_priv; | 504 | struct vb2_dc_buf *buf = buf_priv; |
469 | struct sg_table *sgt = buf->dma_sgt; | 505 | struct sg_table *sgt = buf->dma_sgt; |
470 | 506 | ||
471 | dma_unmap_sg(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); | 507 | if (sgt) { |
472 | if (!vma_is_io(buf->vma)) | 508 | dma_unmap_sg(buf->dev, sgt->sgl, sgt->orig_nents, buf->dma_dir); |
473 | vb2_dc_sgt_foreach_page(sgt, vb2_dc_put_dirty_page); | 509 | if (!vma_is_io(buf->vma)) |
510 | vb2_dc_sgt_foreach_page(sgt, vb2_dc_put_dirty_page); | ||
474 | 511 | ||
475 | sg_free_table(sgt); | 512 | sg_free_table(sgt); |
476 | kfree(sgt); | 513 | kfree(sgt); |
514 | } | ||
477 | vb2_put_vma(buf->vma); | 515 | vb2_put_vma(buf->vma); |
478 | kfree(buf); | 516 | kfree(buf); |
479 | } | 517 | } |
480 | 518 | ||
519 | /* | ||
520 | * For some kind of reserved memory there might be no struct page available, | ||
521 | * so all that can be done to support such 'pages' is to try to convert | ||
522 | * pfn to dma address or at the last resort just assume that | ||
523 | * dma address == physical address (like it has been assumed in earlier version | ||
524 | * of videobuf2-dma-contig | ||
525 | */ | ||
526 | |||
527 | #ifdef __arch_pfn_to_dma | ||
528 | static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn) | ||
529 | { | ||
530 | return (dma_addr_t)__arch_pfn_to_dma(dev, pfn); | ||
531 | } | ||
532 | #elif defined(__pfn_to_bus) | ||
533 | static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn) | ||
534 | { | ||
535 | return (dma_addr_t)__pfn_to_bus(pfn); | ||
536 | } | ||
537 | #elif defined(__pfn_to_phys) | ||
538 | static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn) | ||
539 | { | ||
540 | return (dma_addr_t)__pfn_to_phys(pfn); | ||
541 | } | ||
542 | #else | ||
543 | static inline dma_addr_t vb2_dc_pfn_to_dma(struct device *dev, unsigned long pfn) | ||
544 | { | ||
545 | /* really, we cannot do anything better at this point */ | ||
546 | return (dma_addr_t)(pfn) << PAGE_SHIFT; | ||
547 | } | ||
548 | #endif | ||
549 | |||
481 | static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, | 550 | static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, |
482 | unsigned long size, int write) | 551 | unsigned long size, int write) |
483 | { | 552 | { |
@@ -548,6 +617,14 @@ static void *vb2_dc_get_userptr(void *alloc_ctx, unsigned long vaddr, | |||
548 | /* extract page list from userspace mapping */ | 617 | /* extract page list from userspace mapping */ |
549 | ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, write); | 618 | ret = vb2_dc_get_user_pages(start, pages, n_pages, vma, write); |
550 | if (ret) { | 619 | if (ret) { |
620 | unsigned long pfn; | ||
621 | if (vb2_dc_get_user_pfn(start, n_pages, vma, &pfn) == 0) { | ||
622 | buf->dma_addr = vb2_dc_pfn_to_dma(buf->dev, pfn); | ||
623 | buf->size = size; | ||
624 | kfree(pages); | ||
625 | return buf; | ||
626 | } | ||
627 | |||
551 | pr_err("failed to get user pages\n"); | 628 | pr_err("failed to get user pages\n"); |
552 | goto fail_vma; | 629 | goto fail_vma; |
553 | } | 630 | } |
diff --git a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c index 59ab0692f0b9..a9830ff8e3f3 100644 --- a/drivers/mtd/nand/gpmi-nand/gpmi-nand.c +++ b/drivers/mtd/nand/gpmi-nand/gpmi-nand.c | |||
@@ -349,7 +349,7 @@ static int legacy_set_geometry(struct gpmi_nand_data *this) | |||
349 | 349 | ||
350 | int common_nfc_set_geometry(struct gpmi_nand_data *this) | 350 | int common_nfc_set_geometry(struct gpmi_nand_data *this) |
351 | { | 351 | { |
352 | return set_geometry_by_ecc_info(this) ? 0 : legacy_set_geometry(this); | 352 | return legacy_set_geometry(this); |
353 | } | 353 | } |
354 | 354 | ||
355 | struct dma_chan *get_dma_chan(struct gpmi_nand_data *this) | 355 | struct dma_chan *get_dma_chan(struct gpmi_nand_data *this) |
diff --git a/drivers/mtd/nand/pxa3xx_nand.c b/drivers/mtd/nand/pxa3xx_nand.c index dd03dfdfb0d6..c28d4e29af1a 100644 --- a/drivers/mtd/nand/pxa3xx_nand.c +++ b/drivers/mtd/nand/pxa3xx_nand.c | |||
@@ -1320,7 +1320,12 @@ static int pxa3xx_nand_probe(struct platform_device *pdev) | |||
1320 | for (cs = 0; cs < pdata->num_cs; cs++) { | 1320 | for (cs = 0; cs < pdata->num_cs; cs++) { |
1321 | struct mtd_info *mtd = info->host[cs]->mtd; | 1321 | struct mtd_info *mtd = info->host[cs]->mtd; |
1322 | 1322 | ||
1323 | mtd->name = pdev->name; | 1323 | /* |
1324 | * The mtd name matches the one used in 'mtdparts' kernel | ||
1325 | * parameter. This name cannot be changed or otherwise | ||
1326 | * user's mtd partitions configuration would get broken. | ||
1327 | */ | ||
1328 | mtd->name = "pxa3xx_nand-0"; | ||
1324 | info->cs = cs; | 1329 | info->cs = cs; |
1325 | ret = pxa3xx_nand_scan(mtd); | 1330 | ret = pxa3xx_nand_scan(mtd); |
1326 | if (ret) { | 1331 | if (ret) { |
diff --git a/drivers/net/can/at91_can.c b/drivers/net/can/at91_can.c index 3b1ff6148702..693d8ffe4653 100644 --- a/drivers/net/can/at91_can.c +++ b/drivers/net/can/at91_can.c | |||
@@ -1405,10 +1405,10 @@ static int at91_can_remove(struct platform_device *pdev) | |||
1405 | 1405 | ||
1406 | static const struct platform_device_id at91_can_id_table[] = { | 1406 | static const struct platform_device_id at91_can_id_table[] = { |
1407 | { | 1407 | { |
1408 | .name = "at91_can", | 1408 | .name = "at91sam9x5_can", |
1409 | .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, | 1409 | .driver_data = (kernel_ulong_t)&at91_at91sam9x5_data, |
1410 | }, { | 1410 | }, { |
1411 | .name = "at91sam9x5_can", | 1411 | .name = "at91_can", |
1412 | .driver_data = (kernel_ulong_t)&at91_at91sam9263_data, | 1412 | .driver_data = (kernel_ulong_t)&at91_at91sam9263_data, |
1413 | }, { | 1413 | }, { |
1414 | /* sentinel */ | 1414 | /* sentinel */ |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index f9cba4123c66..1870c4731a57 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -705,14 +705,14 @@ static size_t can_get_size(const struct net_device *dev) | |||
705 | size_t size; | 705 | size_t size; |
706 | 706 | ||
707 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ | 707 | size = nla_total_size(sizeof(u32)); /* IFLA_CAN_STATE */ |
708 | size += sizeof(struct can_ctrlmode); /* IFLA_CAN_CTRLMODE */ | 708 | size += nla_total_size(sizeof(struct can_ctrlmode)); /* IFLA_CAN_CTRLMODE */ |
709 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ | 709 | size += nla_total_size(sizeof(u32)); /* IFLA_CAN_RESTART_MS */ |
710 | size += sizeof(struct can_bittiming); /* IFLA_CAN_BITTIMING */ | 710 | size += nla_total_size(sizeof(struct can_bittiming)); /* IFLA_CAN_BITTIMING */ |
711 | size += sizeof(struct can_clock); /* IFLA_CAN_CLOCK */ | 711 | size += nla_total_size(sizeof(struct can_clock)); /* IFLA_CAN_CLOCK */ |
712 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ | 712 | if (priv->do_get_berr_counter) /* IFLA_CAN_BERR_COUNTER */ |
713 | size += sizeof(struct can_berr_counter); | 713 | size += nla_total_size(sizeof(struct can_berr_counter)); |
714 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ | 714 | if (priv->bittiming_const) /* IFLA_CAN_BITTIMING_CONST */ |
715 | size += sizeof(struct can_bittiming_const); | 715 | size += nla_total_size(sizeof(struct can_bittiming_const)); |
716 | 716 | ||
717 | return size; | 717 | return size; |
718 | } | 718 | } |
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan.c index 3f21142138b7..8f5ce747feb5 100644 --- a/drivers/net/can/flexcan.c +++ b/drivers/net/can/flexcan.c | |||
@@ -62,7 +62,7 @@ | |||
62 | #define FLEXCAN_MCR_BCC BIT(16) | 62 | #define FLEXCAN_MCR_BCC BIT(16) |
63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) | 63 | #define FLEXCAN_MCR_LPRIO_EN BIT(13) |
64 | #define FLEXCAN_MCR_AEN BIT(12) | 64 | #define FLEXCAN_MCR_AEN BIT(12) |
65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0xf) | 65 | #define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f) |
66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) | 66 | #define FLEXCAN_MCR_IDAM_A (0 << 8) |
67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) | 67 | #define FLEXCAN_MCR_IDAM_B (1 << 8) |
68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) | 68 | #define FLEXCAN_MCR_IDAM_C (2 << 8) |
@@ -735,9 +735,11 @@ static int flexcan_chip_start(struct net_device *dev) | |||
735 | * | 735 | * |
736 | */ | 736 | */ |
737 | reg_mcr = flexcan_read(®s->mcr); | 737 | reg_mcr = flexcan_read(®s->mcr); |
738 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); | ||
738 | reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | | 739 | reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_FEN | FLEXCAN_MCR_HALT | |
739 | FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | | 740 | FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | |
740 | FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS; | 741 | FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_SRX_DIS | |
742 | FLEXCAN_MCR_MAXMB(FLEXCAN_TX_BUF_ID); | ||
741 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); | 743 | netdev_dbg(dev, "%s: writing mcr=0x%08x", __func__, reg_mcr); |
742 | flexcan_write(reg_mcr, ®s->mcr); | 744 | flexcan_write(reg_mcr, ®s->mcr); |
743 | 745 | ||
@@ -771,6 +773,10 @@ static int flexcan_chip_start(struct net_device *dev) | |||
771 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); | 773 | netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl); |
772 | flexcan_write(reg_ctrl, ®s->ctrl); | 774 | flexcan_write(reg_ctrl, ®s->ctrl); |
773 | 775 | ||
776 | /* Abort any pending TX, mark Mailbox as INACTIVE */ | ||
777 | flexcan_write(FLEXCAN_MB_CNT_CODE(0x4), | ||
778 | ®s->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl); | ||
779 | |||
774 | /* acceptance mask/acceptance code (accept everything) */ | 780 | /* acceptance mask/acceptance code (accept everything) */ |
775 | flexcan_write(0x0, ®s->rxgmask); | 781 | flexcan_write(0x0, ®s->rxgmask); |
776 | flexcan_write(0x0, ®s->rx14mask); | 782 | flexcan_write(0x0, ®s->rx14mask); |
@@ -979,9 +985,9 @@ static void unregister_flexcandev(struct net_device *dev) | |||
979 | } | 985 | } |
980 | 986 | ||
981 | static const struct of_device_id flexcan_of_match[] = { | 987 | static const struct of_device_id flexcan_of_match[] = { |
982 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | ||
983 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | ||
984 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, | 988 | { .compatible = "fsl,imx6q-flexcan", .data = &fsl_imx6q_devtype_data, }, |
989 | { .compatible = "fsl,imx28-flexcan", .data = &fsl_imx28_devtype_data, }, | ||
990 | { .compatible = "fsl,p1010-flexcan", .data = &fsl_p1010_devtype_data, }, | ||
985 | { /* sentinel */ }, | 991 | { /* sentinel */ }, |
986 | }; | 992 | }; |
987 | MODULE_DEVICE_TABLE(of, flexcan_of_match); | 993 | MODULE_DEVICE_TABLE(of, flexcan_of_match); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h index 97b3d32a98bd..c5e375ddd6c0 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x.h | |||
@@ -1197,8 +1197,9 @@ union cdu_context { | |||
1197 | /* TM (timers) host DB constants */ | 1197 | /* TM (timers) host DB constants */ |
1198 | #define TM_ILT_PAGE_SZ_HW 0 | 1198 | #define TM_ILT_PAGE_SZ_HW 0 |
1199 | #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */ | 1199 | #define TM_ILT_PAGE_SZ (4096 << TM_ILT_PAGE_SZ_HW) /* 4K */ |
1200 | /* #define TM_CONN_NUM (CNIC_STARTING_CID+CNIC_ISCSI_CXT_MAX) */ | 1200 | #define TM_CONN_NUM (BNX2X_FIRST_VF_CID + \ |
1201 | #define TM_CONN_NUM 1024 | 1201 | BNX2X_VF_CIDS + \ |
1202 | CNIC_ISCSI_CID_MAX) | ||
1202 | #define TM_ILT_SZ (8 * TM_CONN_NUM) | 1203 | #define TM_ILT_SZ (8 * TM_CONN_NUM) |
1203 | #define TM_ILT_LINES DIV_ROUND_UP(TM_ILT_SZ, TM_ILT_PAGE_SZ) | 1204 | #define TM_ILT_LINES DIV_ROUND_UP(TM_ILT_SZ, TM_ILT_PAGE_SZ) |
1204 | 1205 | ||
@@ -1527,7 +1528,6 @@ struct bnx2x { | |||
1527 | #define PCI_32BIT_FLAG (1 << 1) | 1528 | #define PCI_32BIT_FLAG (1 << 1) |
1528 | #define ONE_PORT_FLAG (1 << 2) | 1529 | #define ONE_PORT_FLAG (1 << 2) |
1529 | #define NO_WOL_FLAG (1 << 3) | 1530 | #define NO_WOL_FLAG (1 << 3) |
1530 | #define USING_DAC_FLAG (1 << 4) | ||
1531 | #define USING_MSIX_FLAG (1 << 5) | 1531 | #define USING_MSIX_FLAG (1 << 5) |
1532 | #define USING_MSI_FLAG (1 << 6) | 1532 | #define USING_MSI_FLAG (1 << 6) |
1533 | #define DISABLE_MSI_FLAG (1 << 7) | 1533 | #define DISABLE_MSI_FLAG (1 << 7) |
@@ -1621,7 +1621,7 @@ struct bnx2x { | |||
1621 | u16 rx_ticks_int; | 1621 | u16 rx_ticks_int; |
1622 | u16 rx_ticks; | 1622 | u16 rx_ticks; |
1623 | /* Maximal coalescing timeout in us */ | 1623 | /* Maximal coalescing timeout in us */ |
1624 | #define BNX2X_MAX_COALESCE_TOUT (0xf0*12) | 1624 | #define BNX2X_MAX_COALESCE_TOUT (0xff*BNX2X_BTR) |
1625 | 1625 | ||
1626 | u32 lin_cnt; | 1626 | u32 lin_cnt; |
1627 | 1627 | ||
@@ -2072,7 +2072,8 @@ u32 bnx2x_dmae_opcode(struct bnx2x *bp, u8 src_type, u8 dst_type, | |||
2072 | 2072 | ||
2073 | void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, | 2073 | void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
2074 | u8 src_type, u8 dst_type); | 2074 | u8 src_type, u8 dst_type); |
2075 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae); | 2075 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
2076 | u32 *comp); | ||
2076 | 2077 | ||
2077 | /* FLR related routines */ | 2078 | /* FLR related routines */ |
2078 | u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp); | 2079 | u32 bnx2x_flr_clnup_poll_count(struct bnx2x *bp); |
@@ -2498,4 +2499,8 @@ enum bnx2x_pci_bus_speed { | |||
2498 | }; | 2499 | }; |
2499 | 2500 | ||
2500 | void bnx2x_set_local_cmng(struct bnx2x *bp); | 2501 | void bnx2x_set_local_cmng(struct bnx2x *bp); |
2502 | |||
2503 | #define MCPR_SCRATCH_BASE(bp) \ | ||
2504 | (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) | ||
2505 | |||
2501 | #endif /* bnx2x.h */ | 2506 | #endif /* bnx2x.h */ |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c index e66beff2704d..4ab4c89c60cd 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c | |||
@@ -681,6 +681,7 @@ static void bnx2x_gro_receive(struct bnx2x *bp, struct bnx2x_fastpath *fp, | |||
681 | } | 681 | } |
682 | } | 682 | } |
683 | #endif | 683 | #endif |
684 | skb_record_rx_queue(skb, fp->rx_queue); | ||
684 | napi_gro_receive(&fp->napi, skb); | 685 | napi_gro_receive(&fp->napi, skb); |
685 | } | 686 | } |
686 | 687 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 324de5f05332..e8efa1c93ffe 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | |||
@@ -891,17 +891,8 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
891 | * will re-enable parity attentions right after the dump. | 891 | * will re-enable parity attentions right after the dump. |
892 | */ | 892 | */ |
893 | 893 | ||
894 | /* Disable parity on path 0 */ | ||
895 | bnx2x_pretend_func(bp, 0); | ||
896 | bnx2x_disable_blocks_parity(bp); | 894 | bnx2x_disable_blocks_parity(bp); |
897 | 895 | ||
898 | /* Disable parity on path 1 */ | ||
899 | bnx2x_pretend_func(bp, 1); | ||
900 | bnx2x_disable_blocks_parity(bp); | ||
901 | |||
902 | /* Return to current function */ | ||
903 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
904 | |||
905 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; | 896 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; |
906 | dump_hdr.preset = DUMP_ALL_PRESETS; | 897 | dump_hdr.preset = DUMP_ALL_PRESETS; |
907 | dump_hdr.version = BNX2X_DUMP_VERSION; | 898 | dump_hdr.version = BNX2X_DUMP_VERSION; |
@@ -928,18 +919,9 @@ static void bnx2x_get_regs(struct net_device *dev, | |||
928 | /* Actually read the registers */ | 919 | /* Actually read the registers */ |
929 | __bnx2x_get_regs(bp, p); | 920 | __bnx2x_get_regs(bp, p); |
930 | 921 | ||
931 | /* Re-enable parity attentions on path 0 */ | 922 | /* Re-enable parity attentions */ |
932 | bnx2x_pretend_func(bp, 0); | ||
933 | bnx2x_clear_blocks_parity(bp); | 923 | bnx2x_clear_blocks_parity(bp); |
934 | bnx2x_enable_blocks_parity(bp); | 924 | bnx2x_enable_blocks_parity(bp); |
935 | |||
936 | /* Re-enable parity attentions on path 1 */ | ||
937 | bnx2x_pretend_func(bp, 1); | ||
938 | bnx2x_clear_blocks_parity(bp); | ||
939 | bnx2x_enable_blocks_parity(bp); | ||
940 | |||
941 | /* Return to current function */ | ||
942 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
943 | } | 925 | } |
944 | 926 | ||
945 | static int bnx2x_get_preset_regs_len(struct net_device *dev, u32 preset) | 927 | static int bnx2x_get_preset_regs_len(struct net_device *dev, u32 preset) |
@@ -993,17 +975,8 @@ static int bnx2x_get_dump_data(struct net_device *dev, | |||
993 | * will re-enable parity attentions right after the dump. | 975 | * will re-enable parity attentions right after the dump. |
994 | */ | 976 | */ |
995 | 977 | ||
996 | /* Disable parity on path 0 */ | ||
997 | bnx2x_pretend_func(bp, 0); | ||
998 | bnx2x_disable_blocks_parity(bp); | 978 | bnx2x_disable_blocks_parity(bp); |
999 | 979 | ||
1000 | /* Disable parity on path 1 */ | ||
1001 | bnx2x_pretend_func(bp, 1); | ||
1002 | bnx2x_disable_blocks_parity(bp); | ||
1003 | |||
1004 | /* Return to current function */ | ||
1005 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
1006 | |||
1007 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; | 980 | dump_hdr.header_size = (sizeof(struct dump_header) / 4) - 1; |
1008 | dump_hdr.preset = bp->dump_preset_idx; | 981 | dump_hdr.preset = bp->dump_preset_idx; |
1009 | dump_hdr.version = BNX2X_DUMP_VERSION; | 982 | dump_hdr.version = BNX2X_DUMP_VERSION; |
@@ -1032,19 +1005,10 @@ static int bnx2x_get_dump_data(struct net_device *dev, | |||
1032 | /* Actually read the registers */ | 1005 | /* Actually read the registers */ |
1033 | __bnx2x_get_preset_regs(bp, p, dump_hdr.preset); | 1006 | __bnx2x_get_preset_regs(bp, p, dump_hdr.preset); |
1034 | 1007 | ||
1035 | /* Re-enable parity attentions on path 0 */ | 1008 | /* Re-enable parity attentions */ |
1036 | bnx2x_pretend_func(bp, 0); | ||
1037 | bnx2x_clear_blocks_parity(bp); | 1009 | bnx2x_clear_blocks_parity(bp); |
1038 | bnx2x_enable_blocks_parity(bp); | 1010 | bnx2x_enable_blocks_parity(bp); |
1039 | 1011 | ||
1040 | /* Re-enable parity attentions on path 1 */ | ||
1041 | bnx2x_pretend_func(bp, 1); | ||
1042 | bnx2x_clear_blocks_parity(bp); | ||
1043 | bnx2x_enable_blocks_parity(bp); | ||
1044 | |||
1045 | /* Return to current function */ | ||
1046 | bnx2x_pretend_func(bp, BP_ABS_FUNC(bp)); | ||
1047 | |||
1048 | return 0; | 1012 | return 0; |
1049 | } | 1013 | } |
1050 | 1014 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h index 76df015f486a..c2dfea7968f4 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_init.h | |||
@@ -640,23 +640,35 @@ static const struct { | |||
640 | * [30] MCP Latched ump_tx_parity | 640 | * [30] MCP Latched ump_tx_parity |
641 | * [31] MCP Latched scpad_parity | 641 | * [31] MCP Latched scpad_parity |
642 | */ | 642 | */ |
643 | #define MISC_AEU_ENABLE_MCP_PRTY_BITS \ | 643 | #define MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS \ |
644 | (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \ | 644 | (AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY | \ |
645 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \ | 645 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY | \ |
646 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \ | 646 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY) |
647 | |||
648 | #define MISC_AEU_ENABLE_MCP_PRTY_BITS \ | ||
649 | (MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS | \ | ||
647 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY) | 650 | AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY) |
648 | 651 | ||
649 | /* Below registers control the MCP parity attention output. When | 652 | /* Below registers control the MCP parity attention output. When |
650 | * MISC_AEU_ENABLE_MCP_PRTY_BITS are set - attentions are | 653 | * MISC_AEU_ENABLE_MCP_PRTY_BITS are set - attentions are |
651 | * enabled, when cleared - disabled. | 654 | * enabled, when cleared - disabled. |
652 | */ | 655 | */ |
653 | static const u32 mcp_attn_ctl_regs[] = { | 656 | static const struct { |
654 | MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0, | 657 | u32 addr; |
655 | MISC_REG_AEU_ENABLE4_NIG_0, | 658 | u32 bits; |
656 | MISC_REG_AEU_ENABLE4_PXP_0, | 659 | } mcp_attn_ctl_regs[] = { |
657 | MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0, | 660 | { MISC_REG_AEU_ENABLE4_FUNC_0_OUT_0, |
658 | MISC_REG_AEU_ENABLE4_NIG_1, | 661 | MISC_AEU_ENABLE_MCP_PRTY_BITS }, |
659 | MISC_REG_AEU_ENABLE4_PXP_1 | 662 | { MISC_REG_AEU_ENABLE4_NIG_0, |
663 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
664 | { MISC_REG_AEU_ENABLE4_PXP_0, | ||
665 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
666 | { MISC_REG_AEU_ENABLE4_FUNC_1_OUT_0, | ||
667 | MISC_AEU_ENABLE_MCP_PRTY_BITS }, | ||
668 | { MISC_REG_AEU_ENABLE4_NIG_1, | ||
669 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS }, | ||
670 | { MISC_REG_AEU_ENABLE4_PXP_1, | ||
671 | MISC_AEU_ENABLE_MCP_PRTY_SUB_BITS } | ||
660 | }; | 672 | }; |
661 | 673 | ||
662 | static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) | 674 | static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) |
@@ -665,14 +677,14 @@ static inline void bnx2x_set_mcp_parity(struct bnx2x *bp, u8 enable) | |||
665 | u32 reg_val; | 677 | u32 reg_val; |
666 | 678 | ||
667 | for (i = 0; i < ARRAY_SIZE(mcp_attn_ctl_regs); i++) { | 679 | for (i = 0; i < ARRAY_SIZE(mcp_attn_ctl_regs); i++) { |
668 | reg_val = REG_RD(bp, mcp_attn_ctl_regs[i]); | 680 | reg_val = REG_RD(bp, mcp_attn_ctl_regs[i].addr); |
669 | 681 | ||
670 | if (enable) | 682 | if (enable) |
671 | reg_val |= MISC_AEU_ENABLE_MCP_PRTY_BITS; | 683 | reg_val |= mcp_attn_ctl_regs[i].bits; |
672 | else | 684 | else |
673 | reg_val &= ~MISC_AEU_ENABLE_MCP_PRTY_BITS; | 685 | reg_val &= ~mcp_attn_ctl_regs[i].bits; |
674 | 686 | ||
675 | REG_WR(bp, mcp_attn_ctl_regs[i], reg_val); | 687 | REG_WR(bp, mcp_attn_ctl_regs[i].addr, reg_val); |
676 | } | 688 | } |
677 | } | 689 | } |
678 | 690 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index 82b658d8c04c..b42f89ce02ef 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -503,9 +503,9 @@ void bnx2x_prep_dmae_with_comp(struct bnx2x *bp, | |||
503 | } | 503 | } |
504 | 504 | ||
505 | /* issue a dmae command over the init-channel and wait for completion */ | 505 | /* issue a dmae command over the init-channel and wait for completion */ |
506 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | 506 | int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae, |
507 | u32 *comp) | ||
507 | { | 508 | { |
508 | u32 *wb_comp = bnx2x_sp(bp, wb_comp); | ||
509 | int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000; | 509 | int cnt = CHIP_REV_IS_SLOW(bp) ? (400000) : 4000; |
510 | int rc = 0; | 510 | int rc = 0; |
511 | 511 | ||
@@ -518,14 +518,14 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | |||
518 | spin_lock_bh(&bp->dmae_lock); | 518 | spin_lock_bh(&bp->dmae_lock); |
519 | 519 | ||
520 | /* reset completion */ | 520 | /* reset completion */ |
521 | *wb_comp = 0; | 521 | *comp = 0; |
522 | 522 | ||
523 | /* post the command on the channel used for initializations */ | 523 | /* post the command on the channel used for initializations */ |
524 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); | 524 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); |
525 | 525 | ||
526 | /* wait for completion */ | 526 | /* wait for completion */ |
527 | udelay(5); | 527 | udelay(5); |
528 | while ((*wb_comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) { | 528 | while ((*comp & ~DMAE_PCI_ERR_FLAG) != DMAE_COMP_VAL) { |
529 | 529 | ||
530 | if (!cnt || | 530 | if (!cnt || |
531 | (bp->recovery_state != BNX2X_RECOVERY_DONE && | 531 | (bp->recovery_state != BNX2X_RECOVERY_DONE && |
@@ -537,7 +537,7 @@ int bnx2x_issue_dmae_with_comp(struct bnx2x *bp, struct dmae_command *dmae) | |||
537 | cnt--; | 537 | cnt--; |
538 | udelay(50); | 538 | udelay(50); |
539 | } | 539 | } |
540 | if (*wb_comp & DMAE_PCI_ERR_FLAG) { | 540 | if (*comp & DMAE_PCI_ERR_FLAG) { |
541 | BNX2X_ERR("DMAE PCI error!\n"); | 541 | BNX2X_ERR("DMAE PCI error!\n"); |
542 | rc = DMAE_PCI_ERROR; | 542 | rc = DMAE_PCI_ERROR; |
543 | } | 543 | } |
@@ -574,7 +574,7 @@ void bnx2x_write_dmae(struct bnx2x *bp, dma_addr_t dma_addr, u32 dst_addr, | |||
574 | dmae.len = len32; | 574 | dmae.len = len32; |
575 | 575 | ||
576 | /* issue the command and wait for completion */ | 576 | /* issue the command and wait for completion */ |
577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae); | 577 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
578 | if (rc) { | 578 | if (rc) { |
579 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 579 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
580 | bnx2x_panic(); | 580 | bnx2x_panic(); |
@@ -611,7 +611,7 @@ void bnx2x_read_dmae(struct bnx2x *bp, u32 src_addr, u32 len32) | |||
611 | dmae.len = len32; | 611 | dmae.len = len32; |
612 | 612 | ||
613 | /* issue the command and wait for completion */ | 613 | /* issue the command and wait for completion */ |
614 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae); | 614 | rc = bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
615 | if (rc) { | 615 | if (rc) { |
616 | BNX2X_ERR("DMAE returned failure %d\n", rc); | 616 | BNX2X_ERR("DMAE returned failure %d\n", rc); |
617 | bnx2x_panic(); | 617 | bnx2x_panic(); |
@@ -751,6 +751,10 @@ static int bnx2x_mc_assert(struct bnx2x *bp) | |||
751 | return rc; | 751 | return rc; |
752 | } | 752 | } |
753 | 753 | ||
754 | #define MCPR_TRACE_BUFFER_SIZE (0x800) | ||
755 | #define SCRATCH_BUFFER_SIZE(bp) \ | ||
756 | (CHIP_IS_E1(bp) ? 0x10000 : (CHIP_IS_E1H(bp) ? 0x20000 : 0x28000)) | ||
757 | |||
754 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | 758 | void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) |
755 | { | 759 | { |
756 | u32 addr, val; | 760 | u32 addr, val; |
@@ -775,7 +779,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | |||
775 | trace_shmem_base = bp->common.shmem_base; | 779 | trace_shmem_base = bp->common.shmem_base; |
776 | else | 780 | else |
777 | trace_shmem_base = SHMEM2_RD(bp, other_shmem_base_addr); | 781 | trace_shmem_base = SHMEM2_RD(bp, other_shmem_base_addr); |
778 | addr = trace_shmem_base - 0x800; | 782 | |
783 | /* sanity */ | ||
784 | if (trace_shmem_base < MCPR_SCRATCH_BASE(bp) + MCPR_TRACE_BUFFER_SIZE || | ||
785 | trace_shmem_base >= MCPR_SCRATCH_BASE(bp) + | ||
786 | SCRATCH_BUFFER_SIZE(bp)) { | ||
787 | BNX2X_ERR("Unable to dump trace buffer (mark %x)\n", | ||
788 | trace_shmem_base); | ||
789 | return; | ||
790 | } | ||
791 | |||
792 | addr = trace_shmem_base - MCPR_TRACE_BUFFER_SIZE; | ||
779 | 793 | ||
780 | /* validate TRCB signature */ | 794 | /* validate TRCB signature */ |
781 | mark = REG_RD(bp, addr); | 795 | mark = REG_RD(bp, addr); |
@@ -787,14 +801,17 @@ void bnx2x_fw_dump_lvl(struct bnx2x *bp, const char *lvl) | |||
787 | /* read cyclic buffer pointer */ | 801 | /* read cyclic buffer pointer */ |
788 | addr += 4; | 802 | addr += 4; |
789 | mark = REG_RD(bp, addr); | 803 | mark = REG_RD(bp, addr); |
790 | mark = (CHIP_IS_E1x(bp) ? MCP_REG_MCPR_SCRATCH : MCP_A_REG_MCPR_SCRATCH) | 804 | mark = MCPR_SCRATCH_BASE(bp) + ((mark + 0x3) & ~0x3) - 0x08000000; |
791 | + ((mark + 0x3) & ~0x3) - 0x08000000; | 805 | if (mark >= trace_shmem_base || mark < addr + 4) { |
806 | BNX2X_ERR("Mark doesn't fall inside Trace Buffer\n"); | ||
807 | return; | ||
808 | } | ||
792 | printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); | 809 | printk("%s" "begin fw dump (mark 0x%x)\n", lvl, mark); |
793 | 810 | ||
794 | printk("%s", lvl); | 811 | printk("%s", lvl); |
795 | 812 | ||
796 | /* dump buffer after the mark */ | 813 | /* dump buffer after the mark */ |
797 | for (offset = mark; offset <= trace_shmem_base; offset += 0x8*4) { | 814 | for (offset = mark; offset < trace_shmem_base; offset += 0x8*4) { |
798 | for (word = 0; word < 8; word++) | 815 | for (word = 0; word < 8; word++) |
799 | data[word] = htonl(REG_RD(bp, offset + 4*word)); | 816 | data[word] = htonl(REG_RD(bp, offset + 4*word)); |
800 | data[8] = 0x0; | 817 | data[8] = 0x0; |
@@ -4280,65 +4297,60 @@ static void _print_next_block(int idx, const char *blk) | |||
4280 | pr_cont("%s%s", idx ? ", " : "", blk); | 4297 | pr_cont("%s%s", idx ? ", " : "", blk); |
4281 | } | 4298 | } |
4282 | 4299 | ||
4283 | static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, | 4300 | static bool bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, |
4284 | int par_num, bool print) | 4301 | int *par_num, bool print) |
4285 | { | 4302 | { |
4286 | int i = 0; | 4303 | u32 cur_bit; |
4287 | u32 cur_bit = 0; | 4304 | bool res; |
4305 | int i; | ||
4306 | |||
4307 | res = false; | ||
4308 | |||
4288 | for (i = 0; sig; i++) { | 4309 | for (i = 0; sig; i++) { |
4289 | cur_bit = ((u32)0x1 << i); | 4310 | cur_bit = (0x1UL << i); |
4290 | if (sig & cur_bit) { | 4311 | if (sig & cur_bit) { |
4291 | switch (cur_bit) { | 4312 | res |= true; /* Each bit is real error! */ |
4292 | case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR: | 4313 | |
4293 | if (print) { | 4314 | if (print) { |
4294 | _print_next_block(par_num++, "BRB"); | 4315 | switch (cur_bit) { |
4316 | case AEU_INPUTS_ATTN_BITS_BRB_PARITY_ERROR: | ||
4317 | _print_next_block((*par_num)++, "BRB"); | ||
4295 | _print_parity(bp, | 4318 | _print_parity(bp, |
4296 | BRB1_REG_BRB1_PRTY_STS); | 4319 | BRB1_REG_BRB1_PRTY_STS); |
4297 | } | 4320 | break; |
4298 | break; | 4321 | case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR: |
4299 | case AEU_INPUTS_ATTN_BITS_PARSER_PARITY_ERROR: | 4322 | _print_next_block((*par_num)++, |
4300 | if (print) { | 4323 | "PARSER"); |
4301 | _print_next_block(par_num++, "PARSER"); | ||
4302 | _print_parity(bp, PRS_REG_PRS_PRTY_STS); | 4324 | _print_parity(bp, PRS_REG_PRS_PRTY_STS); |
4303 | } | 4325 | break; |
4304 | break; | 4326 | case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR: |
4305 | case AEU_INPUTS_ATTN_BITS_TSDM_PARITY_ERROR: | 4327 | _print_next_block((*par_num)++, "TSDM"); |
4306 | if (print) { | ||
4307 | _print_next_block(par_num++, "TSDM"); | ||
4308 | _print_parity(bp, | 4328 | _print_parity(bp, |
4309 | TSDM_REG_TSDM_PRTY_STS); | 4329 | TSDM_REG_TSDM_PRTY_STS); |
4310 | } | 4330 | break; |
4311 | break; | 4331 | case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR: |
4312 | case AEU_INPUTS_ATTN_BITS_SEARCHER_PARITY_ERROR: | 4332 | _print_next_block((*par_num)++, |
4313 | if (print) { | ||
4314 | _print_next_block(par_num++, | ||
4315 | "SEARCHER"); | 4333 | "SEARCHER"); |
4316 | _print_parity(bp, SRC_REG_SRC_PRTY_STS); | 4334 | _print_parity(bp, SRC_REG_SRC_PRTY_STS); |
4317 | } | 4335 | break; |
4318 | break; | 4336 | case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR: |
4319 | case AEU_INPUTS_ATTN_BITS_TCM_PARITY_ERROR: | 4337 | _print_next_block((*par_num)++, "TCM"); |
4320 | if (print) { | 4338 | _print_parity(bp, TCM_REG_TCM_PRTY_STS); |
4321 | _print_next_block(par_num++, "TCM"); | 4339 | break; |
4322 | _print_parity(bp, | 4340 | case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR: |
4323 | TCM_REG_TCM_PRTY_STS); | 4341 | _print_next_block((*par_num)++, |
4324 | } | 4342 | "TSEMI"); |
4325 | break; | ||
4326 | case AEU_INPUTS_ATTN_BITS_TSEMI_PARITY_ERROR: | ||
4327 | if (print) { | ||
4328 | _print_next_block(par_num++, "TSEMI"); | ||
4329 | _print_parity(bp, | 4343 | _print_parity(bp, |
4330 | TSEM_REG_TSEM_PRTY_STS_0); | 4344 | TSEM_REG_TSEM_PRTY_STS_0); |
4331 | _print_parity(bp, | 4345 | _print_parity(bp, |
4332 | TSEM_REG_TSEM_PRTY_STS_1); | 4346 | TSEM_REG_TSEM_PRTY_STS_1); |
4333 | } | 4347 | break; |
4334 | break; | 4348 | case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR: |
4335 | case AEU_INPUTS_ATTN_BITS_PBCLIENT_PARITY_ERROR: | 4349 | _print_next_block((*par_num)++, "XPB"); |
4336 | if (print) { | ||
4337 | _print_next_block(par_num++, "XPB"); | ||
4338 | _print_parity(bp, GRCBASE_XPB + | 4350 | _print_parity(bp, GRCBASE_XPB + |
4339 | PB_REG_PB_PRTY_STS); | 4351 | PB_REG_PB_PRTY_STS); |
4352 | break; | ||
4340 | } | 4353 | } |
4341 | break; | ||
4342 | } | 4354 | } |
4343 | 4355 | ||
4344 | /* Clear the bit */ | 4356 | /* Clear the bit */ |
@@ -4346,53 +4358,59 @@ static int bnx2x_check_blocks_with_parity0(struct bnx2x *bp, u32 sig, | |||
4346 | } | 4358 | } |
4347 | } | 4359 | } |
4348 | 4360 | ||
4349 | return par_num; | 4361 | return res; |
4350 | } | 4362 | } |
4351 | 4363 | ||
4352 | static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | 4364 | static bool bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, |
4353 | int par_num, bool *global, | 4365 | int *par_num, bool *global, |
4354 | bool print) | 4366 | bool print) |
4355 | { | 4367 | { |
4356 | int i = 0; | 4368 | u32 cur_bit; |
4357 | u32 cur_bit = 0; | 4369 | bool res; |
4370 | int i; | ||
4371 | |||
4372 | res = false; | ||
4373 | |||
4358 | for (i = 0; sig; i++) { | 4374 | for (i = 0; sig; i++) { |
4359 | cur_bit = ((u32)0x1 << i); | 4375 | cur_bit = (0x1UL << i); |
4360 | if (sig & cur_bit) { | 4376 | if (sig & cur_bit) { |
4377 | res |= true; /* Each bit is real error! */ | ||
4361 | switch (cur_bit) { | 4378 | switch (cur_bit) { |
4362 | case AEU_INPUTS_ATTN_BITS_PBF_PARITY_ERROR: | 4379 | case AEU_INPUTS_ATTN_BITS_PBF_PARITY_ERROR: |
4363 | if (print) { | 4380 | if (print) { |
4364 | _print_next_block(par_num++, "PBF"); | 4381 | _print_next_block((*par_num)++, "PBF"); |
4365 | _print_parity(bp, PBF_REG_PBF_PRTY_STS); | 4382 | _print_parity(bp, PBF_REG_PBF_PRTY_STS); |
4366 | } | 4383 | } |
4367 | break; | 4384 | break; |
4368 | case AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR: | 4385 | case AEU_INPUTS_ATTN_BITS_QM_PARITY_ERROR: |
4369 | if (print) { | 4386 | if (print) { |
4370 | _print_next_block(par_num++, "QM"); | 4387 | _print_next_block((*par_num)++, "QM"); |
4371 | _print_parity(bp, QM_REG_QM_PRTY_STS); | 4388 | _print_parity(bp, QM_REG_QM_PRTY_STS); |
4372 | } | 4389 | } |
4373 | break; | 4390 | break; |
4374 | case AEU_INPUTS_ATTN_BITS_TIMERS_PARITY_ERROR: | 4391 | case AEU_INPUTS_ATTN_BITS_TIMERS_PARITY_ERROR: |
4375 | if (print) { | 4392 | if (print) { |
4376 | _print_next_block(par_num++, "TM"); | 4393 | _print_next_block((*par_num)++, "TM"); |
4377 | _print_parity(bp, TM_REG_TM_PRTY_STS); | 4394 | _print_parity(bp, TM_REG_TM_PRTY_STS); |
4378 | } | 4395 | } |
4379 | break; | 4396 | break; |
4380 | case AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR: | 4397 | case AEU_INPUTS_ATTN_BITS_XSDM_PARITY_ERROR: |
4381 | if (print) { | 4398 | if (print) { |
4382 | _print_next_block(par_num++, "XSDM"); | 4399 | _print_next_block((*par_num)++, "XSDM"); |
4383 | _print_parity(bp, | 4400 | _print_parity(bp, |
4384 | XSDM_REG_XSDM_PRTY_STS); | 4401 | XSDM_REG_XSDM_PRTY_STS); |
4385 | } | 4402 | } |
4386 | break; | 4403 | break; |
4387 | case AEU_INPUTS_ATTN_BITS_XCM_PARITY_ERROR: | 4404 | case AEU_INPUTS_ATTN_BITS_XCM_PARITY_ERROR: |
4388 | if (print) { | 4405 | if (print) { |
4389 | _print_next_block(par_num++, "XCM"); | 4406 | _print_next_block((*par_num)++, "XCM"); |
4390 | _print_parity(bp, XCM_REG_XCM_PRTY_STS); | 4407 | _print_parity(bp, XCM_REG_XCM_PRTY_STS); |
4391 | } | 4408 | } |
4392 | break; | 4409 | break; |
4393 | case AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR: | 4410 | case AEU_INPUTS_ATTN_BITS_XSEMI_PARITY_ERROR: |
4394 | if (print) { | 4411 | if (print) { |
4395 | _print_next_block(par_num++, "XSEMI"); | 4412 | _print_next_block((*par_num)++, |
4413 | "XSEMI"); | ||
4396 | _print_parity(bp, | 4414 | _print_parity(bp, |
4397 | XSEM_REG_XSEM_PRTY_STS_0); | 4415 | XSEM_REG_XSEM_PRTY_STS_0); |
4398 | _print_parity(bp, | 4416 | _print_parity(bp, |
@@ -4401,7 +4419,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4401 | break; | 4419 | break; |
4402 | case AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR: | 4420 | case AEU_INPUTS_ATTN_BITS_DOORBELLQ_PARITY_ERROR: |
4403 | if (print) { | 4421 | if (print) { |
4404 | _print_next_block(par_num++, | 4422 | _print_next_block((*par_num)++, |
4405 | "DOORBELLQ"); | 4423 | "DOORBELLQ"); |
4406 | _print_parity(bp, | 4424 | _print_parity(bp, |
4407 | DORQ_REG_DORQ_PRTY_STS); | 4425 | DORQ_REG_DORQ_PRTY_STS); |
@@ -4409,7 +4427,7 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4409 | break; | 4427 | break; |
4410 | case AEU_INPUTS_ATTN_BITS_NIG_PARITY_ERROR: | 4428 | case AEU_INPUTS_ATTN_BITS_NIG_PARITY_ERROR: |
4411 | if (print) { | 4429 | if (print) { |
4412 | _print_next_block(par_num++, "NIG"); | 4430 | _print_next_block((*par_num)++, "NIG"); |
4413 | if (CHIP_IS_E1x(bp)) { | 4431 | if (CHIP_IS_E1x(bp)) { |
4414 | _print_parity(bp, | 4432 | _print_parity(bp, |
4415 | NIG_REG_NIG_PRTY_STS); | 4433 | NIG_REG_NIG_PRTY_STS); |
@@ -4423,32 +4441,34 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4423 | break; | 4441 | break; |
4424 | case AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR: | 4442 | case AEU_INPUTS_ATTN_BITS_VAUX_PCI_CORE_PARITY_ERROR: |
4425 | if (print) | 4443 | if (print) |
4426 | _print_next_block(par_num++, | 4444 | _print_next_block((*par_num)++, |
4427 | "VAUX PCI CORE"); | 4445 | "VAUX PCI CORE"); |
4428 | *global = true; | 4446 | *global = true; |
4429 | break; | 4447 | break; |
4430 | case AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR: | 4448 | case AEU_INPUTS_ATTN_BITS_DEBUG_PARITY_ERROR: |
4431 | if (print) { | 4449 | if (print) { |
4432 | _print_next_block(par_num++, "DEBUG"); | 4450 | _print_next_block((*par_num)++, |
4451 | "DEBUG"); | ||
4433 | _print_parity(bp, DBG_REG_DBG_PRTY_STS); | 4452 | _print_parity(bp, DBG_REG_DBG_PRTY_STS); |
4434 | } | 4453 | } |
4435 | break; | 4454 | break; |
4436 | case AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR: | 4455 | case AEU_INPUTS_ATTN_BITS_USDM_PARITY_ERROR: |
4437 | if (print) { | 4456 | if (print) { |
4438 | _print_next_block(par_num++, "USDM"); | 4457 | _print_next_block((*par_num)++, "USDM"); |
4439 | _print_parity(bp, | 4458 | _print_parity(bp, |
4440 | USDM_REG_USDM_PRTY_STS); | 4459 | USDM_REG_USDM_PRTY_STS); |
4441 | } | 4460 | } |
4442 | break; | 4461 | break; |
4443 | case AEU_INPUTS_ATTN_BITS_UCM_PARITY_ERROR: | 4462 | case AEU_INPUTS_ATTN_BITS_UCM_PARITY_ERROR: |
4444 | if (print) { | 4463 | if (print) { |
4445 | _print_next_block(par_num++, "UCM"); | 4464 | _print_next_block((*par_num)++, "UCM"); |
4446 | _print_parity(bp, UCM_REG_UCM_PRTY_STS); | 4465 | _print_parity(bp, UCM_REG_UCM_PRTY_STS); |
4447 | } | 4466 | } |
4448 | break; | 4467 | break; |
4449 | case AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR: | 4468 | case AEU_INPUTS_ATTN_BITS_USEMI_PARITY_ERROR: |
4450 | if (print) { | 4469 | if (print) { |
4451 | _print_next_block(par_num++, "USEMI"); | 4470 | _print_next_block((*par_num)++, |
4471 | "USEMI"); | ||
4452 | _print_parity(bp, | 4472 | _print_parity(bp, |
4453 | USEM_REG_USEM_PRTY_STS_0); | 4473 | USEM_REG_USEM_PRTY_STS_0); |
4454 | _print_parity(bp, | 4474 | _print_parity(bp, |
@@ -4457,21 +4477,21 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4457 | break; | 4477 | break; |
4458 | case AEU_INPUTS_ATTN_BITS_UPB_PARITY_ERROR: | 4478 | case AEU_INPUTS_ATTN_BITS_UPB_PARITY_ERROR: |
4459 | if (print) { | 4479 | if (print) { |
4460 | _print_next_block(par_num++, "UPB"); | 4480 | _print_next_block((*par_num)++, "UPB"); |
4461 | _print_parity(bp, GRCBASE_UPB + | 4481 | _print_parity(bp, GRCBASE_UPB + |
4462 | PB_REG_PB_PRTY_STS); | 4482 | PB_REG_PB_PRTY_STS); |
4463 | } | 4483 | } |
4464 | break; | 4484 | break; |
4465 | case AEU_INPUTS_ATTN_BITS_CSDM_PARITY_ERROR: | 4485 | case AEU_INPUTS_ATTN_BITS_CSDM_PARITY_ERROR: |
4466 | if (print) { | 4486 | if (print) { |
4467 | _print_next_block(par_num++, "CSDM"); | 4487 | _print_next_block((*par_num)++, "CSDM"); |
4468 | _print_parity(bp, | 4488 | _print_parity(bp, |
4469 | CSDM_REG_CSDM_PRTY_STS); | 4489 | CSDM_REG_CSDM_PRTY_STS); |
4470 | } | 4490 | } |
4471 | break; | 4491 | break; |
4472 | case AEU_INPUTS_ATTN_BITS_CCM_PARITY_ERROR: | 4492 | case AEU_INPUTS_ATTN_BITS_CCM_PARITY_ERROR: |
4473 | if (print) { | 4493 | if (print) { |
4474 | _print_next_block(par_num++, "CCM"); | 4494 | _print_next_block((*par_num)++, "CCM"); |
4475 | _print_parity(bp, CCM_REG_CCM_PRTY_STS); | 4495 | _print_parity(bp, CCM_REG_CCM_PRTY_STS); |
4476 | } | 4496 | } |
4477 | break; | 4497 | break; |
@@ -4482,80 +4502,73 @@ static int bnx2x_check_blocks_with_parity1(struct bnx2x *bp, u32 sig, | |||
4482 | } | 4502 | } |
4483 | } | 4503 | } |
4484 | 4504 | ||
4485 | return par_num; | 4505 | return res; |
4486 | } | 4506 | } |
4487 | 4507 | ||
4488 | static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, | 4508 | static bool bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, |
4489 | int par_num, bool print) | 4509 | int *par_num, bool print) |
4490 | { | 4510 | { |
4491 | int i = 0; | 4511 | u32 cur_bit; |
4492 | u32 cur_bit = 0; | 4512 | bool res; |
4513 | int i; | ||
4514 | |||
4515 | res = false; | ||
4516 | |||
4493 | for (i = 0; sig; i++) { | 4517 | for (i = 0; sig; i++) { |
4494 | cur_bit = ((u32)0x1 << i); | 4518 | cur_bit = (0x1UL << i); |
4495 | if (sig & cur_bit) { | 4519 | if (sig & cur_bit) { |
4496 | switch (cur_bit) { | 4520 | res |= true; /* Each bit is real error! */ |
4497 | case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR: | 4521 | if (print) { |
4498 | if (print) { | 4522 | switch (cur_bit) { |
4499 | _print_next_block(par_num++, "CSEMI"); | 4523 | case AEU_INPUTS_ATTN_BITS_CSEMI_PARITY_ERROR: |
4524 | _print_next_block((*par_num)++, | ||
4525 | "CSEMI"); | ||
4500 | _print_parity(bp, | 4526 | _print_parity(bp, |
4501 | CSEM_REG_CSEM_PRTY_STS_0); | 4527 | CSEM_REG_CSEM_PRTY_STS_0); |
4502 | _print_parity(bp, | 4528 | _print_parity(bp, |
4503 | CSEM_REG_CSEM_PRTY_STS_1); | 4529 | CSEM_REG_CSEM_PRTY_STS_1); |
4504 | } | 4530 | break; |
4505 | break; | 4531 | case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR: |
4506 | case AEU_INPUTS_ATTN_BITS_PXP_PARITY_ERROR: | 4532 | _print_next_block((*par_num)++, "PXP"); |
4507 | if (print) { | ||
4508 | _print_next_block(par_num++, "PXP"); | ||
4509 | _print_parity(bp, PXP_REG_PXP_PRTY_STS); | 4533 | _print_parity(bp, PXP_REG_PXP_PRTY_STS); |
4510 | _print_parity(bp, | 4534 | _print_parity(bp, |
4511 | PXP2_REG_PXP2_PRTY_STS_0); | 4535 | PXP2_REG_PXP2_PRTY_STS_0); |
4512 | _print_parity(bp, | 4536 | _print_parity(bp, |
4513 | PXP2_REG_PXP2_PRTY_STS_1); | 4537 | PXP2_REG_PXP2_PRTY_STS_1); |
4514 | } | 4538 | break; |
4515 | break; | 4539 | case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR: |
4516 | case AEU_IN_ATTN_BITS_PXPPCICLOCKCLIENT_PARITY_ERROR: | 4540 | _print_next_block((*par_num)++, |
4517 | if (print) | 4541 | "PXPPCICLOCKCLIENT"); |
4518 | _print_next_block(par_num++, | 4542 | break; |
4519 | "PXPPCICLOCKCLIENT"); | 4543 | case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR: |
4520 | break; | 4544 | _print_next_block((*par_num)++, "CFC"); |
4521 | case AEU_INPUTS_ATTN_BITS_CFC_PARITY_ERROR: | ||
4522 | if (print) { | ||
4523 | _print_next_block(par_num++, "CFC"); | ||
4524 | _print_parity(bp, | 4545 | _print_parity(bp, |
4525 | CFC_REG_CFC_PRTY_STS); | 4546 | CFC_REG_CFC_PRTY_STS); |
4526 | } | 4547 | break; |
4527 | break; | 4548 | case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR: |
4528 | case AEU_INPUTS_ATTN_BITS_CDU_PARITY_ERROR: | 4549 | _print_next_block((*par_num)++, "CDU"); |
4529 | if (print) { | ||
4530 | _print_next_block(par_num++, "CDU"); | ||
4531 | _print_parity(bp, CDU_REG_CDU_PRTY_STS); | 4550 | _print_parity(bp, CDU_REG_CDU_PRTY_STS); |
4532 | } | 4551 | break; |
4533 | break; | 4552 | case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR: |
4534 | case AEU_INPUTS_ATTN_BITS_DMAE_PARITY_ERROR: | 4553 | _print_next_block((*par_num)++, "DMAE"); |
4535 | if (print) { | ||
4536 | _print_next_block(par_num++, "DMAE"); | ||
4537 | _print_parity(bp, | 4554 | _print_parity(bp, |
4538 | DMAE_REG_DMAE_PRTY_STS); | 4555 | DMAE_REG_DMAE_PRTY_STS); |
4539 | } | 4556 | break; |
4540 | break; | 4557 | case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR: |
4541 | case AEU_INPUTS_ATTN_BITS_IGU_PARITY_ERROR: | 4558 | _print_next_block((*par_num)++, "IGU"); |
4542 | if (print) { | ||
4543 | _print_next_block(par_num++, "IGU"); | ||
4544 | if (CHIP_IS_E1x(bp)) | 4559 | if (CHIP_IS_E1x(bp)) |
4545 | _print_parity(bp, | 4560 | _print_parity(bp, |
4546 | HC_REG_HC_PRTY_STS); | 4561 | HC_REG_HC_PRTY_STS); |
4547 | else | 4562 | else |
4548 | _print_parity(bp, | 4563 | _print_parity(bp, |
4549 | IGU_REG_IGU_PRTY_STS); | 4564 | IGU_REG_IGU_PRTY_STS); |
4550 | } | 4565 | break; |
4551 | break; | 4566 | case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR: |
4552 | case AEU_INPUTS_ATTN_BITS_MISC_PARITY_ERROR: | 4567 | _print_next_block((*par_num)++, "MISC"); |
4553 | if (print) { | ||
4554 | _print_next_block(par_num++, "MISC"); | ||
4555 | _print_parity(bp, | 4568 | _print_parity(bp, |
4556 | MISC_REG_MISC_PRTY_STS); | 4569 | MISC_REG_MISC_PRTY_STS); |
4570 | break; | ||
4557 | } | 4571 | } |
4558 | break; | ||
4559 | } | 4572 | } |
4560 | 4573 | ||
4561 | /* Clear the bit */ | 4574 | /* Clear the bit */ |
@@ -4563,40 +4576,49 @@ static int bnx2x_check_blocks_with_parity2(struct bnx2x *bp, u32 sig, | |||
4563 | } | 4576 | } |
4564 | } | 4577 | } |
4565 | 4578 | ||
4566 | return par_num; | 4579 | return res; |
4567 | } | 4580 | } |
4568 | 4581 | ||
4569 | static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num, | 4582 | static bool bnx2x_check_blocks_with_parity3(struct bnx2x *bp, u32 sig, |
4570 | bool *global, bool print) | 4583 | int *par_num, bool *global, |
4584 | bool print) | ||
4571 | { | 4585 | { |
4572 | int i = 0; | 4586 | bool res = false; |
4573 | u32 cur_bit = 0; | 4587 | u32 cur_bit; |
4588 | int i; | ||
4589 | |||
4574 | for (i = 0; sig; i++) { | 4590 | for (i = 0; sig; i++) { |
4575 | cur_bit = ((u32)0x1 << i); | 4591 | cur_bit = (0x1UL << i); |
4576 | if (sig & cur_bit) { | 4592 | if (sig & cur_bit) { |
4577 | switch (cur_bit) { | 4593 | switch (cur_bit) { |
4578 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY: | 4594 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_ROM_PARITY: |
4579 | if (print) | 4595 | if (print) |
4580 | _print_next_block(par_num++, "MCP ROM"); | 4596 | _print_next_block((*par_num)++, |
4597 | "MCP ROM"); | ||
4581 | *global = true; | 4598 | *global = true; |
4599 | res |= true; | ||
4582 | break; | 4600 | break; |
4583 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY: | 4601 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_RX_PARITY: |
4584 | if (print) | 4602 | if (print) |
4585 | _print_next_block(par_num++, | 4603 | _print_next_block((*par_num)++, |
4586 | "MCP UMP RX"); | 4604 | "MCP UMP RX"); |
4587 | *global = true; | 4605 | *global = true; |
4606 | res |= true; | ||
4588 | break; | 4607 | break; |
4589 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY: | 4608 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY: |
4590 | if (print) | 4609 | if (print) |
4591 | _print_next_block(par_num++, | 4610 | _print_next_block((*par_num)++, |
4592 | "MCP UMP TX"); | 4611 | "MCP UMP TX"); |
4593 | *global = true; | 4612 | *global = true; |
4613 | res |= true; | ||
4594 | break; | 4614 | break; |
4595 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: | 4615 | case AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY: |
4596 | if (print) | 4616 | if (print) |
4597 | _print_next_block(par_num++, | 4617 | _print_next_block((*par_num)++, |
4598 | "MCP SCPAD"); | 4618 | "MCP SCPAD"); |
4599 | *global = true; | 4619 | /* clear latched SCPAD PATIRY from MCP */ |
4620 | REG_WR(bp, MISC_REG_AEU_CLR_LATCH_SIGNAL, | ||
4621 | 1UL << 10); | ||
4600 | break; | 4622 | break; |
4601 | } | 4623 | } |
4602 | 4624 | ||
@@ -4605,45 +4627,50 @@ static int bnx2x_check_blocks_with_parity3(u32 sig, int par_num, | |||
4605 | } | 4627 | } |
4606 | } | 4628 | } |
4607 | 4629 | ||
4608 | return par_num; | 4630 | return res; |
4609 | } | 4631 | } |
4610 | 4632 | ||
4611 | static int bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig, | 4633 | static bool bnx2x_check_blocks_with_parity4(struct bnx2x *bp, u32 sig, |
4612 | int par_num, bool print) | 4634 | int *par_num, bool print) |
4613 | { | 4635 | { |
4614 | int i = 0; | 4636 | u32 cur_bit; |
4615 | u32 cur_bit = 0; | 4637 | bool res; |
4638 | int i; | ||
4639 | |||
4640 | res = false; | ||
4641 | |||
4616 | for (i = 0; sig; i++) { | 4642 | for (i = 0; sig; i++) { |
4617 | cur_bit = ((u32)0x1 << i); | 4643 | cur_bit = (0x1UL << i); |
4618 | if (sig & cur_bit) { | 4644 | if (sig & cur_bit) { |
4619 | switch (cur_bit) { | 4645 | res |= true; /* Each bit is real error! */ |
4620 | case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR: | 4646 | if (print) { |
4621 | if (print) { | 4647 | switch (cur_bit) { |
4622 | _print_next_block(par_num++, "PGLUE_B"); | 4648 | case AEU_INPUTS_ATTN_BITS_PGLUE_PARITY_ERROR: |
4649 | _print_next_block((*par_num)++, | ||
4650 | "PGLUE_B"); | ||
4623 | _print_parity(bp, | 4651 | _print_parity(bp, |
4624 | PGLUE_B_REG_PGLUE_B_PRTY_STS); | 4652 | PGLUE_B_REG_PGLUE_B_PRTY_STS); |
4625 | } | 4653 | break; |
4626 | break; | 4654 | case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR: |
4627 | case AEU_INPUTS_ATTN_BITS_ATC_PARITY_ERROR: | 4655 | _print_next_block((*par_num)++, "ATC"); |
4628 | if (print) { | ||
4629 | _print_next_block(par_num++, "ATC"); | ||
4630 | _print_parity(bp, | 4656 | _print_parity(bp, |
4631 | ATC_REG_ATC_PRTY_STS); | 4657 | ATC_REG_ATC_PRTY_STS); |
4658 | break; | ||
4632 | } | 4659 | } |
4633 | break; | ||
4634 | } | 4660 | } |
4635 | |||
4636 | /* Clear the bit */ | 4661 | /* Clear the bit */ |
4637 | sig &= ~cur_bit; | 4662 | sig &= ~cur_bit; |
4638 | } | 4663 | } |
4639 | } | 4664 | } |
4640 | 4665 | ||
4641 | return par_num; | 4666 | return res; |
4642 | } | 4667 | } |
4643 | 4668 | ||
4644 | static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, | 4669 | static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, |
4645 | u32 *sig) | 4670 | u32 *sig) |
4646 | { | 4671 | { |
4672 | bool res = false; | ||
4673 | |||
4647 | if ((sig[0] & HW_PRTY_ASSERT_SET_0) || | 4674 | if ((sig[0] & HW_PRTY_ASSERT_SET_0) || |
4648 | (sig[1] & HW_PRTY_ASSERT_SET_1) || | 4675 | (sig[1] & HW_PRTY_ASSERT_SET_1) || |
4649 | (sig[2] & HW_PRTY_ASSERT_SET_2) || | 4676 | (sig[2] & HW_PRTY_ASSERT_SET_2) || |
@@ -4660,23 +4687,22 @@ static bool bnx2x_parity_attn(struct bnx2x *bp, bool *global, bool print, | |||
4660 | if (print) | 4687 | if (print) |
4661 | netdev_err(bp->dev, | 4688 | netdev_err(bp->dev, |
4662 | "Parity errors detected in blocks: "); | 4689 | "Parity errors detected in blocks: "); |
4663 | par_num = bnx2x_check_blocks_with_parity0(bp, | 4690 | res |= bnx2x_check_blocks_with_parity0(bp, |
4664 | sig[0] & HW_PRTY_ASSERT_SET_0, par_num, print); | 4691 | sig[0] & HW_PRTY_ASSERT_SET_0, &par_num, print); |
4665 | par_num = bnx2x_check_blocks_with_parity1(bp, | 4692 | res |= bnx2x_check_blocks_with_parity1(bp, |
4666 | sig[1] & HW_PRTY_ASSERT_SET_1, par_num, global, print); | 4693 | sig[1] & HW_PRTY_ASSERT_SET_1, &par_num, global, print); |
4667 | par_num = bnx2x_check_blocks_with_parity2(bp, | 4694 | res |= bnx2x_check_blocks_with_parity2(bp, |
4668 | sig[2] & HW_PRTY_ASSERT_SET_2, par_num, print); | 4695 | sig[2] & HW_PRTY_ASSERT_SET_2, &par_num, print); |
4669 | par_num = bnx2x_check_blocks_with_parity3( | 4696 | res |= bnx2x_check_blocks_with_parity3(bp, |
4670 | sig[3] & HW_PRTY_ASSERT_SET_3, par_num, global, print); | 4697 | sig[3] & HW_PRTY_ASSERT_SET_3, &par_num, global, print); |
4671 | par_num = bnx2x_check_blocks_with_parity4(bp, | 4698 | res |= bnx2x_check_blocks_with_parity4(bp, |
4672 | sig[4] & HW_PRTY_ASSERT_SET_4, par_num, print); | 4699 | sig[4] & HW_PRTY_ASSERT_SET_4, &par_num, print); |
4673 | 4700 | ||
4674 | if (print) | 4701 | if (print) |
4675 | pr_cont("\n"); | 4702 | pr_cont("\n"); |
4703 | } | ||
4676 | 4704 | ||
4677 | return true; | 4705 | return res; |
4678 | } else | ||
4679 | return false; | ||
4680 | } | 4706 | } |
4681 | 4707 | ||
4682 | /** | 4708 | /** |
@@ -7126,7 +7152,7 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
7126 | int port = BP_PORT(bp); | 7152 | int port = BP_PORT(bp); |
7127 | int init_phase = port ? PHASE_PORT1 : PHASE_PORT0; | 7153 | int init_phase = port ? PHASE_PORT1 : PHASE_PORT0; |
7128 | u32 low, high; | 7154 | u32 low, high; |
7129 | u32 val; | 7155 | u32 val, reg; |
7130 | 7156 | ||
7131 | DP(NETIF_MSG_HW, "starting port init port %d\n", port); | 7157 | DP(NETIF_MSG_HW, "starting port init port %d\n", port); |
7132 | 7158 | ||
@@ -7271,6 +7297,17 @@ static int bnx2x_init_hw_port(struct bnx2x *bp) | |||
7271 | val |= CHIP_IS_E1(bp) ? 0 : 0x10; | 7297 | val |= CHIP_IS_E1(bp) ? 0 : 0x10; |
7272 | REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, val); | 7298 | REG_WR(bp, MISC_REG_AEU_MASK_ATTN_FUNC_0 + port*4, val); |
7273 | 7299 | ||
7300 | /* SCPAD_PARITY should NOT trigger close the gates */ | ||
7301 | reg = port ? MISC_REG_AEU_ENABLE4_NIG_1 : MISC_REG_AEU_ENABLE4_NIG_0; | ||
7302 | REG_WR(bp, reg, | ||
7303 | REG_RD(bp, reg) & | ||
7304 | ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY); | ||
7305 | |||
7306 | reg = port ? MISC_REG_AEU_ENABLE4_PXP_1 : MISC_REG_AEU_ENABLE4_PXP_0; | ||
7307 | REG_WR(bp, reg, | ||
7308 | REG_RD(bp, reg) & | ||
7309 | ~AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY); | ||
7310 | |||
7274 | bnx2x_init_block(bp, BLOCK_NIG, init_phase); | 7311 | bnx2x_init_block(bp, BLOCK_NIG, init_phase); |
7275 | 7312 | ||
7276 | if (!CHIP_IS_E1x(bp)) { | 7313 | if (!CHIP_IS_E1x(bp)) { |
@@ -11685,9 +11722,6 @@ static int bnx2x_init_bp(struct bnx2x *bp) | |||
11685 | static int bnx2x_open(struct net_device *dev) | 11722 | static int bnx2x_open(struct net_device *dev) |
11686 | { | 11723 | { |
11687 | struct bnx2x *bp = netdev_priv(dev); | 11724 | struct bnx2x *bp = netdev_priv(dev); |
11688 | bool global = false; | ||
11689 | int other_engine = BP_PATH(bp) ? 0 : 1; | ||
11690 | bool other_load_status, load_status; | ||
11691 | int rc; | 11725 | int rc; |
11692 | 11726 | ||
11693 | bp->stats_init = true; | 11727 | bp->stats_init = true; |
@@ -11703,6 +11737,10 @@ static int bnx2x_open(struct net_device *dev) | |||
11703 | * Parity recovery is only relevant for PF driver. | 11737 | * Parity recovery is only relevant for PF driver. |
11704 | */ | 11738 | */ |
11705 | if (IS_PF(bp)) { | 11739 | if (IS_PF(bp)) { |
11740 | int other_engine = BP_PATH(bp) ? 0 : 1; | ||
11741 | bool other_load_status, load_status; | ||
11742 | bool global = false; | ||
11743 | |||
11706 | other_load_status = bnx2x_get_load_status(bp, other_engine); | 11744 | other_load_status = bnx2x_get_load_status(bp, other_engine); |
11707 | load_status = bnx2x_get_load_status(bp, BP_PATH(bp)); | 11745 | load_status = bnx2x_get_load_status(bp, BP_PATH(bp)); |
11708 | if (!bnx2x_reset_is_done(bp, BP_PATH(bp)) || | 11746 | if (!bnx2x_reset_is_done(bp, BP_PATH(bp)) || |
@@ -12080,7 +12118,6 @@ static int bnx2x_set_coherency_mask(struct bnx2x *bp) | |||
12080 | struct device *dev = &bp->pdev->dev; | 12118 | struct device *dev = &bp->pdev->dev; |
12081 | 12119 | ||
12082 | if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) { | 12120 | if (dma_set_mask(dev, DMA_BIT_MASK(64)) == 0) { |
12083 | bp->flags |= USING_DAC_FLAG; | ||
12084 | if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) { | 12121 | if (dma_set_coherent_mask(dev, DMA_BIT_MASK(64)) != 0) { |
12085 | dev_err(dev, "dma_set_coherent_mask failed, aborting\n"); | 12122 | dev_err(dev, "dma_set_coherent_mask failed, aborting\n"); |
12086 | return -EIO; | 12123 | return -EIO; |
@@ -12248,8 +12285,7 @@ static int bnx2x_init_dev(struct bnx2x *bp, struct pci_dev *pdev, | |||
12248 | NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA; | 12285 | NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6 | NETIF_F_HIGHDMA; |
12249 | 12286 | ||
12250 | dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX; | 12287 | dev->features |= dev->hw_features | NETIF_F_HW_VLAN_CTAG_RX; |
12251 | if (bp->flags & USING_DAC_FLAG) | 12288 | dev->features |= NETIF_F_HIGHDMA; |
12252 | dev->features |= NETIF_F_HIGHDMA; | ||
12253 | 12289 | ||
12254 | /* Add Loopback capability to the device */ | 12290 | /* Add Loopback capability to the device */ |
12255 | dev->hw_features |= NETIF_F_LOOPBACK; | 12291 | dev->hw_features |= NETIF_F_LOOPBACK; |
@@ -12612,24 +12648,24 @@ static int set_max_cos_est(int chip_id) | |||
12612 | return BNX2X_MULTI_TX_COS_E1X; | 12648 | return BNX2X_MULTI_TX_COS_E1X; |
12613 | case BCM57712: | 12649 | case BCM57712: |
12614 | case BCM57712_MF: | 12650 | case BCM57712_MF: |
12615 | case BCM57712_VF: | ||
12616 | return BNX2X_MULTI_TX_COS_E2_E3A0; | 12651 | return BNX2X_MULTI_TX_COS_E2_E3A0; |
12617 | case BCM57800: | 12652 | case BCM57800: |
12618 | case BCM57800_MF: | 12653 | case BCM57800_MF: |
12619 | case BCM57800_VF: | ||
12620 | case BCM57810: | 12654 | case BCM57810: |
12621 | case BCM57810_MF: | 12655 | case BCM57810_MF: |
12622 | case BCM57840_4_10: | 12656 | case BCM57840_4_10: |
12623 | case BCM57840_2_20: | 12657 | case BCM57840_2_20: |
12624 | case BCM57840_O: | 12658 | case BCM57840_O: |
12625 | case BCM57840_MFO: | 12659 | case BCM57840_MFO: |
12626 | case BCM57810_VF: | ||
12627 | case BCM57840_MF: | 12660 | case BCM57840_MF: |
12628 | case BCM57840_VF: | ||
12629 | case BCM57811: | 12661 | case BCM57811: |
12630 | case BCM57811_MF: | 12662 | case BCM57811_MF: |
12631 | case BCM57811_VF: | ||
12632 | return BNX2X_MULTI_TX_COS_E3B0; | 12663 | return BNX2X_MULTI_TX_COS_E3B0; |
12664 | case BCM57712_VF: | ||
12665 | case BCM57800_VF: | ||
12666 | case BCM57810_VF: | ||
12667 | case BCM57840_VF: | ||
12668 | case BCM57811_VF: | ||
12633 | return 1; | 12669 | return 1; |
12634 | default: | 12670 | default: |
12635 | pr_err("Unknown board_type (%d), aborting\n", chip_id); | 12671 | pr_err("Unknown board_type (%d), aborting\n", chip_id); |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c index 9ad012bdd915..bf08ad68b405 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | |||
@@ -470,10 +470,10 @@ static int bnx2x_vfop_qdtor_cmd(struct bnx2x *bp, | |||
470 | bnx2x_vfop_qdtor, cmd->done); | 470 | bnx2x_vfop_qdtor, cmd->done); |
471 | return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_qdtor, | 471 | return bnx2x_vfop_transition(bp, vf, bnx2x_vfop_qdtor, |
472 | cmd->block); | 472 | cmd->block); |
473 | } else { | ||
474 | BNX2X_ERR("VF[%d] failed to add a vfop\n", vf->abs_vfid); | ||
475 | return -ENOMEM; | ||
473 | } | 476 | } |
474 | DP(BNX2X_MSG_IOV, "VF[%d] failed to add a vfop. rc %d\n", | ||
475 | vf->abs_vfid, vfop->rc); | ||
476 | return -ENOMEM; | ||
477 | } | 477 | } |
478 | 478 | ||
479 | static void | 479 | static void |
@@ -3390,14 +3390,16 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) | |||
3390 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); | 3390 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_ETH_MAC, true); |
3391 | if (rc) { | 3391 | if (rc) { |
3392 | BNX2X_ERR("failed to delete eth macs\n"); | 3392 | BNX2X_ERR("failed to delete eth macs\n"); |
3393 | return -EINVAL; | 3393 | rc = -EINVAL; |
3394 | goto out; | ||
3394 | } | 3395 | } |
3395 | 3396 | ||
3396 | /* remove existing uc list macs */ | 3397 | /* remove existing uc list macs */ |
3397 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); | 3398 | rc = bnx2x_del_all_macs(bp, mac_obj, BNX2X_UC_LIST_MAC, true); |
3398 | if (rc) { | 3399 | if (rc) { |
3399 | BNX2X_ERR("failed to delete uc_list macs\n"); | 3400 | BNX2X_ERR("failed to delete uc_list macs\n"); |
3400 | return -EINVAL; | 3401 | rc = -EINVAL; |
3402 | goto out; | ||
3401 | } | 3403 | } |
3402 | 3404 | ||
3403 | /* configure the new mac to device */ | 3405 | /* configure the new mac to device */ |
@@ -3405,6 +3407,7 @@ int bnx2x_set_vf_mac(struct net_device *dev, int vfidx, u8 *mac) | |||
3405 | bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, | 3407 | bnx2x_set_mac_one(bp, (u8 *)&bulletin->mac, mac_obj, true, |
3406 | BNX2X_ETH_MAC, &ramrod_flags); | 3408 | BNX2X_ETH_MAC, &ramrod_flags); |
3407 | 3409 | ||
3410 | out: | ||
3408 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); | 3411 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_MAC); |
3409 | } | 3412 | } |
3410 | 3413 | ||
@@ -3467,7 +3470,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3467 | &ramrod_flags); | 3470 | &ramrod_flags); |
3468 | if (rc) { | 3471 | if (rc) { |
3469 | BNX2X_ERR("failed to delete vlans\n"); | 3472 | BNX2X_ERR("failed to delete vlans\n"); |
3470 | return -EINVAL; | 3473 | rc = -EINVAL; |
3474 | goto out; | ||
3471 | } | 3475 | } |
3472 | 3476 | ||
3473 | /* send queue update ramrod to configure default vlan and silent | 3477 | /* send queue update ramrod to configure default vlan and silent |
@@ -3501,7 +3505,8 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3501 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); | 3505 | rc = bnx2x_config_vlan_mac(bp, &ramrod_param); |
3502 | if (rc) { | 3506 | if (rc) { |
3503 | BNX2X_ERR("failed to configure vlan\n"); | 3507 | BNX2X_ERR("failed to configure vlan\n"); |
3504 | return -EINVAL; | 3508 | rc = -EINVAL; |
3509 | goto out; | ||
3505 | } | 3510 | } |
3506 | 3511 | ||
3507 | /* configure default vlan to vf queue and set silent | 3512 | /* configure default vlan to vf queue and set silent |
@@ -3519,18 +3524,18 @@ int bnx2x_set_vf_vlan(struct net_device *dev, int vfidx, u16 vlan, u8 qos) | |||
3519 | rc = bnx2x_queue_state_change(bp, &q_params); | 3524 | rc = bnx2x_queue_state_change(bp, &q_params); |
3520 | if (rc) { | 3525 | if (rc) { |
3521 | BNX2X_ERR("Failed to configure default VLAN\n"); | 3526 | BNX2X_ERR("Failed to configure default VLAN\n"); |
3522 | return rc; | 3527 | goto out; |
3523 | } | 3528 | } |
3524 | 3529 | ||
3525 | /* clear the flag indicating that this VF needs its vlan | 3530 | /* clear the flag indicating that this VF needs its vlan |
3526 | * (will only be set if the HV configured th Vlan before vf was | 3531 | * (will only be set if the HV configured the Vlan before vf was |
3527 | * and we were called because the VF came up later | 3532 | * up and we were called because the VF came up later |
3528 | */ | 3533 | */ |
3534 | out: | ||
3529 | vf->cfg_flags &= ~VF_CFG_VLAN; | 3535 | vf->cfg_flags &= ~VF_CFG_VLAN; |
3530 | |||
3531 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); | 3536 | bnx2x_unlock_vf_pf_channel(bp, vf, CHANNEL_TLV_PF_SET_VLAN); |
3532 | } | 3537 | } |
3533 | return 0; | 3538 | return rc; |
3534 | } | 3539 | } |
3535 | 3540 | ||
3536 | /* crc is the first field in the bulletin board. Compute the crc over the | 3541 | /* crc is the first field in the bulletin board. Compute the crc over the |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c index 86436c77af03..3b75070411aa 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c | |||
@@ -196,7 +196,7 @@ static void bnx2x_hw_stats_post(struct bnx2x *bp) | |||
196 | 196 | ||
197 | } else if (bp->func_stx) { | 197 | } else if (bp->func_stx) { |
198 | *stats_comp = 0; | 198 | *stats_comp = 0; |
199 | bnx2x_post_dmae(bp, dmae, INIT_DMAE_C(bp)); | 199 | bnx2x_issue_dmae_with_comp(bp, dmae, stats_comp); |
200 | } | 200 | } |
201 | } | 201 | } |
202 | 202 | ||
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c index da16953eb2ec..28757dfacf0d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c | |||
@@ -980,7 +980,7 @@ static int bnx2x_copy32_vf_dmae(struct bnx2x *bp, u8 from_vf, | |||
980 | dmae.len = len32; | 980 | dmae.len = len32; |
981 | 981 | ||
982 | /* issue the command and wait for completion */ | 982 | /* issue the command and wait for completion */ |
983 | return bnx2x_issue_dmae_with_comp(bp, &dmae); | 983 | return bnx2x_issue_dmae_with_comp(bp, &dmae, bnx2x_sp(bp, wb_comp)); |
984 | } | 984 | } |
985 | 985 | ||
986 | static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf) | 986 | static void bnx2x_vf_mbx_resp(struct bnx2x *bp, struct bnx2x_virtf *vf) |
diff --git a/drivers/net/ethernet/calxeda/xgmac.c b/drivers/net/ethernet/calxeda/xgmac.c index 78d6d6b970e1..48f52882a22b 100644 --- a/drivers/net/ethernet/calxeda/xgmac.c +++ b/drivers/net/ethernet/calxeda/xgmac.c | |||
@@ -106,7 +106,6 @@ | |||
106 | #define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */ | 106 | #define XGMAC_DMA_HW_FEATURE 0x00000f58 /* Enabled Hardware Features */ |
107 | 107 | ||
108 | #define XGMAC_ADDR_AE 0x80000000 | 108 | #define XGMAC_ADDR_AE 0x80000000 |
109 | #define XGMAC_MAX_FILTER_ADDR 31 | ||
110 | 109 | ||
111 | /* PMT Control and Status */ | 110 | /* PMT Control and Status */ |
112 | #define XGMAC_PMT_POINTER_RESET 0x80000000 | 111 | #define XGMAC_PMT_POINTER_RESET 0x80000000 |
@@ -384,6 +383,7 @@ struct xgmac_priv { | |||
384 | struct device *device; | 383 | struct device *device; |
385 | struct napi_struct napi; | 384 | struct napi_struct napi; |
386 | 385 | ||
386 | int max_macs; | ||
387 | struct xgmac_extra_stats xstats; | 387 | struct xgmac_extra_stats xstats; |
388 | 388 | ||
389 | spinlock_t stats_lock; | 389 | spinlock_t stats_lock; |
@@ -1291,14 +1291,12 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1291 | netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n", | 1291 | netdev_dbg(priv->dev, "# mcasts %d, # unicast %d\n", |
1292 | netdev_mc_count(dev), netdev_uc_count(dev)); | 1292 | netdev_mc_count(dev), netdev_uc_count(dev)); |
1293 | 1293 | ||
1294 | if (dev->flags & IFF_PROMISC) { | 1294 | if (dev->flags & IFF_PROMISC) |
1295 | writel(XGMAC_FRAME_FILTER_PR, ioaddr + XGMAC_FRAME_FILTER); | 1295 | value |= XGMAC_FRAME_FILTER_PR; |
1296 | return; | ||
1297 | } | ||
1298 | 1296 | ||
1299 | memset(hash_filter, 0, sizeof(hash_filter)); | 1297 | memset(hash_filter, 0, sizeof(hash_filter)); |
1300 | 1298 | ||
1301 | if (netdev_uc_count(dev) > XGMAC_MAX_FILTER_ADDR) { | 1299 | if (netdev_uc_count(dev) > priv->max_macs) { |
1302 | use_hash = true; | 1300 | use_hash = true; |
1303 | value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF; | 1301 | value |= XGMAC_FRAME_FILTER_HUC | XGMAC_FRAME_FILTER_HPF; |
1304 | } | 1302 | } |
@@ -1321,7 +1319,7 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1321 | goto out; | 1319 | goto out; |
1322 | } | 1320 | } |
1323 | 1321 | ||
1324 | if ((netdev_mc_count(dev) + reg - 1) > XGMAC_MAX_FILTER_ADDR) { | 1322 | if ((netdev_mc_count(dev) + reg - 1) > priv->max_macs) { |
1325 | use_hash = true; | 1323 | use_hash = true; |
1326 | value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF; | 1324 | value |= XGMAC_FRAME_FILTER_HMC | XGMAC_FRAME_FILTER_HPF; |
1327 | } else { | 1325 | } else { |
@@ -1342,8 +1340,8 @@ static void xgmac_set_rx_mode(struct net_device *dev) | |||
1342 | } | 1340 | } |
1343 | 1341 | ||
1344 | out: | 1342 | out: |
1345 | for (i = reg; i < XGMAC_MAX_FILTER_ADDR; i++) | 1343 | for (i = reg; i <= priv->max_macs; i++) |
1346 | xgmac_set_mac_addr(ioaddr, NULL, reg); | 1344 | xgmac_set_mac_addr(ioaddr, NULL, i); |
1347 | for (i = 0; i < XGMAC_NUM_HASH; i++) | 1345 | for (i = 0; i < XGMAC_NUM_HASH; i++) |
1348 | writel(hash_filter[i], ioaddr + XGMAC_HASH(i)); | 1346 | writel(hash_filter[i], ioaddr + XGMAC_HASH(i)); |
1349 | 1347 | ||
@@ -1761,6 +1759,13 @@ static int xgmac_probe(struct platform_device *pdev) | |||
1761 | uid = readl(priv->base + XGMAC_VERSION); | 1759 | uid = readl(priv->base + XGMAC_VERSION); |
1762 | netdev_info(ndev, "h/w version is 0x%x\n", uid); | 1760 | netdev_info(ndev, "h/w version is 0x%x\n", uid); |
1763 | 1761 | ||
1762 | /* Figure out how many valid mac address filter registers we have */ | ||
1763 | writel(1, priv->base + XGMAC_ADDR_HIGH(31)); | ||
1764 | if (readl(priv->base + XGMAC_ADDR_HIGH(31)) == 1) | ||
1765 | priv->max_macs = 31; | ||
1766 | else | ||
1767 | priv->max_macs = 7; | ||
1768 | |||
1764 | writel(0, priv->base + XGMAC_DMA_INTR_ENA); | 1769 | writel(0, priv->base + XGMAC_DMA_INTR_ENA); |
1765 | ndev->irq = platform_get_irq(pdev, 0); | 1770 | ndev->irq = platform_get_irq(pdev, 0); |
1766 | if (ndev->irq == -ENXIO) { | 1771 | if (ndev->irq == -ENXIO) { |
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 5f5896e522d2..a7a941b1a655 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c | |||
@@ -158,18 +158,6 @@ static inline board_info_t *to_dm9000_board(struct net_device *dev) | |||
158 | 158 | ||
159 | /* DM9000 network board routine ---------------------------- */ | 159 | /* DM9000 network board routine ---------------------------- */ |
160 | 160 | ||
161 | static void | ||
162 | dm9000_reset(board_info_t * db) | ||
163 | { | ||
164 | dev_dbg(db->dev, "resetting device\n"); | ||
165 | |||
166 | /* RESET device */ | ||
167 | writeb(DM9000_NCR, db->io_addr); | ||
168 | udelay(200); | ||
169 | writeb(NCR_RST, db->io_data); | ||
170 | udelay(200); | ||
171 | } | ||
172 | |||
173 | /* | 161 | /* |
174 | * Read a byte from I/O port | 162 | * Read a byte from I/O port |
175 | */ | 163 | */ |
@@ -191,6 +179,27 @@ iow(board_info_t * db, int reg, int value) | |||
191 | writeb(value, db->io_data); | 179 | writeb(value, db->io_data); |
192 | } | 180 | } |
193 | 181 | ||
182 | static void | ||
183 | dm9000_reset(board_info_t *db) | ||
184 | { | ||
185 | dev_dbg(db->dev, "resetting device\n"); | ||
186 | |||
187 | /* Reset DM9000, see DM9000 Application Notes V1.22 Jun 11, 2004 page 29 | ||
188 | * The essential point is that we have to do a double reset, and the | ||
189 | * instruction is to set LBK into MAC internal loopback mode. | ||
190 | */ | ||
191 | iow(db, DM9000_NCR, 0x03); | ||
192 | udelay(100); /* Application note says at least 20 us */ | ||
193 | if (ior(db, DM9000_NCR) & 1) | ||
194 | dev_err(db->dev, "dm9000 did not respond to first reset\n"); | ||
195 | |||
196 | iow(db, DM9000_NCR, 0); | ||
197 | iow(db, DM9000_NCR, 0x03); | ||
198 | udelay(100); | ||
199 | if (ior(db, DM9000_NCR) & 1) | ||
200 | dev_err(db->dev, "dm9000 did not respond to second reset\n"); | ||
201 | } | ||
202 | |||
194 | /* routines for sending block to chip */ | 203 | /* routines for sending block to chip */ |
195 | 204 | ||
196 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) | 205 | static void dm9000_outblk_8bit(void __iomem *reg, void *data, int count) |
@@ -744,15 +753,20 @@ static const struct ethtool_ops dm9000_ethtool_ops = { | |||
744 | static void dm9000_show_carrier(board_info_t *db, | 753 | static void dm9000_show_carrier(board_info_t *db, |
745 | unsigned carrier, unsigned nsr) | 754 | unsigned carrier, unsigned nsr) |
746 | { | 755 | { |
756 | int lpa; | ||
747 | struct net_device *ndev = db->ndev; | 757 | struct net_device *ndev = db->ndev; |
758 | struct mii_if_info *mii = &db->mii; | ||
748 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); | 759 | unsigned ncr = dm9000_read_locked(db, DM9000_NCR); |
749 | 760 | ||
750 | if (carrier) | 761 | if (carrier) { |
751 | dev_info(db->dev, "%s: link up, %dMbps, %s-duplex, no LPA\n", | 762 | lpa = mii->mdio_read(mii->dev, mii->phy_id, MII_LPA); |
763 | dev_info(db->dev, | ||
764 | "%s: link up, %dMbps, %s-duplex, lpa 0x%04X\n", | ||
752 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, | 765 | ndev->name, (nsr & NSR_SPEED) ? 10 : 100, |
753 | (ncr & NCR_FDX) ? "full" : "half"); | 766 | (ncr & NCR_FDX) ? "full" : "half", lpa); |
754 | else | 767 | } else { |
755 | dev_info(db->dev, "%s: link down\n", ndev->name); | 768 | dev_info(db->dev, "%s: link down\n", ndev->name); |
769 | } | ||
756 | } | 770 | } |
757 | 771 | ||
758 | static void | 772 | static void |
@@ -890,9 +904,15 @@ dm9000_init_dm9000(struct net_device *dev) | |||
890 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); | 904 | (dev->features & NETIF_F_RXCSUM) ? RCSR_CSUM : 0); |
891 | 905 | ||
892 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ | 906 | iow(db, DM9000_GPCR, GPCR_GEP_CNTL); /* Let GPIO0 output */ |
907 | iow(db, DM9000_GPR, 0); | ||
893 | 908 | ||
894 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); /* PHY RESET */ | 909 | /* If we are dealing with DM9000B, some extra steps are required: a |
895 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); /* Init */ | 910 | * manual phy reset, and setting init params. |
911 | */ | ||
912 | if (db->type == TYPE_DM9000B) { | ||
913 | dm9000_phy_write(dev, 0, MII_BMCR, BMCR_RESET); | ||
914 | dm9000_phy_write(dev, 0, MII_DM_DSPCR, DSPCR_INIT_PARAM); | ||
915 | } | ||
896 | 916 | ||
897 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; | 917 | ncr = (db->flags & DM9000_PLATF_EXT_PHY) ? NCR_EXT_PHY : 0; |
898 | 918 | ||
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index bd0e0c0bbcd8..c08fd32bb8e5 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c | |||
@@ -1198,7 +1198,6 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) | |||
1198 | 1198 | ||
1199 | if (lancer_chip(adapter)) { | 1199 | if (lancer_chip(adapter)) { |
1200 | req->hdr.version = 1; | 1200 | req->hdr.version = 1; |
1201 | req->if_id = cpu_to_le16(adapter->if_handle); | ||
1202 | } else if (BEx_chip(adapter)) { | 1201 | } else if (BEx_chip(adapter)) { |
1203 | if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) | 1202 | if (adapter->function_caps & BE_FUNCTION_CAPS_SUPER_NIC) |
1204 | req->hdr.version = 2; | 1203 | req->hdr.version = 2; |
@@ -1206,6 +1205,8 @@ int be_cmd_txq_create(struct be_adapter *adapter, struct be_tx_obj *txo) | |||
1206 | req->hdr.version = 2; | 1205 | req->hdr.version = 2; |
1207 | } | 1206 | } |
1208 | 1207 | ||
1208 | if (req->hdr.version > 0) | ||
1209 | req->if_id = cpu_to_le16(adapter->if_handle); | ||
1209 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); | 1210 | req->num_pages = PAGES_4K_SPANNED(q_mem->va, q_mem->size); |
1210 | req->ulp_num = BE_ULP1_NUM; | 1211 | req->ulp_num = BE_ULP1_NUM; |
1211 | req->type = BE_ETH_TX_RING_TYPE_STANDARD; | 1212 | req->type = BE_ETH_TX_RING_TYPE_STANDARD; |
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c index c4eaadeb572f..9fbe4dda7a0e 100644 --- a/drivers/net/ethernet/freescale/gianfar.c +++ b/drivers/net/ethernet/freescale/gianfar.c | |||
@@ -88,6 +88,7 @@ | |||
88 | 88 | ||
89 | #include <asm/io.h> | 89 | #include <asm/io.h> |
90 | #include <asm/reg.h> | 90 | #include <asm/reg.h> |
91 | #include <asm/mpc85xx.h> | ||
91 | #include <asm/irq.h> | 92 | #include <asm/irq.h> |
92 | #include <asm/uaccess.h> | 93 | #include <asm/uaccess.h> |
93 | #include <linux/module.h> | 94 | #include <linux/module.h> |
@@ -939,9 +940,8 @@ static void gfar_init_filer_table(struct gfar_private *priv) | |||
939 | } | 940 | } |
940 | } | 941 | } |
941 | 942 | ||
942 | static void gfar_detect_errata(struct gfar_private *priv) | 943 | static void __gfar_detect_errata_83xx(struct gfar_private *priv) |
943 | { | 944 | { |
944 | struct device *dev = &priv->ofdev->dev; | ||
945 | unsigned int pvr = mfspr(SPRN_PVR); | 945 | unsigned int pvr = mfspr(SPRN_PVR); |
946 | unsigned int svr = mfspr(SPRN_SVR); | 946 | unsigned int svr = mfspr(SPRN_SVR); |
947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ | 947 | unsigned int mod = (svr >> 16) & 0xfff6; /* w/o E suffix */ |
@@ -957,15 +957,33 @@ static void gfar_detect_errata(struct gfar_private *priv) | |||
957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 957 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) |
958 | priv->errata |= GFAR_ERRATA_76; | 958 | priv->errata |= GFAR_ERRATA_76; |
959 | 959 | ||
960 | /* MPC8313 and MPC837x all rev */ | 960 | /* MPC8313 Rev < 2.0 */ |
961 | if ((pvr == 0x80850010 && mod == 0x80b0) || | 961 | if (pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) |
962 | (pvr == 0x80861010 && (mod & 0xfff9) == 0x80c0)) | 962 | priv->errata |= GFAR_ERRATA_12; |
963 | priv->errata |= GFAR_ERRATA_A002; | 963 | } |
964 | 964 | ||
965 | /* MPC8313 Rev < 2.0, MPC8548 rev 2.0 */ | 965 | static void __gfar_detect_errata_85xx(struct gfar_private *priv) |
966 | if ((pvr == 0x80850010 && mod == 0x80b0 && rev < 0x0020) || | 966 | { |
967 | (pvr == 0x80210020 && mod == 0x8030 && rev == 0x0020)) | 967 | unsigned int svr = mfspr(SPRN_SVR); |
968 | |||
969 | if ((SVR_SOC_VER(svr) == SVR_8548) && (SVR_REV(svr) == 0x20)) | ||
968 | priv->errata |= GFAR_ERRATA_12; | 970 | priv->errata |= GFAR_ERRATA_12; |
971 | if (((SVR_SOC_VER(svr) == SVR_P2020) && (SVR_REV(svr) < 0x20)) || | ||
972 | ((SVR_SOC_VER(svr) == SVR_P2010) && (SVR_REV(svr) < 0x20))) | ||
973 | priv->errata |= GFAR_ERRATA_76; /* aka eTSEC 20 */ | ||
974 | } | ||
975 | |||
976 | static void gfar_detect_errata(struct gfar_private *priv) | ||
977 | { | ||
978 | struct device *dev = &priv->ofdev->dev; | ||
979 | |||
980 | /* no plans to fix */ | ||
981 | priv->errata |= GFAR_ERRATA_A002; | ||
982 | |||
983 | if (pvr_version_is(PVR_VER_E500V1) || pvr_version_is(PVR_VER_E500V2)) | ||
984 | __gfar_detect_errata_85xx(priv); | ||
985 | else /* non-mpc85xx parts, i.e. e300 core based */ | ||
986 | __gfar_detect_errata_83xx(priv); | ||
969 | 987 | ||
970 | if (priv->errata) | 988 | if (priv->errata) |
971 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", | 989 | dev_info(dev, "enabled errata workarounds, flags: 0x%x\n", |
@@ -1599,7 +1617,7 @@ static int __gfar_is_rx_idle(struct gfar_private *priv) | |||
1599 | /* Normaly TSEC should not hang on GRS commands, so we should | 1617 | /* Normaly TSEC should not hang on GRS commands, so we should |
1600 | * actually wait for IEVENT_GRSC flag. | 1618 | * actually wait for IEVENT_GRSC flag. |
1601 | */ | 1619 | */ |
1602 | if (likely(!gfar_has_errata(priv, GFAR_ERRATA_A002))) | 1620 | if (!gfar_has_errata(priv, GFAR_ERRATA_A002)) |
1603 | return 0; | 1621 | return 0; |
1604 | 1622 | ||
1605 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are | 1623 | /* Read the eTSEC register at offset 0xD1C. If bits 7-14 are |
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index 86d51429a189..151e00cad113 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c | |||
@@ -2655,6 +2655,8 @@ static int igb_set_eee(struct net_device *netdev, | |||
2655 | (hw->phy.media_type != e1000_media_type_copper)) | 2655 | (hw->phy.media_type != e1000_media_type_copper)) |
2656 | return -EOPNOTSUPP; | 2656 | return -EOPNOTSUPP; |
2657 | 2657 | ||
2658 | memset(&eee_curr, 0, sizeof(struct ethtool_eee)); | ||
2659 | |||
2658 | ret_val = igb_get_eee(netdev, &eee_curr); | 2660 | ret_val = igb_get_eee(netdev, &eee_curr); |
2659 | if (ret_val) | 2661 | if (ret_val) |
2660 | return ret_val; | 2662 | return ret_val; |
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c index 7fb5677451f9..2c210ec35d59 100644 --- a/drivers/net/ethernet/marvell/mv643xx_eth.c +++ b/drivers/net/ethernet/marvell/mv643xx_eth.c | |||
@@ -1131,15 +1131,13 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1131 | p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); | 1131 | p->rx_discard += rdlp(mp, RX_DISCARD_FRAME_CNT); |
1132 | p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); | 1132 | p->rx_overrun += rdlp(mp, RX_OVERRUN_FRAME_CNT); |
1133 | spin_unlock_bh(&mp->mib_counters_lock); | 1133 | spin_unlock_bh(&mp->mib_counters_lock); |
1134 | |||
1135 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | ||
1136 | } | 1134 | } |
1137 | 1135 | ||
1138 | static void mib_counters_timer_wrapper(unsigned long _mp) | 1136 | static void mib_counters_timer_wrapper(unsigned long _mp) |
1139 | { | 1137 | { |
1140 | struct mv643xx_eth_private *mp = (void *)_mp; | 1138 | struct mv643xx_eth_private *mp = (void *)_mp; |
1141 | |||
1142 | mib_counters_update(mp); | 1139 | mib_counters_update(mp); |
1140 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | ||
1143 | } | 1141 | } |
1144 | 1142 | ||
1145 | 1143 | ||
@@ -2237,6 +2235,7 @@ static int mv643xx_eth_open(struct net_device *dev) | |||
2237 | mp->int_mask |= INT_TX_END_0 << i; | 2235 | mp->int_mask |= INT_TX_END_0 << i; |
2238 | } | 2236 | } |
2239 | 2237 | ||
2238 | add_timer(&mp->mib_counters_timer); | ||
2240 | port_start(mp); | 2239 | port_start(mp); |
2241 | 2240 | ||
2242 | wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX); | 2241 | wrlp(mp, INT_MASK_EXT, INT_EXT_LINK_PHY | INT_EXT_TX); |
@@ -2534,6 +2533,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev, | |||
2534 | if (!ppdev) | 2533 | if (!ppdev) |
2535 | return -ENOMEM; | 2534 | return -ENOMEM; |
2536 | ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); | 2535 | ppdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); |
2536 | ppdev->dev.of_node = pnp; | ||
2537 | 2537 | ||
2538 | ret = platform_device_add_resources(ppdev, &res, 1); | 2538 | ret = platform_device_add_resources(ppdev, &res, 1); |
2539 | if (ret) | 2539 | if (ret) |
@@ -2916,7 +2916,6 @@ static int mv643xx_eth_probe(struct platform_device *pdev) | |||
2916 | mp->mib_counters_timer.data = (unsigned long)mp; | 2916 | mp->mib_counters_timer.data = (unsigned long)mp; |
2917 | mp->mib_counters_timer.function = mib_counters_timer_wrapper; | 2917 | mp->mib_counters_timer.function = mib_counters_timer_wrapper; |
2918 | mp->mib_counters_timer.expires = jiffies + 30 * HZ; | 2918 | mp->mib_counters_timer.expires = jiffies + 30 * HZ; |
2919 | add_timer(&mp->mib_counters_timer); | ||
2920 | 2919 | ||
2921 | spin_lock_init(&mp->mib_counters_lock); | 2920 | spin_lock_init(&mp->mib_counters_lock); |
2922 | 2921 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index dec455c8f627..afe2efa69c86 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -70,14 +70,15 @@ static int mlx4_alloc_pages(struct mlx4_en_priv *priv, | |||
70 | put_page(page); | 70 | put_page(page); |
71 | return -ENOMEM; | 71 | return -ENOMEM; |
72 | } | 72 | } |
73 | page_alloc->size = PAGE_SIZE << order; | 73 | page_alloc->page_size = PAGE_SIZE << order; |
74 | page_alloc->page = page; | 74 | page_alloc->page = page; |
75 | page_alloc->dma = dma; | 75 | page_alloc->dma = dma; |
76 | page_alloc->offset = frag_info->frag_align; | 76 | page_alloc->page_offset = frag_info->frag_align; |
77 | /* Not doing get_page() for each frag is a big win | 77 | /* Not doing get_page() for each frag is a big win |
78 | * on asymetric workloads. | 78 | * on asymetric workloads. |
79 | */ | 79 | */ |
80 | atomic_set(&page->_count, page_alloc->size / frag_info->frag_stride); | 80 | atomic_set(&page->_count, |
81 | page_alloc->page_size / frag_info->frag_stride); | ||
81 | return 0; | 82 | return 0; |
82 | } | 83 | } |
83 | 84 | ||
@@ -96,16 +97,19 @@ static int mlx4_en_alloc_frags(struct mlx4_en_priv *priv, | |||
96 | for (i = 0; i < priv->num_frags; i++) { | 97 | for (i = 0; i < priv->num_frags; i++) { |
97 | frag_info = &priv->frag_info[i]; | 98 | frag_info = &priv->frag_info[i]; |
98 | page_alloc[i] = ring_alloc[i]; | 99 | page_alloc[i] = ring_alloc[i]; |
99 | page_alloc[i].offset += frag_info->frag_stride; | 100 | page_alloc[i].page_offset += frag_info->frag_stride; |
100 | if (page_alloc[i].offset + frag_info->frag_stride <= ring_alloc[i].size) | 101 | |
102 | if (page_alloc[i].page_offset + frag_info->frag_stride <= | ||
103 | ring_alloc[i].page_size) | ||
101 | continue; | 104 | continue; |
105 | |||
102 | if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp)) | 106 | if (mlx4_alloc_pages(priv, &page_alloc[i], frag_info, gfp)) |
103 | goto out; | 107 | goto out; |
104 | } | 108 | } |
105 | 109 | ||
106 | for (i = 0; i < priv->num_frags; i++) { | 110 | for (i = 0; i < priv->num_frags; i++) { |
107 | frags[i] = ring_alloc[i]; | 111 | frags[i] = ring_alloc[i]; |
108 | dma = ring_alloc[i].dma + ring_alloc[i].offset; | 112 | dma = ring_alloc[i].dma + ring_alloc[i].page_offset; |
109 | ring_alloc[i] = page_alloc[i]; | 113 | ring_alloc[i] = page_alloc[i]; |
110 | rx_desc->data[i].addr = cpu_to_be64(dma); | 114 | rx_desc->data[i].addr = cpu_to_be64(dma); |
111 | } | 115 | } |
@@ -117,7 +121,7 @@ out: | |||
117 | frag_info = &priv->frag_info[i]; | 121 | frag_info = &priv->frag_info[i]; |
118 | if (page_alloc[i].page != ring_alloc[i].page) { | 122 | if (page_alloc[i].page != ring_alloc[i].page) { |
119 | dma_unmap_page(priv->ddev, page_alloc[i].dma, | 123 | dma_unmap_page(priv->ddev, page_alloc[i].dma, |
120 | page_alloc[i].size, PCI_DMA_FROMDEVICE); | 124 | page_alloc[i].page_size, PCI_DMA_FROMDEVICE); |
121 | page = page_alloc[i].page; | 125 | page = page_alloc[i].page; |
122 | atomic_set(&page->_count, 1); | 126 | atomic_set(&page->_count, 1); |
123 | put_page(page); | 127 | put_page(page); |
@@ -131,10 +135,12 @@ static void mlx4_en_free_frag(struct mlx4_en_priv *priv, | |||
131 | int i) | 135 | int i) |
132 | { | 136 | { |
133 | const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; | 137 | const struct mlx4_en_frag_info *frag_info = &priv->frag_info[i]; |
138 | u32 next_frag_end = frags[i].page_offset + 2 * frag_info->frag_stride; | ||
139 | |||
134 | 140 | ||
135 | if (frags[i].offset + frag_info->frag_stride > frags[i].size) | 141 | if (next_frag_end > frags[i].page_size) |
136 | dma_unmap_page(priv->ddev, frags[i].dma, frags[i].size, | 142 | dma_unmap_page(priv->ddev, frags[i].dma, frags[i].page_size, |
137 | PCI_DMA_FROMDEVICE); | 143 | PCI_DMA_FROMDEVICE); |
138 | 144 | ||
139 | if (frags[i].page) | 145 | if (frags[i].page) |
140 | put_page(frags[i].page); | 146 | put_page(frags[i].page); |
@@ -161,7 +167,7 @@ out: | |||
161 | 167 | ||
162 | page_alloc = &ring->page_alloc[i]; | 168 | page_alloc = &ring->page_alloc[i]; |
163 | dma_unmap_page(priv->ddev, page_alloc->dma, | 169 | dma_unmap_page(priv->ddev, page_alloc->dma, |
164 | page_alloc->size, PCI_DMA_FROMDEVICE); | 170 | page_alloc->page_size, PCI_DMA_FROMDEVICE); |
165 | page = page_alloc->page; | 171 | page = page_alloc->page; |
166 | atomic_set(&page->_count, 1); | 172 | atomic_set(&page->_count, 1); |
167 | put_page(page); | 173 | put_page(page); |
@@ -184,10 +190,11 @@ static void mlx4_en_destroy_allocator(struct mlx4_en_priv *priv, | |||
184 | i, page_count(page_alloc->page)); | 190 | i, page_count(page_alloc->page)); |
185 | 191 | ||
186 | dma_unmap_page(priv->ddev, page_alloc->dma, | 192 | dma_unmap_page(priv->ddev, page_alloc->dma, |
187 | page_alloc->size, PCI_DMA_FROMDEVICE); | 193 | page_alloc->page_size, PCI_DMA_FROMDEVICE); |
188 | while (page_alloc->offset + frag_info->frag_stride < page_alloc->size) { | 194 | while (page_alloc->page_offset + frag_info->frag_stride < |
195 | page_alloc->page_size) { | ||
189 | put_page(page_alloc->page); | 196 | put_page(page_alloc->page); |
190 | page_alloc->offset += frag_info->frag_stride; | 197 | page_alloc->page_offset += frag_info->frag_stride; |
191 | } | 198 | } |
192 | page_alloc->page = NULL; | 199 | page_alloc->page = NULL; |
193 | } | 200 | } |
@@ -478,7 +485,7 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv, | |||
478 | /* Save page reference in skb */ | 485 | /* Save page reference in skb */ |
479 | __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page); | 486 | __skb_frag_set_page(&skb_frags_rx[nr], frags[nr].page); |
480 | skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size); | 487 | skb_frag_size_set(&skb_frags_rx[nr], frag_info->frag_size); |
481 | skb_frags_rx[nr].page_offset = frags[nr].offset; | 488 | skb_frags_rx[nr].page_offset = frags[nr].page_offset; |
482 | skb->truesize += frag_info->frag_stride; | 489 | skb->truesize += frag_info->frag_stride; |
483 | frags[nr].page = NULL; | 490 | frags[nr].page = NULL; |
484 | } | 491 | } |
@@ -517,7 +524,7 @@ static struct sk_buff *mlx4_en_rx_skb(struct mlx4_en_priv *priv, | |||
517 | 524 | ||
518 | /* Get pointer to first fragment so we could copy the headers into the | 525 | /* Get pointer to first fragment so we could copy the headers into the |
519 | * (linear part of the) skb */ | 526 | * (linear part of the) skb */ |
520 | va = page_address(frags[0].page) + frags[0].offset; | 527 | va = page_address(frags[0].page) + frags[0].page_offset; |
521 | 528 | ||
522 | if (length <= SMALL_PACKET_SIZE) { | 529 | if (length <= SMALL_PACKET_SIZE) { |
523 | /* We are copying all relevant data to the skb - temporarily | 530 | /* We are copying all relevant data to the skb - temporarily |
@@ -645,7 +652,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud | |||
645 | dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh), | 652 | dma_sync_single_for_cpu(priv->ddev, dma, sizeof(*ethh), |
646 | DMA_FROM_DEVICE); | 653 | DMA_FROM_DEVICE); |
647 | ethh = (struct ethhdr *)(page_address(frags[0].page) + | 654 | ethh = (struct ethhdr *)(page_address(frags[0].page) + |
648 | frags[0].offset); | 655 | frags[0].page_offset); |
649 | 656 | ||
650 | if (is_multicast_ether_addr(ethh->h_dest)) { | 657 | if (is_multicast_ether_addr(ethh->h_dest)) { |
651 | struct mlx4_mac_entry *entry; | 658 | struct mlx4_mac_entry *entry; |
diff --git a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h index 5e0aa569306a..bf06e3610d27 100644 --- a/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h +++ b/drivers/net/ethernet/mellanox/mlx4/mlx4_en.h | |||
@@ -237,8 +237,8 @@ struct mlx4_en_tx_desc { | |||
237 | struct mlx4_en_rx_alloc { | 237 | struct mlx4_en_rx_alloc { |
238 | struct page *page; | 238 | struct page *page; |
239 | dma_addr_t dma; | 239 | dma_addr_t dma; |
240 | u32 offset; | 240 | u32 page_offset; |
241 | u32 size; | 241 | u32 page_size; |
242 | }; | 242 | }; |
243 | 243 | ||
244 | struct mlx4_en_tx_ring { | 244 | struct mlx4_en_tx_ring { |
diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c index bd1a2d2bc2ae..ea54d95e5b9f 100644 --- a/drivers/net/ethernet/moxa/moxart_ether.c +++ b/drivers/net/ethernet/moxa/moxart_ether.c | |||
@@ -448,7 +448,8 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
448 | irq = irq_of_parse_and_map(node, 0); | 448 | irq = irq_of_parse_and_map(node, 0); |
449 | if (irq <= 0) { | 449 | if (irq <= 0) { |
450 | netdev_err(ndev, "irq_of_parse_and_map failed\n"); | 450 | netdev_err(ndev, "irq_of_parse_and_map failed\n"); |
451 | return -EINVAL; | 451 | ret = -EINVAL; |
452 | goto irq_map_fail; | ||
452 | } | 453 | } |
453 | 454 | ||
454 | priv = netdev_priv(ndev); | 455 | priv = netdev_priv(ndev); |
@@ -472,24 +473,32 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
472 | priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE * | 473 | priv->tx_desc_base = dma_alloc_coherent(NULL, TX_REG_DESC_SIZE * |
473 | TX_DESC_NUM, &priv->tx_base, | 474 | TX_DESC_NUM, &priv->tx_base, |
474 | GFP_DMA | GFP_KERNEL); | 475 | GFP_DMA | GFP_KERNEL); |
475 | if (priv->tx_desc_base == NULL) | 476 | if (priv->tx_desc_base == NULL) { |
477 | ret = -ENOMEM; | ||
476 | goto init_fail; | 478 | goto init_fail; |
479 | } | ||
477 | 480 | ||
478 | priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE * | 481 | priv->rx_desc_base = dma_alloc_coherent(NULL, RX_REG_DESC_SIZE * |
479 | RX_DESC_NUM, &priv->rx_base, | 482 | RX_DESC_NUM, &priv->rx_base, |
480 | GFP_DMA | GFP_KERNEL); | 483 | GFP_DMA | GFP_KERNEL); |
481 | if (priv->rx_desc_base == NULL) | 484 | if (priv->rx_desc_base == NULL) { |
485 | ret = -ENOMEM; | ||
482 | goto init_fail; | 486 | goto init_fail; |
487 | } | ||
483 | 488 | ||
484 | priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM, | 489 | priv->tx_buf_base = kmalloc(priv->tx_buf_size * TX_DESC_NUM, |
485 | GFP_ATOMIC); | 490 | GFP_ATOMIC); |
486 | if (!priv->tx_buf_base) | 491 | if (!priv->tx_buf_base) { |
492 | ret = -ENOMEM; | ||
487 | goto init_fail; | 493 | goto init_fail; |
494 | } | ||
488 | 495 | ||
489 | priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM, | 496 | priv->rx_buf_base = kmalloc(priv->rx_buf_size * RX_DESC_NUM, |
490 | GFP_ATOMIC); | 497 | GFP_ATOMIC); |
491 | if (!priv->rx_buf_base) | 498 | if (!priv->rx_buf_base) { |
499 | ret = -ENOMEM; | ||
492 | goto init_fail; | 500 | goto init_fail; |
501 | } | ||
493 | 502 | ||
494 | platform_set_drvdata(pdev, ndev); | 503 | platform_set_drvdata(pdev, ndev); |
495 | 504 | ||
@@ -522,7 +531,8 @@ static int moxart_mac_probe(struct platform_device *pdev) | |||
522 | init_fail: | 531 | init_fail: |
523 | netdev_err(ndev, "init failed\n"); | 532 | netdev_err(ndev, "init failed\n"); |
524 | moxart_mac_free_memory(ndev); | 533 | moxart_mac_free_memory(ndev); |
525 | 534 | irq_map_fail: | |
535 | free_netdev(ndev); | ||
526 | return ret; | 536 | return ret; |
527 | } | 537 | } |
528 | 538 | ||
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c index ebe4c86e5230..ff83a9fcd4c5 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_ethtool.c | |||
@@ -665,7 +665,7 @@ static int qlcnic_set_channels(struct net_device *dev, | |||
665 | return err; | 665 | return err; |
666 | } | 666 | } |
667 | 667 | ||
668 | if (channel->tx_count) { | 668 | if (qlcnic_82xx_check(adapter) && channel->tx_count) { |
669 | err = qlcnic_validate_max_tx_rings(adapter, channel->tx_count); | 669 | err = qlcnic_validate_max_tx_rings(adapter, channel->tx_count); |
670 | if (err) | 670 | if (err) |
671 | return err; | 671 | return err; |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 21d00a0449a1..9e61eb867452 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -2257,7 +2257,7 @@ qlcnic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
2257 | 2257 | ||
2258 | err = qlcnic_alloc_adapter_resources(adapter); | 2258 | err = qlcnic_alloc_adapter_resources(adapter); |
2259 | if (err) | 2259 | if (err) |
2260 | goto err_out_free_netdev; | 2260 | goto err_out_free_wq; |
2261 | 2261 | ||
2262 | adapter->dev_rst_time = jiffies; | 2262 | adapter->dev_rst_time = jiffies; |
2263 | adapter->ahw->revision_id = pdev->revision; | 2263 | adapter->ahw->revision_id = pdev->revision; |
@@ -2396,6 +2396,9 @@ err_out_disable_msi: | |||
2396 | err_out_free_hw: | 2396 | err_out_free_hw: |
2397 | qlcnic_free_adapter_resources(adapter); | 2397 | qlcnic_free_adapter_resources(adapter); |
2398 | 2398 | ||
2399 | err_out_free_wq: | ||
2400 | destroy_workqueue(adapter->qlcnic_wq); | ||
2401 | |||
2399 | err_out_free_netdev: | 2402 | err_out_free_netdev: |
2400 | free_netdev(netdev); | 2403 | free_netdev(netdev); |
2401 | 2404 | ||
@@ -3648,11 +3651,6 @@ int qlcnic_validate_max_tx_rings(struct qlcnic_adapter *adapter, u32 txq) | |||
3648 | u8 max_hw = QLCNIC_MAX_TX_RINGS; | 3651 | u8 max_hw = QLCNIC_MAX_TX_RINGS; |
3649 | u32 max_allowed; | 3652 | u32 max_allowed; |
3650 | 3653 | ||
3651 | if (!qlcnic_82xx_check(adapter)) { | ||
3652 | netdev_err(netdev, "No Multi TX-Q support\n"); | ||
3653 | return -EINVAL; | ||
3654 | } | ||
3655 | |||
3656 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { | 3654 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { |
3657 | netdev_err(netdev, "No Multi TX-Q support in INT-x mode\n"); | 3655 | netdev_err(netdev, "No Multi TX-Q support in INT-x mode\n"); |
3658 | return -EINVAL; | 3656 | return -EINVAL; |
@@ -3692,8 +3690,7 @@ int qlcnic_validate_max_rss(struct qlcnic_adapter *adapter, | |||
3692 | u8 max_hw = adapter->ahw->max_rx_ques; | 3690 | u8 max_hw = adapter->ahw->max_rx_ques; |
3693 | u32 max_allowed; | 3691 | u32 max_allowed; |
3694 | 3692 | ||
3695 | if (qlcnic_82xx_check(adapter) && !qlcnic_use_msi_x && | 3693 | if (!qlcnic_use_msi_x && !qlcnic_use_msi) { |
3696 | !qlcnic_use_msi) { | ||
3697 | netdev_err(netdev, "No RSS support in INT-x mode\n"); | 3694 | netdev_err(netdev, "No RSS support in INT-x mode\n"); |
3698 | return -EINVAL; | 3695 | return -EINVAL; |
3699 | } | 3696 | } |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 5cd831ebfa83..b57c278d3b46 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -688,12 +688,16 @@ static struct sh_eth_cpu_data r8a7740_data = { | |||
688 | .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | | 688 | .eesr_err_check = EESR_TWB1 | EESR_TWB | EESR_TABT | EESR_RABT | |
689 | EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE | | 689 | EESR_RFE | EESR_RDE | EESR_RFRMER | EESR_TFE | |
690 | EESR_TDE | EESR_ECI, | 690 | EESR_TDE | EESR_ECI, |
691 | .fdr_value = 0x0000070f, | ||
692 | .rmcr_value = 0x00000001, | ||
691 | 693 | ||
692 | .apr = 1, | 694 | .apr = 1, |
693 | .mpr = 1, | 695 | .mpr = 1, |
694 | .tpauser = 1, | 696 | .tpauser = 1, |
695 | .bculr = 1, | 697 | .bculr = 1, |
696 | .hw_swap = 1, | 698 | .hw_swap = 1, |
699 | .rpadir = 1, | ||
700 | .rpadir_value = 2 << 16, | ||
697 | .no_trimd = 1, | 701 | .no_trimd = 1, |
698 | .no_ade = 1, | 702 | .no_ade = 1, |
699 | .tsu = 1, | 703 | .tsu = 1, |
diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index 9f18ae984f9e..21f9ad6392e9 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c | |||
@@ -444,6 +444,18 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), | 444 | EF10_DMA_STAT(rx_align_error, RX_ALIGN_ERROR_PKTS), |
445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), | 445 | EF10_DMA_STAT(rx_length_error, RX_LENGTH_ERROR_PKTS), |
446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), | 446 | EF10_DMA_STAT(rx_nodesc_drops, RX_NODESC_DROPS), |
447 | EF10_DMA_STAT(rx_pm_trunc_bb_overflow, PM_TRUNC_BB_OVERFLOW), | ||
448 | EF10_DMA_STAT(rx_pm_discard_bb_overflow, PM_DISCARD_BB_OVERFLOW), | ||
449 | EF10_DMA_STAT(rx_pm_trunc_vfifo_full, PM_TRUNC_VFIFO_FULL), | ||
450 | EF10_DMA_STAT(rx_pm_discard_vfifo_full, PM_DISCARD_VFIFO_FULL), | ||
451 | EF10_DMA_STAT(rx_pm_trunc_qbb, PM_TRUNC_QBB), | ||
452 | EF10_DMA_STAT(rx_pm_discard_qbb, PM_DISCARD_QBB), | ||
453 | EF10_DMA_STAT(rx_pm_discard_mapping, PM_DISCARD_MAPPING), | ||
454 | EF10_DMA_STAT(rx_dp_q_disabled_packets, RXDP_Q_DISABLED_PKTS), | ||
455 | EF10_DMA_STAT(rx_dp_di_dropped_packets, RXDP_DI_DROPPED_PKTS), | ||
456 | EF10_DMA_STAT(rx_dp_streaming_packets, RXDP_STREAMING_PKTS), | ||
457 | EF10_DMA_STAT(rx_dp_emerg_fetch, RXDP_EMERGENCY_FETCH_CONDITIONS), | ||
458 | EF10_DMA_STAT(rx_dp_emerg_wait, RXDP_EMERGENCY_WAIT_CONDITIONS), | ||
447 | }; | 459 | }; |
448 | 460 | ||
449 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ | 461 | #define HUNT_COMMON_STAT_MASK ((1ULL << EF10_STAT_tx_bytes) | \ |
@@ -498,44 +510,72 @@ static const struct efx_hw_stat_desc efx_ef10_stat_desc[EF10_STAT_COUNT] = { | |||
498 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ | 510 | #define HUNT_40G_EXTRA_STAT_MASK ((1ULL << EF10_STAT_rx_align_error) | \ |
499 | (1ULL << EF10_STAT_rx_length_error)) | 511 | (1ULL << EF10_STAT_rx_length_error)) |
500 | 512 | ||
501 | #if BITS_PER_LONG == 64 | 513 | /* These statistics are only provided if the firmware supports the |
502 | #define STAT_MASK_BITMAP(bits) (bits) | 514 | * capability PM_AND_RXDP_COUNTERS. |
503 | #else | 515 | */ |
504 | #define STAT_MASK_BITMAP(bits) (bits) & 0xffffffff, (bits) >> 32 | 516 | #define HUNT_PM_AND_RXDP_STAT_MASK ( \ |
505 | #endif | 517 | (1ULL << EF10_STAT_rx_pm_trunc_bb_overflow) | \ |
506 | 518 | (1ULL << EF10_STAT_rx_pm_discard_bb_overflow) | \ | |
507 | static const unsigned long *efx_ef10_stat_mask(struct efx_nic *efx) | 519 | (1ULL << EF10_STAT_rx_pm_trunc_vfifo_full) | \ |
508 | { | 520 | (1ULL << EF10_STAT_rx_pm_discard_vfifo_full) | \ |
509 | static const unsigned long hunt_40g_stat_mask[] = { | 521 | (1ULL << EF10_STAT_rx_pm_trunc_qbb) | \ |
510 | STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | | 522 | (1ULL << EF10_STAT_rx_pm_discard_qbb) | \ |
511 | HUNT_40G_EXTRA_STAT_MASK) | 523 | (1ULL << EF10_STAT_rx_pm_discard_mapping) | \ |
512 | }; | 524 | (1ULL << EF10_STAT_rx_dp_q_disabled_packets) | \ |
513 | static const unsigned long hunt_10g_only_stat_mask[] = { | 525 | (1ULL << EF10_STAT_rx_dp_di_dropped_packets) | \ |
514 | STAT_MASK_BITMAP(HUNT_COMMON_STAT_MASK | | 526 | (1ULL << EF10_STAT_rx_dp_streaming_packets) | \ |
515 | HUNT_10G_ONLY_STAT_MASK) | 527 | (1ULL << EF10_STAT_rx_dp_emerg_fetch) | \ |
516 | }; | 528 | (1ULL << EF10_STAT_rx_dp_emerg_wait)) |
529 | |||
530 | static u64 efx_ef10_raw_stat_mask(struct efx_nic *efx) | ||
531 | { | ||
532 | u64 raw_mask = HUNT_COMMON_STAT_MASK; | ||
517 | u32 port_caps = efx_mcdi_phy_get_caps(efx); | 533 | u32 port_caps = efx_mcdi_phy_get_caps(efx); |
534 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | ||
518 | 535 | ||
519 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) | 536 | if (port_caps & (1 << MC_CMD_PHY_CAP_40000FDX_LBN)) |
520 | return hunt_40g_stat_mask; | 537 | raw_mask |= HUNT_40G_EXTRA_STAT_MASK; |
521 | else | 538 | else |
522 | return hunt_10g_only_stat_mask; | 539 | raw_mask |= HUNT_10G_ONLY_STAT_MASK; |
540 | |||
541 | if (nic_data->datapath_caps & | ||
542 | (1 << MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN)) | ||
543 | raw_mask |= HUNT_PM_AND_RXDP_STAT_MASK; | ||
544 | |||
545 | return raw_mask; | ||
546 | } | ||
547 | |||
548 | static void efx_ef10_get_stat_mask(struct efx_nic *efx, unsigned long *mask) | ||
549 | { | ||
550 | u64 raw_mask = efx_ef10_raw_stat_mask(efx); | ||
551 | |||
552 | #if BITS_PER_LONG == 64 | ||
553 | mask[0] = raw_mask; | ||
554 | #else | ||
555 | mask[0] = raw_mask & 0xffffffff; | ||
556 | mask[1] = raw_mask >> 32; | ||
557 | #endif | ||
523 | } | 558 | } |
524 | 559 | ||
525 | static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) | 560 | static size_t efx_ef10_describe_stats(struct efx_nic *efx, u8 *names) |
526 | { | 561 | { |
562 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); | ||
563 | |||
564 | efx_ef10_get_stat_mask(efx, mask); | ||
527 | return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, | 565 | return efx_nic_describe_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, |
528 | efx_ef10_stat_mask(efx), names); | 566 | mask, names); |
529 | } | 567 | } |
530 | 568 | ||
531 | static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | 569 | static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) |
532 | { | 570 | { |
533 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | 571 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
534 | const unsigned long *stats_mask = efx_ef10_stat_mask(efx); | 572 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); |
535 | __le64 generation_start, generation_end; | 573 | __le64 generation_start, generation_end; |
536 | u64 *stats = nic_data->stats; | 574 | u64 *stats = nic_data->stats; |
537 | __le64 *dma_stats; | 575 | __le64 *dma_stats; |
538 | 576 | ||
577 | efx_ef10_get_stat_mask(efx, mask); | ||
578 | |||
539 | dma_stats = efx->stats_buffer.addr; | 579 | dma_stats = efx->stats_buffer.addr; |
540 | nic_data = efx->nic_data; | 580 | nic_data = efx->nic_data; |
541 | 581 | ||
@@ -543,8 +583,9 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | |||
543 | if (generation_end == EFX_MC_STATS_GENERATION_INVALID) | 583 | if (generation_end == EFX_MC_STATS_GENERATION_INVALID) |
544 | return 0; | 584 | return 0; |
545 | rmb(); | 585 | rmb(); |
546 | efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, stats_mask, | 586 | efx_nic_update_stats(efx_ef10_stat_desc, EF10_STAT_COUNT, mask, |
547 | stats, efx->stats_buffer.addr, false); | 587 | stats, efx->stats_buffer.addr, false); |
588 | rmb(); | ||
548 | generation_start = dma_stats[MC_CMD_MAC_GENERATION_START]; | 589 | generation_start = dma_stats[MC_CMD_MAC_GENERATION_START]; |
549 | if (generation_end != generation_start) | 590 | if (generation_end != generation_start) |
550 | return -EAGAIN; | 591 | return -EAGAIN; |
@@ -563,12 +604,14 @@ static int efx_ef10_try_update_nic_stats(struct efx_nic *efx) | |||
563 | static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats, | 604 | static size_t efx_ef10_update_stats(struct efx_nic *efx, u64 *full_stats, |
564 | struct rtnl_link_stats64 *core_stats) | 605 | struct rtnl_link_stats64 *core_stats) |
565 | { | 606 | { |
566 | const unsigned long *mask = efx_ef10_stat_mask(efx); | 607 | DECLARE_BITMAP(mask, EF10_STAT_COUNT); |
567 | struct efx_ef10_nic_data *nic_data = efx->nic_data; | 608 | struct efx_ef10_nic_data *nic_data = efx->nic_data; |
568 | u64 *stats = nic_data->stats; | 609 | u64 *stats = nic_data->stats; |
569 | size_t stats_count = 0, index; | 610 | size_t stats_count = 0, index; |
570 | int retry; | 611 | int retry; |
571 | 612 | ||
613 | efx_ef10_get_stat_mask(efx, mask); | ||
614 | |||
572 | /* If we're unlucky enough to read statistics during the DMA, wait | 615 | /* If we're unlucky enough to read statistics during the DMA, wait |
573 | * up to 10ms for it to finish (typically takes <500us) | 616 | * up to 10ms for it to finish (typically takes <500us) |
574 | */ | 617 | */ |
diff --git a/drivers/net/ethernet/sfc/mcdi.c b/drivers/net/ethernet/sfc/mcdi.c index c082562dbf4e..366c8e3e3784 100644 --- a/drivers/net/ethernet/sfc/mcdi.c +++ b/drivers/net/ethernet/sfc/mcdi.c | |||
@@ -963,7 +963,7 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | |||
963 | bool *was_attached) | 963 | bool *was_attached) |
964 | { | 964 | { |
965 | MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN); | 965 | MCDI_DECLARE_BUF(inbuf, MC_CMD_DRV_ATTACH_IN_LEN); |
966 | MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_OUT_LEN); | 966 | MCDI_DECLARE_BUF(outbuf, MC_CMD_DRV_ATTACH_EXT_OUT_LEN); |
967 | size_t outlen; | 967 | size_t outlen; |
968 | int rc; | 968 | int rc; |
969 | 969 | ||
@@ -981,6 +981,22 @@ static int efx_mcdi_drv_attach(struct efx_nic *efx, bool driver_operating, | |||
981 | goto fail; | 981 | goto fail; |
982 | } | 982 | } |
983 | 983 | ||
984 | /* We currently assume we have control of the external link | ||
985 | * and are completely trusted by firmware. Abort probing | ||
986 | * if that's not true for this function. | ||
987 | */ | ||
988 | if (driver_operating && | ||
989 | outlen >= MC_CMD_DRV_ATTACH_EXT_OUT_LEN && | ||
990 | (MCDI_DWORD(outbuf, DRV_ATTACH_EXT_OUT_FUNC_FLAGS) & | ||
991 | (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | | ||
992 | 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) != | ||
993 | (1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_LINKCTRL | | ||
994 | 1 << MC_CMD_DRV_ATTACH_EXT_OUT_FLAG_TRUSTED)) { | ||
995 | netif_err(efx, probe, efx->net_dev, | ||
996 | "This driver version only supports one function per port\n"); | ||
997 | return -ENODEV; | ||
998 | } | ||
999 | |||
984 | if (was_attached != NULL) | 1000 | if (was_attached != NULL) |
985 | *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE); | 1001 | *was_attached = MCDI_DWORD(outbuf, DRV_ATTACH_OUT_OLD_STATE); |
986 | return 0; | 1002 | return 0; |
diff --git a/drivers/net/ethernet/sfc/mcdi_pcol.h b/drivers/net/ethernet/sfc/mcdi_pcol.h index b5cf62492f8e..e0a63ddb7a6c 100644 --- a/drivers/net/ethernet/sfc/mcdi_pcol.h +++ b/drivers/net/ethernet/sfc/mcdi_pcol.h | |||
@@ -2574,8 +2574,58 @@ | |||
2574 | #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ | 2574 | #define MC_CMD_MAC_RX_LANES01_DISP_ERR 0x39 /* enum */ |
2575 | #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ | 2575 | #define MC_CMD_MAC_RX_LANES23_DISP_ERR 0x3a /* enum */ |
2576 | #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ | 2576 | #define MC_CMD_MAC_RX_MATCH_FAULT 0x3b /* enum */ |
2577 | #define MC_CMD_GMAC_DMABUF_START 0x40 /* enum */ | 2577 | /* enum: PM trunc_bb_overflow counter. Valid for EF10 with PM_AND_RXDP_COUNTERS |
2578 | #define MC_CMD_GMAC_DMABUF_END 0x5f /* enum */ | 2578 | * capability only. |
2579 | */ | ||
2580 | #define MC_CMD_MAC_PM_TRUNC_BB_OVERFLOW 0x3c | ||
2581 | /* enum: PM discard_bb_overflow counter. Valid for EF10 with | ||
2582 | * PM_AND_RXDP_COUNTERS capability only. | ||
2583 | */ | ||
2584 | #define MC_CMD_MAC_PM_DISCARD_BB_OVERFLOW 0x3d | ||
2585 | /* enum: PM trunc_vfifo_full counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2586 | * capability only. | ||
2587 | */ | ||
2588 | #define MC_CMD_MAC_PM_TRUNC_VFIFO_FULL 0x3e | ||
2589 | /* enum: PM discard_vfifo_full counter. Valid for EF10 with | ||
2590 | * PM_AND_RXDP_COUNTERS capability only. | ||
2591 | */ | ||
2592 | #define MC_CMD_MAC_PM_DISCARD_VFIFO_FULL 0x3f | ||
2593 | /* enum: PM trunc_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2594 | * capability only. | ||
2595 | */ | ||
2596 | #define MC_CMD_MAC_PM_TRUNC_QBB 0x40 | ||
2597 | /* enum: PM discard_qbb counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2598 | * capability only. | ||
2599 | */ | ||
2600 | #define MC_CMD_MAC_PM_DISCARD_QBB 0x41 | ||
2601 | /* enum: PM discard_mapping counter. Valid for EF10 with PM_AND_RXDP_COUNTERS | ||
2602 | * capability only. | ||
2603 | */ | ||
2604 | #define MC_CMD_MAC_PM_DISCARD_MAPPING 0x42 | ||
2605 | /* enum: RXDP counter: Number of packets dropped due to the queue being | ||
2606 | * disabled. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2607 | */ | ||
2608 | #define MC_CMD_MAC_RXDP_Q_DISABLED_PKTS 0x43 | ||
2609 | /* enum: RXDP counter: Number of packets dropped by the DICPU. Valid for EF10 | ||
2610 | * with PM_AND_RXDP_COUNTERS capability only. | ||
2611 | */ | ||
2612 | #define MC_CMD_MAC_RXDP_DI_DROPPED_PKTS 0x45 | ||
2613 | /* enum: RXDP counter: Number of non-host packets. Valid for EF10 with | ||
2614 | * PM_AND_RXDP_COUNTERS capability only. | ||
2615 | */ | ||
2616 | #define MC_CMD_MAC_RXDP_STREAMING_PKTS 0x46 | ||
2617 | /* enum: RXDP counter: Number of times an emergency descriptor fetch was | ||
2618 | * performed. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2619 | */ | ||
2620 | #define MC_CMD_MAC_RXDP_EMERGENCY_FETCH_CONDITIONS 0x47 | ||
2621 | /* enum: RXDP counter: Number of times the DPCPU waited for an existing | ||
2622 | * descriptor fetch. Valid for EF10 with PM_AND_RXDP_COUNTERS capability only. | ||
2623 | */ | ||
2624 | #define MC_CMD_MAC_RXDP_EMERGENCY_WAIT_CONDITIONS 0x48 | ||
2625 | /* enum: Start of GMAC stats buffer space, for Siena only. */ | ||
2626 | #define MC_CMD_GMAC_DMABUF_START 0x40 | ||
2627 | /* enum: End of GMAC stats buffer space, for Siena only. */ | ||
2628 | #define MC_CMD_GMAC_DMABUF_END 0x5f | ||
2579 | #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */ | 2629 | #define MC_CMD_MAC_GENERATION_END 0x60 /* enum */ |
2580 | #define MC_CMD_MAC_NSTATS 0x61 /* enum */ | 2630 | #define MC_CMD_MAC_NSTATS 0x61 /* enum */ |
2581 | 2631 | ||
@@ -5065,6 +5115,8 @@ | |||
5065 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1 | 5115 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_BATCHING_WIDTH 1 |
5066 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26 | 5116 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_LBN 26 |
5067 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1 | 5117 | #define MC_CMD_GET_CAPABILITIES_OUT_MCAST_FILTER_CHAINING_WIDTH 1 |
5118 | #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_LBN 27 | ||
5119 | #define MC_CMD_GET_CAPABILITIES_OUT_PM_AND_RXDP_COUNTERS_WIDTH 1 | ||
5068 | /* RxDPCPU firmware id. */ | 5120 | /* RxDPCPU firmware id. */ |
5069 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4 | 5121 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_OFST 4 |
5070 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2 | 5122 | #define MC_CMD_GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID_LEN 2 |
diff --git a/drivers/net/ethernet/sfc/nic.c b/drivers/net/ethernet/sfc/nic.c index e7dbd2dd202e..9826594c8a48 100644 --- a/drivers/net/ethernet/sfc/nic.c +++ b/drivers/net/ethernet/sfc/nic.c | |||
@@ -469,8 +469,7 @@ size_t efx_nic_describe_stats(const struct efx_hw_stat_desc *desc, size_t count, | |||
469 | * @count: Length of the @desc array | 469 | * @count: Length of the @desc array |
470 | * @mask: Bitmask of which elements of @desc are enabled | 470 | * @mask: Bitmask of which elements of @desc are enabled |
471 | * @stats: Buffer to update with the converted statistics. The length | 471 | * @stats: Buffer to update with the converted statistics. The length |
472 | * of this array must be at least the number of set bits in the | 472 | * of this array must be at least @count. |
473 | * first @count bits of @mask. | ||
474 | * @dma_buf: DMA buffer containing hardware statistics | 473 | * @dma_buf: DMA buffer containing hardware statistics |
475 | * @accumulate: If set, the converted values will be added rather than | 474 | * @accumulate: If set, the converted values will be added rather than |
476 | * directly stored to the corresponding elements of @stats | 475 | * directly stored to the corresponding elements of @stats |
@@ -503,11 +502,9 @@ void efx_nic_update_stats(const struct efx_hw_stat_desc *desc, size_t count, | |||
503 | } | 502 | } |
504 | 503 | ||
505 | if (accumulate) | 504 | if (accumulate) |
506 | *stats += val; | 505 | stats[index] += val; |
507 | else | 506 | else |
508 | *stats = val; | 507 | stats[index] = val; |
509 | } | 508 | } |
510 | |||
511 | ++stats; | ||
512 | } | 509 | } |
513 | } | 510 | } |
diff --git a/drivers/net/ethernet/sfc/nic.h b/drivers/net/ethernet/sfc/nic.h index fda29d39032f..890bbbe8320e 100644 --- a/drivers/net/ethernet/sfc/nic.h +++ b/drivers/net/ethernet/sfc/nic.h | |||
@@ -386,6 +386,18 @@ enum { | |||
386 | EF10_STAT_rx_align_error, | 386 | EF10_STAT_rx_align_error, |
387 | EF10_STAT_rx_length_error, | 387 | EF10_STAT_rx_length_error, |
388 | EF10_STAT_rx_nodesc_drops, | 388 | EF10_STAT_rx_nodesc_drops, |
389 | EF10_STAT_rx_pm_trunc_bb_overflow, | ||
390 | EF10_STAT_rx_pm_discard_bb_overflow, | ||
391 | EF10_STAT_rx_pm_trunc_vfifo_full, | ||
392 | EF10_STAT_rx_pm_discard_vfifo_full, | ||
393 | EF10_STAT_rx_pm_trunc_qbb, | ||
394 | EF10_STAT_rx_pm_discard_qbb, | ||
395 | EF10_STAT_rx_pm_discard_mapping, | ||
396 | EF10_STAT_rx_dp_q_disabled_packets, | ||
397 | EF10_STAT_rx_dp_di_dropped_packets, | ||
398 | EF10_STAT_rx_dp_streaming_packets, | ||
399 | EF10_STAT_rx_dp_emerg_fetch, | ||
400 | EF10_STAT_rx_dp_emerg_wait, | ||
389 | EF10_STAT_COUNT | 401 | EF10_STAT_COUNT |
390 | }; | 402 | }; |
391 | 403 | ||
diff --git a/drivers/net/ethernet/smsc/smc91x.h b/drivers/net/ethernet/smsc/smc91x.h index 5730fe2445a6..98eedb90cdc3 100644 --- a/drivers/net/ethernet/smsc/smc91x.h +++ b/drivers/net/ethernet/smsc/smc91x.h | |||
@@ -1124,8 +1124,7 @@ static const char * chip_ids[ 16 ] = { | |||
1124 | void __iomem *__ioaddr = ioaddr; \ | 1124 | void __iomem *__ioaddr = ioaddr; \ |
1125 | if (__len >= 2 && (unsigned long)__ptr & 2) { \ | 1125 | if (__len >= 2 && (unsigned long)__ptr & 2) { \ |
1126 | __len -= 2; \ | 1126 | __len -= 2; \ |
1127 | SMC_outw(*(u16 *)__ptr, ioaddr, \ | 1127 | SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ |
1128 | DATA_REG(lp)); \ | ||
1129 | __ptr += 2; \ | 1128 | __ptr += 2; \ |
1130 | } \ | 1129 | } \ |
1131 | if (SMC_CAN_USE_DATACS && lp->datacs) \ | 1130 | if (SMC_CAN_USE_DATACS && lp->datacs) \ |
@@ -1133,8 +1132,7 @@ static const char * chip_ids[ 16 ] = { | |||
1133 | SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ | 1132 | SMC_outsl(__ioaddr, DATA_REG(lp), __ptr, __len>>2); \ |
1134 | if (__len & 2) { \ | 1133 | if (__len & 2) { \ |
1135 | __ptr += (__len & ~3); \ | 1134 | __ptr += (__len & ~3); \ |
1136 | SMC_outw(*((u16 *)__ptr), ioaddr, \ | 1135 | SMC_outsw(ioaddr, DATA_REG(lp), __ptr, 1); \ |
1137 | DATA_REG(lp)); \ | ||
1138 | } \ | 1136 | } \ |
1139 | } else if (SMC_16BIT(lp)) \ | 1137 | } else if (SMC_16BIT(lp)) \ |
1140 | SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ | 1138 | SMC_outsw(ioaddr, DATA_REG(lp), p, (l) >> 1); \ |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 79974e31187a..cc3ce557e4aa 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -639,13 +639,6 @@ void cpsw_rx_handler(void *token, int len, int status) | |||
639 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) | 639 | static irqreturn_t cpsw_interrupt(int irq, void *dev_id) |
640 | { | 640 | { |
641 | struct cpsw_priv *priv = dev_id; | 641 | struct cpsw_priv *priv = dev_id; |
642 | u32 rx, tx, rx_thresh; | ||
643 | |||
644 | rx_thresh = __raw_readl(&priv->wr_regs->rx_thresh_stat); | ||
645 | rx = __raw_readl(&priv->wr_regs->rx_stat); | ||
646 | tx = __raw_readl(&priv->wr_regs->tx_stat); | ||
647 | if (!rx_thresh && !rx && !tx) | ||
648 | return IRQ_NONE; | ||
649 | 642 | ||
650 | cpsw_intr_disable(priv); | 643 | cpsw_intr_disable(priv); |
651 | if (priv->irq_enabled == true) { | 644 | if (priv->irq_enabled == true) { |
@@ -1169,9 +1162,9 @@ static int cpsw_ndo_open(struct net_device *ndev) | |||
1169 | } | 1162 | } |
1170 | } | 1163 | } |
1171 | 1164 | ||
1165 | napi_enable(&priv->napi); | ||
1172 | cpdma_ctlr_start(priv->dma); | 1166 | cpdma_ctlr_start(priv->dma); |
1173 | cpsw_intr_enable(priv); | 1167 | cpsw_intr_enable(priv); |
1174 | napi_enable(&priv->napi); | ||
1175 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); | 1168 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_RX); |
1176 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); | 1169 | cpdma_ctlr_eoi(priv->dma, CPDMA_EOI_TX); |
1177 | 1170 | ||
@@ -1771,8 +1764,8 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1771 | } | 1764 | } |
1772 | data->mac_control = prop; | 1765 | data->mac_control = prop; |
1773 | 1766 | ||
1774 | if (!of_property_read_u32(node, "dual_emac", &prop)) | 1767 | if (of_property_read_bool(node, "dual_emac")) |
1775 | data->dual_emac = prop; | 1768 | data->dual_emac = 1; |
1776 | 1769 | ||
1777 | /* | 1770 | /* |
1778 | * Populate all the child nodes here... | 1771 | * Populate all the child nodes here... |
@@ -1782,7 +1775,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1782 | if (ret) | 1775 | if (ret) |
1783 | pr_warn("Doesn't have any child node\n"); | 1776 | pr_warn("Doesn't have any child node\n"); |
1784 | 1777 | ||
1785 | for_each_node_by_name(slave_node, "slave") { | 1778 | for_each_child_of_node(node, slave_node) { |
1786 | struct cpsw_slave_data *slave_data = data->slave_data + i; | 1779 | struct cpsw_slave_data *slave_data = data->slave_data + i; |
1787 | const void *mac_addr = NULL; | 1780 | const void *mac_addr = NULL; |
1788 | u32 phyid; | 1781 | u32 phyid; |
@@ -1791,6 +1784,10 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data, | |||
1791 | struct device_node *mdio_node; | 1784 | struct device_node *mdio_node; |
1792 | struct platform_device *mdio; | 1785 | struct platform_device *mdio; |
1793 | 1786 | ||
1787 | /* This is no slave child node, continue */ | ||
1788 | if (strcmp(slave_node->name, "slave")) | ||
1789 | continue; | ||
1790 | |||
1794 | parp = of_get_property(slave_node, "phy_id", &lenp); | 1791 | parp = of_get_property(slave_node, "phy_id", &lenp); |
1795 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { | 1792 | if ((parp == NULL) || (lenp != (sizeof(void *) * 2))) { |
1796 | pr_err("Missing slave[%d] phy_id property\n", i); | 1793 | pr_err("Missing slave[%d] phy_id property\n", i); |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index 67df09ea9d04..6a32ef9d63ae 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -876,8 +876,7 @@ static void emac_dev_mcast_set(struct net_device *ndev) | |||
876 | netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) { | 876 | netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) { |
877 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); | 877 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); |
878 | emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL); | 878 | emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL); |
879 | } | 879 | } else if (!netdev_mc_empty(ndev)) { |
880 | if (!netdev_mc_empty(ndev)) { | ||
881 | struct netdev_hw_addr *ha; | 880 | struct netdev_hw_addr *ha; |
882 | 881 | ||
883 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); | 882 | mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST); |
diff --git a/drivers/net/hamradio/yam.c b/drivers/net/hamradio/yam.c index 0721e72f9299..5af1c3e5032a 100644 --- a/drivers/net/hamradio/yam.c +++ b/drivers/net/hamradio/yam.c | |||
@@ -975,7 +975,6 @@ static int yam_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
975 | return -EINVAL; /* Cannot change this parameter when up */ | 975 | return -EINVAL; /* Cannot change this parameter when up */ |
976 | if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL) | 976 | if ((ym = kmalloc(sizeof(struct yamdrv_ioctl_mcs), GFP_KERNEL)) == NULL) |
977 | return -ENOBUFS; | 977 | return -ENOBUFS; |
978 | ym->bitrate = 9600; | ||
979 | if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) { | 978 | if (copy_from_user(ym, ifr->ifr_data, sizeof(struct yamdrv_ioctl_mcs))) { |
980 | kfree(ym); | 979 | kfree(ym); |
981 | return -EFAULT; | 980 | return -EFAULT; |
diff --git a/drivers/net/ieee802154/mrf24j40.c b/drivers/net/ieee802154/mrf24j40.c index 42e6deee6db5..0632d34905c7 100644 --- a/drivers/net/ieee802154/mrf24j40.c +++ b/drivers/net/ieee802154/mrf24j40.c | |||
@@ -82,7 +82,6 @@ struct mrf24j40 { | |||
82 | 82 | ||
83 | struct mutex buffer_mutex; /* only used to protect buf */ | 83 | struct mutex buffer_mutex; /* only used to protect buf */ |
84 | struct completion tx_complete; | 84 | struct completion tx_complete; |
85 | struct work_struct irqwork; | ||
86 | u8 *buf; /* 3 bytes. Used for SPI single-register transfers. */ | 85 | u8 *buf; /* 3 bytes. Used for SPI single-register transfers. */ |
87 | }; | 86 | }; |
88 | 87 | ||
@@ -344,6 +343,8 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb) | |||
344 | if (ret) | 343 | if (ret) |
345 | goto err; | 344 | goto err; |
346 | 345 | ||
346 | INIT_COMPLETION(devrec->tx_complete); | ||
347 | |||
347 | /* Set TXNTRIG bit of TXNCON to send packet */ | 348 | /* Set TXNTRIG bit of TXNCON to send packet */ |
348 | ret = read_short_reg(devrec, REG_TXNCON, &val); | 349 | ret = read_short_reg(devrec, REG_TXNCON, &val); |
349 | if (ret) | 350 | if (ret) |
@@ -354,8 +355,6 @@ static int mrf24j40_tx(struct ieee802154_dev *dev, struct sk_buff *skb) | |||
354 | val |= 0x4; | 355 | val |= 0x4; |
355 | write_short_reg(devrec, REG_TXNCON, val); | 356 | write_short_reg(devrec, REG_TXNCON, val); |
356 | 357 | ||
357 | INIT_COMPLETION(devrec->tx_complete); | ||
358 | |||
359 | /* Wait for the device to send the TX complete interrupt. */ | 358 | /* Wait for the device to send the TX complete interrupt. */ |
360 | ret = wait_for_completion_interruptible_timeout( | 359 | ret = wait_for_completion_interruptible_timeout( |
361 | &devrec->tx_complete, | 360 | &devrec->tx_complete, |
@@ -590,17 +589,6 @@ static struct ieee802154_ops mrf24j40_ops = { | |||
590 | static irqreturn_t mrf24j40_isr(int irq, void *data) | 589 | static irqreturn_t mrf24j40_isr(int irq, void *data) |
591 | { | 590 | { |
592 | struct mrf24j40 *devrec = data; | 591 | struct mrf24j40 *devrec = data; |
593 | |||
594 | disable_irq_nosync(irq); | ||
595 | |||
596 | schedule_work(&devrec->irqwork); | ||
597 | |||
598 | return IRQ_HANDLED; | ||
599 | } | ||
600 | |||
601 | static void mrf24j40_isrwork(struct work_struct *work) | ||
602 | { | ||
603 | struct mrf24j40 *devrec = container_of(work, struct mrf24j40, irqwork); | ||
604 | u8 intstat; | 592 | u8 intstat; |
605 | int ret; | 593 | int ret; |
606 | 594 | ||
@@ -618,7 +606,7 @@ static void mrf24j40_isrwork(struct work_struct *work) | |||
618 | mrf24j40_handle_rx(devrec); | 606 | mrf24j40_handle_rx(devrec); |
619 | 607 | ||
620 | out: | 608 | out: |
621 | enable_irq(devrec->spi->irq); | 609 | return IRQ_HANDLED; |
622 | } | 610 | } |
623 | 611 | ||
624 | static int mrf24j40_probe(struct spi_device *spi) | 612 | static int mrf24j40_probe(struct spi_device *spi) |
@@ -642,7 +630,6 @@ static int mrf24j40_probe(struct spi_device *spi) | |||
642 | 630 | ||
643 | mutex_init(&devrec->buffer_mutex); | 631 | mutex_init(&devrec->buffer_mutex); |
644 | init_completion(&devrec->tx_complete); | 632 | init_completion(&devrec->tx_complete); |
645 | INIT_WORK(&devrec->irqwork, mrf24j40_isrwork); | ||
646 | devrec->spi = spi; | 633 | devrec->spi = spi; |
647 | spi_set_drvdata(spi, devrec); | 634 | spi_set_drvdata(spi, devrec); |
648 | 635 | ||
@@ -688,11 +675,12 @@ static int mrf24j40_probe(struct spi_device *spi) | |||
688 | val &= ~0x3; /* Clear RX mode (normal) */ | 675 | val &= ~0x3; /* Clear RX mode (normal) */ |
689 | write_short_reg(devrec, REG_RXMCR, val); | 676 | write_short_reg(devrec, REG_RXMCR, val); |
690 | 677 | ||
691 | ret = request_irq(spi->irq, | 678 | ret = request_threaded_irq(spi->irq, |
692 | mrf24j40_isr, | 679 | NULL, |
693 | IRQF_TRIGGER_FALLING, | 680 | mrf24j40_isr, |
694 | dev_name(&spi->dev), | 681 | IRQF_TRIGGER_LOW|IRQF_ONESHOT, |
695 | devrec); | 682 | dev_name(&spi->dev), |
683 | devrec); | ||
696 | 684 | ||
697 | if (ret) { | 685 | if (ret) { |
698 | dev_err(printdev(devrec), "Unable to get IRQ"); | 686 | dev_err(printdev(devrec), "Unable to get IRQ"); |
@@ -721,7 +709,6 @@ static int mrf24j40_remove(struct spi_device *spi) | |||
721 | dev_dbg(printdev(devrec), "remove\n"); | 709 | dev_dbg(printdev(devrec), "remove\n"); |
722 | 710 | ||
723 | free_irq(spi->irq, devrec); | 711 | free_irq(spi->irq, devrec); |
724 | flush_work(&devrec->irqwork); /* TODO: Is this the right call? */ | ||
725 | ieee802154_unregister_device(devrec->dev); | 712 | ieee802154_unregister_device(devrec->dev); |
726 | ieee802154_free_device(devrec->dev); | 713 | ieee802154_free_device(devrec->dev); |
727 | /* TODO: Will ieee802154_free_device() wait until ->xmit() is | 714 | /* TODO: Will ieee802154_free_device() wait until ->xmit() is |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 807815fc9968..7cb105c103fe 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1293,7 +1293,8 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, | |||
1293 | if (unlikely(!noblock)) | 1293 | if (unlikely(!noblock)) |
1294 | add_wait_queue(&tfile->wq.wait, &wait); | 1294 | add_wait_queue(&tfile->wq.wait, &wait); |
1295 | while (len) { | 1295 | while (len) { |
1296 | current->state = TASK_INTERRUPTIBLE; | 1296 | if (unlikely(!noblock)) |
1297 | current->state = TASK_INTERRUPTIBLE; | ||
1297 | 1298 | ||
1298 | /* Read frames from the queue */ | 1299 | /* Read frames from the queue */ |
1299 | if (!(skb = skb_dequeue(&tfile->socket.sk->sk_receive_queue))) { | 1300 | if (!(skb = skb_dequeue(&tfile->socket.sk->sk_receive_queue))) { |
@@ -1320,9 +1321,10 @@ static ssize_t tun_do_read(struct tun_struct *tun, struct tun_file *tfile, | |||
1320 | break; | 1321 | break; |
1321 | } | 1322 | } |
1322 | 1323 | ||
1323 | current->state = TASK_RUNNING; | 1324 | if (unlikely(!noblock)) { |
1324 | if (unlikely(!noblock)) | 1325 | current->state = TASK_RUNNING; |
1325 | remove_wait_queue(&tfile->wq.wait, &wait); | 1326 | remove_wait_queue(&tfile->wq.wait, &wait); |
1327 | } | ||
1326 | 1328 | ||
1327 | return ret; | 1329 | return ret; |
1328 | } | 1330 | } |
diff --git a/drivers/net/usb/ax88179_178a.c b/drivers/net/usb/ax88179_178a.c index 3569293df872..846cc19c04f2 100644 --- a/drivers/net/usb/ax88179_178a.c +++ b/drivers/net/usb/ax88179_178a.c | |||
@@ -36,8 +36,8 @@ | |||
36 | #define AX_RXHDR_L4_TYPE_TCP 16 | 36 | #define AX_RXHDR_L4_TYPE_TCP 16 |
37 | #define AX_RXHDR_L3CSUM_ERR 2 | 37 | #define AX_RXHDR_L3CSUM_ERR 2 |
38 | #define AX_RXHDR_L4CSUM_ERR 1 | 38 | #define AX_RXHDR_L4CSUM_ERR 1 |
39 | #define AX_RXHDR_CRC_ERR ((u32)BIT(31)) | 39 | #define AX_RXHDR_CRC_ERR ((u32)BIT(29)) |
40 | #define AX_RXHDR_DROP_ERR ((u32)BIT(30)) | 40 | #define AX_RXHDR_DROP_ERR ((u32)BIT(31)) |
41 | #define AX_ACCESS_MAC 0x01 | 41 | #define AX_ACCESS_MAC 0x01 |
42 | #define AX_ACCESS_PHY 0x02 | 42 | #define AX_ACCESS_PHY 0x02 |
43 | #define AX_ACCESS_EEPROM 0x04 | 43 | #define AX_ACCESS_EEPROM 0x04 |
@@ -1406,6 +1406,19 @@ static const struct driver_info sitecom_info = { | |||
1406 | .tx_fixup = ax88179_tx_fixup, | 1406 | .tx_fixup = ax88179_tx_fixup, |
1407 | }; | 1407 | }; |
1408 | 1408 | ||
1409 | static const struct driver_info samsung_info = { | ||
1410 | .description = "Samsung USB Ethernet Adapter", | ||
1411 | .bind = ax88179_bind, | ||
1412 | .unbind = ax88179_unbind, | ||
1413 | .status = ax88179_status, | ||
1414 | .link_reset = ax88179_link_reset, | ||
1415 | .reset = ax88179_reset, | ||
1416 | .stop = ax88179_stop, | ||
1417 | .flags = FLAG_ETHER | FLAG_FRAMING_AX, | ||
1418 | .rx_fixup = ax88179_rx_fixup, | ||
1419 | .tx_fixup = ax88179_tx_fixup, | ||
1420 | }; | ||
1421 | |||
1409 | static const struct usb_device_id products[] = { | 1422 | static const struct usb_device_id products[] = { |
1410 | { | 1423 | { |
1411 | /* ASIX AX88179 10/100/1000 */ | 1424 | /* ASIX AX88179 10/100/1000 */ |
@@ -1418,7 +1431,11 @@ static const struct usb_device_id products[] = { | |||
1418 | }, { | 1431 | }, { |
1419 | /* Sitecom USB 3.0 to Gigabit Adapter */ | 1432 | /* Sitecom USB 3.0 to Gigabit Adapter */ |
1420 | USB_DEVICE(0x0df6, 0x0072), | 1433 | USB_DEVICE(0x0df6, 0x0072), |
1421 | .driver_info = (unsigned long) &sitecom_info, | 1434 | .driver_info = (unsigned long)&sitecom_info, |
1435 | }, { | ||
1436 | /* Samsung USB Ethernet Adapter */ | ||
1437 | USB_DEVICE(0x04e8, 0xa100), | ||
1438 | .driver_info = (unsigned long)&samsung_info, | ||
1422 | }, | 1439 | }, |
1423 | { }, | 1440 | { }, |
1424 | }; | 1441 | }; |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 3d6aaf79d8b2..818ce90185b5 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
@@ -714,6 +714,7 @@ static const struct usb_device_id products[] = { | |||
714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ | 714 | {QMI_FIXED_INTF(0x2357, 0x0201, 4)}, /* TP-LINK HSUPA Modem MA180 */ |
715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ | 715 | {QMI_FIXED_INTF(0x2357, 0x9000, 4)}, /* TP-LINK MA260 */ |
716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ | 716 | {QMI_FIXED_INTF(0x1bc7, 0x1200, 5)}, /* Telit LE920 */ |
717 | {QMI_FIXED_INTF(0x0b3c, 0xc005, 6)}, /* Olivetti Olicard 200 */ | ||
717 | {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ | 718 | {QMI_FIXED_INTF(0x1e2d, 0x0060, 4)}, /* Cinterion PLxx */ |
718 | 719 | ||
719 | /* 4. Gobi 1000 devices */ | 720 | /* 4. Gobi 1000 devices */ |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index bf94e10a37c8..90a429b7ebad 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
@@ -1688,8 +1688,10 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) | |||
1688 | if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && | 1688 | if (dev->can_dma_sg && !(info->flags & FLAG_SEND_ZLP) && |
1689 | !(info->flags & FLAG_MULTI_PACKET)) { | 1689 | !(info->flags & FLAG_MULTI_PACKET)) { |
1690 | dev->padding_pkt = kzalloc(1, GFP_KERNEL); | 1690 | dev->padding_pkt = kzalloc(1, GFP_KERNEL); |
1691 | if (!dev->padding_pkt) | 1691 | if (!dev->padding_pkt) { |
1692 | status = -ENOMEM; | ||
1692 | goto out4; | 1693 | goto out4; |
1694 | } | ||
1693 | } | 1695 | } |
1694 | 1696 | ||
1695 | status = register_netdev (net); | 1697 | status = register_netdev (net); |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index defec2b3c5a4..9fbdfcd1e1a0 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -938,7 +938,9 @@ static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) | |||
938 | return -EINVAL; | 938 | return -EINVAL; |
939 | } else { | 939 | } else { |
940 | vi->curr_queue_pairs = queue_pairs; | 940 | vi->curr_queue_pairs = queue_pairs; |
941 | schedule_delayed_work(&vi->refill, 0); | 941 | /* virtnet_open() will refill when device is going to up. */ |
942 | if (dev->flags & IFF_UP) | ||
943 | schedule_delayed_work(&vi->refill, 0); | ||
942 | } | 944 | } |
943 | 945 | ||
944 | return 0; | 946 | return 0; |
@@ -1116,6 +1118,11 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1116 | { | 1118 | { |
1117 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); | 1119 | struct virtnet_info *vi = container_of(nfb, struct virtnet_info, nb); |
1118 | 1120 | ||
1121 | mutex_lock(&vi->config_lock); | ||
1122 | |||
1123 | if (!vi->config_enable) | ||
1124 | goto done; | ||
1125 | |||
1119 | switch(action & ~CPU_TASKS_FROZEN) { | 1126 | switch(action & ~CPU_TASKS_FROZEN) { |
1120 | case CPU_ONLINE: | 1127 | case CPU_ONLINE: |
1121 | case CPU_DOWN_FAILED: | 1128 | case CPU_DOWN_FAILED: |
@@ -1128,6 +1135,9 @@ static int virtnet_cpu_callback(struct notifier_block *nfb, | |||
1128 | default: | 1135 | default: |
1129 | break; | 1136 | break; |
1130 | } | 1137 | } |
1138 | |||
1139 | done: | ||
1140 | mutex_unlock(&vi->config_lock); | ||
1131 | return NOTIFY_OK; | 1141 | return NOTIFY_OK; |
1132 | } | 1142 | } |
1133 | 1143 | ||
@@ -1733,7 +1743,9 @@ static int virtnet_restore(struct virtio_device *vdev) | |||
1733 | vi->config_enable = true; | 1743 | vi->config_enable = true; |
1734 | mutex_unlock(&vi->config_lock); | 1744 | mutex_unlock(&vi->config_lock); |
1735 | 1745 | ||
1746 | rtnl_lock(); | ||
1736 | virtnet_set_queues(vi, vi->curr_queue_pairs); | 1747 | virtnet_set_queues(vi, vi->curr_queue_pairs); |
1748 | rtnl_unlock(); | ||
1737 | 1749 | ||
1738 | return 0; | 1750 | return 0; |
1739 | } | 1751 | } |
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c index 3f0c4f268751..bcfff0d62de4 100644 --- a/drivers/net/wan/farsync.c +++ b/drivers/net/wan/farsync.c | |||
@@ -1972,6 +1972,7 @@ fst_get_iface(struct fst_card_info *card, struct fst_port_info *port, | |||
1972 | } | 1972 | } |
1973 | 1973 | ||
1974 | i = port->index; | 1974 | i = port->index; |
1975 | memset(&sync, 0, sizeof(sync)); | ||
1975 | sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed); | 1976 | sync.clock_rate = FST_RDL(card, portConfig[i].lineSpeed); |
1976 | /* Lucky card and linux use same encoding here */ | 1977 | /* Lucky card and linux use same encoding here */ |
1977 | sync.clock_type = FST_RDB(card, portConfig[i].internalClock) == | 1978 | sync.clock_type = FST_RDB(card, portConfig[i].internalClock) == |
diff --git a/drivers/net/wan/wanxl.c b/drivers/net/wan/wanxl.c index 6a24a5a70cc7..4c0a69779b89 100644 --- a/drivers/net/wan/wanxl.c +++ b/drivers/net/wan/wanxl.c | |||
@@ -355,6 +355,7 @@ static int wanxl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
355 | ifr->ifr_settings.size = size; /* data size wanted */ | 355 | ifr->ifr_settings.size = size; /* data size wanted */ |
356 | return -ENOBUFS; | 356 | return -ENOBUFS; |
357 | } | 357 | } |
358 | memset(&line, 0, sizeof(line)); | ||
358 | line.clock_type = get_status(port)->clocking; | 359 | line.clock_type = get_status(port)->clocking; |
359 | line.clock_rate = 0; | 360 | line.clock_rate = 0; |
360 | line.loopback = 0; | 361 | line.loopback = 0; |
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index e4f65900132d..709301f88dcd 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c | |||
@@ -208,6 +208,7 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||
208 | struct ath_hw *ah = sc->sc_ah; | 208 | struct ath_hw *ah = sc->sc_ah; |
209 | struct ath_common *common = ath9k_hw_common(ah); | 209 | struct ath_common *common = ath9k_hw_common(ah); |
210 | unsigned long flags; | 210 | unsigned long flags; |
211 | int i; | ||
211 | 212 | ||
212 | if (ath_startrecv(sc) != 0) { | 213 | if (ath_startrecv(sc) != 0) { |
213 | ath_err(common, "Unable to restart recv logic\n"); | 214 | ath_err(common, "Unable to restart recv logic\n"); |
@@ -235,6 +236,15 @@ static bool ath_complete_reset(struct ath_softc *sc, bool start) | |||
235 | } | 236 | } |
236 | work: | 237 | work: |
237 | ath_restart_work(sc); | 238 | ath_restart_work(sc); |
239 | |||
240 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | ||
241 | if (!ATH_TXQ_SETUP(sc, i)) | ||
242 | continue; | ||
243 | |||
244 | spin_lock_bh(&sc->tx.txq[i].axq_lock); | ||
245 | ath_txq_schedule(sc, &sc->tx.txq[i]); | ||
246 | spin_unlock_bh(&sc->tx.txq[i].axq_lock); | ||
247 | } | ||
238 | } | 248 | } |
239 | 249 | ||
240 | ieee80211_wake_queues(sc->hw); | 250 | ieee80211_wake_queues(sc->hw); |
@@ -539,21 +549,10 @@ chip_reset: | |||
539 | 549 | ||
540 | static int ath_reset(struct ath_softc *sc) | 550 | static int ath_reset(struct ath_softc *sc) |
541 | { | 551 | { |
542 | int i, r; | 552 | int r; |
543 | 553 | ||
544 | ath9k_ps_wakeup(sc); | 554 | ath9k_ps_wakeup(sc); |
545 | |||
546 | r = ath_reset_internal(sc, NULL); | 555 | r = ath_reset_internal(sc, NULL); |
547 | |||
548 | for (i = 0; i < ATH9K_NUM_TX_QUEUES; i++) { | ||
549 | if (!ATH_TXQ_SETUP(sc, i)) | ||
550 | continue; | ||
551 | |||
552 | spin_lock_bh(&sc->tx.txq[i].axq_lock); | ||
553 | ath_txq_schedule(sc, &sc->tx.txq[i]); | ||
554 | spin_unlock_bh(&sc->tx.txq[i].axq_lock); | ||
555 | } | ||
556 | |||
557 | ath9k_ps_restore(sc); | 556 | ath9k_ps_restore(sc); |
558 | 557 | ||
559 | return r; | 558 | return r; |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index 5ac713d2ff5d..dd30452df966 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1969,15 +1969,18 @@ static void ath_tx_txqaddbuf(struct ath_softc *sc, struct ath_txq *txq, | |||
1969 | static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, | 1969 | static void ath_tx_send_normal(struct ath_softc *sc, struct ath_txq *txq, |
1970 | struct ath_atx_tid *tid, struct sk_buff *skb) | 1970 | struct ath_atx_tid *tid, struct sk_buff *skb) |
1971 | { | 1971 | { |
1972 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | ||
1972 | struct ath_frame_info *fi = get_frame_info(skb); | 1973 | struct ath_frame_info *fi = get_frame_info(skb); |
1973 | struct list_head bf_head; | 1974 | struct list_head bf_head; |
1974 | struct ath_buf *bf; | 1975 | struct ath_buf *bf = fi->bf; |
1975 | |||
1976 | bf = fi->bf; | ||
1977 | 1976 | ||
1978 | INIT_LIST_HEAD(&bf_head); | 1977 | INIT_LIST_HEAD(&bf_head); |
1979 | list_add_tail(&bf->list, &bf_head); | 1978 | list_add_tail(&bf->list, &bf_head); |
1980 | bf->bf_state.bf_type = 0; | 1979 | bf->bf_state.bf_type = 0; |
1980 | if (tid && (tx_info->flags & IEEE80211_TX_CTL_AMPDU)) { | ||
1981 | bf->bf_state.bf_type = BUF_AMPDU; | ||
1982 | ath_tx_addto_baw(sc, tid, bf); | ||
1983 | } | ||
1981 | 1984 | ||
1982 | bf->bf_next = NULL; | 1985 | bf->bf_next = NULL; |
1983 | bf->bf_lastbf = bf; | 1986 | bf->bf_lastbf = bf; |
diff --git a/drivers/net/wireless/cw1200/cw1200_spi.c b/drivers/net/wireless/cw1200/cw1200_spi.c index 899cad34ccd3..755a0c8edfe1 100644 --- a/drivers/net/wireless/cw1200/cw1200_spi.c +++ b/drivers/net/wireless/cw1200/cw1200_spi.c | |||
@@ -237,7 +237,9 @@ static irqreturn_t cw1200_spi_irq_handler(int irq, void *dev_id) | |||
237 | struct hwbus_priv *self = dev_id; | 237 | struct hwbus_priv *self = dev_id; |
238 | 238 | ||
239 | if (self->core) { | 239 | if (self->core) { |
240 | cw1200_spi_lock(self); | ||
240 | cw1200_irq_handler(self->core); | 241 | cw1200_irq_handler(self->core); |
242 | cw1200_spi_unlock(self); | ||
241 | return IRQ_HANDLED; | 243 | return IRQ_HANDLED; |
242 | } else { | 244 | } else { |
243 | return IRQ_NONE; | 245 | return IRQ_NONE; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index 30d45e2fc193..8ac305be68f4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -240,6 +240,12 @@ const struct iwl_cfg iwl6035_2agn_cfg = { | |||
240 | .ht_params = &iwl6000_ht_params, | 240 | .ht_params = &iwl6000_ht_params, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | const struct iwl_cfg iwl6035_2agn_sff_cfg = { | ||
244 | .name = "Intel(R) Centrino(R) Ultimate-N 6235 AGN", | ||
245 | IWL_DEVICE_6035, | ||
246 | .ht_params = &iwl6000_ht_params, | ||
247 | }; | ||
248 | |||
243 | const struct iwl_cfg iwl1030_bgn_cfg = { | 249 | const struct iwl_cfg iwl1030_bgn_cfg = { |
244 | .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", | 250 | .name = "Intel(R) Centrino(R) Wireless-N 1030 BGN", |
245 | IWL_DEVICE_6030, | 251 | IWL_DEVICE_6030, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-config.h b/drivers/net/wireless/iwlwifi/iwl-config.h index e4d370bff306..b03c25e14903 100644 --- a/drivers/net/wireless/iwlwifi/iwl-config.h +++ b/drivers/net/wireless/iwlwifi/iwl-config.h | |||
@@ -280,6 +280,7 @@ extern const struct iwl_cfg iwl2000_2bgn_cfg; | |||
280 | extern const struct iwl_cfg iwl2000_2bgn_d_cfg; | 280 | extern const struct iwl_cfg iwl2000_2bgn_d_cfg; |
281 | extern const struct iwl_cfg iwl2030_2bgn_cfg; | 281 | extern const struct iwl_cfg iwl2030_2bgn_cfg; |
282 | extern const struct iwl_cfg iwl6035_2agn_cfg; | 282 | extern const struct iwl_cfg iwl6035_2agn_cfg; |
283 | extern const struct iwl_cfg iwl6035_2agn_sff_cfg; | ||
283 | extern const struct iwl_cfg iwl105_bgn_cfg; | 284 | extern const struct iwl_cfg iwl105_bgn_cfg; |
284 | extern const struct iwl_cfg iwl105_bgn_d_cfg; | 285 | extern const struct iwl_cfg iwl105_bgn_d_cfg; |
285 | extern const struct iwl_cfg iwl135_bgn_cfg; | 286 | extern const struct iwl_cfg iwl135_bgn_cfg; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index dd57a36ecb10..80b47508647c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -601,8 +601,10 @@ static inline int iwl_trans_send_cmd(struct iwl_trans *trans, | |||
601 | { | 601 | { |
602 | int ret; | 602 | int ret; |
603 | 603 | ||
604 | WARN_ONCE(trans->state != IWL_TRANS_FW_ALIVE, | 604 | if (trans->state != IWL_TRANS_FW_ALIVE) { |
605 | "%s bad state = %d", __func__, trans->state); | 605 | IWL_ERR(trans, "%s bad state = %d", __func__, trans->state); |
606 | return -EIO; | ||
607 | } | ||
606 | 608 | ||
607 | if (!(cmd->flags & CMD_ASYNC)) | 609 | if (!(cmd->flags & CMD_ASYNC)) |
608 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); | 610 | lock_map_acquire_read(&trans->sync_cmd_lockdep_map); |
diff --git a/drivers/net/wireless/iwlwifi/mvm/power.c b/drivers/net/wireless/iwlwifi/mvm/power.c index 21407a353a3b..d58e393324ef 100644 --- a/drivers/net/wireless/iwlwifi/mvm/power.c +++ b/drivers/net/wireless/iwlwifi/mvm/power.c | |||
@@ -273,7 +273,10 @@ static void iwl_mvm_power_build_cmd(struct iwl_mvm *mvm, | |||
273 | if (!mvmvif->queue_params[ac].uapsd) | 273 | if (!mvmvif->queue_params[ac].uapsd) |
274 | continue; | 274 | continue; |
275 | 275 | ||
276 | cmd->flags |= cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); | 276 | if (mvm->cur_ucode != IWL_UCODE_WOWLAN) |
277 | cmd->flags |= | ||
278 | cpu_to_le16(POWER_FLAGS_ADVANCE_PM_ENA_MSK); | ||
279 | |||
277 | cmd->uapsd_ac_flags |= BIT(ac); | 280 | cmd->uapsd_ac_flags |= BIT(ac); |
278 | 281 | ||
279 | /* QNDP TID - the highest TID with no admission control */ | 282 | /* QNDP TID - the highest TID with no admission control */ |
diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c index 9a7ab8495300..621fb71f282a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c | |||
@@ -394,6 +394,11 @@ static bool iwl_mvm_scan_abort_notif(struct iwl_notif_wait_data *notif_wait, | |||
394 | return false; | 394 | return false; |
395 | } | 395 | } |
396 | 396 | ||
397 | /* | ||
398 | * If scan cannot be aborted, it means that we had a | ||
399 | * SCAN_COMPLETE_NOTIFICATION in the pipe and it called | ||
400 | * ieee80211_scan_completed already. | ||
401 | */ | ||
397 | IWL_DEBUG_SCAN(mvm, "Scan cannot be aborted, exit now: %d\n", | 402 | IWL_DEBUG_SCAN(mvm, "Scan cannot be aborted, exit now: %d\n", |
398 | *resp); | 403 | *resp); |
399 | return true; | 404 | return true; |
@@ -417,14 +422,19 @@ void iwl_mvm_cancel_scan(struct iwl_mvm *mvm) | |||
417 | SCAN_COMPLETE_NOTIFICATION }; | 422 | SCAN_COMPLETE_NOTIFICATION }; |
418 | int ret; | 423 | int ret; |
419 | 424 | ||
425 | if (mvm->scan_status == IWL_MVM_SCAN_NONE) | ||
426 | return; | ||
427 | |||
420 | iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort, | 428 | iwl_init_notification_wait(&mvm->notif_wait, &wait_scan_abort, |
421 | scan_abort_notif, | 429 | scan_abort_notif, |
422 | ARRAY_SIZE(scan_abort_notif), | 430 | ARRAY_SIZE(scan_abort_notif), |
423 | iwl_mvm_scan_abort_notif, NULL); | 431 | iwl_mvm_scan_abort_notif, NULL); |
424 | 432 | ||
425 | ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, CMD_SYNC, 0, NULL); | 433 | ret = iwl_mvm_send_cmd_pdu(mvm, SCAN_ABORT_CMD, |
434 | CMD_SYNC | CMD_SEND_IN_RFKILL, 0, NULL); | ||
426 | if (ret) { | 435 | if (ret) { |
427 | IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret); | 436 | IWL_ERR(mvm, "Couldn't send SCAN_ABORT_CMD: %d\n", ret); |
437 | /* mac80211's state will be cleaned in the fw_restart flow */ | ||
428 | goto out_remove_notif; | 438 | goto out_remove_notif; |
429 | } | 439 | } |
430 | 440 | ||
diff --git a/drivers/net/wireless/iwlwifi/pcie/drv.c b/drivers/net/wireless/iwlwifi/pcie/drv.c index dc02cb9792af..26108a1a29fa 100644 --- a/drivers/net/wireless/iwlwifi/pcie/drv.c +++ b/drivers/net/wireless/iwlwifi/pcie/drv.c | |||
@@ -139,13 +139,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
139 | 139 | ||
140 | /* 6x00 Series */ | 140 | /* 6x00 Series */ |
141 | {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, | 141 | {IWL_PCI_DEVICE(0x422B, 0x1101, iwl6000_3agn_cfg)}, |
142 | {IWL_PCI_DEVICE(0x422B, 0x1108, iwl6000_3agn_cfg)}, | ||
142 | {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, | 143 | {IWL_PCI_DEVICE(0x422B, 0x1121, iwl6000_3agn_cfg)}, |
144 | {IWL_PCI_DEVICE(0x422B, 0x1128, iwl6000_3agn_cfg)}, | ||
143 | {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, | 145 | {IWL_PCI_DEVICE(0x422C, 0x1301, iwl6000i_2agn_cfg)}, |
144 | {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, | 146 | {IWL_PCI_DEVICE(0x422C, 0x1306, iwl6000i_2abg_cfg)}, |
145 | {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, | 147 | {IWL_PCI_DEVICE(0x422C, 0x1307, iwl6000i_2bg_cfg)}, |
146 | {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, | 148 | {IWL_PCI_DEVICE(0x422C, 0x1321, iwl6000i_2agn_cfg)}, |
147 | {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, | 149 | {IWL_PCI_DEVICE(0x422C, 0x1326, iwl6000i_2abg_cfg)}, |
148 | {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, | 150 | {IWL_PCI_DEVICE(0x4238, 0x1111, iwl6000_3agn_cfg)}, |
151 | {IWL_PCI_DEVICE(0x4238, 0x1118, iwl6000_3agn_cfg)}, | ||
149 | {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, | 152 | {IWL_PCI_DEVICE(0x4239, 0x1311, iwl6000i_2agn_cfg)}, |
150 | {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, | 153 | {IWL_PCI_DEVICE(0x4239, 0x1316, iwl6000i_2abg_cfg)}, |
151 | 154 | ||
@@ -153,12 +156,16 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
153 | {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, | 156 | {IWL_PCI_DEVICE(0x0082, 0x1301, iwl6005_2agn_cfg)}, |
154 | {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, | 157 | {IWL_PCI_DEVICE(0x0082, 0x1306, iwl6005_2abg_cfg)}, |
155 | {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, | 158 | {IWL_PCI_DEVICE(0x0082, 0x1307, iwl6005_2bg_cfg)}, |
159 | {IWL_PCI_DEVICE(0x0082, 0x1308, iwl6005_2agn_cfg)}, | ||
156 | {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, | 160 | {IWL_PCI_DEVICE(0x0082, 0x1321, iwl6005_2agn_cfg)}, |
157 | {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, | 161 | {IWL_PCI_DEVICE(0x0082, 0x1326, iwl6005_2abg_cfg)}, |
162 | {IWL_PCI_DEVICE(0x0082, 0x1328, iwl6005_2agn_cfg)}, | ||
158 | {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, | 163 | {IWL_PCI_DEVICE(0x0085, 0x1311, iwl6005_2agn_cfg)}, |
164 | {IWL_PCI_DEVICE(0x0085, 0x1318, iwl6005_2agn_cfg)}, | ||
159 | {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, | 165 | {IWL_PCI_DEVICE(0x0085, 0x1316, iwl6005_2abg_cfg)}, |
160 | {IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, | 166 | {IWL_PCI_DEVICE(0x0082, 0xC020, iwl6005_2agn_sff_cfg)}, |
161 | {IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, | 167 | {IWL_PCI_DEVICE(0x0085, 0xC220, iwl6005_2agn_sff_cfg)}, |
168 | {IWL_PCI_DEVICE(0x0085, 0xC228, iwl6005_2agn_sff_cfg)}, | ||
162 | {IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, | 169 | {IWL_PCI_DEVICE(0x0082, 0x4820, iwl6005_2agn_d_cfg)}, |
163 | {IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ | 170 | {IWL_PCI_DEVICE(0x0082, 0x1304, iwl6005_2agn_mow1_cfg)},/* low 5GHz active */ |
164 | {IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ | 171 | {IWL_PCI_DEVICE(0x0082, 0x1305, iwl6005_2agn_mow2_cfg)},/* high 5GHz active */ |
@@ -240,8 +247,11 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
240 | 247 | ||
241 | /* 6x35 Series */ | 248 | /* 6x35 Series */ |
242 | {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, | 249 | {IWL_PCI_DEVICE(0x088E, 0x4060, iwl6035_2agn_cfg)}, |
250 | {IWL_PCI_DEVICE(0x088E, 0x406A, iwl6035_2agn_sff_cfg)}, | ||
243 | {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, | 251 | {IWL_PCI_DEVICE(0x088F, 0x4260, iwl6035_2agn_cfg)}, |
252 | {IWL_PCI_DEVICE(0x088F, 0x426A, iwl6035_2agn_sff_cfg)}, | ||
244 | {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, | 253 | {IWL_PCI_DEVICE(0x088E, 0x4460, iwl6035_2agn_cfg)}, |
254 | {IWL_PCI_DEVICE(0x088E, 0x446A, iwl6035_2agn_sff_cfg)}, | ||
245 | {IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, | 255 | {IWL_PCI_DEVICE(0x088E, 0x4860, iwl6035_2agn_cfg)}, |
246 | {IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, | 256 | {IWL_PCI_DEVICE(0x088F, 0x5260, iwl6035_2agn_cfg)}, |
247 | 257 | ||
@@ -260,54 +270,86 @@ static DEFINE_PCI_DEVICE_TABLE(iwl_hw_card_ids) = { | |||
260 | #if IS_ENABLED(CONFIG_IWLMVM) | 270 | #if IS_ENABLED(CONFIG_IWLMVM) |
261 | /* 7000 Series */ | 271 | /* 7000 Series */ |
262 | {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, | 272 | {IWL_PCI_DEVICE(0x08B1, 0x4070, iwl7260_2ac_cfg)}, |
273 | {IWL_PCI_DEVICE(0x08B1, 0x4072, iwl7260_2ac_cfg)}, | ||
263 | {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)}, | 274 | {IWL_PCI_DEVICE(0x08B1, 0x4170, iwl7260_2ac_cfg)}, |
264 | {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)}, | 275 | {IWL_PCI_DEVICE(0x08B1, 0x4060, iwl7260_2n_cfg)}, |
276 | {IWL_PCI_DEVICE(0x08B1, 0x406A, iwl7260_2n_cfg)}, | ||
265 | {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)}, | 277 | {IWL_PCI_DEVICE(0x08B1, 0x4160, iwl7260_2n_cfg)}, |
266 | {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)}, | 278 | {IWL_PCI_DEVICE(0x08B1, 0x4062, iwl7260_n_cfg)}, |
267 | {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)}, | 279 | {IWL_PCI_DEVICE(0x08B1, 0x4162, iwl7260_n_cfg)}, |
268 | {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)}, | 280 | {IWL_PCI_DEVICE(0x08B2, 0x4270, iwl7260_2ac_cfg)}, |
281 | {IWL_PCI_DEVICE(0x08B2, 0x4272, iwl7260_2ac_cfg)}, | ||
269 | {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)}, | 282 | {IWL_PCI_DEVICE(0x08B2, 0x4260, iwl7260_2n_cfg)}, |
283 | {IWL_PCI_DEVICE(0x08B2, 0x426A, iwl7260_2n_cfg)}, | ||
270 | {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)}, | 284 | {IWL_PCI_DEVICE(0x08B2, 0x4262, iwl7260_n_cfg)}, |
271 | {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)}, | 285 | {IWL_PCI_DEVICE(0x08B1, 0x4470, iwl7260_2ac_cfg)}, |
286 | {IWL_PCI_DEVICE(0x08B1, 0x4472, iwl7260_2ac_cfg)}, | ||
272 | {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)}, | 287 | {IWL_PCI_DEVICE(0x08B1, 0x4460, iwl7260_2n_cfg)}, |
288 | {IWL_PCI_DEVICE(0x08B1, 0x446A, iwl7260_2n_cfg)}, | ||
273 | {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)}, | 289 | {IWL_PCI_DEVICE(0x08B1, 0x4462, iwl7260_n_cfg)}, |
274 | {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)}, | 290 | {IWL_PCI_DEVICE(0x08B1, 0x4870, iwl7260_2ac_cfg)}, |
275 | {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)}, | 291 | {IWL_PCI_DEVICE(0x08B1, 0x486E, iwl7260_2ac_cfg)}, |
276 | {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)}, | 292 | {IWL_PCI_DEVICE(0x08B1, 0x4A70, iwl7260_2ac_cfg_high_temp)}, |
277 | {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)}, | 293 | {IWL_PCI_DEVICE(0x08B1, 0x4A6E, iwl7260_2ac_cfg_high_temp)}, |
278 | {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)}, | 294 | {IWL_PCI_DEVICE(0x08B1, 0x4A6C, iwl7260_2ac_cfg_high_temp)}, |
295 | {IWL_PCI_DEVICE(0x08B1, 0x4570, iwl7260_2ac_cfg)}, | ||
296 | {IWL_PCI_DEVICE(0x08B1, 0x4560, iwl7260_2n_cfg)}, | ||
297 | {IWL_PCI_DEVICE(0x08B2, 0x4370, iwl7260_2ac_cfg)}, | ||
298 | {IWL_PCI_DEVICE(0x08B2, 0x4360, iwl7260_2n_cfg)}, | ||
299 | {IWL_PCI_DEVICE(0x08B1, 0x5070, iwl7260_2ac_cfg)}, | ||
279 | {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)}, | 300 | {IWL_PCI_DEVICE(0x08B1, 0x4020, iwl7260_2n_cfg)}, |
301 | {IWL_PCI_DEVICE(0x08B1, 0x402A, iwl7260_2n_cfg)}, | ||
280 | {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)}, | 302 | {IWL_PCI_DEVICE(0x08B2, 0x4220, iwl7260_2n_cfg)}, |
281 | {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)}, | 303 | {IWL_PCI_DEVICE(0x08B1, 0x4420, iwl7260_2n_cfg)}, |
282 | {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, | 304 | {IWL_PCI_DEVICE(0x08B1, 0xC070, iwl7260_2ac_cfg)}, |
305 | {IWL_PCI_DEVICE(0x08B1, 0xC072, iwl7260_2ac_cfg)}, | ||
283 | {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)}, | 306 | {IWL_PCI_DEVICE(0x08B1, 0xC170, iwl7260_2ac_cfg)}, |
284 | {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)}, | 307 | {IWL_PCI_DEVICE(0x08B1, 0xC060, iwl7260_2n_cfg)}, |
308 | {IWL_PCI_DEVICE(0x08B1, 0xC06A, iwl7260_2n_cfg)}, | ||
285 | {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)}, | 309 | {IWL_PCI_DEVICE(0x08B1, 0xC160, iwl7260_2n_cfg)}, |
286 | {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)}, | 310 | {IWL_PCI_DEVICE(0x08B1, 0xC062, iwl7260_n_cfg)}, |
287 | {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)}, | 311 | {IWL_PCI_DEVICE(0x08B1, 0xC162, iwl7260_n_cfg)}, |
312 | {IWL_PCI_DEVICE(0x08B1, 0xC770, iwl7260_2ac_cfg)}, | ||
313 | {IWL_PCI_DEVICE(0x08B1, 0xC760, iwl7260_2n_cfg)}, | ||
288 | {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)}, | 314 | {IWL_PCI_DEVICE(0x08B2, 0xC270, iwl7260_2ac_cfg)}, |
315 | {IWL_PCI_DEVICE(0x08B2, 0xC272, iwl7260_2ac_cfg)}, | ||
289 | {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)}, | 316 | {IWL_PCI_DEVICE(0x08B2, 0xC260, iwl7260_2n_cfg)}, |
317 | {IWL_PCI_DEVICE(0x08B2, 0xC26A, iwl7260_n_cfg)}, | ||
290 | {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)}, | 318 | {IWL_PCI_DEVICE(0x08B2, 0xC262, iwl7260_n_cfg)}, |
291 | {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)}, | 319 | {IWL_PCI_DEVICE(0x08B1, 0xC470, iwl7260_2ac_cfg)}, |
320 | {IWL_PCI_DEVICE(0x08B1, 0xC472, iwl7260_2ac_cfg)}, | ||
292 | {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)}, | 321 | {IWL_PCI_DEVICE(0x08B1, 0xC460, iwl7260_2n_cfg)}, |
293 | {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)}, | 322 | {IWL_PCI_DEVICE(0x08B1, 0xC462, iwl7260_n_cfg)}, |
323 | {IWL_PCI_DEVICE(0x08B1, 0xC570, iwl7260_2ac_cfg)}, | ||
324 | {IWL_PCI_DEVICE(0x08B1, 0xC560, iwl7260_2n_cfg)}, | ||
325 | {IWL_PCI_DEVICE(0x08B2, 0xC370, iwl7260_2ac_cfg)}, | ||
326 | {IWL_PCI_DEVICE(0x08B1, 0xC360, iwl7260_2n_cfg)}, | ||
294 | {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)}, | 327 | {IWL_PCI_DEVICE(0x08B1, 0xC020, iwl7260_2n_cfg)}, |
328 | {IWL_PCI_DEVICE(0x08B1, 0xC02A, iwl7260_2n_cfg)}, | ||
295 | {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)}, | 329 | {IWL_PCI_DEVICE(0x08B2, 0xC220, iwl7260_2n_cfg)}, |
296 | {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)}, | 330 | {IWL_PCI_DEVICE(0x08B1, 0xC420, iwl7260_2n_cfg)}, |
297 | 331 | ||
298 | /* 3160 Series */ | 332 | /* 3160 Series */ |
299 | {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)}, | 333 | {IWL_PCI_DEVICE(0x08B3, 0x0070, iwl3160_2ac_cfg)}, |
334 | {IWL_PCI_DEVICE(0x08B3, 0x0072, iwl3160_2ac_cfg)}, | ||
300 | {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)}, | 335 | {IWL_PCI_DEVICE(0x08B3, 0x0170, iwl3160_2ac_cfg)}, |
336 | {IWL_PCI_DEVICE(0x08B3, 0x0172, iwl3160_2ac_cfg)}, | ||
301 | {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)}, | 337 | {IWL_PCI_DEVICE(0x08B3, 0x0060, iwl3160_2n_cfg)}, |
302 | {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)}, | 338 | {IWL_PCI_DEVICE(0x08B3, 0x0062, iwl3160_n_cfg)}, |
303 | {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)}, | 339 | {IWL_PCI_DEVICE(0x08B4, 0x0270, iwl3160_2ac_cfg)}, |
340 | {IWL_PCI_DEVICE(0x08B4, 0x0272, iwl3160_2ac_cfg)}, | ||
304 | {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)}, | 341 | {IWL_PCI_DEVICE(0x08B3, 0x0470, iwl3160_2ac_cfg)}, |
342 | {IWL_PCI_DEVICE(0x08B3, 0x0472, iwl3160_2ac_cfg)}, | ||
343 | {IWL_PCI_DEVICE(0x08B4, 0x0370, iwl3160_2ac_cfg)}, | ||
305 | {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)}, | 344 | {IWL_PCI_DEVICE(0x08B3, 0x8070, iwl3160_2ac_cfg)}, |
345 | {IWL_PCI_DEVICE(0x08B3, 0x8072, iwl3160_2ac_cfg)}, | ||
306 | {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)}, | 346 | {IWL_PCI_DEVICE(0x08B3, 0x8170, iwl3160_2ac_cfg)}, |
347 | {IWL_PCI_DEVICE(0x08B3, 0x8172, iwl3160_2ac_cfg)}, | ||
307 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, | 348 | {IWL_PCI_DEVICE(0x08B3, 0x8060, iwl3160_2n_cfg)}, |
308 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, | 349 | {IWL_PCI_DEVICE(0x08B3, 0x8062, iwl3160_n_cfg)}, |
309 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, | 350 | {IWL_PCI_DEVICE(0x08B4, 0x8270, iwl3160_2ac_cfg)}, |
310 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, | 351 | {IWL_PCI_DEVICE(0x08B3, 0x8470, iwl3160_2ac_cfg)}, |
352 | {IWL_PCI_DEVICE(0x08B3, 0x8570, iwl3160_2ac_cfg)}, | ||
311 | #endif /* CONFIG_IWLMVM */ | 353 | #endif /* CONFIG_IWLMVM */ |
312 | 354 | ||
313 | {0} | 355 | {0} |
diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c index bad95d28d50d..c3f904d422b0 100644 --- a/drivers/net/wireless/iwlwifi/pcie/trans.c +++ b/drivers/net/wireless/iwlwifi/pcie/trans.c | |||
@@ -1401,6 +1401,10 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
1401 | spin_lock_init(&trans_pcie->reg_lock); | 1401 | spin_lock_init(&trans_pcie->reg_lock); |
1402 | init_waitqueue_head(&trans_pcie->ucode_write_waitq); | 1402 | init_waitqueue_head(&trans_pcie->ucode_write_waitq); |
1403 | 1403 | ||
1404 | err = pci_enable_device(pdev); | ||
1405 | if (err) | ||
1406 | goto out_no_pci; | ||
1407 | |||
1404 | if (!cfg->base_params->pcie_l1_allowed) { | 1408 | if (!cfg->base_params->pcie_l1_allowed) { |
1405 | /* | 1409 | /* |
1406 | * W/A - seems to solve weird behavior. We need to remove this | 1410 | * W/A - seems to solve weird behavior. We need to remove this |
@@ -1412,10 +1416,6 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, | |||
1412 | PCIE_LINK_STATE_CLKPM); | 1416 | PCIE_LINK_STATE_CLKPM); |
1413 | } | 1417 | } |
1414 | 1418 | ||
1415 | err = pci_enable_device(pdev); | ||
1416 | if (err) | ||
1417 | goto out_no_pci; | ||
1418 | |||
1419 | pci_set_master(pdev); | 1419 | pci_set_master(pdev); |
1420 | 1420 | ||
1421 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36)); | 1421 | err = pci_set_dma_mask(pdev, DMA_BIT_MASK(36)); |
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index f45eb29c2ede..1424335163b9 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c | |||
@@ -1102,6 +1102,8 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo, | |||
1102 | * non-AGG queue. | 1102 | * non-AGG queue. |
1103 | */ | 1103 | */ |
1104 | iwl_clear_bits_prph(trans, SCD_AGGR_SEL, BIT(txq_id)); | 1104 | iwl_clear_bits_prph(trans, SCD_AGGR_SEL, BIT(txq_id)); |
1105 | |||
1106 | ssn = trans_pcie->txq[txq_id].q.read_ptr; | ||
1105 | } | 1107 | } |
1106 | 1108 | ||
1107 | /* Place first TFD at index corresponding to start sequence number. | 1109 | /* Place first TFD at index corresponding to start sequence number. |
diff --git a/drivers/net/wireless/mwifiex/join.c b/drivers/net/wireless/mwifiex/join.c index 9d7c0e6c4fc7..37f873bb342f 100644 --- a/drivers/net/wireless/mwifiex/join.c +++ b/drivers/net/wireless/mwifiex/join.c | |||
@@ -1422,13 +1422,19 @@ static int mwifiex_deauthenticate_infra(struct mwifiex_private *priv, u8 *mac) | |||
1422 | */ | 1422 | */ |
1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | 1423 | int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) |
1424 | { | 1424 | { |
1425 | int ret = 0; | ||
1426 | |||
1425 | if (!priv->media_connected) | 1427 | if (!priv->media_connected) |
1426 | return 0; | 1428 | return 0; |
1427 | 1429 | ||
1428 | switch (priv->bss_mode) { | 1430 | switch (priv->bss_mode) { |
1429 | case NL80211_IFTYPE_STATION: | 1431 | case NL80211_IFTYPE_STATION: |
1430 | case NL80211_IFTYPE_P2P_CLIENT: | 1432 | case NL80211_IFTYPE_P2P_CLIENT: |
1431 | return mwifiex_deauthenticate_infra(priv, mac); | 1433 | ret = mwifiex_deauthenticate_infra(priv, mac); |
1434 | if (ret) | ||
1435 | cfg80211_disconnected(priv->netdev, 0, NULL, 0, | ||
1436 | GFP_KERNEL); | ||
1437 | break; | ||
1432 | case NL80211_IFTYPE_ADHOC: | 1438 | case NL80211_IFTYPE_ADHOC: |
1433 | return mwifiex_send_cmd_sync(priv, | 1439 | return mwifiex_send_cmd_sync(priv, |
1434 | HostCmd_CMD_802_11_AD_HOC_STOP, | 1440 | HostCmd_CMD_802_11_AD_HOC_STOP, |
@@ -1440,7 +1446,7 @@ int mwifiex_deauthenticate(struct mwifiex_private *priv, u8 *mac) | |||
1440 | break; | 1446 | break; |
1441 | } | 1447 | } |
1442 | 1448 | ||
1443 | return 0; | 1449 | return ret; |
1444 | } | 1450 | } |
1445 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); | 1451 | EXPORT_SYMBOL_GPL(mwifiex_deauthenticate); |
1446 | 1452 | ||
diff --git a/drivers/net/wireless/mwifiex/main.c b/drivers/net/wireless/mwifiex/main.c index fd778337deee..c2b91f566e05 100644 --- a/drivers/net/wireless/mwifiex/main.c +++ b/drivers/net/wireless/mwifiex/main.c | |||
@@ -358,10 +358,12 @@ process_start: | |||
358 | } | 358 | } |
359 | } while (true); | 359 | } while (true); |
360 | 360 | ||
361 | if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) | 361 | spin_lock_irqsave(&adapter->main_proc_lock, flags); |
362 | if ((adapter->int_status) || IS_CARD_RX_RCVD(adapter)) { | ||
363 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | ||
362 | goto process_start; | 364 | goto process_start; |
365 | } | ||
363 | 366 | ||
364 | spin_lock_irqsave(&adapter->main_proc_lock, flags); | ||
365 | adapter->mwifiex_processing = false; | 367 | adapter->mwifiex_processing = false; |
366 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); | 368 | spin_unlock_irqrestore(&adapter->main_proc_lock, flags); |
367 | 369 | ||
diff --git a/drivers/net/wireless/mwifiex/sta_event.c b/drivers/net/wireless/mwifiex/sta_event.c index 8b057524b252..8c351f71f72f 100644 --- a/drivers/net/wireless/mwifiex/sta_event.c +++ b/drivers/net/wireless/mwifiex/sta_event.c | |||
@@ -118,7 +118,8 @@ mwifiex_reset_connect_state(struct mwifiex_private *priv, u16 reason_code) | |||
118 | dev_dbg(adapter->dev, | 118 | dev_dbg(adapter->dev, |
119 | "info: successfully disconnected from %pM: reason code %d\n", | 119 | "info: successfully disconnected from %pM: reason code %d\n", |
120 | priv->cfg_bssid, reason_code); | 120 | priv->cfg_bssid, reason_code); |
121 | if (priv->bss_mode == NL80211_IFTYPE_STATION) { | 121 | if (priv->bss_mode == NL80211_IFTYPE_STATION || |
122 | priv->bss_mode == NL80211_IFTYPE_P2P_CLIENT) { | ||
122 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, | 123 | cfg80211_disconnected(priv->netdev, reason_code, NULL, 0, |
123 | GFP_KERNEL); | 124 | GFP_KERNEL); |
124 | } | 125 | } |
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c index 76d95deb274b..dc49e525ae5e 100644 --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c | |||
@@ -105,13 +105,11 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct rt2x00_ops *ops) | |||
105 | goto exit_release_regions; | 105 | goto exit_release_regions; |
106 | } | 106 | } |
107 | 107 | ||
108 | pci_enable_msi(pci_dev); | ||
109 | |||
110 | hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw); | 108 | hw = ieee80211_alloc_hw(sizeof(struct rt2x00_dev), ops->hw); |
111 | if (!hw) { | 109 | if (!hw) { |
112 | rt2x00_probe_err("Failed to allocate hardware\n"); | 110 | rt2x00_probe_err("Failed to allocate hardware\n"); |
113 | retval = -ENOMEM; | 111 | retval = -ENOMEM; |
114 | goto exit_disable_msi; | 112 | goto exit_release_regions; |
115 | } | 113 | } |
116 | 114 | ||
117 | pci_set_drvdata(pci_dev, hw); | 115 | pci_set_drvdata(pci_dev, hw); |
@@ -152,9 +150,6 @@ exit_free_reg: | |||
152 | exit_free_device: | 150 | exit_free_device: |
153 | ieee80211_free_hw(hw); | 151 | ieee80211_free_hw(hw); |
154 | 152 | ||
155 | exit_disable_msi: | ||
156 | pci_disable_msi(pci_dev); | ||
157 | |||
158 | exit_release_regions: | 153 | exit_release_regions: |
159 | pci_release_regions(pci_dev); | 154 | pci_release_regions(pci_dev); |
160 | 155 | ||
@@ -179,8 +174,6 @@ void rt2x00pci_remove(struct pci_dev *pci_dev) | |||
179 | rt2x00pci_free_reg(rt2x00dev); | 174 | rt2x00pci_free_reg(rt2x00dev); |
180 | ieee80211_free_hw(hw); | 175 | ieee80211_free_hw(hw); |
181 | 176 | ||
182 | pci_disable_msi(pci_dev); | ||
183 | |||
184 | /* | 177 | /* |
185 | * Free the PCI device data. | 178 | * Free the PCI device data. |
186 | */ | 179 | */ |
diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c index 763cf1defab5..5a060e537fbe 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c | |||
@@ -343,7 +343,8 @@ bool rtl92cu_rx_query_desc(struct ieee80211_hw *hw, | |||
343 | (bool)GET_RX_DESC_PAGGR(pdesc)); | 343 | (bool)GET_RX_DESC_PAGGR(pdesc)); |
344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); | 344 | rx_status->mactime = GET_RX_DESC_TSFL(pdesc); |
345 | if (phystatus) { | 345 | if (phystatus) { |
346 | p_drvinfo = (struct rx_fwinfo_92c *)(pdesc + RTL_RX_DESC_SIZE); | 346 | p_drvinfo = (struct rx_fwinfo_92c *)(skb->data + |
347 | stats->rx_bufshift); | ||
347 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, | 348 | rtl92c_translate_rx_signal_stuff(hw, skb, stats, pdesc, |
348 | p_drvinfo); | 349 | p_drvinfo); |
349 | } | 350 | } |
diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c index b45bce20ad76..1b08d8798372 100644 --- a/drivers/net/xen-netback/xenbus.c +++ b/drivers/net/xen-netback/xenbus.c | |||
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *); | |||
39 | static void connect(struct backend_info *); | 39 | static void connect(struct backend_info *); |
40 | static void backend_create_xenvif(struct backend_info *be); | 40 | static void backend_create_xenvif(struct backend_info *be); |
41 | static void unregister_hotplug_status_watch(struct backend_info *be); | 41 | static void unregister_hotplug_status_watch(struct backend_info *be); |
42 | static void set_backend_state(struct backend_info *be, | ||
43 | enum xenbus_state state); | ||
42 | 44 | ||
43 | static int netback_remove(struct xenbus_device *dev) | 45 | static int netback_remove(struct xenbus_device *dev) |
44 | { | 46 | { |
45 | struct backend_info *be = dev_get_drvdata(&dev->dev); | 47 | struct backend_info *be = dev_get_drvdata(&dev->dev); |
46 | 48 | ||
49 | set_backend_state(be, XenbusStateClosed); | ||
50 | |||
47 | unregister_hotplug_status_watch(be); | 51 | unregister_hotplug_status_watch(be); |
48 | if (be->vif) { | 52 | if (be->vif) { |
49 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); | 53 | kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); |
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig index 96d6b2eef4f2..b51a7460cc49 100644 --- a/drivers/platform/x86/Kconfig +++ b/drivers/platform/x86/Kconfig | |||
@@ -504,6 +504,7 @@ config ASUS_WMI | |||
504 | depends on BACKLIGHT_CLASS_DEVICE | 504 | depends on BACKLIGHT_CLASS_DEVICE |
505 | depends on RFKILL || RFKILL = n | 505 | depends on RFKILL || RFKILL = n |
506 | depends on HOTPLUG_PCI | 506 | depends on HOTPLUG_PCI |
507 | depends on ACPI_VIDEO || ACPI_VIDEO = n | ||
507 | select INPUT_SPARSEKMAP | 508 | select INPUT_SPARSEKMAP |
508 | select LEDS_CLASS | 509 | select LEDS_CLASS |
509 | select NEW_LEDS | 510 | select NEW_LEDS |
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index d3fd52036fd6..13ec195f0ca6 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c | |||
@@ -127,18 +127,17 @@ MODULE_PARM_DESC(minor, | |||
127 | "default is -1 (automatic)"); | 127 | "default is -1 (automatic)"); |
128 | #endif | 128 | #endif |
129 | 129 | ||
130 | static int kbd_backlight = 1; | 130 | static int kbd_backlight = -1; |
131 | module_param(kbd_backlight, int, 0444); | 131 | module_param(kbd_backlight, int, 0444); |
132 | MODULE_PARM_DESC(kbd_backlight, | 132 | MODULE_PARM_DESC(kbd_backlight, |
133 | "set this to 0 to disable keyboard backlight, " | 133 | "set this to 0 to disable keyboard backlight, " |
134 | "1 to enable it (default: 0)"); | 134 | "1 to enable it (default: no change from current value)"); |
135 | 135 | ||
136 | static int kbd_backlight_timeout; /* = 0 */ | 136 | static int kbd_backlight_timeout = -1; |
137 | module_param(kbd_backlight_timeout, int, 0444); | 137 | module_param(kbd_backlight_timeout, int, 0444); |
138 | MODULE_PARM_DESC(kbd_backlight_timeout, | 138 | MODULE_PARM_DESC(kbd_backlight_timeout, |
139 | "set this to 0 to set the default 10 seconds timeout, " | 139 | "meaningful values vary from 0 to 3 and their meaning depends " |
140 | "1 for 30 seconds, 2 for 60 seconds and 3 to disable timeout " | 140 | "on the model (default: no change from current value)"); |
141 | "(default: 0)"); | ||
142 | 141 | ||
143 | #ifdef CONFIG_PM_SLEEP | 142 | #ifdef CONFIG_PM_SLEEP |
144 | static void sony_nc_kbd_backlight_resume(void); | 143 | static void sony_nc_kbd_backlight_resume(void); |
@@ -1844,6 +1843,8 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, | |||
1844 | if (!kbdbl_ctl) | 1843 | if (!kbdbl_ctl) |
1845 | return -ENOMEM; | 1844 | return -ENOMEM; |
1846 | 1845 | ||
1846 | kbdbl_ctl->mode = kbd_backlight; | ||
1847 | kbdbl_ctl->timeout = kbd_backlight_timeout; | ||
1847 | kbdbl_ctl->handle = handle; | 1848 | kbdbl_ctl->handle = handle; |
1848 | if (handle == 0x0137) | 1849 | if (handle == 0x0137) |
1849 | kbdbl_ctl->base = 0x0C00; | 1850 | kbdbl_ctl->base = 0x0C00; |
@@ -1870,8 +1871,8 @@ static int sony_nc_kbd_backlight_setup(struct platform_device *pd, | |||
1870 | if (ret) | 1871 | if (ret) |
1871 | goto outmode; | 1872 | goto outmode; |
1872 | 1873 | ||
1873 | __sony_nc_kbd_backlight_mode_set(kbd_backlight); | 1874 | __sony_nc_kbd_backlight_mode_set(kbdbl_ctl->mode); |
1874 | __sony_nc_kbd_backlight_timeout_set(kbd_backlight_timeout); | 1875 | __sony_nc_kbd_backlight_timeout_set(kbdbl_ctl->timeout); |
1875 | 1876 | ||
1876 | return 0; | 1877 | return 0; |
1877 | 1878 | ||
@@ -1886,17 +1887,8 @@ outkzalloc: | |||
1886 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) | 1887 | static void sony_nc_kbd_backlight_cleanup(struct platform_device *pd) |
1887 | { | 1888 | { |
1888 | if (kbdbl_ctl) { | 1889 | if (kbdbl_ctl) { |
1889 | int result; | ||
1890 | |||
1891 | device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr); | 1890 | device_remove_file(&pd->dev, &kbdbl_ctl->mode_attr); |
1892 | device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr); | 1891 | device_remove_file(&pd->dev, &kbdbl_ctl->timeout_attr); |
1893 | |||
1894 | /* restore the default hw behaviour */ | ||
1895 | sony_call_snc_handle(kbdbl_ctl->handle, | ||
1896 | kbdbl_ctl->base | 0x10000, &result); | ||
1897 | sony_call_snc_handle(kbdbl_ctl->handle, | ||
1898 | kbdbl_ctl->base + 0x200, &result); | ||
1899 | |||
1900 | kfree(kbdbl_ctl); | 1892 | kfree(kbdbl_ctl); |
1901 | kbdbl_ctl = NULL; | 1893 | kbdbl_ctl = NULL; |
1902 | } | 1894 | } |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 5adb2042e824..cee7e2708a1f 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -2077,6 +2077,7 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2077 | int intensity = 0; | 2077 | int intensity = 0; |
2078 | int r0_perm; | 2078 | int r0_perm; |
2079 | int nr_tracks; | 2079 | int nr_tracks; |
2080 | int use_prefix; | ||
2080 | 2081 | ||
2081 | startdev = dasd_alias_get_start_dev(base); | 2082 | startdev = dasd_alias_get_start_dev(base); |
2082 | if (!startdev) | 2083 | if (!startdev) |
@@ -2106,28 +2107,46 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2106 | intensity = fdata->intensity; | 2107 | intensity = fdata->intensity; |
2107 | } | 2108 | } |
2108 | 2109 | ||
2110 | use_prefix = base_priv->features.feature[8] & 0x01; | ||
2111 | |||
2109 | switch (intensity) { | 2112 | switch (intensity) { |
2110 | case 0x00: /* Normal format */ | 2113 | case 0x00: /* Normal format */ |
2111 | case 0x08: /* Normal format, use cdl. */ | 2114 | case 0x08: /* Normal format, use cdl. */ |
2112 | cplength = 2 + (rpt*nr_tracks); | 2115 | cplength = 2 + (rpt*nr_tracks); |
2113 | datasize = sizeof(struct PFX_eckd_data) + | 2116 | if (use_prefix) |
2114 | sizeof(struct LO_eckd_data) + | 2117 | datasize = sizeof(struct PFX_eckd_data) + |
2115 | rpt * nr_tracks * sizeof(struct eckd_count); | 2118 | sizeof(struct LO_eckd_data) + |
2119 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2120 | else | ||
2121 | datasize = sizeof(struct DE_eckd_data) + | ||
2122 | sizeof(struct LO_eckd_data) + | ||
2123 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2116 | break; | 2124 | break; |
2117 | case 0x01: /* Write record zero and format track. */ | 2125 | case 0x01: /* Write record zero and format track. */ |
2118 | case 0x09: /* Write record zero and format track, use cdl. */ | 2126 | case 0x09: /* Write record zero and format track, use cdl. */ |
2119 | cplength = 2 + rpt * nr_tracks; | 2127 | cplength = 2 + rpt * nr_tracks; |
2120 | datasize = sizeof(struct PFX_eckd_data) + | 2128 | if (use_prefix) |
2121 | sizeof(struct LO_eckd_data) + | 2129 | datasize = sizeof(struct PFX_eckd_data) + |
2122 | sizeof(struct eckd_count) + | 2130 | sizeof(struct LO_eckd_data) + |
2123 | rpt * nr_tracks * sizeof(struct eckd_count); | 2131 | sizeof(struct eckd_count) + |
2132 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2133 | else | ||
2134 | datasize = sizeof(struct DE_eckd_data) + | ||
2135 | sizeof(struct LO_eckd_data) + | ||
2136 | sizeof(struct eckd_count) + | ||
2137 | rpt * nr_tracks * sizeof(struct eckd_count); | ||
2124 | break; | 2138 | break; |
2125 | case 0x04: /* Invalidate track. */ | 2139 | case 0x04: /* Invalidate track. */ |
2126 | case 0x0c: /* Invalidate track, use cdl. */ | 2140 | case 0x0c: /* Invalidate track, use cdl. */ |
2127 | cplength = 3; | 2141 | cplength = 3; |
2128 | datasize = sizeof(struct PFX_eckd_data) + | 2142 | if (use_prefix) |
2129 | sizeof(struct LO_eckd_data) + | 2143 | datasize = sizeof(struct PFX_eckd_data) + |
2130 | sizeof(struct eckd_count); | 2144 | sizeof(struct LO_eckd_data) + |
2145 | sizeof(struct eckd_count); | ||
2146 | else | ||
2147 | datasize = sizeof(struct DE_eckd_data) + | ||
2148 | sizeof(struct LO_eckd_data) + | ||
2149 | sizeof(struct eckd_count); | ||
2131 | break; | 2150 | break; |
2132 | default: | 2151 | default: |
2133 | dev_warn(&startdev->cdev->dev, | 2152 | dev_warn(&startdev->cdev->dev, |
@@ -2147,14 +2166,25 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2147 | 2166 | ||
2148 | switch (intensity & ~0x08) { | 2167 | switch (intensity & ~0x08) { |
2149 | case 0x00: /* Normal format. */ | 2168 | case 0x00: /* Normal format. */ |
2150 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2169 | if (use_prefix) { |
2151 | fdata->start_unit, fdata->stop_unit, | 2170 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2152 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); | 2171 | fdata->start_unit, fdata->stop_unit, |
2153 | /* grant subsystem permission to format R0 */ | 2172 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); |
2154 | if (r0_perm) | 2173 | /* grant subsystem permission to format R0 */ |
2155 | ((struct PFX_eckd_data *)data) | 2174 | if (r0_perm) |
2156 | ->define_extent.ga_extended |= 0x04; | 2175 | ((struct PFX_eckd_data *)data) |
2157 | data += sizeof(struct PFX_eckd_data); | 2176 | ->define_extent.ga_extended |= 0x04; |
2177 | data += sizeof(struct PFX_eckd_data); | ||
2178 | } else { | ||
2179 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2180 | fdata->start_unit, fdata->stop_unit, | ||
2181 | DASD_ECKD_CCW_WRITE_CKD, startdev); | ||
2182 | /* grant subsystem permission to format R0 */ | ||
2183 | if (r0_perm) | ||
2184 | ((struct DE_eckd_data *) data) | ||
2185 | ->ga_extended |= 0x04; | ||
2186 | data += sizeof(struct DE_eckd_data); | ||
2187 | } | ||
2158 | ccw[-1].flags |= CCW_FLAG_CC; | 2188 | ccw[-1].flags |= CCW_FLAG_CC; |
2159 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2189 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2160 | fdata->start_unit, 0, rpt*nr_tracks, | 2190 | fdata->start_unit, 0, rpt*nr_tracks, |
@@ -2163,11 +2193,18 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2163 | data += sizeof(struct LO_eckd_data); | 2193 | data += sizeof(struct LO_eckd_data); |
2164 | break; | 2194 | break; |
2165 | case 0x01: /* Write record zero + format track. */ | 2195 | case 0x01: /* Write record zero + format track. */ |
2166 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2196 | if (use_prefix) { |
2167 | fdata->start_unit, fdata->stop_unit, | 2197 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2168 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, | 2198 | fdata->start_unit, fdata->stop_unit, |
2169 | base, startdev); | 2199 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, |
2170 | data += sizeof(struct PFX_eckd_data); | 2200 | base, startdev); |
2201 | data += sizeof(struct PFX_eckd_data); | ||
2202 | } else { | ||
2203 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2204 | fdata->start_unit, fdata->stop_unit, | ||
2205 | DASD_ECKD_CCW_WRITE_RECORD_ZERO, startdev); | ||
2206 | data += sizeof(struct DE_eckd_data); | ||
2207 | } | ||
2171 | ccw[-1].flags |= CCW_FLAG_CC; | 2208 | ccw[-1].flags |= CCW_FLAG_CC; |
2172 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2209 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2173 | fdata->start_unit, 0, rpt * nr_tracks + 1, | 2210 | fdata->start_unit, 0, rpt * nr_tracks + 1, |
@@ -2176,10 +2213,17 @@ dasd_eckd_build_format(struct dasd_device *base, | |||
2176 | data += sizeof(struct LO_eckd_data); | 2213 | data += sizeof(struct LO_eckd_data); |
2177 | break; | 2214 | break; |
2178 | case 0x04: /* Invalidate track. */ | 2215 | case 0x04: /* Invalidate track. */ |
2179 | prefix(ccw++, (struct PFX_eckd_data *) data, | 2216 | if (use_prefix) { |
2180 | fdata->start_unit, fdata->stop_unit, | 2217 | prefix(ccw++, (struct PFX_eckd_data *) data, |
2181 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); | 2218 | fdata->start_unit, fdata->stop_unit, |
2182 | data += sizeof(struct PFX_eckd_data); | 2219 | DASD_ECKD_CCW_WRITE_CKD, base, startdev); |
2220 | data += sizeof(struct PFX_eckd_data); | ||
2221 | } else { | ||
2222 | define_extent(ccw++, (struct DE_eckd_data *) data, | ||
2223 | fdata->start_unit, fdata->stop_unit, | ||
2224 | DASD_ECKD_CCW_WRITE_CKD, startdev); | ||
2225 | data += sizeof(struct DE_eckd_data); | ||
2226 | } | ||
2183 | ccw[-1].flags |= CCW_FLAG_CC; | 2227 | ccw[-1].flags |= CCW_FLAG_CC; |
2184 | locate_record(ccw++, (struct LO_eckd_data *) data, | 2228 | locate_record(ccw++, (struct LO_eckd_data *) data, |
2185 | fdata->start_unit, 0, 1, | 2229 | fdata->start_unit, 0, 1, |
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index a3aa374799dc..1fe264379e0d 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c | |||
@@ -486,7 +486,7 @@ sclp_sync_wait(void) | |||
486 | timeout = 0; | 486 | timeout = 0; |
487 | if (timer_pending(&sclp_request_timer)) { | 487 | if (timer_pending(&sclp_request_timer)) { |
488 | /* Get timeout TOD value */ | 488 | /* Get timeout TOD value */ |
489 | timeout = get_tod_clock() + | 489 | timeout = get_tod_clock_fast() + |
490 | sclp_tod_from_jiffies(sclp_request_timer.expires - | 490 | sclp_tod_from_jiffies(sclp_request_timer.expires - |
491 | jiffies); | 491 | jiffies); |
492 | } | 492 | } |
@@ -508,7 +508,7 @@ sclp_sync_wait(void) | |||
508 | while (sclp_running_state != sclp_running_state_idle) { | 508 | while (sclp_running_state != sclp_running_state_idle) { |
509 | /* Check for expired request timer */ | 509 | /* Check for expired request timer */ |
510 | if (timer_pending(&sclp_request_timer) && | 510 | if (timer_pending(&sclp_request_timer) && |
511 | get_tod_clock() > timeout && | 511 | get_tod_clock_fast() > timeout && |
512 | del_timer(&sclp_request_timer)) | 512 | del_timer(&sclp_request_timer)) |
513 | sclp_request_timer.function(sclp_request_timer.data); | 513 | sclp_request_timer.function(sclp_request_timer.data); |
514 | cpu_relax(); | 514 | cpu_relax(); |
diff --git a/drivers/s390/char/vmlogrdr.c b/drivers/s390/char/vmlogrdr.c index 9b3a24e8d3a0..cf31d3321dab 100644 --- a/drivers/s390/char/vmlogrdr.c +++ b/drivers/s390/char/vmlogrdr.c | |||
@@ -313,7 +313,7 @@ static int vmlogrdr_open (struct inode *inode, struct file *filp) | |||
313 | int ret; | 313 | int ret; |
314 | 314 | ||
315 | dev_num = iminor(inode); | 315 | dev_num = iminor(inode); |
316 | if (dev_num > MAXMINOR) | 316 | if (dev_num >= MAXMINOR) |
317 | return -ENODEV; | 317 | return -ENODEV; |
318 | logptr = &sys_ser[dev_num]; | 318 | logptr = &sys_ser[dev_num]; |
319 | 319 | ||
diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index d7da67a31c77..88e35d85d205 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c | |||
@@ -878,9 +878,9 @@ static void css_reset(void) | |||
878 | atomic_inc(&chpid_reset_count); | 878 | atomic_inc(&chpid_reset_count); |
879 | } | 879 | } |
880 | /* Wait for machine check for all channel paths. */ | 880 | /* Wait for machine check for all channel paths. */ |
881 | timeout = get_tod_clock() + (RCHP_TIMEOUT << 12); | 881 | timeout = get_tod_clock_fast() + (RCHP_TIMEOUT << 12); |
882 | while (atomic_read(&chpid_reset_count) != 0) { | 882 | while (atomic_read(&chpid_reset_count) != 0) { |
883 | if (get_tod_clock() > timeout) | 883 | if (get_tod_clock_fast() > timeout) |
884 | break; | 884 | break; |
885 | cpu_relax(); | 885 | cpu_relax(); |
886 | } | 886 | } |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index 8ed52aa49122..bbd3e511c771 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -338,10 +338,10 @@ again: | |||
338 | retries++; | 338 | retries++; |
339 | 339 | ||
340 | if (!start_time) { | 340 | if (!start_time) { |
341 | start_time = get_tod_clock(); | 341 | start_time = get_tod_clock_fast(); |
342 | goto again; | 342 | goto again; |
343 | } | 343 | } |
344 | if ((get_tod_clock() - start_time) < QDIO_BUSY_BIT_PATIENCE) | 344 | if (get_tod_clock_fast() - start_time < QDIO_BUSY_BIT_PATIENCE) |
345 | goto again; | 345 | goto again; |
346 | } | 346 | } |
347 | if (retries) { | 347 | if (retries) { |
@@ -504,7 +504,7 @@ static int get_inbound_buffer_frontier(struct qdio_q *q) | |||
504 | int count, stop; | 504 | int count, stop; |
505 | unsigned char state = 0; | 505 | unsigned char state = 0; |
506 | 506 | ||
507 | q->timestamp = get_tod_clock(); | 507 | q->timestamp = get_tod_clock_fast(); |
508 | 508 | ||
509 | /* | 509 | /* |
510 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved | 510 | * Don't check 128 buffers, as otherwise qdio_inbound_q_moved |
@@ -595,7 +595,7 @@ static inline int qdio_inbound_q_done(struct qdio_q *q) | |||
595 | * At this point we know, that inbound first_to_check | 595 | * At this point we know, that inbound first_to_check |
596 | * has (probably) not moved (see qdio_inbound_processing). | 596 | * has (probably) not moved (see qdio_inbound_processing). |
597 | */ | 597 | */ |
598 | if (get_tod_clock() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { | 598 | if (get_tod_clock_fast() > q->u.in.timestamp + QDIO_INPUT_THRESHOLD) { |
599 | DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x", | 599 | DBF_DEV_EVENT(DBF_INFO, q->irq_ptr, "in done:%02x", |
600 | q->first_to_check); | 600 | q->first_to_check); |
601 | return 1; | 601 | return 1; |
@@ -728,7 +728,7 @@ static int get_outbound_buffer_frontier(struct qdio_q *q) | |||
728 | int count, stop; | 728 | int count, stop; |
729 | unsigned char state = 0; | 729 | unsigned char state = 0; |
730 | 730 | ||
731 | q->timestamp = get_tod_clock(); | 731 | q->timestamp = get_tod_clock_fast(); |
732 | 732 | ||
733 | if (need_siga_sync(q)) | 733 | if (need_siga_sync(q)) |
734 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && | 734 | if (((queue_type(q) != QDIO_IQDIO_QFMT) && |
diff --git a/drivers/scsi/BusLogic.c b/drivers/scsi/BusLogic.c index feab3a5e50b5..757eb0716d45 100644 --- a/drivers/scsi/BusLogic.c +++ b/drivers/scsi/BusLogic.c | |||
@@ -696,7 +696,7 @@ static int __init blogic_init_mm_probeinfo(struct blogic_adapter *adapter) | |||
696 | while ((pci_device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC, | 696 | while ((pci_device = pci_get_device(PCI_VENDOR_ID_BUSLOGIC, |
697 | PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, | 697 | PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER, |
698 | pci_device)) != NULL) { | 698 | pci_device)) != NULL) { |
699 | struct blogic_adapter *adapter = adapter; | 699 | struct blogic_adapter *host_adapter = adapter; |
700 | struct blogic_adapter_info adapter_info; | 700 | struct blogic_adapter_info adapter_info; |
701 | enum blogic_isa_ioport mod_ioaddr_req; | 701 | enum blogic_isa_ioport mod_ioaddr_req; |
702 | unsigned char bus; | 702 | unsigned char bus; |
@@ -744,9 +744,9 @@ static int __init blogic_init_mm_probeinfo(struct blogic_adapter *adapter) | |||
744 | known and enabled, note that the particular Standard ISA I/O | 744 | known and enabled, note that the particular Standard ISA I/O |
745 | Address should not be probed. | 745 | Address should not be probed. |
746 | */ | 746 | */ |
747 | adapter->io_addr = io_addr; | 747 | host_adapter->io_addr = io_addr; |
748 | blogic_intreset(adapter); | 748 | blogic_intreset(host_adapter); |
749 | if (blogic_cmd(adapter, BLOGIC_INQ_PCI_INFO, NULL, 0, | 749 | if (blogic_cmd(host_adapter, BLOGIC_INQ_PCI_INFO, NULL, 0, |
750 | &adapter_info, sizeof(adapter_info)) == | 750 | &adapter_info, sizeof(adapter_info)) == |
751 | sizeof(adapter_info)) { | 751 | sizeof(adapter_info)) { |
752 | if (adapter_info.isa_port < 6) | 752 | if (adapter_info.isa_port < 6) |
@@ -762,7 +762,7 @@ static int __init blogic_init_mm_probeinfo(struct blogic_adapter *adapter) | |||
762 | I/O Address assigned at system initialization. | 762 | I/O Address assigned at system initialization. |
763 | */ | 763 | */ |
764 | mod_ioaddr_req = BLOGIC_IO_DISABLE; | 764 | mod_ioaddr_req = BLOGIC_IO_DISABLE; |
765 | blogic_cmd(adapter, BLOGIC_MOD_IOADDR, &mod_ioaddr_req, | 765 | blogic_cmd(host_adapter, BLOGIC_MOD_IOADDR, &mod_ioaddr_req, |
766 | sizeof(mod_ioaddr_req), NULL, 0); | 766 | sizeof(mod_ioaddr_req), NULL, 0); |
767 | /* | 767 | /* |
768 | For the first MultiMaster Host Adapter enumerated, | 768 | For the first MultiMaster Host Adapter enumerated, |
@@ -779,12 +779,12 @@ static int __init blogic_init_mm_probeinfo(struct blogic_adapter *adapter) | |||
779 | 779 | ||
780 | fetch_localram.offset = BLOGIC_AUTOSCSI_BASE + 45; | 780 | fetch_localram.offset = BLOGIC_AUTOSCSI_BASE + 45; |
781 | fetch_localram.count = sizeof(autoscsi_byte45); | 781 | fetch_localram.count = sizeof(autoscsi_byte45); |
782 | blogic_cmd(adapter, BLOGIC_FETCH_LOCALRAM, | 782 | blogic_cmd(host_adapter, BLOGIC_FETCH_LOCALRAM, |
783 | &fetch_localram, sizeof(fetch_localram), | 783 | &fetch_localram, sizeof(fetch_localram), |
784 | &autoscsi_byte45, | 784 | &autoscsi_byte45, |
785 | sizeof(autoscsi_byte45)); | 785 | sizeof(autoscsi_byte45)); |
786 | blogic_cmd(adapter, BLOGIC_GET_BOARD_ID, NULL, 0, &id, | 786 | blogic_cmd(host_adapter, BLOGIC_GET_BOARD_ID, NULL, 0, |
787 | sizeof(id)); | 787 | &id, sizeof(id)); |
788 | if (id.fw_ver_digit1 == '5') | 788 | if (id.fw_ver_digit1 == '5') |
789 | force_scan_order = | 789 | force_scan_order = |
790 | autoscsi_byte45.force_scan_order; | 790 | autoscsi_byte45.force_scan_order; |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 2ef497ebadc0..ee5c1833eb73 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -20,7 +20,7 @@ | |||
20 | * | Device Discovery | 0x2095 | 0x2020-0x2022, | | 20 | * | Device Discovery | 0x2095 | 0x2020-0x2022, | |
21 | * | | | 0x2011-0x2012, | | 21 | * | | | 0x2011-0x2012, | |
22 | * | | | 0x2016 | | 22 | * | | | 0x2016 | |
23 | * | Queue Command and IO tracing | 0x3058 | 0x3006-0x300b | | 23 | * | Queue Command and IO tracing | 0x3059 | 0x3006-0x300b | |
24 | * | | | 0x3027-0x3028 | | 24 | * | | | 0x3027-0x3028 | |
25 | * | | | 0x303d-0x3041 | | 25 | * | | | 0x303d-0x3041 | |
26 | * | | | 0x302d,0x3033 | | 26 | * | | | 0x302d,0x3033 | |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index df1b30ba938c..ff9c86b1a0d8 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -1957,6 +1957,15 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
1957 | que = MSW(sts->handle); | 1957 | que = MSW(sts->handle); |
1958 | req = ha->req_q_map[que]; | 1958 | req = ha->req_q_map[que]; |
1959 | 1959 | ||
1960 | /* Check for invalid queue pointer */ | ||
1961 | if (req == NULL || | ||
1962 | que >= find_first_zero_bit(ha->req_qid_map, ha->max_req_queues)) { | ||
1963 | ql_dbg(ql_dbg_io, vha, 0x3059, | ||
1964 | "Invalid status handle (0x%x): Bad req pointer. req=%p, " | ||
1965 | "que=%u.\n", sts->handle, req, que); | ||
1966 | return; | ||
1967 | } | ||
1968 | |||
1960 | /* Validate handle. */ | 1969 | /* Validate handle. */ |
1961 | if (handle < req->num_outstanding_cmds) | 1970 | if (handle < req->num_outstanding_cmds) |
1962 | sp = req->outstanding_cmds[handle]; | 1971 | sp = req->outstanding_cmds[handle]; |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index e62d17d41d4e..5693f6d7eddb 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -2854,6 +2854,7 @@ static void sd_probe_async(void *data, async_cookie_t cookie) | |||
2854 | gd->events |= DISK_EVENT_MEDIA_CHANGE; | 2854 | gd->events |= DISK_EVENT_MEDIA_CHANGE; |
2855 | } | 2855 | } |
2856 | 2856 | ||
2857 | blk_pm_runtime_init(sdp->request_queue, dev); | ||
2857 | add_disk(gd); | 2858 | add_disk(gd); |
2858 | if (sdkp->capacity) | 2859 | if (sdkp->capacity) |
2859 | sd_dif_config_host(sdkp); | 2860 | sd_dif_config_host(sdkp); |
@@ -2862,7 +2863,6 @@ static void sd_probe_async(void *data, async_cookie_t cookie) | |||
2862 | 2863 | ||
2863 | sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", | 2864 | sd_printk(KERN_NOTICE, sdkp, "Attached SCSI %sdisk\n", |
2864 | sdp->removable ? "removable " : ""); | 2865 | sdp->removable ? "removable " : ""); |
2865 | blk_pm_runtime_init(sdp->request_queue, dev); | ||
2866 | scsi_autopm_put_device(sdp); | 2866 | scsi_autopm_put_device(sdp); |
2867 | put_device(&sdkp->dev); | 2867 | put_device(&sdkp->dev); |
2868 | } | 2868 | } |
diff --git a/drivers/staging/media/msi3101/Kconfig b/drivers/staging/media/msi3101/Kconfig index b94a95a597d6..76d5bbd4d93c 100644 --- a/drivers/staging/media/msi3101/Kconfig +++ b/drivers/staging/media/msi3101/Kconfig | |||
@@ -1,3 +1,4 @@ | |||
1 | config USB_MSI3101 | 1 | config USB_MSI3101 |
2 | tristate "Mirics MSi3101 SDR Dongle" | 2 | tristate "Mirics MSi3101 SDR Dongle" |
3 | depends on USB && VIDEO_DEV && VIDEO_V4L2 | 3 | depends on USB && VIDEO_DEV && VIDEO_V4L2 |
4 | select VIDEOBUF2_VMALLOC | ||
diff --git a/drivers/staging/media/msi3101/sdr-msi3101.c b/drivers/staging/media/msi3101/sdr-msi3101.c index 24c7b70a6cbf..4c3bf776bb20 100644 --- a/drivers/staging/media/msi3101/sdr-msi3101.c +++ b/drivers/staging/media/msi3101/sdr-msi3101.c | |||
@@ -1131,7 +1131,13 @@ static int msi3101_queue_setup(struct vb2_queue *vq, | |||
1131 | /* Absolute min and max number of buffers available for mmap() */ | 1131 | /* Absolute min and max number of buffers available for mmap() */ |
1132 | *nbuffers = 32; | 1132 | *nbuffers = 32; |
1133 | *nplanes = 1; | 1133 | *nplanes = 1; |
1134 | sizes[0] = PAGE_ALIGN(3 * 3072); /* 3 * 768 * 4 */ | 1134 | /* |
1135 | * 3, wMaxPacketSize 3x 1024 bytes | ||
1136 | * 504, max IQ sample pairs per 1024 frame | ||
1137 | * 2, two samples, I and Q | ||
1138 | * 4, 32-bit float | ||
1139 | */ | ||
1140 | sizes[0] = PAGE_ALIGN(3 * 504 * 2 * 4); /* = 12096 */ | ||
1135 | dev_dbg(&s->udev->dev, "%s: nbuffers=%d sizes[0]=%d\n", | 1141 | dev_dbg(&s->udev->dev, "%s: nbuffers=%d sizes[0]=%d\n", |
1136 | __func__, *nbuffers, sizes[0]); | 1142 | __func__, *nbuffers, sizes[0]); |
1137 | return 0; | 1143 | return 0; |
@@ -1657,7 +1663,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, | |||
1657 | f->frequency * 625UL / 10UL); | 1663 | f->frequency * 625UL / 10UL); |
1658 | } | 1664 | } |
1659 | 1665 | ||
1660 | const struct v4l2_ioctl_ops msi3101_ioctl_ops = { | 1666 | static const struct v4l2_ioctl_ops msi3101_ioctl_ops = { |
1661 | .vidioc_querycap = msi3101_querycap, | 1667 | .vidioc_querycap = msi3101_querycap, |
1662 | 1668 | ||
1663 | .vidioc_enum_input = msi3101_enum_input, | 1669 | .vidioc_enum_input = msi3101_enum_input, |
diff --git a/drivers/target/target_core_pscsi.c b/drivers/target/target_core_pscsi.c index 551c96ca60ac..0f199f6a0738 100644 --- a/drivers/target/target_core_pscsi.c +++ b/drivers/target/target_core_pscsi.c | |||
@@ -134,10 +134,10 @@ static int pscsi_pmode_enable_hba(struct se_hba *hba, unsigned long mode_flag) | |||
134 | * pSCSI Host ID and enable for phba mode | 134 | * pSCSI Host ID and enable for phba mode |
135 | */ | 135 | */ |
136 | sh = scsi_host_lookup(phv->phv_host_id); | 136 | sh = scsi_host_lookup(phv->phv_host_id); |
137 | if (IS_ERR(sh)) { | 137 | if (!sh) { |
138 | pr_err("pSCSI: Unable to locate SCSI Host for" | 138 | pr_err("pSCSI: Unable to locate SCSI Host for" |
139 | " phv_host_id: %d\n", phv->phv_host_id); | 139 | " phv_host_id: %d\n", phv->phv_host_id); |
140 | return PTR_ERR(sh); | 140 | return -EINVAL; |
141 | } | 141 | } |
142 | 142 | ||
143 | phv->phv_lld_host = sh; | 143 | phv->phv_lld_host = sh; |
@@ -515,10 +515,10 @@ static int pscsi_configure_device(struct se_device *dev) | |||
515 | sh = phv->phv_lld_host; | 515 | sh = phv->phv_lld_host; |
516 | } else { | 516 | } else { |
517 | sh = scsi_host_lookup(pdv->pdv_host_id); | 517 | sh = scsi_host_lookup(pdv->pdv_host_id); |
518 | if (IS_ERR(sh)) { | 518 | if (!sh) { |
519 | pr_err("pSCSI: Unable to locate" | 519 | pr_err("pSCSI: Unable to locate" |
520 | " pdv_host_id: %d\n", pdv->pdv_host_id); | 520 | " pdv_host_id: %d\n", pdv->pdv_host_id); |
521 | return PTR_ERR(sh); | 521 | return -EINVAL; |
522 | } | 522 | } |
523 | } | 523 | } |
524 | } else { | 524 | } else { |
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 4714c6f8da4b..d9b92b2c524d 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
@@ -263,6 +263,11 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o | |||
263 | sectors, cmd->se_dev->dev_attrib.max_write_same_len); | 263 | sectors, cmd->se_dev->dev_attrib.max_write_same_len); |
264 | return TCM_INVALID_CDB_FIELD; | 264 | return TCM_INVALID_CDB_FIELD; |
265 | } | 265 | } |
266 | /* We always have ANC_SUP == 0 so setting ANCHOR is always an error */ | ||
267 | if (flags[0] & 0x10) { | ||
268 | pr_warn("WRITE SAME with ANCHOR not supported\n"); | ||
269 | return TCM_INVALID_CDB_FIELD; | ||
270 | } | ||
266 | /* | 271 | /* |
267 | * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting | 272 | * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting |
268 | * translated into block discard requests within backend code. | 273 | * translated into block discard requests within backend code. |
diff --git a/drivers/target/target_core_xcopy.c b/drivers/target/target_core_xcopy.c index 3da4fd10b9f8..474cd44fac14 100644 --- a/drivers/target/target_core_xcopy.c +++ b/drivers/target/target_core_xcopy.c | |||
@@ -82,6 +82,9 @@ static int target_xcopy_locate_se_dev_e4(struct se_cmd *se_cmd, struct xcopy_op | |||
82 | mutex_lock(&g_device_mutex); | 82 | mutex_lock(&g_device_mutex); |
83 | list_for_each_entry(se_dev, &g_device_list, g_dev_node) { | 83 | list_for_each_entry(se_dev, &g_device_list, g_dev_node) { |
84 | 84 | ||
85 | if (!se_dev->dev_attrib.emulate_3pc) | ||
86 | continue; | ||
87 | |||
85 | memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); | 88 | memset(&tmp_dev_wwn[0], 0, XCOPY_NAA_IEEE_REGEX_LEN); |
86 | target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); | 89 | target_xcopy_gen_naa_ieee(se_dev, &tmp_dev_wwn[0]); |
87 | 90 | ||
@@ -357,6 +360,7 @@ struct xcopy_pt_cmd { | |||
357 | struct se_cmd se_cmd; | 360 | struct se_cmd se_cmd; |
358 | struct xcopy_op *xcopy_op; | 361 | struct xcopy_op *xcopy_op; |
359 | struct completion xpt_passthrough_sem; | 362 | struct completion xpt_passthrough_sem; |
363 | unsigned char sense_buffer[TRANSPORT_SENSE_BUFFER]; | ||
360 | }; | 364 | }; |
361 | 365 | ||
362 | static struct se_port xcopy_pt_port; | 366 | static struct se_port xcopy_pt_port; |
@@ -675,7 +679,8 @@ static int target_xcopy_issue_pt_cmd(struct xcopy_pt_cmd *xpt_cmd) | |||
675 | 679 | ||
676 | pr_debug("target_xcopy_issue_pt_cmd(): SCSI status: 0x%02x\n", | 680 | pr_debug("target_xcopy_issue_pt_cmd(): SCSI status: 0x%02x\n", |
677 | se_cmd->scsi_status); | 681 | se_cmd->scsi_status); |
678 | return 0; | 682 | |
683 | return (se_cmd->scsi_status) ? -EINVAL : 0; | ||
679 | } | 684 | } |
680 | 685 | ||
681 | static int target_xcopy_read_source( | 686 | static int target_xcopy_read_source( |
@@ -708,7 +713,7 @@ static int target_xcopy_read_source( | |||
708 | (unsigned long long)src_lba, src_sectors, length); | 713 | (unsigned long long)src_lba, src_sectors, length); |
709 | 714 | ||
710 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, | 715 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, |
711 | DMA_FROM_DEVICE, 0, NULL); | 716 | DMA_FROM_DEVICE, 0, &xpt_cmd->sense_buffer[0]); |
712 | xop->src_pt_cmd = xpt_cmd; | 717 | xop->src_pt_cmd = xpt_cmd; |
713 | 718 | ||
714 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0], | 719 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, src_dev, &cdb[0], |
@@ -768,7 +773,7 @@ static int target_xcopy_write_destination( | |||
768 | (unsigned long long)dst_lba, dst_sectors, length); | 773 | (unsigned long long)dst_lba, dst_sectors, length); |
769 | 774 | ||
770 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, | 775 | transport_init_se_cmd(se_cmd, &xcopy_pt_tfo, NULL, length, |
771 | DMA_TO_DEVICE, 0, NULL); | 776 | DMA_TO_DEVICE, 0, &xpt_cmd->sense_buffer[0]); |
772 | xop->dst_pt_cmd = xpt_cmd; | 777 | xop->dst_pt_cmd = xpt_cmd; |
773 | 778 | ||
774 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0], | 779 | rc = target_xcopy_setup_pt_cmd(xpt_cmd, xop, dst_dev, &cdb[0], |
@@ -884,30 +889,42 @@ out: | |||
884 | 889 | ||
885 | sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | 890 | sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) |
886 | { | 891 | { |
892 | struct se_device *dev = se_cmd->se_dev; | ||
887 | struct xcopy_op *xop = NULL; | 893 | struct xcopy_op *xop = NULL; |
888 | unsigned char *p = NULL, *seg_desc; | 894 | unsigned char *p = NULL, *seg_desc; |
889 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; | 895 | unsigned int list_id, list_id_usage, sdll, inline_dl, sa; |
896 | sense_reason_t ret = TCM_INVALID_PARAMETER_LIST; | ||
890 | int rc; | 897 | int rc; |
891 | unsigned short tdll; | 898 | unsigned short tdll; |
892 | 899 | ||
900 | if (!dev->dev_attrib.emulate_3pc) { | ||
901 | pr_err("EXTENDED_COPY operation explicitly disabled\n"); | ||
902 | return TCM_UNSUPPORTED_SCSI_OPCODE; | ||
903 | } | ||
904 | |||
893 | sa = se_cmd->t_task_cdb[1] & 0x1f; | 905 | sa = se_cmd->t_task_cdb[1] & 0x1f; |
894 | if (sa != 0x00) { | 906 | if (sa != 0x00) { |
895 | pr_err("EXTENDED_COPY(LID4) not supported\n"); | 907 | pr_err("EXTENDED_COPY(LID4) not supported\n"); |
896 | return TCM_UNSUPPORTED_SCSI_OPCODE; | 908 | return TCM_UNSUPPORTED_SCSI_OPCODE; |
897 | } | 909 | } |
898 | 910 | ||
911 | xop = kzalloc(sizeof(struct xcopy_op), GFP_KERNEL); | ||
912 | if (!xop) { | ||
913 | pr_err("Unable to allocate xcopy_op\n"); | ||
914 | return TCM_OUT_OF_RESOURCES; | ||
915 | } | ||
916 | xop->xop_se_cmd = se_cmd; | ||
917 | |||
899 | p = transport_kmap_data_sg(se_cmd); | 918 | p = transport_kmap_data_sg(se_cmd); |
900 | if (!p) { | 919 | if (!p) { |
901 | pr_err("transport_kmap_data_sg() failed in target_do_xcopy\n"); | 920 | pr_err("transport_kmap_data_sg() failed in target_do_xcopy\n"); |
921 | kfree(xop); | ||
902 | return TCM_OUT_OF_RESOURCES; | 922 | return TCM_OUT_OF_RESOURCES; |
903 | } | 923 | } |
904 | 924 | ||
905 | list_id = p[0]; | 925 | list_id = p[0]; |
906 | if (list_id != 0x00) { | 926 | list_id_usage = (p[1] & 0x18) >> 3; |
907 | pr_err("XCOPY with non zero list_id: 0x%02x\n", list_id); | 927 | |
908 | goto out; | ||
909 | } | ||
910 | list_id_usage = (p[1] & 0x18); | ||
911 | /* | 928 | /* |
912 | * Determine TARGET DESCRIPTOR LIST LENGTH + SEGMENT DESCRIPTOR LIST LENGTH | 929 | * Determine TARGET DESCRIPTOR LIST LENGTH + SEGMENT DESCRIPTOR LIST LENGTH |
913 | */ | 930 | */ |
@@ -920,13 +937,6 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | |||
920 | goto out; | 937 | goto out; |
921 | } | 938 | } |
922 | 939 | ||
923 | xop = kzalloc(sizeof(struct xcopy_op), GFP_KERNEL); | ||
924 | if (!xop) { | ||
925 | pr_err("Unable to allocate xcopy_op\n"); | ||
926 | goto out; | ||
927 | } | ||
928 | xop->xop_se_cmd = se_cmd; | ||
929 | |||
930 | pr_debug("Processing XCOPY with list_id: 0x%02x list_id_usage: 0x%02x" | 940 | pr_debug("Processing XCOPY with list_id: 0x%02x list_id_usage: 0x%02x" |
931 | " tdll: %hu sdll: %u inline_dl: %u\n", list_id, list_id_usage, | 941 | " tdll: %hu sdll: %u inline_dl: %u\n", list_id, list_id_usage, |
932 | tdll, sdll, inline_dl); | 942 | tdll, sdll, inline_dl); |
@@ -935,6 +945,17 @@ sense_reason_t target_do_xcopy(struct se_cmd *se_cmd) | |||
935 | if (rc <= 0) | 945 | if (rc <= 0) |
936 | goto out; | 946 | goto out; |
937 | 947 | ||
948 | if (xop->src_dev->dev_attrib.block_size != | ||
949 | xop->dst_dev->dev_attrib.block_size) { | ||
950 | pr_err("XCOPY: Non matching src_dev block_size: %u + dst_dev" | ||
951 | " block_size: %u currently unsupported\n", | ||
952 | xop->src_dev->dev_attrib.block_size, | ||
953 | xop->dst_dev->dev_attrib.block_size); | ||
954 | xcopy_pt_undepend_remotedev(xop); | ||
955 | ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; | ||
956 | goto out; | ||
957 | } | ||
958 | |||
938 | pr_debug("XCOPY: Processed %d target descriptors, length: %u\n", rc, | 959 | pr_debug("XCOPY: Processed %d target descriptors, length: %u\n", rc, |
939 | rc * XCOPY_TARGET_DESC_LEN); | 960 | rc * XCOPY_TARGET_DESC_LEN); |
940 | seg_desc = &p[16]; | 961 | seg_desc = &p[16]; |
@@ -957,7 +978,7 @@ out: | |||
957 | if (p) | 978 | if (p) |
958 | transport_kunmap_data_sg(se_cmd); | 979 | transport_kunmap_data_sg(se_cmd); |
959 | kfree(xop); | 980 | kfree(xop); |
960 | return TCM_INVALID_CDB_FIELD; | 981 | return ret; |
961 | } | 982 | } |
962 | 983 | ||
963 | static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd) | 984 | static sense_reason_t target_rcr_operating_parameters(struct se_cmd *se_cmd) |
diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c index f10a6ad37c06..c2301da08ac7 100644 --- a/drivers/thermal/samsung/exynos_thermal_common.c +++ b/drivers/thermal/samsung/exynos_thermal_common.c | |||
@@ -310,8 +310,6 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf) | |||
310 | } | 310 | } |
311 | 311 | ||
312 | th_zone = conf->pzone_data; | 312 | th_zone = conf->pzone_data; |
313 | if (th_zone->therm_dev) | ||
314 | return; | ||
315 | 313 | ||
316 | if (th_zone->bind == false) { | 314 | if (th_zone->bind == false) { |
317 | for (i = 0; i < th_zone->cool_dev_size; i++) { | 315 | for (i = 0; i < th_zone->cool_dev_size; i++) { |
diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index b43afda8acd1..32f38b90c4f6 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c | |||
@@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on) | |||
317 | 317 | ||
318 | con = readl(data->base + reg->tmu_ctrl); | 318 | con = readl(data->base + reg->tmu_ctrl); |
319 | 319 | ||
320 | if (pdata->test_mux) | ||
321 | con |= (pdata->test_mux << reg->test_mux_addr_shift); | ||
322 | |||
320 | if (pdata->reference_voltage) { | 323 | if (pdata->reference_voltage) { |
321 | con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift); | 324 | con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift); |
322 | con |= pdata->reference_voltage << reg->buf_vref_sel_shift; | 325 | con |= pdata->reference_voltage << reg->buf_vref_sel_shift; |
@@ -488,7 +491,7 @@ static const struct of_device_id exynos_tmu_match[] = { | |||
488 | }, | 491 | }, |
489 | { | 492 | { |
490 | .compatible = "samsung,exynos4412-tmu", | 493 | .compatible = "samsung,exynos4412-tmu", |
491 | .data = (void *)EXYNOS5250_TMU_DRV_DATA, | 494 | .data = (void *)EXYNOS4412_TMU_DRV_DATA, |
492 | }, | 495 | }, |
493 | { | 496 | { |
494 | .compatible = "samsung,exynos5250-tmu", | 497 | .compatible = "samsung,exynos5250-tmu", |
@@ -629,9 +632,10 @@ static int exynos_tmu_probe(struct platform_device *pdev) | |||
629 | if (ret) | 632 | if (ret) |
630 | return ret; | 633 | return ret; |
631 | 634 | ||
632 | if (pdata->type == SOC_ARCH_EXYNOS || | 635 | if (pdata->type == SOC_ARCH_EXYNOS4210 || |
633 | pdata->type == SOC_ARCH_EXYNOS4210 || | 636 | pdata->type == SOC_ARCH_EXYNOS4412 || |
634 | pdata->type == SOC_ARCH_EXYNOS5440) | 637 | pdata->type == SOC_ARCH_EXYNOS5250 || |
638 | pdata->type == SOC_ARCH_EXYNOS5440) | ||
635 | data->soc = pdata->type; | 639 | data->soc = pdata->type; |
636 | else { | 640 | else { |
637 | ret = -EINVAL; | 641 | ret = -EINVAL; |
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index b364c9eee701..3fb65547e64c 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h | |||
@@ -41,7 +41,8 @@ enum calibration_mode { | |||
41 | 41 | ||
42 | enum soc_type { | 42 | enum soc_type { |
43 | SOC_ARCH_EXYNOS4210 = 1, | 43 | SOC_ARCH_EXYNOS4210 = 1, |
44 | SOC_ARCH_EXYNOS, | 44 | SOC_ARCH_EXYNOS4412, |
45 | SOC_ARCH_EXYNOS5250, | ||
45 | SOC_ARCH_EXYNOS5440, | 46 | SOC_ARCH_EXYNOS5440, |
46 | }; | 47 | }; |
47 | 48 | ||
@@ -84,6 +85,7 @@ enum soc_type { | |||
84 | * @triminfo_reload_shift: shift of triminfo reload enable bit in triminfo_ctrl | 85 | * @triminfo_reload_shift: shift of triminfo reload enable bit in triminfo_ctrl |
85 | reg. | 86 | reg. |
86 | * @tmu_ctrl: TMU main controller register. | 87 | * @tmu_ctrl: TMU main controller register. |
88 | * @test_mux_addr_shift: shift bits of test mux address. | ||
87 | * @buf_vref_sel_shift: shift bits of reference voltage in tmu_ctrl register. | 89 | * @buf_vref_sel_shift: shift bits of reference voltage in tmu_ctrl register. |
88 | * @buf_vref_sel_mask: mask bits of reference voltage in tmu_ctrl register. | 90 | * @buf_vref_sel_mask: mask bits of reference voltage in tmu_ctrl register. |
89 | * @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register. | 91 | * @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register. |
@@ -150,6 +152,7 @@ struct exynos_tmu_registers { | |||
150 | u32 triminfo_reload_shift; | 152 | u32 triminfo_reload_shift; |
151 | 153 | ||
152 | u32 tmu_ctrl; | 154 | u32 tmu_ctrl; |
155 | u32 test_mux_addr_shift; | ||
153 | u32 buf_vref_sel_shift; | 156 | u32 buf_vref_sel_shift; |
154 | u32 buf_vref_sel_mask; | 157 | u32 buf_vref_sel_mask; |
155 | u32 therm_trip_mode_shift; | 158 | u32 therm_trip_mode_shift; |
@@ -257,6 +260,7 @@ struct exynos_tmu_registers { | |||
257 | * @first_point_trim: temp value of the first point trimming | 260 | * @first_point_trim: temp value of the first point trimming |
258 | * @second_point_trim: temp value of the second point trimming | 261 | * @second_point_trim: temp value of the second point trimming |
259 | * @default_temp_offset: default temperature offset in case of no trimming | 262 | * @default_temp_offset: default temperature offset in case of no trimming |
263 | * @test_mux; information if SoC supports test MUX | ||
260 | * @cal_type: calibration type for temperature | 264 | * @cal_type: calibration type for temperature |
261 | * @cal_mode: calibration mode for temperature | 265 | * @cal_mode: calibration mode for temperature |
262 | * @freq_clip_table: Table representing frequency reduction percentage. | 266 | * @freq_clip_table: Table representing frequency reduction percentage. |
@@ -286,6 +290,7 @@ struct exynos_tmu_platform_data { | |||
286 | u8 first_point_trim; | 290 | u8 first_point_trim; |
287 | u8 second_point_trim; | 291 | u8 second_point_trim; |
288 | u8 default_temp_offset; | 292 | u8 default_temp_offset; |
293 | u8 test_mux; | ||
289 | 294 | ||
290 | enum calibration_type cal_type; | 295 | enum calibration_type cal_type; |
291 | enum calibration_mode cal_mode; | 296 | enum calibration_mode cal_mode; |
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c index 9002499c1f69..073c292baa53 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c +++ b/drivers/thermal/samsung/exynos_tmu_data.c | |||
@@ -90,14 +90,15 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = { | |||
90 | }; | 90 | }; |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | #if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412) | 93 | #if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250) |
94 | static const struct exynos_tmu_registers exynos5250_tmu_registers = { | 94 | static const struct exynos_tmu_registers exynos4412_tmu_registers = { |
95 | .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, | 95 | .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, |
96 | .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT, | 96 | .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT, |
97 | .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT, | 97 | .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT, |
98 | .triminfo_ctrl = EXYNOS_TMU_TRIMINFO_CON, | 98 | .triminfo_ctrl = EXYNOS_TMU_TRIMINFO_CON, |
99 | .triminfo_reload_shift = EXYNOS_TRIMINFO_RELOAD_SHIFT, | 99 | .triminfo_reload_shift = EXYNOS_TRIMINFO_RELOAD_SHIFT, |
100 | .tmu_ctrl = EXYNOS_TMU_REG_CONTROL, | 100 | .tmu_ctrl = EXYNOS_TMU_REG_CONTROL, |
101 | .test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT, | ||
101 | .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT, | 102 | .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT, |
102 | .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK, | 103 | .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK, |
103 | .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, | 104 | .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT, |
@@ -128,7 +129,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { | |||
128 | .emul_time_mask = EXYNOS_EMUL_TIME_MASK, | 129 | .emul_time_mask = EXYNOS_EMUL_TIME_MASK, |
129 | }; | 130 | }; |
130 | 131 | ||
131 | #define EXYNOS5250_TMU_DATA \ | 132 | #define EXYNOS4412_TMU_DATA \ |
132 | .threshold_falling = 10, \ | 133 | .threshold_falling = 10, \ |
133 | .trigger_levels[0] = 85, \ | 134 | .trigger_levels[0] = 85, \ |
134 | .trigger_levels[1] = 103, \ | 135 | .trigger_levels[1] = 103, \ |
@@ -162,15 +163,32 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = { | |||
162 | .temp_level = 103, \ | 163 | .temp_level = 103, \ |
163 | }, \ | 164 | }, \ |
164 | .freq_tab_count = 2, \ | 165 | .freq_tab_count = 2, \ |
165 | .type = SOC_ARCH_EXYNOS, \ | 166 | .registers = &exynos4412_tmu_registers, \ |
166 | .registers = &exynos5250_tmu_registers, \ | ||
167 | .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ | 167 | .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \ |
168 | TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \ | 168 | TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \ |
169 | TMU_SUPPORT_EMUL_TIME) | 169 | TMU_SUPPORT_EMUL_TIME) |
170 | #endif | ||
170 | 171 | ||
172 | #if defined(CONFIG_SOC_EXYNOS4412) | ||
173 | struct exynos_tmu_init_data const exynos4412_default_tmu_data = { | ||
174 | .tmu_data = { | ||
175 | { | ||
176 | EXYNOS4412_TMU_DATA, | ||
177 | .type = SOC_ARCH_EXYNOS4412, | ||
178 | .test_mux = EXYNOS4412_MUX_ADDR_VALUE, | ||
179 | }, | ||
180 | }, | ||
181 | .tmu_count = 1, | ||
182 | }; | ||
183 | #endif | ||
184 | |||
185 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
171 | struct exynos_tmu_init_data const exynos5250_default_tmu_data = { | 186 | struct exynos_tmu_init_data const exynos5250_default_tmu_data = { |
172 | .tmu_data = { | 187 | .tmu_data = { |
173 | { EXYNOS5250_TMU_DATA }, | 188 | { |
189 | EXYNOS4412_TMU_DATA, | ||
190 | .type = SOC_ARCH_EXYNOS5250, | ||
191 | }, | ||
174 | }, | 192 | }, |
175 | .tmu_count = 1, | 193 | .tmu_count = 1, |
176 | }; | 194 | }; |
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h index dc7feb51099b..a1ea19d9e0a6 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++ b/drivers/thermal/samsung/exynos_tmu_data.h | |||
@@ -95,6 +95,10 @@ | |||
95 | 95 | ||
96 | #define EXYNOS_MAX_TRIGGER_PER_REG 4 | 96 | #define EXYNOS_MAX_TRIGGER_PER_REG 4 |
97 | 97 | ||
98 | /* Exynos4412 specific */ | ||
99 | #define EXYNOS4412_MUX_ADDR_VALUE 6 | ||
100 | #define EXYNOS4412_MUX_ADDR_SHIFT 20 | ||
101 | |||
98 | /*exynos5440 specific registers*/ | 102 | /*exynos5440 specific registers*/ |
99 | #define EXYNOS5440_TMU_S0_7_TRIM 0x000 | 103 | #define EXYNOS5440_TMU_S0_7_TRIM 0x000 |
100 | #define EXYNOS5440_TMU_S0_7_CTRL 0x020 | 104 | #define EXYNOS5440_TMU_S0_7_CTRL 0x020 |
@@ -138,7 +142,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data; | |||
138 | #define EXYNOS4210_TMU_DRV_DATA (NULL) | 142 | #define EXYNOS4210_TMU_DRV_DATA (NULL) |
139 | #endif | 143 | #endif |
140 | 144 | ||
141 | #if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)) | 145 | #if defined(CONFIG_SOC_EXYNOS4412) |
146 | extern struct exynos_tmu_init_data const exynos4412_default_tmu_data; | ||
147 | #define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data) | ||
148 | #else | ||
149 | #define EXYNOS4412_TMU_DRV_DATA (NULL) | ||
150 | #endif | ||
151 | |||
152 | #if defined(CONFIG_SOC_EXYNOS5250) | ||
142 | extern struct exynos_tmu_init_data const exynos5250_default_tmu_data; | 153 | extern struct exynos_tmu_init_data const exynos5250_default_tmu_data; |
143 | #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data) | 154 | #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data) |
144 | #else | 155 | #else |
diff --git a/drivers/thermal/thermal_hwmon.c b/drivers/thermal/thermal_hwmon.c index eeef0e2498ca..fdb07199d9c2 100644 --- a/drivers/thermal/thermal_hwmon.c +++ b/drivers/thermal/thermal_hwmon.c | |||
@@ -159,7 +159,7 @@ int thermal_add_hwmon_sysfs(struct thermal_zone_device *tz) | |||
159 | 159 | ||
160 | INIT_LIST_HEAD(&hwmon->tz_list); | 160 | INIT_LIST_HEAD(&hwmon->tz_list); |
161 | strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); | 161 | strlcpy(hwmon->type, tz->type, THERMAL_NAME_LENGTH); |
162 | hwmon->device = hwmon_device_register(&tz->device); | 162 | hwmon->device = hwmon_device_register(NULL); |
163 | if (IS_ERR(hwmon->device)) { | 163 | if (IS_ERR(hwmon->device)) { |
164 | result = PTR_ERR(hwmon->device); | 164 | result = PTR_ERR(hwmon->device); |
165 | goto free_mem; | 165 | goto free_mem; |
diff --git a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c index 4f8b9af54a5a..5a47cc8c8f85 100644 --- a/drivers/thermal/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/thermal/ti-soc-thermal/ti-thermal-common.c | |||
@@ -110,6 +110,7 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal, | |||
110 | } else { | 110 | } else { |
111 | dev_err(bgp->dev, | 111 | dev_err(bgp->dev, |
112 | "Failed to read PCB state. Using defaults\n"); | 112 | "Failed to read PCB state. Using defaults\n"); |
113 | ret = 0; | ||
113 | } | 114 | } |
114 | } | 115 | } |
115 | *temp = ti_thermal_hotspot_temperature(tmp, slope, constant); | 116 | *temp = ti_thermal_hotspot_temperature(tmp, slope, constant); |
diff --git a/drivers/thermal/x86_pkg_temp_thermal.c b/drivers/thermal/x86_pkg_temp_thermal.c index f36950e4134f..7722cb9d5a80 100644 --- a/drivers/thermal/x86_pkg_temp_thermal.c +++ b/drivers/thermal/x86_pkg_temp_thermal.c | |||
@@ -316,18 +316,19 @@ static void pkg_temp_thermal_threshold_work_fn(struct work_struct *work) | |||
316 | int phy_id = topology_physical_package_id(cpu); | 316 | int phy_id = topology_physical_package_id(cpu); |
317 | struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu); | 317 | struct phy_dev_entry *phdev = pkg_temp_thermal_get_phy_entry(cpu); |
318 | bool notify = false; | 318 | bool notify = false; |
319 | unsigned long flags; | ||
319 | 320 | ||
320 | if (!phdev) | 321 | if (!phdev) |
321 | return; | 322 | return; |
322 | 323 | ||
323 | spin_lock(&pkg_work_lock); | 324 | spin_lock_irqsave(&pkg_work_lock, flags); |
324 | ++pkg_work_cnt; | 325 | ++pkg_work_cnt; |
325 | if (unlikely(phy_id > max_phy_id)) { | 326 | if (unlikely(phy_id > max_phy_id)) { |
326 | spin_unlock(&pkg_work_lock); | 327 | spin_unlock_irqrestore(&pkg_work_lock, flags); |
327 | return; | 328 | return; |
328 | } | 329 | } |
329 | pkg_work_scheduled[phy_id] = 0; | 330 | pkg_work_scheduled[phy_id] = 0; |
330 | spin_unlock(&pkg_work_lock); | 331 | spin_unlock_irqrestore(&pkg_work_lock, flags); |
331 | 332 | ||
332 | enable_pkg_thres_interrupt(); | 333 | enable_pkg_thres_interrupt(); |
333 | rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val); | 334 | rdmsrl(MSR_IA32_PACKAGE_THERM_STATUS, msr_val); |
@@ -397,6 +398,7 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) | |||
397 | int thres_count; | 398 | int thres_count; |
398 | u32 eax, ebx, ecx, edx; | 399 | u32 eax, ebx, ecx, edx; |
399 | u8 *temp; | 400 | u8 *temp; |
401 | unsigned long flags; | ||
400 | 402 | ||
401 | cpuid(6, &eax, &ebx, &ecx, &edx); | 403 | cpuid(6, &eax, &ebx, &ecx, &edx); |
402 | thres_count = ebx & 0x07; | 404 | thres_count = ebx & 0x07; |
@@ -420,19 +422,19 @@ static int pkg_temp_thermal_device_add(unsigned int cpu) | |||
420 | goto err_ret_unlock; | 422 | goto err_ret_unlock; |
421 | } | 423 | } |
422 | 424 | ||
423 | spin_lock(&pkg_work_lock); | 425 | spin_lock_irqsave(&pkg_work_lock, flags); |
424 | if (topology_physical_package_id(cpu) > max_phy_id) | 426 | if (topology_physical_package_id(cpu) > max_phy_id) |
425 | max_phy_id = topology_physical_package_id(cpu); | 427 | max_phy_id = topology_physical_package_id(cpu); |
426 | temp = krealloc(pkg_work_scheduled, | 428 | temp = krealloc(pkg_work_scheduled, |
427 | (max_phy_id+1) * sizeof(u8), GFP_ATOMIC); | 429 | (max_phy_id+1) * sizeof(u8), GFP_ATOMIC); |
428 | if (!temp) { | 430 | if (!temp) { |
429 | spin_unlock(&pkg_work_lock); | 431 | spin_unlock_irqrestore(&pkg_work_lock, flags); |
430 | err = -ENOMEM; | 432 | err = -ENOMEM; |
431 | goto err_ret_free; | 433 | goto err_ret_free; |
432 | } | 434 | } |
433 | pkg_work_scheduled = temp; | 435 | pkg_work_scheduled = temp; |
434 | pkg_work_scheduled[topology_physical_package_id(cpu)] = 0; | 436 | pkg_work_scheduled[topology_physical_package_id(cpu)] = 0; |
435 | spin_unlock(&pkg_work_lock); | 437 | spin_unlock_irqrestore(&pkg_work_lock, flags); |
436 | 438 | ||
437 | phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu); | 439 | phy_dev_entry->phys_proc_id = topology_physical_package_id(cpu); |
438 | phy_dev_entry->first_cpu = cpu; | 440 | phy_dev_entry->first_cpu = cpu; |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index ce5221fa393a..e663921eebb6 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -1056,7 +1056,7 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) | |||
1056 | if (data_direction != DMA_NONE) { | 1056 | if (data_direction != DMA_NONE) { |
1057 | ret = vhost_scsi_map_iov_to_sgl(cmd, | 1057 | ret = vhost_scsi_map_iov_to_sgl(cmd, |
1058 | &vq->iov[data_first], data_num, | 1058 | &vq->iov[data_first], data_num, |
1059 | data_direction == DMA_TO_DEVICE); | 1059 | data_direction == DMA_FROM_DEVICE); |
1060 | if (unlikely(ret)) { | 1060 | if (unlikely(ret)) { |
1061 | vq_err(vq, "Failed to map iov to sgl\n"); | 1061 | vq_err(vq, "Failed to map iov to sgl\n"); |
1062 | goto err_free; | 1062 | goto err_free; |
diff --git a/fs/dcache.c b/fs/dcache.c index 41000305d716..20532cb0b06e 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -1331,14 +1331,6 @@ rename_retry: | |||
1331 | * list is non-empty and continue searching. | 1331 | * list is non-empty and continue searching. |
1332 | */ | 1332 | */ |
1333 | 1333 | ||
1334 | /** | ||
1335 | * have_submounts - check for mounts over a dentry | ||
1336 | * @parent: dentry to check. | ||
1337 | * | ||
1338 | * Return true if the parent or its subdirectories contain | ||
1339 | * a mount point | ||
1340 | */ | ||
1341 | |||
1342 | static enum d_walk_ret check_mount(void *data, struct dentry *dentry) | 1334 | static enum d_walk_ret check_mount(void *data, struct dentry *dentry) |
1343 | { | 1335 | { |
1344 | int *ret = data; | 1336 | int *ret = data; |
@@ -1349,6 +1341,13 @@ static enum d_walk_ret check_mount(void *data, struct dentry *dentry) | |||
1349 | return D_WALK_CONTINUE; | 1341 | return D_WALK_CONTINUE; |
1350 | } | 1342 | } |
1351 | 1343 | ||
1344 | /** | ||
1345 | * have_submounts - check for mounts over a dentry | ||
1346 | * @parent: dentry to check. | ||
1347 | * | ||
1348 | * Return true if the parent or its subdirectories contain | ||
1349 | * a mount point | ||
1350 | */ | ||
1352 | int have_submounts(struct dentry *parent) | 1351 | int have_submounts(struct dentry *parent) |
1353 | { | 1352 | { |
1354 | int ret = 0; | 1353 | int ret = 0; |
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c index c88e355f7635..000eae2782b6 100644 --- a/fs/ecryptfs/crypto.c +++ b/fs/ecryptfs/crypto.c | |||
@@ -408,7 +408,7 @@ static loff_t lower_offset_for_page(struct ecryptfs_crypt_stat *crypt_stat, | |||
408 | struct page *page) | 408 | struct page *page) |
409 | { | 409 | { |
410 | return ecryptfs_lower_header_size(crypt_stat) + | 410 | return ecryptfs_lower_header_size(crypt_stat) + |
411 | (page->index << PAGE_CACHE_SHIFT); | 411 | ((loff_t)page->index << PAGE_CACHE_SHIFT); |
412 | } | 412 | } |
413 | 413 | ||
414 | /** | 414 | /** |
diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c index 7d52806c2119..4725a07f003c 100644 --- a/fs/ecryptfs/keystore.c +++ b/fs/ecryptfs/keystore.c | |||
@@ -1149,7 +1149,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1149 | struct ecryptfs_msg_ctx *msg_ctx; | 1149 | struct ecryptfs_msg_ctx *msg_ctx; |
1150 | struct ecryptfs_message *msg = NULL; | 1150 | struct ecryptfs_message *msg = NULL; |
1151 | char *auth_tok_sig; | 1151 | char *auth_tok_sig; |
1152 | char *payload; | 1152 | char *payload = NULL; |
1153 | size_t payload_len = 0; | 1153 | size_t payload_len = 0; |
1154 | int rc; | 1154 | int rc; |
1155 | 1155 | ||
@@ -1203,6 +1203,7 @@ decrypt_pki_encrypted_session_key(struct ecryptfs_auth_tok *auth_tok, | |||
1203 | } | 1203 | } |
1204 | out: | 1204 | out: |
1205 | kfree(msg); | 1205 | kfree(msg); |
1206 | kfree(payload); | ||
1206 | return rc; | 1207 | return rc; |
1207 | } | 1208 | } |
1208 | 1209 | ||
diff --git a/fs/file_table.c b/fs/file_table.c index abdd15ad13c9..e900ca518635 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -297,7 +297,7 @@ void flush_delayed_fput(void) | |||
297 | delayed_fput(NULL); | 297 | delayed_fput(NULL); |
298 | } | 298 | } |
299 | 299 | ||
300 | static DECLARE_WORK(delayed_fput_work, delayed_fput); | 300 | static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput); |
301 | 301 | ||
302 | void fput(struct file *file) | 302 | void fput(struct file *file) |
303 | { | 303 | { |
@@ -317,7 +317,7 @@ void fput(struct file *file) | |||
317 | } | 317 | } |
318 | 318 | ||
319 | if (llist_add(&file->f_u.fu_llist, &delayed_fput_list)) | 319 | if (llist_add(&file->f_u.fu_llist, &delayed_fput_list)) |
320 | schedule_work(&delayed_fput_work); | 320 | schedule_delayed_work(&delayed_fput_work, 1); |
321 | } | 321 | } |
322 | } | 322 | } |
323 | 323 | ||
diff --git a/fs/jfs/jfs_inode.c b/fs/jfs/jfs_inode.c index c1a3e603279c..7f464c513ba0 100644 --- a/fs/jfs/jfs_inode.c +++ b/fs/jfs/jfs_inode.c | |||
@@ -95,7 +95,7 @@ struct inode *ialloc(struct inode *parent, umode_t mode) | |||
95 | 95 | ||
96 | if (insert_inode_locked(inode) < 0) { | 96 | if (insert_inode_locked(inode) < 0) { |
97 | rc = -EINVAL; | 97 | rc = -EINVAL; |
98 | goto fail_unlock; | 98 | goto fail_put; |
99 | } | 99 | } |
100 | 100 | ||
101 | inode_init_owner(inode, parent, mode); | 101 | inode_init_owner(inode, parent, mode); |
@@ -156,7 +156,6 @@ struct inode *ialloc(struct inode *parent, umode_t mode) | |||
156 | fail_drop: | 156 | fail_drop: |
157 | dquot_drop(inode); | 157 | dquot_drop(inode); |
158 | inode->i_flags |= S_NOQUOTA; | 158 | inode->i_flags |= S_NOQUOTA; |
159 | fail_unlock: | ||
160 | clear_nlink(inode); | 159 | clear_nlink(inode); |
161 | unlock_new_inode(inode); | 160 | unlock_new_inode(inode); |
162 | fail_put: | 161 | fail_put: |
diff --git a/fs/namei.c b/fs/namei.c index 645268f23eb6..caa28051e197 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -2294,10 +2294,11 @@ out: | |||
2294 | * path_mountpoint - look up a path to be umounted | 2294 | * path_mountpoint - look up a path to be umounted |
2295 | * @dfd: directory file descriptor to start walk from | 2295 | * @dfd: directory file descriptor to start walk from |
2296 | * @name: full pathname to walk | 2296 | * @name: full pathname to walk |
2297 | * @path: pointer to container for result | ||
2297 | * @flags: lookup flags | 2298 | * @flags: lookup flags |
2298 | * | 2299 | * |
2299 | * Look up the given name, but don't attempt to revalidate the last component. | 2300 | * Look up the given name, but don't attempt to revalidate the last component. |
2300 | * Returns 0 and "path" will be valid on success; Retuns error otherwise. | 2301 | * Returns 0 and "path" will be valid on success; Returns error otherwise. |
2301 | */ | 2302 | */ |
2302 | static int | 2303 | static int |
2303 | path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags) | 2304 | path_mountpoint(int dfd, const char *name, struct path *path, unsigned int flags) |
diff --git a/fs/seq_file.c b/fs/seq_file.c index 3135c2525c76..a290157265ef 100644 --- a/fs/seq_file.c +++ b/fs/seq_file.c | |||
@@ -328,6 +328,8 @@ loff_t seq_lseek(struct file *file, loff_t offset, int whence) | |||
328 | m->read_pos = offset; | 328 | m->read_pos = offset; |
329 | retval = file->f_pos = offset; | 329 | retval = file->f_pos = offset; |
330 | } | 330 | } |
331 | } else { | ||
332 | file->f_pos = offset; | ||
331 | } | 333 | } |
332 | } | 334 | } |
333 | file->f_version = m->version; | 335 | file->f_version = m->version; |
diff --git a/include/linux/filter.h b/include/linux/filter.h index a6ac84871d6d..ff4e40cd45b1 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -6,6 +6,7 @@ | |||
6 | 6 | ||
7 | #include <linux/atomic.h> | 7 | #include <linux/atomic.h> |
8 | #include <linux/compat.h> | 8 | #include <linux/compat.h> |
9 | #include <linux/workqueue.h> | ||
9 | #include <uapi/linux/filter.h> | 10 | #include <uapi/linux/filter.h> |
10 | 11 | ||
11 | #ifdef CONFIG_COMPAT | 12 | #ifdef CONFIG_COMPAT |
@@ -25,15 +26,19 @@ struct sk_filter | |||
25 | { | 26 | { |
26 | atomic_t refcnt; | 27 | atomic_t refcnt; |
27 | unsigned int len; /* Number of filter blocks */ | 28 | unsigned int len; /* Number of filter blocks */ |
29 | struct rcu_head rcu; | ||
28 | unsigned int (*bpf_func)(const struct sk_buff *skb, | 30 | unsigned int (*bpf_func)(const struct sk_buff *skb, |
29 | const struct sock_filter *filter); | 31 | const struct sock_filter *filter); |
30 | struct rcu_head rcu; | 32 | union { |
31 | struct sock_filter insns[0]; | 33 | struct sock_filter insns[0]; |
34 | struct work_struct work; | ||
35 | }; | ||
32 | }; | 36 | }; |
33 | 37 | ||
34 | static inline unsigned int sk_filter_len(const struct sk_filter *fp) | 38 | static inline unsigned int sk_filter_size(unsigned int proglen) |
35 | { | 39 | { |
36 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); | 40 | return max(sizeof(struct sk_filter), |
41 | offsetof(struct sk_filter, insns[proglen])); | ||
37 | } | 42 | } |
38 | 43 | ||
39 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); | 44 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
@@ -67,11 +72,13 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | |||
67 | } | 72 | } |
68 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) | 73 | #define SK_RUN_FILTER(FILTER, SKB) (*FILTER->bpf_func)(SKB, FILTER->insns) |
69 | #else | 74 | #else |
75 | #include <linux/slab.h> | ||
70 | static inline void bpf_jit_compile(struct sk_filter *fp) | 76 | static inline void bpf_jit_compile(struct sk_filter *fp) |
71 | { | 77 | { |
72 | } | 78 | } |
73 | static inline void bpf_jit_free(struct sk_filter *fp) | 79 | static inline void bpf_jit_free(struct sk_filter *fp) |
74 | { | 80 | { |
81 | kfree(fp); | ||
75 | } | 82 | } |
76 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) | 83 | #define SK_RUN_FILTER(FILTER, SKB) sk_run_filter(SKB, FILTER->insns) |
77 | #endif | 84 | #endif |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3de49aca4519..25f5d2d11e7c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2264,11 +2264,12 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
2264 | } | 2264 | } |
2265 | 2265 | ||
2266 | #ifdef CONFIG_XPS | 2266 | #ifdef CONFIG_XPS |
2267 | extern int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, | 2267 | extern int netif_set_xps_queue(struct net_device *dev, |
2268 | const struct cpumask *mask, | ||
2268 | u16 index); | 2269 | u16 index); |
2269 | #else | 2270 | #else |
2270 | static inline int netif_set_xps_queue(struct net_device *dev, | 2271 | static inline int netif_set_xps_queue(struct net_device *dev, |
2271 | struct cpumask *mask, | 2272 | const struct cpumask *mask, |
2272 | u16 index) | 2273 | u16 index) |
2273 | { | 2274 | { |
2274 | return 0; | 2275 | return 0; |
diff --git a/include/linux/yam.h b/include/linux/yam.h index 7fe28228b274..512cdc2fb80f 100644 --- a/include/linux/yam.h +++ b/include/linux/yam.h | |||
@@ -77,6 +77,6 @@ struct yamdrv_ioctl_cfg { | |||
77 | 77 | ||
78 | struct yamdrv_ioctl_mcs { | 78 | struct yamdrv_ioctl_mcs { |
79 | int cmd; | 79 | int cmd; |
80 | int bitrate; | 80 | unsigned int bitrate; |
81 | unsigned char bits[YAM_FPGA_SIZE]; | 81 | unsigned char bits[YAM_FPGA_SIZE]; |
82 | }; | 82 | }; |
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h index a7a683e30b64..a8c2ef6d3b93 100644 --- a/include/net/cipso_ipv4.h +++ b/include/net/cipso_ipv4.h | |||
@@ -290,6 +290,7 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
290 | unsigned char err_offset = 0; | 290 | unsigned char err_offset = 0; |
291 | u8 opt_len = opt[1]; | 291 | u8 opt_len = opt[1]; |
292 | u8 opt_iter; | 292 | u8 opt_iter; |
293 | u8 tag_len; | ||
293 | 294 | ||
294 | if (opt_len < 8) { | 295 | if (opt_len < 8) { |
295 | err_offset = 1; | 296 | err_offset = 1; |
@@ -302,11 +303,12 @@ static inline int cipso_v4_validate(const struct sk_buff *skb, | |||
302 | } | 303 | } |
303 | 304 | ||
304 | for (opt_iter = 6; opt_iter < opt_len;) { | 305 | for (opt_iter = 6; opt_iter < opt_len;) { |
305 | if (opt[opt_iter + 1] > (opt_len - opt_iter)) { | 306 | tag_len = opt[opt_iter + 1]; |
307 | if ((tag_len == 0) || (opt[opt_iter + 1] > (opt_len - opt_iter))) { | ||
306 | err_offset = opt_iter + 1; | 308 | err_offset = opt_iter + 1; |
307 | goto out; | 309 | goto out; |
308 | } | 310 | } |
309 | opt_iter += opt[opt_iter + 1]; | 311 | opt_iter += tag_len; |
310 | } | 312 | } |
311 | 313 | ||
312 | out: | 314 | out: |
diff --git a/include/net/dst.h b/include/net/dst.h index 3bc4865f8267..3c4c944096c9 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -479,10 +479,22 @@ static inline struct dst_entry *xfrm_lookup(struct net *net, | |||
479 | { | 479 | { |
480 | return dst_orig; | 480 | return dst_orig; |
481 | } | 481 | } |
482 | |||
483 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | ||
484 | { | ||
485 | return NULL; | ||
486 | } | ||
487 | |||
482 | #else | 488 | #else |
483 | extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, | 489 | extern struct dst_entry *xfrm_lookup(struct net *net, struct dst_entry *dst_orig, |
484 | const struct flowi *fl, struct sock *sk, | 490 | const struct flowi *fl, struct sock *sk, |
485 | int flags); | 491 | int flags); |
492 | |||
493 | /* skb attached with this dst needs transformation if dst->xfrm is valid */ | ||
494 | static inline struct xfrm_state *dst_xfrm(const struct dst_entry *dst) | ||
495 | { | ||
496 | return dst->xfrm; | ||
497 | } | ||
486 | #endif | 498 | #endif |
487 | 499 | ||
488 | #endif /* _NET_DST_H */ | 500 | #endif /* _NET_DST_H */ |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index f525e7038cca..2b786b7e3585 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -194,11 +194,9 @@ static inline int ip6_skb_dst_mtu(struct sk_buff *skb) | |||
194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); | 194 | skb_dst(skb)->dev->mtu : dst_mtu(skb_dst(skb)); |
195 | } | 195 | } |
196 | 196 | ||
197 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt, struct in6_addr *dest) | 197 | static inline struct in6_addr *rt6_nexthop(struct rt6_info *rt) |
198 | { | 198 | { |
199 | if (rt->rt6i_flags & RTF_GATEWAY) | 199 | return &rt->rt6i_gateway; |
200 | return &rt->rt6i_gateway; | ||
201 | return dest; | ||
202 | } | 200 | } |
203 | 201 | ||
204 | #endif | 202 | #endif |
diff --git a/include/net/mac802154.h b/include/net/mac802154.h index d0d11df9cba1..807d6b7a943f 100644 --- a/include/net/mac802154.h +++ b/include/net/mac802154.h | |||
@@ -133,7 +133,7 @@ struct ieee802154_ops { | |||
133 | 133 | ||
134 | /* Basic interface to register ieee802154 device */ | 134 | /* Basic interface to register ieee802154 device */ |
135 | struct ieee802154_dev * | 135 | struct ieee802154_dev * |
136 | ieee802154_alloc_device(size_t priv_data_lex, struct ieee802154_ops *ops); | 136 | ieee802154_alloc_device(size_t priv_data_len, struct ieee802154_ops *ops); |
137 | void ieee802154_free_device(struct ieee802154_dev *dev); | 137 | void ieee802154_free_device(struct ieee802154_dev *dev); |
138 | int ieee802154_register_device(struct ieee802154_dev *dev); | 138 | int ieee802154_register_device(struct ieee802154_dev *dev); |
139 | void ieee802154_unregister_device(struct ieee802154_dev *dev); | 139 | void ieee802154_unregister_device(struct ieee802154_dev *dev); |
diff --git a/include/net/sock.h b/include/net/sock.h index 1d37a8086bed..808cbc2ec6c1 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -1630,16 +1630,14 @@ static inline void sk_filter_release(struct sk_filter *fp) | |||
1630 | 1630 | ||
1631 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) | 1631 | static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) |
1632 | { | 1632 | { |
1633 | unsigned int size = sk_filter_len(fp); | 1633 | atomic_sub(sk_filter_size(fp->len), &sk->sk_omem_alloc); |
1634 | |||
1635 | atomic_sub(size, &sk->sk_omem_alloc); | ||
1636 | sk_filter_release(fp); | 1634 | sk_filter_release(fp); |
1637 | } | 1635 | } |
1638 | 1636 | ||
1639 | static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) | 1637 | static inline void sk_filter_charge(struct sock *sk, struct sk_filter *fp) |
1640 | { | 1638 | { |
1641 | atomic_inc(&fp->refcnt); | 1639 | atomic_inc(&fp->refcnt); |
1642 | atomic_add(sk_filter_len(fp), &sk->sk_omem_alloc); | 1640 | atomic_add(sk_filter_size(fp->len), &sk->sk_omem_alloc); |
1643 | } | 1641 | } |
1644 | 1642 | ||
1645 | /* | 1643 | /* |
diff --git a/include/trace/events/target.h b/include/trace/events/target.h index aef8fc354025..da9cc0f05c93 100644 --- a/include/trace/events/target.h +++ b/include/trace/events/target.h | |||
@@ -144,7 +144,7 @@ TRACE_EVENT(target_sequencer_start, | |||
144 | ), | 144 | ), |
145 | 145 | ||
146 | TP_fast_assign( | 146 | TP_fast_assign( |
147 | __entry->unpacked_lun = cmd->se_lun->unpacked_lun; | 147 | __entry->unpacked_lun = cmd->orig_fe_lun; |
148 | __entry->opcode = cmd->t_task_cdb[0]; | 148 | __entry->opcode = cmd->t_task_cdb[0]; |
149 | __entry->data_length = cmd->data_length; | 149 | __entry->data_length = cmd->data_length; |
150 | __entry->task_attribute = cmd->sam_task_attr; | 150 | __entry->task_attribute = cmd->sam_task_attr; |
@@ -182,7 +182,7 @@ TRACE_EVENT(target_cmd_complete, | |||
182 | ), | 182 | ), |
183 | 183 | ||
184 | TP_fast_assign( | 184 | TP_fast_assign( |
185 | __entry->unpacked_lun = cmd->se_lun->unpacked_lun; | 185 | __entry->unpacked_lun = cmd->orig_fe_lun; |
186 | __entry->opcode = cmd->t_task_cdb[0]; | 186 | __entry->opcode = cmd->t_task_cdb[0]; |
187 | __entry->data_length = cmd->data_length; | 187 | __entry->data_length = cmd->data_length; |
188 | __entry->task_attribute = cmd->sam_task_attr; | 188 | __entry->task_attribute = cmd->sam_task_attr; |
diff --git a/include/uapi/drm/drm_mode.h b/include/uapi/drm/drm_mode.h index 550811712f78..28acbaf4a81e 100644 --- a/include/uapi/drm/drm_mode.h +++ b/include/uapi/drm/drm_mode.h | |||
@@ -223,6 +223,8 @@ struct drm_mode_get_connector { | |||
223 | __u32 connection; | 223 | __u32 connection; |
224 | __u32 mm_width, mm_height; /**< HxW in millimeters */ | 224 | __u32 mm_width, mm_height; /**< HxW in millimeters */ |
225 | __u32 subpixel; | 225 | __u32 subpixel; |
226 | |||
227 | __u32 pad; | ||
226 | }; | 228 | }; |
227 | 229 | ||
228 | #define DRM_MODE_PROP_PENDING (1<<0) | 230 | #define DRM_MODE_PROP_PENDING (1<<0) |
diff --git a/include/uapi/linux/tc_act/Kbuild b/include/uapi/linux/tc_act/Kbuild index 0623ec4e728f..56f121605c99 100644 --- a/include/uapi/linux/tc_act/Kbuild +++ b/include/uapi/linux/tc_act/Kbuild | |||
@@ -1,5 +1,6 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += tc_csum.h | 2 | header-y += tc_csum.h |
3 | header-y += tc_defact.h | ||
3 | header-y += tc_gact.h | 4 | header-y += tc_gact.h |
4 | header-y += tc_ipt.h | 5 | header-y += tc_ipt.h |
5 | header-y += tc_mirred.h | 6 | header-y += tc_mirred.h |
diff --git a/include/linux/tc_act/tc_defact.h b/include/uapi/linux/tc_act/tc_defact.h index 6f65d07c7ce2..17dddb40f740 100644 --- a/include/linux/tc_act/tc_defact.h +++ b/include/uapi/linux/tc_act/tc_defact.h | |||
@@ -6,7 +6,7 @@ | |||
6 | struct tc_defact { | 6 | struct tc_defact { |
7 | tc_gen; | 7 | tc_gen; |
8 | }; | 8 | }; |
9 | 9 | ||
10 | enum { | 10 | enum { |
11 | TCA_DEF_UNSPEC, | 11 | TCA_DEF_UNSPEC, |
12 | TCA_DEF_TM, | 12 | TCA_DEF_TM, |
diff --git a/include/uapi/rdma/ib_user_verbs.h b/include/uapi/rdma/ib_user_verbs.h index 0b233c56b0e4..e3ddd86c90a6 100644 --- a/include/uapi/rdma/ib_user_verbs.h +++ b/include/uapi/rdma/ib_user_verbs.h | |||
@@ -87,8 +87,10 @@ enum { | |||
87 | IB_USER_VERBS_CMD_CLOSE_XRCD, | 87 | IB_USER_VERBS_CMD_CLOSE_XRCD, |
88 | IB_USER_VERBS_CMD_CREATE_XSRQ, | 88 | IB_USER_VERBS_CMD_CREATE_XSRQ, |
89 | IB_USER_VERBS_CMD_OPEN_QP, | 89 | IB_USER_VERBS_CMD_OPEN_QP, |
90 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
90 | IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, | 91 | IB_USER_VERBS_CMD_CREATE_FLOW = IB_USER_VERBS_CMD_THRESHOLD, |
91 | IB_USER_VERBS_CMD_DESTROY_FLOW | 92 | IB_USER_VERBS_CMD_DESTROY_FLOW |
93 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
92 | }; | 94 | }; |
93 | 95 | ||
94 | /* | 96 | /* |
@@ -126,6 +128,7 @@ struct ib_uverbs_cmd_hdr { | |||
126 | __u16 out_words; | 128 | __u16 out_words; |
127 | }; | 129 | }; |
128 | 130 | ||
131 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
129 | struct ib_uverbs_cmd_hdr_ex { | 132 | struct ib_uverbs_cmd_hdr_ex { |
130 | __u32 command; | 133 | __u32 command; |
131 | __u16 in_words; | 134 | __u16 in_words; |
@@ -134,6 +137,7 @@ struct ib_uverbs_cmd_hdr_ex { | |||
134 | __u16 provider_out_words; | 137 | __u16 provider_out_words; |
135 | __u32 cmd_hdr_reserved; | 138 | __u32 cmd_hdr_reserved; |
136 | }; | 139 | }; |
140 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
137 | 141 | ||
138 | struct ib_uverbs_get_context { | 142 | struct ib_uverbs_get_context { |
139 | __u64 response; | 143 | __u64 response; |
@@ -696,6 +700,7 @@ struct ib_uverbs_detach_mcast { | |||
696 | __u64 driver_data[0]; | 700 | __u64 driver_data[0]; |
697 | }; | 701 | }; |
698 | 702 | ||
703 | #ifdef CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING | ||
699 | struct ib_kern_eth_filter { | 704 | struct ib_kern_eth_filter { |
700 | __u8 dst_mac[6]; | 705 | __u8 dst_mac[6]; |
701 | __u8 src_mac[6]; | 706 | __u8 src_mac[6]; |
@@ -780,6 +785,7 @@ struct ib_uverbs_destroy_flow { | |||
780 | __u32 comp_mask; | 785 | __u32 comp_mask; |
781 | __u32 flow_handle; | 786 | __u32 flow_handle; |
782 | }; | 787 | }; |
788 | #endif /* CONFIG_INFINIBAND_EXPERIMENTAL_UVERBS_FLOW_STEERING */ | ||
783 | 789 | ||
784 | struct ib_uverbs_create_srq { | 790 | struct ib_uverbs_create_srq { |
785 | __u64 response; | 791 | __u64 response; |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index 2418b6e71a85..8bd9cfdc70d7 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -2039,7 +2039,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||
2039 | 2039 | ||
2040 | /* @tsk either already exited or can't exit until the end */ | 2040 | /* @tsk either already exited or can't exit until the end */ |
2041 | if (tsk->flags & PF_EXITING) | 2041 | if (tsk->flags & PF_EXITING) |
2042 | continue; | 2042 | goto next; |
2043 | 2043 | ||
2044 | /* as per above, nr_threads may decrease, but not increase. */ | 2044 | /* as per above, nr_threads may decrease, but not increase. */ |
2045 | BUG_ON(i >= group_size); | 2045 | BUG_ON(i >= group_size); |
@@ -2047,7 +2047,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||
2047 | ent.cgrp = task_cgroup_from_root(tsk, root); | 2047 | ent.cgrp = task_cgroup_from_root(tsk, root); |
2048 | /* nothing to do if this task is already in the cgroup */ | 2048 | /* nothing to do if this task is already in the cgroup */ |
2049 | if (ent.cgrp == cgrp) | 2049 | if (ent.cgrp == cgrp) |
2050 | continue; | 2050 | goto next; |
2051 | /* | 2051 | /* |
2052 | * saying GFP_ATOMIC has no effect here because we did prealloc | 2052 | * saying GFP_ATOMIC has no effect here because we did prealloc |
2053 | * earlier, but it's good form to communicate our expectations. | 2053 | * earlier, but it's good form to communicate our expectations. |
@@ -2055,7 +2055,7 @@ static int cgroup_attach_task(struct cgroup *cgrp, struct task_struct *tsk, | |||
2055 | retval = flex_array_put(group, i, &ent, GFP_ATOMIC); | 2055 | retval = flex_array_put(group, i, &ent, GFP_ATOMIC); |
2056 | BUG_ON(retval != 0); | 2056 | BUG_ON(retval != 0); |
2057 | i++; | 2057 | i++; |
2058 | 2058 | next: | |
2059 | if (!threadgroup) | 2059 | if (!threadgroup) |
2060 | break; | 2060 | break; |
2061 | } while_each_thread(leader, tsk); | 2061 | } while_each_thread(leader, tsk); |
@@ -3188,11 +3188,9 @@ css_next_descendant_post(struct cgroup_subsys_state *pos, | |||
3188 | 3188 | ||
3189 | WARN_ON_ONCE(!rcu_read_lock_held()); | 3189 | WARN_ON_ONCE(!rcu_read_lock_held()); |
3190 | 3190 | ||
3191 | /* if first iteration, visit the leftmost descendant */ | 3191 | /* if first iteration, visit leftmost descendant which may be @root */ |
3192 | if (!pos) { | 3192 | if (!pos) |
3193 | next = css_leftmost_descendant(root); | 3193 | return css_leftmost_descendant(root); |
3194 | return next != root ? next : NULL; | ||
3195 | } | ||
3196 | 3194 | ||
3197 | /* if we visited @root, we're done */ | 3195 | /* if we visited @root, we're done */ |
3198 | if (pos == root) | 3196 | if (pos == root) |
diff --git a/kernel/events/core.c b/kernel/events/core.c index d49a9d29334c..953c14348375 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c | |||
@@ -6767,6 +6767,10 @@ static int perf_copy_attr(struct perf_event_attr __user *uattr, | |||
6767 | if (ret) | 6767 | if (ret) |
6768 | return -EFAULT; | 6768 | return -EFAULT; |
6769 | 6769 | ||
6770 | /* disabled for now */ | ||
6771 | if (attr->mmap2) | ||
6772 | return -EINVAL; | ||
6773 | |||
6770 | if (attr->__reserved_1) | 6774 | if (attr->__reserved_1) |
6771 | return -EINVAL; | 6775 | return -EINVAL; |
6772 | 6776 | ||
diff --git a/kernel/mutex.c b/kernel/mutex.c index 6d647aedffea..d24105b1b794 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c | |||
@@ -410,7 +410,7 @@ ww_mutex_set_context_fastpath(struct ww_mutex *lock, | |||
410 | static __always_inline int __sched | 410 | static __always_inline int __sched |
411 | __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | 411 | __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, |
412 | struct lockdep_map *nest_lock, unsigned long ip, | 412 | struct lockdep_map *nest_lock, unsigned long ip, |
413 | struct ww_acquire_ctx *ww_ctx) | 413 | struct ww_acquire_ctx *ww_ctx, const bool use_ww_ctx) |
414 | { | 414 | { |
415 | struct task_struct *task = current; | 415 | struct task_struct *task = current; |
416 | struct mutex_waiter waiter; | 416 | struct mutex_waiter waiter; |
@@ -450,7 +450,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | |||
450 | struct task_struct *owner; | 450 | struct task_struct *owner; |
451 | struct mspin_node node; | 451 | struct mspin_node node; |
452 | 452 | ||
453 | if (!__builtin_constant_p(ww_ctx == NULL) && ww_ctx->acquired > 0) { | 453 | if (use_ww_ctx && ww_ctx->acquired > 0) { |
454 | struct ww_mutex *ww; | 454 | struct ww_mutex *ww; |
455 | 455 | ||
456 | ww = container_of(lock, struct ww_mutex, base); | 456 | ww = container_of(lock, struct ww_mutex, base); |
@@ -480,7 +480,7 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | |||
480 | if ((atomic_read(&lock->count) == 1) && | 480 | if ((atomic_read(&lock->count) == 1) && |
481 | (atomic_cmpxchg(&lock->count, 1, 0) == 1)) { | 481 | (atomic_cmpxchg(&lock->count, 1, 0) == 1)) { |
482 | lock_acquired(&lock->dep_map, ip); | 482 | lock_acquired(&lock->dep_map, ip); |
483 | if (!__builtin_constant_p(ww_ctx == NULL)) { | 483 | if (use_ww_ctx) { |
484 | struct ww_mutex *ww; | 484 | struct ww_mutex *ww; |
485 | ww = container_of(lock, struct ww_mutex, base); | 485 | ww = container_of(lock, struct ww_mutex, base); |
486 | 486 | ||
@@ -551,7 +551,7 @@ slowpath: | |||
551 | goto err; | 551 | goto err; |
552 | } | 552 | } |
553 | 553 | ||
554 | if (!__builtin_constant_p(ww_ctx == NULL) && ww_ctx->acquired > 0) { | 554 | if (use_ww_ctx && ww_ctx->acquired > 0) { |
555 | ret = __mutex_lock_check_stamp(lock, ww_ctx); | 555 | ret = __mutex_lock_check_stamp(lock, ww_ctx); |
556 | if (ret) | 556 | if (ret) |
557 | goto err; | 557 | goto err; |
@@ -575,7 +575,7 @@ skip_wait: | |||
575 | lock_acquired(&lock->dep_map, ip); | 575 | lock_acquired(&lock->dep_map, ip); |
576 | mutex_set_owner(lock); | 576 | mutex_set_owner(lock); |
577 | 577 | ||
578 | if (!__builtin_constant_p(ww_ctx == NULL)) { | 578 | if (use_ww_ctx) { |
579 | struct ww_mutex *ww = container_of(lock, struct ww_mutex, base); | 579 | struct ww_mutex *ww = container_of(lock, struct ww_mutex, base); |
580 | struct mutex_waiter *cur; | 580 | struct mutex_waiter *cur; |
581 | 581 | ||
@@ -615,7 +615,7 @@ mutex_lock_nested(struct mutex *lock, unsigned int subclass) | |||
615 | { | 615 | { |
616 | might_sleep(); | 616 | might_sleep(); |
617 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, | 617 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, |
618 | subclass, NULL, _RET_IP_, NULL); | 618 | subclass, NULL, _RET_IP_, NULL, 0); |
619 | } | 619 | } |
620 | 620 | ||
621 | EXPORT_SYMBOL_GPL(mutex_lock_nested); | 621 | EXPORT_SYMBOL_GPL(mutex_lock_nested); |
@@ -625,7 +625,7 @@ _mutex_lock_nest_lock(struct mutex *lock, struct lockdep_map *nest) | |||
625 | { | 625 | { |
626 | might_sleep(); | 626 | might_sleep(); |
627 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, | 627 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, |
628 | 0, nest, _RET_IP_, NULL); | 628 | 0, nest, _RET_IP_, NULL, 0); |
629 | } | 629 | } |
630 | 630 | ||
631 | EXPORT_SYMBOL_GPL(_mutex_lock_nest_lock); | 631 | EXPORT_SYMBOL_GPL(_mutex_lock_nest_lock); |
@@ -635,7 +635,7 @@ mutex_lock_killable_nested(struct mutex *lock, unsigned int subclass) | |||
635 | { | 635 | { |
636 | might_sleep(); | 636 | might_sleep(); |
637 | return __mutex_lock_common(lock, TASK_KILLABLE, | 637 | return __mutex_lock_common(lock, TASK_KILLABLE, |
638 | subclass, NULL, _RET_IP_, NULL); | 638 | subclass, NULL, _RET_IP_, NULL, 0); |
639 | } | 639 | } |
640 | EXPORT_SYMBOL_GPL(mutex_lock_killable_nested); | 640 | EXPORT_SYMBOL_GPL(mutex_lock_killable_nested); |
641 | 641 | ||
@@ -644,7 +644,7 @@ mutex_lock_interruptible_nested(struct mutex *lock, unsigned int subclass) | |||
644 | { | 644 | { |
645 | might_sleep(); | 645 | might_sleep(); |
646 | return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, | 646 | return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, |
647 | subclass, NULL, _RET_IP_, NULL); | 647 | subclass, NULL, _RET_IP_, NULL, 0); |
648 | } | 648 | } |
649 | 649 | ||
650 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); | 650 | EXPORT_SYMBOL_GPL(mutex_lock_interruptible_nested); |
@@ -682,7 +682,7 @@ __ww_mutex_lock(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | |||
682 | 682 | ||
683 | might_sleep(); | 683 | might_sleep(); |
684 | ret = __mutex_lock_common(&lock->base, TASK_UNINTERRUPTIBLE, | 684 | ret = __mutex_lock_common(&lock->base, TASK_UNINTERRUPTIBLE, |
685 | 0, &ctx->dep_map, _RET_IP_, ctx); | 685 | 0, &ctx->dep_map, _RET_IP_, ctx, 1); |
686 | if (!ret && ctx->acquired > 1) | 686 | if (!ret && ctx->acquired > 1) |
687 | return ww_mutex_deadlock_injection(lock, ctx); | 687 | return ww_mutex_deadlock_injection(lock, ctx); |
688 | 688 | ||
@@ -697,7 +697,7 @@ __ww_mutex_lock_interruptible(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | |||
697 | 697 | ||
698 | might_sleep(); | 698 | might_sleep(); |
699 | ret = __mutex_lock_common(&lock->base, TASK_INTERRUPTIBLE, | 699 | ret = __mutex_lock_common(&lock->base, TASK_INTERRUPTIBLE, |
700 | 0, &ctx->dep_map, _RET_IP_, ctx); | 700 | 0, &ctx->dep_map, _RET_IP_, ctx, 1); |
701 | 701 | ||
702 | if (!ret && ctx->acquired > 1) | 702 | if (!ret && ctx->acquired > 1) |
703 | return ww_mutex_deadlock_injection(lock, ctx); | 703 | return ww_mutex_deadlock_injection(lock, ctx); |
@@ -809,28 +809,28 @@ __mutex_lock_slowpath(atomic_t *lock_count) | |||
809 | struct mutex *lock = container_of(lock_count, struct mutex, count); | 809 | struct mutex *lock = container_of(lock_count, struct mutex, count); |
810 | 810 | ||
811 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, 0, | 811 | __mutex_lock_common(lock, TASK_UNINTERRUPTIBLE, 0, |
812 | NULL, _RET_IP_, NULL); | 812 | NULL, _RET_IP_, NULL, 0); |
813 | } | 813 | } |
814 | 814 | ||
815 | static noinline int __sched | 815 | static noinline int __sched |
816 | __mutex_lock_killable_slowpath(struct mutex *lock) | 816 | __mutex_lock_killable_slowpath(struct mutex *lock) |
817 | { | 817 | { |
818 | return __mutex_lock_common(lock, TASK_KILLABLE, 0, | 818 | return __mutex_lock_common(lock, TASK_KILLABLE, 0, |
819 | NULL, _RET_IP_, NULL); | 819 | NULL, _RET_IP_, NULL, 0); |
820 | } | 820 | } |
821 | 821 | ||
822 | static noinline int __sched | 822 | static noinline int __sched |
823 | __mutex_lock_interruptible_slowpath(struct mutex *lock) | 823 | __mutex_lock_interruptible_slowpath(struct mutex *lock) |
824 | { | 824 | { |
825 | return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, 0, | 825 | return __mutex_lock_common(lock, TASK_INTERRUPTIBLE, 0, |
826 | NULL, _RET_IP_, NULL); | 826 | NULL, _RET_IP_, NULL, 0); |
827 | } | 827 | } |
828 | 828 | ||
829 | static noinline int __sched | 829 | static noinline int __sched |
830 | __ww_mutex_lock_slowpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) | 830 | __ww_mutex_lock_slowpath(struct ww_mutex *lock, struct ww_acquire_ctx *ctx) |
831 | { | 831 | { |
832 | return __mutex_lock_common(&lock->base, TASK_UNINTERRUPTIBLE, 0, | 832 | return __mutex_lock_common(&lock->base, TASK_UNINTERRUPTIBLE, 0, |
833 | NULL, _RET_IP_, ctx); | 833 | NULL, _RET_IP_, ctx, 1); |
834 | } | 834 | } |
835 | 835 | ||
836 | static noinline int __sched | 836 | static noinline int __sched |
@@ -838,7 +838,7 @@ __ww_mutex_lock_interruptible_slowpath(struct ww_mutex *lock, | |||
838 | struct ww_acquire_ctx *ctx) | 838 | struct ww_acquire_ctx *ctx) |
839 | { | 839 | { |
840 | return __mutex_lock_common(&lock->base, TASK_INTERRUPTIBLE, 0, | 840 | return __mutex_lock_common(&lock->base, TASK_INTERRUPTIBLE, 0, |
841 | NULL, _RET_IP_, ctx); | 841 | NULL, _RET_IP_, ctx, 1); |
842 | } | 842 | } |
843 | 843 | ||
844 | #endif | 844 | #endif |
diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c index c9c759d5a15c..0121dab83f43 100644 --- a/kernel/power/hibernate.c +++ b/kernel/power/hibernate.c | |||
@@ -846,7 +846,7 @@ static int software_resume(void) | |||
846 | goto Finish; | 846 | goto Finish; |
847 | } | 847 | } |
848 | 848 | ||
849 | late_initcall(software_resume); | 849 | late_initcall_sync(software_resume); |
850 | 850 | ||
851 | 851 | ||
852 | static const char * const hibernation_modes[] = { | 852 | static const char * const hibernation_modes[] = { |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 38959c866789..662c5798a685 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -33,29 +33,64 @@ struct ce_unbind { | |||
33 | int res; | 33 | int res; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | /** | 36 | static u64 cev_delta2ns(unsigned long latch, struct clock_event_device *evt, |
37 | * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds | 37 | bool ismax) |
38 | * @latch: value to convert | ||
39 | * @evt: pointer to clock event device descriptor | ||
40 | * | ||
41 | * Math helper, returns latch value converted to nanoseconds (bound checked) | ||
42 | */ | ||
43 | u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt) | ||
44 | { | 38 | { |
45 | u64 clc = (u64) latch << evt->shift; | 39 | u64 clc = (u64) latch << evt->shift; |
40 | u64 rnd; | ||
46 | 41 | ||
47 | if (unlikely(!evt->mult)) { | 42 | if (unlikely(!evt->mult)) { |
48 | evt->mult = 1; | 43 | evt->mult = 1; |
49 | WARN_ON(1); | 44 | WARN_ON(1); |
50 | } | 45 | } |
46 | rnd = (u64) evt->mult - 1; | ||
47 | |||
48 | /* | ||
49 | * Upper bound sanity check. If the backwards conversion is | ||
50 | * not equal latch, we know that the above shift overflowed. | ||
51 | */ | ||
52 | if ((clc >> evt->shift) != (u64)latch) | ||
53 | clc = ~0ULL; | ||
54 | |||
55 | /* | ||
56 | * Scaled math oddities: | ||
57 | * | ||
58 | * For mult <= (1 << shift) we can safely add mult - 1 to | ||
59 | * prevent integer rounding loss. So the backwards conversion | ||
60 | * from nsec to device ticks will be correct. | ||
61 | * | ||
62 | * For mult > (1 << shift), i.e. device frequency is > 1GHz we | ||
63 | * need to be careful. Adding mult - 1 will result in a value | ||
64 | * which when converted back to device ticks can be larger | ||
65 | * than latch by up to (mult - 1) >> shift. For the min_delta | ||
66 | * calculation we still want to apply this in order to stay | ||
67 | * above the minimum device ticks limit. For the upper limit | ||
68 | * we would end up with a latch value larger than the upper | ||
69 | * limit of the device, so we omit the add to stay below the | ||
70 | * device upper boundary. | ||
71 | * | ||
72 | * Also omit the add if it would overflow the u64 boundary. | ||
73 | */ | ||
74 | if ((~0ULL - clc > rnd) && | ||
75 | (!ismax || evt->mult <= (1U << evt->shift))) | ||
76 | clc += rnd; | ||
51 | 77 | ||
52 | do_div(clc, evt->mult); | 78 | do_div(clc, evt->mult); |
53 | if (clc < 1000) | ||
54 | clc = 1000; | ||
55 | if (clc > KTIME_MAX) | ||
56 | clc = KTIME_MAX; | ||
57 | 79 | ||
58 | return clc; | 80 | /* Deltas less than 1usec are pointless noise */ |
81 | return clc > 1000 ? clc : 1000; | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * clockevents_delta2ns - Convert a latch value (device ticks) to nanoseconds | ||
86 | * @latch: value to convert | ||
87 | * @evt: pointer to clock event device descriptor | ||
88 | * | ||
89 | * Math helper, returns latch value converted to nanoseconds (bound checked) | ||
90 | */ | ||
91 | u64 clockevent_delta2ns(unsigned long latch, struct clock_event_device *evt) | ||
92 | { | ||
93 | return cev_delta2ns(latch, evt, false); | ||
59 | } | 94 | } |
60 | EXPORT_SYMBOL_GPL(clockevent_delta2ns); | 95 | EXPORT_SYMBOL_GPL(clockevent_delta2ns); |
61 | 96 | ||
@@ -380,8 +415,8 @@ void clockevents_config(struct clock_event_device *dev, u32 freq) | |||
380 | sec = 600; | 415 | sec = 600; |
381 | 416 | ||
382 | clockevents_calc_mult_shift(dev, freq, sec); | 417 | clockevents_calc_mult_shift(dev, freq, sec); |
383 | dev->min_delta_ns = clockevent_delta2ns(dev->min_delta_ticks, dev); | 418 | dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false); |
384 | dev->max_delta_ns = clockevent_delta2ns(dev->max_delta_ticks, dev); | 419 | dev->max_delta_ns = cev_delta2ns(dev->max_delta_ticks, dev, true); |
385 | } | 420 | } |
386 | 421 | ||
387 | /** | 422 | /** |
diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c index 309129732285..c7e634af8516 100644 --- a/net/8021q/vlan_netlink.c +++ b/net/8021q/vlan_netlink.c | |||
@@ -171,7 +171,7 @@ static size_t vlan_get_size(const struct net_device *dev) | |||
171 | 171 | ||
172 | return nla_total_size(2) + /* IFLA_VLAN_PROTOCOL */ | 172 | return nla_total_size(2) + /* IFLA_VLAN_PROTOCOL */ |
173 | nla_total_size(2) + /* IFLA_VLAN_ID */ | 173 | nla_total_size(2) + /* IFLA_VLAN_ID */ |
174 | sizeof(struct ifla_vlan_flags) + /* IFLA_VLAN_FLAGS */ | 174 | nla_total_size(sizeof(struct ifla_vlan_flags)) + /* IFLA_VLAN_FLAGS */ |
175 | vlan_qos_map_size(vlan->nr_ingress_mappings) + | 175 | vlan_qos_map_size(vlan->nr_ingress_mappings) + |
176 | vlan_qos_map_size(vlan->nr_egress_mappings); | 176 | vlan_qos_map_size(vlan->nr_egress_mappings); |
177 | } | 177 | } |
diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c index c72d1bcdcf49..1356af660b5b 100644 --- a/net/batman-adv/main.c +++ b/net/batman-adv/main.c | |||
@@ -65,6 +65,7 @@ static int __init batadv_init(void) | |||
65 | batadv_recv_handler_init(); | 65 | batadv_recv_handler_init(); |
66 | 66 | ||
67 | batadv_iv_init(); | 67 | batadv_iv_init(); |
68 | batadv_nc_init(); | ||
68 | 69 | ||
69 | batadv_event_workqueue = create_singlethread_workqueue("bat_events"); | 70 | batadv_event_workqueue = create_singlethread_workqueue("bat_events"); |
70 | 71 | ||
@@ -142,7 +143,7 @@ int batadv_mesh_init(struct net_device *soft_iface) | |||
142 | if (ret < 0) | 143 | if (ret < 0) |
143 | goto err; | 144 | goto err; |
144 | 145 | ||
145 | ret = batadv_nc_init(bat_priv); | 146 | ret = batadv_nc_mesh_init(bat_priv); |
146 | if (ret < 0) | 147 | if (ret < 0) |
147 | goto err; | 148 | goto err; |
148 | 149 | ||
@@ -167,7 +168,7 @@ void batadv_mesh_free(struct net_device *soft_iface) | |||
167 | batadv_vis_quit(bat_priv); | 168 | batadv_vis_quit(bat_priv); |
168 | 169 | ||
169 | batadv_gw_node_purge(bat_priv); | 170 | batadv_gw_node_purge(bat_priv); |
170 | batadv_nc_free(bat_priv); | 171 | batadv_nc_mesh_free(bat_priv); |
171 | batadv_dat_free(bat_priv); | 172 | batadv_dat_free(bat_priv); |
172 | batadv_bla_free(bat_priv); | 173 | batadv_bla_free(bat_priv); |
173 | 174 | ||
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index a487d46e0aec..4ecc0b6bf8ab 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c | |||
@@ -35,6 +35,20 @@ static int batadv_nc_recv_coded_packet(struct sk_buff *skb, | |||
35 | struct batadv_hard_iface *recv_if); | 35 | struct batadv_hard_iface *recv_if); |
36 | 36 | ||
37 | /** | 37 | /** |
38 | * batadv_nc_init - one-time initialization for network coding | ||
39 | */ | ||
40 | int __init batadv_nc_init(void) | ||
41 | { | ||
42 | int ret; | ||
43 | |||
44 | /* Register our packet type */ | ||
45 | ret = batadv_recv_handler_register(BATADV_CODED, | ||
46 | batadv_nc_recv_coded_packet); | ||
47 | |||
48 | return ret; | ||
49 | } | ||
50 | |||
51 | /** | ||
38 | * batadv_nc_start_timer - initialise the nc periodic worker | 52 | * batadv_nc_start_timer - initialise the nc periodic worker |
39 | * @bat_priv: the bat priv with all the soft interface information | 53 | * @bat_priv: the bat priv with all the soft interface information |
40 | */ | 54 | */ |
@@ -45,10 +59,10 @@ static void batadv_nc_start_timer(struct batadv_priv *bat_priv) | |||
45 | } | 59 | } |
46 | 60 | ||
47 | /** | 61 | /** |
48 | * batadv_nc_init - initialise coding hash table and start house keeping | 62 | * batadv_nc_mesh_init - initialise coding hash table and start house keeping |
49 | * @bat_priv: the bat priv with all the soft interface information | 63 | * @bat_priv: the bat priv with all the soft interface information |
50 | */ | 64 | */ |
51 | int batadv_nc_init(struct batadv_priv *bat_priv) | 65 | int batadv_nc_mesh_init(struct batadv_priv *bat_priv) |
52 | { | 66 | { |
53 | bat_priv->nc.timestamp_fwd_flush = jiffies; | 67 | bat_priv->nc.timestamp_fwd_flush = jiffies; |
54 | bat_priv->nc.timestamp_sniffed_purge = jiffies; | 68 | bat_priv->nc.timestamp_sniffed_purge = jiffies; |
@@ -70,11 +84,6 @@ int batadv_nc_init(struct batadv_priv *bat_priv) | |||
70 | batadv_hash_set_lock_class(bat_priv->nc.coding_hash, | 84 | batadv_hash_set_lock_class(bat_priv->nc.coding_hash, |
71 | &batadv_nc_decoding_hash_lock_class_key); | 85 | &batadv_nc_decoding_hash_lock_class_key); |
72 | 86 | ||
73 | /* Register our packet type */ | ||
74 | if (batadv_recv_handler_register(BATADV_CODED, | ||
75 | batadv_nc_recv_coded_packet) < 0) | ||
76 | goto err; | ||
77 | |||
78 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); | 87 | INIT_DELAYED_WORK(&bat_priv->nc.work, batadv_nc_worker); |
79 | batadv_nc_start_timer(bat_priv); | 88 | batadv_nc_start_timer(bat_priv); |
80 | 89 | ||
@@ -1721,12 +1730,11 @@ free_nc_packet: | |||
1721 | } | 1730 | } |
1722 | 1731 | ||
1723 | /** | 1732 | /** |
1724 | * batadv_nc_free - clean up network coding memory | 1733 | * batadv_nc_mesh_free - clean up network coding memory |
1725 | * @bat_priv: the bat priv with all the soft interface information | 1734 | * @bat_priv: the bat priv with all the soft interface information |
1726 | */ | 1735 | */ |
1727 | void batadv_nc_free(struct batadv_priv *bat_priv) | 1736 | void batadv_nc_mesh_free(struct batadv_priv *bat_priv) |
1728 | { | 1737 | { |
1729 | batadv_recv_handler_unregister(BATADV_CODED); | ||
1730 | cancel_delayed_work_sync(&bat_priv->nc.work); | 1738 | cancel_delayed_work_sync(&bat_priv->nc.work); |
1731 | 1739 | ||
1732 | batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL); | 1740 | batadv_nc_purge_paths(bat_priv, bat_priv->nc.coding_hash, NULL); |
diff --git a/net/batman-adv/network-coding.h b/net/batman-adv/network-coding.h index 85a4ec81ad50..ddfa618e80bf 100644 --- a/net/batman-adv/network-coding.h +++ b/net/batman-adv/network-coding.h | |||
@@ -22,8 +22,9 @@ | |||
22 | 22 | ||
23 | #ifdef CONFIG_BATMAN_ADV_NC | 23 | #ifdef CONFIG_BATMAN_ADV_NC |
24 | 24 | ||
25 | int batadv_nc_init(struct batadv_priv *bat_priv); | 25 | int batadv_nc_init(void); |
26 | void batadv_nc_free(struct batadv_priv *bat_priv); | 26 | int batadv_nc_mesh_init(struct batadv_priv *bat_priv); |
27 | void batadv_nc_mesh_free(struct batadv_priv *bat_priv); | ||
27 | void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, | 28 | void batadv_nc_update_nc_node(struct batadv_priv *bat_priv, |
28 | struct batadv_orig_node *orig_node, | 29 | struct batadv_orig_node *orig_node, |
29 | struct batadv_orig_node *orig_neigh_node, | 30 | struct batadv_orig_node *orig_neigh_node, |
@@ -46,12 +47,17 @@ int batadv_nc_init_debugfs(struct batadv_priv *bat_priv); | |||
46 | 47 | ||
47 | #else /* ifdef CONFIG_BATMAN_ADV_NC */ | 48 | #else /* ifdef CONFIG_BATMAN_ADV_NC */ |
48 | 49 | ||
49 | static inline int batadv_nc_init(struct batadv_priv *bat_priv) | 50 | static inline int batadv_nc_init(void) |
50 | { | 51 | { |
51 | return 0; | 52 | return 0; |
52 | } | 53 | } |
53 | 54 | ||
54 | static inline void batadv_nc_free(struct batadv_priv *bat_priv) | 55 | static inline int batadv_nc_mesh_init(struct batadv_priv *bat_priv) |
56 | { | ||
57 | return 0; | ||
58 | } | ||
59 | |||
60 | static inline void batadv_nc_mesh_free(struct batadv_priv *bat_priv) | ||
55 | { | 61 | { |
56 | return; | 62 | return; |
57 | } | 63 | } |
diff --git a/net/bridge/br_fdb.c b/net/bridge/br_fdb.c index ffd5874f2592..33e8f23acddd 100644 --- a/net/bridge/br_fdb.c +++ b/net/bridge/br_fdb.c | |||
@@ -700,7 +700,7 @@ int br_fdb_add(struct ndmsg *ndm, struct nlattr *tb[], | |||
700 | 700 | ||
701 | vid = nla_get_u16(tb[NDA_VLAN]); | 701 | vid = nla_get_u16(tb[NDA_VLAN]); |
702 | 702 | ||
703 | if (vid >= VLAN_N_VID) { | 703 | if (!vid || vid >= VLAN_VID_MASK) { |
704 | pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n", | 704 | pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n", |
705 | vid); | 705 | vid); |
706 | return -EINVAL; | 706 | return -EINVAL; |
@@ -794,7 +794,7 @@ int br_fdb_delete(struct ndmsg *ndm, struct nlattr *tb[], | |||
794 | 794 | ||
795 | vid = nla_get_u16(tb[NDA_VLAN]); | 795 | vid = nla_get_u16(tb[NDA_VLAN]); |
796 | 796 | ||
797 | if (vid >= VLAN_N_VID) { | 797 | if (!vid || vid >= VLAN_VID_MASK) { |
798 | pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n", | 798 | pr_info("bridge: RTM_NEWNEIGH with invalid vlan id %d\n", |
799 | vid); | 799 | vid); |
800 | return -EINVAL; | 800 | return -EINVAL; |
diff --git a/net/bridge/br_mdb.c b/net/bridge/br_mdb.c index 85a09bb5ca51..b7b1914dfa25 100644 --- a/net/bridge/br_mdb.c +++ b/net/bridge/br_mdb.c | |||
@@ -453,7 +453,7 @@ static int __br_mdb_del(struct net_bridge *br, struct br_mdb_entry *entry) | |||
453 | call_rcu_bh(&p->rcu, br_multicast_free_pg); | 453 | call_rcu_bh(&p->rcu, br_multicast_free_pg); |
454 | err = 0; | 454 | err = 0; |
455 | 455 | ||
456 | if (!mp->ports && !mp->mglist && mp->timer_armed && | 456 | if (!mp->ports && !mp->mglist && |
457 | netif_running(br->dev)) | 457 | netif_running(br->dev)) |
458 | mod_timer(&mp->timer, jiffies); | 458 | mod_timer(&mp->timer, jiffies); |
459 | break; | 459 | break; |
diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c index d1c578630678..8b0b610ca2c9 100644 --- a/net/bridge/br_multicast.c +++ b/net/bridge/br_multicast.c | |||
@@ -272,7 +272,7 @@ static void br_multicast_del_pg(struct net_bridge *br, | |||
272 | del_timer(&p->timer); | 272 | del_timer(&p->timer); |
273 | call_rcu_bh(&p->rcu, br_multicast_free_pg); | 273 | call_rcu_bh(&p->rcu, br_multicast_free_pg); |
274 | 274 | ||
275 | if (!mp->ports && !mp->mglist && mp->timer_armed && | 275 | if (!mp->ports && !mp->mglist && |
276 | netif_running(br->dev)) | 276 | netif_running(br->dev)) |
277 | mod_timer(&mp->timer, jiffies); | 277 | mod_timer(&mp->timer, jiffies); |
278 | 278 | ||
@@ -620,7 +620,6 @@ rehash: | |||
620 | 620 | ||
621 | mp->br = br; | 621 | mp->br = br; |
622 | mp->addr = *group; | 622 | mp->addr = *group; |
623 | |||
624 | setup_timer(&mp->timer, br_multicast_group_expired, | 623 | setup_timer(&mp->timer, br_multicast_group_expired, |
625 | (unsigned long)mp); | 624 | (unsigned long)mp); |
626 | 625 | ||
@@ -660,6 +659,7 @@ static int br_multicast_add_group(struct net_bridge *br, | |||
660 | struct net_bridge_mdb_entry *mp; | 659 | struct net_bridge_mdb_entry *mp; |
661 | struct net_bridge_port_group *p; | 660 | struct net_bridge_port_group *p; |
662 | struct net_bridge_port_group __rcu **pp; | 661 | struct net_bridge_port_group __rcu **pp; |
662 | unsigned long now = jiffies; | ||
663 | int err; | 663 | int err; |
664 | 664 | ||
665 | spin_lock(&br->multicast_lock); | 665 | spin_lock(&br->multicast_lock); |
@@ -674,6 +674,7 @@ static int br_multicast_add_group(struct net_bridge *br, | |||
674 | 674 | ||
675 | if (!port) { | 675 | if (!port) { |
676 | mp->mglist = true; | 676 | mp->mglist = true; |
677 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | ||
677 | goto out; | 678 | goto out; |
678 | } | 679 | } |
679 | 680 | ||
@@ -681,7 +682,7 @@ static int br_multicast_add_group(struct net_bridge *br, | |||
681 | (p = mlock_dereference(*pp, br)) != NULL; | 682 | (p = mlock_dereference(*pp, br)) != NULL; |
682 | pp = &p->next) { | 683 | pp = &p->next) { |
683 | if (p->port == port) | 684 | if (p->port == port) |
684 | goto out; | 685 | goto found; |
685 | if ((unsigned long)p->port < (unsigned long)port) | 686 | if ((unsigned long)p->port < (unsigned long)port) |
686 | break; | 687 | break; |
687 | } | 688 | } |
@@ -692,6 +693,8 @@ static int br_multicast_add_group(struct net_bridge *br, | |||
692 | rcu_assign_pointer(*pp, p); | 693 | rcu_assign_pointer(*pp, p); |
693 | br_mdb_notify(br->dev, port, group, RTM_NEWMDB); | 694 | br_mdb_notify(br->dev, port, group, RTM_NEWMDB); |
694 | 695 | ||
696 | found: | ||
697 | mod_timer(&p->timer, now + br->multicast_membership_interval); | ||
695 | out: | 698 | out: |
696 | err = 0; | 699 | err = 0; |
697 | 700 | ||
@@ -1191,9 +1194,6 @@ static int br_ip4_multicast_query(struct net_bridge *br, | |||
1191 | if (!mp) | 1194 | if (!mp) |
1192 | goto out; | 1195 | goto out; |
1193 | 1196 | ||
1194 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | ||
1195 | mp->timer_armed = true; | ||
1196 | |||
1197 | max_delay *= br->multicast_last_member_count; | 1197 | max_delay *= br->multicast_last_member_count; |
1198 | 1198 | ||
1199 | if (mp->mglist && | 1199 | if (mp->mglist && |
@@ -1270,9 +1270,6 @@ static int br_ip6_multicast_query(struct net_bridge *br, | |||
1270 | if (!mp) | 1270 | if (!mp) |
1271 | goto out; | 1271 | goto out; |
1272 | 1272 | ||
1273 | mod_timer(&mp->timer, now + br->multicast_membership_interval); | ||
1274 | mp->timer_armed = true; | ||
1275 | |||
1276 | max_delay *= br->multicast_last_member_count; | 1273 | max_delay *= br->multicast_last_member_count; |
1277 | if (mp->mglist && | 1274 | if (mp->mglist && |
1278 | (timer_pending(&mp->timer) ? | 1275 | (timer_pending(&mp->timer) ? |
@@ -1358,7 +1355,7 @@ static void br_multicast_leave_group(struct net_bridge *br, | |||
1358 | call_rcu_bh(&p->rcu, br_multicast_free_pg); | 1355 | call_rcu_bh(&p->rcu, br_multicast_free_pg); |
1359 | br_mdb_notify(br->dev, port, group, RTM_DELMDB); | 1356 | br_mdb_notify(br->dev, port, group, RTM_DELMDB); |
1360 | 1357 | ||
1361 | if (!mp->ports && !mp->mglist && mp->timer_armed && | 1358 | if (!mp->ports && !mp->mglist && |
1362 | netif_running(br->dev)) | 1359 | netif_running(br->dev)) |
1363 | mod_timer(&mp->timer, jiffies); | 1360 | mod_timer(&mp->timer, jiffies); |
1364 | } | 1361 | } |
@@ -1370,12 +1367,30 @@ static void br_multicast_leave_group(struct net_bridge *br, | |||
1370 | br->multicast_last_member_interval; | 1367 | br->multicast_last_member_interval; |
1371 | 1368 | ||
1372 | if (!port) { | 1369 | if (!port) { |
1373 | if (mp->mglist && mp->timer_armed && | 1370 | if (mp->mglist && |
1374 | (timer_pending(&mp->timer) ? | 1371 | (timer_pending(&mp->timer) ? |
1375 | time_after(mp->timer.expires, time) : | 1372 | time_after(mp->timer.expires, time) : |
1376 | try_to_del_timer_sync(&mp->timer) >= 0)) { | 1373 | try_to_del_timer_sync(&mp->timer) >= 0)) { |
1377 | mod_timer(&mp->timer, time); | 1374 | mod_timer(&mp->timer, time); |
1378 | } | 1375 | } |
1376 | |||
1377 | goto out; | ||
1378 | } | ||
1379 | |||
1380 | for (p = mlock_dereference(mp->ports, br); | ||
1381 | p != NULL; | ||
1382 | p = mlock_dereference(p->next, br)) { | ||
1383 | if (p->port != port) | ||
1384 | continue; | ||
1385 | |||
1386 | if (!hlist_unhashed(&p->mglist) && | ||
1387 | (timer_pending(&p->timer) ? | ||
1388 | time_after(p->timer.expires, time) : | ||
1389 | try_to_del_timer_sync(&p->timer) >= 0)) { | ||
1390 | mod_timer(&p->timer, time); | ||
1391 | } | ||
1392 | |||
1393 | break; | ||
1379 | } | 1394 | } |
1380 | out: | 1395 | out: |
1381 | spin_unlock(&br->multicast_lock); | 1396 | spin_unlock(&br->multicast_lock); |
@@ -1798,7 +1813,6 @@ void br_multicast_stop(struct net_bridge *br) | |||
1798 | hlist_for_each_entry_safe(mp, n, &mdb->mhash[i], | 1813 | hlist_for_each_entry_safe(mp, n, &mdb->mhash[i], |
1799 | hlist[ver]) { | 1814 | hlist[ver]) { |
1800 | del_timer(&mp->timer); | 1815 | del_timer(&mp->timer); |
1801 | mp->timer_armed = false; | ||
1802 | call_rcu_bh(&mp->rcu, br_multicast_free_group); | 1816 | call_rcu_bh(&mp->rcu, br_multicast_free_group); |
1803 | } | 1817 | } |
1804 | } | 1818 | } |
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index e74ddc1c29a8..f75d92e4f96b 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -243,7 +243,7 @@ static int br_afspec(struct net_bridge *br, | |||
243 | 243 | ||
244 | vinfo = nla_data(tb[IFLA_BRIDGE_VLAN_INFO]); | 244 | vinfo = nla_data(tb[IFLA_BRIDGE_VLAN_INFO]); |
245 | 245 | ||
246 | if (vinfo->vid >= VLAN_N_VID) | 246 | if (!vinfo->vid || vinfo->vid >= VLAN_VID_MASK) |
247 | return -EINVAL; | 247 | return -EINVAL; |
248 | 248 | ||
249 | switch (cmd) { | 249 | switch (cmd) { |
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h index efb57d911569..e14c33b42f75 100644 --- a/net/bridge/br_private.h +++ b/net/bridge/br_private.h | |||
@@ -126,7 +126,6 @@ struct net_bridge_mdb_entry | |||
126 | struct timer_list timer; | 126 | struct timer_list timer; |
127 | struct br_ip addr; | 127 | struct br_ip addr; |
128 | bool mglist; | 128 | bool mglist; |
129 | bool timer_armed; | ||
130 | }; | 129 | }; |
131 | 130 | ||
132 | struct net_bridge_mdb_htable | 131 | struct net_bridge_mdb_htable |
@@ -643,9 +642,7 @@ static inline u16 br_get_pvid(const struct net_port_vlans *v) | |||
643 | * vid wasn't set | 642 | * vid wasn't set |
644 | */ | 643 | */ |
645 | smp_rmb(); | 644 | smp_rmb(); |
646 | return (v->pvid & VLAN_TAG_PRESENT) ? | 645 | return v->pvid ?: VLAN_N_VID; |
647 | (v->pvid & ~VLAN_TAG_PRESENT) : | ||
648 | VLAN_N_VID; | ||
649 | } | 646 | } |
650 | 647 | ||
651 | #else | 648 | #else |
diff --git a/net/bridge/br_stp_if.c b/net/bridge/br_stp_if.c index 108084a04671..656a6f3e40de 100644 --- a/net/bridge/br_stp_if.c +++ b/net/bridge/br_stp_if.c | |||
@@ -134,7 +134,7 @@ static void br_stp_start(struct net_bridge *br) | |||
134 | 134 | ||
135 | if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY) | 135 | if (br->bridge_forward_delay < BR_MIN_FORWARD_DELAY) |
136 | __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY); | 136 | __br_set_forward_delay(br, BR_MIN_FORWARD_DELAY); |
137 | else if (br->bridge_forward_delay < BR_MAX_FORWARD_DELAY) | 137 | else if (br->bridge_forward_delay > BR_MAX_FORWARD_DELAY) |
138 | __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY); | 138 | __br_set_forward_delay(br, BR_MAX_FORWARD_DELAY); |
139 | 139 | ||
140 | if (r == 0) { | 140 | if (r == 0) { |
diff --git a/net/bridge/br_vlan.c b/net/bridge/br_vlan.c index 9a9ffe7e4019..53f0990eab58 100644 --- a/net/bridge/br_vlan.c +++ b/net/bridge/br_vlan.c | |||
@@ -45,37 +45,34 @@ static int __vlan_add(struct net_port_vlans *v, u16 vid, u16 flags) | |||
45 | return 0; | 45 | return 0; |
46 | } | 46 | } |
47 | 47 | ||
48 | if (vid) { | 48 | if (v->port_idx) { |
49 | if (v->port_idx) { | 49 | p = v->parent.port; |
50 | p = v->parent.port; | 50 | br = p->br; |
51 | br = p->br; | 51 | dev = p->dev; |
52 | dev = p->dev; | 52 | } else { |
53 | } else { | 53 | br = v->parent.br; |
54 | br = v->parent.br; | 54 | dev = br->dev; |
55 | dev = br->dev; | 55 | } |
56 | } | 56 | ops = dev->netdev_ops; |
57 | ops = dev->netdev_ops; | 57 | |
58 | 58 | if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { | |
59 | if (p && (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) { | 59 | /* Add VLAN to the device filter if it is supported. |
60 | /* Add VLAN to the device filter if it is supported. | 60 | * Stricly speaking, this is not necessary now, since |
61 | * Stricly speaking, this is not necessary now, since | 61 | * devices are made promiscuous by the bridge, but if |
62 | * devices are made promiscuous by the bridge, but if | 62 | * that ever changes this code will allow tagged |
63 | * that ever changes this code will allow tagged | 63 | * traffic to enter the bridge. |
64 | * traffic to enter the bridge. | 64 | */ |
65 | */ | 65 | err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q), |
66 | err = ops->ndo_vlan_rx_add_vid(dev, htons(ETH_P_8021Q), | 66 | vid); |
67 | vid); | 67 | if (err) |
68 | if (err) | 68 | return err; |
69 | return err; | 69 | } |
70 | } | ||
71 | |||
72 | err = br_fdb_insert(br, p, dev->dev_addr, vid); | ||
73 | if (err) { | ||
74 | br_err(br, "failed insert local address into bridge " | ||
75 | "forwarding table\n"); | ||
76 | goto out_filt; | ||
77 | } | ||
78 | 70 | ||
71 | err = br_fdb_insert(br, p, dev->dev_addr, vid); | ||
72 | if (err) { | ||
73 | br_err(br, "failed insert local address into bridge " | ||
74 | "forwarding table\n"); | ||
75 | goto out_filt; | ||
79 | } | 76 | } |
80 | 77 | ||
81 | set_bit(vid, v->vlan_bitmap); | 78 | set_bit(vid, v->vlan_bitmap); |
@@ -98,7 +95,7 @@ static int __vlan_del(struct net_port_vlans *v, u16 vid) | |||
98 | __vlan_delete_pvid(v, vid); | 95 | __vlan_delete_pvid(v, vid); |
99 | clear_bit(vid, v->untagged_bitmap); | 96 | clear_bit(vid, v->untagged_bitmap); |
100 | 97 | ||
101 | if (v->port_idx && vid) { | 98 | if (v->port_idx) { |
102 | struct net_device *dev = v->parent.port->dev; | 99 | struct net_device *dev = v->parent.port->dev; |
103 | const struct net_device_ops *ops = dev->netdev_ops; | 100 | const struct net_device_ops *ops = dev->netdev_ops; |
104 | 101 | ||
@@ -192,6 +189,8 @@ out: | |||
192 | bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, | 189 | bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, |
193 | struct sk_buff *skb, u16 *vid) | 190 | struct sk_buff *skb, u16 *vid) |
194 | { | 191 | { |
192 | int err; | ||
193 | |||
195 | /* If VLAN filtering is disabled on the bridge, all packets are | 194 | /* If VLAN filtering is disabled on the bridge, all packets are |
196 | * permitted. | 195 | * permitted. |
197 | */ | 196 | */ |
@@ -204,20 +203,32 @@ bool br_allowed_ingress(struct net_bridge *br, struct net_port_vlans *v, | |||
204 | if (!v) | 203 | if (!v) |
205 | return false; | 204 | return false; |
206 | 205 | ||
207 | if (br_vlan_get_tag(skb, vid)) { | 206 | err = br_vlan_get_tag(skb, vid); |
207 | if (!*vid) { | ||
208 | u16 pvid = br_get_pvid(v); | 208 | u16 pvid = br_get_pvid(v); |
209 | 209 | ||
210 | /* Frame did not have a tag. See if pvid is set | 210 | /* Frame had a tag with VID 0 or did not have a tag. |
211 | * on this port. That tells us which vlan untagged | 211 | * See if pvid is set on this port. That tells us which |
212 | * traffic belongs to. | 212 | * vlan untagged or priority-tagged traffic belongs to. |
213 | */ | 213 | */ |
214 | if (pvid == VLAN_N_VID) | 214 | if (pvid == VLAN_N_VID) |
215 | return false; | 215 | return false; |
216 | 216 | ||
217 | /* PVID is set on this port. Any untagged ingress | 217 | /* PVID is set on this port. Any untagged or priority-tagged |
218 | * frame is considered to belong to this vlan. | 218 | * ingress frame is considered to belong to this vlan. |
219 | */ | 219 | */ |
220 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid); | 220 | *vid = pvid; |
221 | if (likely(err)) | ||
222 | /* Untagged Frame. */ | ||
223 | __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), pvid); | ||
224 | else | ||
225 | /* Priority-tagged Frame. | ||
226 | * At this point, We know that skb->vlan_tci had | ||
227 | * VLAN_TAG_PRESENT bit and its VID field was 0x000. | ||
228 | * We update only VID field and preserve PCP field. | ||
229 | */ | ||
230 | skb->vlan_tci |= pvid; | ||
231 | |||
221 | return true; | 232 | return true; |
222 | } | 233 | } |
223 | 234 | ||
@@ -248,7 +259,9 @@ bool br_allowed_egress(struct net_bridge *br, | |||
248 | return false; | 259 | return false; |
249 | } | 260 | } |
250 | 261 | ||
251 | /* Must be protected by RTNL */ | 262 | /* Must be protected by RTNL. |
263 | * Must be called with vid in range from 1 to 4094 inclusive. | ||
264 | */ | ||
252 | int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) | 265 | int br_vlan_add(struct net_bridge *br, u16 vid, u16 flags) |
253 | { | 266 | { |
254 | struct net_port_vlans *pv = NULL; | 267 | struct net_port_vlans *pv = NULL; |
@@ -278,7 +291,9 @@ out: | |||
278 | return err; | 291 | return err; |
279 | } | 292 | } |
280 | 293 | ||
281 | /* Must be protected by RTNL */ | 294 | /* Must be protected by RTNL. |
295 | * Must be called with vid in range from 1 to 4094 inclusive. | ||
296 | */ | ||
282 | int br_vlan_delete(struct net_bridge *br, u16 vid) | 297 | int br_vlan_delete(struct net_bridge *br, u16 vid) |
283 | { | 298 | { |
284 | struct net_port_vlans *pv; | 299 | struct net_port_vlans *pv; |
@@ -289,14 +304,9 @@ int br_vlan_delete(struct net_bridge *br, u16 vid) | |||
289 | if (!pv) | 304 | if (!pv) |
290 | return -EINVAL; | 305 | return -EINVAL; |
291 | 306 | ||
292 | if (vid) { | 307 | spin_lock_bh(&br->hash_lock); |
293 | /* If the VID !=0 remove fdb for this vid. VID 0 is special | 308 | fdb_delete_by_addr(br, br->dev->dev_addr, vid); |
294 | * in that it's the default and is always there in the fdb. | 309 | spin_unlock_bh(&br->hash_lock); |
295 | */ | ||
296 | spin_lock_bh(&br->hash_lock); | ||
297 | fdb_delete_by_addr(br, br->dev->dev_addr, vid); | ||
298 | spin_unlock_bh(&br->hash_lock); | ||
299 | } | ||
300 | 310 | ||
301 | __vlan_del(pv, vid); | 311 | __vlan_del(pv, vid); |
302 | return 0; | 312 | return 0; |
@@ -329,7 +339,9 @@ unlock: | |||
329 | return 0; | 339 | return 0; |
330 | } | 340 | } |
331 | 341 | ||
332 | /* Must be protected by RTNL */ | 342 | /* Must be protected by RTNL. |
343 | * Must be called with vid in range from 1 to 4094 inclusive. | ||
344 | */ | ||
333 | int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags) | 345 | int nbp_vlan_add(struct net_bridge_port *port, u16 vid, u16 flags) |
334 | { | 346 | { |
335 | struct net_port_vlans *pv = NULL; | 347 | struct net_port_vlans *pv = NULL; |
@@ -363,7 +375,9 @@ clean_up: | |||
363 | return err; | 375 | return err; |
364 | } | 376 | } |
365 | 377 | ||
366 | /* Must be protected by RTNL */ | 378 | /* Must be protected by RTNL. |
379 | * Must be called with vid in range from 1 to 4094 inclusive. | ||
380 | */ | ||
367 | int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) | 381 | int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) |
368 | { | 382 | { |
369 | struct net_port_vlans *pv; | 383 | struct net_port_vlans *pv; |
@@ -374,14 +388,9 @@ int nbp_vlan_delete(struct net_bridge_port *port, u16 vid) | |||
374 | if (!pv) | 388 | if (!pv) |
375 | return -EINVAL; | 389 | return -EINVAL; |
376 | 390 | ||
377 | if (vid) { | 391 | spin_lock_bh(&port->br->hash_lock); |
378 | /* If the VID !=0 remove fdb for this vid. VID 0 is special | 392 | fdb_delete_by_addr(port->br, port->dev->dev_addr, vid); |
379 | * in that it's the default and is always there in the fdb. | 393 | spin_unlock_bh(&port->br->hash_lock); |
380 | */ | ||
381 | spin_lock_bh(&port->br->hash_lock); | ||
382 | fdb_delete_by_addr(port->br, port->dev->dev_addr, vid); | ||
383 | spin_unlock_bh(&port->br->hash_lock); | ||
384 | } | ||
385 | 394 | ||
386 | return __vlan_del(pv, vid); | 395 | return __vlan_del(pv, vid); |
387 | } | 396 | } |
diff --git a/net/compat.c b/net/compat.c index f0a1ba6c8086..89032580bd1d 100644 --- a/net/compat.c +++ b/net/compat.c | |||
@@ -71,6 +71,8 @@ int get_compat_msghdr(struct msghdr *kmsg, struct compat_msghdr __user *umsg) | |||
71 | __get_user(kmsg->msg_controllen, &umsg->msg_controllen) || | 71 | __get_user(kmsg->msg_controllen, &umsg->msg_controllen) || |
72 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) | 72 | __get_user(kmsg->msg_flags, &umsg->msg_flags)) |
73 | return -EFAULT; | 73 | return -EFAULT; |
74 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) | ||
75 | return -EINVAL; | ||
74 | kmsg->msg_name = compat_ptr(tmp1); | 76 | kmsg->msg_name = compat_ptr(tmp1); |
75 | kmsg->msg_iov = compat_ptr(tmp2); | 77 | kmsg->msg_iov = compat_ptr(tmp2); |
76 | kmsg->msg_control = compat_ptr(tmp3); | 78 | kmsg->msg_control = compat_ptr(tmp3); |
diff --git a/net/core/dev.c b/net/core/dev.c index 65f829cfd928..3430b1ed12e5 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1917,7 +1917,8 @@ static struct xps_map *expand_xps_map(struct xps_map *map, | |||
1917 | return new_map; | 1917 | return new_map; |
1918 | } | 1918 | } |
1919 | 1919 | ||
1920 | int netif_set_xps_queue(struct net_device *dev, struct cpumask *mask, u16 index) | 1920 | int netif_set_xps_queue(struct net_device *dev, const struct cpumask *mask, |
1921 | u16 index) | ||
1921 | { | 1922 | { |
1922 | struct xps_dev_maps *dev_maps, *new_dev_maps = NULL; | 1923 | struct xps_dev_maps *dev_maps, *new_dev_maps = NULL; |
1923 | struct xps_map *map, *new_map; | 1924 | struct xps_map *map, *new_map; |
diff --git a/net/core/filter.c b/net/core/filter.c index 6438f29ff266..01b780856db2 100644 --- a/net/core/filter.c +++ b/net/core/filter.c | |||
@@ -644,7 +644,6 @@ void sk_filter_release_rcu(struct rcu_head *rcu) | |||
644 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); | 644 | struct sk_filter *fp = container_of(rcu, struct sk_filter, rcu); |
645 | 645 | ||
646 | bpf_jit_free(fp); | 646 | bpf_jit_free(fp); |
647 | kfree(fp); | ||
648 | } | 647 | } |
649 | EXPORT_SYMBOL(sk_filter_release_rcu); | 648 | EXPORT_SYMBOL(sk_filter_release_rcu); |
650 | 649 | ||
@@ -683,7 +682,7 @@ int sk_unattached_filter_create(struct sk_filter **pfp, | |||
683 | if (fprog->filter == NULL) | 682 | if (fprog->filter == NULL) |
684 | return -EINVAL; | 683 | return -EINVAL; |
685 | 684 | ||
686 | fp = kmalloc(fsize + sizeof(*fp), GFP_KERNEL); | 685 | fp = kmalloc(sk_filter_size(fprog->len), GFP_KERNEL); |
687 | if (!fp) | 686 | if (!fp) |
688 | return -ENOMEM; | 687 | return -ENOMEM; |
689 | memcpy(fp->insns, fprog->filter, fsize); | 688 | memcpy(fp->insns, fprog->filter, fsize); |
@@ -723,6 +722,7 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) | |||
723 | { | 722 | { |
724 | struct sk_filter *fp, *old_fp; | 723 | struct sk_filter *fp, *old_fp; |
725 | unsigned int fsize = sizeof(struct sock_filter) * fprog->len; | 724 | unsigned int fsize = sizeof(struct sock_filter) * fprog->len; |
725 | unsigned int sk_fsize = sk_filter_size(fprog->len); | ||
726 | int err; | 726 | int err; |
727 | 727 | ||
728 | if (sock_flag(sk, SOCK_FILTER_LOCKED)) | 728 | if (sock_flag(sk, SOCK_FILTER_LOCKED)) |
@@ -732,11 +732,11 @@ int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk) | |||
732 | if (fprog->filter == NULL) | 732 | if (fprog->filter == NULL) |
733 | return -EINVAL; | 733 | return -EINVAL; |
734 | 734 | ||
735 | fp = sock_kmalloc(sk, fsize+sizeof(*fp), GFP_KERNEL); | 735 | fp = sock_kmalloc(sk, sk_fsize, GFP_KERNEL); |
736 | if (!fp) | 736 | if (!fp) |
737 | return -ENOMEM; | 737 | return -ENOMEM; |
738 | if (copy_from_user(fp->insns, fprog->filter, fsize)) { | 738 | if (copy_from_user(fp->insns, fprog->filter, fsize)) { |
739 | sock_kfree_s(sk, fp, fsize+sizeof(*fp)); | 739 | sock_kfree_s(sk, fp, sk_fsize); |
740 | return -EFAULT; | 740 | return -EFAULT; |
741 | } | 741 | } |
742 | 742 | ||
diff --git a/net/core/secure_seq.c b/net/core/secure_seq.c index 3f1ec1586ae1..8d9d05edd2eb 100644 --- a/net/core/secure_seq.c +++ b/net/core/secure_seq.c | |||
@@ -10,6 +10,7 @@ | |||
10 | 10 | ||
11 | #include <net/secure_seq.h> | 11 | #include <net/secure_seq.h> |
12 | 12 | ||
13 | #if IS_ENABLED(CONFIG_IPV6) || IS_ENABLED(CONFIG_INET) | ||
13 | #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4) | 14 | #define NET_SECRET_SIZE (MD5_MESSAGE_BYTES / 4) |
14 | 15 | ||
15 | static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned; | 16 | static u32 net_secret[NET_SECRET_SIZE] ____cacheline_aligned; |
@@ -29,6 +30,7 @@ static void net_secret_init(void) | |||
29 | cmpxchg(&net_secret[--i], 0, tmp); | 30 | cmpxchg(&net_secret[--i], 0, tmp); |
30 | } | 31 | } |
31 | } | 32 | } |
33 | #endif | ||
32 | 34 | ||
33 | #ifdef CONFIG_INET | 35 | #ifdef CONFIG_INET |
34 | static u32 seq_scale(u32 seq) | 36 | static u32 seq_scale(u32 seq) |
diff --git a/net/core/sock.c b/net/core/sock.c index 5b6beba494a3..0b39e7ae4383 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -2319,6 +2319,7 @@ void sock_init_data(struct socket *sock, struct sock *sk) | |||
2319 | sk->sk_ll_usec = sysctl_net_busy_read; | 2319 | sk->sk_ll_usec = sysctl_net_busy_read; |
2320 | #endif | 2320 | #endif |
2321 | 2321 | ||
2322 | sk->sk_pacing_rate = ~0U; | ||
2322 | /* | 2323 | /* |
2323 | * Before updating sk_refcnt, we must commit prior changes to memory | 2324 | * Before updating sk_refcnt, we must commit prior changes to memory |
2324 | * (Documentation/RCU/rculist_nulls.txt for details) | 2325 | * (Documentation/RCU/rculist_nulls.txt for details) |
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c index c85e71e0c7ff..ff41b4d60d30 100644 --- a/net/ieee802154/6lowpan.c +++ b/net/ieee802154/6lowpan.c | |||
@@ -1372,6 +1372,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, | |||
1372 | real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); | 1372 | real_dev = dev_get_by_index(src_net, nla_get_u32(tb[IFLA_LINK])); |
1373 | if (!real_dev) | 1373 | if (!real_dev) |
1374 | return -ENODEV; | 1374 | return -ENODEV; |
1375 | if (real_dev->type != ARPHRD_IEEE802154) | ||
1376 | return -EINVAL; | ||
1375 | 1377 | ||
1376 | lowpan_dev_info(dev)->real_dev = real_dev; | 1378 | lowpan_dev_info(dev)->real_dev = real_dev; |
1377 | lowpan_dev_info(dev)->fragment_tag = 0; | 1379 | lowpan_dev_info(dev)->fragment_tag = 0; |
@@ -1386,6 +1388,9 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, | |||
1386 | 1388 | ||
1387 | entry->ldev = dev; | 1389 | entry->ldev = dev; |
1388 | 1390 | ||
1391 | /* Set the lowpan harware address to the wpan hardware address. */ | ||
1392 | memcpy(dev->dev_addr, real_dev->dev_addr, IEEE802154_ADDR_LEN); | ||
1393 | |||
1389 | mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); | 1394 | mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); |
1390 | INIT_LIST_HEAD(&entry->list); | 1395 | INIT_LIST_HEAD(&entry->list); |
1391 | list_add_tail(&entry->list, &lowpan_devices); | 1396 | list_add_tail(&entry->list, &lowpan_devices); |
diff --git a/net/ipv4/inet_hashtables.c b/net/ipv4/inet_hashtables.c index 7bd8983dbfcf..96da9c77deca 100644 --- a/net/ipv4/inet_hashtables.c +++ b/net/ipv4/inet_hashtables.c | |||
@@ -287,7 +287,7 @@ begintw: | |||
287 | if (unlikely(!INET_TW_MATCH(sk, net, acookie, | 287 | if (unlikely(!INET_TW_MATCH(sk, net, acookie, |
288 | saddr, daddr, ports, | 288 | saddr, daddr, ports, |
289 | dif))) { | 289 | dif))) { |
290 | sock_put(sk); | 290 | inet_twsk_put(inet_twsk(sk)); |
291 | goto begintw; | 291 | goto begintw; |
292 | } | 292 | } |
293 | goto out; | 293 | goto out; |
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index a04d872c54f9..3982eabf61e1 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c | |||
@@ -772,15 +772,20 @@ static inline int ip_ufo_append_data(struct sock *sk, | |||
772 | /* initialize protocol header pointer */ | 772 | /* initialize protocol header pointer */ |
773 | skb->transport_header = skb->network_header + fragheaderlen; | 773 | skb->transport_header = skb->network_header + fragheaderlen; |
774 | 774 | ||
775 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
776 | skb->csum = 0; | 775 | skb->csum = 0; |
777 | 776 | ||
778 | /* specify the length of each IP datagram fragment */ | 777 | |
779 | skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen; | ||
780 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
781 | __skb_queue_tail(queue, skb); | 778 | __skb_queue_tail(queue, skb); |
779 | } else if (skb_is_gso(skb)) { | ||
780 | goto append; | ||
782 | } | 781 | } |
783 | 782 | ||
783 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
784 | /* specify the length of each IP datagram fragment */ | ||
785 | skb_shinfo(skb)->gso_size = maxfraglen - fragheaderlen; | ||
786 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
787 | |||
788 | append: | ||
784 | return skb_append_datato_frags(sk, skb, getfrag, from, | 789 | return skb_append_datato_frags(sk, skb, getfrag, from, |
785 | (length - transhdrlen)); | 790 | (length - transhdrlen)); |
786 | } | 791 | } |
diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index e805e7b3030e..6e87f853d033 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c | |||
@@ -125,8 +125,17 @@ static int vti_rcv(struct sk_buff *skb) | |||
125 | iph->saddr, iph->daddr, 0); | 125 | iph->saddr, iph->daddr, 0); |
126 | if (tunnel != NULL) { | 126 | if (tunnel != NULL) { |
127 | struct pcpu_tstats *tstats; | 127 | struct pcpu_tstats *tstats; |
128 | u32 oldmark = skb->mark; | ||
129 | int ret; | ||
128 | 130 | ||
129 | if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb)) | 131 | |
132 | /* temporarily mark the skb with the tunnel o_key, to | ||
133 | * only match policies with this mark. | ||
134 | */ | ||
135 | skb->mark = be32_to_cpu(tunnel->parms.o_key); | ||
136 | ret = xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb); | ||
137 | skb->mark = oldmark; | ||
138 | if (!ret) | ||
130 | return -1; | 139 | return -1; |
131 | 140 | ||
132 | tstats = this_cpu_ptr(tunnel->dev->tstats); | 141 | tstats = this_cpu_ptr(tunnel->dev->tstats); |
@@ -135,7 +144,6 @@ static int vti_rcv(struct sk_buff *skb) | |||
135 | tstats->rx_bytes += skb->len; | 144 | tstats->rx_bytes += skb->len; |
136 | u64_stats_update_end(&tstats->syncp); | 145 | u64_stats_update_end(&tstats->syncp); |
137 | 146 | ||
138 | skb->mark = 0; | ||
139 | secpath_reset(skb); | 147 | secpath_reset(skb); |
140 | skb->dev = tunnel->dev; | 148 | skb->dev = tunnel->dev; |
141 | return 1; | 149 | return 1; |
@@ -167,7 +175,7 @@ static netdev_tx_t vti_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) | |||
167 | 175 | ||
168 | memset(&fl4, 0, sizeof(fl4)); | 176 | memset(&fl4, 0, sizeof(fl4)); |
169 | flowi4_init_output(&fl4, tunnel->parms.link, | 177 | flowi4_init_output(&fl4, tunnel->parms.link, |
170 | be32_to_cpu(tunnel->parms.i_key), RT_TOS(tos), | 178 | be32_to_cpu(tunnel->parms.o_key), RT_TOS(tos), |
171 | RT_SCOPE_UNIVERSE, | 179 | RT_SCOPE_UNIVERSE, |
172 | IPPROTO_IPIP, 0, | 180 | IPPROTO_IPIP, 0, |
173 | dst, tiph->saddr, 0, 0); | 181 | dst, tiph->saddr, 0, 0); |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 727f4365bcdf..6011615e810d 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -2072,7 +2072,7 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *fl4) | |||
2072 | RT_SCOPE_LINK); | 2072 | RT_SCOPE_LINK); |
2073 | goto make_route; | 2073 | goto make_route; |
2074 | } | 2074 | } |
2075 | if (fl4->saddr) { | 2075 | if (!fl4->saddr) { |
2076 | if (ipv4_is_multicast(fl4->daddr)) | 2076 | if (ipv4_is_multicast(fl4->daddr)) |
2077 | fl4->saddr = inet_select_addr(dev_out, 0, | 2077 | fl4->saddr = inet_select_addr(dev_out, 0, |
2078 | fl4->flowi4_scope); | 2078 | fl4->flowi4_scope); |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 25a89eaa669d..a16b01b537ba 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1284,7 +1284,10 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *skb, | |||
1284 | tp->lost_cnt_hint -= tcp_skb_pcount(prev); | 1284 | tp->lost_cnt_hint -= tcp_skb_pcount(prev); |
1285 | } | 1285 | } |
1286 | 1286 | ||
1287 | TCP_SKB_CB(skb)->tcp_flags |= TCP_SKB_CB(prev)->tcp_flags; | 1287 | TCP_SKB_CB(prev)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags; |
1288 | if (TCP_SKB_CB(skb)->tcp_flags & TCPHDR_FIN) | ||
1289 | TCP_SKB_CB(prev)->end_seq++; | ||
1290 | |||
1288 | if (skb == tcp_highest_sack(sk)) | 1291 | if (skb == tcp_highest_sack(sk)) |
1289 | tcp_advance_highest_sack(sk, skb); | 1292 | tcp_advance_highest_sack(sk, skb); |
1290 | 1293 | ||
@@ -3288,7 +3291,7 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) | |||
3288 | tcp_init_cwnd_reduction(sk, true); | 3291 | tcp_init_cwnd_reduction(sk, true); |
3289 | tcp_set_ca_state(sk, TCP_CA_CWR); | 3292 | tcp_set_ca_state(sk, TCP_CA_CWR); |
3290 | tcp_end_cwnd_reduction(sk); | 3293 | tcp_end_cwnd_reduction(sk); |
3291 | tcp_set_ca_state(sk, TCP_CA_Open); | 3294 | tcp_try_keep_open(sk); |
3292 | NET_INC_STATS_BH(sock_net(sk), | 3295 | NET_INC_STATS_BH(sock_net(sk), |
3293 | LINUX_MIB_TCPLOSSPROBERECOVERY); | 3296 | LINUX_MIB_TCPLOSSPROBERECOVERY); |
3294 | } | 3297 | } |
@@ -5709,6 +5712,8 @@ int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, | |||
5709 | } else | 5712 | } else |
5710 | tcp_init_metrics(sk); | 5713 | tcp_init_metrics(sk); |
5711 | 5714 | ||
5715 | tcp_update_pacing_rate(sk); | ||
5716 | |||
5712 | /* Prevent spurious tcp_cwnd_restart() on first data packet */ | 5717 | /* Prevent spurious tcp_cwnd_restart() on first data packet */ |
5713 | tp->lsndtime = tcp_time_stamp; | 5718 | tp->lsndtime = tcp_time_stamp; |
5714 | 5719 | ||
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e6bb8256e59f..d46f2143305c 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -637,6 +637,8 @@ static unsigned int tcp_established_options(struct sock *sk, struct sk_buff *skb | |||
637 | unsigned int size = 0; | 637 | unsigned int size = 0; |
638 | unsigned int eff_sacks; | 638 | unsigned int eff_sacks; |
639 | 639 | ||
640 | opts->options = 0; | ||
641 | |||
640 | #ifdef CONFIG_TCP_MD5SIG | 642 | #ifdef CONFIG_TCP_MD5SIG |
641 | *md5 = tp->af_specific->md5_lookup(sk, sk); | 643 | *md5 = tp->af_specific->md5_lookup(sk, sk); |
642 | if (unlikely(*md5)) { | 644 | if (unlikely(*md5)) { |
@@ -984,8 +986,10 @@ static void tcp_queue_skb(struct sock *sk, struct sk_buff *skb) | |||
984 | static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb, | 986 | static void tcp_set_skb_tso_segs(const struct sock *sk, struct sk_buff *skb, |
985 | unsigned int mss_now) | 987 | unsigned int mss_now) |
986 | { | 988 | { |
987 | if (skb->len <= mss_now || !sk_can_gso(sk) || | 989 | /* Make sure we own this skb before messing gso_size/gso_segs */ |
988 | skb->ip_summed == CHECKSUM_NONE) { | 990 | WARN_ON_ONCE(skb_cloned(skb)); |
991 | |||
992 | if (skb->len <= mss_now || skb->ip_summed == CHECKSUM_NONE) { | ||
989 | /* Avoid the costly divide in the normal | 993 | /* Avoid the costly divide in the normal |
990 | * non-TSO case. | 994 | * non-TSO case. |
991 | */ | 995 | */ |
@@ -1065,9 +1069,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, | |||
1065 | if (nsize < 0) | 1069 | if (nsize < 0) |
1066 | nsize = 0; | 1070 | nsize = 0; |
1067 | 1071 | ||
1068 | if (skb_cloned(skb) && | 1072 | if (skb_unclone(skb, GFP_ATOMIC)) |
1069 | skb_is_nonlinear(skb) && | ||
1070 | pskb_expand_head(skb, 0, 0, GFP_ATOMIC)) | ||
1071 | return -ENOMEM; | 1073 | return -ENOMEM; |
1072 | 1074 | ||
1073 | /* Get a new skb... force flag on. */ | 1075 | /* Get a new skb... force flag on. */ |
@@ -2342,6 +2344,8 @@ int __tcp_retransmit_skb(struct sock *sk, struct sk_buff *skb) | |||
2342 | int oldpcount = tcp_skb_pcount(skb); | 2344 | int oldpcount = tcp_skb_pcount(skb); |
2343 | 2345 | ||
2344 | if (unlikely(oldpcount > 1)) { | 2346 | if (unlikely(oldpcount > 1)) { |
2347 | if (skb_unclone(skb, GFP_ATOMIC)) | ||
2348 | return -ENOMEM; | ||
2345 | tcp_init_tso_segs(sk, skb, cur_mss); | 2349 | tcp_init_tso_segs(sk, skb, cur_mss); |
2346 | tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb)); | 2350 | tcp_adjust_pcount(sk, skb, oldpcount - tcp_skb_pcount(skb)); |
2347 | } | 2351 | } |
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c index 9a459be24af7..ccde54248c8c 100644 --- a/net/ipv4/xfrm4_policy.c +++ b/net/ipv4/xfrm4_policy.c | |||
@@ -107,6 +107,7 @@ _decode_session4(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
107 | 107 | ||
108 | memset(fl4, 0, sizeof(struct flowi4)); | 108 | memset(fl4, 0, sizeof(struct flowi4)); |
109 | fl4->flowi4_mark = skb->mark; | 109 | fl4->flowi4_mark = skb->mark; |
110 | fl4->flowi4_oif = skb_dst(skb)->dev->ifindex; | ||
110 | 111 | ||
111 | if (!ip_is_fragment(iph)) { | 112 | if (!ip_is_fragment(iph)) { |
112 | switch (iph->protocol) { | 113 | switch (iph->protocol) { |
diff --git a/net/ipv6/ah6.c b/net/ipv6/ah6.c index 73784c3d4642..82e1da3a40b9 100644 --- a/net/ipv6/ah6.c +++ b/net/ipv6/ah6.c | |||
@@ -618,8 +618,7 @@ static void ah6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
618 | struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset); | 618 | struct ip_auth_hdr *ah = (struct ip_auth_hdr*)(skb->data+offset); |
619 | struct xfrm_state *x; | 619 | struct xfrm_state *x; |
620 | 620 | ||
621 | if (type != ICMPV6_DEST_UNREACH && | 621 | if (type != ICMPV6_PKT_TOOBIG && |
622 | type != ICMPV6_PKT_TOOBIG && | ||
623 | type != NDISC_REDIRECT) | 622 | type != NDISC_REDIRECT) |
624 | return; | 623 | return; |
625 | 624 | ||
diff --git a/net/ipv6/esp6.c b/net/ipv6/esp6.c index d3618a78fcac..e67e63f9858d 100644 --- a/net/ipv6/esp6.c +++ b/net/ipv6/esp6.c | |||
@@ -436,8 +436,7 @@ static void esp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
436 | struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset); | 436 | struct ip_esp_hdr *esph = (struct ip_esp_hdr *)(skb->data + offset); |
437 | struct xfrm_state *x; | 437 | struct xfrm_state *x; |
438 | 438 | ||
439 | if (type != ICMPV6_DEST_UNREACH && | 439 | if (type != ICMPV6_PKT_TOOBIG && |
440 | type != ICMPV6_PKT_TOOBIG && | ||
441 | type != NDISC_REDIRECT) | 440 | type != NDISC_REDIRECT) |
442 | return; | 441 | return; |
443 | 442 | ||
diff --git a/net/ipv6/inet6_hashtables.c b/net/ipv6/inet6_hashtables.c index 32b4a1675d82..066640e0ba8e 100644 --- a/net/ipv6/inet6_hashtables.c +++ b/net/ipv6/inet6_hashtables.c | |||
@@ -116,7 +116,7 @@ begintw: | |||
116 | } | 116 | } |
117 | if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr, | 117 | if (unlikely(!INET6_TW_MATCH(sk, net, saddr, daddr, |
118 | ports, dif))) { | 118 | ports, dif))) { |
119 | sock_put(sk); | 119 | inet_twsk_put(inet_twsk(sk)); |
120 | goto begintw; | 120 | goto begintw; |
121 | } | 121 | } |
122 | goto out; | 122 | goto out; |
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c index 7bb5446b9d73..bf4a9a084de5 100644 --- a/net/ipv6/ip6_gre.c +++ b/net/ipv6/ip6_gre.c | |||
@@ -976,6 +976,7 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) | |||
976 | if (t->parms.o_flags&GRE_SEQ) | 976 | if (t->parms.o_flags&GRE_SEQ) |
977 | addend += 4; | 977 | addend += 4; |
978 | } | 978 | } |
979 | t->hlen = addend; | ||
979 | 980 | ||
980 | if (p->flags & IP6_TNL_F_CAP_XMIT) { | 981 | if (p->flags & IP6_TNL_F_CAP_XMIT) { |
981 | int strict = (ipv6_addr_type(&p->raddr) & | 982 | int strict = (ipv6_addr_type(&p->raddr) & |
@@ -1002,8 +1003,6 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) | |||
1002 | } | 1003 | } |
1003 | ip6_rt_put(rt); | 1004 | ip6_rt_put(rt); |
1004 | } | 1005 | } |
1005 | |||
1006 | t->hlen = addend; | ||
1007 | } | 1006 | } |
1008 | 1007 | ||
1009 | static int ip6gre_tnl_change(struct ip6_tnl *t, | 1008 | static int ip6gre_tnl_change(struct ip6_tnl *t, |
@@ -1173,9 +1172,8 @@ done: | |||
1173 | 1172 | ||
1174 | static int ip6gre_tunnel_change_mtu(struct net_device *dev, int new_mtu) | 1173 | static int ip6gre_tunnel_change_mtu(struct net_device *dev, int new_mtu) |
1175 | { | 1174 | { |
1176 | struct ip6_tnl *tunnel = netdev_priv(dev); | ||
1177 | if (new_mtu < 68 || | 1175 | if (new_mtu < 68 || |
1178 | new_mtu > 0xFFF8 - dev->hard_header_len - tunnel->hlen) | 1176 | new_mtu > 0xFFF8 - dev->hard_header_len) |
1179 | return -EINVAL; | 1177 | return -EINVAL; |
1180 | dev->mtu = new_mtu; | 1178 | dev->mtu = new_mtu; |
1181 | return 0; | 1179 | return 0; |
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index a54c45ce4a48..91fb4e8212f5 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -105,7 +105,7 @@ static int ip6_finish_output2(struct sk_buff *skb) | |||
105 | } | 105 | } |
106 | 106 | ||
107 | rcu_read_lock_bh(); | 107 | rcu_read_lock_bh(); |
108 | nexthop = rt6_nexthop((struct rt6_info *)dst, &ipv6_hdr(skb)->daddr); | 108 | nexthop = rt6_nexthop((struct rt6_info *)dst); |
109 | neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop); | 109 | neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop); |
110 | if (unlikely(!neigh)) | 110 | if (unlikely(!neigh)) |
111 | neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false); | 111 | neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false); |
@@ -874,7 +874,7 @@ static int ip6_dst_lookup_tail(struct sock *sk, | |||
874 | */ | 874 | */ |
875 | rt = (struct rt6_info *) *dst; | 875 | rt = (struct rt6_info *) *dst; |
876 | rcu_read_lock_bh(); | 876 | rcu_read_lock_bh(); |
877 | n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt, &fl6->daddr)); | 877 | n = __ipv6_neigh_lookup_noref(rt->dst.dev, rt6_nexthop(rt)); |
878 | err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0; | 878 | err = n && !(n->nud_state & NUD_VALID) ? -EINVAL : 0; |
879 | rcu_read_unlock_bh(); | 879 | rcu_read_unlock_bh(); |
880 | 880 | ||
@@ -1008,6 +1008,7 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1008 | 1008 | ||
1009 | { | 1009 | { |
1010 | struct sk_buff *skb; | 1010 | struct sk_buff *skb; |
1011 | struct frag_hdr fhdr; | ||
1011 | int err; | 1012 | int err; |
1012 | 1013 | ||
1013 | /* There is support for UDP large send offload by network | 1014 | /* There is support for UDP large send offload by network |
@@ -1015,8 +1016,6 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1015 | * udp datagram | 1016 | * udp datagram |
1016 | */ | 1017 | */ |
1017 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) { | 1018 | if ((skb = skb_peek_tail(&sk->sk_write_queue)) == NULL) { |
1018 | struct frag_hdr fhdr; | ||
1019 | |||
1020 | skb = sock_alloc_send_skb(sk, | 1019 | skb = sock_alloc_send_skb(sk, |
1021 | hh_len + fragheaderlen + transhdrlen + 20, | 1020 | hh_len + fragheaderlen + transhdrlen + 20, |
1022 | (flags & MSG_DONTWAIT), &err); | 1021 | (flags & MSG_DONTWAIT), &err); |
@@ -1036,20 +1035,24 @@ static inline int ip6_ufo_append_data(struct sock *sk, | |||
1036 | skb->transport_header = skb->network_header + fragheaderlen; | 1035 | skb->transport_header = skb->network_header + fragheaderlen; |
1037 | 1036 | ||
1038 | skb->protocol = htons(ETH_P_IPV6); | 1037 | skb->protocol = htons(ETH_P_IPV6); |
1039 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
1040 | skb->csum = 0; | 1038 | skb->csum = 0; |
1041 | 1039 | ||
1042 | /* Specify the length of each IPv6 datagram fragment. | ||
1043 | * It has to be a multiple of 8. | ||
1044 | */ | ||
1045 | skb_shinfo(skb)->gso_size = (mtu - fragheaderlen - | ||
1046 | sizeof(struct frag_hdr)) & ~7; | ||
1047 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
1048 | ipv6_select_ident(&fhdr, rt); | ||
1049 | skb_shinfo(skb)->ip6_frag_id = fhdr.identification; | ||
1050 | __skb_queue_tail(&sk->sk_write_queue, skb); | 1040 | __skb_queue_tail(&sk->sk_write_queue, skb); |
1041 | } else if (skb_is_gso(skb)) { | ||
1042 | goto append; | ||
1051 | } | 1043 | } |
1052 | 1044 | ||
1045 | skb->ip_summed = CHECKSUM_PARTIAL; | ||
1046 | /* Specify the length of each IPv6 datagram fragment. | ||
1047 | * It has to be a multiple of 8. | ||
1048 | */ | ||
1049 | skb_shinfo(skb)->gso_size = (mtu - fragheaderlen - | ||
1050 | sizeof(struct frag_hdr)) & ~7; | ||
1051 | skb_shinfo(skb)->gso_type = SKB_GSO_UDP; | ||
1052 | ipv6_select_ident(&fhdr, rt); | ||
1053 | skb_shinfo(skb)->ip6_frag_id = fhdr.identification; | ||
1054 | |||
1055 | append: | ||
1053 | return skb_append_datato_frags(sk, skb, getfrag, from, | 1056 | return skb_append_datato_frags(sk, skb, getfrag, from, |
1054 | (length - transhdrlen)); | 1057 | (length - transhdrlen)); |
1055 | } | 1058 | } |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index a791552e0422..583b77e2f69b 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -1430,9 +1430,17 @@ ip6_tnl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
1430 | static int | 1430 | static int |
1431 | ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) | 1431 | ip6_tnl_change_mtu(struct net_device *dev, int new_mtu) |
1432 | { | 1432 | { |
1433 | if (new_mtu < IPV6_MIN_MTU) { | 1433 | struct ip6_tnl *tnl = netdev_priv(dev); |
1434 | return -EINVAL; | 1434 | |
1435 | if (tnl->parms.proto == IPPROTO_IPIP) { | ||
1436 | if (new_mtu < 68) | ||
1437 | return -EINVAL; | ||
1438 | } else { | ||
1439 | if (new_mtu < IPV6_MIN_MTU) | ||
1440 | return -EINVAL; | ||
1435 | } | 1441 | } |
1442 | if (new_mtu > 0xFFF8 - dev->hard_header_len) | ||
1443 | return -EINVAL; | ||
1436 | dev->mtu = new_mtu; | 1444 | dev->mtu = new_mtu; |
1437 | return 0; | 1445 | return 0; |
1438 | } | 1446 | } |
diff --git a/net/ipv6/ipcomp6.c b/net/ipv6/ipcomp6.c index 5636a912074a..ce507d9e1c90 100644 --- a/net/ipv6/ipcomp6.c +++ b/net/ipv6/ipcomp6.c | |||
@@ -64,8 +64,7 @@ static void ipcomp6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, | |||
64 | (struct ip_comp_hdr *)(skb->data + offset); | 64 | (struct ip_comp_hdr *)(skb->data + offset); |
65 | struct xfrm_state *x; | 65 | struct xfrm_state *x; |
66 | 66 | ||
67 | if (type != ICMPV6_DEST_UNREACH && | 67 | if (type != ICMPV6_PKT_TOOBIG && |
68 | type != ICMPV6_PKT_TOOBIG && | ||
69 | type != NDISC_REDIRECT) | 68 | type != NDISC_REDIRECT) |
70 | return; | 69 | return; |
71 | 70 | ||
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c979dd96d82a..f54e3a101098 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -476,6 +476,24 @@ out: | |||
476 | } | 476 | } |
477 | 477 | ||
478 | #ifdef CONFIG_IPV6_ROUTER_PREF | 478 | #ifdef CONFIG_IPV6_ROUTER_PREF |
479 | struct __rt6_probe_work { | ||
480 | struct work_struct work; | ||
481 | struct in6_addr target; | ||
482 | struct net_device *dev; | ||
483 | }; | ||
484 | |||
485 | static void rt6_probe_deferred(struct work_struct *w) | ||
486 | { | ||
487 | struct in6_addr mcaddr; | ||
488 | struct __rt6_probe_work *work = | ||
489 | container_of(w, struct __rt6_probe_work, work); | ||
490 | |||
491 | addrconf_addr_solict_mult(&work->target, &mcaddr); | ||
492 | ndisc_send_ns(work->dev, NULL, &work->target, &mcaddr, NULL); | ||
493 | dev_put(work->dev); | ||
494 | kfree(w); | ||
495 | } | ||
496 | |||
479 | static void rt6_probe(struct rt6_info *rt) | 497 | static void rt6_probe(struct rt6_info *rt) |
480 | { | 498 | { |
481 | struct neighbour *neigh; | 499 | struct neighbour *neigh; |
@@ -499,17 +517,23 @@ static void rt6_probe(struct rt6_info *rt) | |||
499 | 517 | ||
500 | if (!neigh || | 518 | if (!neigh || |
501 | time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) { | 519 | time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) { |
502 | struct in6_addr mcaddr; | 520 | struct __rt6_probe_work *work; |
503 | struct in6_addr *target; | ||
504 | 521 | ||
505 | if (neigh) { | 522 | work = kmalloc(sizeof(*work), GFP_ATOMIC); |
523 | |||
524 | if (neigh && work) | ||
506 | neigh->updated = jiffies; | 525 | neigh->updated = jiffies; |
526 | |||
527 | if (neigh) | ||
507 | write_unlock(&neigh->lock); | 528 | write_unlock(&neigh->lock); |
508 | } | ||
509 | 529 | ||
510 | target = (struct in6_addr *)&rt->rt6i_gateway; | 530 | if (work) { |
511 | addrconf_addr_solict_mult(target, &mcaddr); | 531 | INIT_WORK(&work->work, rt6_probe_deferred); |
512 | ndisc_send_ns(rt->dst.dev, NULL, target, &mcaddr, NULL); | 532 | work->target = rt->rt6i_gateway; |
533 | dev_hold(rt->dst.dev); | ||
534 | work->dev = rt->dst.dev; | ||
535 | schedule_work(&work->work); | ||
536 | } | ||
513 | } else { | 537 | } else { |
514 | out: | 538 | out: |
515 | write_unlock(&neigh->lock); | 539 | write_unlock(&neigh->lock); |
@@ -851,7 +875,6 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, | |||
851 | if (ort->rt6i_dst.plen != 128 && | 875 | if (ort->rt6i_dst.plen != 128 && |
852 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) | 876 | ipv6_addr_equal(&ort->rt6i_dst.addr, daddr)) |
853 | rt->rt6i_flags |= RTF_ANYCAST; | 877 | rt->rt6i_flags |= RTF_ANYCAST; |
854 | rt->rt6i_gateway = *daddr; | ||
855 | } | 878 | } |
856 | 879 | ||
857 | rt->rt6i_flags |= RTF_CACHE; | 880 | rt->rt6i_flags |= RTF_CACHE; |
@@ -1338,6 +1361,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev, | |||
1338 | rt->dst.flags |= DST_HOST; | 1361 | rt->dst.flags |= DST_HOST; |
1339 | rt->dst.output = ip6_output; | 1362 | rt->dst.output = ip6_output; |
1340 | atomic_set(&rt->dst.__refcnt, 1); | 1363 | atomic_set(&rt->dst.__refcnt, 1); |
1364 | rt->rt6i_gateway = fl6->daddr; | ||
1341 | rt->rt6i_dst.addr = fl6->daddr; | 1365 | rt->rt6i_dst.addr = fl6->daddr; |
1342 | rt->rt6i_dst.plen = 128; | 1366 | rt->rt6i_dst.plen = 128; |
1343 | rt->rt6i_idev = idev; | 1367 | rt->rt6i_idev = idev; |
@@ -1873,7 +1897,10 @@ static struct rt6_info *ip6_rt_copy(struct rt6_info *ort, | |||
1873 | in6_dev_hold(rt->rt6i_idev); | 1897 | in6_dev_hold(rt->rt6i_idev); |
1874 | rt->dst.lastuse = jiffies; | 1898 | rt->dst.lastuse = jiffies; |
1875 | 1899 | ||
1876 | rt->rt6i_gateway = ort->rt6i_gateway; | 1900 | if (ort->rt6i_flags & RTF_GATEWAY) |
1901 | rt->rt6i_gateway = ort->rt6i_gateway; | ||
1902 | else | ||
1903 | rt->rt6i_gateway = *dest; | ||
1877 | rt->rt6i_flags = ort->rt6i_flags; | 1904 | rt->rt6i_flags = ort->rt6i_flags; |
1878 | if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) == | 1905 | if ((ort->rt6i_flags & (RTF_DEFAULT | RTF_ADDRCONF)) == |
1879 | (RTF_DEFAULT | RTF_ADDRCONF)) | 1906 | (RTF_DEFAULT | RTF_ADDRCONF)) |
@@ -2160,6 +2187,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, | |||
2160 | else | 2187 | else |
2161 | rt->rt6i_flags |= RTF_LOCAL; | 2188 | rt->rt6i_flags |= RTF_LOCAL; |
2162 | 2189 | ||
2190 | rt->rt6i_gateway = *addr; | ||
2163 | rt->rt6i_dst.addr = *addr; | 2191 | rt->rt6i_dst.addr = *addr; |
2164 | rt->rt6i_dst.plen = 128; | 2192 | rt->rt6i_dst.plen = 128; |
2165 | rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL); | 2193 | rt->rt6i_table = fib6_get_table(net, RT6_TABLE_LOCAL); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 72b7eaaf3ca0..18786098fd41 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -1225,9 +1225,6 @@ do_udp_sendmsg: | |||
1225 | if (tclass < 0) | 1225 | if (tclass < 0) |
1226 | tclass = np->tclass; | 1226 | tclass = np->tclass; |
1227 | 1227 | ||
1228 | if (dontfrag < 0) | ||
1229 | dontfrag = np->dontfrag; | ||
1230 | |||
1231 | if (msg->msg_flags&MSG_CONFIRM) | 1228 | if (msg->msg_flags&MSG_CONFIRM) |
1232 | goto do_confirm; | 1229 | goto do_confirm; |
1233 | back_from_confirm: | 1230 | back_from_confirm: |
@@ -1246,6 +1243,8 @@ back_from_confirm: | |||
1246 | up->pending = AF_INET6; | 1243 | up->pending = AF_INET6; |
1247 | 1244 | ||
1248 | do_append_data: | 1245 | do_append_data: |
1246 | if (dontfrag < 0) | ||
1247 | dontfrag = np->dontfrag; | ||
1249 | up->len += ulen; | 1248 | up->len += ulen; |
1250 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; | 1249 | getfrag = is_udplite ? udplite_getfrag : ip_generic_getfrag; |
1251 | err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen, | 1250 | err = ip6_append_data(sk, getfrag, msg->msg_iov, ulen, |
diff --git a/net/ipv6/xfrm6_policy.c b/net/ipv6/xfrm6_policy.c index 23ed03d786c8..08ed2772b7aa 100644 --- a/net/ipv6/xfrm6_policy.c +++ b/net/ipv6/xfrm6_policy.c | |||
@@ -138,6 +138,7 @@ _decode_session6(struct sk_buff *skb, struct flowi *fl, int reverse) | |||
138 | 138 | ||
139 | memset(fl6, 0, sizeof(struct flowi6)); | 139 | memset(fl6, 0, sizeof(struct flowi6)); |
140 | fl6->flowi6_mark = skb->mark; | 140 | fl6->flowi6_mark = skb->mark; |
141 | fl6->flowi6_oif = skb_dst(skb)->dev->ifindex; | ||
141 | 142 | ||
142 | fl6->daddr = reverse ? hdr->saddr : hdr->daddr; | 143 | fl6->daddr = reverse ? hdr->saddr : hdr->daddr; |
143 | fl6->saddr = reverse ? hdr->daddr : hdr->saddr; | 144 | fl6->saddr = reverse ? hdr->daddr : hdr->saddr; |
diff --git a/net/key/af_key.c b/net/key/af_key.c index 9d585370c5b4..911ef03bf8fb 100644 --- a/net/key/af_key.c +++ b/net/key/af_key.c | |||
@@ -1098,7 +1098,8 @@ static struct xfrm_state * pfkey_msg2xfrm_state(struct net *net, | |||
1098 | 1098 | ||
1099 | x->id.proto = proto; | 1099 | x->id.proto = proto; |
1100 | x->id.spi = sa->sadb_sa_spi; | 1100 | x->id.spi = sa->sadb_sa_spi; |
1101 | x->props.replay_window = sa->sadb_sa_replay; | 1101 | x->props.replay_window = min_t(unsigned int, sa->sadb_sa_replay, |
1102 | (sizeof(x->replay.bitmap) * 8)); | ||
1102 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOECN) | 1103 | if (sa->sadb_sa_flags & SADB_SAFLAGS_NOECN) |
1103 | x->props.flags |= XFRM_STATE_NOECN; | 1104 | x->props.flags |= XFRM_STATE_NOECN; |
1104 | if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP) | 1105 | if (sa->sadb_sa_flags & SADB_SAFLAGS_DECAP_DSCP) |
diff --git a/net/l2tp/l2tp_core.c b/net/l2tp/l2tp_core.c index feae495a0a30..b076e8309bc2 100644 --- a/net/l2tp/l2tp_core.c +++ b/net/l2tp/l2tp_core.c | |||
@@ -115,6 +115,11 @@ struct l2tp_net { | |||
115 | static void l2tp_session_set_header_len(struct l2tp_session *session, int version); | 115 | static void l2tp_session_set_header_len(struct l2tp_session *session, int version); |
116 | static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel); | 116 | static void l2tp_tunnel_free(struct l2tp_tunnel *tunnel); |
117 | 117 | ||
118 | static inline struct l2tp_tunnel *l2tp_tunnel(struct sock *sk) | ||
119 | { | ||
120 | return sk->sk_user_data; | ||
121 | } | ||
122 | |||
118 | static inline struct l2tp_net *l2tp_pernet(struct net *net) | 123 | static inline struct l2tp_net *l2tp_pernet(struct net *net) |
119 | { | 124 | { |
120 | BUG_ON(!net); | 125 | BUG_ON(!net); |
@@ -504,7 +509,7 @@ static inline int l2tp_verify_udp_checksum(struct sock *sk, | |||
504 | return 0; | 509 | return 0; |
505 | 510 | ||
506 | #if IS_ENABLED(CONFIG_IPV6) | 511 | #if IS_ENABLED(CONFIG_IPV6) |
507 | if (sk->sk_family == PF_INET6) { | 512 | if (sk->sk_family == PF_INET6 && !l2tp_tunnel(sk)->v4mapped) { |
508 | if (!uh->check) { | 513 | if (!uh->check) { |
509 | LIMIT_NETDEBUG(KERN_INFO "L2TP: IPv6: checksum is 0\n"); | 514 | LIMIT_NETDEBUG(KERN_INFO "L2TP: IPv6: checksum is 0\n"); |
510 | return 1; | 515 | return 1; |
@@ -1128,7 +1133,7 @@ static int l2tp_xmit_core(struct l2tp_session *session, struct sk_buff *skb, | |||
1128 | /* Queue the packet to IP for output */ | 1133 | /* Queue the packet to IP for output */ |
1129 | skb->local_df = 1; | 1134 | skb->local_df = 1; |
1130 | #if IS_ENABLED(CONFIG_IPV6) | 1135 | #if IS_ENABLED(CONFIG_IPV6) |
1131 | if (skb->sk->sk_family == PF_INET6) | 1136 | if (skb->sk->sk_family == PF_INET6 && !tunnel->v4mapped) |
1132 | error = inet6_csk_xmit(skb, NULL); | 1137 | error = inet6_csk_xmit(skb, NULL); |
1133 | else | 1138 | else |
1134 | #endif | 1139 | #endif |
@@ -1255,7 +1260,7 @@ int l2tp_xmit_skb(struct l2tp_session *session, struct sk_buff *skb, int hdr_len | |||
1255 | 1260 | ||
1256 | /* Calculate UDP checksum if configured to do so */ | 1261 | /* Calculate UDP checksum if configured to do so */ |
1257 | #if IS_ENABLED(CONFIG_IPV6) | 1262 | #if IS_ENABLED(CONFIG_IPV6) |
1258 | if (sk->sk_family == PF_INET6) | 1263 | if (sk->sk_family == PF_INET6 && !tunnel->v4mapped) |
1259 | l2tp_xmit_ipv6_csum(sk, skb, udp_len); | 1264 | l2tp_xmit_ipv6_csum(sk, skb, udp_len); |
1260 | else | 1265 | else |
1261 | #endif | 1266 | #endif |
@@ -1304,10 +1309,9 @@ EXPORT_SYMBOL_GPL(l2tp_xmit_skb); | |||
1304 | */ | 1309 | */ |
1305 | static void l2tp_tunnel_destruct(struct sock *sk) | 1310 | static void l2tp_tunnel_destruct(struct sock *sk) |
1306 | { | 1311 | { |
1307 | struct l2tp_tunnel *tunnel; | 1312 | struct l2tp_tunnel *tunnel = l2tp_tunnel(sk); |
1308 | struct l2tp_net *pn; | 1313 | struct l2tp_net *pn; |
1309 | 1314 | ||
1310 | tunnel = sk->sk_user_data; | ||
1311 | if (tunnel == NULL) | 1315 | if (tunnel == NULL) |
1312 | goto end; | 1316 | goto end; |
1313 | 1317 | ||
@@ -1675,7 +1679,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 | |||
1675 | } | 1679 | } |
1676 | 1680 | ||
1677 | /* Check if this socket has already been prepped */ | 1681 | /* Check if this socket has already been prepped */ |
1678 | tunnel = (struct l2tp_tunnel *)sk->sk_user_data; | 1682 | tunnel = l2tp_tunnel(sk); |
1679 | if (tunnel != NULL) { | 1683 | if (tunnel != NULL) { |
1680 | /* This socket has already been prepped */ | 1684 | /* This socket has already been prepped */ |
1681 | err = -EBUSY; | 1685 | err = -EBUSY; |
@@ -1704,6 +1708,24 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 | |||
1704 | if (cfg != NULL) | 1708 | if (cfg != NULL) |
1705 | tunnel->debug = cfg->debug; | 1709 | tunnel->debug = cfg->debug; |
1706 | 1710 | ||
1711 | #if IS_ENABLED(CONFIG_IPV6) | ||
1712 | if (sk->sk_family == PF_INET6) { | ||
1713 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
1714 | |||
1715 | if (ipv6_addr_v4mapped(&np->saddr) && | ||
1716 | ipv6_addr_v4mapped(&np->daddr)) { | ||
1717 | struct inet_sock *inet = inet_sk(sk); | ||
1718 | |||
1719 | tunnel->v4mapped = true; | ||
1720 | inet->inet_saddr = np->saddr.s6_addr32[3]; | ||
1721 | inet->inet_rcv_saddr = np->rcv_saddr.s6_addr32[3]; | ||
1722 | inet->inet_daddr = np->daddr.s6_addr32[3]; | ||
1723 | } else { | ||
1724 | tunnel->v4mapped = false; | ||
1725 | } | ||
1726 | } | ||
1727 | #endif | ||
1728 | |||
1707 | /* Mark socket as an encapsulation socket. See net/ipv4/udp.c */ | 1729 | /* Mark socket as an encapsulation socket. See net/ipv4/udp.c */ |
1708 | tunnel->encap = encap; | 1730 | tunnel->encap = encap; |
1709 | if (encap == L2TP_ENCAPTYPE_UDP) { | 1731 | if (encap == L2TP_ENCAPTYPE_UDP) { |
@@ -1712,7 +1734,7 @@ int l2tp_tunnel_create(struct net *net, int fd, int version, u32 tunnel_id, u32 | |||
1712 | udp_sk(sk)->encap_rcv = l2tp_udp_encap_recv; | 1734 | udp_sk(sk)->encap_rcv = l2tp_udp_encap_recv; |
1713 | udp_sk(sk)->encap_destroy = l2tp_udp_encap_destroy; | 1735 | udp_sk(sk)->encap_destroy = l2tp_udp_encap_destroy; |
1714 | #if IS_ENABLED(CONFIG_IPV6) | 1736 | #if IS_ENABLED(CONFIG_IPV6) |
1715 | if (sk->sk_family == PF_INET6) | 1737 | if (sk->sk_family == PF_INET6 && !tunnel->v4mapped) |
1716 | udpv6_encap_enable(); | 1738 | udpv6_encap_enable(); |
1717 | else | 1739 | else |
1718 | #endif | 1740 | #endif |
diff --git a/net/l2tp/l2tp_core.h b/net/l2tp/l2tp_core.h index 66a559b104b6..6f251cbc2ed7 100644 --- a/net/l2tp/l2tp_core.h +++ b/net/l2tp/l2tp_core.h | |||
@@ -194,6 +194,9 @@ struct l2tp_tunnel { | |||
194 | struct sock *sock; /* Parent socket */ | 194 | struct sock *sock; /* Parent socket */ |
195 | int fd; /* Parent fd, if tunnel socket | 195 | int fd; /* Parent fd, if tunnel socket |
196 | * was created by userspace */ | 196 | * was created by userspace */ |
197 | #if IS_ENABLED(CONFIG_IPV6) | ||
198 | bool v4mapped; | ||
199 | #endif | ||
197 | 200 | ||
198 | struct work_struct del_work; | 201 | struct work_struct del_work; |
199 | 202 | ||
diff --git a/net/l2tp/l2tp_ppp.c b/net/l2tp/l2tp_ppp.c index 5ebee2ded9e9..8c46b271064a 100644 --- a/net/l2tp/l2tp_ppp.c +++ b/net/l2tp/l2tp_ppp.c | |||
@@ -353,7 +353,9 @@ static int pppol2tp_sendmsg(struct kiocb *iocb, struct socket *sock, struct msgh | |||
353 | goto error_put_sess_tun; | 353 | goto error_put_sess_tun; |
354 | } | 354 | } |
355 | 355 | ||
356 | local_bh_disable(); | ||
356 | l2tp_xmit_skb(session, skb, session->hdr_len); | 357 | l2tp_xmit_skb(session, skb, session->hdr_len); |
358 | local_bh_enable(); | ||
357 | 359 | ||
358 | sock_put(ps->tunnel_sock); | 360 | sock_put(ps->tunnel_sock); |
359 | sock_put(sk); | 361 | sock_put(sk); |
@@ -422,7 +424,9 @@ static int pppol2tp_xmit(struct ppp_channel *chan, struct sk_buff *skb) | |||
422 | skb->data[0] = ppph[0]; | 424 | skb->data[0] = ppph[0]; |
423 | skb->data[1] = ppph[1]; | 425 | skb->data[1] = ppph[1]; |
424 | 426 | ||
427 | local_bh_disable(); | ||
425 | l2tp_xmit_skb(session, skb, session->hdr_len); | 428 | l2tp_xmit_skb(session, skb, session->hdr_len); |
429 | local_bh_enable(); | ||
426 | 430 | ||
427 | sock_put(sk_tun); | 431 | sock_put(sk_tun); |
428 | sock_put(sk); | 432 | sock_put(sk); |
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 2e7855a1b10d..629dee7ec9bf 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -3518,7 +3518,7 @@ static int ieee80211_probe_client(struct wiphy *wiphy, struct net_device *dev, | |||
3518 | return -EINVAL; | 3518 | return -EINVAL; |
3519 | } | 3519 | } |
3520 | band = chanctx_conf->def.chan->band; | 3520 | band = chanctx_conf->def.chan->band; |
3521 | sta = sta_info_get(sdata, peer); | 3521 | sta = sta_info_get_bss(sdata, peer); |
3522 | if (sta) { | 3522 | if (sta) { |
3523 | qos = test_sta_flag(sta, WLAN_STA_WME); | 3523 | qos = test_sta_flag(sta, WLAN_STA_WME); |
3524 | } else { | 3524 | } else { |
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index b6186517ec56..611abfcfb5eb 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -893,6 +893,8 @@ struct tpt_led_trigger { | |||
893 | * that the scan completed. | 893 | * that the scan completed. |
894 | * @SCAN_ABORTED: Set for our scan work function when the driver reported | 894 | * @SCAN_ABORTED: Set for our scan work function when the driver reported |
895 | * a scan complete for an aborted scan. | 895 | * a scan complete for an aborted scan. |
896 | * @SCAN_HW_CANCELLED: Set for our scan work function when the scan is being | ||
897 | * cancelled. | ||
896 | */ | 898 | */ |
897 | enum { | 899 | enum { |
898 | SCAN_SW_SCANNING, | 900 | SCAN_SW_SCANNING, |
@@ -900,6 +902,7 @@ enum { | |||
900 | SCAN_ONCHANNEL_SCANNING, | 902 | SCAN_ONCHANNEL_SCANNING, |
901 | SCAN_COMPLETED, | 903 | SCAN_COMPLETED, |
902 | SCAN_ABORTED, | 904 | SCAN_ABORTED, |
905 | SCAN_HW_CANCELLED, | ||
903 | }; | 906 | }; |
904 | 907 | ||
905 | /** | 908 | /** |
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index acd1f71adc03..0c2a29484c07 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c | |||
@@ -394,6 +394,8 @@ void ieee80211_sw_roc_work(struct work_struct *work) | |||
394 | 394 | ||
395 | if (started) | 395 | if (started) |
396 | ieee80211_start_next_roc(local); | 396 | ieee80211_start_next_roc(local); |
397 | else if (list_empty(&local->roc_list)) | ||
398 | ieee80211_run_deferred_scan(local); | ||
397 | } | 399 | } |
398 | 400 | ||
399 | out_unlock: | 401 | out_unlock: |
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 54395d7583ba..674eac1f996c 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -3056,6 +3056,9 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
3056 | case NL80211_IFTYPE_ADHOC: | 3056 | case NL80211_IFTYPE_ADHOC: |
3057 | if (!bssid) | 3057 | if (!bssid) |
3058 | return 0; | 3058 | return 0; |
3059 | if (ether_addr_equal(sdata->vif.addr, hdr->addr2) || | ||
3060 | ether_addr_equal(sdata->u.ibss.bssid, hdr->addr2)) | ||
3061 | return 0; | ||
3059 | if (ieee80211_is_beacon(hdr->frame_control)) { | 3062 | if (ieee80211_is_beacon(hdr->frame_control)) { |
3060 | return 1; | 3063 | return 1; |
3061 | } else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { | 3064 | } else if (!ieee80211_bssid_match(bssid, sdata->u.ibss.bssid)) { |
diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index 08afe74b98f4..d2d17a449224 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c | |||
@@ -238,6 +238,9 @@ static bool ieee80211_prep_hw_scan(struct ieee80211_local *local) | |||
238 | enum ieee80211_band band; | 238 | enum ieee80211_band band; |
239 | int i, ielen, n_chans; | 239 | int i, ielen, n_chans; |
240 | 240 | ||
241 | if (test_bit(SCAN_HW_CANCELLED, &local->scanning)) | ||
242 | return false; | ||
243 | |||
241 | do { | 244 | do { |
242 | if (local->hw_scan_band == IEEE80211_NUM_BANDS) | 245 | if (local->hw_scan_band == IEEE80211_NUM_BANDS) |
243 | return false; | 246 | return false; |
@@ -940,7 +943,23 @@ void ieee80211_scan_cancel(struct ieee80211_local *local) | |||
940 | if (!local->scan_req) | 943 | if (!local->scan_req) |
941 | goto out; | 944 | goto out; |
942 | 945 | ||
946 | /* | ||
947 | * We have a scan running and the driver already reported completion, | ||
948 | * but the worker hasn't run yet or is stuck on the mutex - mark it as | ||
949 | * cancelled. | ||
950 | */ | ||
951 | if (test_bit(SCAN_HW_SCANNING, &local->scanning) && | ||
952 | test_bit(SCAN_COMPLETED, &local->scanning)) { | ||
953 | set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||
954 | goto out; | ||
955 | } | ||
956 | |||
943 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { | 957 | if (test_bit(SCAN_HW_SCANNING, &local->scanning)) { |
958 | /* | ||
959 | * Make sure that __ieee80211_scan_completed doesn't trigger a | ||
960 | * scan on another band. | ||
961 | */ | ||
962 | set_bit(SCAN_HW_CANCELLED, &local->scanning); | ||
944 | if (local->ops->cancel_hw_scan) | 963 | if (local->ops->cancel_hw_scan) |
945 | drv_cancel_hw_scan(local, | 964 | drv_cancel_hw_scan(local, |
946 | rcu_dereference_protected(local->scan_sdata, | 965 | rcu_dereference_protected(local->scan_sdata, |
diff --git a/net/mac80211/status.c b/net/mac80211/status.c index 368837fe3b80..78dc2e99027e 100644 --- a/net/mac80211/status.c +++ b/net/mac80211/status.c | |||
@@ -180,6 +180,9 @@ static void ieee80211_frame_acked(struct sta_info *sta, struct sk_buff *skb) | |||
180 | struct ieee80211_local *local = sta->local; | 180 | struct ieee80211_local *local = sta->local; |
181 | struct ieee80211_sub_if_data *sdata = sta->sdata; | 181 | struct ieee80211_sub_if_data *sdata = sta->sdata; |
182 | 182 | ||
183 | if (local->hw.flags & IEEE80211_HW_REPORTS_TX_ACK_STATUS) | ||
184 | sta->last_rx = jiffies; | ||
185 | |||
183 | if (ieee80211_is_data_qos(mgmt->frame_control)) { | 186 | if (ieee80211_is_data_qos(mgmt->frame_control)) { |
184 | struct ieee80211_hdr *hdr = (void *) skb->data; | 187 | struct ieee80211_hdr *hdr = (void *) skb->data; |
185 | u8 *qc = ieee80211_get_qos_ctl(hdr); | 188 | u8 *qc = ieee80211_get_qos_ctl(hdr); |
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 3456c0486b48..70b5a05c0a4e 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1120,7 +1120,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, | |||
1120 | tx->sta = rcu_dereference(sdata->u.vlan.sta); | 1120 | tx->sta = rcu_dereference(sdata->u.vlan.sta); |
1121 | if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) | 1121 | if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) |
1122 | return TX_DROP; | 1122 | return TX_DROP; |
1123 | } else if (info->flags & IEEE80211_TX_CTL_INJECTED || | 1123 | } else if (info->flags & (IEEE80211_TX_CTL_INJECTED | |
1124 | IEEE80211_TX_INTFL_NL80211_FRAME_TX) || | ||
1124 | tx->sdata->control_port_protocol == tx->skb->protocol) { | 1125 | tx->sdata->control_port_protocol == tx->skb->protocol) { |
1125 | tx->sta = sta_info_get_bss(sdata, hdr->addr1); | 1126 | tx->sta = sta_info_get_bss(sdata, hdr->addr1); |
1126 | } | 1127 | } |
diff --git a/net/mac80211/util.c b/net/mac80211/util.c index e1b34a18b243..69e4ef5348a0 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c | |||
@@ -2103,7 +2103,7 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata, | |||
2103 | { | 2103 | { |
2104 | struct ieee80211_local *local = sdata->local; | 2104 | struct ieee80211_local *local = sdata->local; |
2105 | struct ieee80211_supported_band *sband; | 2105 | struct ieee80211_supported_band *sband; |
2106 | int rate, skip, shift; | 2106 | int rate, shift; |
2107 | u8 i, exrates, *pos; | 2107 | u8 i, exrates, *pos; |
2108 | u32 basic_rates = sdata->vif.bss_conf.basic_rates; | 2108 | u32 basic_rates = sdata->vif.bss_conf.basic_rates; |
2109 | u32 rate_flags; | 2109 | u32 rate_flags; |
@@ -2131,14 +2131,11 @@ int ieee80211_add_ext_srates_ie(struct ieee80211_sub_if_data *sdata, | |||
2131 | pos = skb_put(skb, exrates + 2); | 2131 | pos = skb_put(skb, exrates + 2); |
2132 | *pos++ = WLAN_EID_EXT_SUPP_RATES; | 2132 | *pos++ = WLAN_EID_EXT_SUPP_RATES; |
2133 | *pos++ = exrates; | 2133 | *pos++ = exrates; |
2134 | skip = 0; | ||
2135 | for (i = 8; i < sband->n_bitrates; i++) { | 2134 | for (i = 8; i < sband->n_bitrates; i++) { |
2136 | u8 basic = 0; | 2135 | u8 basic = 0; |
2137 | if ((rate_flags & sband->bitrates[i].flags) | 2136 | if ((rate_flags & sband->bitrates[i].flags) |
2138 | != rate_flags) | 2137 | != rate_flags) |
2139 | continue; | 2138 | continue; |
2140 | if (skip++ < 8) | ||
2141 | continue; | ||
2142 | if (need_basic && basic_rates & BIT(i)) | 2139 | if (need_basic && basic_rates & BIT(i)) |
2143 | basic = 0x80; | 2140 | basic = 0x80; |
2144 | rate = DIV_ROUND_UP(sband->bitrates[i].bitrate, | 2141 | rate = DIV_ROUND_UP(sband->bitrates[i].bitrate, |
@@ -2241,6 +2238,10 @@ u64 ieee80211_calculate_rx_timestamp(struct ieee80211_local *local, | |||
2241 | } | 2238 | } |
2242 | 2239 | ||
2243 | rate = cfg80211_calculate_bitrate(&ri); | 2240 | rate = cfg80211_calculate_bitrate(&ri); |
2241 | if (WARN_ONCE(!rate, | ||
2242 | "Invalid bitrate: flags=0x%x, idx=%d, vht_nss=%d\n", | ||
2243 | status->flag, status->rate_idx, status->vht_nss)) | ||
2244 | return 0; | ||
2244 | 2245 | ||
2245 | /* rewind from end of MPDU */ | 2246 | /* rewind from end of MPDU */ |
2246 | if (status->flag & RX_FLAG_MACTIME_END) | 2247 | if (status->flag & RX_FLAG_MACTIME_END) |
diff --git a/net/netfilter/nf_conntrack_h323_main.c b/net/netfilter/nf_conntrack_h323_main.c index bdebd03bc8cd..70866d192efc 100644 --- a/net/netfilter/nf_conntrack_h323_main.c +++ b/net/netfilter/nf_conntrack_h323_main.c | |||
@@ -778,8 +778,8 @@ static int callforward_do_filter(const union nf_inet_addr *src, | |||
778 | flowi6_to_flowi(&fl1), false)) { | 778 | flowi6_to_flowi(&fl1), false)) { |
779 | if (!afinfo->route(&init_net, (struct dst_entry **)&rt2, | 779 | if (!afinfo->route(&init_net, (struct dst_entry **)&rt2, |
780 | flowi6_to_flowi(&fl2), false)) { | 780 | flowi6_to_flowi(&fl2), false)) { |
781 | if (!memcmp(&rt1->rt6i_gateway, &rt2->rt6i_gateway, | 781 | if (ipv6_addr_equal(rt6_nexthop(rt1), |
782 | sizeof(rt1->rt6i_gateway)) && | 782 | rt6_nexthop(rt2)) && |
783 | rt1->dst.dev == rt2->dst.dev) | 783 | rt1->dst.dev == rt2->dst.dev) |
784 | ret = 1; | 784 | ret = 1; |
785 | dst_release(&rt2->dst); | 785 | dst_release(&rt2->dst); |
diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c index a2fef8b10b96..a9dfdda9ed1d 100644 --- a/net/sched/sch_fq.c +++ b/net/sched/sch_fq.c | |||
@@ -472,20 +472,16 @@ begin: | |||
472 | if (f->credit > 0 || !q->rate_enable) | 472 | if (f->credit > 0 || !q->rate_enable) |
473 | goto out; | 473 | goto out; |
474 | 474 | ||
475 | if (skb->sk && skb->sk->sk_state != TCP_TIME_WAIT) { | 475 | rate = q->flow_max_rate; |
476 | rate = skb->sk->sk_pacing_rate ?: q->flow_default_rate; | 476 | if (skb->sk && skb->sk->sk_state != TCP_TIME_WAIT) |
477 | rate = min(skb->sk->sk_pacing_rate, rate); | ||
477 | 478 | ||
478 | rate = min(rate, q->flow_max_rate); | 479 | if (rate != ~0U) { |
479 | } else { | ||
480 | rate = q->flow_max_rate; | ||
481 | if (rate == ~0U) | ||
482 | goto out; | ||
483 | } | ||
484 | if (rate) { | ||
485 | u32 plen = max(qdisc_pkt_len(skb), q->quantum); | 480 | u32 plen = max(qdisc_pkt_len(skb), q->quantum); |
486 | u64 len = (u64)plen * NSEC_PER_SEC; | 481 | u64 len = (u64)plen * NSEC_PER_SEC; |
487 | 482 | ||
488 | do_div(len, rate); | 483 | if (likely(rate)) |
484 | do_div(len, rate); | ||
489 | /* Since socket rate can change later, | 485 | /* Since socket rate can change later, |
490 | * clamp the delay to 125 ms. | 486 | * clamp the delay to 125 ms. |
491 | * TODO: maybe segment the too big skb, as in commit | 487 | * TODO: maybe segment the too big skb, as in commit |
@@ -656,7 +652,7 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt) | |||
656 | q->quantum = nla_get_u32(tb[TCA_FQ_QUANTUM]); | 652 | q->quantum = nla_get_u32(tb[TCA_FQ_QUANTUM]); |
657 | 653 | ||
658 | if (tb[TCA_FQ_INITIAL_QUANTUM]) | 654 | if (tb[TCA_FQ_INITIAL_QUANTUM]) |
659 | q->quantum = nla_get_u32(tb[TCA_FQ_INITIAL_QUANTUM]); | 655 | q->initial_quantum = nla_get_u32(tb[TCA_FQ_INITIAL_QUANTUM]); |
660 | 656 | ||
661 | if (tb[TCA_FQ_FLOW_DEFAULT_RATE]) | 657 | if (tb[TCA_FQ_FLOW_DEFAULT_RATE]) |
662 | q->flow_default_rate = nla_get_u32(tb[TCA_FQ_FLOW_DEFAULT_RATE]); | 658 | q->flow_default_rate = nla_get_u32(tb[TCA_FQ_FLOW_DEFAULT_RATE]); |
@@ -735,12 +731,14 @@ static int fq_dump(struct Qdisc *sch, struct sk_buff *skb) | |||
735 | if (opts == NULL) | 731 | if (opts == NULL) |
736 | goto nla_put_failure; | 732 | goto nla_put_failure; |
737 | 733 | ||
734 | /* TCA_FQ_FLOW_DEFAULT_RATE is not used anymore, | ||
735 | * do not bother giving its value | ||
736 | */ | ||
738 | if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || | 737 | if (nla_put_u32(skb, TCA_FQ_PLIMIT, sch->limit) || |
739 | nla_put_u32(skb, TCA_FQ_FLOW_PLIMIT, q->flow_plimit) || | 738 | nla_put_u32(skb, TCA_FQ_FLOW_PLIMIT, q->flow_plimit) || |
740 | nla_put_u32(skb, TCA_FQ_QUANTUM, q->quantum) || | 739 | nla_put_u32(skb, TCA_FQ_QUANTUM, q->quantum) || |
741 | nla_put_u32(skb, TCA_FQ_INITIAL_QUANTUM, q->initial_quantum) || | 740 | nla_put_u32(skb, TCA_FQ_INITIAL_QUANTUM, q->initial_quantum) || |
742 | nla_put_u32(skb, TCA_FQ_RATE_ENABLE, q->rate_enable) || | 741 | nla_put_u32(skb, TCA_FQ_RATE_ENABLE, q->rate_enable) || |
743 | nla_put_u32(skb, TCA_FQ_FLOW_DEFAULT_RATE, q->flow_default_rate) || | ||
744 | nla_put_u32(skb, TCA_FQ_FLOW_MAX_RATE, q->flow_max_rate) || | 742 | nla_put_u32(skb, TCA_FQ_FLOW_MAX_RATE, q->flow_max_rate) || |
745 | nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log)) | 743 | nla_put_u32(skb, TCA_FQ_BUCKETS_LOG, q->fq_trees_log)) |
746 | goto nla_put_failure; | 744 | goto nla_put_failure; |
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c index a6d788d45216..b87e83d07478 100644 --- a/net/sched/sch_netem.c +++ b/net/sched/sch_netem.c | |||
@@ -358,6 +358,21 @@ static psched_time_t packet_len_2_sched_time(unsigned int len, struct netem_sche | |||
358 | return PSCHED_NS2TICKS(ticks); | 358 | return PSCHED_NS2TICKS(ticks); |
359 | } | 359 | } |
360 | 360 | ||
361 | static void tfifo_reset(struct Qdisc *sch) | ||
362 | { | ||
363 | struct netem_sched_data *q = qdisc_priv(sch); | ||
364 | struct rb_node *p; | ||
365 | |||
366 | while ((p = rb_first(&q->t_root))) { | ||
367 | struct sk_buff *skb = netem_rb_to_skb(p); | ||
368 | |||
369 | rb_erase(p, &q->t_root); | ||
370 | skb->next = NULL; | ||
371 | skb->prev = NULL; | ||
372 | kfree_skb(skb); | ||
373 | } | ||
374 | } | ||
375 | |||
361 | static void tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) | 376 | static void tfifo_enqueue(struct sk_buff *nskb, struct Qdisc *sch) |
362 | { | 377 | { |
363 | struct netem_sched_data *q = qdisc_priv(sch); | 378 | struct netem_sched_data *q = qdisc_priv(sch); |
@@ -520,6 +535,7 @@ static unsigned int netem_drop(struct Qdisc *sch) | |||
520 | skb->next = NULL; | 535 | skb->next = NULL; |
521 | skb->prev = NULL; | 536 | skb->prev = NULL; |
522 | len = qdisc_pkt_len(skb); | 537 | len = qdisc_pkt_len(skb); |
538 | sch->qstats.backlog -= len; | ||
523 | kfree_skb(skb); | 539 | kfree_skb(skb); |
524 | } | 540 | } |
525 | } | 541 | } |
@@ -609,6 +625,7 @@ static void netem_reset(struct Qdisc *sch) | |||
609 | struct netem_sched_data *q = qdisc_priv(sch); | 625 | struct netem_sched_data *q = qdisc_priv(sch); |
610 | 626 | ||
611 | qdisc_reset_queue(sch); | 627 | qdisc_reset_queue(sch); |
628 | tfifo_reset(sch); | ||
612 | if (q->qdisc) | 629 | if (q->qdisc) |
613 | qdisc_reset(q->qdisc); | 630 | qdisc_reset(q->qdisc); |
614 | qdisc_watchdog_cancel(&q->watchdog); | 631 | qdisc_watchdog_cancel(&q->watchdog); |
diff --git a/net/sctp/output.c b/net/sctp/output.c index 0ac3a65daccb..319137340d15 100644 --- a/net/sctp/output.c +++ b/net/sctp/output.c | |||
@@ -536,7 +536,8 @@ int sctp_packet_transmit(struct sctp_packet *packet) | |||
536 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. | 536 | * by CRC32-C as described in <draft-ietf-tsvwg-sctpcsum-02.txt>. |
537 | */ | 537 | */ |
538 | if (!sctp_checksum_disable) { | 538 | if (!sctp_checksum_disable) { |
539 | if (!(dst->dev->features & NETIF_F_SCTP_CSUM)) { | 539 | if (!(dst->dev->features & NETIF_F_SCTP_CSUM) || |
540 | (dst_xfrm(dst) != NULL) || packet->ipfragok) { | ||
540 | __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); | 541 | __u32 crc32 = sctp_start_cksum((__u8 *)sh, cksum_buf_len); |
541 | 542 | ||
542 | /* 3) Put the resultant value into the checksum field in the | 543 | /* 3) Put the resultant value into the checksum field in the |
diff --git a/net/socket.c b/net/socket.c index ebed4b68f768..c226aceee65b 100644 --- a/net/socket.c +++ b/net/socket.c | |||
@@ -1964,6 +1964,16 @@ struct used_address { | |||
1964 | unsigned int name_len; | 1964 | unsigned int name_len; |
1965 | }; | 1965 | }; |
1966 | 1966 | ||
1967 | static int copy_msghdr_from_user(struct msghdr *kmsg, | ||
1968 | struct msghdr __user *umsg) | ||
1969 | { | ||
1970 | if (copy_from_user(kmsg, umsg, sizeof(struct msghdr))) | ||
1971 | return -EFAULT; | ||
1972 | if (kmsg->msg_namelen > sizeof(struct sockaddr_storage)) | ||
1973 | return -EINVAL; | ||
1974 | return 0; | ||
1975 | } | ||
1976 | |||
1967 | static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg, | 1977 | static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg, |
1968 | struct msghdr *msg_sys, unsigned int flags, | 1978 | struct msghdr *msg_sys, unsigned int flags, |
1969 | struct used_address *used_address) | 1979 | struct used_address *used_address) |
@@ -1982,8 +1992,11 @@ static int ___sys_sendmsg(struct socket *sock, struct msghdr __user *msg, | |||
1982 | if (MSG_CMSG_COMPAT & flags) { | 1992 | if (MSG_CMSG_COMPAT & flags) { |
1983 | if (get_compat_msghdr(msg_sys, msg_compat)) | 1993 | if (get_compat_msghdr(msg_sys, msg_compat)) |
1984 | return -EFAULT; | 1994 | return -EFAULT; |
1985 | } else if (copy_from_user(msg_sys, msg, sizeof(struct msghdr))) | 1995 | } else { |
1986 | return -EFAULT; | 1996 | err = copy_msghdr_from_user(msg_sys, msg); |
1997 | if (err) | ||
1998 | return err; | ||
1999 | } | ||
1987 | 2000 | ||
1988 | if (msg_sys->msg_iovlen > UIO_FASTIOV) { | 2001 | if (msg_sys->msg_iovlen > UIO_FASTIOV) { |
1989 | err = -EMSGSIZE; | 2002 | err = -EMSGSIZE; |
@@ -2191,8 +2204,11 @@ static int ___sys_recvmsg(struct socket *sock, struct msghdr __user *msg, | |||
2191 | if (MSG_CMSG_COMPAT & flags) { | 2204 | if (MSG_CMSG_COMPAT & flags) { |
2192 | if (get_compat_msghdr(msg_sys, msg_compat)) | 2205 | if (get_compat_msghdr(msg_sys, msg_compat)) |
2193 | return -EFAULT; | 2206 | return -EFAULT; |
2194 | } else if (copy_from_user(msg_sys, msg, sizeof(struct msghdr))) | 2207 | } else { |
2195 | return -EFAULT; | 2208 | err = copy_msghdr_from_user(msg_sys, msg); |
2209 | if (err) | ||
2210 | return err; | ||
2211 | } | ||
2196 | 2212 | ||
2197 | if (msg_sys->msg_iovlen > UIO_FASTIOV) { | 2213 | if (msg_sys->msg_iovlen > UIO_FASTIOV) { |
2198 | err = -EMSGSIZE; | 2214 | err = -EMSGSIZE; |
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c index 86de99ad2976..c1f403bed683 100644 --- a/net/unix/af_unix.c +++ b/net/unix/af_unix.c | |||
@@ -1246,6 +1246,15 @@ static int unix_socketpair(struct socket *socka, struct socket *sockb) | |||
1246 | return 0; | 1246 | return 0; |
1247 | } | 1247 | } |
1248 | 1248 | ||
1249 | static void unix_sock_inherit_flags(const struct socket *old, | ||
1250 | struct socket *new) | ||
1251 | { | ||
1252 | if (test_bit(SOCK_PASSCRED, &old->flags)) | ||
1253 | set_bit(SOCK_PASSCRED, &new->flags); | ||
1254 | if (test_bit(SOCK_PASSSEC, &old->flags)) | ||
1255 | set_bit(SOCK_PASSSEC, &new->flags); | ||
1256 | } | ||
1257 | |||
1249 | static int unix_accept(struct socket *sock, struct socket *newsock, int flags) | 1258 | static int unix_accept(struct socket *sock, struct socket *newsock, int flags) |
1250 | { | 1259 | { |
1251 | struct sock *sk = sock->sk; | 1260 | struct sock *sk = sock->sk; |
@@ -1280,6 +1289,7 @@ static int unix_accept(struct socket *sock, struct socket *newsock, int flags) | |||
1280 | /* attach accepted sock to socket */ | 1289 | /* attach accepted sock to socket */ |
1281 | unix_state_lock(tsk); | 1290 | unix_state_lock(tsk); |
1282 | newsock->state = SS_CONNECTED; | 1291 | newsock->state = SS_CONNECTED; |
1292 | unix_sock_inherit_flags(sock, newsock); | ||
1283 | sock_graft(tsk, newsock); | 1293 | sock_graft(tsk, newsock); |
1284 | unix_state_unlock(tsk); | 1294 | unix_state_unlock(tsk); |
1285 | return 0; | 1295 | return 0; |
diff --git a/net/unix/diag.c b/net/unix/diag.c index d591091603bf..86fa0f3b2caf 100644 --- a/net/unix/diag.c +++ b/net/unix/diag.c | |||
@@ -124,6 +124,7 @@ static int sk_diag_fill(struct sock *sk, struct sk_buff *skb, struct unix_diag_r | |||
124 | rep->udiag_family = AF_UNIX; | 124 | rep->udiag_family = AF_UNIX; |
125 | rep->udiag_type = sk->sk_type; | 125 | rep->udiag_type = sk->sk_type; |
126 | rep->udiag_state = sk->sk_state; | 126 | rep->udiag_state = sk->sk_state; |
127 | rep->pad = 0; | ||
127 | rep->udiag_ino = sk_ino; | 128 | rep->udiag_ino = sk_ino; |
128 | sock_diag_save_cookie(sk, rep->udiag_cookie); | 129 | sock_diag_save_cookie(sk, rep->udiag_cookie); |
129 | 130 | ||
diff --git a/net/wireless/core.c b/net/wireless/core.c index 67153964aad2..aff959e5a1b3 100644 --- a/net/wireless/core.c +++ b/net/wireless/core.c | |||
@@ -566,18 +566,13 @@ int wiphy_register(struct wiphy *wiphy) | |||
566 | /* check and set up bitrates */ | 566 | /* check and set up bitrates */ |
567 | ieee80211_set_bitrate_flags(wiphy); | 567 | ieee80211_set_bitrate_flags(wiphy); |
568 | 568 | ||
569 | 569 | rtnl_lock(); | |
570 | res = device_add(&rdev->wiphy.dev); | 570 | res = device_add(&rdev->wiphy.dev); |
571 | if (res) | ||
572 | return res; | ||
573 | |||
574 | res = rfkill_register(rdev->rfkill); | ||
575 | if (res) { | 571 | if (res) { |
576 | device_del(&rdev->wiphy.dev); | 572 | rtnl_unlock(); |
577 | return res; | 573 | return res; |
578 | } | 574 | } |
579 | 575 | ||
580 | rtnl_lock(); | ||
581 | /* set up regulatory info */ | 576 | /* set up regulatory info */ |
582 | wiphy_regulatory_register(wiphy); | 577 | wiphy_regulatory_register(wiphy); |
583 | 578 | ||
@@ -606,6 +601,15 @@ int wiphy_register(struct wiphy *wiphy) | |||
606 | 601 | ||
607 | rdev->wiphy.registered = true; | 602 | rdev->wiphy.registered = true; |
608 | rtnl_unlock(); | 603 | rtnl_unlock(); |
604 | |||
605 | res = rfkill_register(rdev->rfkill); | ||
606 | if (res) { | ||
607 | rfkill_destroy(rdev->rfkill); | ||
608 | rdev->rfkill = NULL; | ||
609 | wiphy_unregister(&rdev->wiphy); | ||
610 | return res; | ||
611 | } | ||
612 | |||
609 | return 0; | 613 | return 0; |
610 | } | 614 | } |
611 | EXPORT_SYMBOL(wiphy_register); | 615 | EXPORT_SYMBOL(wiphy_register); |
@@ -640,7 +644,8 @@ void wiphy_unregister(struct wiphy *wiphy) | |||
640 | rtnl_unlock(); | 644 | rtnl_unlock(); |
641 | __count == 0; })); | 645 | __count == 0; })); |
642 | 646 | ||
643 | rfkill_unregister(rdev->rfkill); | 647 | if (rdev->rfkill) |
648 | rfkill_unregister(rdev->rfkill); | ||
644 | 649 | ||
645 | rtnl_lock(); | 650 | rtnl_lock(); |
646 | rdev->wiphy.registered = false; | 651 | rdev->wiphy.registered = false; |
@@ -953,8 +958,6 @@ static int cfg80211_netdev_notifier_call(struct notifier_block *nb, | |||
953 | case NETDEV_PRE_UP: | 958 | case NETDEV_PRE_UP: |
954 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) | 959 | if (!(wdev->wiphy->interface_modes & BIT(wdev->iftype))) |
955 | return notifier_from_errno(-EOPNOTSUPP); | 960 | return notifier_from_errno(-EOPNOTSUPP); |
956 | if (rfkill_blocked(rdev->rfkill)) | ||
957 | return notifier_from_errno(-ERFKILL); | ||
958 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); | 961 | ret = cfg80211_can_add_interface(rdev, wdev->iftype); |
959 | if (ret) | 962 | if (ret) |
960 | return notifier_from_errno(ret); | 963 | return notifier_from_errno(ret); |
diff --git a/net/wireless/core.h b/net/wireless/core.h index 9ad43c619c54..3159e9c284c5 100644 --- a/net/wireless/core.h +++ b/net/wireless/core.h | |||
@@ -411,6 +411,9 @@ static inline int | |||
411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, | 411 | cfg80211_can_add_interface(struct cfg80211_registered_device *rdev, |
412 | enum nl80211_iftype iftype) | 412 | enum nl80211_iftype iftype) |
413 | { | 413 | { |
414 | if (rfkill_blocked(rdev->rfkill)) | ||
415 | return -ERFKILL; | ||
416 | |||
414 | return cfg80211_can_change_interface(rdev, NULL, iftype); | 417 | return cfg80211_can_change_interface(rdev, NULL, iftype); |
415 | } | 418 | } |
416 | 419 | ||
diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 39bff7d36768..403fe29c024d 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c | |||
@@ -263,6 +263,8 @@ int cfg80211_ibss_wext_join(struct cfg80211_registered_device *rdev, | |||
263 | if (chan->flags & IEEE80211_CHAN_DISABLED) | 263 | if (chan->flags & IEEE80211_CHAN_DISABLED) |
264 | continue; | 264 | continue; |
265 | wdev->wext.ibss.chandef.chan = chan; | 265 | wdev->wext.ibss.chandef.chan = chan; |
266 | wdev->wext.ibss.chandef.center_freq1 = | ||
267 | chan->center_freq; | ||
266 | break; | 268 | break; |
267 | } | 269 | } |
268 | 270 | ||
@@ -347,6 +349,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | |||
347 | if (chan) { | 349 | if (chan) { |
348 | wdev->wext.ibss.chandef.chan = chan; | 350 | wdev->wext.ibss.chandef.chan = chan; |
349 | wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; | 351 | wdev->wext.ibss.chandef.width = NL80211_CHAN_WIDTH_20_NOHT; |
352 | wdev->wext.ibss.chandef.center_freq1 = freq; | ||
350 | wdev->wext.ibss.channel_fixed = true; | 353 | wdev->wext.ibss.channel_fixed = true; |
351 | } else { | 354 | } else { |
352 | /* cfg80211_ibss_wext_join will pick one if needed */ | 355 | /* cfg80211_ibss_wext_join will pick one if needed */ |
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index af8d84a4a5b2..626dc3b5fd8d 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -2421,7 +2421,7 @@ static int nl80211_set_interface(struct sk_buff *skb, struct genl_info *info) | |||
2421 | change = true; | 2421 | change = true; |
2422 | } | 2422 | } |
2423 | 2423 | ||
2424 | if (flags && (*flags & NL80211_MNTR_FLAG_ACTIVE) && | 2424 | if (flags && (*flags & MONITOR_FLAG_ACTIVE) && |
2425 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) | 2425 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) |
2426 | return -EOPNOTSUPP; | 2426 | return -EOPNOTSUPP; |
2427 | 2427 | ||
@@ -2483,7 +2483,7 @@ static int nl80211_new_interface(struct sk_buff *skb, struct genl_info *info) | |||
2483 | info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, | 2483 | info->attrs[NL80211_ATTR_MNTR_FLAGS] : NULL, |
2484 | &flags); | 2484 | &flags); |
2485 | 2485 | ||
2486 | if (!err && (flags & NL80211_MNTR_FLAG_ACTIVE) && | 2486 | if (!err && (flags & MONITOR_FLAG_ACTIVE) && |
2487 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) | 2487 | !(rdev->wiphy.features & NL80211_FEATURE_ACTIVE_MONITOR)) |
2488 | return -EOPNOTSUPP; | 2488 | return -EOPNOTSUPP; |
2489 | 2489 | ||
diff --git a/net/wireless/radiotap.c b/net/wireless/radiotap.c index 7d604c06c3dc..a271c27fac77 100644 --- a/net/wireless/radiotap.c +++ b/net/wireless/radiotap.c | |||
@@ -97,6 +97,10 @@ int ieee80211_radiotap_iterator_init( | |||
97 | struct ieee80211_radiotap_header *radiotap_header, | 97 | struct ieee80211_radiotap_header *radiotap_header, |
98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) | 98 | int max_length, const struct ieee80211_radiotap_vendor_namespaces *vns) |
99 | { | 99 | { |
100 | /* check the radiotap header can actually be present */ | ||
101 | if (max_length < sizeof(struct ieee80211_radiotap_header)) | ||
102 | return -EINVAL; | ||
103 | |||
100 | /* Linux only supports version 0 radiotap format */ | 104 | /* Linux only supports version 0 radiotap format */ |
101 | if (radiotap_header->it_version) | 105 | if (radiotap_header->it_version) |
102 | return -EINVAL; | 106 | return -EINVAL; |
@@ -131,7 +135,8 @@ int ieee80211_radiotap_iterator_init( | |||
131 | */ | 135 | */ |
132 | 136 | ||
133 | if ((unsigned long)iterator->_arg - | 137 | if ((unsigned long)iterator->_arg - |
134 | (unsigned long)iterator->_rtheader > | 138 | (unsigned long)iterator->_rtheader + |
139 | sizeof(uint32_t) > | ||
135 | (unsigned long)iterator->_max_length) | 140 | (unsigned long)iterator->_max_length) |
136 | return -EINVAL; | 141 | return -EINVAL; |
137 | } | 142 | } |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index ed38d5d81f9e..76e1873811d4 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
@@ -334,7 +334,8 @@ static void xfrm_policy_kill(struct xfrm_policy *policy) | |||
334 | 334 | ||
335 | atomic_inc(&policy->genid); | 335 | atomic_inc(&policy->genid); |
336 | 336 | ||
337 | del_timer(&policy->polq.hold_timer); | 337 | if (del_timer(&policy->polq.hold_timer)) |
338 | xfrm_pol_put(policy); | ||
338 | xfrm_queue_purge(&policy->polq.hold_queue); | 339 | xfrm_queue_purge(&policy->polq.hold_queue); |
339 | 340 | ||
340 | if (del_timer(&policy->timer)) | 341 | if (del_timer(&policy->timer)) |
@@ -589,7 +590,8 @@ static void xfrm_policy_requeue(struct xfrm_policy *old, | |||
589 | 590 | ||
590 | spin_lock_bh(&pq->hold_queue.lock); | 591 | spin_lock_bh(&pq->hold_queue.lock); |
591 | skb_queue_splice_init(&pq->hold_queue, &list); | 592 | skb_queue_splice_init(&pq->hold_queue, &list); |
592 | del_timer(&pq->hold_timer); | 593 | if (del_timer(&pq->hold_timer)) |
594 | xfrm_pol_put(old); | ||
593 | spin_unlock_bh(&pq->hold_queue.lock); | 595 | spin_unlock_bh(&pq->hold_queue.lock); |
594 | 596 | ||
595 | if (skb_queue_empty(&list)) | 597 | if (skb_queue_empty(&list)) |
@@ -600,7 +602,8 @@ static void xfrm_policy_requeue(struct xfrm_policy *old, | |||
600 | spin_lock_bh(&pq->hold_queue.lock); | 602 | spin_lock_bh(&pq->hold_queue.lock); |
601 | skb_queue_splice(&list, &pq->hold_queue); | 603 | skb_queue_splice(&list, &pq->hold_queue); |
602 | pq->timeout = XFRM_QUEUE_TMO_MIN; | 604 | pq->timeout = XFRM_QUEUE_TMO_MIN; |
603 | mod_timer(&pq->hold_timer, jiffies); | 605 | if (!mod_timer(&pq->hold_timer, jiffies)) |
606 | xfrm_pol_hold(new); | ||
604 | spin_unlock_bh(&pq->hold_queue.lock); | 607 | spin_unlock_bh(&pq->hold_queue.lock); |
605 | } | 608 | } |
606 | 609 | ||
@@ -1769,6 +1772,10 @@ static void xfrm_policy_queue_process(unsigned long arg) | |||
1769 | 1772 | ||
1770 | spin_lock(&pq->hold_queue.lock); | 1773 | spin_lock(&pq->hold_queue.lock); |
1771 | skb = skb_peek(&pq->hold_queue); | 1774 | skb = skb_peek(&pq->hold_queue); |
1775 | if (!skb) { | ||
1776 | spin_unlock(&pq->hold_queue.lock); | ||
1777 | goto out; | ||
1778 | } | ||
1772 | dst = skb_dst(skb); | 1779 | dst = skb_dst(skb); |
1773 | sk = skb->sk; | 1780 | sk = skb->sk; |
1774 | xfrm_decode_session(skb, &fl, dst->ops->family); | 1781 | xfrm_decode_session(skb, &fl, dst->ops->family); |
@@ -1787,8 +1794,9 @@ static void xfrm_policy_queue_process(unsigned long arg) | |||
1787 | goto purge_queue; | 1794 | goto purge_queue; |
1788 | 1795 | ||
1789 | pq->timeout = pq->timeout << 1; | 1796 | pq->timeout = pq->timeout << 1; |
1790 | mod_timer(&pq->hold_timer, jiffies + pq->timeout); | 1797 | if (!mod_timer(&pq->hold_timer, jiffies + pq->timeout)) |
1791 | return; | 1798 | xfrm_pol_hold(pol); |
1799 | goto out; | ||
1792 | } | 1800 | } |
1793 | 1801 | ||
1794 | dst_release(dst); | 1802 | dst_release(dst); |
@@ -1819,11 +1827,14 @@ static void xfrm_policy_queue_process(unsigned long arg) | |||
1819 | err = dst_output(skb); | 1827 | err = dst_output(skb); |
1820 | } | 1828 | } |
1821 | 1829 | ||
1830 | out: | ||
1831 | xfrm_pol_put(pol); | ||
1822 | return; | 1832 | return; |
1823 | 1833 | ||
1824 | purge_queue: | 1834 | purge_queue: |
1825 | pq->timeout = 0; | 1835 | pq->timeout = 0; |
1826 | xfrm_queue_purge(&pq->hold_queue); | 1836 | xfrm_queue_purge(&pq->hold_queue); |
1837 | xfrm_pol_put(pol); | ||
1827 | } | 1838 | } |
1828 | 1839 | ||
1829 | static int xdst_queue_output(struct sk_buff *skb) | 1840 | static int xdst_queue_output(struct sk_buff *skb) |
@@ -1831,7 +1842,8 @@ static int xdst_queue_output(struct sk_buff *skb) | |||
1831 | unsigned long sched_next; | 1842 | unsigned long sched_next; |
1832 | struct dst_entry *dst = skb_dst(skb); | 1843 | struct dst_entry *dst = skb_dst(skb); |
1833 | struct xfrm_dst *xdst = (struct xfrm_dst *) dst; | 1844 | struct xfrm_dst *xdst = (struct xfrm_dst *) dst; |
1834 | struct xfrm_policy_queue *pq = &xdst->pols[0]->polq; | 1845 | struct xfrm_policy *pol = xdst->pols[0]; |
1846 | struct xfrm_policy_queue *pq = &pol->polq; | ||
1835 | 1847 | ||
1836 | if (pq->hold_queue.qlen > XFRM_MAX_QUEUE_LEN) { | 1848 | if (pq->hold_queue.qlen > XFRM_MAX_QUEUE_LEN) { |
1837 | kfree_skb(skb); | 1849 | kfree_skb(skb); |
@@ -1850,10 +1862,12 @@ static int xdst_queue_output(struct sk_buff *skb) | |||
1850 | if (del_timer(&pq->hold_timer)) { | 1862 | if (del_timer(&pq->hold_timer)) { |
1851 | if (time_before(pq->hold_timer.expires, sched_next)) | 1863 | if (time_before(pq->hold_timer.expires, sched_next)) |
1852 | sched_next = pq->hold_timer.expires; | 1864 | sched_next = pq->hold_timer.expires; |
1865 | xfrm_pol_put(pol); | ||
1853 | } | 1866 | } |
1854 | 1867 | ||
1855 | __skb_queue_tail(&pq->hold_queue, skb); | 1868 | __skb_queue_tail(&pq->hold_queue, skb); |
1856 | mod_timer(&pq->hold_timer, sched_next); | 1869 | if (!mod_timer(&pq->hold_timer, sched_next)) |
1870 | xfrm_pol_hold(pol); | ||
1857 | 1871 | ||
1858 | spin_unlock_bh(&pq->hold_queue.lock); | 1872 | spin_unlock_bh(&pq->hold_queue.lock); |
1859 | 1873 | ||
diff --git a/net/xfrm/xfrm_replay.c b/net/xfrm/xfrm_replay.c index 8dafe6d3c6e4..dab57daae408 100644 --- a/net/xfrm/xfrm_replay.c +++ b/net/xfrm/xfrm_replay.c | |||
@@ -61,9 +61,9 @@ static void xfrm_replay_notify(struct xfrm_state *x, int event) | |||
61 | 61 | ||
62 | switch (event) { | 62 | switch (event) { |
63 | case XFRM_REPLAY_UPDATE: | 63 | case XFRM_REPLAY_UPDATE: |
64 | if (x->replay_maxdiff && | 64 | if (!x->replay_maxdiff || |
65 | (x->replay.seq - x->preplay.seq < x->replay_maxdiff) && | 65 | ((x->replay.seq - x->preplay.seq < x->replay_maxdiff) && |
66 | (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff)) { | 66 | (x->replay.oseq - x->preplay.oseq < x->replay_maxdiff))) { |
67 | if (x->xflags & XFRM_TIME_DEFER) | 67 | if (x->xflags & XFRM_TIME_DEFER) |
68 | event = XFRM_REPLAY_TIMEOUT; | 68 | event = XFRM_REPLAY_TIMEOUT; |
69 | else | 69 | else |
@@ -129,8 +129,7 @@ static int xfrm_replay_check(struct xfrm_state *x, | |||
129 | return 0; | 129 | return 0; |
130 | 130 | ||
131 | diff = x->replay.seq - seq; | 131 | diff = x->replay.seq - seq; |
132 | if (diff >= min_t(unsigned int, x->props.replay_window, | 132 | if (diff >= x->props.replay_window) { |
133 | sizeof(x->replay.bitmap) * 8)) { | ||
134 | x->stats.replay_window++; | 133 | x->stats.replay_window++; |
135 | goto err; | 134 | goto err; |
136 | } | 135 | } |
@@ -302,9 +301,10 @@ static void xfrm_replay_notify_bmp(struct xfrm_state *x, int event) | |||
302 | 301 | ||
303 | switch (event) { | 302 | switch (event) { |
304 | case XFRM_REPLAY_UPDATE: | 303 | case XFRM_REPLAY_UPDATE: |
305 | if (x->replay_maxdiff && | 304 | if (!x->replay_maxdiff || |
306 | (replay_esn->seq - preplay_esn->seq < x->replay_maxdiff) && | 305 | ((replay_esn->seq - preplay_esn->seq < x->replay_maxdiff) && |
307 | (replay_esn->oseq - preplay_esn->oseq < x->replay_maxdiff)) { | 306 | (replay_esn->oseq - preplay_esn->oseq |
307 | < x->replay_maxdiff))) { | ||
308 | if (x->xflags & XFRM_TIME_DEFER) | 308 | if (x->xflags & XFRM_TIME_DEFER) |
309 | event = XFRM_REPLAY_TIMEOUT; | 309 | event = XFRM_REPLAY_TIMEOUT; |
310 | else | 310 | else |
@@ -353,28 +353,30 @@ static void xfrm_replay_notify_esn(struct xfrm_state *x, int event) | |||
353 | 353 | ||
354 | switch (event) { | 354 | switch (event) { |
355 | case XFRM_REPLAY_UPDATE: | 355 | case XFRM_REPLAY_UPDATE: |
356 | if (!x->replay_maxdiff) | 356 | if (x->replay_maxdiff) { |
357 | break; | 357 | if (replay_esn->seq_hi == preplay_esn->seq_hi) |
358 | 358 | seq_diff = replay_esn->seq - preplay_esn->seq; | |
359 | if (replay_esn->seq_hi == preplay_esn->seq_hi) | 359 | else |
360 | seq_diff = replay_esn->seq - preplay_esn->seq; | 360 | seq_diff = ~preplay_esn->seq + replay_esn->seq |
361 | else | 361 | + 1; |
362 | seq_diff = ~preplay_esn->seq + replay_esn->seq + 1; | ||
363 | |||
364 | if (replay_esn->oseq_hi == preplay_esn->oseq_hi) | ||
365 | oseq_diff = replay_esn->oseq - preplay_esn->oseq; | ||
366 | else | ||
367 | oseq_diff = ~preplay_esn->oseq + replay_esn->oseq + 1; | ||
368 | |||
369 | if (seq_diff < x->replay_maxdiff && | ||
370 | oseq_diff < x->replay_maxdiff) { | ||
371 | 362 | ||
372 | if (x->xflags & XFRM_TIME_DEFER) | 363 | if (replay_esn->oseq_hi == preplay_esn->oseq_hi) |
373 | event = XFRM_REPLAY_TIMEOUT; | 364 | oseq_diff = replay_esn->oseq |
365 | - preplay_esn->oseq; | ||
374 | else | 366 | else |
375 | return; | 367 | oseq_diff = ~preplay_esn->oseq |
368 | + replay_esn->oseq + 1; | ||
369 | |||
370 | if (seq_diff >= x->replay_maxdiff || | ||
371 | oseq_diff >= x->replay_maxdiff) | ||
372 | break; | ||
376 | } | 373 | } |
377 | 374 | ||
375 | if (x->xflags & XFRM_TIME_DEFER) | ||
376 | event = XFRM_REPLAY_TIMEOUT; | ||
377 | else | ||
378 | return; | ||
379 | |||
378 | break; | 380 | break; |
379 | 381 | ||
380 | case XFRM_REPLAY_TIMEOUT: | 382 | case XFRM_REPLAY_TIMEOUT: |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index 3f565e495ac6..f964d4c00ffb 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c | |||
@@ -446,7 +446,8 @@ static void copy_from_user_state(struct xfrm_state *x, struct xfrm_usersa_info * | |||
446 | memcpy(&x->sel, &p->sel, sizeof(x->sel)); | 446 | memcpy(&x->sel, &p->sel, sizeof(x->sel)); |
447 | memcpy(&x->lft, &p->lft, sizeof(x->lft)); | 447 | memcpy(&x->lft, &p->lft, sizeof(x->lft)); |
448 | x->props.mode = p->mode; | 448 | x->props.mode = p->mode; |
449 | x->props.replay_window = p->replay_window; | 449 | x->props.replay_window = min_t(unsigned int, p->replay_window, |
450 | sizeof(x->replay.bitmap) * 8); | ||
450 | x->props.reqid = p->reqid; | 451 | x->props.reqid = p->reqid; |
451 | x->props.family = p->family; | 452 | x->props.family = p->family; |
452 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); | 453 | memcpy(&x->props.saddr, &p->saddr, sizeof(x->props.saddr)); |
@@ -1856,7 +1857,7 @@ static int xfrm_new_ae(struct sk_buff *skb, struct nlmsghdr *nlh, | |||
1856 | if (x->km.state != XFRM_STATE_VALID) | 1857 | if (x->km.state != XFRM_STATE_VALID) |
1857 | goto out; | 1858 | goto out; |
1858 | 1859 | ||
1859 | err = xfrm_replay_verify_len(x->replay_esn, rp); | 1860 | err = xfrm_replay_verify_len(x->replay_esn, re); |
1860 | if (err) | 1861 | if (err) |
1861 | goto out; | 1862 | goto out; |
1862 | 1863 | ||
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index 21c35ed778cc..090d499bb7eb 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
@@ -257,7 +257,7 @@ static int ak4642_dai_startup(struct snd_pcm_substream *substream, | |||
257 | * This operation came from example code of | 257 | * This operation came from example code of |
258 | * "ASAHI KASEI AK4642" (japanese) manual p94. | 258 | * "ASAHI KASEI AK4642" (japanese) manual p94. |
259 | */ | 259 | */ |
260 | snd_soc_write(codec, SG_SL1, PMMP | MGAIN0); | 260 | snd_soc_update_bits(codec, SG_SL1, PMMP | MGAIN0, PMMP | MGAIN0); |
261 | snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3)); | 261 | snd_soc_write(codec, TIMER, ZTM(0x3) | WTM(0x3)); |
262 | snd_soc_write(codec, ALC_CTL1, ALC | LMTH0); | 262 | snd_soc_write(codec, ALC_CTL1, ALC | LMTH0); |
263 | snd_soc_update_bits(codec, PW_MGMT1, PMADL, PMADL); | 263 | snd_soc_update_bits(codec, PW_MGMT1, PMADL, PMADL); |
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 9b393e7dca6f..63df031fc9c7 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c | |||
@@ -187,7 +187,7 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, | |||
187 | return -1; | 187 | return -1; |
188 | } | 188 | } |
189 | 189 | ||
190 | event->header.type = PERF_RECORD_MMAP2; | 190 | event->header.type = PERF_RECORD_MMAP; |
191 | /* | 191 | /* |
192 | * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c | 192 | * Just like the kernel, see __perf_event_mmap in kernel/perf_event.c |
193 | */ | 193 | */ |
@@ -198,7 +198,6 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, | |||
198 | char prot[5]; | 198 | char prot[5]; |
199 | char execname[PATH_MAX]; | 199 | char execname[PATH_MAX]; |
200 | char anonstr[] = "//anon"; | 200 | char anonstr[] = "//anon"; |
201 | unsigned int ino; | ||
202 | size_t size; | 201 | size_t size; |
203 | ssize_t n; | 202 | ssize_t n; |
204 | 203 | ||
@@ -209,13 +208,10 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, | |||
209 | strcpy(execname, ""); | 208 | strcpy(execname, ""); |
210 | 209 | ||
211 | /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ | 210 | /* 00400000-0040c000 r-xp 00000000 fd:01 41038 /bin/cat */ |
212 | n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %x:%x %u %s\n", | 211 | n = sscanf(bf, "%"PRIx64"-%"PRIx64" %s %"PRIx64" %*x:%*x %*u %s\n", |
213 | &event->mmap2.start, &event->mmap2.len, prot, | 212 | &event->mmap.start, &event->mmap.len, prot, |
214 | &event->mmap2.pgoff, &event->mmap2.maj, | 213 | &event->mmap.pgoff, |
215 | &event->mmap2.min, | 214 | execname); |
216 | &ino, execname); | ||
217 | |||
218 | event->mmap2.ino = (u64)ino; | ||
219 | 215 | ||
220 | if (n != 8) | 216 | if (n != 8) |
221 | continue; | 217 | continue; |
@@ -227,15 +223,15 @@ static int perf_event__synthesize_mmap_events(struct perf_tool *tool, | |||
227 | strcpy(execname, anonstr); | 223 | strcpy(execname, anonstr); |
228 | 224 | ||
229 | size = strlen(execname) + 1; | 225 | size = strlen(execname) + 1; |
230 | memcpy(event->mmap2.filename, execname, size); | 226 | memcpy(event->mmap.filename, execname, size); |
231 | size = PERF_ALIGN(size, sizeof(u64)); | 227 | size = PERF_ALIGN(size, sizeof(u64)); |
232 | event->mmap2.len -= event->mmap.start; | 228 | event->mmap.len -= event->mmap.start; |
233 | event->mmap2.header.size = (sizeof(event->mmap2) - | 229 | event->mmap.header.size = (sizeof(event->mmap) - |
234 | (sizeof(event->mmap2.filename) - size)); | 230 | (sizeof(event->mmap.filename) - size)); |
235 | memset(event->mmap2.filename + size, 0, machine->id_hdr_size); | 231 | memset(event->mmap.filename + size, 0, machine->id_hdr_size); |
236 | event->mmap2.header.size += machine->id_hdr_size; | 232 | event->mmap.header.size += machine->id_hdr_size; |
237 | event->mmap2.pid = tgid; | 233 | event->mmap.pid = tgid; |
238 | event->mmap2.tid = pid; | 234 | event->mmap.tid = pid; |
239 | 235 | ||
240 | if (process(tool, event, &synth_sample, machine) != 0) { | 236 | if (process(tool, event, &synth_sample, machine) != 0) { |
241 | rc = -1; | 237 | rc = -1; |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index 0ce9febf1ba0..9f1ef9bee2d0 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -678,7 +678,6 @@ void perf_evsel__config(struct perf_evsel *evsel, | |||
678 | attr->sample_type |= PERF_SAMPLE_WEIGHT; | 678 | attr->sample_type |= PERF_SAMPLE_WEIGHT; |
679 | 679 | ||
680 | attr->mmap = track; | 680 | attr->mmap = track; |
681 | attr->mmap2 = track && !perf_missing_features.mmap2; | ||
682 | attr->comm = track; | 681 | attr->comm = track; |
683 | 682 | ||
684 | /* | 683 | /* |
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index c09e0a9fdf4c..f0692737ebf1 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -1357,10 +1357,10 @@ int debuginfo__find_probe_point(struct debuginfo *self, unsigned long addr, | |||
1357 | goto post; | 1357 | goto post; |
1358 | } | 1358 | } |
1359 | 1359 | ||
1360 | fname = dwarf_decl_file(&spdie); | ||
1360 | if (addr == (unsigned long)baseaddr) { | 1361 | if (addr == (unsigned long)baseaddr) { |
1361 | /* Function entry - Relative line number is 0 */ | 1362 | /* Function entry - Relative line number is 0 */ |
1362 | lineno = baseline; | 1363 | lineno = baseline; |
1363 | fname = dwarf_decl_file(&spdie); | ||
1364 | goto post; | 1364 | goto post; |
1365 | } | 1365 | } |
1366 | 1366 | ||
diff --git a/tools/perf/util/scripting-engines/trace-event-perl.c b/tools/perf/util/scripting-engines/trace-event-perl.c index a85e4ae5f3ac..c0c9795c4f02 100644 --- a/tools/perf/util/scripting-engines/trace-event-perl.c +++ b/tools/perf/util/scripting-engines/trace-event-perl.c | |||
@@ -282,7 +282,7 @@ static void perl_process_tracepoint(union perf_event *perf_event __maybe_unused, | |||
282 | 282 | ||
283 | event = find_cache_event(evsel); | 283 | event = find_cache_event(evsel); |
284 | if (!event) | 284 | if (!event) |
285 | die("ug! no event found for type %" PRIu64, evsel->attr.config); | 285 | die("ug! no event found for type %" PRIu64, (u64)evsel->attr.config); |
286 | 286 | ||
287 | pid = raw_field_value(event, "common_pid", data); | 287 | pid = raw_field_value(event, "common_pid", data); |
288 | 288 | ||