diff options
169 files changed, 1542 insertions, 904 deletions
diff --git a/Documentation/devicetree/bindings/arm/arm-boards b/Documentation/devicetree/bindings/arm/arm-boards index 556c8665fdbf..b78564b2b201 100644 --- a/Documentation/devicetree/bindings/arm/arm-boards +++ b/Documentation/devicetree/bindings/arm/arm-boards | |||
@@ -23,7 +23,7 @@ Required nodes: | |||
23 | range of 0x200 bytes. | 23 | range of 0x200 bytes. |
24 | 24 | ||
25 | - syscon: the root node of the Integrator platforms must have a | 25 | - syscon: the root node of the Integrator platforms must have a |
26 | system controller node pointong to the control registers, | 26 | system controller node pointing to the control registers, |
27 | with the compatible string | 27 | with the compatible string |
28 | "arm,integrator-ap-syscon" | 28 | "arm,integrator-ap-syscon" |
29 | "arm,integrator-cp-syscon" | 29 | "arm,integrator-cp-syscon" |
diff --git a/Documentation/devicetree/bindings/arm/fw-cfg.txt b/Documentation/devicetree/bindings/arm/fw-cfg.txt new file mode 100644 index 000000000000..953fb640d9c4 --- /dev/null +++ b/Documentation/devicetree/bindings/arm/fw-cfg.txt | |||
@@ -0,0 +1,72 @@ | |||
1 | * QEMU Firmware Configuration bindings for ARM | ||
2 | |||
3 | QEMU's arm-softmmu and aarch64-softmmu emulation / virtualization targets | ||
4 | provide the following Firmware Configuration interface on the "virt" machine | ||
5 | type: | ||
6 | |||
7 | - A write-only, 16-bit wide selector (or control) register, | ||
8 | - a read-write, 64-bit wide data register. | ||
9 | |||
10 | QEMU exposes the control and data register to ARM guests as memory mapped | ||
11 | registers; their location is communicated to the guest's UEFI firmware in the | ||
12 | DTB that QEMU places at the bottom of the guest's DRAM. | ||
13 | |||
14 | The guest writes a selector value (a key) to the selector register, and then | ||
15 | can read the corresponding data (produced by QEMU) via the data register. If | ||
16 | the selected entry is writable, the guest can rewrite it through the data | ||
17 | register. | ||
18 | |||
19 | The selector register takes keys in big endian byte order. | ||
20 | |||
21 | The data register allows accesses with 8, 16, 32 and 64-bit width (only at | ||
22 | offset 0 of the register). Accesses larger than a byte are interpreted as | ||
23 | arrays, bundled together only for better performance. The bytes constituting | ||
24 | such a word, in increasing address order, correspond to the bytes that would | ||
25 | have been transferred by byte-wide accesses in chronological order. | ||
26 | |||
27 | The interface allows guest firmware to download various parameters and blobs | ||
28 | that affect how the firmware works and what tables it installs for the guest | ||
29 | OS. For example, boot order of devices, ACPI tables, SMBIOS tables, kernel and | ||
30 | initrd images for direct kernel booting, virtual machine UUID, SMP information, | ||
31 | virtual NUMA topology, and so on. | ||
32 | |||
33 | The authoritative registry of the valid selector values and their meanings is | ||
34 | the QEMU source code; the structure of the data blobs corresponding to the | ||
35 | individual key values is also defined in the QEMU source code. | ||
36 | |||
37 | The presence of the registers can be verified by selecting the "signature" blob | ||
38 | with key 0x0000, and reading four bytes from the data register. The returned | ||
39 | signature is "QEMU". | ||
40 | |||
41 | The outermost protocol (involving the write / read sequences of the control and | ||
42 | data registers) is expected to be versioned, and/or described by feature bits. | ||
43 | The interface revision / feature bitmap can be retrieved with key 0x0001. The | ||
44 | blob to be read from the data register has size 4, and it is to be interpreted | ||
45 | as a uint32_t value in little endian byte order. The current value | ||
46 | (corresponding to the above outer protocol) is zero. | ||
47 | |||
48 | The guest kernel is not expected to use these registers (although it is | ||
49 | certainly allowed to); the device tree bindings are documented here because | ||
50 | this is where device tree bindings reside in general. | ||
51 | |||
52 | Required properties: | ||
53 | |||
54 | - compatible: "qemu,fw-cfg-mmio". | ||
55 | |||
56 | - reg: the MMIO region used by the device. | ||
57 | * Bytes 0x0 to 0x7 cover the data register. | ||
58 | * Bytes 0x8 to 0x9 cover the selector register. | ||
59 | * Further registers may be appended to the region in case of future interface | ||
60 | revisions / feature bits. | ||
61 | |||
62 | Example: | ||
63 | |||
64 | / { | ||
65 | #size-cells = <0x2>; | ||
66 | #address-cells = <0x2>; | ||
67 | |||
68 | fw-cfg@9020000 { | ||
69 | compatible = "qemu,fw-cfg-mmio"; | ||
70 | reg = <0x0 0x9020000 0x0 0xa>; | ||
71 | }; | ||
72 | }; | ||
diff --git a/Documentation/devicetree/bindings/graph.txt b/Documentation/devicetree/bindings/graph.txt index 1a69c078adf2..fcb1c6a4787b 100644 --- a/Documentation/devicetree/bindings/graph.txt +++ b/Documentation/devicetree/bindings/graph.txt | |||
@@ -19,7 +19,7 @@ type of the connections, they just map their existence. Specific properties | |||
19 | may be described by specialized bindings depending on the type of connection. | 19 | may be described by specialized bindings depending on the type of connection. |
20 | 20 | ||
21 | To see how this binding applies to video pipelines, for example, see | 21 | To see how this binding applies to video pipelines, for example, see |
22 | Documentation/device-tree/bindings/media/video-interfaces.txt. | 22 | Documentation/devicetree/bindings/media/video-interfaces.txt. |
23 | Here the ports describe data interfaces, and the links between them are | 23 | Here the ports describe data interfaces, and the links between them are |
24 | the connecting data buses. A single port with multiple connections can | 24 | the connecting data buses. A single port with multiple connections can |
25 | correspond to multiple devices being connected to the same physical bus. | 25 | correspond to multiple devices being connected to the same physical bus. |
diff --git a/Documentation/devicetree/bindings/net/davinci_emac.txt b/Documentation/devicetree/bindings/net/davinci_emac.txt index 032808843f90..24c5cdaba8d2 100644 --- a/Documentation/devicetree/bindings/net/davinci_emac.txt +++ b/Documentation/devicetree/bindings/net/davinci_emac.txt | |||
@@ -4,7 +4,8 @@ This file provides information, what the device node | |||
4 | for the davinci_emac interface contains. | 4 | for the davinci_emac interface contains. |
5 | 5 | ||
6 | Required properties: | 6 | Required properties: |
7 | - compatible: "ti,davinci-dm6467-emac" or "ti,am3517-emac" | 7 | - compatible: "ti,davinci-dm6467-emac", "ti,am3517-emac" or |
8 | "ti,dm816-emac" | ||
8 | - reg: Offset and length of the register set for the device | 9 | - reg: Offset and length of the register set for the device |
9 | - ti,davinci-ctrl-reg-offset: offset to control register | 10 | - ti,davinci-ctrl-reg-offset: offset to control register |
10 | - ti,davinci-ctrl-mod-reg-offset: offset to control module register | 11 | - ti,davinci-ctrl-mod-reg-offset: offset to control module register |
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt index b1df0ad1306c..d443279c95dc 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.txt +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt | |||
@@ -9,7 +9,6 @@ ad Avionic Design GmbH | |||
9 | adapteva Adapteva, Inc. | 9 | adapteva Adapteva, Inc. |
10 | adi Analog Devices, Inc. | 10 | adi Analog Devices, Inc. |
11 | aeroflexgaisler Aeroflex Gaisler AB | 11 | aeroflexgaisler Aeroflex Gaisler AB |
12 | ak Asahi Kasei Corp. | ||
13 | allwinner Allwinner Technology Co., Ltd. | 12 | allwinner Allwinner Technology Co., Ltd. |
14 | altr Altera Corp. | 13 | altr Altera Corp. |
15 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) | 14 | amcc Applied Micro Circuits Corporation (APM, formally AMCC) |
@@ -20,6 +19,7 @@ amstaos AMS-Taos Inc. | |||
20 | apm Applied Micro Circuits Corporation (APM) | 19 | apm Applied Micro Circuits Corporation (APM) |
21 | arm ARM Ltd. | 20 | arm ARM Ltd. |
22 | armadeus ARMadeus Systems SARL | 21 | armadeus ARMadeus Systems SARL |
22 | asahi-kasei Asahi Kasei Corp. | ||
23 | atmel Atmel Corporation | 23 | atmel Atmel Corporation |
24 | auo AU Optronics Corporation | 24 | auo AU Optronics Corporation |
25 | avago Avago Technologies | 25 | avago Avago Technologies |
@@ -127,6 +127,7 @@ pixcir PIXCIR MICROELECTRONICS Co., Ltd | |||
127 | powervr PowerVR (deprecated, use img) | 127 | powervr PowerVR (deprecated, use img) |
128 | qca Qualcomm Atheros, Inc. | 128 | qca Qualcomm Atheros, Inc. |
129 | qcom Qualcomm Technologies, Inc | 129 | qcom Qualcomm Technologies, Inc |
130 | qemu QEMU, a generic and open source machine emulator and virtualizer | ||
130 | qnap QNAP Systems, Inc. | 131 | qnap QNAP Systems, Inc. |
131 | radxa Radxa | 132 | radxa Radxa |
132 | raidsonic RaidSonic Technology GmbH | 133 | raidsonic RaidSonic Technology GmbH |
@@ -168,6 +169,7 @@ usi Universal Scientific Industrial Co., Ltd. | |||
168 | v3 V3 Semiconductor | 169 | v3 V3 Semiconductor |
169 | variscite Variscite Ltd. | 170 | variscite Variscite Ltd. |
170 | via VIA Technologies, Inc. | 171 | via VIA Technologies, Inc. |
172 | virtio Virtual I/O Device Specification, developed by the OASIS consortium | ||
171 | voipac Voipac Technologies s.r.o. | 173 | voipac Voipac Technologies s.r.o. |
172 | winbond Winbond Electronics corp. | 174 | winbond Winbond Electronics corp. |
173 | wlf Wolfson Microelectronics | 175 | wlf Wolfson Microelectronics |
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4df73da11adc..176d4fe4f076 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1277,6 +1277,7 @@ bytes respectively. Such letter suffixes can also be entirely omitted. | |||
1277 | i8042.notimeout [HW] Ignore timeout condition signalled by controller | 1277 | i8042.notimeout [HW] Ignore timeout condition signalled by controller |
1278 | i8042.reset [HW] Reset the controller during init and cleanup | 1278 | i8042.reset [HW] Reset the controller during init and cleanup |
1279 | i8042.unlock [HW] Unlock (ignore) the keylock | 1279 | i8042.unlock [HW] Unlock (ignore) the keylock |
1280 | i8042.kbdreset [HW] Reset device connected to KBD port | ||
1280 | 1281 | ||
1281 | i810= [HW,DRM] | 1282 | i810= [HW,DRM] |
1282 | 1283 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 2fa385321245..6b7a694bf454 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -696,7 +696,7 @@ L: alsa-devel@alsa-project.org (moderated for non-subscribers) | |||
696 | W: http://blackfin.uclinux.org/ | 696 | W: http://blackfin.uclinux.org/ |
697 | S: Supported | 697 | S: Supported |
698 | F: sound/soc/blackfin/* | 698 | F: sound/soc/blackfin/* |
699 | 699 | ||
700 | ANALOG DEVICES INC IIO DRIVERS | 700 | ANALOG DEVICES INC IIO DRIVERS |
701 | M: Lars-Peter Clausen <lars@metafoo.de> | 701 | M: Lars-Peter Clausen <lars@metafoo.de> |
702 | M: Michael Hennerich <Michael.Hennerich@analog.com> | 702 | M: Michael Hennerich <Michael.Hennerich@analog.com> |
@@ -754,13 +754,6 @@ L: linux-media@vger.kernel.org | |||
754 | S: Maintained | 754 | S: Maintained |
755 | F: drivers/media/i2c/aptina-pll.* | 755 | F: drivers/media/i2c/aptina-pll.* |
756 | 756 | ||
757 | ARASAN COMPACT FLASH PATA CONTROLLER | ||
758 | M: Viresh Kumar <viresh.linux@gmail.com> | ||
759 | L: linux-ide@vger.kernel.org | ||
760 | S: Maintained | ||
761 | F: include/linux/pata_arasan_cf_data.h | ||
762 | F: drivers/ata/pata_arasan_cf.c | ||
763 | |||
764 | ARC FRAMEBUFFER DRIVER | 757 | ARC FRAMEBUFFER DRIVER |
765 | M: Jaya Kumar <jayalk@intworks.biz> | 758 | M: Jaya Kumar <jayalk@intworks.biz> |
766 | S: Maintained | 759 | S: Maintained |
@@ -2346,7 +2339,8 @@ CAN NETWORK LAYER | |||
2346 | M: Oliver Hartkopp <socketcan@hartkopp.net> | 2339 | M: Oliver Hartkopp <socketcan@hartkopp.net> |
2347 | L: linux-can@vger.kernel.org | 2340 | L: linux-can@vger.kernel.org |
2348 | W: http://gitorious.org/linux-can | 2341 | W: http://gitorious.org/linux-can |
2349 | T: git git://gitorious.org/linux-can/linux-can-next.git | 2342 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git |
2343 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git | ||
2350 | S: Maintained | 2344 | S: Maintained |
2351 | F: Documentation/networking/can.txt | 2345 | F: Documentation/networking/can.txt |
2352 | F: net/can/ | 2346 | F: net/can/ |
@@ -2361,7 +2355,8 @@ M: Wolfgang Grandegger <wg@grandegger.com> | |||
2361 | M: Marc Kleine-Budde <mkl@pengutronix.de> | 2355 | M: Marc Kleine-Budde <mkl@pengutronix.de> |
2362 | L: linux-can@vger.kernel.org | 2356 | L: linux-can@vger.kernel.org |
2363 | W: http://gitorious.org/linux-can | 2357 | W: http://gitorious.org/linux-can |
2364 | T: git git://gitorious.org/linux-can/linux-can-next.git | 2358 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git |
2359 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git | ||
2365 | S: Maintained | 2360 | S: Maintained |
2366 | F: drivers/net/can/ | 2361 | F: drivers/net/can/ |
2367 | F: include/linux/can/dev.h | 2362 | F: include/linux/can/dev.h |
@@ -4930,7 +4925,6 @@ F: include/uapi/linux/inotify.h | |||
4930 | 4925 | ||
4931 | INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS | 4926 | INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS |
4932 | M: Dmitry Torokhov <dmitry.torokhov@gmail.com> | 4927 | M: Dmitry Torokhov <dmitry.torokhov@gmail.com> |
4933 | M: Dmitry Torokhov <dtor@mail.ru> | ||
4934 | L: linux-input@vger.kernel.org | 4928 | L: linux-input@vger.kernel.org |
4935 | Q: http://patchwork.kernel.org/project/linux-input/list/ | 4929 | Q: http://patchwork.kernel.org/project/linux-input/list/ |
4936 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git | 4930 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git |
@@ -5703,6 +5697,49 @@ F: drivers/lguest/ | |||
5703 | F: include/linux/lguest*.h | 5697 | F: include/linux/lguest*.h |
5704 | F: tools/lguest/ | 5698 | F: tools/lguest/ |
5705 | 5699 | ||
5700 | LIBATA SUBSYSTEM (Serial and Parallel ATA drivers) | ||
5701 | M: Tejun Heo <tj@kernel.org> | ||
5702 | L: linux-ide@vger.kernel.org | ||
5703 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
5704 | S: Maintained | ||
5705 | F: drivers/ata/ | ||
5706 | F: include/linux/ata.h | ||
5707 | F: include/linux/libata.h | ||
5708 | |||
5709 | LIBATA PATA ARASAN COMPACT FLASH CONTROLLER | ||
5710 | M: Viresh Kumar <viresh.linux@gmail.com> | ||
5711 | L: linux-ide@vger.kernel.org | ||
5712 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
5713 | S: Maintained | ||
5714 | F: include/linux/pata_arasan_cf_data.h | ||
5715 | F: drivers/ata/pata_arasan_cf.c | ||
5716 | |||
5717 | LIBATA PATA DRIVERS | ||
5718 | M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> | ||
5719 | M: Tejun Heo <tj@kernel.org> | ||
5720 | L: linux-ide@vger.kernel.org | ||
5721 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
5722 | S: Maintained | ||
5723 | F: drivers/ata/pata_*.c | ||
5724 | F: drivers/ata/ata_generic.c | ||
5725 | |||
5726 | LIBATA SATA AHCI PLATFORM devices support | ||
5727 | M: Hans de Goede <hdegoede@redhat.com> | ||
5728 | M: Tejun Heo <tj@kernel.org> | ||
5729 | L: linux-ide@vger.kernel.org | ||
5730 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
5731 | S: Maintained | ||
5732 | F: drivers/ata/ahci_platform.c | ||
5733 | F: drivers/ata/libahci_platform.c | ||
5734 | F: include/linux/ahci_platform.h | ||
5735 | |||
5736 | LIBATA SATA PROMISE TX2/TX4 CONTROLLER DRIVER | ||
5737 | M: Mikael Pettersson <mikpelinux@gmail.com> | ||
5738 | L: linux-ide@vger.kernel.org | ||
5739 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
5740 | S: Maintained | ||
5741 | F: drivers/ata/sata_promise.* | ||
5742 | |||
5706 | LIBLOCKDEP | 5743 | LIBLOCKDEP |
5707 | M: Sasha Levin <sasha.levin@oracle.com> | 5744 | M: Sasha Levin <sasha.levin@oracle.com> |
5708 | S: Maintained | 5745 | S: Maintained |
@@ -6987,14 +7024,12 @@ OPEN FIRMWARE AND FLATTENED DEVICE TREE | |||
6987 | M: Grant Likely <grant.likely@linaro.org> | 7024 | M: Grant Likely <grant.likely@linaro.org> |
6988 | M: Rob Herring <robh+dt@kernel.org> | 7025 | M: Rob Herring <robh+dt@kernel.org> |
6989 | L: devicetree@vger.kernel.org | 7026 | L: devicetree@vger.kernel.org |
6990 | W: http://fdt.secretlab.ca | 7027 | W: http://www.devicetree.org/ |
6991 | T: git git://git.secretlab.ca/git/linux-2.6.git | 7028 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git |
6992 | S: Maintained | 7029 | S: Maintained |
6993 | F: drivers/of/ | 7030 | F: drivers/of/ |
6994 | F: include/linux/of*.h | 7031 | F: include/linux/of*.h |
6995 | F: scripts/dtc/ | 7032 | F: scripts/dtc/ |
6996 | K: of_get_property | ||
6997 | K: of_match_table | ||
6998 | 7033 | ||
6999 | OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS | 7034 | OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS |
7000 | M: Rob Herring <robh+dt@kernel.org> | 7035 | M: Rob Herring <robh+dt@kernel.org> |
@@ -7239,7 +7274,7 @@ S: Maintained | |||
7239 | F: drivers/pci/host/*layerscape* | 7274 | F: drivers/pci/host/*layerscape* |
7240 | 7275 | ||
7241 | PCI DRIVER FOR IMX6 | 7276 | PCI DRIVER FOR IMX6 |
7242 | M: Richard Zhu <r65037@freescale.com> | 7277 | M: Richard Zhu <Richard.Zhu@freescale.com> |
7243 | M: Lucas Stach <l.stach@pengutronix.de> | 7278 | M: Lucas Stach <l.stach@pengutronix.de> |
7244 | L: linux-pci@vger.kernel.org | 7279 | L: linux-pci@vger.kernel.org |
7245 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 7280 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
@@ -7409,6 +7444,7 @@ F: drivers/crypto/picoxcell* | |||
7409 | PIN CONTROL SUBSYSTEM | 7444 | PIN CONTROL SUBSYSTEM |
7410 | M: Linus Walleij <linus.walleij@linaro.org> | 7445 | M: Linus Walleij <linus.walleij@linaro.org> |
7411 | L: linux-gpio@vger.kernel.org | 7446 | L: linux-gpio@vger.kernel.org |
7447 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git | ||
7412 | S: Maintained | 7448 | S: Maintained |
7413 | F: drivers/pinctrl/ | 7449 | F: drivers/pinctrl/ |
7414 | F: include/linux/pinctrl/ | 7450 | F: include/linux/pinctrl/ |
@@ -7576,12 +7612,6 @@ W: http://wireless.kernel.org/en/users/Drivers/p54 | |||
7576 | S: Obsolete | 7612 | S: Obsolete |
7577 | F: drivers/net/wireless/prism54/ | 7613 | F: drivers/net/wireless/prism54/ |
7578 | 7614 | ||
7579 | PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER | ||
7580 | M: Mikael Pettersson <mikpelinux@gmail.com> | ||
7581 | L: linux-ide@vger.kernel.org | ||
7582 | S: Maintained | ||
7583 | F: drivers/ata/sata_promise.* | ||
7584 | |||
7585 | PS3 NETWORK SUPPORT | 7615 | PS3 NETWORK SUPPORT |
7586 | M: Geoff Levand <geoff@infradead.org> | 7616 | M: Geoff Levand <geoff@infradead.org> |
7587 | L: netdev@vger.kernel.org | 7617 | L: netdev@vger.kernel.org |
@@ -8555,25 +8585,6 @@ S: Maintained | |||
8555 | F: drivers/misc/phantom.c | 8585 | F: drivers/misc/phantom.c |
8556 | F: include/uapi/linux/phantom.h | 8586 | F: include/uapi/linux/phantom.h |
8557 | 8587 | ||
8558 | SERIAL ATA (SATA) SUBSYSTEM | ||
8559 | M: Tejun Heo <tj@kernel.org> | ||
8560 | L: linux-ide@vger.kernel.org | ||
8561 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
8562 | S: Supported | ||
8563 | F: drivers/ata/ | ||
8564 | F: include/linux/ata.h | ||
8565 | F: include/linux/libata.h | ||
8566 | |||
8567 | SERIAL ATA AHCI PLATFORM devices support | ||
8568 | M: Hans de Goede <hdegoede@redhat.com> | ||
8569 | M: Tejun Heo <tj@kernel.org> | ||
8570 | L: linux-ide@vger.kernel.org | ||
8571 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git | ||
8572 | S: Supported | ||
8573 | F: drivers/ata/ahci_platform.c | ||
8574 | F: drivers/ata/libahci_platform.c | ||
8575 | F: include/linux/ahci_platform.h | ||
8576 | |||
8577 | SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER | 8588 | SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER |
8578 | M: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> | 8589 | M: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> |
8579 | L: linux-scsi@vger.kernel.org | 8590 | L: linux-scsi@vger.kernel.org |
diff --git a/arch/alpha/kernel/pci.c b/arch/alpha/kernel/pci.c index 076c35cd6cde..98a1525fa164 100644 --- a/arch/alpha/kernel/pci.c +++ b/arch/alpha/kernel/pci.c | |||
@@ -285,8 +285,12 @@ pcibios_claim_one_bus(struct pci_bus *b) | |||
285 | if (r->parent || !r->start || !r->flags) | 285 | if (r->parent || !r->start || !r->flags) |
286 | continue; | 286 | continue; |
287 | if (pci_has_flag(PCI_PROBE_ONLY) || | 287 | if (pci_has_flag(PCI_PROBE_ONLY) || |
288 | (r->flags & IORESOURCE_PCI_FIXED)) | 288 | (r->flags & IORESOURCE_PCI_FIXED)) { |
289 | pci_claim_resource(dev, i); | 289 | if (pci_claim_resource(dev, i) == 0) |
290 | continue; | ||
291 | |||
292 | pci_claim_bridge_resource(dev, i); | ||
293 | } | ||
290 | } | 294 | } |
291 | } | 295 | } |
292 | 296 | ||
diff --git a/arch/arm/boot/dts/tegra20-seaboard.dts b/arch/arm/boot/dts/tegra20-seaboard.dts index ea282c7c0ca5..e2fed2712249 100644 --- a/arch/arm/boot/dts/tegra20-seaboard.dts +++ b/arch/arm/boot/dts/tegra20-seaboard.dts | |||
@@ -406,7 +406,7 @@ | |||
406 | clock-frequency = <400000>; | 406 | clock-frequency = <400000>; |
407 | 407 | ||
408 | magnetometer@c { | 408 | magnetometer@c { |
409 | compatible = "ak,ak8975"; | 409 | compatible = "asahi-kasei,ak8975"; |
410 | reg = <0xc>; | 410 | reg = <0xc>; |
411 | interrupt-parent = <&gpio>; | 411 | interrupt-parent = <&gpio>; |
412 | interrupts = <TEGRA_GPIO(N, 5) IRQ_TYPE_LEVEL_HIGH>; | 412 | interrupts = <TEGRA_GPIO(N, 5) IRQ_TYPE_LEVEL_HIGH>; |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 4176df721bf0..1a0045abead7 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -253,21 +253,22 @@ | |||
253 | .endm | 253 | .endm |
254 | 254 | ||
255 | .macro restore_user_regs, fast = 0, offset = 0 | 255 | .macro restore_user_regs, fast = 0, offset = 0 |
256 | ldr r1, [sp, #\offset + S_PSR] @ get calling cpsr | 256 | mov r2, sp |
257 | ldr lr, [sp, #\offset + S_PC]! @ get pc | 257 | ldr r1, [r2, #\offset + S_PSR] @ get calling cpsr |
258 | ldr lr, [r2, #\offset + S_PC]! @ get pc | ||
258 | msr spsr_cxsf, r1 @ save in spsr_svc | 259 | msr spsr_cxsf, r1 @ save in spsr_svc |
259 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) | 260 | #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_32v6K) |
260 | @ We must avoid clrex due to Cortex-A15 erratum #830321 | 261 | @ We must avoid clrex due to Cortex-A15 erratum #830321 |
261 | strex r1, r2, [sp] @ clear the exclusive monitor | 262 | strex r1, r2, [r2] @ clear the exclusive monitor |
262 | #endif | 263 | #endif |
263 | .if \fast | 264 | .if \fast |
264 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | 265 | ldmdb r2, {r1 - lr}^ @ get calling r1 - lr |
265 | .else | 266 | .else |
266 | ldmdb sp, {r0 - lr}^ @ get calling r0 - lr | 267 | ldmdb r2, {r0 - lr}^ @ get calling r0 - lr |
267 | .endif | 268 | .endif |
268 | mov r0, r0 @ ARMv5T and earlier require a nop | 269 | mov r0, r0 @ ARMv5T and earlier require a nop |
269 | @ after ldm {}^ | 270 | @ after ldm {}^ |
270 | add sp, sp, #S_FRAME_SIZE - S_PC | 271 | add sp, sp, #\offset + S_FRAME_SIZE |
271 | movs pc, lr @ return & move spsr_svc into cpsr | 272 | movs pc, lr @ return & move spsr_svc into cpsr |
272 | .endm | 273 | .endm |
273 | 274 | ||
diff --git a/arch/arm/kernel/perf_event.c b/arch/arm/kernel/perf_event.c index f7c65adaa428..557e128e4df0 100644 --- a/arch/arm/kernel/perf_event.c +++ b/arch/arm/kernel/perf_event.c | |||
@@ -116,8 +116,14 @@ int armpmu_event_set_period(struct perf_event *event) | |||
116 | ret = 1; | 116 | ret = 1; |
117 | } | 117 | } |
118 | 118 | ||
119 | if (left > (s64)armpmu->max_period) | 119 | /* |
120 | left = armpmu->max_period; | 120 | * Limit the maximum period to prevent the counter value |
121 | * from overtaking the one we are about to program. In | ||
122 | * effect we are reducing max_period to account for | ||
123 | * interrupt latency (and we are being very conservative). | ||
124 | */ | ||
125 | if (left > (armpmu->max_period >> 1)) | ||
126 | left = armpmu->max_period >> 1; | ||
121 | 127 | ||
122 | local64_set(&hwc->prev_count, (u64)-left); | 128 | local64_set(&hwc->prev_count, (u64)-left); |
123 | 129 | ||
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 715ae19bc7c8..e55408e96559 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -657,10 +657,13 @@ int __init arm_add_memory(u64 start, u64 size) | |||
657 | 657 | ||
658 | /* | 658 | /* |
659 | * Ensure that start/size are aligned to a page boundary. | 659 | * Ensure that start/size are aligned to a page boundary. |
660 | * Size is appropriately rounded down, start is rounded up. | 660 | * Size is rounded down, start is rounded up. |
661 | */ | 661 | */ |
662 | size -= start & ~PAGE_MASK; | ||
663 | aligned_start = PAGE_ALIGN(start); | 662 | aligned_start = PAGE_ALIGN(start); |
663 | if (aligned_start > start + size) | ||
664 | size = 0; | ||
665 | else | ||
666 | size -= aligned_start - start; | ||
664 | 667 | ||
665 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT | 668 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT |
666 | if (aligned_start > ULONG_MAX) { | 669 | if (aligned_start > ULONG_MAX) { |
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 1c43cec971b5..066688863920 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
@@ -85,6 +85,7 @@ vdso_install: | |||
85 | # We use MRPROPER_FILES and CLEAN_FILES now | 85 | # We use MRPROPER_FILES and CLEAN_FILES now |
86 | archclean: | 86 | archclean: |
87 | $(Q)$(MAKE) $(clean)=$(boot) | 87 | $(Q)$(MAKE) $(clean)=$(boot) |
88 | $(Q)$(MAKE) $(clean)=$(boot)/dts | ||
88 | 89 | ||
89 | define archhelp | 90 | define archhelp |
90 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' | 91 | echo '* Image.gz - Compressed kernel image (arch/$(ARCH)/boot/Image.gz)' |
diff --git a/arch/arm64/boot/dts/Makefile b/arch/arm64/boot/dts/Makefile index 3b8d427c3985..c62b0f4d9ef6 100644 --- a/arch/arm64/boot/dts/Makefile +++ b/arch/arm64/boot/dts/Makefile | |||
@@ -3,6 +3,4 @@ dts-dirs += apm | |||
3 | dts-dirs += arm | 3 | dts-dirs += arm |
4 | dts-dirs += cavium | 4 | dts-dirs += cavium |
5 | 5 | ||
6 | always := $(dtb-y) | ||
7 | subdir-y := $(dts-dirs) | 6 | subdir-y := $(dts-dirs) |
8 | clean-files := *.dtb | ||
diff --git a/arch/arm64/mm/dump.c b/arch/arm64/mm/dump.c index cf33f33333cc..d54dc9ac4b70 100644 --- a/arch/arm64/mm/dump.c +++ b/arch/arm64/mm/dump.c | |||
@@ -15,6 +15,7 @@ | |||
15 | */ | 15 | */ |
16 | #include <linux/debugfs.h> | 16 | #include <linux/debugfs.h> |
17 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
18 | #include <linux/io.h> | ||
18 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
19 | #include <linux/sched.h> | 20 | #include <linux/sched.h> |
20 | #include <linux/seq_file.h> | 21 | #include <linux/seq_file.h> |
diff --git a/arch/avr32/kernel/module.c b/arch/avr32/kernel/module.c index 2c9412908024..164efa009e5b 100644 --- a/arch/avr32/kernel/module.c +++ b/arch/avr32/kernel/module.c | |||
@@ -19,12 +19,10 @@ | |||
19 | #include <linux/moduleloader.h> | 19 | #include <linux/moduleloader.h> |
20 | #include <linux/vmalloc.h> | 20 | #include <linux/vmalloc.h> |
21 | 21 | ||
22 | void module_free(struct module *mod, void *module_region) | 22 | void module_arch_freeing_init(struct module *mod) |
23 | { | 23 | { |
24 | vfree(mod->arch.syminfo); | 24 | vfree(mod->arch.syminfo); |
25 | mod->arch.syminfo = NULL; | 25 | mod->arch.syminfo = NULL; |
26 | |||
27 | vfree(module_region); | ||
28 | } | 26 | } |
29 | 27 | ||
30 | static inline int check_rela(Elf32_Rela *rela, struct module *module, | 28 | static inline int check_rela(Elf32_Rela *rela, struct module *module, |
@@ -291,12 +289,3 @@ int apply_relocate_add(Elf32_Shdr *sechdrs, const char *strtab, | |||
291 | 289 | ||
292 | return ret; | 290 | return ret; |
293 | } | 291 | } |
294 | |||
295 | int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, | ||
296 | struct module *module) | ||
297 | { | ||
298 | vfree(module->arch.syminfo); | ||
299 | module->arch.syminfo = NULL; | ||
300 | |||
301 | return 0; | ||
302 | } | ||
diff --git a/arch/cris/kernel/module.c b/arch/cris/kernel/module.c index 51123f985eb5..af04cb6b6dc9 100644 --- a/arch/cris/kernel/module.c +++ b/arch/cris/kernel/module.c | |||
@@ -36,7 +36,7 @@ void *module_alloc(unsigned long size) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | /* Free memory returned from module_alloc */ | 38 | /* Free memory returned from module_alloc */ |
39 | void module_free(struct module *mod, void *module_region) | 39 | void module_memfree(void *module_region) |
40 | { | 40 | { |
41 | kfree(module_region); | 41 | kfree(module_region); |
42 | } | 42 | } |
diff --git a/arch/frv/mb93090-mb00/pci-frv.c b/arch/frv/mb93090-mb00/pci-frv.c index 67b1d1685759..0635bd6c2af3 100644 --- a/arch/frv/mb93090-mb00/pci-frv.c +++ b/arch/frv/mb93090-mb00/pci-frv.c | |||
@@ -94,7 +94,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
94 | r = &dev->resource[idx]; | 94 | r = &dev->resource[idx]; |
95 | if (!r->start) | 95 | if (!r->start) |
96 | continue; | 96 | continue; |
97 | pci_claim_resource(dev, idx); | 97 | pci_claim_bridge_resource(dev, idx); |
98 | } | 98 | } |
99 | } | 99 | } |
100 | pcibios_allocate_bus_resources(&bus->children); | 100 | pcibios_allocate_bus_resources(&bus->children); |
diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c index 24603be24c14..29754aae5177 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -305,14 +305,12 @@ plt_target (struct plt_entry *plt) | |||
305 | #endif /* !USE_BRL */ | 305 | #endif /* !USE_BRL */ |
306 | 306 | ||
307 | void | 307 | void |
308 | module_free (struct module *mod, void *module_region) | 308 | module_arch_freeing_init (struct module *mod) |
309 | { | 309 | { |
310 | if (mod && mod->arch.init_unw_table && | 310 | if (mod->arch.init_unw_table) { |
311 | module_region == mod->module_init) { | ||
312 | unw_remove_unwind_table(mod->arch.init_unw_table); | 311 | unw_remove_unwind_table(mod->arch.init_unw_table); |
313 | mod->arch.init_unw_table = NULL; | 312 | mod->arch.init_unw_table = NULL; |
314 | } | 313 | } |
315 | vfree(module_region); | ||
316 | } | 314 | } |
317 | 315 | ||
318 | /* Have we already seen one of these relocations? */ | 316 | /* Have we already seen one of these relocations? */ |
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 291a582777cf..900cc93e5409 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c | |||
@@ -487,45 +487,39 @@ int pcibios_root_bridge_prepare(struct pci_host_bridge *bridge) | |||
487 | return 0; | 487 | return 0; |
488 | } | 488 | } |
489 | 489 | ||
490 | static int is_valid_resource(struct pci_dev *dev, int idx) | 490 | void pcibios_fixup_device_resources(struct pci_dev *dev) |
491 | { | 491 | { |
492 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; | 492 | int idx; |
493 | struct resource *devr = &dev->resource[idx], *busr; | ||
494 | 493 | ||
495 | if (!dev->bus) | 494 | if (!dev->bus) |
496 | return 0; | 495 | return; |
497 | |||
498 | pci_bus_for_each_resource(dev->bus, busr, i) { | ||
499 | if (!busr || ((busr->flags ^ devr->flags) & type_mask)) | ||
500 | continue; | ||
501 | if ((devr->start) && (devr->start >= busr->start) && | ||
502 | (devr->end <= busr->end)) | ||
503 | return 1; | ||
504 | } | ||
505 | return 0; | ||
506 | } | ||
507 | 496 | ||
508 | static void pcibios_fixup_resources(struct pci_dev *dev, int start, int limit) | 497 | for (idx = 0; idx < PCI_BRIDGE_RESOURCES; idx++) { |
509 | { | 498 | struct resource *r = &dev->resource[idx]; |
510 | int i; | ||
511 | 499 | ||
512 | for (i = start; i < limit; i++) { | 500 | if (!r->flags || r->parent || !r->start) |
513 | if (!dev->resource[i].flags) | ||
514 | continue; | 501 | continue; |
515 | if ((is_valid_resource(dev, i))) | ||
516 | pci_claim_resource(dev, i); | ||
517 | } | ||
518 | } | ||
519 | 502 | ||
520 | void pcibios_fixup_device_resources(struct pci_dev *dev) | 503 | pci_claim_resource(dev, idx); |
521 | { | 504 | } |
522 | pcibios_fixup_resources(dev, 0, PCI_BRIDGE_RESOURCES); | ||
523 | } | 505 | } |
524 | EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources); | 506 | EXPORT_SYMBOL_GPL(pcibios_fixup_device_resources); |
525 | 507 | ||
526 | static void pcibios_fixup_bridge_resources(struct pci_dev *dev) | 508 | static void pcibios_fixup_bridge_resources(struct pci_dev *dev) |
527 | { | 509 | { |
528 | pcibios_fixup_resources(dev, PCI_BRIDGE_RESOURCES, PCI_NUM_RESOURCES); | 510 | int idx; |
511 | |||
512 | if (!dev->bus) | ||
513 | return; | ||
514 | |||
515 | for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { | ||
516 | struct resource *r = &dev->resource[idx]; | ||
517 | |||
518 | if (!r->flags || r->parent || !r->start) | ||
519 | continue; | ||
520 | |||
521 | pci_claim_bridge_resource(dev, idx); | ||
522 | } | ||
529 | } | 523 | } |
530 | 524 | ||
531 | /* | 525 | /* |
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c index b30e41c0c033..48528fb81eff 100644 --- a/arch/microblaze/pci/pci-common.c +++ b/arch/microblaze/pci/pci-common.c | |||
@@ -1026,6 +1026,8 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1026 | pr, (pr && pr->name) ? pr->name : "nil"); | 1026 | pr, (pr && pr->name) ? pr->name : "nil"); |
1027 | 1027 | ||
1028 | if (pr && !(pr->flags & IORESOURCE_UNSET)) { | 1028 | if (pr && !(pr->flags & IORESOURCE_UNSET)) { |
1029 | struct pci_dev *dev = bus->self; | ||
1030 | |||
1029 | if (request_resource(pr, res) == 0) | 1031 | if (request_resource(pr, res) == 0) |
1030 | continue; | 1032 | continue; |
1031 | /* | 1033 | /* |
@@ -1035,6 +1037,12 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1035 | */ | 1037 | */ |
1036 | if (reparent_resources(pr, res) == 0) | 1038 | if (reparent_resources(pr, res) == 0) |
1037 | continue; | 1039 | continue; |
1040 | |||
1041 | if (dev && i < PCI_BRIDGE_RESOURCE_NUM && | ||
1042 | pci_claim_bridge_resource(dev, | ||
1043 | i + PCI_BRIDGE_RESOURCES) == 0) | ||
1044 | continue; | ||
1045 | |||
1038 | } | 1046 | } |
1039 | pr_warn("PCI: Cannot allocate resource region "); | 1047 | pr_warn("PCI: Cannot allocate resource region "); |
1040 | pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number); | 1048 | pr_cont("%d of PCI bridge %d, will remap\n", i, bus->number); |
@@ -1227,7 +1235,10 @@ void pcibios_claim_one_bus(struct pci_bus *bus) | |||
1227 | (unsigned long long)r->end, | 1235 | (unsigned long long)r->end, |
1228 | (unsigned int)r->flags); | 1236 | (unsigned int)r->flags); |
1229 | 1237 | ||
1230 | pci_claim_resource(dev, i); | 1238 | if (pci_claim_resource(dev, i) == 0) |
1239 | continue; | ||
1240 | |||
1241 | pci_claim_bridge_resource(dev, i); | ||
1231 | } | 1242 | } |
1232 | } | 1243 | } |
1233 | 1244 | ||
diff --git a/arch/mips/net/bpf_jit.c b/arch/mips/net/bpf_jit.c index 9fd6834a2172..5d6139390bf8 100644 --- a/arch/mips/net/bpf_jit.c +++ b/arch/mips/net/bpf_jit.c | |||
@@ -1388,7 +1388,7 @@ out: | |||
1388 | void bpf_jit_free(struct bpf_prog *fp) | 1388 | void bpf_jit_free(struct bpf_prog *fp) |
1389 | { | 1389 | { |
1390 | if (fp->jited) | 1390 | if (fp->jited) |
1391 | module_free(NULL, fp->bpf_func); | 1391 | module_memfree(fp->bpf_func); |
1392 | 1392 | ||
1393 | bpf_prog_unlock_free(fp); | 1393 | bpf_prog_unlock_free(fp); |
1394 | } | 1394 | } |
diff --git a/arch/mn10300/unit-asb2305/pci-asb2305.c b/arch/mn10300/unit-asb2305/pci-asb2305.c index febb9cd83177..b5b036f64275 100644 --- a/arch/mn10300/unit-asb2305/pci-asb2305.c +++ b/arch/mn10300/unit-asb2305/pci-asb2305.c | |||
@@ -106,7 +106,7 @@ static void __init pcibios_allocate_bus_resources(struct list_head *bus_list) | |||
106 | if (!r->flags) | 106 | if (!r->flags) |
107 | continue; | 107 | continue; |
108 | if (!r->start || | 108 | if (!r->start || |
109 | pci_claim_resource(dev, idx) < 0) { | 109 | pci_claim_bridge_resource(dev, idx) < 0) { |
110 | printk(KERN_ERR "PCI:" | 110 | printk(KERN_ERR "PCI:" |
111 | " Cannot allocate resource" | 111 | " Cannot allocate resource" |
112 | " region %d of bridge %s\n", | 112 | " region %d of bridge %s\n", |
diff --git a/arch/mn10300/unit-asb2305/pci.c b/arch/mn10300/unit-asb2305/pci.c index 6b4339f8c9c2..471ff398090c 100644 --- a/arch/mn10300/unit-asb2305/pci.c +++ b/arch/mn10300/unit-asb2305/pci.c | |||
@@ -281,42 +281,37 @@ static int __init pci_check_direct(void) | |||
281 | return -ENODEV; | 281 | return -ENODEV; |
282 | } | 282 | } |
283 | 283 | ||
284 | static int is_valid_resource(struct pci_dev *dev, int idx) | 284 | static void pcibios_fixup_device_resources(struct pci_dev *dev) |
285 | { | 285 | { |
286 | unsigned int i, type_mask = IORESOURCE_IO | IORESOURCE_MEM; | 286 | int idx; |
287 | struct resource *devr = &dev->resource[idx], *busr; | ||
288 | |||
289 | if (dev->bus) { | ||
290 | pci_bus_for_each_resource(dev->bus, busr, i) { | ||
291 | if (!busr || (busr->flags ^ devr->flags) & type_mask) | ||
292 | continue; | ||
293 | |||
294 | if (devr->start && | ||
295 | devr->start >= busr->start && | ||
296 | devr->end <= busr->end) | ||
297 | return 1; | ||
298 | } | ||
299 | } | ||
300 | 287 | ||
301 | return 0; | 288 | if (!dev->bus) |
289 | return; | ||
290 | |||
291 | for (idx = 0; idx < PCI_BRIDGE_RESOURCES; idx++) { | ||
292 | struct resource *r = &dev->resource[idx]; | ||
293 | |||
294 | if (!r->flags || r->parent || !r->start) | ||
295 | continue; | ||
296 | |||
297 | pci_claim_resource(dev, idx); | ||
298 | } | ||
302 | } | 299 | } |
303 | 300 | ||
304 | static void pcibios_fixup_device_resources(struct pci_dev *dev) | 301 | static void pcibios_fixup_bridge_resources(struct pci_dev *dev) |
305 | { | 302 | { |
306 | int limit, i; | 303 | int idx; |
307 | 304 | ||
308 | if (dev->bus->number != 0) | 305 | if (!dev->bus) |
309 | return; | 306 | return; |
310 | 307 | ||
311 | limit = (dev->hdr_type == PCI_HEADER_TYPE_NORMAL) ? | 308 | for (idx = PCI_BRIDGE_RESOURCES; idx < PCI_NUM_RESOURCES; idx++) { |
312 | PCI_BRIDGE_RESOURCES : PCI_NUM_RESOURCES; | 309 | struct resource *r = &dev->resource[idx]; |
313 | 310 | ||
314 | for (i = 0; i < limit; i++) { | 311 | if (!r->flags || r->parent || !r->start) |
315 | if (!dev->resource[i].flags) | ||
316 | continue; | 312 | continue; |
317 | 313 | ||
318 | if (is_valid_resource(dev, i)) | 314 | pci_claim_bridge_resource(dev, idx); |
319 | pci_claim_resource(dev, i); | ||
320 | } | 315 | } |
321 | } | 316 | } |
322 | 317 | ||
@@ -330,7 +325,7 @@ void pcibios_fixup_bus(struct pci_bus *bus) | |||
330 | 325 | ||
331 | if (bus->self) { | 326 | if (bus->self) { |
332 | pci_read_bridge_bases(bus); | 327 | pci_read_bridge_bases(bus); |
333 | pcibios_fixup_device_resources(bus->self); | 328 | pcibios_fixup_bridge_resources(bus->self); |
334 | } | 329 | } |
335 | 330 | ||
336 | list_for_each_entry(dev, &bus->devices, bus_list) | 331 | list_for_each_entry(dev, &bus->devices, bus_list) |
diff --git a/arch/nios2/kernel/module.c b/arch/nios2/kernel/module.c index cc924a38f22a..e2e3f13f98d5 100644 --- a/arch/nios2/kernel/module.c +++ b/arch/nios2/kernel/module.c | |||
@@ -36,7 +36,7 @@ void *module_alloc(unsigned long size) | |||
36 | } | 36 | } |
37 | 37 | ||
38 | /* Free memory returned from module_alloc */ | 38 | /* Free memory returned from module_alloc */ |
39 | void module_free(struct module *mod, void *module_region) | 39 | void module_memfree(void *module_region) |
40 | { | 40 | { |
41 | kfree(module_region); | 41 | kfree(module_region); |
42 | } | 42 | } |
diff --git a/arch/nios2/kernel/signal.c b/arch/nios2/kernel/signal.c index f9d27883a714..2d0ea25be171 100644 --- a/arch/nios2/kernel/signal.c +++ b/arch/nios2/kernel/signal.c | |||
@@ -200,7 +200,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
200 | 200 | ||
201 | /* Set up to return from userspace; jump to fixed address sigreturn | 201 | /* Set up to return from userspace; jump to fixed address sigreturn |
202 | trampoline on kuser page. */ | 202 | trampoline on kuser page. */ |
203 | regs->ra = (unsigned long) (0x1040); | 203 | regs->ra = (unsigned long) (0x1044); |
204 | 204 | ||
205 | /* Set up registers for signal handler */ | 205 | /* Set up registers for signal handler */ |
206 | regs->sp = (unsigned long) frame; | 206 | regs->sp = (unsigned long) frame; |
diff --git a/arch/parisc/kernel/module.c b/arch/parisc/kernel/module.c index 50dfafc3f2c1..5822e8e200e6 100644 --- a/arch/parisc/kernel/module.c +++ b/arch/parisc/kernel/module.c | |||
@@ -298,14 +298,10 @@ static inline unsigned long count_stubs(const Elf_Rela *rela, unsigned long n) | |||
298 | } | 298 | } |
299 | #endif | 299 | #endif |
300 | 300 | ||
301 | 301 | void module_arch_freeing_init(struct module *mod) | |
302 | /* Free memory returned from module_alloc */ | ||
303 | void module_free(struct module *mod, void *module_region) | ||
304 | { | 302 | { |
305 | kfree(mod->arch.section); | 303 | kfree(mod->arch.section); |
306 | mod->arch.section = NULL; | 304 | mod->arch.section = NULL; |
307 | |||
308 | vfree(module_region); | ||
309 | } | 305 | } |
310 | 306 | ||
311 | /* Additional bytes needed in front of individual sections */ | 307 | /* Additional bytes needed in front of individual sections */ |
diff --git a/arch/powerpc/crypto/sha1.c b/arch/powerpc/crypto/sha1.c index d3feba5a275f..c154cebc1041 100644 --- a/arch/powerpc/crypto/sha1.c +++ b/arch/powerpc/crypto/sha1.c | |||
@@ -154,4 +154,5 @@ module_exit(sha1_powerpc_mod_fini); | |||
154 | MODULE_LICENSE("GPL"); | 154 | MODULE_LICENSE("GPL"); |
155 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); | 155 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); |
156 | 156 | ||
157 | MODULE_ALIAS_CRYPTO("sha1"); | ||
157 | MODULE_ALIAS_CRYPTO("sha1-powerpc"); | 158 | MODULE_ALIAS_CRYPTO("sha1-powerpc"); |
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c index 37d512d35943..2a525c938158 100644 --- a/arch/powerpc/kernel/pci-common.c +++ b/arch/powerpc/kernel/pci-common.c | |||
@@ -1184,6 +1184,8 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1184 | pr, (pr && pr->name) ? pr->name : "nil"); | 1184 | pr, (pr && pr->name) ? pr->name : "nil"); |
1185 | 1185 | ||
1186 | if (pr && !(pr->flags & IORESOURCE_UNSET)) { | 1186 | if (pr && !(pr->flags & IORESOURCE_UNSET)) { |
1187 | struct pci_dev *dev = bus->self; | ||
1188 | |||
1187 | if (request_resource(pr, res) == 0) | 1189 | if (request_resource(pr, res) == 0) |
1188 | continue; | 1190 | continue; |
1189 | /* | 1191 | /* |
@@ -1193,6 +1195,11 @@ static void pcibios_allocate_bus_resources(struct pci_bus *bus) | |||
1193 | */ | 1195 | */ |
1194 | if (reparent_resources(pr, res) == 0) | 1196 | if (reparent_resources(pr, res) == 0) |
1195 | continue; | 1197 | continue; |
1198 | |||
1199 | if (dev && i < PCI_BRIDGE_RESOURCE_NUM && | ||
1200 | pci_claim_bridge_resource(dev, | ||
1201 | i + PCI_BRIDGE_RESOURCES) == 0) | ||
1202 | continue; | ||
1196 | } | 1203 | } |
1197 | pr_warning("PCI: Cannot allocate resource region " | 1204 | pr_warning("PCI: Cannot allocate resource region " |
1198 | "%d of PCI bridge %d, will remap\n", i, bus->number); | 1205 | "%d of PCI bridge %d, will remap\n", i, bus->number); |
@@ -1401,7 +1408,10 @@ void pcibios_claim_one_bus(struct pci_bus *bus) | |||
1401 | (unsigned long long)r->end, | 1408 | (unsigned long long)r->end, |
1402 | (unsigned int)r->flags); | 1409 | (unsigned int)r->flags); |
1403 | 1410 | ||
1404 | pci_claim_resource(dev, i); | 1411 | if (pci_claim_resource(dev, i) == 0) |
1412 | continue; | ||
1413 | |||
1414 | pci_claim_bridge_resource(dev, i); | ||
1405 | } | 1415 | } |
1406 | } | 1416 | } |
1407 | 1417 | ||
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index 1ca125b9c226..d1916b577f2c 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -699,7 +699,7 @@ out: | |||
699 | void bpf_jit_free(struct bpf_prog *fp) | 699 | void bpf_jit_free(struct bpf_prog *fp) |
700 | { | 700 | { |
701 | if (fp->jited) | 701 | if (fp->jited) |
702 | module_free(NULL, fp->bpf_func); | 702 | module_memfree(fp->bpf_func); |
703 | 703 | ||
704 | bpf_prog_unlock_free(fp); | 704 | bpf_prog_unlock_free(fp); |
705 | } | 705 | } |
diff --git a/arch/s390/kernel/module.c b/arch/s390/kernel/module.c index b89b59158b95..409d152585be 100644 --- a/arch/s390/kernel/module.c +++ b/arch/s390/kernel/module.c | |||
@@ -55,14 +55,10 @@ void *module_alloc(unsigned long size) | |||
55 | } | 55 | } |
56 | #endif | 56 | #endif |
57 | 57 | ||
58 | /* Free memory returned from module_alloc */ | 58 | void module_arch_freeing_init(struct module *mod) |
59 | void module_free(struct module *mod, void *module_region) | ||
60 | { | 59 | { |
61 | if (mod) { | 60 | vfree(mod->arch.syminfo); |
62 | vfree(mod->arch.syminfo); | 61 | mod->arch.syminfo = NULL; |
63 | mod->arch.syminfo = NULL; | ||
64 | } | ||
65 | vfree(module_region); | ||
66 | } | 62 | } |
67 | 63 | ||
68 | static void check_rela(Elf_Rela *rela, struct module *me) | 64 | static void check_rela(Elf_Rela *rela, struct module *me) |
diff --git a/arch/s390/net/bpf_jit.S b/arch/s390/net/bpf_jit.S index 7e45d13816c1..ba44c9f55346 100644 --- a/arch/s390/net/bpf_jit.S +++ b/arch/s390/net/bpf_jit.S | |||
@@ -22,8 +22,8 @@ | |||
22 | * skb_copy_bits takes 4 parameters: | 22 | * skb_copy_bits takes 4 parameters: |
23 | * %r2 = skb pointer | 23 | * %r2 = skb pointer |
24 | * %r3 = offset into skb data | 24 | * %r3 = offset into skb data |
25 | * %r4 = length to copy | 25 | * %r4 = pointer to temp buffer |
26 | * %r5 = pointer to temp buffer | 26 | * %r5 = length to copy |
27 | */ | 27 | */ |
28 | #define SKBDATA %r8 | 28 | #define SKBDATA %r8 |
29 | 29 | ||
@@ -44,8 +44,9 @@ ENTRY(sk_load_word) | |||
44 | 44 | ||
45 | sk_load_word_slow: | 45 | sk_load_word_slow: |
46 | lgr %r9,%r2 # save %r2 | 46 | lgr %r9,%r2 # save %r2 |
47 | lhi %r4,4 # 4 bytes | 47 | lgr %r3,%r1 # offset |
48 | la %r5,160(%r15) # pointer to temp buffer | 48 | la %r4,160(%r15) # pointer to temp buffer |
49 | lghi %r5,4 # 4 bytes | ||
49 | brasl %r14,skb_copy_bits # get data from skb | 50 | brasl %r14,skb_copy_bits # get data from skb |
50 | l %r5,160(%r15) # load result from temp buffer | 51 | l %r5,160(%r15) # load result from temp buffer |
51 | ltgr %r2,%r2 # set cc to (%r2 != 0) | 52 | ltgr %r2,%r2 # set cc to (%r2 != 0) |
@@ -69,8 +70,9 @@ ENTRY(sk_load_half) | |||
69 | 70 | ||
70 | sk_load_half_slow: | 71 | sk_load_half_slow: |
71 | lgr %r9,%r2 # save %r2 | 72 | lgr %r9,%r2 # save %r2 |
72 | lhi %r4,2 # 2 bytes | 73 | lgr %r3,%r1 # offset |
73 | la %r5,162(%r15) # pointer to temp buffer | 74 | la %r4,162(%r15) # pointer to temp buffer |
75 | lghi %r5,2 # 2 bytes | ||
74 | brasl %r14,skb_copy_bits # get data from skb | 76 | brasl %r14,skb_copy_bits # get data from skb |
75 | xc 160(2,%r15),160(%r15) | 77 | xc 160(2,%r15),160(%r15) |
76 | l %r5,160(%r15) # load result from temp buffer | 78 | l %r5,160(%r15) # load result from temp buffer |
@@ -95,8 +97,9 @@ ENTRY(sk_load_byte) | |||
95 | 97 | ||
96 | sk_load_byte_slow: | 98 | sk_load_byte_slow: |
97 | lgr %r9,%r2 # save %r2 | 99 | lgr %r9,%r2 # save %r2 |
98 | lhi %r4,1 # 1 bytes | 100 | lgr %r3,%r1 # offset |
99 | la %r5,163(%r15) # pointer to temp buffer | 101 | la %r4,163(%r15) # pointer to temp buffer |
102 | lghi %r5,1 # 1 byte | ||
100 | brasl %r14,skb_copy_bits # get data from skb | 103 | brasl %r14,skb_copy_bits # get data from skb |
101 | xc 160(3,%r15),160(%r15) | 104 | xc 160(3,%r15),160(%r15) |
102 | l %r5,160(%r15) # load result from temp buffer | 105 | l %r5,160(%r15) # load result from temp buffer |
@@ -104,11 +107,11 @@ sk_load_byte_slow: | |||
104 | lgr %r2,%r9 # restore %r2 | 107 | lgr %r2,%r9 # restore %r2 |
105 | br %r8 | 108 | br %r8 |
106 | 109 | ||
107 | /* A = (*(u8 *)(skb->data+K) & 0xf) << 2 */ | 110 | /* X = (*(u8 *)(skb->data+K) & 0xf) << 2 */ |
108 | ENTRY(sk_load_byte_msh) | 111 | ENTRY(sk_load_byte_msh) |
109 | llgfr %r1,%r3 # extend offset | 112 | llgfr %r1,%r3 # extend offset |
110 | clr %r11,%r3 # hlen < offset ? | 113 | clr %r11,%r3 # hlen < offset ? |
111 | jle sk_load_byte_slow | 114 | jle sk_load_byte_msh_slow |
112 | lhi %r12,0 | 115 | lhi %r12,0 |
113 | ic %r12,0(%r1,%r10) # get byte from skb | 116 | ic %r12,0(%r1,%r10) # get byte from skb |
114 | nill %r12,0x0f | 117 | nill %r12,0x0f |
@@ -118,8 +121,9 @@ ENTRY(sk_load_byte_msh) | |||
118 | 121 | ||
119 | sk_load_byte_msh_slow: | 122 | sk_load_byte_msh_slow: |
120 | lgr %r9,%r2 # save %r2 | 123 | lgr %r9,%r2 # save %r2 |
121 | lhi %r4,2 # 2 bytes | 124 | lgr %r3,%r1 # offset |
122 | la %r5,162(%r15) # pointer to temp buffer | 125 | la %r4,163(%r15) # pointer to temp buffer |
126 | lghi %r5,1 # 1 byte | ||
123 | brasl %r14,skb_copy_bits # get data from skb | 127 | brasl %r14,skb_copy_bits # get data from skb |
124 | xc 160(3,%r15),160(%r15) | 128 | xc 160(3,%r15),160(%r15) |
125 | l %r12,160(%r15) # load result from temp buffer | 129 | l %r12,160(%r15) # load result from temp buffer |
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 524496d47ef5..bbd1981cc150 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c | |||
@@ -448,15 +448,12 @@ static int bpf_jit_insn(struct bpf_jit *jit, struct sock_filter *filter, | |||
448 | mask = 0x800000; /* je */ | 448 | mask = 0x800000; /* je */ |
449 | kbranch: /* Emit compare if the branch targets are different */ | 449 | kbranch: /* Emit compare if the branch targets are different */ |
450 | if (filter->jt != filter->jf) { | 450 | if (filter->jt != filter->jf) { |
451 | if (K <= 16383) | 451 | if (test_facility(21)) |
452 | /* chi %r5,<K> */ | ||
453 | EMIT4_IMM(0xa75e0000, K); | ||
454 | else if (test_facility(21)) | ||
455 | /* clfi %r5,<K> */ | 452 | /* clfi %r5,<K> */ |
456 | EMIT6_IMM(0xc25f0000, K); | 453 | EMIT6_IMM(0xc25f0000, K); |
457 | else | 454 | else |
458 | /* c %r5,<d(K)>(%r13) */ | 455 | /* cl %r5,<d(K)>(%r13) */ |
459 | EMIT4_DISP(0x5950d000, EMIT_CONST(K)); | 456 | EMIT4_DISP(0x5550d000, EMIT_CONST(K)); |
460 | } | 457 | } |
461 | branch: if (filter->jt == filter->jf) { | 458 | branch: if (filter->jt == filter->jf) { |
462 | if (filter->jt == 0) | 459 | if (filter->jt == 0) |
diff --git a/arch/sparc/kernel/pci.c b/arch/sparc/kernel/pci.c index b36365f49478..9ce5afe167ff 100644 --- a/arch/sparc/kernel/pci.c +++ b/arch/sparc/kernel/pci.c | |||
@@ -639,7 +639,10 @@ static void pci_claim_bus_resources(struct pci_bus *bus) | |||
639 | (unsigned long long)r->end, | 639 | (unsigned long long)r->end, |
640 | (unsigned int)r->flags); | 640 | (unsigned int)r->flags); |
641 | 641 | ||
642 | pci_claim_resource(dev, i); | 642 | if (pci_claim_resource(dev, i) == 0) |
643 | continue; | ||
644 | |||
645 | pci_claim_bridge_resource(dev, i); | ||
643 | } | 646 | } |
644 | } | 647 | } |
645 | 648 | ||
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index f33e7c7a3bf7..7931eeeb649a 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c | |||
@@ -776,7 +776,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf]; | |||
776 | if (unlikely(proglen + ilen > oldproglen)) { | 776 | if (unlikely(proglen + ilen > oldproglen)) { |
777 | pr_err("bpb_jit_compile fatal error\n"); | 777 | pr_err("bpb_jit_compile fatal error\n"); |
778 | kfree(addrs); | 778 | kfree(addrs); |
779 | module_free(NULL, image); | 779 | module_memfree(image); |
780 | return; | 780 | return; |
781 | } | 781 | } |
782 | memcpy(image + proglen, temp, ilen); | 782 | memcpy(image + proglen, temp, ilen); |
@@ -822,7 +822,7 @@ out: | |||
822 | void bpf_jit_free(struct bpf_prog *fp) | 822 | void bpf_jit_free(struct bpf_prog *fp) |
823 | { | 823 | { |
824 | if (fp->jited) | 824 | if (fp->jited) |
825 | module_free(NULL, fp->bpf_func); | 825 | module_memfree(fp->bpf_func); |
826 | 826 | ||
827 | bpf_prog_unlock_free(fp); | 827 | bpf_prog_unlock_free(fp); |
828 | } | 828 | } |
diff --git a/arch/tile/kernel/module.c b/arch/tile/kernel/module.c index 96447c9160a0..2305084c9b93 100644 --- a/arch/tile/kernel/module.c +++ b/arch/tile/kernel/module.c | |||
@@ -74,7 +74,7 @@ error: | |||
74 | 74 | ||
75 | 75 | ||
76 | /* Free memory returned from module_alloc */ | 76 | /* Free memory returned from module_alloc */ |
77 | void module_free(struct module *mod, void *module_region) | 77 | void module_memfree(void *module_region) |
78 | { | 78 | { |
79 | vfree(module_region); | 79 | vfree(module_region); |
80 | 80 | ||
@@ -83,7 +83,7 @@ void module_free(struct module *mod, void *module_region) | |||
83 | 0, 0, 0, NULL, NULL, 0); | 83 | 0, 0, 0, NULL, NULL, 0); |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * FIXME: If module_region == mod->module_init, trim exception | 86 | * FIXME: Add module_arch_freeing_init to trim exception |
87 | * table entries. | 87 | * table entries. |
88 | */ | 88 | */ |
89 | } | 89 | } |
diff --git a/arch/x86/crypto/sha-mb/sha1_mb.c b/arch/x86/crypto/sha-mb/sha1_mb.c index a225a5ca1037..fd9f6b035b16 100644 --- a/arch/x86/crypto/sha-mb/sha1_mb.c +++ b/arch/x86/crypto/sha-mb/sha1_mb.c | |||
@@ -931,4 +931,4 @@ module_exit(sha1_mb_mod_fini); | |||
931 | MODULE_LICENSE("GPL"); | 931 | MODULE_LICENSE("GPL"); |
932 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, multi buffer accelerated"); | 932 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm, multi buffer accelerated"); |
933 | 933 | ||
934 | MODULE_ALIAS("sha1"); | 934 | MODULE_ALIAS_CRYPTO("sha1"); |
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c index 2142376dc8c6..8b7b0a51e742 100644 --- a/arch/x86/kernel/ftrace.c +++ b/arch/x86/kernel/ftrace.c | |||
@@ -674,7 +674,7 @@ static inline void *alloc_tramp(unsigned long size) | |||
674 | } | 674 | } |
675 | static inline void tramp_free(void *tramp) | 675 | static inline void tramp_free(void *tramp) |
676 | { | 676 | { |
677 | module_free(NULL, tramp); | 677 | module_memfree(tramp); |
678 | } | 678 | } |
679 | #else | 679 | #else |
680 | /* Trampolines can only be created if modules are supported */ | 680 | /* Trampolines can only be created if modules are supported */ |
diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 169b09d76ddd..de12c1d379f1 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c | |||
@@ -2348,7 +2348,7 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) | |||
2348 | * Not recognized on AMD in compat mode (but is recognized in legacy | 2348 | * Not recognized on AMD in compat mode (but is recognized in legacy |
2349 | * mode). | 2349 | * mode). |
2350 | */ | 2350 | */ |
2351 | if ((ctxt->mode == X86EMUL_MODE_PROT32) && (efer & EFER_LMA) | 2351 | if ((ctxt->mode != X86EMUL_MODE_PROT64) && (efer & EFER_LMA) |
2352 | && !vendor_intel(ctxt)) | 2352 | && !vendor_intel(ctxt)) |
2353 | return emulate_ud(ctxt); | 2353 | return emulate_ud(ctxt); |
2354 | 2354 | ||
@@ -2359,25 +2359,13 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) | |||
2359 | setup_syscalls_segments(ctxt, &cs, &ss); | 2359 | setup_syscalls_segments(ctxt, &cs, &ss); |
2360 | 2360 | ||
2361 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); | 2361 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_CS, &msr_data); |
2362 | switch (ctxt->mode) { | 2362 | if ((msr_data & 0xfffc) == 0x0) |
2363 | case X86EMUL_MODE_PROT32: | 2363 | return emulate_gp(ctxt, 0); |
2364 | if ((msr_data & 0xfffc) == 0x0) | ||
2365 | return emulate_gp(ctxt, 0); | ||
2366 | break; | ||
2367 | case X86EMUL_MODE_PROT64: | ||
2368 | if (msr_data == 0x0) | ||
2369 | return emulate_gp(ctxt, 0); | ||
2370 | break; | ||
2371 | default: | ||
2372 | break; | ||
2373 | } | ||
2374 | 2364 | ||
2375 | ctxt->eflags &= ~(EFLG_VM | EFLG_IF); | 2365 | ctxt->eflags &= ~(EFLG_VM | EFLG_IF); |
2376 | cs_sel = (u16)msr_data; | 2366 | cs_sel = (u16)msr_data & ~SELECTOR_RPL_MASK; |
2377 | cs_sel &= ~SELECTOR_RPL_MASK; | ||
2378 | ss_sel = cs_sel + 8; | 2367 | ss_sel = cs_sel + 8; |
2379 | ss_sel &= ~SELECTOR_RPL_MASK; | 2368 | if (efer & EFER_LMA) { |
2380 | if (ctxt->mode == X86EMUL_MODE_PROT64 || (efer & EFER_LMA)) { | ||
2381 | cs.d = 0; | 2369 | cs.d = 0; |
2382 | cs.l = 1; | 2370 | cs.l = 1; |
2383 | } | 2371 | } |
@@ -2386,10 +2374,11 @@ static int em_sysenter(struct x86_emulate_ctxt *ctxt) | |||
2386 | ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS); | 2374 | ops->set_segment(ctxt, ss_sel, &ss, 0, VCPU_SREG_SS); |
2387 | 2375 | ||
2388 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_EIP, &msr_data); | 2376 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_EIP, &msr_data); |
2389 | ctxt->_eip = msr_data; | 2377 | ctxt->_eip = (efer & EFER_LMA) ? msr_data : (u32)msr_data; |
2390 | 2378 | ||
2391 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_ESP, &msr_data); | 2379 | ops->get_msr(ctxt, MSR_IA32_SYSENTER_ESP, &msr_data); |
2392 | *reg_write(ctxt, VCPU_REGS_RSP) = msr_data; | 2380 | *reg_write(ctxt, VCPU_REGS_RSP) = (efer & EFER_LMA) ? msr_data : |
2381 | (u32)msr_data; | ||
2393 | 2382 | ||
2394 | return X86EMUL_CONTINUE; | 2383 | return X86EMUL_CONTINUE; |
2395 | } | 2384 | } |
@@ -3791,8 +3780,8 @@ static const struct opcode group5[] = { | |||
3791 | }; | 3780 | }; |
3792 | 3781 | ||
3793 | static const struct opcode group6[] = { | 3782 | static const struct opcode group6[] = { |
3794 | DI(Prot, sldt), | 3783 | DI(Prot | DstMem, sldt), |
3795 | DI(Prot, str), | 3784 | DI(Prot | DstMem, str), |
3796 | II(Prot | Priv | SrcMem16, em_lldt, lldt), | 3785 | II(Prot | Priv | SrcMem16, em_lldt, lldt), |
3797 | II(Prot | Priv | SrcMem16, em_ltr, ltr), | 3786 | II(Prot | Priv | SrcMem16, em_ltr, ltr), |
3798 | N, N, N, N, | 3787 | N, N, N, N, |
diff --git a/arch/x86/pci/i386.c b/arch/x86/pci/i386.c index 9b18ef315a55..349c0d32cc0b 100644 --- a/arch/x86/pci/i386.c +++ b/arch/x86/pci/i386.c | |||
@@ -216,7 +216,7 @@ static void pcibios_allocate_bridge_resources(struct pci_dev *dev) | |||
216 | continue; | 216 | continue; |
217 | if (r->parent) /* Already allocated */ | 217 | if (r->parent) /* Already allocated */ |
218 | continue; | 218 | continue; |
219 | if (!r->start || pci_claim_resource(dev, idx) < 0) { | 219 | if (!r->start || pci_claim_bridge_resource(dev, idx) < 0) { |
220 | /* | 220 | /* |
221 | * Something is wrong with the region. | 221 | * Something is wrong with the region. |
222 | * Invalidate the resource to prevent | 222 | * Invalidate the resource to prevent |
diff --git a/crypto/aes_generic.c b/crypto/aes_generic.c index 9b3c54c1cbe8..3dd101144a58 100644 --- a/crypto/aes_generic.c +++ b/crypto/aes_generic.c | |||
@@ -1475,3 +1475,4 @@ module_exit(aes_fini); | |||
1475 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 1475 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
1476 | MODULE_LICENSE("Dual BSD/GPL"); | 1476 | MODULE_LICENSE("Dual BSD/GPL"); |
1477 | MODULE_ALIAS_CRYPTO("aes"); | 1477 | MODULE_ALIAS_CRYPTO("aes"); |
1478 | MODULE_ALIAS_CRYPTO("aes-generic"); | ||
diff --git a/crypto/ansi_cprng.c b/crypto/ansi_cprng.c index b4485a108389..6f5bebc9bf01 100644 --- a/crypto/ansi_cprng.c +++ b/crypto/ansi_cprng.c | |||
@@ -477,3 +477,4 @@ MODULE_PARM_DESC(dbg, "Boolean to enable debugging (0/1 == off/on)"); | |||
477 | module_init(prng_mod_init); | 477 | module_init(prng_mod_init); |
478 | module_exit(prng_mod_fini); | 478 | module_exit(prng_mod_fini); |
479 | MODULE_ALIAS_CRYPTO("stdrng"); | 479 | MODULE_ALIAS_CRYPTO("stdrng"); |
480 | MODULE_ALIAS_CRYPTO("ansi_cprng"); | ||
diff --git a/crypto/blowfish_generic.c b/crypto/blowfish_generic.c index 7bd71f02d0dd..87b392a77a93 100644 --- a/crypto/blowfish_generic.c +++ b/crypto/blowfish_generic.c | |||
@@ -139,3 +139,4 @@ module_exit(blowfish_mod_fini); | |||
139 | MODULE_LICENSE("GPL"); | 139 | MODULE_LICENSE("GPL"); |
140 | MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); | 140 | MODULE_DESCRIPTION("Blowfish Cipher Algorithm"); |
141 | MODULE_ALIAS_CRYPTO("blowfish"); | 141 | MODULE_ALIAS_CRYPTO("blowfish"); |
142 | MODULE_ALIAS_CRYPTO("blowfish-generic"); | ||
diff --git a/crypto/camellia_generic.c b/crypto/camellia_generic.c index 1b74c5a3e891..a02286bf319e 100644 --- a/crypto/camellia_generic.c +++ b/crypto/camellia_generic.c | |||
@@ -1099,3 +1099,4 @@ module_exit(camellia_fini); | |||
1099 | MODULE_DESCRIPTION("Camellia Cipher Algorithm"); | 1099 | MODULE_DESCRIPTION("Camellia Cipher Algorithm"); |
1100 | MODULE_LICENSE("GPL"); | 1100 | MODULE_LICENSE("GPL"); |
1101 | MODULE_ALIAS_CRYPTO("camellia"); | 1101 | MODULE_ALIAS_CRYPTO("camellia"); |
1102 | MODULE_ALIAS_CRYPTO("camellia-generic"); | ||
diff --git a/crypto/cast5_generic.c b/crypto/cast5_generic.c index 84c86db67ec7..df5c72629383 100644 --- a/crypto/cast5_generic.c +++ b/crypto/cast5_generic.c | |||
@@ -550,3 +550,4 @@ module_exit(cast5_mod_fini); | |||
550 | MODULE_LICENSE("GPL"); | 550 | MODULE_LICENSE("GPL"); |
551 | MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); | 551 | MODULE_DESCRIPTION("Cast5 Cipher Algorithm"); |
552 | MODULE_ALIAS_CRYPTO("cast5"); | 552 | MODULE_ALIAS_CRYPTO("cast5"); |
553 | MODULE_ALIAS_CRYPTO("cast5-generic"); | ||
diff --git a/crypto/cast6_generic.c b/crypto/cast6_generic.c index f408f0bd8de2..058c8d755d03 100644 --- a/crypto/cast6_generic.c +++ b/crypto/cast6_generic.c | |||
@@ -292,3 +292,4 @@ module_exit(cast6_mod_fini); | |||
292 | MODULE_LICENSE("GPL"); | 292 | MODULE_LICENSE("GPL"); |
293 | MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); | 293 | MODULE_DESCRIPTION("Cast6 Cipher Algorithm"); |
294 | MODULE_ALIAS_CRYPTO("cast6"); | 294 | MODULE_ALIAS_CRYPTO("cast6"); |
295 | MODULE_ALIAS_CRYPTO("cast6-generic"); | ||
diff --git a/crypto/crc32c_generic.c b/crypto/crc32c_generic.c index 2a062025749d..06f1b60f02b2 100644 --- a/crypto/crc32c_generic.c +++ b/crypto/crc32c_generic.c | |||
@@ -171,4 +171,5 @@ MODULE_AUTHOR("Clay Haapala <chaapala@cisco.com>"); | |||
171 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c"); | 171 | MODULE_DESCRIPTION("CRC32c (Castagnoli) calculations wrapper for lib/crc32c"); |
172 | MODULE_LICENSE("GPL"); | 172 | MODULE_LICENSE("GPL"); |
173 | MODULE_ALIAS_CRYPTO("crc32c"); | 173 | MODULE_ALIAS_CRYPTO("crc32c"); |
174 | MODULE_ALIAS_CRYPTO("crc32c-generic"); | ||
174 | MODULE_SOFTDEP("pre: crc32c"); | 175 | MODULE_SOFTDEP("pre: crc32c"); |
diff --git a/crypto/crct10dif_generic.c b/crypto/crct10dif_generic.c index 08bb4f504520..c1229614c7e3 100644 --- a/crypto/crct10dif_generic.c +++ b/crypto/crct10dif_generic.c | |||
@@ -125,3 +125,4 @@ MODULE_AUTHOR("Tim Chen <tim.c.chen@linux.intel.com>"); | |||
125 | MODULE_DESCRIPTION("T10 DIF CRC calculation."); | 125 | MODULE_DESCRIPTION("T10 DIF CRC calculation."); |
126 | MODULE_LICENSE("GPL"); | 126 | MODULE_LICENSE("GPL"); |
127 | MODULE_ALIAS_CRYPTO("crct10dif"); | 127 | MODULE_ALIAS_CRYPTO("crct10dif"); |
128 | MODULE_ALIAS_CRYPTO("crct10dif-generic"); | ||
diff --git a/crypto/des_generic.c b/crypto/des_generic.c index 42912948776b..a71720544d11 100644 --- a/crypto/des_generic.c +++ b/crypto/des_generic.c | |||
@@ -983,8 +983,6 @@ static struct crypto_alg des_algs[2] = { { | |||
983 | .cia_decrypt = des3_ede_decrypt } } | 983 | .cia_decrypt = des3_ede_decrypt } } |
984 | } }; | 984 | } }; |
985 | 985 | ||
986 | MODULE_ALIAS_CRYPTO("des3_ede"); | ||
987 | |||
988 | static int __init des_generic_mod_init(void) | 986 | static int __init des_generic_mod_init(void) |
989 | { | 987 | { |
990 | return crypto_register_algs(des_algs, ARRAY_SIZE(des_algs)); | 988 | return crypto_register_algs(des_algs, ARRAY_SIZE(des_algs)); |
@@ -1001,4 +999,7 @@ module_exit(des_generic_mod_fini); | |||
1001 | MODULE_LICENSE("GPL"); | 999 | MODULE_LICENSE("GPL"); |
1002 | MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms"); | 1000 | MODULE_DESCRIPTION("DES & Triple DES EDE Cipher Algorithms"); |
1003 | MODULE_AUTHOR("Dag Arne Osvik <da@osvik.no>"); | 1001 | MODULE_AUTHOR("Dag Arne Osvik <da@osvik.no>"); |
1004 | MODULE_ALIAS("des"); | 1002 | MODULE_ALIAS_CRYPTO("des"); |
1003 | MODULE_ALIAS_CRYPTO("des-generic"); | ||
1004 | MODULE_ALIAS_CRYPTO("des3_ede"); | ||
1005 | MODULE_ALIAS_CRYPTO("des3_ede-generic"); | ||
diff --git a/crypto/ghash-generic.c b/crypto/ghash-generic.c index 4e97fae9666f..bac70995e064 100644 --- a/crypto/ghash-generic.c +++ b/crypto/ghash-generic.c | |||
@@ -173,3 +173,4 @@ module_exit(ghash_mod_exit); | |||
173 | MODULE_LICENSE("GPL"); | 173 | MODULE_LICENSE("GPL"); |
174 | MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); | 174 | MODULE_DESCRIPTION("GHASH Message Digest Algorithm"); |
175 | MODULE_ALIAS_CRYPTO("ghash"); | 175 | MODULE_ALIAS_CRYPTO("ghash"); |
176 | MODULE_ALIAS_CRYPTO("ghash-generic"); | ||
diff --git a/crypto/krng.c b/crypto/krng.c index 67c88b331210..0224841b6579 100644 --- a/crypto/krng.c +++ b/crypto/krng.c | |||
@@ -63,3 +63,4 @@ module_exit(krng_mod_fini); | |||
63 | MODULE_LICENSE("GPL"); | 63 | MODULE_LICENSE("GPL"); |
64 | MODULE_DESCRIPTION("Kernel Random Number Generator"); | 64 | MODULE_DESCRIPTION("Kernel Random Number Generator"); |
65 | MODULE_ALIAS_CRYPTO("stdrng"); | 65 | MODULE_ALIAS_CRYPTO("stdrng"); |
66 | MODULE_ALIAS_CRYPTO("krng"); | ||
diff --git a/crypto/salsa20_generic.c b/crypto/salsa20_generic.c index 3d0f9df30ac9..f550b5d94630 100644 --- a/crypto/salsa20_generic.c +++ b/crypto/salsa20_generic.c | |||
@@ -249,3 +249,4 @@ module_exit(salsa20_generic_mod_fini); | |||
249 | MODULE_LICENSE("GPL"); | 249 | MODULE_LICENSE("GPL"); |
250 | MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); | 250 | MODULE_DESCRIPTION ("Salsa20 stream cipher algorithm"); |
251 | MODULE_ALIAS_CRYPTO("salsa20"); | 251 | MODULE_ALIAS_CRYPTO("salsa20"); |
252 | MODULE_ALIAS_CRYPTO("salsa20-generic"); | ||
diff --git a/crypto/serpent_generic.c b/crypto/serpent_generic.c index a53b5e2af335..94970a794975 100644 --- a/crypto/serpent_generic.c +++ b/crypto/serpent_generic.c | |||
@@ -667,3 +667,4 @@ MODULE_DESCRIPTION("Serpent and tnepres (kerneli compatible serpent reversed) Ci | |||
667 | MODULE_AUTHOR("Dag Arne Osvik <osvik@ii.uib.no>"); | 667 | MODULE_AUTHOR("Dag Arne Osvik <osvik@ii.uib.no>"); |
668 | MODULE_ALIAS_CRYPTO("tnepres"); | 668 | MODULE_ALIAS_CRYPTO("tnepres"); |
669 | MODULE_ALIAS_CRYPTO("serpent"); | 669 | MODULE_ALIAS_CRYPTO("serpent"); |
670 | MODULE_ALIAS_CRYPTO("serpent-generic"); | ||
diff --git a/crypto/sha1_generic.c b/crypto/sha1_generic.c index 039e58cfa155..a3e50c37eb6f 100644 --- a/crypto/sha1_generic.c +++ b/crypto/sha1_generic.c | |||
@@ -154,3 +154,4 @@ MODULE_LICENSE("GPL"); | |||
154 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); | 154 | MODULE_DESCRIPTION("SHA1 Secure Hash Algorithm"); |
155 | 155 | ||
156 | MODULE_ALIAS_CRYPTO("sha1"); | 156 | MODULE_ALIAS_CRYPTO("sha1"); |
157 | MODULE_ALIAS_CRYPTO("sha1-generic"); | ||
diff --git a/crypto/sha256_generic.c b/crypto/sha256_generic.c index 5eb21b120033..b001ff5c2efc 100644 --- a/crypto/sha256_generic.c +++ b/crypto/sha256_generic.c | |||
@@ -385,4 +385,6 @@ MODULE_LICENSE("GPL"); | |||
385 | MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); | 385 | MODULE_DESCRIPTION("SHA-224 and SHA-256 Secure Hash Algorithm"); |
386 | 386 | ||
387 | MODULE_ALIAS_CRYPTO("sha224"); | 387 | MODULE_ALIAS_CRYPTO("sha224"); |
388 | MODULE_ALIAS_CRYPTO("sha224-generic"); | ||
388 | MODULE_ALIAS_CRYPTO("sha256"); | 389 | MODULE_ALIAS_CRYPTO("sha256"); |
390 | MODULE_ALIAS_CRYPTO("sha256-generic"); | ||
diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c index 8d0b19ed4f4b..1c3c3767e079 100644 --- a/crypto/sha512_generic.c +++ b/crypto/sha512_generic.c | |||
@@ -289,4 +289,6 @@ MODULE_LICENSE("GPL"); | |||
289 | MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); | 289 | MODULE_DESCRIPTION("SHA-512 and SHA-384 Secure Hash Algorithms"); |
290 | 290 | ||
291 | MODULE_ALIAS_CRYPTO("sha384"); | 291 | MODULE_ALIAS_CRYPTO("sha384"); |
292 | MODULE_ALIAS_CRYPTO("sha384-generic"); | ||
292 | MODULE_ALIAS_CRYPTO("sha512"); | 293 | MODULE_ALIAS_CRYPTO("sha512"); |
294 | MODULE_ALIAS_CRYPTO("sha512-generic"); | ||
diff --git a/crypto/tea.c b/crypto/tea.c index 495be2d0077d..b70b441c7d1e 100644 --- a/crypto/tea.c +++ b/crypto/tea.c | |||
@@ -270,6 +270,7 @@ static void __exit tea_mod_fini(void) | |||
270 | crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); | 270 | crypto_unregister_algs(tea_algs, ARRAY_SIZE(tea_algs)); |
271 | } | 271 | } |
272 | 272 | ||
273 | MODULE_ALIAS_CRYPTO("tea"); | ||
273 | MODULE_ALIAS_CRYPTO("xtea"); | 274 | MODULE_ALIAS_CRYPTO("xtea"); |
274 | MODULE_ALIAS_CRYPTO("xeta"); | 275 | MODULE_ALIAS_CRYPTO("xeta"); |
275 | 276 | ||
diff --git a/crypto/tgr192.c b/crypto/tgr192.c index 6e5651c66cf8..321bc6ff2a9d 100644 --- a/crypto/tgr192.c +++ b/crypto/tgr192.c | |||
@@ -676,6 +676,7 @@ static void __exit tgr192_mod_fini(void) | |||
676 | crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); | 676 | crypto_unregister_shashes(tgr_algs, ARRAY_SIZE(tgr_algs)); |
677 | } | 677 | } |
678 | 678 | ||
679 | MODULE_ALIAS_CRYPTO("tgr192"); | ||
679 | MODULE_ALIAS_CRYPTO("tgr160"); | 680 | MODULE_ALIAS_CRYPTO("tgr160"); |
680 | MODULE_ALIAS_CRYPTO("tgr128"); | 681 | MODULE_ALIAS_CRYPTO("tgr128"); |
681 | 682 | ||
diff --git a/crypto/twofish_generic.c b/crypto/twofish_generic.c index 523ad8c4e359..ebf7a3efb572 100644 --- a/crypto/twofish_generic.c +++ b/crypto/twofish_generic.c | |||
@@ -212,3 +212,4 @@ module_exit(twofish_mod_fini); | |||
212 | MODULE_LICENSE("GPL"); | 212 | MODULE_LICENSE("GPL"); |
213 | MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); | 213 | MODULE_DESCRIPTION ("Twofish Cipher Algorithm"); |
214 | MODULE_ALIAS_CRYPTO("twofish"); | 214 | MODULE_ALIAS_CRYPTO("twofish"); |
215 | MODULE_ALIAS_CRYPTO("twofish-generic"); | ||
diff --git a/crypto/wp512.c b/crypto/wp512.c index 0de42eb3d040..7ee5a043a988 100644 --- a/crypto/wp512.c +++ b/crypto/wp512.c | |||
@@ -1167,6 +1167,7 @@ static void __exit wp512_mod_fini(void) | |||
1167 | crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); | 1167 | crypto_unregister_shashes(wp_algs, ARRAY_SIZE(wp_algs)); |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | MODULE_ALIAS_CRYPTO("wp512"); | ||
1170 | MODULE_ALIAS_CRYPTO("wp384"); | 1171 | MODULE_ALIAS_CRYPTO("wp384"); |
1171 | MODULE_ALIAS_CRYPTO("wp256"); | 1172 | MODULE_ALIAS_CRYPTO("wp256"); |
1172 | 1173 | ||
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index a3a13605a9c4..5f601553b9b0 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -835,6 +835,7 @@ config PATA_AT32 | |||
835 | config PATA_AT91 | 835 | config PATA_AT91 |
836 | tristate "PATA support for AT91SAM9260" | 836 | tristate "PATA support for AT91SAM9260" |
837 | depends on ARM && SOC_AT91SAM9 | 837 | depends on ARM && SOC_AT91SAM9 |
838 | depends on !ARCH_MULTIPLATFORM | ||
838 | help | 839 | help |
839 | This option enables support for IDE devices on the Atmel AT91SAM9260 SoC. | 840 | This option enables support for IDE devices on the Atmel AT91SAM9260 SoC. |
840 | 841 | ||
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index 49f1e6890587..33bb06e006c9 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -325,7 +325,6 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
325 | { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */ | 325 | { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */ |
326 | { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */ | 326 | { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */ |
327 | { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ | 327 | { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ |
328 | { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */ | ||
329 | { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ | 328 | { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ |
330 | { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ | 329 | { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ |
331 | { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ | 330 | { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ |
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c index feeb8f1e2fe8..cbcd20810355 100644 --- a/drivers/ata/ahci_xgene.c +++ b/drivers/ata/ahci_xgene.c | |||
@@ -125,10 +125,11 @@ static int xgene_ahci_restart_engine(struct ata_port *ap) | |||
125 | * xgene_ahci_qc_issue - Issue commands to the device | 125 | * xgene_ahci_qc_issue - Issue commands to the device |
126 | * @qc: Command to issue | 126 | * @qc: Command to issue |
127 | * | 127 | * |
128 | * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot | 128 | * Due to Hardware errata for IDENTIFY DEVICE command and PACKET |
129 | * clear the BSY bit after receiving the PIO setup FIS. This results in the dma | 129 | * command of ATAPI protocol set, the controller cannot clear the BSY bit |
130 | * state machine goes into the CMFatalErrorUpdate state and locks up. By | 130 | * after receiving the PIO setup FIS. This results in the DMA state machine |
131 | * restarting the dma engine, it removes the controller out of lock up state. | 131 | * going into the CMFatalErrorUpdate state and locks up. By restarting the |
132 | * DMA engine, it removes the controller out of lock up state. | ||
132 | */ | 133 | */ |
133 | static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) | 134 | static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) |
134 | { | 135 | { |
@@ -137,7 +138,8 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) | |||
137 | struct xgene_ahci_context *ctx = hpriv->plat_data; | 138 | struct xgene_ahci_context *ctx = hpriv->plat_data; |
138 | int rc = 0; | 139 | int rc = 0; |
139 | 140 | ||
140 | if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA)) | 141 | if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) || |
142 | (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET))) | ||
141 | xgene_ahci_restart_engine(ap); | 143 | xgene_ahci_restart_engine(ap); |
142 | 144 | ||
143 | rc = ahci_qc_issue(qc); | 145 | rc = ahci_qc_issue(qc); |
@@ -188,7 +190,7 @@ static unsigned int xgene_ahci_read_id(struct ata_device *dev, | |||
188 | * | 190 | * |
189 | * Clear reserved bit 8 (DEVSLP bit) as we don't support DEVSLP | 191 | * Clear reserved bit 8 (DEVSLP bit) as we don't support DEVSLP |
190 | */ | 192 | */ |
191 | id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8); | 193 | id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8)); |
192 | 194 | ||
193 | return 0; | 195 | return 0; |
194 | } | 196 | } |
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c index 97683e45ab04..61a9c07e0dff 100644 --- a/drivers/ata/libahci.c +++ b/drivers/ata/libahci.c | |||
@@ -2003,7 +2003,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep) | |||
2003 | 2003 | ||
2004 | devslp = readl(port_mmio + PORT_DEVSLP); | 2004 | devslp = readl(port_mmio + PORT_DEVSLP); |
2005 | if (!(devslp & PORT_DEVSLP_DSP)) { | 2005 | if (!(devslp & PORT_DEVSLP_DSP)) { |
2006 | dev_err(ap->host->dev, "port does not support device sleep\n"); | 2006 | dev_info(ap->host->dev, "port does not support device sleep\n"); |
2007 | return; | 2007 | return; |
2008 | } | 2008 | } |
2009 | 2009 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5c84fb5c3372..d1a05f9bb91f 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -4233,10 +4233,33 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = { | |||
4233 | { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, | 4233 | { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, |
4234 | 4234 | ||
4235 | /* devices that don't properly handle queued TRIM commands */ | 4235 | /* devices that don't properly handle queued TRIM commands */ |
4236 | { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4236 | { "Micron_M[56]*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | |
4237 | { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4237 | ATA_HORKAGE_ZERO_AFTER_TRIM, }, |
4238 | { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4238 | { "Crucial_CT*SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, |
4239 | { "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, | 4239 | |
4240 | /* | ||
4241 | * As defined, the DRAT (Deterministic Read After Trim) and RZAT | ||
4242 | * (Return Zero After Trim) flags in the ATA Command Set are | ||
4243 | * unreliable in the sense that they only define what happens if | ||
4244 | * the device successfully executed the DSM TRIM command. TRIM | ||
4245 | * is only advisory, however, and the device is free to silently | ||
4246 | * ignore all or parts of the request. | ||
4247 | * | ||
4248 | * Whitelist drives that are known to reliably return zeroes | ||
4249 | * after TRIM. | ||
4250 | */ | ||
4251 | |||
4252 | /* | ||
4253 | * The intel 510 drive has buggy DRAT/RZAT. Explicitly exclude | ||
4254 | * that model before whitelisting all other intel SSDs. | ||
4255 | */ | ||
4256 | { "INTEL*SSDSC2MH*", NULL, 0, }, | ||
4257 | |||
4258 | { "INTEL*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4259 | { "SSD*INTEL*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4260 | { "Samsung*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4261 | { "SAMSUNG*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4262 | { "ST[1248][0248]0[FH]*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, | ||
4240 | 4263 | ||
4241 | /* | 4264 | /* |
4242 | * Some WD SATA-I drives spin up and down erratically when the link | 4265 | * Some WD SATA-I drives spin up and down erratically when the link |
@@ -4748,7 +4771,10 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) | |||
4748 | return NULL; | 4771 | return NULL; |
4749 | 4772 | ||
4750 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { | 4773 | for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { |
4751 | tag = tag < max_queue ? tag : 0; | 4774 | if (ap->flags & ATA_FLAG_LOWTAG) |
4775 | tag = i; | ||
4776 | else | ||
4777 | tag = tag < max_queue ? tag : 0; | ||
4752 | 4778 | ||
4753 | /* the last tag is reserved for internal command. */ | 4779 | /* the last tag is reserved for internal command. */ |
4754 | if (tag == ATA_TAG_INTERNAL) | 4780 | if (tag == ATA_TAG_INTERNAL) |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 3dbec8954c86..8d00c2638bed 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2389,6 +2389,7 @@ const char *ata_get_cmd_descript(u8 command) | |||
2389 | 2389 | ||
2390 | return NULL; | 2390 | return NULL; |
2391 | } | 2391 | } |
2392 | EXPORT_SYMBOL_GPL(ata_get_cmd_descript); | ||
2392 | 2393 | ||
2393 | /** | 2394 | /** |
2394 | * ata_eh_link_report - report error handling to user | 2395 | * ata_eh_link_report - report error handling to user |
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index e364e86e84d7..6abd17a85b13 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c | |||
@@ -2532,13 +2532,15 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf) | |||
2532 | rbuf[15] = lowest_aligned; | 2532 | rbuf[15] = lowest_aligned; |
2533 | 2533 | ||
2534 | if (ata_id_has_trim(args->id)) { | 2534 | if (ata_id_has_trim(args->id)) { |
2535 | rbuf[14] |= 0x80; /* TPE */ | 2535 | rbuf[14] |= 0x80; /* LBPME */ |
2536 | 2536 | ||
2537 | if (ata_id_has_zero_after_trim(args->id)) | 2537 | if (ata_id_has_zero_after_trim(args->id) && |
2538 | rbuf[14] |= 0x40; /* TPRZ */ | 2538 | dev->horkage & ATA_HORKAGE_ZERO_AFTER_TRIM) { |
2539 | ata_dev_info(dev, "Enabling discard_zeroes_data\n"); | ||
2540 | rbuf[14] |= 0x40; /* LBPRZ */ | ||
2541 | } | ||
2539 | } | 2542 | } |
2540 | } | 2543 | } |
2541 | |||
2542 | return 0; | 2544 | return 0; |
2543 | } | 2545 | } |
2544 | 2546 | ||
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index db90aa35cb71..2e86e3b85266 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1333,7 +1333,19 @@ void ata_sff_flush_pio_task(struct ata_port *ap) | |||
1333 | DPRINTK("ENTER\n"); | 1333 | DPRINTK("ENTER\n"); |
1334 | 1334 | ||
1335 | cancel_delayed_work_sync(&ap->sff_pio_task); | 1335 | cancel_delayed_work_sync(&ap->sff_pio_task); |
1336 | |||
1337 | /* | ||
1338 | * We wanna reset the HSM state to IDLE. If we do so without | ||
1339 | * grabbing the port lock, critical sections protected by it which | ||
1340 | * expect the HSM state to stay stable may get surprised. For | ||
1341 | * example, we may set IDLE in between the time | ||
1342 | * __ata_sff_port_intr() checks for HSM_ST_IDLE and before it calls | ||
1343 | * ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG(). | ||
1344 | */ | ||
1345 | spin_lock_irq(ap->lock); | ||
1336 | ap->hsm_task_state = HSM_ST_IDLE; | 1346 | ap->hsm_task_state = HSM_ST_IDLE; |
1347 | spin_unlock_irq(ap->lock); | ||
1348 | |||
1337 | ap->sff_pio_task_link = NULL; | 1349 | ap->sff_pio_task_link = NULL; |
1338 | 1350 | ||
1339 | if (ata_msg_ctl(ap)) | 1351 | if (ata_msg_ctl(ap)) |
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index c7ddef89e7b0..8e8248179d20 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c | |||
@@ -797,7 +797,7 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq) | |||
797 | if (err) { | 797 | if (err) { |
798 | dev_err(host_pvt.dwc_dev, "%s: dma_request_interrupts returns" | 798 | dev_err(host_pvt.dwc_dev, "%s: dma_request_interrupts returns" |
799 | " %d\n", __func__, err); | 799 | " %d\n", __func__, err); |
800 | goto error_out; | 800 | return err; |
801 | } | 801 | } |
802 | 802 | ||
803 | /* Enabe DMA */ | 803 | /* Enabe DMA */ |
@@ -808,11 +808,6 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq) | |||
808 | sata_dma_regs); | 808 | sata_dma_regs); |
809 | 809 | ||
810 | return 0; | 810 | return 0; |
811 | |||
812 | error_out: | ||
813 | dma_dwc_exit(hsdev); | ||
814 | |||
815 | return err; | ||
816 | } | 811 | } |
817 | 812 | ||
818 | static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val) | 813 | static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val) |
@@ -1662,7 +1657,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1662 | char *ver = (char *)&versionr; | 1657 | char *ver = (char *)&versionr; |
1663 | u8 *base = NULL; | 1658 | u8 *base = NULL; |
1664 | int err = 0; | 1659 | int err = 0; |
1665 | int irq, rc; | 1660 | int irq; |
1666 | struct ata_host *host; | 1661 | struct ata_host *host; |
1667 | struct ata_port_info pi = sata_dwc_port_info[0]; | 1662 | struct ata_port_info pi = sata_dwc_port_info[0]; |
1668 | const struct ata_port_info *ppi[] = { &pi, NULL }; | 1663 | const struct ata_port_info *ppi[] = { &pi, NULL }; |
@@ -1725,7 +1720,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1725 | if (irq == NO_IRQ) { | 1720 | if (irq == NO_IRQ) { |
1726 | dev_err(&ofdev->dev, "no SATA DMA irq\n"); | 1721 | dev_err(&ofdev->dev, "no SATA DMA irq\n"); |
1727 | err = -ENODEV; | 1722 | err = -ENODEV; |
1728 | goto error_out; | 1723 | goto error_iomap; |
1729 | } | 1724 | } |
1730 | 1725 | ||
1731 | /* Get physical SATA DMA register base address */ | 1726 | /* Get physical SATA DMA register base address */ |
@@ -1734,14 +1729,16 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1734 | dev_err(&ofdev->dev, "ioremap failed for AHBDMA register" | 1729 | dev_err(&ofdev->dev, "ioremap failed for AHBDMA register" |
1735 | " address\n"); | 1730 | " address\n"); |
1736 | err = -ENODEV; | 1731 | err = -ENODEV; |
1737 | goto error_out; | 1732 | goto error_iomap; |
1738 | } | 1733 | } |
1739 | 1734 | ||
1740 | /* Save dev for later use in dev_xxx() routines */ | 1735 | /* Save dev for later use in dev_xxx() routines */ |
1741 | host_pvt.dwc_dev = &ofdev->dev; | 1736 | host_pvt.dwc_dev = &ofdev->dev; |
1742 | 1737 | ||
1743 | /* Initialize AHB DMAC */ | 1738 | /* Initialize AHB DMAC */ |
1744 | dma_dwc_init(hsdev, irq); | 1739 | err = dma_dwc_init(hsdev, irq); |
1740 | if (err) | ||
1741 | goto error_dma_iomap; | ||
1745 | 1742 | ||
1746 | /* Enable SATA Interrupts */ | 1743 | /* Enable SATA Interrupts */ |
1747 | sata_dwc_enable_interrupts(hsdev); | 1744 | sata_dwc_enable_interrupts(hsdev); |
@@ -1759,9 +1756,8 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1759 | * device discovery process, invoking our port_start() handler & | 1756 | * device discovery process, invoking our port_start() handler & |
1760 | * error_handler() to execute a dummy Softreset EH session | 1757 | * error_handler() to execute a dummy Softreset EH session |
1761 | */ | 1758 | */ |
1762 | rc = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht); | 1759 | err = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht); |
1763 | 1760 | if (err) | |
1764 | if (rc != 0) | ||
1765 | dev_err(&ofdev->dev, "failed to activate host"); | 1761 | dev_err(&ofdev->dev, "failed to activate host"); |
1766 | 1762 | ||
1767 | dev_set_drvdata(&ofdev->dev, host); | 1763 | dev_set_drvdata(&ofdev->dev, host); |
@@ -1770,7 +1766,8 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
1770 | error_out: | 1766 | error_out: |
1771 | /* Free SATA DMA resources */ | 1767 | /* Free SATA DMA resources */ |
1772 | dma_dwc_exit(hsdev); | 1768 | dma_dwc_exit(hsdev); |
1773 | 1769 | error_dma_iomap: | |
1770 | iounmap((void __iomem *)host_pvt.sata_dma_regs); | ||
1774 | error_iomap: | 1771 | error_iomap: |
1775 | iounmap(base); | 1772 | iounmap(base); |
1776 | error_kmalloc: | 1773 | error_kmalloc: |
@@ -1791,6 +1788,7 @@ static int sata_dwc_remove(struct platform_device *ofdev) | |||
1791 | /* Free SATA DMA resources */ | 1788 | /* Free SATA DMA resources */ |
1792 | dma_dwc_exit(hsdev); | 1789 | dma_dwc_exit(hsdev); |
1793 | 1790 | ||
1791 | iounmap((void __iomem *)host_pvt.sata_dma_regs); | ||
1794 | iounmap(hsdev->reg_base); | 1792 | iounmap(hsdev->reg_base); |
1795 | kfree(hsdev); | 1793 | kfree(hsdev); |
1796 | kfree(host); | 1794 | kfree(host); |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index d81b20ddb527..ea655949023f 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -246,7 +246,7 @@ enum { | |||
246 | /* host flags */ | 246 | /* host flags */ |
247 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | | 247 | SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | |
248 | ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA | | 248 | ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA | |
249 | ATA_FLAG_AN | ATA_FLAG_PMP, | 249 | ATA_FLAG_AN | ATA_FLAG_PMP | ATA_FLAG_LOWTAG, |
250 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ | 250 | SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ |
251 | 251 | ||
252 | IRQ_STAT_4PORTS = 0xf, | 252 | IRQ_STAT_4PORTS = 0xf, |
diff --git a/drivers/gpio/gpio-crystalcove.c b/drivers/gpio/gpio-crystalcove.c index 55d4803d71b0..3d9e08f7e823 100644 --- a/drivers/gpio/gpio-crystalcove.c +++ b/drivers/gpio/gpio-crystalcove.c | |||
@@ -272,7 +272,7 @@ static irqreturn_t crystalcove_gpio_irq_handler(int irq, void *data) | |||
272 | for (gpio = 0; gpio < CRYSTALCOVE_GPIO_NUM; gpio++) { | 272 | for (gpio = 0; gpio < CRYSTALCOVE_GPIO_NUM; gpio++) { |
273 | if (pending & BIT(gpio)) { | 273 | if (pending & BIT(gpio)) { |
274 | virq = irq_find_mapping(cg->chip.irqdomain, gpio); | 274 | virq = irq_find_mapping(cg->chip.irqdomain, gpio); |
275 | generic_handle_irq(virq); | 275 | handle_nested_irq(virq); |
276 | } | 276 | } |
277 | } | 277 | } |
278 | 278 | ||
diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c index 604dbe60bdee..08261f2b3a82 100644 --- a/drivers/gpio/gpiolib-of.c +++ b/drivers/gpio/gpiolib-of.c | |||
@@ -45,8 +45,14 @@ static int of_gpiochip_find_and_xlate(struct gpio_chip *gc, void *data) | |||
45 | return false; | 45 | return false; |
46 | 46 | ||
47 | ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags); | 47 | ret = gc->of_xlate(gc, &gg_data->gpiospec, gg_data->flags); |
48 | if (ret < 0) | 48 | if (ret < 0) { |
49 | return false; | 49 | /* We've found the gpio chip, but the translation failed. |
50 | * Return true to stop looking and return the translation | ||
51 | * error via out_gpio | ||
52 | */ | ||
53 | gg_data->out_gpio = ERR_PTR(ret); | ||
54 | return true; | ||
55 | } | ||
50 | 56 | ||
51 | gg_data->out_gpio = gpiochip_get_desc(gc, ret); | 57 | gg_data->out_gpio = gpiochip_get_desc(gc, ret); |
52 | return true; | 58 | return true; |
diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 2ac1800b58bb..f62aa115d79a 100644 --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c | |||
@@ -128,7 +128,7 @@ static ssize_t gpio_value_store(struct device *dev, | |||
128 | return status; | 128 | return status; |
129 | } | 129 | } |
130 | 130 | ||
131 | static const DEVICE_ATTR(value, 0644, | 131 | static DEVICE_ATTR(value, 0644, |
132 | gpio_value_show, gpio_value_store); | 132 | gpio_value_show, gpio_value_store); |
133 | 133 | ||
134 | static irqreturn_t gpio_sysfs_irq(int irq, void *priv) | 134 | static irqreturn_t gpio_sysfs_irq(int irq, void *priv) |
@@ -353,17 +353,46 @@ static ssize_t gpio_active_low_store(struct device *dev, | |||
353 | return status ? : size; | 353 | return status ? : size; |
354 | } | 354 | } |
355 | 355 | ||
356 | static const DEVICE_ATTR(active_low, 0644, | 356 | static DEVICE_ATTR(active_low, 0644, |
357 | gpio_active_low_show, gpio_active_low_store); | 357 | gpio_active_low_show, gpio_active_low_store); |
358 | 358 | ||
359 | static const struct attribute *gpio_attrs[] = { | 359 | static umode_t gpio_is_visible(struct kobject *kobj, struct attribute *attr, |
360 | int n) | ||
361 | { | ||
362 | struct device *dev = container_of(kobj, struct device, kobj); | ||
363 | struct gpio_desc *desc = dev_get_drvdata(dev); | ||
364 | umode_t mode = attr->mode; | ||
365 | bool show_direction = test_bit(FLAG_SYSFS_DIR, &desc->flags); | ||
366 | |||
367 | if (attr == &dev_attr_direction.attr) { | ||
368 | if (!show_direction) | ||
369 | mode = 0; | ||
370 | } else if (attr == &dev_attr_edge.attr) { | ||
371 | if (gpiod_to_irq(desc) < 0) | ||
372 | mode = 0; | ||
373 | if (!show_direction && test_bit(FLAG_IS_OUT, &desc->flags)) | ||
374 | mode = 0; | ||
375 | } | ||
376 | |||
377 | return mode; | ||
378 | } | ||
379 | |||
380 | static struct attribute *gpio_attrs[] = { | ||
381 | &dev_attr_direction.attr, | ||
382 | &dev_attr_edge.attr, | ||
360 | &dev_attr_value.attr, | 383 | &dev_attr_value.attr, |
361 | &dev_attr_active_low.attr, | 384 | &dev_attr_active_low.attr, |
362 | NULL, | 385 | NULL, |
363 | }; | 386 | }; |
364 | 387 | ||
365 | static const struct attribute_group gpio_attr_group = { | 388 | static const struct attribute_group gpio_group = { |
366 | .attrs = (struct attribute **) gpio_attrs, | 389 | .attrs = gpio_attrs, |
390 | .is_visible = gpio_is_visible, | ||
391 | }; | ||
392 | |||
393 | static const struct attribute_group *gpio_groups[] = { | ||
394 | &gpio_group, | ||
395 | NULL | ||
367 | }; | 396 | }; |
368 | 397 | ||
369 | /* | 398 | /* |
@@ -400,16 +429,13 @@ static ssize_t chip_ngpio_show(struct device *dev, | |||
400 | } | 429 | } |
401 | static DEVICE_ATTR(ngpio, 0444, chip_ngpio_show, NULL); | 430 | static DEVICE_ATTR(ngpio, 0444, chip_ngpio_show, NULL); |
402 | 431 | ||
403 | static const struct attribute *gpiochip_attrs[] = { | 432 | static struct attribute *gpiochip_attrs[] = { |
404 | &dev_attr_base.attr, | 433 | &dev_attr_base.attr, |
405 | &dev_attr_label.attr, | 434 | &dev_attr_label.attr, |
406 | &dev_attr_ngpio.attr, | 435 | &dev_attr_ngpio.attr, |
407 | NULL, | 436 | NULL, |
408 | }; | 437 | }; |
409 | 438 | ATTRIBUTE_GROUPS(gpiochip); | |
410 | static const struct attribute_group gpiochip_attr_group = { | ||
411 | .attrs = (struct attribute **) gpiochip_attrs, | ||
412 | }; | ||
413 | 439 | ||
414 | /* | 440 | /* |
415 | * /sys/class/gpio/export ... write-only | 441 | * /sys/class/gpio/export ... write-only |
@@ -556,45 +582,30 @@ int gpiod_export(struct gpio_desc *desc, bool direction_may_change) | |||
556 | goto fail_unlock; | 582 | goto fail_unlock; |
557 | } | 583 | } |
558 | 584 | ||
559 | if (!desc->chip->direction_input || !desc->chip->direction_output) | 585 | if (desc->chip->direction_input && desc->chip->direction_output && |
560 | direction_may_change = false; | 586 | direction_may_change) { |
587 | set_bit(FLAG_SYSFS_DIR, &desc->flags); | ||
588 | } | ||
589 | |||
561 | spin_unlock_irqrestore(&gpio_lock, flags); | 590 | spin_unlock_irqrestore(&gpio_lock, flags); |
562 | 591 | ||
563 | offset = gpio_chip_hwgpio(desc); | 592 | offset = gpio_chip_hwgpio(desc); |
564 | if (desc->chip->names && desc->chip->names[offset]) | 593 | if (desc->chip->names && desc->chip->names[offset]) |
565 | ioname = desc->chip->names[offset]; | 594 | ioname = desc->chip->names[offset]; |
566 | 595 | ||
567 | dev = device_create(&gpio_class, desc->chip->dev, MKDEV(0, 0), | 596 | dev = device_create_with_groups(&gpio_class, desc->chip->dev, |
568 | desc, ioname ? ioname : "gpio%u", | 597 | MKDEV(0, 0), desc, gpio_groups, |
569 | desc_to_gpio(desc)); | 598 | ioname ? ioname : "gpio%u", |
599 | desc_to_gpio(desc)); | ||
570 | if (IS_ERR(dev)) { | 600 | if (IS_ERR(dev)) { |
571 | status = PTR_ERR(dev); | 601 | status = PTR_ERR(dev); |
572 | goto fail_unlock; | 602 | goto fail_unlock; |
573 | } | 603 | } |
574 | 604 | ||
575 | status = sysfs_create_group(&dev->kobj, &gpio_attr_group); | ||
576 | if (status) | ||
577 | goto fail_unregister_device; | ||
578 | |||
579 | if (direction_may_change) { | ||
580 | status = device_create_file(dev, &dev_attr_direction); | ||
581 | if (status) | ||
582 | goto fail_unregister_device; | ||
583 | } | ||
584 | |||
585 | if (gpiod_to_irq(desc) >= 0 && (direction_may_change || | ||
586 | !test_bit(FLAG_IS_OUT, &desc->flags))) { | ||
587 | status = device_create_file(dev, &dev_attr_edge); | ||
588 | if (status) | ||
589 | goto fail_unregister_device; | ||
590 | } | ||
591 | |||
592 | set_bit(FLAG_EXPORT, &desc->flags); | 605 | set_bit(FLAG_EXPORT, &desc->flags); |
593 | mutex_unlock(&sysfs_lock); | 606 | mutex_unlock(&sysfs_lock); |
594 | return 0; | 607 | return 0; |
595 | 608 | ||
596 | fail_unregister_device: | ||
597 | device_unregister(dev); | ||
598 | fail_unlock: | 609 | fail_unlock: |
599 | mutex_unlock(&sysfs_lock); | 610 | mutex_unlock(&sysfs_lock); |
600 | gpiod_dbg(desc, "%s: status %d\n", __func__, status); | 611 | gpiod_dbg(desc, "%s: status %d\n", __func__, status); |
@@ -718,6 +729,7 @@ void gpiod_unexport(struct gpio_desc *desc) | |||
718 | dev = class_find_device(&gpio_class, NULL, desc, match_export); | 729 | dev = class_find_device(&gpio_class, NULL, desc, match_export); |
719 | if (dev) { | 730 | if (dev) { |
720 | gpio_setup_irq(desc, dev, 0); | 731 | gpio_setup_irq(desc, dev, 0); |
732 | clear_bit(FLAG_SYSFS_DIR, &desc->flags); | ||
721 | clear_bit(FLAG_EXPORT, &desc->flags); | 733 | clear_bit(FLAG_EXPORT, &desc->flags); |
722 | } else | 734 | } else |
723 | status = -ENODEV; | 735 | status = -ENODEV; |
@@ -750,13 +762,13 @@ int gpiochip_export(struct gpio_chip *chip) | |||
750 | 762 | ||
751 | /* use chip->base for the ID; it's already known to be unique */ | 763 | /* use chip->base for the ID; it's already known to be unique */ |
752 | mutex_lock(&sysfs_lock); | 764 | mutex_lock(&sysfs_lock); |
753 | dev = device_create(&gpio_class, chip->dev, MKDEV(0, 0), chip, | 765 | dev = device_create_with_groups(&gpio_class, chip->dev, MKDEV(0, 0), |
754 | "gpiochip%d", chip->base); | 766 | chip, gpiochip_groups, |
755 | if (!IS_ERR(dev)) { | 767 | "gpiochip%d", chip->base); |
756 | status = sysfs_create_group(&dev->kobj, | 768 | if (IS_ERR(dev)) |
757 | &gpiochip_attr_group); | ||
758 | } else | ||
759 | status = PTR_ERR(dev); | 769 | status = PTR_ERR(dev); |
770 | else | ||
771 | status = 0; | ||
760 | chip->exported = (status == 0); | 772 | chip->exported = (status == 0); |
761 | mutex_unlock(&sysfs_lock); | 773 | mutex_unlock(&sysfs_lock); |
762 | 774 | ||
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 487afe6f22fc..568aa2b6bdb0 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -248,29 +248,30 @@ int gpiochip_add(struct gpio_chip *chip) | |||
248 | base = gpiochip_find_base(chip->ngpio); | 248 | base = gpiochip_find_base(chip->ngpio); |
249 | if (base < 0) { | 249 | if (base < 0) { |
250 | status = base; | 250 | status = base; |
251 | goto unlock; | 251 | spin_unlock_irqrestore(&gpio_lock, flags); |
252 | goto err_free_descs; | ||
252 | } | 253 | } |
253 | chip->base = base; | 254 | chip->base = base; |
254 | } | 255 | } |
255 | 256 | ||
256 | status = gpiochip_add_to_list(chip); | 257 | status = gpiochip_add_to_list(chip); |
258 | if (status) { | ||
259 | spin_unlock_irqrestore(&gpio_lock, flags); | ||
260 | goto err_free_descs; | ||
261 | } | ||
257 | 262 | ||
258 | if (status == 0) { | 263 | for (id = 0; id < chip->ngpio; id++) { |
259 | for (id = 0; id < chip->ngpio; id++) { | 264 | struct gpio_desc *desc = &descs[id]; |
260 | struct gpio_desc *desc = &descs[id]; | 265 | |
261 | desc->chip = chip; | 266 | desc->chip = chip; |
262 | 267 | ||
263 | /* REVISIT: most hardware initializes GPIOs as | 268 | /* REVISIT: most hardware initializes GPIOs as inputs (often |
264 | * inputs (often with pullups enabled) so power | 269 | * with pullups enabled) so power usage is minimized. Linux |
265 | * usage is minimized. Linux code should set the | 270 | * code should set the gpio direction first thing; but until |
266 | * gpio direction first thing; but until it does, | 271 | * it does, and in case chip->get_direction is not set, we may |
267 | * and in case chip->get_direction is not set, | 272 | * expose the wrong direction in sysfs. |
268 | * we may expose the wrong direction in sysfs. | 273 | */ |
269 | */ | 274 | desc->flags = !chip->direction_input ? (1 << FLAG_IS_OUT) : 0; |
270 | desc->flags = !chip->direction_input | ||
271 | ? (1 << FLAG_IS_OUT) | ||
272 | : 0; | ||
273 | } | ||
274 | } | 275 | } |
275 | 276 | ||
276 | chip->desc = descs; | 277 | chip->desc = descs; |
@@ -284,12 +285,9 @@ int gpiochip_add(struct gpio_chip *chip) | |||
284 | of_gpiochip_add(chip); | 285 | of_gpiochip_add(chip); |
285 | acpi_gpiochip_add(chip); | 286 | acpi_gpiochip_add(chip); |
286 | 287 | ||
287 | if (status) | ||
288 | goto fail; | ||
289 | |||
290 | status = gpiochip_export(chip); | 288 | status = gpiochip_export(chip); |
291 | if (status) | 289 | if (status) |
292 | goto fail; | 290 | goto err_remove_chip; |
293 | 291 | ||
294 | pr_debug("%s: registered GPIOs %d to %d on device: %s\n", __func__, | 292 | pr_debug("%s: registered GPIOs %d to %d on device: %s\n", __func__, |
295 | chip->base, chip->base + chip->ngpio - 1, | 293 | chip->base, chip->base + chip->ngpio - 1, |
@@ -297,11 +295,15 @@ int gpiochip_add(struct gpio_chip *chip) | |||
297 | 295 | ||
298 | return 0; | 296 | return 0; |
299 | 297 | ||
300 | unlock: | 298 | err_remove_chip: |
299 | acpi_gpiochip_remove(chip); | ||
300 | of_gpiochip_remove(chip); | ||
301 | spin_lock_irqsave(&gpio_lock, flags); | ||
302 | list_del(&chip->list); | ||
301 | spin_unlock_irqrestore(&gpio_lock, flags); | 303 | spin_unlock_irqrestore(&gpio_lock, flags); |
302 | fail: | ||
303 | kfree(descs); | ||
304 | chip->desc = NULL; | 304 | chip->desc = NULL; |
305 | err_free_descs: | ||
306 | kfree(descs); | ||
305 | 307 | ||
306 | /* failures here can mean systems won't boot... */ | 308 | /* failures here can mean systems won't boot... */ |
307 | pr_err("%s: GPIOs %d..%d (%s) failed to register\n", __func__, | 309 | pr_err("%s: GPIOs %d..%d (%s) failed to register\n", __func__, |
@@ -325,14 +327,15 @@ void gpiochip_remove(struct gpio_chip *chip) | |||
325 | unsigned long flags; | 327 | unsigned long flags; |
326 | unsigned id; | 328 | unsigned id; |
327 | 329 | ||
328 | acpi_gpiochip_remove(chip); | 330 | gpiochip_unexport(chip); |
329 | |||
330 | spin_lock_irqsave(&gpio_lock, flags); | ||
331 | 331 | ||
332 | gpiochip_irqchip_remove(chip); | 332 | gpiochip_irqchip_remove(chip); |
333 | |||
334 | acpi_gpiochip_remove(chip); | ||
333 | gpiochip_remove_pin_ranges(chip); | 335 | gpiochip_remove_pin_ranges(chip); |
334 | of_gpiochip_remove(chip); | 336 | of_gpiochip_remove(chip); |
335 | 337 | ||
338 | spin_lock_irqsave(&gpio_lock, flags); | ||
336 | for (id = 0; id < chip->ngpio; id++) { | 339 | for (id = 0; id < chip->ngpio; id++) { |
337 | if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) | 340 | if (test_bit(FLAG_REQUESTED, &chip->desc[id].flags)) |
338 | dev_crit(chip->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); | 341 | dev_crit(chip->dev, "REMOVING GPIOCHIP WITH GPIOS STILL REQUESTED\n"); |
@@ -342,7 +345,6 @@ void gpiochip_remove(struct gpio_chip *chip) | |||
342 | 345 | ||
343 | list_del(&chip->list); | 346 | list_del(&chip->list); |
344 | spin_unlock_irqrestore(&gpio_lock, flags); | 347 | spin_unlock_irqrestore(&gpio_lock, flags); |
345 | gpiochip_unexport(chip); | ||
346 | 348 | ||
347 | kfree(chip->desc); | 349 | kfree(chip->desc); |
348 | chip->desc = NULL; | 350 | chip->desc = NULL; |
diff --git a/drivers/gpio/gpiolib.h b/drivers/gpio/gpiolib.h index e3a52113a541..550a5eafbd38 100644 --- a/drivers/gpio/gpiolib.h +++ b/drivers/gpio/gpiolib.h | |||
@@ -77,6 +77,7 @@ struct gpio_desc { | |||
77 | #define FLAG_OPEN_DRAIN 7 /* Gpio is open drain type */ | 77 | #define FLAG_OPEN_DRAIN 7 /* Gpio is open drain type */ |
78 | #define FLAG_OPEN_SOURCE 8 /* Gpio is open source type */ | 78 | #define FLAG_OPEN_SOURCE 8 /* Gpio is open source type */ |
79 | #define FLAG_USED_AS_IRQ 9 /* GPIO is connected to an IRQ */ | 79 | #define FLAG_USED_AS_IRQ 9 /* GPIO is connected to an IRQ */ |
80 | #define FLAG_SYSFS_DIR 10 /* show sysfs direction attribute */ | ||
80 | 81 | ||
81 | #define ID_SHIFT 16 /* add new flags before this one */ | 82 | #define ID_SHIFT 16 /* add new flags before this one */ |
82 | 83 | ||
diff --git a/drivers/gpu/drm/amd/amdkfd/Makefile b/drivers/gpu/drm/amd/amdkfd/Makefile index be6246de5091..307a309110e6 100644 --- a/drivers/gpu/drm/amd/amdkfd/Makefile +++ b/drivers/gpu/drm/amd/amdkfd/Makefile | |||
@@ -8,7 +8,6 @@ amdkfd-y := kfd_module.o kfd_device.o kfd_chardev.o kfd_topology.o \ | |||
8 | kfd_pasid.o kfd_doorbell.o kfd_flat_memory.o \ | 8 | kfd_pasid.o kfd_doorbell.o kfd_flat_memory.o \ |
9 | kfd_process.o kfd_queue.o kfd_mqd_manager.o \ | 9 | kfd_process.o kfd_queue.o kfd_mqd_manager.o \ |
10 | kfd_kernel_queue.o kfd_packet_manager.o \ | 10 | kfd_kernel_queue.o kfd_packet_manager.o \ |
11 | kfd_process_queue_manager.o kfd_device_queue_manager.o \ | 11 | kfd_process_queue_manager.o kfd_device_queue_manager.o |
12 | kfd_interrupt.o | ||
13 | 12 | ||
14 | obj-$(CONFIG_HSA_AMD) += amdkfd.o | 13 | obj-$(CONFIG_HSA_AMD) += amdkfd.o |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c index 43884ebd4303..633532a2e7ec 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c | |||
@@ -192,13 +192,6 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd, | |||
192 | goto kfd_topology_add_device_error; | 192 | goto kfd_topology_add_device_error; |
193 | } | 193 | } |
194 | 194 | ||
195 | if (kfd_interrupt_init(kfd)) { | ||
196 | dev_err(kfd_device, | ||
197 | "Error initializing interrupts for device (%x:%x)\n", | ||
198 | kfd->pdev->vendor, kfd->pdev->device); | ||
199 | goto kfd_interrupt_error; | ||
200 | } | ||
201 | |||
202 | if (!device_iommu_pasid_init(kfd)) { | 195 | if (!device_iommu_pasid_init(kfd)) { |
203 | dev_err(kfd_device, | 196 | dev_err(kfd_device, |
204 | "Error initializing iommuv2 for device (%x:%x)\n", | 197 | "Error initializing iommuv2 for device (%x:%x)\n", |
@@ -237,8 +230,6 @@ dqm_start_error: | |||
237 | device_queue_manager_error: | 230 | device_queue_manager_error: |
238 | amd_iommu_free_device(kfd->pdev); | 231 | amd_iommu_free_device(kfd->pdev); |
239 | device_iommu_pasid_error: | 232 | device_iommu_pasid_error: |
240 | kfd_interrupt_exit(kfd); | ||
241 | kfd_interrupt_error: | ||
242 | kfd_topology_remove_device(kfd); | 233 | kfd_topology_remove_device(kfd); |
243 | kfd_topology_add_device_error: | 234 | kfd_topology_add_device_error: |
244 | kfd2kgd->fini_sa_manager(kfd->kgd); | 235 | kfd2kgd->fini_sa_manager(kfd->kgd); |
@@ -254,7 +245,6 @@ void kgd2kfd_device_exit(struct kfd_dev *kfd) | |||
254 | if (kfd->init_complete) { | 245 | if (kfd->init_complete) { |
255 | device_queue_manager_uninit(kfd->dqm); | 246 | device_queue_manager_uninit(kfd->dqm); |
256 | amd_iommu_free_device(kfd->pdev); | 247 | amd_iommu_free_device(kfd->pdev); |
257 | kfd_interrupt_exit(kfd); | ||
258 | kfd_topology_remove_device(kfd); | 248 | kfd_topology_remove_device(kfd); |
259 | } | 249 | } |
260 | 250 | ||
@@ -296,13 +286,5 @@ int kgd2kfd_resume(struct kfd_dev *kfd) | |||
296 | /* This is called directly from KGD at ISR. */ | 286 | /* This is called directly from KGD at ISR. */ |
297 | void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry) | 287 | void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry) |
298 | { | 288 | { |
299 | if (kfd->init_complete) { | 289 | /* Process interrupts / schedule work as necessary */ |
300 | spin_lock(&kfd->interrupt_lock); | ||
301 | |||
302 | if (kfd->interrupts_active | ||
303 | && enqueue_ih_ring_entry(kfd, ih_ring_entry)) | ||
304 | schedule_work(&kfd->interrupt_work); | ||
305 | |||
306 | spin_unlock(&kfd->interrupt_lock); | ||
307 | } | ||
308 | } | 290 | } |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 9c8961d22360..30c8fda9622e 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | |||
@@ -280,7 +280,7 @@ static int create_compute_queue_nocpsch(struct device_queue_manager *dqm, | |||
280 | q->queue); | 280 | q->queue); |
281 | 281 | ||
282 | retval = mqd->load_mqd(mqd, q->mqd, q->pipe, | 282 | retval = mqd->load_mqd(mqd, q->mqd, q->pipe, |
283 | q->queue, q->properties.write_ptr); | 283 | q->queue, (uint32_t __user *) q->properties.write_ptr); |
284 | if (retval != 0) { | 284 | if (retval != 0) { |
285 | deallocate_hqd(dqm, q); | 285 | deallocate_hqd(dqm, q); |
286 | mqd->uninit_mqd(mqd, q->mqd, q->mqd_mem_obj); | 286 | mqd->uninit_mqd(mqd, q->mqd, q->mqd_mem_obj); |
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c b/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c deleted file mode 100644 index 5b999095a1f7..000000000000 --- a/drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c +++ /dev/null | |||
@@ -1,176 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2014 Advanced Micro Devices, Inc. | ||
3 | * | ||
4 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
5 | * copy of this software and associated documentation files (the "Software"), | ||
6 | * to deal in the Software without restriction, including without limitation | ||
7 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
8 | * and/or sell copies of the Software, and to permit persons to whom the | ||
9 | * Software is furnished to do so, subject to the following conditions: | ||
10 | * | ||
11 | * The above copyright notice and this permission notice shall be included in | ||
12 | * all copies or substantial portions of the Software. | ||
13 | * | ||
14 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
15 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
16 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
17 | * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
18 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
19 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
20 | * OTHER DEALINGS IN THE SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | /* | ||
24 | * KFD Interrupts. | ||
25 | * | ||
26 | * AMD GPUs deliver interrupts by pushing an interrupt description onto the | ||
27 | * interrupt ring and then sending an interrupt. KGD receives the interrupt | ||
28 | * in ISR and sends us a pointer to each new entry on the interrupt ring. | ||
29 | * | ||
30 | * We generally can't process interrupt-signaled events from ISR, so we call | ||
31 | * out to each interrupt client module (currently only the scheduler) to ask if | ||
32 | * each interrupt is interesting. If they return true, then it requires further | ||
33 | * processing so we copy it to an internal interrupt ring and call each | ||
34 | * interrupt client again from a work-queue. | ||
35 | * | ||
36 | * There's no acknowledgment for the interrupts we use. The hardware simply | ||
37 | * queues a new interrupt each time without waiting. | ||
38 | * | ||
39 | * The fixed-size internal queue means that it's possible for us to lose | ||
40 | * interrupts because we have no back-pressure to the hardware. | ||
41 | */ | ||
42 | |||
43 | #include <linux/slab.h> | ||
44 | #include <linux/device.h> | ||
45 | #include "kfd_priv.h" | ||
46 | |||
47 | #define KFD_INTERRUPT_RING_SIZE 256 | ||
48 | |||
49 | static void interrupt_wq(struct work_struct *); | ||
50 | |||
51 | int kfd_interrupt_init(struct kfd_dev *kfd) | ||
52 | { | ||
53 | void *interrupt_ring = kmalloc_array(KFD_INTERRUPT_RING_SIZE, | ||
54 | kfd->device_info->ih_ring_entry_size, | ||
55 | GFP_KERNEL); | ||
56 | if (!interrupt_ring) | ||
57 | return -ENOMEM; | ||
58 | |||
59 | kfd->interrupt_ring = interrupt_ring; | ||
60 | kfd->interrupt_ring_size = | ||
61 | KFD_INTERRUPT_RING_SIZE * kfd->device_info->ih_ring_entry_size; | ||
62 | atomic_set(&kfd->interrupt_ring_wptr, 0); | ||
63 | atomic_set(&kfd->interrupt_ring_rptr, 0); | ||
64 | |||
65 | spin_lock_init(&kfd->interrupt_lock); | ||
66 | |||
67 | INIT_WORK(&kfd->interrupt_work, interrupt_wq); | ||
68 | |||
69 | kfd->interrupts_active = true; | ||
70 | |||
71 | /* | ||
72 | * After this function returns, the interrupt will be enabled. This | ||
73 | * barrier ensures that the interrupt running on a different processor | ||
74 | * sees all the above writes. | ||
75 | */ | ||
76 | smp_wmb(); | ||
77 | |||
78 | return 0; | ||
79 | } | ||
80 | |||
81 | void kfd_interrupt_exit(struct kfd_dev *kfd) | ||
82 | { | ||
83 | /* | ||
84 | * Stop the interrupt handler from writing to the ring and scheduling | ||
85 | * workqueue items. The spinlock ensures that any interrupt running | ||
86 | * after we have unlocked sees interrupts_active = false. | ||
87 | */ | ||
88 | unsigned long flags; | ||
89 | |||
90 | spin_lock_irqsave(&kfd->interrupt_lock, flags); | ||
91 | kfd->interrupts_active = false; | ||
92 | spin_unlock_irqrestore(&kfd->interrupt_lock, flags); | ||
93 | |||
94 | /* | ||
95 | * Flush_scheduled_work ensures that there are no outstanding | ||
96 | * work-queue items that will access interrupt_ring. New work items | ||
97 | * can't be created because we stopped interrupt handling above. | ||
98 | */ | ||
99 | flush_scheduled_work(); | ||
100 | |||
101 | kfree(kfd->interrupt_ring); | ||
102 | } | ||
103 | |||
104 | /* | ||
105 | * This assumes that it can't be called concurrently with itself | ||
106 | * but only with dequeue_ih_ring_entry. | ||
107 | */ | ||
108 | bool enqueue_ih_ring_entry(struct kfd_dev *kfd, const void *ih_ring_entry) | ||
109 | { | ||
110 | unsigned int rptr = atomic_read(&kfd->interrupt_ring_rptr); | ||
111 | unsigned int wptr = atomic_read(&kfd->interrupt_ring_wptr); | ||
112 | |||
113 | if ((rptr - wptr) % kfd->interrupt_ring_size == | ||
114 | kfd->device_info->ih_ring_entry_size) { | ||
115 | /* This is very bad, the system is likely to hang. */ | ||
116 | dev_err_ratelimited(kfd_chardev(), | ||
117 | "Interrupt ring overflow, dropping interrupt.\n"); | ||
118 | return false; | ||
119 | } | ||
120 | |||
121 | memcpy(kfd->interrupt_ring + wptr, ih_ring_entry, | ||
122 | kfd->device_info->ih_ring_entry_size); | ||
123 | |||
124 | wptr = (wptr + kfd->device_info->ih_ring_entry_size) % | ||
125 | kfd->interrupt_ring_size; | ||
126 | smp_wmb(); /* Ensure memcpy'd data is visible before wptr update. */ | ||
127 | atomic_set(&kfd->interrupt_ring_wptr, wptr); | ||
128 | |||
129 | return true; | ||
130 | } | ||
131 | |||
132 | /* | ||
133 | * This assumes that it can't be called concurrently with itself | ||
134 | * but only with enqueue_ih_ring_entry. | ||
135 | */ | ||
136 | static bool dequeue_ih_ring_entry(struct kfd_dev *kfd, void *ih_ring_entry) | ||
137 | { | ||
138 | /* | ||
139 | * Assume that wait queues have an implicit barrier, i.e. anything that | ||
140 | * happened in the ISR before it queued work is visible. | ||
141 | */ | ||
142 | |||
143 | unsigned int wptr = atomic_read(&kfd->interrupt_ring_wptr); | ||
144 | unsigned int rptr = atomic_read(&kfd->interrupt_ring_rptr); | ||
145 | |||
146 | if (rptr == wptr) | ||
147 | return false; | ||
148 | |||
149 | memcpy(ih_ring_entry, kfd->interrupt_ring + rptr, | ||
150 | kfd->device_info->ih_ring_entry_size); | ||
151 | |||
152 | rptr = (rptr + kfd->device_info->ih_ring_entry_size) % | ||
153 | kfd->interrupt_ring_size; | ||
154 | |||
155 | /* | ||
156 | * Ensure the rptr write update is not visible until | ||
157 | * memcpy has finished reading. | ||
158 | */ | ||
159 | smp_mb(); | ||
160 | atomic_set(&kfd->interrupt_ring_rptr, rptr); | ||
161 | |||
162 | return true; | ||
163 | } | ||
164 | |||
165 | static void interrupt_wq(struct work_struct *work) | ||
166 | { | ||
167 | struct kfd_dev *dev = container_of(work, struct kfd_dev, | ||
168 | interrupt_work); | ||
169 | |||
170 | uint32_t ih_ring_entry[DIV_ROUND_UP( | ||
171 | dev->device_info->ih_ring_entry_size, | ||
172 | sizeof(uint32_t))]; | ||
173 | |||
174 | while (dequeue_ih_ring_entry(dev, ih_ring_entry)) | ||
175 | ; | ||
176 | } | ||
diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h index a5edb29507e3..b3dc13c83169 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h | |||
@@ -135,22 +135,10 @@ struct kfd_dev { | |||
135 | 135 | ||
136 | struct kgd2kfd_shared_resources shared_resources; | 136 | struct kgd2kfd_shared_resources shared_resources; |
137 | 137 | ||
138 | void *interrupt_ring; | ||
139 | size_t interrupt_ring_size; | ||
140 | atomic_t interrupt_ring_rptr; | ||
141 | atomic_t interrupt_ring_wptr; | ||
142 | struct work_struct interrupt_work; | ||
143 | spinlock_t interrupt_lock; | ||
144 | |||
145 | /* QCM Device instance */ | 138 | /* QCM Device instance */ |
146 | struct device_queue_manager *dqm; | 139 | struct device_queue_manager *dqm; |
147 | 140 | ||
148 | bool init_complete; | 141 | bool init_complete; |
149 | /* | ||
150 | * Interrupts of interest to KFD are copied | ||
151 | * from the HW ring into a SW ring. | ||
152 | */ | ||
153 | bool interrupts_active; | ||
154 | }; | 142 | }; |
155 | 143 | ||
156 | /* KGD2KFD callbacks */ | 144 | /* KGD2KFD callbacks */ |
@@ -531,10 +519,7 @@ struct kfd_dev *kfd_device_by_pci_dev(const struct pci_dev *pdev); | |||
531 | struct kfd_dev *kfd_topology_enum_kfd_devices(uint8_t idx); | 519 | struct kfd_dev *kfd_topology_enum_kfd_devices(uint8_t idx); |
532 | 520 | ||
533 | /* Interrupts */ | 521 | /* Interrupts */ |
534 | int kfd_interrupt_init(struct kfd_dev *dev); | ||
535 | void kfd_interrupt_exit(struct kfd_dev *dev); | ||
536 | void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry); | 522 | void kgd2kfd_interrupt(struct kfd_dev *kfd, const void *ih_ring_entry); |
537 | bool enqueue_ih_ring_entry(struct kfd_dev *kfd, const void *ih_ring_entry); | ||
538 | 523 | ||
539 | /* Power Management */ | 524 | /* Power Management */ |
540 | void kgd2kfd_suspend(struct kfd_dev *kfd); | 525 | void kgd2kfd_suspend(struct kfd_dev *kfd); |
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 52ce26d6b4fb..cf775a4449c1 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
@@ -741,7 +741,9 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) | |||
741 | int i, j, rc = 0; | 741 | int i, j, rc = 0; |
742 | int start; | 742 | int start; |
743 | 743 | ||
744 | drm_modeset_lock_all(dev); | 744 | if (__drm_modeset_lock_all(dev, !!oops_in_progress)) { |
745 | return -EBUSY; | ||
746 | } | ||
745 | if (!drm_fb_helper_is_bound(fb_helper)) { | 747 | if (!drm_fb_helper_is_bound(fb_helper)) { |
746 | drm_modeset_unlock_all(dev); | 748 | drm_modeset_unlock_all(dev); |
747 | return -EBUSY; | 749 | return -EBUSY; |
@@ -915,7 +917,9 @@ int drm_fb_helper_pan_display(struct fb_var_screeninfo *var, | |||
915 | int ret = 0; | 917 | int ret = 0; |
916 | int i; | 918 | int i; |
917 | 919 | ||
918 | drm_modeset_lock_all(dev); | 920 | if (__drm_modeset_lock_all(dev, !!oops_in_progress)) { |
921 | return -EBUSY; | ||
922 | } | ||
919 | if (!drm_fb_helper_is_bound(fb_helper)) { | 923 | if (!drm_fb_helper_is_bound(fb_helper)) { |
920 | drm_modeset_unlock_all(dev); | 924 | drm_modeset_unlock_all(dev); |
921 | return -EBUSY; | 925 | return -EBUSY; |
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 121470a83d1a..1bcbe07cecfc 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c | |||
@@ -645,18 +645,6 @@ static int exynos_drm_init(void) | |||
645 | if (!is_exynos) | 645 | if (!is_exynos) |
646 | return -ENODEV; | 646 | return -ENODEV; |
647 | 647 | ||
648 | /* | ||
649 | * Register device object only in case of Exynos SoC. | ||
650 | * | ||
651 | * Below codes resolves temporarily infinite loop issue incurred | ||
652 | * by Exynos drm driver when using multi-platform kernel. | ||
653 | * So these codes will be replaced with more generic way later. | ||
654 | */ | ||
655 | if (!of_machine_is_compatible("samsung,exynos3") && | ||
656 | !of_machine_is_compatible("samsung,exynos4") && | ||
657 | !of_machine_is_compatible("samsung,exynos5")) | ||
658 | return -ENODEV; | ||
659 | |||
660 | exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, | 648 | exynos_drm_pdev = platform_device_register_simple("exynos-drm", -1, |
661 | NULL, 0); | 649 | NULL, 0); |
662 | if (IS_ERR(exynos_drm_pdev)) | 650 | if (IS_ERR(exynos_drm_pdev)) |
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c index 5765a161abdd..98051e8e855a 100644 --- a/drivers/gpu/drm/exynos/exynos_hdmi.c +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c | |||
@@ -1669,7 +1669,6 @@ static void hdmi_mode_apply(struct hdmi_context *hdata) | |||
1669 | 1669 | ||
1670 | static void hdmiphy_conf_reset(struct hdmi_context *hdata) | 1670 | static void hdmiphy_conf_reset(struct hdmi_context *hdata) |
1671 | { | 1671 | { |
1672 | u8 buffer[2]; | ||
1673 | u32 reg; | 1672 | u32 reg; |
1674 | 1673 | ||
1675 | clk_disable_unprepare(hdata->res.sclk_hdmi); | 1674 | clk_disable_unprepare(hdata->res.sclk_hdmi); |
@@ -1677,11 +1676,8 @@ static void hdmiphy_conf_reset(struct hdmi_context *hdata) | |||
1677 | clk_prepare_enable(hdata->res.sclk_hdmi); | 1676 | clk_prepare_enable(hdata->res.sclk_hdmi); |
1678 | 1677 | ||
1679 | /* operation mode */ | 1678 | /* operation mode */ |
1680 | buffer[0] = 0x1f; | 1679 | hdmiphy_reg_writeb(hdata, HDMIPHY_MODE_SET_DONE, |
1681 | buffer[1] = 0x00; | 1680 | HDMI_PHY_ENABLE_MODE_SET); |
1682 | |||
1683 | if (hdata->hdmiphy_port) | ||
1684 | i2c_master_send(hdata->hdmiphy_port, buffer, 2); | ||
1685 | 1681 | ||
1686 | if (hdata->type == HDMI_TYPE13) | 1682 | if (hdata->type == HDMI_TYPE13) |
1687 | reg = HDMI_V13_PHY_RSTOUT; | 1683 | reg = HDMI_V13_PHY_RSTOUT; |
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 820b76234ef4..064ed6597def 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c | |||
@@ -1026,6 +1026,7 @@ static void mixer_win_disable(struct exynos_drm_manager *mgr, int zpos) | |||
1026 | static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr) | 1026 | static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr) |
1027 | { | 1027 | { |
1028 | struct mixer_context *mixer_ctx = mgr_to_mixer(mgr); | 1028 | struct mixer_context *mixer_ctx = mgr_to_mixer(mgr); |
1029 | int err; | ||
1029 | 1030 | ||
1030 | mutex_lock(&mixer_ctx->mixer_mutex); | 1031 | mutex_lock(&mixer_ctx->mixer_mutex); |
1031 | if (!mixer_ctx->powered) { | 1032 | if (!mixer_ctx->powered) { |
@@ -1034,7 +1035,11 @@ static void mixer_wait_for_vblank(struct exynos_drm_manager *mgr) | |||
1034 | } | 1035 | } |
1035 | mutex_unlock(&mixer_ctx->mixer_mutex); | 1036 | mutex_unlock(&mixer_ctx->mixer_mutex); |
1036 | 1037 | ||
1037 | drm_vblank_get(mgr->crtc->dev, mixer_ctx->pipe); | 1038 | err = drm_vblank_get(mgr->crtc->dev, mixer_ctx->pipe); |
1039 | if (err < 0) { | ||
1040 | DRM_DEBUG_KMS("failed to acquire vblank counter\n"); | ||
1041 | return; | ||
1042 | } | ||
1038 | 1043 | ||
1039 | atomic_set(&mixer_ctx->wait_vsync_event, 1); | 1044 | atomic_set(&mixer_ctx->wait_vsync_event, 1); |
1040 | 1045 | ||
@@ -1262,8 +1267,6 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) | |||
1262 | return ret; | 1267 | return ret; |
1263 | } | 1268 | } |
1264 | 1269 | ||
1265 | pm_runtime_enable(dev); | ||
1266 | |||
1267 | return 0; | 1270 | return 0; |
1268 | } | 1271 | } |
1269 | 1272 | ||
@@ -1272,8 +1275,6 @@ static void mixer_unbind(struct device *dev, struct device *master, void *data) | |||
1272 | struct mixer_context *ctx = dev_get_drvdata(dev); | 1275 | struct mixer_context *ctx = dev_get_drvdata(dev); |
1273 | 1276 | ||
1274 | mixer_mgr_remove(&ctx->manager); | 1277 | mixer_mgr_remove(&ctx->manager); |
1275 | |||
1276 | pm_runtime_disable(dev); | ||
1277 | } | 1278 | } |
1278 | 1279 | ||
1279 | static const struct component_ops mixer_component_ops = { | 1280 | static const struct component_ops mixer_component_ops = { |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c11603b4cf1d..76354d3ba925 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -5155,7 +5155,7 @@ static bool mutex_is_locked_by(struct mutex *mutex, struct task_struct *task) | |||
5155 | if (!mutex_is_locked(mutex)) | 5155 | if (!mutex_is_locked(mutex)) |
5156 | return false; | 5156 | return false; |
5157 | 5157 | ||
5158 | #if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_MUTEXES) | 5158 | #if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) |
5159 | return mutex->owner == task; | 5159 | return mutex->owner == task; |
5160 | #else | 5160 | #else |
5161 | /* Since UP may be pre-empted, we cannot assume that we own the lock */ | 5161 | /* Since UP may be pre-empted, we cannot assume that we own the lock */ |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index d0d3dfbe6d2a..b051a238baf9 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -292,6 +292,23 @@ void gen6_enable_rps_interrupts(struct drm_device *dev) | |||
292 | spin_unlock_irq(&dev_priv->irq_lock); | 292 | spin_unlock_irq(&dev_priv->irq_lock); |
293 | } | 293 | } |
294 | 294 | ||
295 | u32 gen6_sanitize_rps_pm_mask(struct drm_i915_private *dev_priv, u32 mask) | ||
296 | { | ||
297 | /* | ||
298 | * SNB,IVB can while VLV,CHV may hard hang on looping batchbuffer | ||
299 | * if GEN6_PM_UP_EI_EXPIRED is masked. | ||
300 | * | ||
301 | * TODO: verify if this can be reproduced on VLV,CHV. | ||
302 | */ | ||
303 | if (INTEL_INFO(dev_priv)->gen <= 7 && !IS_HASWELL(dev_priv)) | ||
304 | mask &= ~GEN6_PM_RP_UP_EI_EXPIRED; | ||
305 | |||
306 | if (INTEL_INFO(dev_priv)->gen >= 8) | ||
307 | mask &= ~GEN8_PMINTR_REDIRECT_TO_NON_DISP; | ||
308 | |||
309 | return mask; | ||
310 | } | ||
311 | |||
295 | void gen6_disable_rps_interrupts(struct drm_device *dev) | 312 | void gen6_disable_rps_interrupts(struct drm_device *dev) |
296 | { | 313 | { |
297 | struct drm_i915_private *dev_priv = dev->dev_private; | 314 | struct drm_i915_private *dev_priv = dev->dev_private; |
@@ -304,8 +321,7 @@ void gen6_disable_rps_interrupts(struct drm_device *dev) | |||
304 | 321 | ||
305 | spin_lock_irq(&dev_priv->irq_lock); | 322 | spin_lock_irq(&dev_priv->irq_lock); |
306 | 323 | ||
307 | I915_WRITE(GEN6_PMINTRMSK, INTEL_INFO(dev_priv)->gen >= 8 ? | 324 | I915_WRITE(GEN6_PMINTRMSK, gen6_sanitize_rps_pm_mask(dev_priv, ~0)); |
308 | ~GEN8_PMINTR_REDIRECT_TO_NON_DISP : ~0); | ||
309 | 325 | ||
310 | __gen6_disable_pm_irq(dev_priv, dev_priv->pm_rps_events); | 326 | __gen6_disable_pm_irq(dev_priv, dev_priv->pm_rps_events); |
311 | I915_WRITE(gen6_pm_ier(dev_priv), I915_READ(gen6_pm_ier(dev_priv)) & | 327 | I915_WRITE(gen6_pm_ier(dev_priv), I915_READ(gen6_pm_ier(dev_priv)) & |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e2af1383b179..e7a16f119a29 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -9815,7 +9815,7 @@ static int intel_crtc_page_flip(struct drm_crtc *crtc, | |||
9815 | if (obj->tiling_mode != work->old_fb_obj->tiling_mode) | 9815 | if (obj->tiling_mode != work->old_fb_obj->tiling_mode) |
9816 | /* vlv: DISPLAY_FLIP fails to change tiling */ | 9816 | /* vlv: DISPLAY_FLIP fails to change tiling */ |
9817 | ring = NULL; | 9817 | ring = NULL; |
9818 | } else if (IS_IVYBRIDGE(dev)) { | 9818 | } else if (IS_IVYBRIDGE(dev) || IS_HASWELL(dev)) { |
9819 | ring = &dev_priv->ring[BCS]; | 9819 | ring = &dev_priv->ring[BCS]; |
9820 | } else if (INTEL_INFO(dev)->gen >= 7) { | 9820 | } else if (INTEL_INFO(dev)->gen >= 7) { |
9821 | ring = obj->ring; | 9821 | ring = obj->ring; |
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 25fdbb16d4e0..3b40a17b8852 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h | |||
@@ -794,6 +794,7 @@ void gen6_disable_pm_irq(struct drm_i915_private *dev_priv, uint32_t mask); | |||
794 | void gen6_reset_rps_interrupts(struct drm_device *dev); | 794 | void gen6_reset_rps_interrupts(struct drm_device *dev); |
795 | void gen6_enable_rps_interrupts(struct drm_device *dev); | 795 | void gen6_enable_rps_interrupts(struct drm_device *dev); |
796 | void gen6_disable_rps_interrupts(struct drm_device *dev); | 796 | void gen6_disable_rps_interrupts(struct drm_device *dev); |
797 | u32 gen6_sanitize_rps_pm_mask(struct drm_i915_private *dev_priv, u32 mask); | ||
797 | void intel_runtime_pm_disable_interrupts(struct drm_i915_private *dev_priv); | 798 | void intel_runtime_pm_disable_interrupts(struct drm_i915_private *dev_priv); |
798 | void intel_runtime_pm_enable_interrupts(struct drm_i915_private *dev_priv); | 799 | void intel_runtime_pm_enable_interrupts(struct drm_i915_private *dev_priv); |
799 | static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv) | 800 | static inline bool intel_irqs_enabled(struct drm_i915_private *dev_priv) |
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c index 964b28e3c630..bf814a64582a 100644 --- a/drivers/gpu/drm/i915/intel_pm.c +++ b/drivers/gpu/drm/i915/intel_pm.c | |||
@@ -4363,16 +4363,7 @@ static u32 gen6_rps_pm_mask(struct drm_i915_private *dev_priv, u8 val) | |||
4363 | mask |= dev_priv->pm_rps_events & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED); | 4363 | mask |= dev_priv->pm_rps_events & (GEN6_PM_RP_DOWN_EI_EXPIRED | GEN6_PM_RP_UP_EI_EXPIRED); |
4364 | mask &= dev_priv->pm_rps_events; | 4364 | mask &= dev_priv->pm_rps_events; |
4365 | 4365 | ||
4366 | /* IVB and SNB hard hangs on looping batchbuffer | 4366 | return gen6_sanitize_rps_pm_mask(dev_priv, ~mask); |
4367 | * if GEN6_PM_UP_EI_EXPIRED is masked. | ||
4368 | */ | ||
4369 | if (INTEL_INFO(dev_priv->dev)->gen <= 7 && !IS_HASWELL(dev_priv->dev)) | ||
4370 | mask |= GEN6_PM_RP_UP_EI_EXPIRED; | ||
4371 | |||
4372 | if (IS_GEN8(dev_priv->dev)) | ||
4373 | mask |= GEN8_PMINTR_REDIRECT_TO_NON_DISP; | ||
4374 | |||
4375 | return ~mask; | ||
4376 | } | 4367 | } |
4377 | 4368 | ||
4378 | /* gen6_set_rps is called to update the frequency request, but should also be | 4369 | /* gen6_set_rps is called to update the frequency request, but should also be |
@@ -4441,7 +4432,8 @@ static void vlv_set_rps_idle(struct drm_i915_private *dev_priv) | |||
4441 | return; | 4432 | return; |
4442 | 4433 | ||
4443 | /* Mask turbo interrupt so that they will not come in between */ | 4434 | /* Mask turbo interrupt so that they will not come in between */ |
4444 | I915_WRITE(GEN6_PMINTRMSK, 0xffffffff); | 4435 | I915_WRITE(GEN6_PMINTRMSK, |
4436 | gen6_sanitize_rps_pm_mask(dev_priv, ~0)); | ||
4445 | 4437 | ||
4446 | vlv_force_gfx_clock(dev_priv, true); | 4438 | vlv_force_gfx_clock(dev_priv, true); |
4447 | 4439 | ||
diff --git a/drivers/gpu/drm/radeon/cik.c b/drivers/gpu/drm/radeon/cik.c index 6dcde3798b45..64fdae558d36 100644 --- a/drivers/gpu/drm/radeon/cik.c +++ b/drivers/gpu/drm/radeon/cik.c | |||
@@ -6033,6 +6033,17 @@ void cik_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
6033 | radeon_ring_write(ring, 0); | 6033 | radeon_ring_write(ring, 0); |
6034 | radeon_ring_write(ring, 1 << vm_id); | 6034 | radeon_ring_write(ring, 1 << vm_id); |
6035 | 6035 | ||
6036 | /* wait for the invalidate to complete */ | ||
6037 | radeon_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5)); | ||
6038 | radeon_ring_write(ring, (WAIT_REG_MEM_OPERATION(0) | /* wait */ | ||
6039 | WAIT_REG_MEM_FUNCTION(0) | /* always */ | ||
6040 | WAIT_REG_MEM_ENGINE(0))); /* me */ | ||
6041 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | ||
6042 | radeon_ring_write(ring, 0); | ||
6043 | radeon_ring_write(ring, 0); /* ref */ | ||
6044 | radeon_ring_write(ring, 0); /* mask */ | ||
6045 | radeon_ring_write(ring, 0x20); /* poll interval */ | ||
6046 | |||
6036 | /* compute doesn't have PFP */ | 6047 | /* compute doesn't have PFP */ |
6037 | if (usepfp) { | 6048 | if (usepfp) { |
6038 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ | 6049 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ |
diff --git a/drivers/gpu/drm/radeon/cik_sdma.c b/drivers/gpu/drm/radeon/cik_sdma.c index dde5c7e29eb2..a0133c74f4cf 100644 --- a/drivers/gpu/drm/radeon/cik_sdma.c +++ b/drivers/gpu/drm/radeon/cik_sdma.c | |||
@@ -903,6 +903,9 @@ void cik_sdma_vm_pad_ib(struct radeon_ib *ib) | |||
903 | void cik_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | 903 | void cik_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, |
904 | unsigned vm_id, uint64_t pd_addr) | 904 | unsigned vm_id, uint64_t pd_addr) |
905 | { | 905 | { |
906 | u32 extra_bits = (SDMA_POLL_REG_MEM_EXTRA_OP(0) | | ||
907 | SDMA_POLL_REG_MEM_EXTRA_FUNC(0)); /* always */ | ||
908 | |||
906 | radeon_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_SRBM_WRITE, 0, 0xf000)); | 909 | radeon_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_SRBM_WRITE, 0, 0xf000)); |
907 | if (vm_id < 8) { | 910 | if (vm_id < 8) { |
908 | radeon_ring_write(ring, (VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm_id << 2)) >> 2); | 911 | radeon_ring_write(ring, (VM_CONTEXT0_PAGE_TABLE_BASE_ADDR + (vm_id << 2)) >> 2); |
@@ -943,5 +946,12 @@ void cik_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
943 | radeon_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_SRBM_WRITE, 0, 0xf000)); | 946 | radeon_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_SRBM_WRITE, 0, 0xf000)); |
944 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | 947 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); |
945 | radeon_ring_write(ring, 1 << vm_id); | 948 | radeon_ring_write(ring, 1 << vm_id); |
949 | |||
950 | radeon_ring_write(ring, SDMA_PACKET(SDMA_OPCODE_POLL_REG_MEM, 0, extra_bits)); | ||
951 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | ||
952 | radeon_ring_write(ring, 0); | ||
953 | radeon_ring_write(ring, 0); /* reference */ | ||
954 | radeon_ring_write(ring, 0); /* mask */ | ||
955 | radeon_ring_write(ring, (0xfff << 16) | 10); /* retry count, poll interval */ | ||
946 | } | 956 | } |
947 | 957 | ||
diff --git a/drivers/gpu/drm/radeon/ni.c b/drivers/gpu/drm/radeon/ni.c index 360de9f1f491..aea48c89b241 100644 --- a/drivers/gpu/drm/radeon/ni.c +++ b/drivers/gpu/drm/radeon/ni.c | |||
@@ -2516,6 +2516,16 @@ void cayman_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
2516 | radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0)); | 2516 | radeon_ring_write(ring, PACKET0(VM_INVALIDATE_REQUEST, 0)); |
2517 | radeon_ring_write(ring, 1 << vm_id); | 2517 | radeon_ring_write(ring, 1 << vm_id); |
2518 | 2518 | ||
2519 | /* wait for the invalidate to complete */ | ||
2520 | radeon_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5)); | ||
2521 | radeon_ring_write(ring, (WAIT_REG_MEM_FUNCTION(0) | /* always */ | ||
2522 | WAIT_REG_MEM_ENGINE(0))); /* me */ | ||
2523 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | ||
2524 | radeon_ring_write(ring, 0); | ||
2525 | radeon_ring_write(ring, 0); /* ref */ | ||
2526 | radeon_ring_write(ring, 0); /* mask */ | ||
2527 | radeon_ring_write(ring, 0x20); /* poll interval */ | ||
2528 | |||
2519 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ | 2529 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ |
2520 | radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); | 2530 | radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); |
2521 | radeon_ring_write(ring, 0x0); | 2531 | radeon_ring_write(ring, 0x0); |
diff --git a/drivers/gpu/drm/radeon/ni_dma.c b/drivers/gpu/drm/radeon/ni_dma.c index 50f88611ff60..4be2bb7cbef3 100644 --- a/drivers/gpu/drm/radeon/ni_dma.c +++ b/drivers/gpu/drm/radeon/ni_dma.c | |||
@@ -463,5 +463,11 @@ void cayman_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
463 | radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0)); | 463 | radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0)); |
464 | radeon_ring_write(ring, (0xf << 16) | (VM_INVALIDATE_REQUEST >> 2)); | 464 | radeon_ring_write(ring, (0xf << 16) | (VM_INVALIDATE_REQUEST >> 2)); |
465 | radeon_ring_write(ring, 1 << vm_id); | 465 | radeon_ring_write(ring, 1 << vm_id); |
466 | |||
467 | /* wait for invalidate to complete */ | ||
468 | radeon_ring_write(ring, DMA_SRBM_READ_PACKET); | ||
469 | radeon_ring_write(ring, (0xff << 20) | (VM_INVALIDATE_REQUEST >> 2)); | ||
470 | radeon_ring_write(ring, 0); /* mask */ | ||
471 | radeon_ring_write(ring, 0); /* value */ | ||
466 | } | 472 | } |
467 | 473 | ||
diff --git a/drivers/gpu/drm/radeon/nid.h b/drivers/gpu/drm/radeon/nid.h index 2e12e4d69253..ad7125486894 100644 --- a/drivers/gpu/drm/radeon/nid.h +++ b/drivers/gpu/drm/radeon/nid.h | |||
@@ -1133,6 +1133,23 @@ | |||
1133 | #define PACKET3_MEM_SEMAPHORE 0x39 | 1133 | #define PACKET3_MEM_SEMAPHORE 0x39 |
1134 | #define PACKET3_MPEG_INDEX 0x3A | 1134 | #define PACKET3_MPEG_INDEX 0x3A |
1135 | #define PACKET3_WAIT_REG_MEM 0x3C | 1135 | #define PACKET3_WAIT_REG_MEM 0x3C |
1136 | #define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) | ||
1137 | /* 0 - always | ||
1138 | * 1 - < | ||
1139 | * 2 - <= | ||
1140 | * 3 - == | ||
1141 | * 4 - != | ||
1142 | * 5 - >= | ||
1143 | * 6 - > | ||
1144 | */ | ||
1145 | #define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) | ||
1146 | /* 0 - reg | ||
1147 | * 1 - mem | ||
1148 | */ | ||
1149 | #define WAIT_REG_MEM_ENGINE(x) ((x) << 8) | ||
1150 | /* 0 - me | ||
1151 | * 1 - pfp | ||
1152 | */ | ||
1136 | #define PACKET3_MEM_WRITE 0x3D | 1153 | #define PACKET3_MEM_WRITE 0x3D |
1137 | #define PACKET3_PFP_SYNC_ME 0x42 | 1154 | #define PACKET3_PFP_SYNC_ME 0x42 |
1138 | #define PACKET3_SURFACE_SYNC 0x43 | 1155 | #define PACKET3_SURFACE_SYNC 0x43 |
@@ -1272,6 +1289,13 @@ | |||
1272 | (1 << 21) | \ | 1289 | (1 << 21) | \ |
1273 | (((n) & 0xFFFFF) << 0)) | 1290 | (((n) & 0xFFFFF) << 0)) |
1274 | 1291 | ||
1292 | #define DMA_SRBM_POLL_PACKET ((9 << 28) | \ | ||
1293 | (1 << 27) | \ | ||
1294 | (1 << 26)) | ||
1295 | |||
1296 | #define DMA_SRBM_READ_PACKET ((9 << 28) | \ | ||
1297 | (1 << 27)) | ||
1298 | |||
1275 | /* async DMA Packet types */ | 1299 | /* async DMA Packet types */ |
1276 | #define DMA_PACKET_WRITE 0x2 | 1300 | #define DMA_PACKET_WRITE 0x2 |
1277 | #define DMA_PACKET_COPY 0x3 | 1301 | #define DMA_PACKET_COPY 0x3 |
diff --git a/drivers/gpu/drm/radeon/radeon_asic.c b/drivers/gpu/drm/radeon/radeon_asic.c index 850de57069be..121aff6a3b41 100644 --- a/drivers/gpu/drm/radeon/radeon_asic.c +++ b/drivers/gpu/drm/radeon/radeon_asic.c | |||
@@ -333,6 +333,20 @@ static struct radeon_asic_ring r300_gfx_ring = { | |||
333 | .set_wptr = &r100_gfx_set_wptr, | 333 | .set_wptr = &r100_gfx_set_wptr, |
334 | }; | 334 | }; |
335 | 335 | ||
336 | static struct radeon_asic_ring rv515_gfx_ring = { | ||
337 | .ib_execute = &r100_ring_ib_execute, | ||
338 | .emit_fence = &r300_fence_ring_emit, | ||
339 | .emit_semaphore = &r100_semaphore_ring_emit, | ||
340 | .cs_parse = &r300_cs_parse, | ||
341 | .ring_start = &rv515_ring_start, | ||
342 | .ring_test = &r100_ring_test, | ||
343 | .ib_test = &r100_ib_test, | ||
344 | .is_lockup = &r100_gpu_is_lockup, | ||
345 | .get_rptr = &r100_gfx_get_rptr, | ||
346 | .get_wptr = &r100_gfx_get_wptr, | ||
347 | .set_wptr = &r100_gfx_set_wptr, | ||
348 | }; | ||
349 | |||
336 | static struct radeon_asic r300_asic = { | 350 | static struct radeon_asic r300_asic = { |
337 | .init = &r300_init, | 351 | .init = &r300_init, |
338 | .fini = &r300_fini, | 352 | .fini = &r300_fini, |
@@ -748,7 +762,7 @@ static struct radeon_asic rv515_asic = { | |||
748 | .set_page = &rv370_pcie_gart_set_page, | 762 | .set_page = &rv370_pcie_gart_set_page, |
749 | }, | 763 | }, |
750 | .ring = { | 764 | .ring = { |
751 | [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring | 765 | [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring |
752 | }, | 766 | }, |
753 | .irq = { | 767 | .irq = { |
754 | .set = &rs600_irq_set, | 768 | .set = &rs600_irq_set, |
@@ -814,7 +828,7 @@ static struct radeon_asic r520_asic = { | |||
814 | .set_page = &rv370_pcie_gart_set_page, | 828 | .set_page = &rv370_pcie_gart_set_page, |
815 | }, | 829 | }, |
816 | .ring = { | 830 | .ring = { |
817 | [RADEON_RING_TYPE_GFX_INDEX] = &r300_gfx_ring | 831 | [RADEON_RING_TYPE_GFX_INDEX] = &rv515_gfx_ring |
818 | }, | 832 | }, |
819 | .irq = { | 833 | .irq = { |
820 | .set = &rs600_irq_set, | 834 | .set = &rs600_irq_set, |
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c index a46f73737994..d0b4f7d1140d 100644 --- a/drivers/gpu/drm/radeon/radeon_gem.c +++ b/drivers/gpu/drm/radeon/radeon_gem.c | |||
@@ -576,7 +576,7 @@ error_unreserve: | |||
576 | error_free: | 576 | error_free: |
577 | drm_free_large(vm_bos); | 577 | drm_free_large(vm_bos); |
578 | 578 | ||
579 | if (r) | 579 | if (r && r != -ERESTARTSYS) |
580 | DRM_ERROR("Couldn't update BO_VA (%d)\n", r); | 580 | DRM_ERROR("Couldn't update BO_VA (%d)\n", r); |
581 | } | 581 | } |
582 | 582 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_pm.c b/drivers/gpu/drm/radeon/radeon_pm.c index 32522cc940a1..f7da8fe96a66 100644 --- a/drivers/gpu/drm/radeon/radeon_pm.c +++ b/drivers/gpu/drm/radeon/radeon_pm.c | |||
@@ -1287,8 +1287,39 @@ dpm_failed: | |||
1287 | return ret; | 1287 | return ret; |
1288 | } | 1288 | } |
1289 | 1289 | ||
1290 | struct radeon_dpm_quirk { | ||
1291 | u32 chip_vendor; | ||
1292 | u32 chip_device; | ||
1293 | u32 subsys_vendor; | ||
1294 | u32 subsys_device; | ||
1295 | }; | ||
1296 | |||
1297 | /* cards with dpm stability problems */ | ||
1298 | static struct radeon_dpm_quirk radeon_dpm_quirk_list[] = { | ||
1299 | /* TURKS - https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1386534 */ | ||
1300 | { PCI_VENDOR_ID_ATI, 0x6759, 0x1682, 0x3195 }, | ||
1301 | /* TURKS - https://bugzilla.kernel.org/show_bug.cgi?id=83731 */ | ||
1302 | { PCI_VENDOR_ID_ATI, 0x6840, 0x1179, 0xfb81 }, | ||
1303 | { 0, 0, 0, 0 }, | ||
1304 | }; | ||
1305 | |||
1290 | int radeon_pm_init(struct radeon_device *rdev) | 1306 | int radeon_pm_init(struct radeon_device *rdev) |
1291 | { | 1307 | { |
1308 | struct radeon_dpm_quirk *p = radeon_dpm_quirk_list; | ||
1309 | bool disable_dpm = false; | ||
1310 | |||
1311 | /* Apply dpm quirks */ | ||
1312 | while (p && p->chip_device != 0) { | ||
1313 | if (rdev->pdev->vendor == p->chip_vendor && | ||
1314 | rdev->pdev->device == p->chip_device && | ||
1315 | rdev->pdev->subsystem_vendor == p->subsys_vendor && | ||
1316 | rdev->pdev->subsystem_device == p->subsys_device) { | ||
1317 | disable_dpm = true; | ||
1318 | break; | ||
1319 | } | ||
1320 | ++p; | ||
1321 | } | ||
1322 | |||
1292 | /* enable dpm on rv6xx+ */ | 1323 | /* enable dpm on rv6xx+ */ |
1293 | switch (rdev->family) { | 1324 | switch (rdev->family) { |
1294 | case CHIP_RV610: | 1325 | case CHIP_RV610: |
@@ -1344,6 +1375,8 @@ int radeon_pm_init(struct radeon_device *rdev) | |||
1344 | (!(rdev->flags & RADEON_IS_IGP)) && | 1375 | (!(rdev->flags & RADEON_IS_IGP)) && |
1345 | (!rdev->smc_fw)) | 1376 | (!rdev->smc_fw)) |
1346 | rdev->pm.pm_method = PM_METHOD_PROFILE; | 1377 | rdev->pm.pm_method = PM_METHOD_PROFILE; |
1378 | else if (disable_dpm && (radeon_dpm == -1)) | ||
1379 | rdev->pm.pm_method = PM_METHOD_PROFILE; | ||
1347 | else if (radeon_dpm == 0) | 1380 | else if (radeon_dpm == 0) |
1348 | rdev->pm.pm_method = PM_METHOD_PROFILE; | 1381 | rdev->pm.pm_method = PM_METHOD_PROFILE; |
1349 | else | 1382 | else |
diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c index 60df444bd075..5d89b874a1a2 100644 --- a/drivers/gpu/drm/radeon/si.c +++ b/drivers/gpu/drm/radeon/si.c | |||
@@ -5057,6 +5057,16 @@ void si_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
5057 | radeon_ring_write(ring, 0); | 5057 | radeon_ring_write(ring, 0); |
5058 | radeon_ring_write(ring, 1 << vm_id); | 5058 | radeon_ring_write(ring, 1 << vm_id); |
5059 | 5059 | ||
5060 | /* wait for the invalidate to complete */ | ||
5061 | radeon_ring_write(ring, PACKET3(PACKET3_WAIT_REG_MEM, 5)); | ||
5062 | radeon_ring_write(ring, (WAIT_REG_MEM_FUNCTION(0) | /* always */ | ||
5063 | WAIT_REG_MEM_ENGINE(0))); /* me */ | ||
5064 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST >> 2); | ||
5065 | radeon_ring_write(ring, 0); | ||
5066 | radeon_ring_write(ring, 0); /* ref */ | ||
5067 | radeon_ring_write(ring, 0); /* mask */ | ||
5068 | radeon_ring_write(ring, 0x20); /* poll interval */ | ||
5069 | |||
5060 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ | 5070 | /* sync PFP to ME, otherwise we might get invalid PFP reads */ |
5061 | radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); | 5071 | radeon_ring_write(ring, PACKET3(PACKET3_PFP_SYNC_ME, 0)); |
5062 | radeon_ring_write(ring, 0x0); | 5072 | radeon_ring_write(ring, 0x0); |
diff --git a/drivers/gpu/drm/radeon/si_dma.c b/drivers/gpu/drm/radeon/si_dma.c index f5cc777e1c5f..aa7b872b2c43 100644 --- a/drivers/gpu/drm/radeon/si_dma.c +++ b/drivers/gpu/drm/radeon/si_dma.c | |||
@@ -206,6 +206,14 @@ void si_dma_vm_flush(struct radeon_device *rdev, struct radeon_ring *ring, | |||
206 | radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0, 0)); | 206 | radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_SRBM_WRITE, 0, 0, 0, 0)); |
207 | radeon_ring_write(ring, (0xf << 16) | (VM_INVALIDATE_REQUEST >> 2)); | 207 | radeon_ring_write(ring, (0xf << 16) | (VM_INVALIDATE_REQUEST >> 2)); |
208 | radeon_ring_write(ring, 1 << vm_id); | 208 | radeon_ring_write(ring, 1 << vm_id); |
209 | |||
210 | /* wait for invalidate to complete */ | ||
211 | radeon_ring_write(ring, DMA_PACKET(DMA_PACKET_POLL_REG_MEM, 0, 0, 0, 0)); | ||
212 | radeon_ring_write(ring, VM_INVALIDATE_REQUEST); | ||
213 | radeon_ring_write(ring, 0xff << 16); /* retry */ | ||
214 | radeon_ring_write(ring, 1 << vm_id); /* mask */ | ||
215 | radeon_ring_write(ring, 0); /* value */ | ||
216 | radeon_ring_write(ring, (0 << 28) | 0x20); /* func(always) | poll interval */ | ||
209 | } | 217 | } |
210 | 218 | ||
211 | /** | 219 | /** |
diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c index 32e354b8b0ab..eff8a6444956 100644 --- a/drivers/gpu/drm/radeon/si_dpm.c +++ b/drivers/gpu/drm/radeon/si_dpm.c | |||
@@ -2908,6 +2908,22 @@ static int si_init_smc_spll_table(struct radeon_device *rdev) | |||
2908 | return ret; | 2908 | return ret; |
2909 | } | 2909 | } |
2910 | 2910 | ||
2911 | struct si_dpm_quirk { | ||
2912 | u32 chip_vendor; | ||
2913 | u32 chip_device; | ||
2914 | u32 subsys_vendor; | ||
2915 | u32 subsys_device; | ||
2916 | u32 max_sclk; | ||
2917 | u32 max_mclk; | ||
2918 | }; | ||
2919 | |||
2920 | /* cards with dpm stability problems */ | ||
2921 | static struct si_dpm_quirk si_dpm_quirk_list[] = { | ||
2922 | /* PITCAIRN - https://bugs.freedesktop.org/show_bug.cgi?id=76490 */ | ||
2923 | { PCI_VENDOR_ID_ATI, 0x6810, 0x1462, 0x3036, 0, 120000 }, | ||
2924 | { 0, 0, 0, 0 }, | ||
2925 | }; | ||
2926 | |||
2911 | static void si_apply_state_adjust_rules(struct radeon_device *rdev, | 2927 | static void si_apply_state_adjust_rules(struct radeon_device *rdev, |
2912 | struct radeon_ps *rps) | 2928 | struct radeon_ps *rps) |
2913 | { | 2929 | { |
@@ -2918,7 +2934,22 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, | |||
2918 | u32 mclk, sclk; | 2934 | u32 mclk, sclk; |
2919 | u16 vddc, vddci; | 2935 | u16 vddc, vddci; |
2920 | u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc; | 2936 | u32 max_sclk_vddc, max_mclk_vddci, max_mclk_vddc; |
2937 | u32 max_sclk = 0, max_mclk = 0; | ||
2921 | int i; | 2938 | int i; |
2939 | struct si_dpm_quirk *p = si_dpm_quirk_list; | ||
2940 | |||
2941 | /* Apply dpm quirks */ | ||
2942 | while (p && p->chip_device != 0) { | ||
2943 | if (rdev->pdev->vendor == p->chip_vendor && | ||
2944 | rdev->pdev->device == p->chip_device && | ||
2945 | rdev->pdev->subsystem_vendor == p->subsys_vendor && | ||
2946 | rdev->pdev->subsystem_device == p->subsys_device) { | ||
2947 | max_sclk = p->max_sclk; | ||
2948 | max_mclk = p->max_mclk; | ||
2949 | break; | ||
2950 | } | ||
2951 | ++p; | ||
2952 | } | ||
2922 | 2953 | ||
2923 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || | 2954 | if ((rdev->pm.dpm.new_active_crtc_count > 1) || |
2924 | ni_dpm_vblank_too_short(rdev)) | 2955 | ni_dpm_vblank_too_short(rdev)) |
@@ -2972,6 +3003,14 @@ static void si_apply_state_adjust_rules(struct radeon_device *rdev, | |||
2972 | if (ps->performance_levels[i].mclk > max_mclk_vddc) | 3003 | if (ps->performance_levels[i].mclk > max_mclk_vddc) |
2973 | ps->performance_levels[i].mclk = max_mclk_vddc; | 3004 | ps->performance_levels[i].mclk = max_mclk_vddc; |
2974 | } | 3005 | } |
3006 | if (max_mclk) { | ||
3007 | if (ps->performance_levels[i].mclk > max_mclk) | ||
3008 | ps->performance_levels[i].mclk = max_mclk; | ||
3009 | } | ||
3010 | if (max_sclk) { | ||
3011 | if (ps->performance_levels[i].sclk > max_sclk) | ||
3012 | ps->performance_levels[i].sclk = max_sclk; | ||
3013 | } | ||
2975 | } | 3014 | } |
2976 | 3015 | ||
2977 | /* XXX validate the min clocks required for display */ | 3016 | /* XXX validate the min clocks required for display */ |
diff --git a/drivers/gpu/drm/radeon/sid.h b/drivers/gpu/drm/radeon/sid.h index 4069be89e585..84999242c747 100644 --- a/drivers/gpu/drm/radeon/sid.h +++ b/drivers/gpu/drm/radeon/sid.h | |||
@@ -1632,6 +1632,23 @@ | |||
1632 | #define PACKET3_MPEG_INDEX 0x3A | 1632 | #define PACKET3_MPEG_INDEX 0x3A |
1633 | #define PACKET3_COPY_DW 0x3B | 1633 | #define PACKET3_COPY_DW 0x3B |
1634 | #define PACKET3_WAIT_REG_MEM 0x3C | 1634 | #define PACKET3_WAIT_REG_MEM 0x3C |
1635 | #define WAIT_REG_MEM_FUNCTION(x) ((x) << 0) | ||
1636 | /* 0 - always | ||
1637 | * 1 - < | ||
1638 | * 2 - <= | ||
1639 | * 3 - == | ||
1640 | * 4 - != | ||
1641 | * 5 - >= | ||
1642 | * 6 - > | ||
1643 | */ | ||
1644 | #define WAIT_REG_MEM_MEM_SPACE(x) ((x) << 4) | ||
1645 | /* 0 - reg | ||
1646 | * 1 - mem | ||
1647 | */ | ||
1648 | #define WAIT_REG_MEM_ENGINE(x) ((x) << 8) | ||
1649 | /* 0 - me | ||
1650 | * 1 - pfp | ||
1651 | */ | ||
1635 | #define PACKET3_MEM_WRITE 0x3D | 1652 | #define PACKET3_MEM_WRITE 0x3D |
1636 | #define PACKET3_COPY_DATA 0x40 | 1653 | #define PACKET3_COPY_DATA 0x40 |
1637 | #define PACKET3_CP_DMA 0x41 | 1654 | #define PACKET3_CP_DMA 0x41 |
@@ -1835,6 +1852,7 @@ | |||
1835 | #define DMA_PACKET_TRAP 0x7 | 1852 | #define DMA_PACKET_TRAP 0x7 |
1836 | #define DMA_PACKET_SRBM_WRITE 0x9 | 1853 | #define DMA_PACKET_SRBM_WRITE 0x9 |
1837 | #define DMA_PACKET_CONSTANT_FILL 0xd | 1854 | #define DMA_PACKET_CONSTANT_FILL 0xd |
1855 | #define DMA_PACKET_POLL_REG_MEM 0xe | ||
1838 | #define DMA_PACKET_NOP 0xf | 1856 | #define DMA_PACKET_NOP 0xf |
1839 | 1857 | ||
1840 | #define VCE_STATUS 0x20004 | 1858 | #define VCE_STATUS 0x20004 |
diff --git a/drivers/infiniband/hw/mlx4/main.c b/drivers/infiniband/hw/mlx4/main.c index 57ecc5b204f3..9117b7a2d5f8 100644 --- a/drivers/infiniband/hw/mlx4/main.c +++ b/drivers/infiniband/hw/mlx4/main.c | |||
@@ -1114,7 +1114,8 @@ static int mlx4_ib_tunnel_steer_add(struct ib_qp *qp, struct ib_flow_attr *flow_ | |||
1114 | struct mlx4_dev *dev = to_mdev(qp->device)->dev; | 1114 | struct mlx4_dev *dev = to_mdev(qp->device)->dev; |
1115 | int err = 0; | 1115 | int err = 0; |
1116 | 1116 | ||
1117 | if (dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) | 1117 | if (dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN || |
1118 | dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_STATIC) | ||
1118 | return 0; /* do nothing */ | 1119 | return 0; /* do nothing */ |
1119 | 1120 | ||
1120 | ib_flow = flow_attr + 1; | 1121 | ib_flow = flow_attr + 1; |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index f2b978026407..77ecf6d32237 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -1520,6 +1520,8 @@ static int elantech_set_properties(struct elantech_data *etd) | |||
1520 | case 7: | 1520 | case 7: |
1521 | case 8: | 1521 | case 8: |
1522 | case 9: | 1522 | case 9: |
1523 | case 10: | ||
1524 | case 13: | ||
1523 | etd->hw_version = 4; | 1525 | etd->hw_version = 4; |
1524 | break; | 1526 | break; |
1525 | default: | 1527 | default: |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index c66d1b53843e..764857b4e268 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -415,6 +415,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { | |||
415 | }, | 415 | }, |
416 | }, | 416 | }, |
417 | { | 417 | { |
418 | /* Acer Aspire 7738 */ | ||
419 | .matches = { | ||
420 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
421 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7738"), | ||
422 | }, | ||
423 | }, | ||
424 | { | ||
418 | /* Gericom Bellagio */ | 425 | /* Gericom Bellagio */ |
419 | .matches = { | 426 | .matches = { |
420 | DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), | 427 | DMI_MATCH(DMI_SYS_VENDOR, "Gericom"), |
@@ -745,6 +752,35 @@ static const struct dmi_system_id __initconst i8042_dmi_dritek_table[] = { | |||
745 | { } | 752 | { } |
746 | }; | 753 | }; |
747 | 754 | ||
755 | /* | ||
756 | * Some laptops need keyboard reset before probing for the trackpad to get | ||
757 | * it detected, initialised & finally work. | ||
758 | */ | ||
759 | static const struct dmi_system_id __initconst i8042_dmi_kbdreset_table[] = { | ||
760 | { | ||
761 | /* Gigabyte P35 v2 - Elantech touchpad */ | ||
762 | .matches = { | ||
763 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
764 | DMI_MATCH(DMI_PRODUCT_NAME, "P35V2"), | ||
765 | }, | ||
766 | }, | ||
767 | { | ||
768 | /* Aorus branded Gigabyte X3 Plus - Elantech touchpad */ | ||
769 | .matches = { | ||
770 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
771 | DMI_MATCH(DMI_PRODUCT_NAME, "X3"), | ||
772 | }, | ||
773 | }, | ||
774 | { | ||
775 | /* Gigabyte P34 - Elantech touchpad */ | ||
776 | .matches = { | ||
777 | DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), | ||
778 | DMI_MATCH(DMI_PRODUCT_NAME, "P34"), | ||
779 | }, | ||
780 | }, | ||
781 | { } | ||
782 | }; | ||
783 | |||
748 | #endif /* CONFIG_X86 */ | 784 | #endif /* CONFIG_X86 */ |
749 | 785 | ||
750 | #ifdef CONFIG_PNP | 786 | #ifdef CONFIG_PNP |
@@ -1040,6 +1076,9 @@ static int __init i8042_platform_init(void) | |||
1040 | if (dmi_check_system(i8042_dmi_dritek_table)) | 1076 | if (dmi_check_system(i8042_dmi_dritek_table)) |
1041 | i8042_dritek = true; | 1077 | i8042_dritek = true; |
1042 | 1078 | ||
1079 | if (dmi_check_system(i8042_dmi_kbdreset_table)) | ||
1080 | i8042_kbdreset = true; | ||
1081 | |||
1043 | /* | 1082 | /* |
1044 | * A20 was already enabled during early kernel init. But some buggy | 1083 | * A20 was already enabled during early kernel init. But some buggy |
1045 | * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to | 1084 | * BIOSes (in MSI Laptops) require A20 to be enabled using 8042 to |
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 924e4bf357fb..986a71c614b0 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -67,6 +67,10 @@ static bool i8042_notimeout; | |||
67 | module_param_named(notimeout, i8042_notimeout, bool, 0); | 67 | module_param_named(notimeout, i8042_notimeout, bool, 0); |
68 | MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042"); | 68 | MODULE_PARM_DESC(notimeout, "Ignore timeouts signalled by i8042"); |
69 | 69 | ||
70 | static bool i8042_kbdreset; | ||
71 | module_param_named(kbdreset, i8042_kbdreset, bool, 0); | ||
72 | MODULE_PARM_DESC(kbdreset, "Reset device connected to KBD port"); | ||
73 | |||
70 | #ifdef CONFIG_X86 | 74 | #ifdef CONFIG_X86 |
71 | static bool i8042_dritek; | 75 | static bool i8042_dritek; |
72 | module_param_named(dritek, i8042_dritek, bool, 0); | 76 | module_param_named(dritek, i8042_dritek, bool, 0); |
@@ -790,6 +794,16 @@ static int __init i8042_check_aux(void) | |||
790 | return -1; | 794 | return -1; |
791 | 795 | ||
792 | /* | 796 | /* |
797 | * Reset keyboard (needed on some laptops to successfully detect | ||
798 | * touchpad, e.g., some Gigabyte laptop models with Elantech | ||
799 | * touchpads). | ||
800 | */ | ||
801 | if (i8042_kbdreset) { | ||
802 | pr_warn("Attempting to reset device connected to KBD port\n"); | ||
803 | i8042_kbd_write(NULL, (unsigned char) 0xff); | ||
804 | } | ||
805 | |||
806 | /* | ||
793 | * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and | 807 | * Test AUX IRQ delivery to make sure BIOS did not grab the IRQ and |
794 | * used it for a PCI card or somethig else. | 808 | * used it for a PCI card or somethig else. |
795 | */ | 809 | */ |
diff --git a/drivers/mfd/da9052-core.c b/drivers/mfd/da9052-core.c index 52a0c2f6264f..ae498b53ee40 100644 --- a/drivers/mfd/da9052-core.c +++ b/drivers/mfd/da9052-core.c | |||
@@ -554,7 +554,8 @@ int da9052_device_init(struct da9052 *da9052, u8 chip_id) | |||
554 | return ret; | 554 | return ret; |
555 | } | 555 | } |
556 | 556 | ||
557 | ret = mfd_add_devices(da9052->dev, -1, da9052_subdev_info, | 557 | ret = mfd_add_devices(da9052->dev, PLATFORM_DEVID_AUTO, |
558 | da9052_subdev_info, | ||
558 | ARRAY_SIZE(da9052_subdev_info), NULL, 0, NULL); | 559 | ARRAY_SIZE(da9052_subdev_info), NULL, 0, NULL); |
559 | if (ret) { | 560 | if (ret) { |
560 | dev_err(da9052->dev, "mfd_add_devices failed: %d\n", ret); | 561 | dev_err(da9052->dev, "mfd_add_devices failed: %d\n", ret); |
diff --git a/drivers/mfd/rtsx_usb.c b/drivers/mfd/rtsx_usb.c index dbdd0faeb6ce..210d1f85679e 100644 --- a/drivers/mfd/rtsx_usb.c +++ b/drivers/mfd/rtsx_usb.c | |||
@@ -681,21 +681,9 @@ static void rtsx_usb_disconnect(struct usb_interface *intf) | |||
681 | #ifdef CONFIG_PM | 681 | #ifdef CONFIG_PM |
682 | static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message) | 682 | static int rtsx_usb_suspend(struct usb_interface *intf, pm_message_t message) |
683 | { | 683 | { |
684 | struct rtsx_ucr *ucr = | ||
685 | (struct rtsx_ucr *)usb_get_intfdata(intf); | ||
686 | |||
687 | dev_dbg(&intf->dev, "%s called with pm message 0x%04x\n", | 684 | dev_dbg(&intf->dev, "%s called with pm message 0x%04x\n", |
688 | __func__, message.event); | 685 | __func__, message.event); |
689 | 686 | ||
690 | /* | ||
691 | * Call to make sure LED is off during suspend to save more power. | ||
692 | * It is NOT a permanent state and could be turned on anytime later. | ||
693 | * Thus no need to call turn_on when resunming. | ||
694 | */ | ||
695 | mutex_lock(&ucr->dev_mutex); | ||
696 | rtsx_usb_turn_off_led(ucr); | ||
697 | mutex_unlock(&ucr->dev_mutex); | ||
698 | |||
699 | return 0; | 687 | return 0; |
700 | } | 688 | } |
701 | 689 | ||
diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c index 0d256cb002eb..d6b764349f9d 100644 --- a/drivers/mfd/tps65218.c +++ b/drivers/mfd/tps65218.c | |||
@@ -125,10 +125,21 @@ int tps65218_clear_bits(struct tps65218 *tps, unsigned int reg, | |||
125 | } | 125 | } |
126 | EXPORT_SYMBOL_GPL(tps65218_clear_bits); | 126 | EXPORT_SYMBOL_GPL(tps65218_clear_bits); |
127 | 127 | ||
128 | static const struct regmap_range tps65218_yes_ranges[] = { | ||
129 | regmap_reg_range(TPS65218_REG_INT1, TPS65218_REG_INT2), | ||
130 | regmap_reg_range(TPS65218_REG_STATUS, TPS65218_REG_STATUS), | ||
131 | }; | ||
132 | |||
133 | static const struct regmap_access_table tps65218_volatile_table = { | ||
134 | .yes_ranges = tps65218_yes_ranges, | ||
135 | .n_yes_ranges = ARRAY_SIZE(tps65218_yes_ranges), | ||
136 | }; | ||
137 | |||
128 | static struct regmap_config tps65218_regmap_config = { | 138 | static struct regmap_config tps65218_regmap_config = { |
129 | .reg_bits = 8, | 139 | .reg_bits = 8, |
130 | .val_bits = 8, | 140 | .val_bits = 8, |
131 | .cache_type = REGCACHE_RBTREE, | 141 | .cache_type = REGCACHE_RBTREE, |
142 | .volatile_table = &tps65218_volatile_table, | ||
132 | }; | 143 | }; |
133 | 144 | ||
134 | static const struct regmap_irq tps65218_irqs[] = { | 145 | static const struct regmap_irq tps65218_irqs[] = { |
@@ -193,6 +204,7 @@ static struct regmap_irq_chip tps65218_irq_chip = { | |||
193 | 204 | ||
194 | .num_regs = 2, | 205 | .num_regs = 2, |
195 | .mask_base = TPS65218_REG_INT_MASK1, | 206 | .mask_base = TPS65218_REG_INT_MASK1, |
207 | .status_base = TPS65218_REG_INT1, | ||
196 | }; | 208 | }; |
197 | 209 | ||
198 | static const struct of_device_id of_tps65218_match_table[] = { | 210 | static const struct of_device_id of_tps65218_match_table[] = { |
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index f363972cd77d..e36d10520e24 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
@@ -103,27 +103,34 @@ static void c_can_hw_raminit_syscon(const struct c_can_priv *priv, bool enable) | |||
103 | mask = 1 << raminit->bits.start | 1 << raminit->bits.done; | 103 | mask = 1 << raminit->bits.start | 1 << raminit->bits.done; |
104 | regmap_read(raminit->syscon, raminit->reg, &ctrl); | 104 | regmap_read(raminit->syscon, raminit->reg, &ctrl); |
105 | 105 | ||
106 | /* We clear the done and start bit first. The start bit is | 106 | /* We clear the start bit first. The start bit is |
107 | * looking at the 0 -> transition, but is not self clearing; | 107 | * looking at the 0 -> transition, but is not self clearing; |
108 | * And we clear the init done bit as well. | ||
109 | * NOTE: DONE must be written with 1 to clear it. | 108 | * NOTE: DONE must be written with 1 to clear it. |
109 | * We can't clear the DONE bit here using regmap_update_bits() | ||
110 | * as it will bypass the write if initial condition is START:0 DONE:1 | ||
111 | * e.g. on DRA7 which needs START pulse. | ||
110 | */ | 112 | */ |
111 | ctrl &= ~(1 << raminit->bits.start); | 113 | ctrl &= ~mask; /* START = 0, DONE = 0 */ |
112 | ctrl |= 1 << raminit->bits.done; | 114 | regmap_update_bits(raminit->syscon, raminit->reg, mask, ctrl); |
113 | regmap_write(raminit->syscon, raminit->reg, ctrl); | ||
114 | 115 | ||
115 | ctrl &= ~(1 << raminit->bits.done); | 116 | /* check if START bit is 0. Ignore DONE bit for now |
116 | c_can_hw_raminit_wait_syscon(priv, mask, ctrl); | 117 | * as it can be either 0 or 1. |
118 | */ | ||
119 | c_can_hw_raminit_wait_syscon(priv, 1 << raminit->bits.start, ctrl); | ||
117 | 120 | ||
118 | if (enable) { | 121 | if (enable) { |
119 | /* Set start bit and wait for the done bit. */ | 122 | /* Clear DONE bit & set START bit. */ |
120 | ctrl |= 1 << raminit->bits.start; | 123 | ctrl |= 1 << raminit->bits.start; |
121 | regmap_write(raminit->syscon, raminit->reg, ctrl); | 124 | /* DONE must be written with 1 to clear it */ |
122 | 125 | ctrl |= 1 << raminit->bits.done; | |
126 | regmap_update_bits(raminit->syscon, raminit->reg, mask, ctrl); | ||
127 | /* prevent further clearing of DONE bit */ | ||
128 | ctrl &= ~(1 << raminit->bits.done); | ||
123 | /* clear START bit if start pulse is needed */ | 129 | /* clear START bit if start pulse is needed */ |
124 | if (raminit->needs_pulse) { | 130 | if (raminit->needs_pulse) { |
125 | ctrl &= ~(1 << raminit->bits.start); | 131 | ctrl &= ~(1 << raminit->bits.start); |
126 | regmap_write(raminit->syscon, raminit->reg, ctrl); | 132 | regmap_update_bits(raminit->syscon, raminit->reg, |
133 | mask, ctrl); | ||
127 | } | 134 | } |
128 | 135 | ||
129 | ctrl |= 1 << raminit->bits.done; | 136 | ctrl |= 1 << raminit->bits.done; |
diff --git a/drivers/net/can/dev.c b/drivers/net/can/dev.c index 3ec8f6f25e5f..847c1f813261 100644 --- a/drivers/net/can/dev.c +++ b/drivers/net/can/dev.c | |||
@@ -807,10 +807,14 @@ static int can_changelink(struct net_device *dev, | |||
807 | if (dev->flags & IFF_UP) | 807 | if (dev->flags & IFF_UP) |
808 | return -EBUSY; | 808 | return -EBUSY; |
809 | cm = nla_data(data[IFLA_CAN_CTRLMODE]); | 809 | cm = nla_data(data[IFLA_CAN_CTRLMODE]); |
810 | if (cm->flags & ~priv->ctrlmode_supported) | 810 | |
811 | /* check whether changed bits are allowed to be modified */ | ||
812 | if (cm->mask & ~priv->ctrlmode_supported) | ||
811 | return -EOPNOTSUPP; | 813 | return -EOPNOTSUPP; |
814 | |||
815 | /* clear bits to be modified and copy the flag values */ | ||
812 | priv->ctrlmode &= ~cm->mask; | 816 | priv->ctrlmode &= ~cm->mask; |
813 | priv->ctrlmode |= cm->flags; | 817 | priv->ctrlmode |= (cm->flags & cm->mask); |
814 | 818 | ||
815 | /* CAN_CTRLMODE_FD can only be set when driver supports FD */ | 819 | /* CAN_CTRLMODE_FD can only be set when driver supports FD */ |
816 | if (priv->ctrlmode & CAN_CTRLMODE_FD) | 820 | if (priv->ctrlmode & CAN_CTRLMODE_FD) |
diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index d7bc462aafdc..244529881be9 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c | |||
@@ -955,6 +955,11 @@ static struct net_device *alloc_m_can_dev(void) | |||
955 | priv->can.data_bittiming_const = &m_can_data_bittiming_const; | 955 | priv->can.data_bittiming_const = &m_can_data_bittiming_const; |
956 | priv->can.do_set_mode = m_can_set_mode; | 956 | priv->can.do_set_mode = m_can_set_mode; |
957 | priv->can.do_get_berr_counter = m_can_get_berr_counter; | 957 | priv->can.do_get_berr_counter = m_can_get_berr_counter; |
958 | |||
959 | /* CAN_CTRLMODE_FD_NON_ISO is fixed with M_CAN IP v3.0.1 */ | ||
960 | priv->can.ctrlmode = CAN_CTRLMODE_FD_NON_ISO; | ||
961 | |||
962 | /* CAN_CTRLMODE_FD_NON_ISO can not be changed with M_CAN IP v3.0.1 */ | ||
958 | priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | | 963 | priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | |
959 | CAN_CTRLMODE_LISTENONLY | | 964 | CAN_CTRLMODE_LISTENONLY | |
960 | CAN_CTRLMODE_BERR_REPORTING | | 965 | CAN_CTRLMODE_BERR_REPORTING | |
diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 541fb7a05625..c32cd61073bc 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c | |||
@@ -520,10 +520,10 @@ static void kvaser_usb_tx_acknowledge(const struct kvaser_usb *dev, | |||
520 | skb = alloc_can_err_skb(priv->netdev, &cf); | 520 | skb = alloc_can_err_skb(priv->netdev, &cf); |
521 | if (skb) { | 521 | if (skb) { |
522 | cf->can_id |= CAN_ERR_RESTARTED; | 522 | cf->can_id |= CAN_ERR_RESTARTED; |
523 | netif_rx(skb); | ||
524 | 523 | ||
525 | stats->rx_packets++; | 524 | stats->rx_packets++; |
526 | stats->rx_bytes += cf->can_dlc; | 525 | stats->rx_bytes += cf->can_dlc; |
526 | netif_rx(skb); | ||
527 | } else { | 527 | } else { |
528 | netdev_err(priv->netdev, | 528 | netdev_err(priv->netdev, |
529 | "No memory left for err_skb\n"); | 529 | "No memory left for err_skb\n"); |
@@ -770,10 +770,9 @@ static void kvaser_usb_rx_error(const struct kvaser_usb *dev, | |||
770 | 770 | ||
771 | priv->can.state = new_state; | 771 | priv->can.state = new_state; |
772 | 772 | ||
773 | netif_rx(skb); | ||
774 | |||
775 | stats->rx_packets++; | 773 | stats->rx_packets++; |
776 | stats->rx_bytes += cf->can_dlc; | 774 | stats->rx_bytes += cf->can_dlc; |
775 | netif_rx(skb); | ||
777 | } | 776 | } |
778 | 777 | ||
779 | static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv, | 778 | static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv, |
@@ -805,10 +804,9 @@ static void kvaser_usb_rx_can_err(const struct kvaser_usb_net_priv *priv, | |||
805 | stats->rx_over_errors++; | 804 | stats->rx_over_errors++; |
806 | stats->rx_errors++; | 805 | stats->rx_errors++; |
807 | 806 | ||
808 | netif_rx(skb); | ||
809 | |||
810 | stats->rx_packets++; | 807 | stats->rx_packets++; |
811 | stats->rx_bytes += cf->can_dlc; | 808 | stats->rx_bytes += cf->can_dlc; |
809 | netif_rx(skb); | ||
812 | } | 810 | } |
813 | } | 811 | } |
814 | 812 | ||
@@ -887,10 +885,9 @@ static void kvaser_usb_rx_can_msg(const struct kvaser_usb *dev, | |||
887 | cf->can_dlc); | 885 | cf->can_dlc); |
888 | } | 886 | } |
889 | 887 | ||
890 | netif_rx(skb); | ||
891 | |||
892 | stats->rx_packets++; | 888 | stats->rx_packets++; |
893 | stats->rx_bytes += cf->can_dlc; | 889 | stats->rx_bytes += cf->can_dlc; |
890 | netif_rx(skb); | ||
894 | } | 891 | } |
895 | 892 | ||
896 | static void kvaser_usb_start_chip_reply(const struct kvaser_usb *dev, | 893 | static void kvaser_usb_start_chip_reply(const struct kvaser_usb *dev, |
@@ -1246,6 +1243,9 @@ static int kvaser_usb_close(struct net_device *netdev) | |||
1246 | if (err) | 1243 | if (err) |
1247 | netdev_warn(netdev, "Cannot stop device, error %d\n", err); | 1244 | netdev_warn(netdev, "Cannot stop device, error %d\n", err); |
1248 | 1245 | ||
1246 | /* reset tx contexts */ | ||
1247 | kvaser_usb_unlink_tx_urbs(priv); | ||
1248 | |||
1249 | priv->can.state = CAN_STATE_STOPPED; | 1249 | priv->can.state = CAN_STATE_STOPPED; |
1250 | close_candev(priv->netdev); | 1250 | close_candev(priv->netdev); |
1251 | 1251 | ||
@@ -1294,12 +1294,14 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
1294 | if (!urb) { | 1294 | if (!urb) { |
1295 | netdev_err(netdev, "No memory left for URBs\n"); | 1295 | netdev_err(netdev, "No memory left for URBs\n"); |
1296 | stats->tx_dropped++; | 1296 | stats->tx_dropped++; |
1297 | goto nourbmem; | 1297 | dev_kfree_skb(skb); |
1298 | return NETDEV_TX_OK; | ||
1298 | } | 1299 | } |
1299 | 1300 | ||
1300 | buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); | 1301 | buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); |
1301 | if (!buf) { | 1302 | if (!buf) { |
1302 | stats->tx_dropped++; | 1303 | stats->tx_dropped++; |
1304 | dev_kfree_skb(skb); | ||
1303 | goto nobufmem; | 1305 | goto nobufmem; |
1304 | } | 1306 | } |
1305 | 1307 | ||
@@ -1334,6 +1336,7 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
1334 | } | 1336 | } |
1335 | } | 1337 | } |
1336 | 1338 | ||
1339 | /* This should never happen; it implies a flow control bug */ | ||
1337 | if (!context) { | 1340 | if (!context) { |
1338 | netdev_warn(netdev, "cannot find free context\n"); | 1341 | netdev_warn(netdev, "cannot find free context\n"); |
1339 | ret = NETDEV_TX_BUSY; | 1342 | ret = NETDEV_TX_BUSY; |
@@ -1364,9 +1367,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, | |||
1364 | if (unlikely(err)) { | 1367 | if (unlikely(err)) { |
1365 | can_free_echo_skb(netdev, context->echo_index); | 1368 | can_free_echo_skb(netdev, context->echo_index); |
1366 | 1369 | ||
1367 | skb = NULL; /* set to NULL to avoid double free in | ||
1368 | * dev_kfree_skb(skb) */ | ||
1369 | |||
1370 | atomic_dec(&priv->active_tx_urbs); | 1370 | atomic_dec(&priv->active_tx_urbs); |
1371 | usb_unanchor_urb(urb); | 1371 | usb_unanchor_urb(urb); |
1372 | 1372 | ||
@@ -1388,8 +1388,6 @@ releasebuf: | |||
1388 | kfree(buf); | 1388 | kfree(buf); |
1389 | nobufmem: | 1389 | nobufmem: |
1390 | usb_free_urb(urb); | 1390 | usb_free_urb(urb); |
1391 | nourbmem: | ||
1392 | dev_kfree_skb(skb); | ||
1393 | return ret; | 1391 | return ret; |
1394 | } | 1392 | } |
1395 | 1393 | ||
@@ -1502,6 +1500,10 @@ static int kvaser_usb_init_one(struct usb_interface *intf, | |||
1502 | struct kvaser_usb_net_priv *priv; | 1500 | struct kvaser_usb_net_priv *priv; |
1503 | int i, err; | 1501 | int i, err; |
1504 | 1502 | ||
1503 | err = kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, channel); | ||
1504 | if (err) | ||
1505 | return err; | ||
1506 | |||
1505 | netdev = alloc_candev(sizeof(*priv), MAX_TX_URBS); | 1507 | netdev = alloc_candev(sizeof(*priv), MAX_TX_URBS); |
1506 | if (!netdev) { | 1508 | if (!netdev) { |
1507 | dev_err(&intf->dev, "Cannot alloc candev\n"); | 1509 | dev_err(&intf->dev, "Cannot alloc candev\n"); |
@@ -1606,9 +1608,6 @@ static int kvaser_usb_probe(struct usb_interface *intf, | |||
1606 | 1608 | ||
1607 | usb_set_intfdata(intf, dev); | 1609 | usb_set_intfdata(intf, dev); |
1608 | 1610 | ||
1609 | for (i = 0; i < MAX_NET_DEVICES; i++) | ||
1610 | kvaser_usb_send_simple_msg(dev, CMD_RESET_CHIP, i); | ||
1611 | |||
1612 | err = kvaser_usb_get_software_info(dev); | 1611 | err = kvaser_usb_get_software_info(dev); |
1613 | if (err) { | 1612 | if (err) { |
1614 | dev_err(&intf->dev, | 1613 | dev_err(&intf->dev, |
diff --git a/drivers/net/ethernet/broadcom/bgmac.c b/drivers/net/ethernet/broadcom/bgmac.c index 05c6af6c418f..3007d95fbb9f 100644 --- a/drivers/net/ethernet/broadcom/bgmac.c +++ b/drivers/net/ethernet/broadcom/bgmac.c | |||
@@ -1167,10 +1167,10 @@ static int bgmac_poll(struct napi_struct *napi, int weight) | |||
1167 | bgmac->int_status = 0; | 1167 | bgmac->int_status = 0; |
1168 | } | 1168 | } |
1169 | 1169 | ||
1170 | if (handled < weight) | 1170 | if (handled < weight) { |
1171 | napi_complete(napi); | 1171 | napi_complete(napi); |
1172 | 1172 | bgmac_chip_intrs_on(bgmac); | |
1173 | bgmac_chip_intrs_on(bgmac); | 1173 | } |
1174 | 1174 | ||
1175 | return handled; | 1175 | return handled; |
1176 | } | 1176 | } |
@@ -1515,6 +1515,8 @@ static int bgmac_probe(struct bcma_device *core) | |||
1515 | if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM) | 1515 | if (core->bus->sprom.boardflags_lo & BGMAC_BFL_ENETADM) |
1516 | bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n"); | 1516 | bgmac_warn(bgmac, "Support for ADMtek ethernet switch not implemented\n"); |
1517 | 1517 | ||
1518 | netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT); | ||
1519 | |||
1518 | err = bgmac_mii_register(bgmac); | 1520 | err = bgmac_mii_register(bgmac); |
1519 | if (err) { | 1521 | if (err) { |
1520 | bgmac_err(bgmac, "Cannot register MDIO\n"); | 1522 | bgmac_err(bgmac, "Cannot register MDIO\n"); |
@@ -1529,8 +1531,6 @@ static int bgmac_probe(struct bcma_device *core) | |||
1529 | 1531 | ||
1530 | netif_carrier_off(net_dev); | 1532 | netif_carrier_off(net_dev); |
1531 | 1533 | ||
1532 | netif_napi_add(net_dev, &bgmac->napi, bgmac_poll, BGMAC_WEIGHT); | ||
1533 | |||
1534 | return 0; | 1534 | return 0; |
1535 | 1535 | ||
1536 | err_mii_unregister: | 1536 | err_mii_unregister: |
@@ -1549,9 +1549,9 @@ static void bgmac_remove(struct bcma_device *core) | |||
1549 | { | 1549 | { |
1550 | struct bgmac *bgmac = bcma_get_drvdata(core); | 1550 | struct bgmac *bgmac = bcma_get_drvdata(core); |
1551 | 1551 | ||
1552 | netif_napi_del(&bgmac->napi); | ||
1553 | unregister_netdev(bgmac->net_dev); | 1552 | unregister_netdev(bgmac->net_dev); |
1554 | bgmac_mii_unregister(bgmac); | 1553 | bgmac_mii_unregister(bgmac); |
1554 | netif_napi_del(&bgmac->napi); | ||
1555 | bgmac_dma_free(bgmac); | 1555 | bgmac_dma_free(bgmac); |
1556 | bcma_set_drvdata(core, NULL); | 1556 | bcma_set_drvdata(core, NULL); |
1557 | free_netdev(bgmac->net_dev); | 1557 | free_netdev(bgmac->net_dev); |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 41a0a5498da7..d48806b5cd88 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -4383,8 +4383,9 @@ static int be_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | |||
4383 | * distinguish various types of transports (VxLAN, GRE, NVGRE ..). So, offload | 4383 | * distinguish various types of transports (VxLAN, GRE, NVGRE ..). So, offload |
4384 | * is expected to work across all types of IP tunnels once exported. Skyhawk | 4384 | * is expected to work across all types of IP tunnels once exported. Skyhawk |
4385 | * supports offloads for either VxLAN or NVGRE, exclusively. So we export VxLAN | 4385 | * supports offloads for either VxLAN or NVGRE, exclusively. So we export VxLAN |
4386 | * offloads in hw_enc_features only when a VxLAN port is added. Note this only | 4386 | * offloads in hw_enc_features only when a VxLAN port is added. If other (non |
4387 | * ensures that other tunnels work fine while VxLAN offloads are not enabled. | 4387 | * VxLAN) tunnels are configured while VxLAN offloads are enabled, offloads for |
4388 | * those other tunnels are unexported on the fly through ndo_features_check(). | ||
4388 | * | 4389 | * |
4389 | * Skyhawk supports VxLAN offloads only for one UDP dport. So, if the stack | 4390 | * Skyhawk supports VxLAN offloads only for one UDP dport. So, if the stack |
4390 | * adds more than one port, disable offloads and don't re-enable them again | 4391 | * adds more than one port, disable offloads and don't re-enable them again |
@@ -4463,7 +4464,41 @@ static netdev_features_t be_features_check(struct sk_buff *skb, | |||
4463 | struct net_device *dev, | 4464 | struct net_device *dev, |
4464 | netdev_features_t features) | 4465 | netdev_features_t features) |
4465 | { | 4466 | { |
4466 | return vxlan_features_check(skb, features); | 4467 | struct be_adapter *adapter = netdev_priv(dev); |
4468 | u8 l4_hdr = 0; | ||
4469 | |||
4470 | /* The code below restricts offload features for some tunneled packets. | ||
4471 | * Offload features for normal (non tunnel) packets are unchanged. | ||
4472 | */ | ||
4473 | if (!skb->encapsulation || | ||
4474 | !(adapter->flags & BE_FLAGS_VXLAN_OFFLOADS)) | ||
4475 | return features; | ||
4476 | |||
4477 | /* It's an encapsulated packet and VxLAN offloads are enabled. We | ||
4478 | * should disable tunnel offload features if it's not a VxLAN packet, | ||
4479 | * as tunnel offloads have been enabled only for VxLAN. This is done to | ||
4480 | * allow other tunneled traffic like GRE work fine while VxLAN | ||
4481 | * offloads are configured in Skyhawk-R. | ||
4482 | */ | ||
4483 | switch (vlan_get_protocol(skb)) { | ||
4484 | case htons(ETH_P_IP): | ||
4485 | l4_hdr = ip_hdr(skb)->protocol; | ||
4486 | break; | ||
4487 | case htons(ETH_P_IPV6): | ||
4488 | l4_hdr = ipv6_hdr(skb)->nexthdr; | ||
4489 | break; | ||
4490 | default: | ||
4491 | return features; | ||
4492 | } | ||
4493 | |||
4494 | if (l4_hdr != IPPROTO_UDP || | ||
4495 | skb->inner_protocol_type != ENCAP_TYPE_ETHER || | ||
4496 | skb->inner_protocol != htons(ETH_P_TEB) || | ||
4497 | skb_inner_mac_header(skb) - skb_transport_header(skb) != | ||
4498 | sizeof(struct udphdr) + sizeof(struct vxlanhdr)) | ||
4499 | return features & ~(NETIF_F_ALL_CSUM | NETIF_F_GSO_MASK); | ||
4500 | |||
4501 | return features; | ||
4467 | } | 4502 | } |
4468 | #endif | 4503 | #endif |
4469 | 4504 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index d0d6dc1b8e46..ac6a8f1eea6c 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -475,7 +475,8 @@ static int mlx4_en_tunnel_steer_add(struct mlx4_en_priv *priv, unsigned char *ad | |||
475 | { | 475 | { |
476 | int err; | 476 | int err; |
477 | 477 | ||
478 | if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) | 478 | if (priv->mdev->dev->caps.tunnel_offload_mode != MLX4_TUNNEL_OFFLOAD_MODE_VXLAN || |
479 | priv->mdev->dev->caps.dmfs_high_steer_mode == MLX4_STEERING_DMFS_A0_STATIC) | ||
479 | return 0; /* do nothing */ | 480 | return 0; /* do nothing */ |
480 | 481 | ||
481 | err = mlx4_tunnel_steer_add(priv->mdev->dev, addr, priv->port, qpn, | 482 | err = mlx4_tunnel_steer_add(priv->mdev->dev, addr, priv->port, qpn, |
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c b/drivers/net/ethernet/mellanox/mlx4/main.c index 03e9eb0dc761..6e08352ec994 100644 --- a/drivers/net/ethernet/mellanox/mlx4/main.c +++ b/drivers/net/ethernet/mellanox/mlx4/main.c | |||
@@ -1744,8 +1744,7 @@ static void choose_tunnel_offload_mode(struct mlx4_dev *dev, | |||
1744 | struct mlx4_dev_cap *dev_cap) | 1744 | struct mlx4_dev_cap *dev_cap) |
1745 | { | 1745 | { |
1746 | if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED && | 1746 | if (dev->caps.steering_mode == MLX4_STEERING_MODE_DEVICE_MANAGED && |
1747 | dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS && | 1747 | dev_cap->flags2 & MLX4_DEV_CAP_FLAG2_VXLAN_OFFLOADS) |
1748 | dev->caps.dmfs_high_steer_mode != MLX4_STEERING_DMFS_A0_STATIC) | ||
1749 | dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_VXLAN; | 1748 | dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_VXLAN; |
1750 | else | 1749 | else |
1751 | dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_NONE; | 1750 | dev->caps.tunnel_offload_mode = MLX4_TUNNEL_OFFLOAD_MODE_NONE; |
diff --git a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c index f5e4b820128b..db0c7a9aee60 100644 --- a/drivers/net/ethernet/neterion/s2io.c +++ b/drivers/net/ethernet/neterion/s2io.c | |||
@@ -6987,7 +6987,9 @@ static int s2io_add_isr(struct s2io_nic *sp) | |||
6987 | if (sp->s2io_entries[i].in_use == MSIX_FLG) { | 6987 | if (sp->s2io_entries[i].in_use == MSIX_FLG) { |
6988 | if (sp->s2io_entries[i].type == | 6988 | if (sp->s2io_entries[i].type == |
6989 | MSIX_RING_TYPE) { | 6989 | MSIX_RING_TYPE) { |
6990 | sprintf(sp->desc[i], "%s:MSI-X-%d-RX", | 6990 | snprintf(sp->desc[i], |
6991 | sizeof(sp->desc[i]), | ||
6992 | "%s:MSI-X-%d-RX", | ||
6991 | dev->name, i); | 6993 | dev->name, i); |
6992 | err = request_irq(sp->entries[i].vector, | 6994 | err = request_irq(sp->entries[i].vector, |
6993 | s2io_msix_ring_handle, | 6995 | s2io_msix_ring_handle, |
@@ -6996,7 +6998,9 @@ static int s2io_add_isr(struct s2io_nic *sp) | |||
6996 | sp->s2io_entries[i].arg); | 6998 | sp->s2io_entries[i].arg); |
6997 | } else if (sp->s2io_entries[i].type == | 6999 | } else if (sp->s2io_entries[i].type == |
6998 | MSIX_ALARM_TYPE) { | 7000 | MSIX_ALARM_TYPE) { |
6999 | sprintf(sp->desc[i], "%s:MSI-X-%d-TX", | 7001 | snprintf(sp->desc[i], |
7002 | sizeof(sp->desc[i]), | ||
7003 | "%s:MSI-X-%d-TX", | ||
7000 | dev->name, i); | 7004 | dev->name, i); |
7001 | err = request_irq(sp->entries[i].vector, | 7005 | err = request_irq(sp->entries[i].vector, |
7002 | s2io_msix_fifo_handle, | 7006 | s2io_msix_fifo_handle, |
@@ -8154,7 +8158,8 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
8154 | "%s: UDP Fragmentation Offload(UFO) enabled\n", | 8158 | "%s: UDP Fragmentation Offload(UFO) enabled\n", |
8155 | dev->name); | 8159 | dev->name); |
8156 | /* Initialize device name */ | 8160 | /* Initialize device name */ |
8157 | sprintf(sp->name, "%s Neterion %s", dev->name, sp->product_name); | 8161 | snprintf(sp->name, sizeof(sp->name), "%s Neterion %s", dev->name, |
8162 | sp->product_name); | ||
8158 | 8163 | ||
8159 | if (vlan_tag_strip) | 8164 | if (vlan_tag_strip) |
8160 | sp->vlan_strip_flag = 1; | 8165 | sp->vlan_strip_flag = 1; |
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 37583a9d8853..6576243222af 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c | |||
@@ -498,6 +498,8 @@ static struct sh_eth_cpu_data r8a779x_data = { | |||
498 | EESR_ECI, | 498 | EESR_ECI, |
499 | .fdr_value = 0x00000f0f, | 499 | .fdr_value = 0x00000f0f, |
500 | 500 | ||
501 | .trscer_err_mask = DESC_I_RINT8, | ||
502 | |||
501 | .apr = 1, | 503 | .apr = 1, |
502 | .mpr = 1, | 504 | .mpr = 1, |
503 | .tpauser = 1, | 505 | .tpauser = 1, |
@@ -538,8 +540,6 @@ static struct sh_eth_cpu_data sh7724_data = { | |||
538 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | | 540 | EESR_RDE | EESR_RFRMER | EESR_TFE | EESR_TDE | |
539 | EESR_ECI, | 541 | EESR_ECI, |
540 | 542 | ||
541 | .trscer_err_mask = DESC_I_RINT8, | ||
542 | |||
543 | .apr = 1, | 543 | .apr = 1, |
544 | .mpr = 1, | 544 | .mpr = 1, |
545 | .tpauser = 1, | 545 | .tpauser = 1, |
@@ -1827,6 +1827,9 @@ static int sh_eth_get_settings(struct net_device *ndev, | |||
1827 | unsigned long flags; | 1827 | unsigned long flags; |
1828 | int ret; | 1828 | int ret; |
1829 | 1829 | ||
1830 | if (!mdp->phydev) | ||
1831 | return -ENODEV; | ||
1832 | |||
1830 | spin_lock_irqsave(&mdp->lock, flags); | 1833 | spin_lock_irqsave(&mdp->lock, flags); |
1831 | ret = phy_ethtool_gset(mdp->phydev, ecmd); | 1834 | ret = phy_ethtool_gset(mdp->phydev, ecmd); |
1832 | spin_unlock_irqrestore(&mdp->lock, flags); | 1835 | spin_unlock_irqrestore(&mdp->lock, flags); |
@@ -1841,6 +1844,9 @@ static int sh_eth_set_settings(struct net_device *ndev, | |||
1841 | unsigned long flags; | 1844 | unsigned long flags; |
1842 | int ret; | 1845 | int ret; |
1843 | 1846 | ||
1847 | if (!mdp->phydev) | ||
1848 | return -ENODEV; | ||
1849 | |||
1844 | spin_lock_irqsave(&mdp->lock, flags); | 1850 | spin_lock_irqsave(&mdp->lock, flags); |
1845 | 1851 | ||
1846 | /* disable tx and rx */ | 1852 | /* disable tx and rx */ |
@@ -1875,6 +1881,9 @@ static int sh_eth_nway_reset(struct net_device *ndev) | |||
1875 | unsigned long flags; | 1881 | unsigned long flags; |
1876 | int ret; | 1882 | int ret; |
1877 | 1883 | ||
1884 | if (!mdp->phydev) | ||
1885 | return -ENODEV; | ||
1886 | |||
1878 | spin_lock_irqsave(&mdp->lock, flags); | 1887 | spin_lock_irqsave(&mdp->lock, flags); |
1879 | ret = phy_start_aneg(mdp->phydev); | 1888 | ret = phy_start_aneg(mdp->phydev); |
1880 | spin_unlock_irqrestore(&mdp->lock, flags); | 1889 | spin_unlock_irqrestore(&mdp->lock, flags); |
@@ -2184,6 +2193,7 @@ static int sh_eth_close(struct net_device *ndev) | |||
2184 | if (mdp->phydev) { | 2193 | if (mdp->phydev) { |
2185 | phy_stop(mdp->phydev); | 2194 | phy_stop(mdp->phydev); |
2186 | phy_disconnect(mdp->phydev); | 2195 | phy_disconnect(mdp->phydev); |
2196 | mdp->phydev = NULL; | ||
2187 | } | 2197 | } |
2188 | 2198 | ||
2189 | free_irq(ndev->irq, ndev); | 2199 | free_irq(ndev->irq, ndev); |
@@ -2417,7 +2427,7 @@ static int sh_eth_tsu_purge_all(struct net_device *ndev) | |||
2417 | struct sh_eth_private *mdp = netdev_priv(ndev); | 2427 | struct sh_eth_private *mdp = netdev_priv(ndev); |
2418 | int i, ret; | 2428 | int i, ret; |
2419 | 2429 | ||
2420 | if (unlikely(!mdp->cd->tsu)) | 2430 | if (!mdp->cd->tsu) |
2421 | return 0; | 2431 | return 0; |
2422 | 2432 | ||
2423 | for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++) { | 2433 | for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++) { |
@@ -2440,7 +2450,7 @@ static void sh_eth_tsu_purge_mcast(struct net_device *ndev) | |||
2440 | void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0); | 2450 | void *reg_offset = sh_eth_tsu_get_offset(mdp, TSU_ADRH0); |
2441 | int i; | 2451 | int i; |
2442 | 2452 | ||
2443 | if (unlikely(!mdp->cd->tsu)) | 2453 | if (!mdp->cd->tsu) |
2444 | return; | 2454 | return; |
2445 | 2455 | ||
2446 | for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) { | 2456 | for (i = 0; i < SH_ETH_TSU_CAM_ENTRIES; i++, reg_offset += 8) { |
@@ -2450,8 +2460,8 @@ static void sh_eth_tsu_purge_mcast(struct net_device *ndev) | |||
2450 | } | 2460 | } |
2451 | } | 2461 | } |
2452 | 2462 | ||
2453 | /* Multicast reception directions set */ | 2463 | /* Update promiscuous flag and multicast filter */ |
2454 | static void sh_eth_set_multicast_list(struct net_device *ndev) | 2464 | static void sh_eth_set_rx_mode(struct net_device *ndev) |
2455 | { | 2465 | { |
2456 | struct sh_eth_private *mdp = netdev_priv(ndev); | 2466 | struct sh_eth_private *mdp = netdev_priv(ndev); |
2457 | u32 ecmr_bits; | 2467 | u32 ecmr_bits; |
@@ -2462,7 +2472,9 @@ static void sh_eth_set_multicast_list(struct net_device *ndev) | |||
2462 | /* Initial condition is MCT = 1, PRM = 0. | 2472 | /* Initial condition is MCT = 1, PRM = 0. |
2463 | * Depending on ndev->flags, set PRM or clear MCT | 2473 | * Depending on ndev->flags, set PRM or clear MCT |
2464 | */ | 2474 | */ |
2465 | ecmr_bits = (sh_eth_read(ndev, ECMR) & ~ECMR_PRM) | ECMR_MCT; | 2475 | ecmr_bits = sh_eth_read(ndev, ECMR) & ~ECMR_PRM; |
2476 | if (mdp->cd->tsu) | ||
2477 | ecmr_bits |= ECMR_MCT; | ||
2466 | 2478 | ||
2467 | if (!(ndev->flags & IFF_MULTICAST)) { | 2479 | if (!(ndev->flags & IFF_MULTICAST)) { |
2468 | sh_eth_tsu_purge_mcast(ndev); | 2480 | sh_eth_tsu_purge_mcast(ndev); |
@@ -2491,9 +2503,6 @@ static void sh_eth_set_multicast_list(struct net_device *ndev) | |||
2491 | } | 2503 | } |
2492 | } | 2504 | } |
2493 | } | 2505 | } |
2494 | } else { | ||
2495 | /* Normal, unicast/broadcast-only mode. */ | ||
2496 | ecmr_bits = (ecmr_bits & ~ECMR_PRM) | ECMR_MCT; | ||
2497 | } | 2506 | } |
2498 | 2507 | ||
2499 | /* update the ethernet mode */ | 2508 | /* update the ethernet mode */ |
@@ -2701,6 +2710,7 @@ static const struct net_device_ops sh_eth_netdev_ops = { | |||
2701 | .ndo_stop = sh_eth_close, | 2710 | .ndo_stop = sh_eth_close, |
2702 | .ndo_start_xmit = sh_eth_start_xmit, | 2711 | .ndo_start_xmit = sh_eth_start_xmit, |
2703 | .ndo_get_stats = sh_eth_get_stats, | 2712 | .ndo_get_stats = sh_eth_get_stats, |
2713 | .ndo_set_rx_mode = sh_eth_set_rx_mode, | ||
2704 | .ndo_tx_timeout = sh_eth_tx_timeout, | 2714 | .ndo_tx_timeout = sh_eth_tx_timeout, |
2705 | .ndo_do_ioctl = sh_eth_do_ioctl, | 2715 | .ndo_do_ioctl = sh_eth_do_ioctl, |
2706 | .ndo_validate_addr = eth_validate_addr, | 2716 | .ndo_validate_addr = eth_validate_addr, |
@@ -2713,7 +2723,7 @@ static const struct net_device_ops sh_eth_netdev_ops_tsu = { | |||
2713 | .ndo_stop = sh_eth_close, | 2723 | .ndo_stop = sh_eth_close, |
2714 | .ndo_start_xmit = sh_eth_start_xmit, | 2724 | .ndo_start_xmit = sh_eth_start_xmit, |
2715 | .ndo_get_stats = sh_eth_get_stats, | 2725 | .ndo_get_stats = sh_eth_get_stats, |
2716 | .ndo_set_rx_mode = sh_eth_set_multicast_list, | 2726 | .ndo_set_rx_mode = sh_eth_set_rx_mode, |
2717 | .ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid, | 2727 | .ndo_vlan_rx_add_vid = sh_eth_vlan_rx_add_vid, |
2718 | .ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid, | 2728 | .ndo_vlan_rx_kill_vid = sh_eth_vlan_rx_kill_vid, |
2719 | .ndo_tx_timeout = sh_eth_tx_timeout, | 2729 | .ndo_tx_timeout = sh_eth_tx_timeout, |
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c index 698494481d18..b1a271853d85 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | |||
@@ -474,13 +474,19 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no, | |||
474 | /* allocate memory for RX skbuff array */ | 474 | /* allocate memory for RX skbuff array */ |
475 | rx_ring->rx_skbuff_dma = kmalloc_array(rx_rsize, | 475 | rx_ring->rx_skbuff_dma = kmalloc_array(rx_rsize, |
476 | sizeof(dma_addr_t), GFP_KERNEL); | 476 | sizeof(dma_addr_t), GFP_KERNEL); |
477 | if (rx_ring->rx_skbuff_dma == NULL) | 477 | if (!rx_ring->rx_skbuff_dma) { |
478 | goto dmamem_err; | 478 | dma_free_coherent(priv->device, |
479 | rx_rsize * sizeof(struct sxgbe_rx_norm_desc), | ||
480 | rx_ring->dma_rx, rx_ring->dma_rx_phy); | ||
481 | goto error; | ||
482 | } | ||
479 | 483 | ||
480 | rx_ring->rx_skbuff = kmalloc_array(rx_rsize, | 484 | rx_ring->rx_skbuff = kmalloc_array(rx_rsize, |
481 | sizeof(struct sk_buff *), GFP_KERNEL); | 485 | sizeof(struct sk_buff *), GFP_KERNEL); |
482 | if (rx_ring->rx_skbuff == NULL) | 486 | if (!rx_ring->rx_skbuff) { |
483 | goto rxbuff_err; | 487 | kfree(rx_ring->rx_skbuff_dma); |
488 | goto error; | ||
489 | } | ||
484 | 490 | ||
485 | /* initialise the buffers */ | 491 | /* initialise the buffers */ |
486 | for (desc_index = 0; desc_index < rx_rsize; desc_index++) { | 492 | for (desc_index = 0; desc_index < rx_rsize; desc_index++) { |
@@ -502,13 +508,6 @@ static int init_rx_ring(struct net_device *dev, u8 queue_no, | |||
502 | err_init_rx_buffers: | 508 | err_init_rx_buffers: |
503 | while (--desc_index >= 0) | 509 | while (--desc_index >= 0) |
504 | free_rx_ring(priv->device, rx_ring, desc_index); | 510 | free_rx_ring(priv->device, rx_ring, desc_index); |
505 | kfree(rx_ring->rx_skbuff); | ||
506 | rxbuff_err: | ||
507 | kfree(rx_ring->rx_skbuff_dma); | ||
508 | dmamem_err: | ||
509 | dma_free_coherent(priv->device, | ||
510 | rx_rsize * sizeof(struct sxgbe_rx_norm_desc), | ||
511 | rx_ring->dma_rx, rx_ring->dma_rx_phy); | ||
512 | error: | 511 | error: |
513 | return -ENOMEM; | 512 | return -ENOMEM; |
514 | } | 513 | } |
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c index 866560ea9e18..b02eed12bfc5 100644 --- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c +++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | |||
@@ -108,10 +108,6 @@ static int sxgbe_platform_probe(struct platform_device *pdev) | |||
108 | } | 108 | } |
109 | } | 109 | } |
110 | 110 | ||
111 | /* Get MAC address if available (DT) */ | ||
112 | if (mac) | ||
113 | ether_addr_copy(priv->dev->dev_addr, mac); | ||
114 | |||
115 | priv = sxgbe_drv_probe(&(pdev->dev), plat_dat, addr); | 111 | priv = sxgbe_drv_probe(&(pdev->dev), plat_dat, addr); |
116 | if (!priv) { | 112 | if (!priv) { |
117 | pr_err("%s: main driver probe failed\n", __func__); | 113 | pr_err("%s: main driver probe failed\n", __func__); |
@@ -125,6 +121,10 @@ static int sxgbe_platform_probe(struct platform_device *pdev) | |||
125 | goto err_drv_remove; | 121 | goto err_drv_remove; |
126 | } | 122 | } |
127 | 123 | ||
124 | /* Get MAC address if available (DT) */ | ||
125 | if (mac) | ||
126 | ether_addr_copy(priv->dev->dev_addr, mac); | ||
127 | |||
128 | /* Get the TX/RX IRQ numbers */ | 128 | /* Get the TX/RX IRQ numbers */ |
129 | for (i = 0, chan = 1; i < SXGBE_TX_QUEUES; i++) { | 129 | for (i = 0, chan = 1; i < SXGBE_TX_QUEUES; i++) { |
130 | priv->txq[i]->irq_no = irq_of_parse_and_map(node, chan++); | 130 | priv->txq[i]->irq_no = irq_of_parse_and_map(node, chan++); |
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 64d1cef4cda1..e068d48b0f21 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c | |||
@@ -1634,16 +1634,24 @@ static inline int cpsw_add_vlan_ale_entry(struct cpsw_priv *priv, | |||
1634 | unsigned short vid) | 1634 | unsigned short vid) |
1635 | { | 1635 | { |
1636 | int ret; | 1636 | int ret; |
1637 | int unreg_mcast_mask; | 1637 | int unreg_mcast_mask = 0; |
1638 | u32 port_mask; | ||
1638 | 1639 | ||
1639 | if (priv->ndev->flags & IFF_ALLMULTI) | 1640 | if (priv->data.dual_emac) { |
1640 | unreg_mcast_mask = ALE_ALL_PORTS; | 1641 | port_mask = (1 << (priv->emac_port + 1)) | ALE_PORT_HOST; |
1641 | else | 1642 | |
1642 | unreg_mcast_mask = ALE_PORT_1 | ALE_PORT_2; | 1643 | if (priv->ndev->flags & IFF_ALLMULTI) |
1644 | unreg_mcast_mask = port_mask; | ||
1645 | } else { | ||
1646 | port_mask = ALE_ALL_PORTS; | ||
1647 | |||
1648 | if (priv->ndev->flags & IFF_ALLMULTI) | ||
1649 | unreg_mcast_mask = ALE_ALL_PORTS; | ||
1650 | else | ||
1651 | unreg_mcast_mask = ALE_PORT_1 | ALE_PORT_2; | ||
1652 | } | ||
1643 | 1653 | ||
1644 | ret = cpsw_ale_add_vlan(priv->ale, vid, | 1654 | ret = cpsw_ale_add_vlan(priv->ale, vid, port_mask, 0, port_mask, |
1645 | ALE_ALL_PORTS << priv->host_port, | ||
1646 | 0, ALE_ALL_PORTS << priv->host_port, | ||
1647 | unreg_mcast_mask << priv->host_port); | 1655 | unreg_mcast_mask << priv->host_port); |
1648 | if (ret != 0) | 1656 | if (ret != 0) |
1649 | return ret; | 1657 | return ret; |
@@ -1654,8 +1662,7 @@ static inline int cpsw_add_vlan_ale_entry(struct cpsw_priv *priv, | |||
1654 | goto clean_vid; | 1662 | goto clean_vid; |
1655 | 1663 | ||
1656 | ret = cpsw_ale_add_mcast(priv->ale, priv->ndev->broadcast, | 1664 | ret = cpsw_ale_add_mcast(priv->ale, priv->ndev->broadcast, |
1657 | ALE_ALL_PORTS << priv->host_port, | 1665 | port_mask, ALE_VLAN, vid, 0); |
1658 | ALE_VLAN, vid, 0); | ||
1659 | if (ret != 0) | 1666 | if (ret != 0) |
1660 | goto clean_vlan_ucast; | 1667 | goto clean_vlan_ucast; |
1661 | return 0; | 1668 | return 0; |
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index ea712512c7d1..5fae4354722c 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/of.h> | 62 | #include <linux/of.h> |
63 | #include <linux/of_address.h> | 63 | #include <linux/of_address.h> |
64 | #include <linux/of_device.h> | 64 | #include <linux/of_device.h> |
65 | #include <linux/of_mdio.h> | ||
65 | #include <linux/of_irq.h> | 66 | #include <linux/of_irq.h> |
66 | #include <linux/of_net.h> | 67 | #include <linux/of_net.h> |
67 | 68 | ||
@@ -343,9 +344,7 @@ struct emac_priv { | |||
343 | u32 multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS]; | 344 | u32 multicast_hash_cnt[EMAC_NUM_MULTICAST_BITS]; |
344 | u32 rx_addr_type; | 345 | u32 rx_addr_type; |
345 | const char *phy_id; | 346 | const char *phy_id; |
346 | #ifdef CONFIG_OF | ||
347 | struct device_node *phy_node; | 347 | struct device_node *phy_node; |
348 | #endif | ||
349 | struct phy_device *phydev; | 348 | struct phy_device *phydev; |
350 | spinlock_t lock; | 349 | spinlock_t lock; |
351 | /*platform specific members*/ | 350 | /*platform specific members*/ |
@@ -922,6 +921,16 @@ static void emac_int_disable(struct emac_priv *priv) | |||
922 | if (priv->int_disable) | 921 | if (priv->int_disable) |
923 | priv->int_disable(); | 922 | priv->int_disable(); |
924 | 923 | ||
924 | /* NOTE: Rx Threshold and Misc interrupts are not enabled */ | ||
925 | |||
926 | /* ack rxen only then a new pulse will be generated */ | ||
927 | emac_write(EMAC_DM646X_MACEOIVECTOR, | ||
928 | EMAC_DM646X_MAC_EOI_C0_RXEN); | ||
929 | |||
930 | /* ack txen- only then a new pulse will be generated */ | ||
931 | emac_write(EMAC_DM646X_MACEOIVECTOR, | ||
932 | EMAC_DM646X_MAC_EOI_C0_TXEN); | ||
933 | |||
925 | local_irq_restore(flags); | 934 | local_irq_restore(flags); |
926 | 935 | ||
927 | } else { | 936 | } else { |
@@ -951,15 +960,6 @@ static void emac_int_enable(struct emac_priv *priv) | |||
951 | * register */ | 960 | * register */ |
952 | 961 | ||
953 | /* NOTE: Rx Threshold and Misc interrupts are not enabled */ | 962 | /* NOTE: Rx Threshold and Misc interrupts are not enabled */ |
954 | |||
955 | /* ack rxen only then a new pulse will be generated */ | ||
956 | emac_write(EMAC_DM646X_MACEOIVECTOR, | ||
957 | EMAC_DM646X_MAC_EOI_C0_RXEN); | ||
958 | |||
959 | /* ack txen- only then a new pulse will be generated */ | ||
960 | emac_write(EMAC_DM646X_MACEOIVECTOR, | ||
961 | EMAC_DM646X_MAC_EOI_C0_TXEN); | ||
962 | |||
963 | } else { | 963 | } else { |
964 | /* Set DM644x control registers for interrupt control */ | 964 | /* Set DM644x control registers for interrupt control */ |
965 | emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1); | 965 | emac_ctrl_write(EMAC_CTRL_EWCTL, 0x1); |
@@ -1537,7 +1537,13 @@ static int emac_dev_open(struct net_device *ndev) | |||
1537 | int i = 0; | 1537 | int i = 0; |
1538 | struct emac_priv *priv = netdev_priv(ndev); | 1538 | struct emac_priv *priv = netdev_priv(ndev); |
1539 | 1539 | ||
1540 | pm_runtime_get(&priv->pdev->dev); | 1540 | ret = pm_runtime_get_sync(&priv->pdev->dev); |
1541 | if (ret < 0) { | ||
1542 | pm_runtime_put_noidle(&priv->pdev->dev); | ||
1543 | dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n", | ||
1544 | __func__, ret); | ||
1545 | return ret; | ||
1546 | } | ||
1541 | 1547 | ||
1542 | netif_carrier_off(ndev); | 1548 | netif_carrier_off(ndev); |
1543 | for (cnt = 0; cnt < ETH_ALEN; cnt++) | 1549 | for (cnt = 0; cnt < ETH_ALEN; cnt++) |
@@ -1596,8 +1602,20 @@ static int emac_dev_open(struct net_device *ndev) | |||
1596 | cpdma_ctlr_start(priv->dma); | 1602 | cpdma_ctlr_start(priv->dma); |
1597 | 1603 | ||
1598 | priv->phydev = NULL; | 1604 | priv->phydev = NULL; |
1605 | |||
1606 | if (priv->phy_node) { | ||
1607 | priv->phydev = of_phy_connect(ndev, priv->phy_node, | ||
1608 | &emac_adjust_link, 0, 0); | ||
1609 | if (!priv->phydev) { | ||
1610 | dev_err(emac_dev, "could not connect to phy %s\n", | ||
1611 | priv->phy_node->full_name); | ||
1612 | ret = -ENODEV; | ||
1613 | goto err; | ||
1614 | } | ||
1615 | } | ||
1616 | |||
1599 | /* use the first phy on the bus if pdata did not give us a phy id */ | 1617 | /* use the first phy on the bus if pdata did not give us a phy id */ |
1600 | if (!priv->phy_id) { | 1618 | if (!priv->phydev && !priv->phy_id) { |
1601 | struct device *phy; | 1619 | struct device *phy; |
1602 | 1620 | ||
1603 | phy = bus_find_device(&mdio_bus_type, NULL, NULL, | 1621 | phy = bus_find_device(&mdio_bus_type, NULL, NULL, |
@@ -1606,7 +1624,7 @@ static int emac_dev_open(struct net_device *ndev) | |||
1606 | priv->phy_id = dev_name(phy); | 1624 | priv->phy_id = dev_name(phy); |
1607 | } | 1625 | } |
1608 | 1626 | ||
1609 | if (priv->phy_id && *priv->phy_id) { | 1627 | if (!priv->phydev && priv->phy_id && *priv->phy_id) { |
1610 | priv->phydev = phy_connect(ndev, priv->phy_id, | 1628 | priv->phydev = phy_connect(ndev, priv->phy_id, |
1611 | &emac_adjust_link, | 1629 | &emac_adjust_link, |
1612 | PHY_INTERFACE_MODE_MII); | 1630 | PHY_INTERFACE_MODE_MII); |
@@ -1627,7 +1645,9 @@ static int emac_dev_open(struct net_device *ndev) | |||
1627 | "(mii_bus:phy_addr=%s, id=%x)\n", | 1645 | "(mii_bus:phy_addr=%s, id=%x)\n", |
1628 | priv->phydev->drv->name, dev_name(&priv->phydev->dev), | 1646 | priv->phydev->drv->name, dev_name(&priv->phydev->dev), |
1629 | priv->phydev->phy_id); | 1647 | priv->phydev->phy_id); |
1630 | } else { | 1648 | } |
1649 | |||
1650 | if (!priv->phydev) { | ||
1631 | /* No PHY , fix the link, speed and duplex settings */ | 1651 | /* No PHY , fix the link, speed and duplex settings */ |
1632 | dev_notice(emac_dev, "no phy, defaulting to 100/full\n"); | 1652 | dev_notice(emac_dev, "no phy, defaulting to 100/full\n"); |
1633 | priv->link = 1; | 1653 | priv->link = 1; |
@@ -1724,6 +1744,15 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev) | |||
1724 | struct emac_priv *priv = netdev_priv(ndev); | 1744 | struct emac_priv *priv = netdev_priv(ndev); |
1725 | u32 mac_control; | 1745 | u32 mac_control; |
1726 | u32 stats_clear_mask; | 1746 | u32 stats_clear_mask; |
1747 | int err; | ||
1748 | |||
1749 | err = pm_runtime_get_sync(&priv->pdev->dev); | ||
1750 | if (err < 0) { | ||
1751 | pm_runtime_put_noidle(&priv->pdev->dev); | ||
1752 | dev_err(&priv->pdev->dev, "%s: failed to get_sync(%d)\n", | ||
1753 | __func__, err); | ||
1754 | return &ndev->stats; | ||
1755 | } | ||
1727 | 1756 | ||
1728 | /* update emac hardware stats and reset the registers*/ | 1757 | /* update emac hardware stats and reset the registers*/ |
1729 | 1758 | ||
@@ -1766,6 +1795,8 @@ static struct net_device_stats *emac_dev_getnetstats(struct net_device *ndev) | |||
1766 | ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN); | 1795 | ndev->stats.tx_fifo_errors += emac_read(EMAC_TXUNDERRUN); |
1767 | emac_write(EMAC_TXUNDERRUN, stats_clear_mask); | 1796 | emac_write(EMAC_TXUNDERRUN, stats_clear_mask); |
1768 | 1797 | ||
1798 | pm_runtime_put(&priv->pdev->dev); | ||
1799 | |||
1769 | return &ndev->stats; | 1800 | return &ndev->stats; |
1770 | } | 1801 | } |
1771 | 1802 | ||
@@ -1859,7 +1890,7 @@ davinci_emac_of_get_pdata(struct platform_device *pdev, struct emac_priv *priv) | |||
1859 | static int davinci_emac_probe(struct platform_device *pdev) | 1890 | static int davinci_emac_probe(struct platform_device *pdev) |
1860 | { | 1891 | { |
1861 | int rc = 0; | 1892 | int rc = 0; |
1862 | struct resource *res; | 1893 | struct resource *res, *res_ctrl; |
1863 | struct net_device *ndev; | 1894 | struct net_device *ndev; |
1864 | struct emac_priv *priv; | 1895 | struct emac_priv *priv; |
1865 | unsigned long hw_ram_addr; | 1896 | unsigned long hw_ram_addr; |
@@ -1876,6 +1907,7 @@ static int davinci_emac_probe(struct platform_device *pdev) | |||
1876 | return -EBUSY; | 1907 | return -EBUSY; |
1877 | } | 1908 | } |
1878 | emac_bus_frequency = clk_get_rate(emac_clk); | 1909 | emac_bus_frequency = clk_get_rate(emac_clk); |
1910 | devm_clk_put(&pdev->dev, emac_clk); | ||
1879 | 1911 | ||
1880 | /* TODO: Probe PHY here if possible */ | 1912 | /* TODO: Probe PHY here if possible */ |
1881 | 1913 | ||
@@ -1917,11 +1949,20 @@ static int davinci_emac_probe(struct platform_device *pdev) | |||
1917 | rc = PTR_ERR(priv->remap_addr); | 1949 | rc = PTR_ERR(priv->remap_addr); |
1918 | goto no_pdata; | 1950 | goto no_pdata; |
1919 | } | 1951 | } |
1952 | |||
1953 | res_ctrl = platform_get_resource(pdev, IORESOURCE_MEM, 1); | ||
1954 | if (res_ctrl) { | ||
1955 | priv->ctrl_base = | ||
1956 | devm_ioremap_resource(&pdev->dev, res_ctrl); | ||
1957 | if (IS_ERR(priv->ctrl_base)) | ||
1958 | goto no_pdata; | ||
1959 | } else { | ||
1960 | priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset; | ||
1961 | } | ||
1962 | |||
1920 | priv->emac_base = priv->remap_addr + pdata->ctrl_reg_offset; | 1963 | priv->emac_base = priv->remap_addr + pdata->ctrl_reg_offset; |
1921 | ndev->base_addr = (unsigned long)priv->remap_addr; | 1964 | ndev->base_addr = (unsigned long)priv->remap_addr; |
1922 | 1965 | ||
1923 | priv->ctrl_base = priv->remap_addr + pdata->ctrl_mod_reg_offset; | ||
1924 | |||
1925 | hw_ram_addr = pdata->hw_ram_addr; | 1966 | hw_ram_addr = pdata->hw_ram_addr; |
1926 | if (!hw_ram_addr) | 1967 | if (!hw_ram_addr) |
1927 | hw_ram_addr = (u32 __force)res->start + pdata->ctrl_ram_offset; | 1968 | hw_ram_addr = (u32 __force)res->start + pdata->ctrl_ram_offset; |
@@ -1980,12 +2021,22 @@ static int davinci_emac_probe(struct platform_device *pdev) | |||
1980 | ndev->ethtool_ops = ðtool_ops; | 2021 | ndev->ethtool_ops = ðtool_ops; |
1981 | netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT); | 2022 | netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT); |
1982 | 2023 | ||
2024 | pm_runtime_enable(&pdev->dev); | ||
2025 | rc = pm_runtime_get_sync(&pdev->dev); | ||
2026 | if (rc < 0) { | ||
2027 | pm_runtime_put_noidle(&pdev->dev); | ||
2028 | dev_err(&pdev->dev, "%s: failed to get_sync(%d)\n", | ||
2029 | __func__, rc); | ||
2030 | goto no_cpdma_chan; | ||
2031 | } | ||
2032 | |||
1983 | /* register the network device */ | 2033 | /* register the network device */ |
1984 | SET_NETDEV_DEV(ndev, &pdev->dev); | 2034 | SET_NETDEV_DEV(ndev, &pdev->dev); |
1985 | rc = register_netdev(ndev); | 2035 | rc = register_netdev(ndev); |
1986 | if (rc) { | 2036 | if (rc) { |
1987 | dev_err(&pdev->dev, "error in register_netdev\n"); | 2037 | dev_err(&pdev->dev, "error in register_netdev\n"); |
1988 | rc = -ENODEV; | 2038 | rc = -ENODEV; |
2039 | pm_runtime_put(&pdev->dev); | ||
1989 | goto no_cpdma_chan; | 2040 | goto no_cpdma_chan; |
1990 | } | 2041 | } |
1991 | 2042 | ||
@@ -1995,9 +2046,7 @@ static int davinci_emac_probe(struct platform_device *pdev) | |||
1995 | "(regs: %p, irq: %d)\n", | 2046 | "(regs: %p, irq: %d)\n", |
1996 | (void *)priv->emac_base_phys, ndev->irq); | 2047 | (void *)priv->emac_base_phys, ndev->irq); |
1997 | } | 2048 | } |
1998 | 2049 | pm_runtime_put(&pdev->dev); | |
1999 | pm_runtime_enable(&pdev->dev); | ||
2000 | pm_runtime_resume(&pdev->dev); | ||
2001 | 2050 | ||
2002 | return 0; | 2051 | return 0; |
2003 | 2052 | ||
@@ -2071,9 +2120,14 @@ static const struct emac_platform_data am3517_emac_data = { | |||
2071 | .hw_ram_addr = 0x01e20000, | 2120 | .hw_ram_addr = 0x01e20000, |
2072 | }; | 2121 | }; |
2073 | 2122 | ||
2123 | static const struct emac_platform_data dm816_emac_data = { | ||
2124 | .version = EMAC_VERSION_2, | ||
2125 | }; | ||
2126 | |||
2074 | static const struct of_device_id davinci_emac_of_match[] = { | 2127 | static const struct of_device_id davinci_emac_of_match[] = { |
2075 | {.compatible = "ti,davinci-dm6467-emac", }, | 2128 | {.compatible = "ti,davinci-dm6467-emac", }, |
2076 | {.compatible = "ti,am3517-emac", .data = &am3517_emac_data, }, | 2129 | {.compatible = "ti,am3517-emac", .data = &am3517_emac_data, }, |
2130 | {.compatible = "ti,dm816-emac", .data = &dm816_emac_data, }, | ||
2077 | {}, | 2131 | {}, |
2078 | }; | 2132 | }; |
2079 | MODULE_DEVICE_TABLE(of, davinci_emac_of_match); | 2133 | MODULE_DEVICE_TABLE(of, davinci_emac_of_match); |
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c index 57ec23e8ccfa..bf405f134d3a 100644 --- a/drivers/net/usb/r8152.c +++ b/drivers/net/usb/r8152.c | |||
@@ -833,9 +833,6 @@ static void ocp_write_word(struct r8152 *tp, u16 type, u16 index, u32 data) | |||
833 | index &= ~3; | 833 | index &= ~3; |
834 | } | 834 | } |
835 | 835 | ||
836 | generic_ocp_read(tp, index, sizeof(tmp), &tmp, type); | ||
837 | |||
838 | data |= __le32_to_cpu(tmp) & ~mask; | ||
839 | tmp = __cpu_to_le32(data); | 836 | tmp = __cpu_to_le32(data); |
840 | 837 | ||
841 | generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type); | 838 | generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type); |
@@ -874,9 +871,6 @@ static void ocp_write_byte(struct r8152 *tp, u16 type, u16 index, u32 data) | |||
874 | index &= ~3; | 871 | index &= ~3; |
875 | } | 872 | } |
876 | 873 | ||
877 | generic_ocp_read(tp, index, sizeof(tmp), &tmp, type); | ||
878 | |||
879 | data |= __le32_to_cpu(tmp) & ~mask; | ||
880 | tmp = __cpu_to_le32(data); | 874 | tmp = __cpu_to_le32(data); |
881 | 875 | ||
882 | generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type); | 876 | generic_ocp_write(tp, index, byen, sizeof(tmp), &tmp, type); |
@@ -926,12 +920,6 @@ static void sram_write(struct r8152 *tp, u16 addr, u16 data) | |||
926 | ocp_reg_write(tp, OCP_SRAM_DATA, data); | 920 | ocp_reg_write(tp, OCP_SRAM_DATA, data); |
927 | } | 921 | } |
928 | 922 | ||
929 | static u16 sram_read(struct r8152 *tp, u16 addr) | ||
930 | { | ||
931 | ocp_reg_write(tp, OCP_SRAM_ADDR, addr); | ||
932 | return ocp_reg_read(tp, OCP_SRAM_DATA); | ||
933 | } | ||
934 | |||
935 | static int read_mii_word(struct net_device *netdev, int phy_id, int reg) | 923 | static int read_mii_word(struct net_device *netdev, int phy_id, int reg) |
936 | { | 924 | { |
937 | struct r8152 *tp = netdev_priv(netdev); | 925 | struct r8152 *tp = netdev_priv(netdev); |
@@ -2518,24 +2506,18 @@ static void r8153_hw_phy_cfg(struct r8152 *tp) | |||
2518 | data = ocp_reg_read(tp, OCP_POWER_CFG); | 2506 | data = ocp_reg_read(tp, OCP_POWER_CFG); |
2519 | data |= EN_10M_PLLOFF; | 2507 | data |= EN_10M_PLLOFF; |
2520 | ocp_reg_write(tp, OCP_POWER_CFG, data); | 2508 | ocp_reg_write(tp, OCP_POWER_CFG, data); |
2521 | data = sram_read(tp, SRAM_IMPEDANCE); | 2509 | sram_write(tp, SRAM_IMPEDANCE, 0x0b13); |
2522 | data &= ~RX_DRIVING_MASK; | ||
2523 | sram_write(tp, SRAM_IMPEDANCE, data); | ||
2524 | 2510 | ||
2525 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR); | 2511 | ocp_data = ocp_read_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR); |
2526 | ocp_data |= PFM_PWM_SWITCH; | 2512 | ocp_data |= PFM_PWM_SWITCH; |
2527 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data); | 2513 | ocp_write_word(tp, MCU_TYPE_PLA, PLA_PHY_PWR, ocp_data); |
2528 | 2514 | ||
2529 | data = sram_read(tp, SRAM_LPF_CFG); | 2515 | /* Enable LPF corner auto tune */ |
2530 | data |= LPF_AUTO_TUNE; | 2516 | sram_write(tp, SRAM_LPF_CFG, 0xf70f); |
2531 | sram_write(tp, SRAM_LPF_CFG, data); | ||
2532 | 2517 | ||
2533 | data = sram_read(tp, SRAM_10M_AMP1); | 2518 | /* Adjust 10M Amplitude */ |
2534 | data |= GDAC_IB_UPALL; | 2519 | sram_write(tp, SRAM_10M_AMP1, 0x00af); |
2535 | sram_write(tp, SRAM_10M_AMP1, data); | 2520 | sram_write(tp, SRAM_10M_AMP2, 0x0208); |
2536 | data = sram_read(tp, SRAM_10M_AMP2); | ||
2537 | data |= AMP_DN; | ||
2538 | sram_write(tp, SRAM_10M_AMP2, data); | ||
2539 | 2521 | ||
2540 | set_bit(PHY_RESET, &tp->flags); | 2522 | set_bit(PHY_RESET, &tp->flags); |
2541 | } | 2523 | } |
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c index ea63fbd228ed..352b4f28f82c 100644 --- a/drivers/of/overlay.c +++ b/drivers/of/overlay.c | |||
@@ -114,17 +114,6 @@ static int of_overlay_apply_single_device_node(struct of_overlay *ov, | |||
114 | ret = of_overlay_apply_one(ov, tchild, child); | 114 | ret = of_overlay_apply_one(ov, tchild, child); |
115 | if (ret) | 115 | if (ret) |
116 | return ret; | 116 | return ret; |
117 | |||
118 | /* The properties are already copied, now do the child nodes */ | ||
119 | for_each_child_of_node(child, grandchild) { | ||
120 | ret = of_overlay_apply_single_device_node(ov, tchild, grandchild); | ||
121 | if (ret) { | ||
122 | pr_err("%s: Failed to apply single node @%s/%s\n", | ||
123 | __func__, tchild->full_name, | ||
124 | grandchild->name); | ||
125 | return ret; | ||
126 | } | ||
127 | } | ||
128 | } | 117 | } |
129 | 118 | ||
130 | return ret; | 119 | return ret; |
diff --git a/drivers/of/platform.c b/drivers/of/platform.c index 5b33c6a21807..b0d50d70a8a1 100644 --- a/drivers/of/platform.c +++ b/drivers/of/platform.c | |||
@@ -188,7 +188,7 @@ static void of_dma_configure(struct device *dev) | |||
188 | size = dev->coherent_dma_mask; | 188 | size = dev->coherent_dma_mask; |
189 | } else { | 189 | } else { |
190 | offset = PFN_DOWN(paddr - dma_addr); | 190 | offset = PFN_DOWN(paddr - dma_addr); |
191 | dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", dev->dma_pfn_offset); | 191 | dev_dbg(dev, "dma_pfn_offset(%#08lx)\n", offset); |
192 | } | 192 | } |
193 | dev->dma_pfn_offset = offset; | 193 | dev->dma_pfn_offset = offset; |
194 | 194 | ||
@@ -566,6 +566,10 @@ static int of_platform_notify(struct notifier_block *nb, | |||
566 | if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS)) | 566 | if (!of_node_check_flag(rd->dn->parent, OF_POPULATED_BUS)) |
567 | return NOTIFY_OK; /* not for us */ | 567 | return NOTIFY_OK; /* not for us */ |
568 | 568 | ||
569 | /* already populated? (driver using of_populate manually) */ | ||
570 | if (of_node_check_flag(rd->dn, OF_POPULATED)) | ||
571 | return NOTIFY_OK; | ||
572 | |||
569 | /* pdev_parent may be NULL when no bus platform device */ | 573 | /* pdev_parent may be NULL when no bus platform device */ |
570 | pdev_parent = of_find_device_by_node(rd->dn->parent); | 574 | pdev_parent = of_find_device_by_node(rd->dn->parent); |
571 | pdev = of_platform_device_create(rd->dn, NULL, | 575 | pdev = of_platform_device_create(rd->dn, NULL, |
@@ -581,6 +585,11 @@ static int of_platform_notify(struct notifier_block *nb, | |||
581 | break; | 585 | break; |
582 | 586 | ||
583 | case OF_RECONFIG_CHANGE_REMOVE: | 587 | case OF_RECONFIG_CHANGE_REMOVE: |
588 | |||
589 | /* already depopulated? */ | ||
590 | if (!of_node_check_flag(rd->dn, OF_POPULATED)) | ||
591 | return NOTIFY_OK; | ||
592 | |||
584 | /* find our device by node */ | 593 | /* find our device by node */ |
585 | pdev = of_find_device_by_node(rd->dn); | 594 | pdev = of_find_device_by_node(rd->dn); |
586 | if (pdev == NULL) | 595 | if (pdev == NULL) |
diff --git a/drivers/of/unittest-data/tests-overlay.dtsi b/drivers/of/unittest-data/tests-overlay.dtsi index 75976da22b2e..a2b687d5f324 100644 --- a/drivers/of/unittest-data/tests-overlay.dtsi +++ b/drivers/of/unittest-data/tests-overlay.dtsi | |||
@@ -176,5 +176,60 @@ | |||
176 | }; | 176 | }; |
177 | }; | 177 | }; |
178 | 178 | ||
179 | overlay10 { | ||
180 | fragment@0 { | ||
181 | target-path = "/testcase-data/overlay-node/test-bus"; | ||
182 | __overlay__ { | ||
183 | |||
184 | /* suppress DTC warning */ | ||
185 | #address-cells = <1>; | ||
186 | #size-cells = <0>; | ||
187 | |||
188 | test-selftest10 { | ||
189 | compatible = "selftest"; | ||
190 | status = "okay"; | ||
191 | reg = <10>; | ||
192 | |||
193 | #address-cells = <1>; | ||
194 | #size-cells = <0>; | ||
195 | |||
196 | test-selftest101 { | ||
197 | compatible = "selftest"; | ||
198 | status = "okay"; | ||
199 | reg = <1>; | ||
200 | }; | ||
201 | |||
202 | }; | ||
203 | }; | ||
204 | }; | ||
205 | }; | ||
206 | |||
207 | overlay11 { | ||
208 | fragment@0 { | ||
209 | target-path = "/testcase-data/overlay-node/test-bus"; | ||
210 | __overlay__ { | ||
211 | |||
212 | /* suppress DTC warning */ | ||
213 | #address-cells = <1>; | ||
214 | #size-cells = <0>; | ||
215 | |||
216 | test-selftest11 { | ||
217 | compatible = "selftest"; | ||
218 | status = "okay"; | ||
219 | reg = <11>; | ||
220 | |||
221 | #address-cells = <1>; | ||
222 | #size-cells = <0>; | ||
223 | |||
224 | test-selftest111 { | ||
225 | compatible = "selftest"; | ||
226 | status = "okay"; | ||
227 | reg = <1>; | ||
228 | }; | ||
229 | |||
230 | }; | ||
231 | }; | ||
232 | }; | ||
233 | }; | ||
179 | }; | 234 | }; |
180 | }; | 235 | }; |
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c index 844838e11ef1..41a4a138f53b 100644 --- a/drivers/of/unittest.c +++ b/drivers/of/unittest.c | |||
@@ -978,6 +978,9 @@ static int selftest_probe(struct platform_device *pdev) | |||
978 | } | 978 | } |
979 | 979 | ||
980 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); | 980 | dev_dbg(dev, "%s for node @%s\n", __func__, np->full_name); |
981 | |||
982 | of_platform_populate(np, NULL, NULL, &pdev->dev); | ||
983 | |||
981 | return 0; | 984 | return 0; |
982 | } | 985 | } |
983 | 986 | ||
@@ -1385,6 +1388,39 @@ static void of_selftest_overlay_8(void) | |||
1385 | selftest(1, "overlay test %d passed\n", 8); | 1388 | selftest(1, "overlay test %d passed\n", 8); |
1386 | } | 1389 | } |
1387 | 1390 | ||
1391 | /* test insertion of a bus with parent devices */ | ||
1392 | static void of_selftest_overlay_10(void) | ||
1393 | { | ||
1394 | int ret; | ||
1395 | char *child_path; | ||
1396 | |||
1397 | /* device should disable */ | ||
1398 | ret = of_selftest_apply_overlay_check(10, 10, 0, 1); | ||
1399 | if (selftest(ret == 0, "overlay test %d failed; overlay application\n", 10)) | ||
1400 | return; | ||
1401 | |||
1402 | child_path = kasprintf(GFP_KERNEL, "%s/test-selftest101", | ||
1403 | selftest_path(10)); | ||
1404 | if (selftest(child_path, "overlay test %d failed; kasprintf\n", 10)) | ||
1405 | return; | ||
1406 | |||
1407 | ret = of_path_platform_device_exists(child_path); | ||
1408 | kfree(child_path); | ||
1409 | if (selftest(ret, "overlay test %d failed; no child device\n", 10)) | ||
1410 | return; | ||
1411 | } | ||
1412 | |||
1413 | /* test insertion of a bus with parent devices (and revert) */ | ||
1414 | static void of_selftest_overlay_11(void) | ||
1415 | { | ||
1416 | int ret; | ||
1417 | |||
1418 | /* device should disable */ | ||
1419 | ret = of_selftest_apply_revert_overlay_check(11, 11, 0, 1); | ||
1420 | if (selftest(ret == 0, "overlay test %d failed; overlay application\n", 11)) | ||
1421 | return; | ||
1422 | } | ||
1423 | |||
1388 | static void __init of_selftest_overlay(void) | 1424 | static void __init of_selftest_overlay(void) |
1389 | { | 1425 | { |
1390 | struct device_node *bus_np = NULL; | 1426 | struct device_node *bus_np = NULL; |
@@ -1433,6 +1469,9 @@ static void __init of_selftest_overlay(void) | |||
1433 | of_selftest_overlay_6(); | 1469 | of_selftest_overlay_6(); |
1434 | of_selftest_overlay_8(); | 1470 | of_selftest_overlay_8(); |
1435 | 1471 | ||
1472 | of_selftest_overlay_10(); | ||
1473 | of_selftest_overlay_11(); | ||
1474 | |||
1436 | out: | 1475 | out: |
1437 | of_node_put(bus_np); | 1476 | of_node_put(bus_np); |
1438 | } | 1477 | } |
diff --git a/drivers/parisc/lba_pci.c b/drivers/parisc/lba_pci.c index 37e71ff6408d..dceb9ddfd99a 100644 --- a/drivers/parisc/lba_pci.c +++ b/drivers/parisc/lba_pci.c | |||
@@ -694,9 +694,8 @@ lba_fixup_bus(struct pci_bus *bus) | |||
694 | int i; | 694 | int i; |
695 | /* PCI-PCI Bridge */ | 695 | /* PCI-PCI Bridge */ |
696 | pci_read_bridge_bases(bus); | 696 | pci_read_bridge_bases(bus); |
697 | for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) { | 697 | for (i = PCI_BRIDGE_RESOURCES; i < PCI_NUM_RESOURCES; i++) |
698 | pci_claim_resource(bus->self, i); | 698 | pci_claim_bridge_resource(bus->self, i); |
699 | } | ||
700 | } else { | 699 | } else { |
701 | /* Host-PCI Bridge */ | 700 | /* Host-PCI Bridge */ |
702 | int err; | 701 | int err; |
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index 73aef51a28f0..8fb16188cd82 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -228,6 +228,49 @@ int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
228 | } | 228 | } |
229 | EXPORT_SYMBOL(pci_bus_alloc_resource); | 229 | EXPORT_SYMBOL(pci_bus_alloc_resource); |
230 | 230 | ||
231 | /* | ||
232 | * The @idx resource of @dev should be a PCI-PCI bridge window. If this | ||
233 | * resource fits inside a window of an upstream bridge, do nothing. If it | ||
234 | * overlaps an upstream window but extends outside it, clip the resource so | ||
235 | * it fits completely inside. | ||
236 | */ | ||
237 | bool pci_bus_clip_resource(struct pci_dev *dev, int idx) | ||
238 | { | ||
239 | struct pci_bus *bus = dev->bus; | ||
240 | struct resource *res = &dev->resource[idx]; | ||
241 | struct resource orig_res = *res; | ||
242 | struct resource *r; | ||
243 | int i; | ||
244 | |||
245 | pci_bus_for_each_resource(bus, r, i) { | ||
246 | resource_size_t start, end; | ||
247 | |||
248 | if (!r) | ||
249 | continue; | ||
250 | |||
251 | if (resource_type(res) != resource_type(r)) | ||
252 | continue; | ||
253 | |||
254 | start = max(r->start, res->start); | ||
255 | end = min(r->end, res->end); | ||
256 | |||
257 | if (start > end) | ||
258 | continue; /* no overlap */ | ||
259 | |||
260 | if (res->start == start && res->end == end) | ||
261 | return false; /* no change */ | ||
262 | |||
263 | res->start = start; | ||
264 | res->end = end; | ||
265 | dev_printk(KERN_DEBUG, &dev->dev, "%pR clipped to %pR\n", | ||
266 | &orig_res, res); | ||
267 | |||
268 | return true; | ||
269 | } | ||
270 | |||
271 | return false; | ||
272 | } | ||
273 | |||
231 | void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { } | 274 | void __weak pcibios_resource_survey_bus(struct pci_bus *bus) { } |
232 | 275 | ||
233 | /** | 276 | /** |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index cab05f31223f..e9d4fd861ba1 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -3271,7 +3271,8 @@ static int pci_parent_bus_reset(struct pci_dev *dev, int probe) | |||
3271 | { | 3271 | { |
3272 | struct pci_dev *pdev; | 3272 | struct pci_dev *pdev; |
3273 | 3273 | ||
3274 | if (pci_is_root_bus(dev->bus) || dev->subordinate || !dev->bus->self) | 3274 | if (pci_is_root_bus(dev->bus) || dev->subordinate || |
3275 | !dev->bus->self || dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET) | ||
3275 | return -ENOTTY; | 3276 | return -ENOTTY; |
3276 | 3277 | ||
3277 | list_for_each_entry(pdev, &dev->bus->devices, bus_list) | 3278 | list_for_each_entry(pdev, &dev->bus->devices, bus_list) |
@@ -3305,7 +3306,8 @@ static int pci_dev_reset_slot_function(struct pci_dev *dev, int probe) | |||
3305 | { | 3306 | { |
3306 | struct pci_dev *pdev; | 3307 | struct pci_dev *pdev; |
3307 | 3308 | ||
3308 | if (dev->subordinate || !dev->slot) | 3309 | if (dev->subordinate || !dev->slot || |
3310 | dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET) | ||
3309 | return -ENOTTY; | 3311 | return -ENOTTY; |
3310 | 3312 | ||
3311 | list_for_each_entry(pdev, &dev->bus->devices, bus_list) | 3313 | list_for_each_entry(pdev, &dev->bus->devices, bus_list) |
@@ -3557,6 +3559,20 @@ int pci_try_reset_function(struct pci_dev *dev) | |||
3557 | } | 3559 | } |
3558 | EXPORT_SYMBOL_GPL(pci_try_reset_function); | 3560 | EXPORT_SYMBOL_GPL(pci_try_reset_function); |
3559 | 3561 | ||
3562 | /* Do any devices on or below this bus prevent a bus reset? */ | ||
3563 | static bool pci_bus_resetable(struct pci_bus *bus) | ||
3564 | { | ||
3565 | struct pci_dev *dev; | ||
3566 | |||
3567 | list_for_each_entry(dev, &bus->devices, bus_list) { | ||
3568 | if (dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET || | ||
3569 | (dev->subordinate && !pci_bus_resetable(dev->subordinate))) | ||
3570 | return false; | ||
3571 | } | ||
3572 | |||
3573 | return true; | ||
3574 | } | ||
3575 | |||
3560 | /* Lock devices from the top of the tree down */ | 3576 | /* Lock devices from the top of the tree down */ |
3561 | static void pci_bus_lock(struct pci_bus *bus) | 3577 | static void pci_bus_lock(struct pci_bus *bus) |
3562 | { | 3578 | { |
@@ -3607,6 +3623,22 @@ unlock: | |||
3607 | return 0; | 3623 | return 0; |
3608 | } | 3624 | } |
3609 | 3625 | ||
3626 | /* Do any devices on or below this slot prevent a bus reset? */ | ||
3627 | static bool pci_slot_resetable(struct pci_slot *slot) | ||
3628 | { | ||
3629 | struct pci_dev *dev; | ||
3630 | |||
3631 | list_for_each_entry(dev, &slot->bus->devices, bus_list) { | ||
3632 | if (!dev->slot || dev->slot != slot) | ||
3633 | continue; | ||
3634 | if (dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET || | ||
3635 | (dev->subordinate && !pci_bus_resetable(dev->subordinate))) | ||
3636 | return false; | ||
3637 | } | ||
3638 | |||
3639 | return true; | ||
3640 | } | ||
3641 | |||
3610 | /* Lock devices from the top of the tree down */ | 3642 | /* Lock devices from the top of the tree down */ |
3611 | static void pci_slot_lock(struct pci_slot *slot) | 3643 | static void pci_slot_lock(struct pci_slot *slot) |
3612 | { | 3644 | { |
@@ -3728,7 +3760,7 @@ static int pci_slot_reset(struct pci_slot *slot, int probe) | |||
3728 | { | 3760 | { |
3729 | int rc; | 3761 | int rc; |
3730 | 3762 | ||
3731 | if (!slot) | 3763 | if (!slot || !pci_slot_resetable(slot)) |
3732 | return -ENOTTY; | 3764 | return -ENOTTY; |
3733 | 3765 | ||
3734 | if (!probe) | 3766 | if (!probe) |
@@ -3820,7 +3852,7 @@ EXPORT_SYMBOL_GPL(pci_try_reset_slot); | |||
3820 | 3852 | ||
3821 | static int pci_bus_reset(struct pci_bus *bus, int probe) | 3853 | static int pci_bus_reset(struct pci_bus *bus, int probe) |
3822 | { | 3854 | { |
3823 | if (!bus->self) | 3855 | if (!bus->self || !pci_bus_resetable(bus)) |
3824 | return -ENOTTY; | 3856 | return -ENOTTY; |
3825 | 3857 | ||
3826 | if (probe) | 3858 | if (probe) |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index 8aff29a804ff..d54632a1db43 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -208,6 +208,7 @@ void __pci_bus_size_bridges(struct pci_bus *bus, | |||
208 | void __pci_bus_assign_resources(const struct pci_bus *bus, | 208 | void __pci_bus_assign_resources(const struct pci_bus *bus, |
209 | struct list_head *realloc_head, | 209 | struct list_head *realloc_head, |
210 | struct list_head *fail_head); | 210 | struct list_head *fail_head); |
211 | bool pci_bus_clip_resource(struct pci_dev *dev, int idx); | ||
211 | 212 | ||
212 | /** | 213 | /** |
213 | * pci_ari_enabled - query ARI forwarding status | 214 | * pci_ari_enabled - query ARI forwarding status |
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index ed6f89b6efe5..e52356aa09b8 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -3028,6 +3028,20 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_REALTEK, 0x8169, | |||
3028 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID, | 3028 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_MELLANOX, PCI_ANY_ID, |
3029 | quirk_broken_intx_masking); | 3029 | quirk_broken_intx_masking); |
3030 | 3030 | ||
3031 | static void quirk_no_bus_reset(struct pci_dev *dev) | ||
3032 | { | ||
3033 | dev->dev_flags |= PCI_DEV_FLAGS_NO_BUS_RESET; | ||
3034 | } | ||
3035 | |||
3036 | /* | ||
3037 | * Atheros AR93xx chips do not behave after a bus reset. The device will | ||
3038 | * throw a Link Down error on AER-capable systems and regardless of AER, | ||
3039 | * config space of the device is never accessible again and typically | ||
3040 | * causes the system to hang or reset when access is attempted. | ||
3041 | * http://www.spinics.net/lists/linux-pci/msg34797.html | ||
3042 | */ | ||
3043 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATHEROS, 0x0030, quirk_no_bus_reset); | ||
3044 | |||
3031 | #ifdef CONFIG_ACPI | 3045 | #ifdef CONFIG_ACPI |
3032 | /* | 3046 | /* |
3033 | * Apple: Shutdown Cactus Ridge Thunderbolt controller. | 3047 | * Apple: Shutdown Cactus Ridge Thunderbolt controller. |
diff --git a/drivers/pci/setup-bus.c b/drivers/pci/setup-bus.c index 0482235eee92..e3e17f3c0f0f 100644 --- a/drivers/pci/setup-bus.c +++ b/drivers/pci/setup-bus.c | |||
@@ -530,9 +530,8 @@ EXPORT_SYMBOL(pci_setup_cardbus); | |||
530 | config space writes, so it's quite possible that an I/O window of | 530 | config space writes, so it's quite possible that an I/O window of |
531 | the bridge will have some undesirable address (e.g. 0) after the | 531 | the bridge will have some undesirable address (e.g. 0) after the |
532 | first write. Ditto 64-bit prefetchable MMIO. */ | 532 | first write. Ditto 64-bit prefetchable MMIO. */ |
533 | static void pci_setup_bridge_io(struct pci_bus *bus) | 533 | static void pci_setup_bridge_io(struct pci_dev *bridge) |
534 | { | 534 | { |
535 | struct pci_dev *bridge = bus->self; | ||
536 | struct resource *res; | 535 | struct resource *res; |
537 | struct pci_bus_region region; | 536 | struct pci_bus_region region; |
538 | unsigned long io_mask; | 537 | unsigned long io_mask; |
@@ -545,7 +544,7 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
545 | io_mask = PCI_IO_1K_RANGE_MASK; | 544 | io_mask = PCI_IO_1K_RANGE_MASK; |
546 | 545 | ||
547 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ | 546 | /* Set up the top and bottom of the PCI I/O segment for this bus. */ |
548 | res = bus->resource[0]; | 547 | res = &bridge->resource[PCI_BRIDGE_RESOURCES + 0]; |
549 | pcibios_resource_to_bus(bridge->bus, ®ion, res); | 548 | pcibios_resource_to_bus(bridge->bus, ®ion, res); |
550 | if (res->flags & IORESOURCE_IO) { | 549 | if (res->flags & IORESOURCE_IO) { |
551 | pci_read_config_word(bridge, PCI_IO_BASE, &l); | 550 | pci_read_config_word(bridge, PCI_IO_BASE, &l); |
@@ -568,15 +567,14 @@ static void pci_setup_bridge_io(struct pci_bus *bus) | |||
568 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, io_upper16); | 567 | pci_write_config_dword(bridge, PCI_IO_BASE_UPPER16, io_upper16); |
569 | } | 568 | } |
570 | 569 | ||
571 | static void pci_setup_bridge_mmio(struct pci_bus *bus) | 570 | static void pci_setup_bridge_mmio(struct pci_dev *bridge) |
572 | { | 571 | { |
573 | struct pci_dev *bridge = bus->self; | ||
574 | struct resource *res; | 572 | struct resource *res; |
575 | struct pci_bus_region region; | 573 | struct pci_bus_region region; |
576 | u32 l; | 574 | u32 l; |
577 | 575 | ||
578 | /* Set up the top and bottom of the PCI Memory segment for this bus. */ | 576 | /* Set up the top and bottom of the PCI Memory segment for this bus. */ |
579 | res = bus->resource[1]; | 577 | res = &bridge->resource[PCI_BRIDGE_RESOURCES + 1]; |
580 | pcibios_resource_to_bus(bridge->bus, ®ion, res); | 578 | pcibios_resource_to_bus(bridge->bus, ®ion, res); |
581 | if (res->flags & IORESOURCE_MEM) { | 579 | if (res->flags & IORESOURCE_MEM) { |
582 | l = (region.start >> 16) & 0xfff0; | 580 | l = (region.start >> 16) & 0xfff0; |
@@ -588,9 +586,8 @@ static void pci_setup_bridge_mmio(struct pci_bus *bus) | |||
588 | pci_write_config_dword(bridge, PCI_MEMORY_BASE, l); | 586 | pci_write_config_dword(bridge, PCI_MEMORY_BASE, l); |
589 | } | 587 | } |
590 | 588 | ||
591 | static void pci_setup_bridge_mmio_pref(struct pci_bus *bus) | 589 | static void pci_setup_bridge_mmio_pref(struct pci_dev *bridge) |
592 | { | 590 | { |
593 | struct pci_dev *bridge = bus->self; | ||
594 | struct resource *res; | 591 | struct resource *res; |
595 | struct pci_bus_region region; | 592 | struct pci_bus_region region; |
596 | u32 l, bu, lu; | 593 | u32 l, bu, lu; |
@@ -602,7 +599,7 @@ static void pci_setup_bridge_mmio_pref(struct pci_bus *bus) | |||
602 | 599 | ||
603 | /* Set up PREF base/limit. */ | 600 | /* Set up PREF base/limit. */ |
604 | bu = lu = 0; | 601 | bu = lu = 0; |
605 | res = bus->resource[2]; | 602 | res = &bridge->resource[PCI_BRIDGE_RESOURCES + 2]; |
606 | pcibios_resource_to_bus(bridge->bus, ®ion, res); | 603 | pcibios_resource_to_bus(bridge->bus, ®ion, res); |
607 | if (res->flags & IORESOURCE_PREFETCH) { | 604 | if (res->flags & IORESOURCE_PREFETCH) { |
608 | l = (region.start >> 16) & 0xfff0; | 605 | l = (region.start >> 16) & 0xfff0; |
@@ -630,13 +627,13 @@ static void __pci_setup_bridge(struct pci_bus *bus, unsigned long type) | |||
630 | &bus->busn_res); | 627 | &bus->busn_res); |
631 | 628 | ||
632 | if (type & IORESOURCE_IO) | 629 | if (type & IORESOURCE_IO) |
633 | pci_setup_bridge_io(bus); | 630 | pci_setup_bridge_io(bridge); |
634 | 631 | ||
635 | if (type & IORESOURCE_MEM) | 632 | if (type & IORESOURCE_MEM) |
636 | pci_setup_bridge_mmio(bus); | 633 | pci_setup_bridge_mmio(bridge); |
637 | 634 | ||
638 | if (type & IORESOURCE_PREFETCH) | 635 | if (type & IORESOURCE_PREFETCH) |
639 | pci_setup_bridge_mmio_pref(bus); | 636 | pci_setup_bridge_mmio_pref(bridge); |
640 | 637 | ||
641 | pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl); | 638 | pci_write_config_word(bridge, PCI_BRIDGE_CONTROL, bus->bridge_ctl); |
642 | } | 639 | } |
@@ -649,6 +646,41 @@ void pci_setup_bridge(struct pci_bus *bus) | |||
649 | __pci_setup_bridge(bus, type); | 646 | __pci_setup_bridge(bus, type); |
650 | } | 647 | } |
651 | 648 | ||
649 | |||
650 | int pci_claim_bridge_resource(struct pci_dev *bridge, int i) | ||
651 | { | ||
652 | if (i < PCI_BRIDGE_RESOURCES || i > PCI_BRIDGE_RESOURCE_END) | ||
653 | return 0; | ||
654 | |||
655 | if (pci_claim_resource(bridge, i) == 0) | ||
656 | return 0; /* claimed the window */ | ||
657 | |||
658 | if ((bridge->class >> 8) != PCI_CLASS_BRIDGE_PCI) | ||
659 | return 0; | ||
660 | |||
661 | if (!pci_bus_clip_resource(bridge, i)) | ||
662 | return -EINVAL; /* clipping didn't change anything */ | ||
663 | |||
664 | switch (i - PCI_BRIDGE_RESOURCES) { | ||
665 | case 0: | ||
666 | pci_setup_bridge_io(bridge); | ||
667 | break; | ||
668 | case 1: | ||
669 | pci_setup_bridge_mmio(bridge); | ||
670 | break; | ||
671 | case 2: | ||
672 | pci_setup_bridge_mmio_pref(bridge); | ||
673 | break; | ||
674 | default: | ||
675 | return -EINVAL; | ||
676 | } | ||
677 | |||
678 | if (pci_claim_resource(bridge, i) == 0) | ||
679 | return 0; /* claimed a smaller window */ | ||
680 | |||
681 | return -EINVAL; | ||
682 | } | ||
683 | |||
652 | /* Check whether the bridge supports optional I/O and | 684 | /* Check whether the bridge supports optional I/O and |
653 | prefetchable memory ranges. If not, the respective | 685 | prefetchable memory ranges. If not, the respective |
654 | base/limit registers must be read-only and read as 0. */ | 686 | base/limit registers must be read-only and read as 0. */ |
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index e4f65510c87e..89dca77ca038 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -1801,14 +1801,15 @@ void pinctrl_unregister(struct pinctrl_dev *pctldev) | |||
1801 | if (pctldev == NULL) | 1801 | if (pctldev == NULL) |
1802 | return; | 1802 | return; |
1803 | 1803 | ||
1804 | mutex_lock(&pinctrldev_list_mutex); | ||
1805 | mutex_lock(&pctldev->mutex); | 1804 | mutex_lock(&pctldev->mutex); |
1806 | |||
1807 | pinctrl_remove_device_debugfs(pctldev); | 1805 | pinctrl_remove_device_debugfs(pctldev); |
1806 | mutex_unlock(&pctldev->mutex); | ||
1808 | 1807 | ||
1809 | if (!IS_ERR(pctldev->p)) | 1808 | if (!IS_ERR(pctldev->p)) |
1810 | pinctrl_put(pctldev->p); | 1809 | pinctrl_put(pctldev->p); |
1811 | 1810 | ||
1811 | mutex_lock(&pinctrldev_list_mutex); | ||
1812 | mutex_lock(&pctldev->mutex); | ||
1812 | /* TODO: check that no pinmuxes are still active? */ | 1813 | /* TODO: check that no pinmuxes are still active? */ |
1813 | list_del(&pctldev->node); | 1814 | list_del(&pctldev->node); |
1814 | /* Destroy descriptor tree */ | 1815 | /* Destroy descriptor tree */ |
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index 3c22dbebc80f..43eacc924b7e 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -1398,10 +1398,7 @@ static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
1398 | { | 1398 | { |
1399 | struct irq_chip *chip = irq_get_chip(irq); | 1399 | struct irq_chip *chip = irq_get_chip(irq); |
1400 | struct rockchip_pin_bank *bank = irq_get_handler_data(irq); | 1400 | struct rockchip_pin_bank *bank = irq_get_handler_data(irq); |
1401 | u32 polarity = 0, data = 0; | ||
1402 | u32 pend; | 1401 | u32 pend; |
1403 | bool edge_changed = false; | ||
1404 | unsigned long flags; | ||
1405 | 1402 | ||
1406 | dev_dbg(bank->drvdata->dev, "got irq for bank %s\n", bank->name); | 1403 | dev_dbg(bank->drvdata->dev, "got irq for bank %s\n", bank->name); |
1407 | 1404 | ||
@@ -1409,12 +1406,6 @@ static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
1409 | 1406 | ||
1410 | pend = readl_relaxed(bank->reg_base + GPIO_INT_STATUS); | 1407 | pend = readl_relaxed(bank->reg_base + GPIO_INT_STATUS); |
1411 | 1408 | ||
1412 | if (bank->toggle_edge_mode) { | ||
1413 | polarity = readl_relaxed(bank->reg_base + | ||
1414 | GPIO_INT_POLARITY); | ||
1415 | data = readl_relaxed(bank->reg_base + GPIO_EXT_PORT); | ||
1416 | } | ||
1417 | |||
1418 | while (pend) { | 1409 | while (pend) { |
1419 | unsigned int virq; | 1410 | unsigned int virq; |
1420 | 1411 | ||
@@ -1434,27 +1425,31 @@ static void rockchip_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
1434 | * needs manual intervention. | 1425 | * needs manual intervention. |
1435 | */ | 1426 | */ |
1436 | if (bank->toggle_edge_mode & BIT(irq)) { | 1427 | if (bank->toggle_edge_mode & BIT(irq)) { |
1437 | if (data & BIT(irq)) | 1428 | u32 data, data_old, polarity; |
1438 | polarity &= ~BIT(irq); | 1429 | unsigned long flags; |
1439 | else | ||
1440 | polarity |= BIT(irq); | ||
1441 | 1430 | ||
1442 | edge_changed = true; | 1431 | data = readl_relaxed(bank->reg_base + GPIO_EXT_PORT); |
1443 | } | 1432 | do { |
1433 | spin_lock_irqsave(&bank->slock, flags); | ||
1444 | 1434 | ||
1445 | generic_handle_irq(virq); | 1435 | polarity = readl_relaxed(bank->reg_base + |
1446 | } | 1436 | GPIO_INT_POLARITY); |
1437 | if (data & BIT(irq)) | ||
1438 | polarity &= ~BIT(irq); | ||
1439 | else | ||
1440 | polarity |= BIT(irq); | ||
1441 | writel(polarity, | ||
1442 | bank->reg_base + GPIO_INT_POLARITY); | ||
1447 | 1443 | ||
1448 | if (bank->toggle_edge_mode && edge_changed) { | 1444 | spin_unlock_irqrestore(&bank->slock, flags); |
1449 | /* Interrupt params should only be set with ints disabled */ | ||
1450 | spin_lock_irqsave(&bank->slock, flags); | ||
1451 | 1445 | ||
1452 | data = readl_relaxed(bank->reg_base + GPIO_INTEN); | 1446 | data_old = data; |
1453 | writel_relaxed(0, bank->reg_base + GPIO_INTEN); | 1447 | data = readl_relaxed(bank->reg_base + |
1454 | writel(polarity, bank->reg_base + GPIO_INT_POLARITY); | 1448 | GPIO_EXT_PORT); |
1455 | writel(data, bank->reg_base + GPIO_INTEN); | 1449 | } while ((data & BIT(irq)) != (data_old & BIT(irq))); |
1450 | } | ||
1456 | 1451 | ||
1457 | spin_unlock_irqrestore(&bank->slock, flags); | 1452 | generic_handle_irq(virq); |
1458 | } | 1453 | } |
1459 | 1454 | ||
1460 | chained_irq_exit(chip, desc); | 1455 | chained_irq_exit(chip, desc); |
diff --git a/drivers/pinctrl/pinctrl-xway.c b/drivers/pinctrl/pinctrl-xway.c index c5cef59f5965..779950c62e53 100644 --- a/drivers/pinctrl/pinctrl-xway.c +++ b/drivers/pinctrl/pinctrl-xway.c | |||
@@ -798,10 +798,8 @@ static int pinmux_xway_probe(struct platform_device *pdev) | |||
798 | 798 | ||
799 | /* load the gpio chip */ | 799 | /* load the gpio chip */ |
800 | xway_chip.dev = &pdev->dev; | 800 | xway_chip.dev = &pdev->dev; |
801 | of_gpiochip_add(&xway_chip); | ||
802 | ret = gpiochip_add(&xway_chip); | 801 | ret = gpiochip_add(&xway_chip); |
803 | if (ret) { | 802 | if (ret) { |
804 | of_gpiochip_remove(&xway_chip); | ||
805 | dev_err(&pdev->dev, "Failed to register gpio chip\n"); | 803 | dev_err(&pdev->dev, "Failed to register gpio chip\n"); |
806 | return ret; | 804 | return ret; |
807 | } | 805 | } |
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index e730935fa457..ed7017df065d 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c | |||
@@ -865,10 +865,10 @@ static int msm_ps_hold_restart(struct notifier_block *nb, unsigned long action, | |||
865 | 865 | ||
866 | static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl) | 866 | static void msm_pinctrl_setup_pm_reset(struct msm_pinctrl *pctrl) |
867 | { | 867 | { |
868 | int i = 0; | 868 | int i; |
869 | const struct msm_function *func = pctrl->soc->functions; | 869 | const struct msm_function *func = pctrl->soc->functions; |
870 | 870 | ||
871 | for (; i <= pctrl->soc->nfunctions; i++) | 871 | for (i = 0; i < pctrl->soc->nfunctions; i++) |
872 | if (!strcmp(func[i].name, "ps_hold")) { | 872 | if (!strcmp(func[i].name, "ps_hold")) { |
873 | pctrl->restart_nb.notifier_call = msm_ps_hold_restart; | 873 | pctrl->restart_nb.notifier_call = msm_ps_hold_restart; |
874 | pctrl->restart_nb.priority = 128; | 874 | pctrl->restart_nb.priority = 128; |
diff --git a/include/dt-bindings/interrupt-controller/arm-gic.h b/include/dt-bindings/interrupt-controller/arm-gic.h index 1ea1b702fec2..d4110d5caa3e 100644 --- a/include/dt-bindings/interrupt-controller/arm-gic.h +++ b/include/dt-bindings/interrupt-controller/arm-gic.h | |||
@@ -7,14 +7,14 @@ | |||
7 | 7 | ||
8 | #include <dt-bindings/interrupt-controller/irq.h> | 8 | #include <dt-bindings/interrupt-controller/irq.h> |
9 | 9 | ||
10 | /* interrupt specific cell 0 */ | 10 | /* interrupt specifier cell 0 */ |
11 | 11 | ||
12 | #define GIC_SPI 0 | 12 | #define GIC_SPI 0 |
13 | #define GIC_PPI 1 | 13 | #define GIC_PPI 1 |
14 | 14 | ||
15 | /* | 15 | /* |
16 | * Interrupt specifier cell 2. | 16 | * Interrupt specifier cell 2. |
17 | * The flaggs in irq.h are valid, plus those below. | 17 | * The flags in irq.h are valid, plus those below. |
18 | */ | 18 | */ |
19 | #define GIC_CPU_MASK_RAW(x) ((x) << 8) | 19 | #define GIC_CPU_MASK_RAW(x) ((x) << 8) |
20 | #define GIC_CPU_MASK_SIMPLE(num) GIC_CPU_MASK_RAW((1 << (num)) - 1) | 20 | #define GIC_CPU_MASK_SIMPLE(num) GIC_CPU_MASK_RAW((1 << (num)) - 1) |
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h index 55b685719d52..09460d6d6682 100644 --- a/include/linux/genetlink.h +++ b/include/linux/genetlink.h | |||
@@ -11,6 +11,10 @@ extern void genl_unlock(void); | |||
11 | extern int lockdep_genl_is_held(void); | 11 | extern int lockdep_genl_is_held(void); |
12 | #endif | 12 | #endif |
13 | 13 | ||
14 | /* for synchronisation between af_netlink and genetlink */ | ||
15 | extern atomic_t genl_sk_destructing_cnt; | ||
16 | extern wait_queue_head_t genl_sk_destructing_waitq; | ||
17 | |||
14 | /** | 18 | /** |
15 | * rcu_dereference_genl - rcu_dereference with debug checking | 19 | * rcu_dereference_genl - rcu_dereference with debug checking |
16 | * @p: The pointer to read, prior to dereferencing | 20 | * @p: The pointer to read, prior to dereferencing |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 2d182413b1db..91f705de2c0b 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -231,6 +231,7 @@ enum { | |||
231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity | 231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity |
232 | * led */ | 232 | * led */ |
233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ | 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ |
234 | ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */ | ||
234 | 235 | ||
235 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 236 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
236 | 237 | ||
@@ -422,6 +423,7 @@ enum { | |||
422 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | 423 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ |
423 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ | 424 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ |
424 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ | 425 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ |
426 | ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ | ||
425 | 427 | ||
426 | /* DMA mask for user DMA control: User visible values; DO NOT | 428 | /* DMA mask for user DMA control: User visible values; DO NOT |
427 | renumber */ | 429 | renumber */ |
diff --git a/include/linux/module.h b/include/linux/module.h index ebfb0e153c6a..b653d7c0a05a 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -444,7 +444,7 @@ extern void __module_put_and_exit(struct module *mod, long code) | |||
444 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) | 444 | #define module_put_and_exit(code) __module_put_and_exit(THIS_MODULE, code) |
445 | 445 | ||
446 | #ifdef CONFIG_MODULE_UNLOAD | 446 | #ifdef CONFIG_MODULE_UNLOAD |
447 | unsigned long module_refcount(struct module *mod); | 447 | int module_refcount(struct module *mod); |
448 | void __symbol_put(const char *symbol); | 448 | void __symbol_put(const char *symbol); |
449 | #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) | 449 | #define symbol_put(x) __symbol_put(VMLINUX_SYMBOL_STR(x)) |
450 | void symbol_put_addr(void *addr); | 450 | void symbol_put_addr(void *addr); |
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index 7eeb9bbfb816..f7556261fe3c 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h | |||
@@ -26,7 +26,7 @@ unsigned int arch_mod_section_prepend(struct module *mod, unsigned int section); | |||
26 | void *module_alloc(unsigned long size); | 26 | void *module_alloc(unsigned long size); |
27 | 27 | ||
28 | /* Free memory returned from module_alloc. */ | 28 | /* Free memory returned from module_alloc. */ |
29 | void module_free(struct module *mod, void *module_region); | 29 | void module_memfree(void *module_region); |
30 | 30 | ||
31 | /* | 31 | /* |
32 | * Apply the given relocation to the (simplified) ELF. Return -error | 32 | * Apply the given relocation to the (simplified) ELF. Return -error |
@@ -82,4 +82,6 @@ int module_finalize(const Elf_Ehdr *hdr, | |||
82 | /* Any cleanup needed when module leaves. */ | 82 | /* Any cleanup needed when module leaves. */ |
83 | void module_arch_cleanup(struct module *mod); | 83 | void module_arch_cleanup(struct module *mod); |
84 | 84 | ||
85 | /* Any cleanup before freeing mod->module_init */ | ||
86 | void module_arch_freeing_init(struct module *mod); | ||
85 | #endif | 87 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 360a966a97a5..9603094ed59b 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -175,6 +175,8 @@ enum pci_dev_flags { | |||
175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), | 175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), |
176 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ | 176 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ |
177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), | 177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), |
178 | /* Do not use bus resets for device */ | ||
179 | PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6), | ||
178 | }; | 180 | }; |
179 | 181 | ||
180 | enum pci_irq_reroute_variant { | 182 | enum pci_irq_reroute_variant { |
@@ -1065,6 +1067,7 @@ resource_size_t pcibios_retrieve_fw_addr(struct pci_dev *dev, int idx); | |||
1065 | void pci_bus_assign_resources(const struct pci_bus *bus); | 1067 | void pci_bus_assign_resources(const struct pci_bus *bus); |
1066 | void pci_bus_size_bridges(struct pci_bus *bus); | 1068 | void pci_bus_size_bridges(struct pci_bus *bus); |
1067 | int pci_claim_resource(struct pci_dev *, int); | 1069 | int pci_claim_resource(struct pci_dev *, int); |
1070 | int pci_claim_bridge_resource(struct pci_dev *bridge, int i); | ||
1068 | void pci_assign_unassigned_resources(void); | 1071 | void pci_assign_unassigned_resources(void); |
1069 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); | 1072 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); |
1070 | void pci_assign_unassigned_bus_resources(struct pci_bus *bus); | 1073 | void pci_assign_unassigned_bus_resources(struct pci_bus *bus); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 84125088c309..6c92415311ca 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -27,13 +27,18 @@ struct genl_info; | |||
27 | * @maxattr: maximum number of attributes supported | 27 | * @maxattr: maximum number of attributes supported |
28 | * @netnsok: set to true if the family can handle network | 28 | * @netnsok: set to true if the family can handle network |
29 | * namespaces and should be presented in all of them | 29 | * namespaces and should be presented in all of them |
30 | * @parallel_ops: operations can be called in parallel and aren't | ||
31 | * synchronized by the core genetlink code | ||
30 | * @pre_doit: called before an operation's doit callback, it may | 32 | * @pre_doit: called before an operation's doit callback, it may |
31 | * do additional, common, filtering and return an error | 33 | * do additional, common, filtering and return an error |
32 | * @post_doit: called after an operation's doit callback, it may | 34 | * @post_doit: called after an operation's doit callback, it may |
33 | * undo operations done by pre_doit, for example release locks | 35 | * undo operations done by pre_doit, for example release locks |
34 | * @mcast_bind: a socket bound to the given multicast group (which | 36 | * @mcast_bind: a socket bound to the given multicast group (which |
35 | * is given as the offset into the groups array) | 37 | * is given as the offset into the groups array) |
36 | * @mcast_unbind: a socket was unbound from the given multicast group | 38 | * @mcast_unbind: a socket was unbound from the given multicast group. |
39 | * Note that unbind() will not be called symmetrically if the | ||
40 | * generic netlink family is removed while there are still open | ||
41 | * sockets. | ||
37 | * @attrbuf: buffer to store parsed attributes | 42 | * @attrbuf: buffer to store parsed attributes |
38 | * @family_list: family list | 43 | * @family_list: family list |
39 | * @mcgrps: multicast groups used by this family (private) | 44 | * @mcgrps: multicast groups used by this family (private) |
diff --git a/include/trace/events/kvm.h b/include/trace/events/kvm.h index 6edf1f2028cd..86b399c66c3d 100644 --- a/include/trace/events/kvm.h +++ b/include/trace/events/kvm.h | |||
@@ -146,6 +146,14 @@ TRACE_EVENT(kvm_msi_set_irq, | |||
146 | 146 | ||
147 | #if defined(CONFIG_HAVE_KVM_IRQFD) | 147 | #if defined(CONFIG_HAVE_KVM_IRQFD) |
148 | 148 | ||
149 | #ifdef kvm_irqchips | ||
150 | #define kvm_ack_irq_string "irqchip %s pin %u" | ||
151 | #define kvm_ack_irq_parm __print_symbolic(__entry->irqchip, kvm_irqchips), __entry->pin | ||
152 | #else | ||
153 | #define kvm_ack_irq_string "irqchip %d pin %u" | ||
154 | #define kvm_ack_irq_parm __entry->irqchip, __entry->pin | ||
155 | #endif | ||
156 | |||
149 | TRACE_EVENT(kvm_ack_irq, | 157 | TRACE_EVENT(kvm_ack_irq, |
150 | TP_PROTO(unsigned int irqchip, unsigned int pin), | 158 | TP_PROTO(unsigned int irqchip, unsigned int pin), |
151 | TP_ARGS(irqchip, pin), | 159 | TP_ARGS(irqchip, pin), |
@@ -160,13 +168,7 @@ TRACE_EVENT(kvm_ack_irq, | |||
160 | __entry->pin = pin; | 168 | __entry->pin = pin; |
161 | ), | 169 | ), |
162 | 170 | ||
163 | #ifdef kvm_irqchips | 171 | TP_printk(kvm_ack_irq_string, kvm_ack_irq_parm) |
164 | TP_printk("irqchip %s pin %u", | ||
165 | __print_symbolic(__entry->irqchip, kvm_irqchips), | ||
166 | __entry->pin) | ||
167 | #else | ||
168 | TP_printk("irqchip %d pin %u", __entry->irqchip, __entry->pin) | ||
169 | #endif | ||
170 | ); | 172 | ); |
171 | 173 | ||
172 | #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */ | 174 | #endif /* defined(CONFIG_HAVE_KVM_IRQFD) */ |
diff --git a/include/uapi/linux/can/netlink.h b/include/uapi/linux/can/netlink.h index 3e4323a3918d..94ffe0c83ce7 100644 --- a/include/uapi/linux/can/netlink.h +++ b/include/uapi/linux/can/netlink.h | |||
@@ -98,6 +98,7 @@ struct can_ctrlmode { | |||
98 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ | 98 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ |
99 | #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ | 99 | #define CAN_CTRLMODE_FD 0x20 /* CAN FD mode */ |
100 | #define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */ | 100 | #define CAN_CTRLMODE_PRESUME_ACK 0x40 /* Ignore missing CAN ACKs */ |
101 | #define CAN_CTRLMODE_FD_NON_ISO 0x80 /* CAN FD in non-ISO mode */ | ||
101 | 102 | ||
102 | /* | 103 | /* |
103 | * CAN device statistics | 104 | * CAN device statistics |
diff --git a/include/uapi/linux/uinput.h b/include/uapi/linux/uinput.h index baeab83deb64..013c9d8db372 100644 --- a/include/uapi/linux/uinput.h +++ b/include/uapi/linux/uinput.h | |||
@@ -82,7 +82,7 @@ struct uinput_ff_erase { | |||
82 | * The complete sysfs path is then /sys/devices/virtual/input/--NAME-- | 82 | * The complete sysfs path is then /sys/devices/virtual/input/--NAME-- |
83 | * Usually, it is in the form "inputN" | 83 | * Usually, it is in the form "inputN" |
84 | */ | 84 | */ |
85 | #define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 300, len) | 85 | #define UI_GET_SYSNAME(len) _IOC(_IOC_READ, UINPUT_IOCTL_BASE, 44, len) |
86 | 86 | ||
87 | /** | 87 | /** |
88 | * UI_GET_VERSION - Return version of uinput protocol | 88 | * UI_GET_VERSION - Return version of uinput protocol |
@@ -91,7 +91,7 @@ struct uinput_ff_erase { | |||
91 | * the integer pointed to by the ioctl argument. The protocol version | 91 | * the integer pointed to by the ioctl argument. The protocol version |
92 | * is hard-coded in the kernel and is independent of the uinput device. | 92 | * is hard-coded in the kernel and is independent of the uinput device. |
93 | */ | 93 | */ |
94 | #define UI_GET_VERSION _IOR(UINPUT_IOCTL_BASE, 301, unsigned int) | 94 | #define UI_GET_VERSION _IOR(UINPUT_IOCTL_BASE, 45, unsigned int) |
95 | 95 | ||
96 | /* | 96 | /* |
97 | * To write a force-feedback-capable driver, the upload_effect | 97 | * To write a force-feedback-capable driver, the upload_effect |
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index d6594e457a25..a64e7a207d2b 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c | |||
@@ -163,7 +163,7 @@ bpf_jit_binary_alloc(unsigned int proglen, u8 **image_ptr, | |||
163 | 163 | ||
164 | void bpf_jit_binary_free(struct bpf_binary_header *hdr) | 164 | void bpf_jit_binary_free(struct bpf_binary_header *hdr) |
165 | { | 165 | { |
166 | module_free(NULL, hdr); | 166 | module_memfree(hdr); |
167 | } | 167 | } |
168 | #endif /* CONFIG_BPF_JIT */ | 168 | #endif /* CONFIG_BPF_JIT */ |
169 | 169 | ||
diff --git a/kernel/debug/kdb/kdb_main.c b/kernel/debug/kdb/kdb_main.c index f191bddf64b8..7b40c5f07dce 100644 --- a/kernel/debug/kdb/kdb_main.c +++ b/kernel/debug/kdb/kdb_main.c | |||
@@ -2023,7 +2023,7 @@ static int kdb_lsmod(int argc, const char **argv) | |||
2023 | kdb_printf("%-20s%8u 0x%p ", mod->name, | 2023 | kdb_printf("%-20s%8u 0x%p ", mod->name, |
2024 | mod->core_size, (void *)mod); | 2024 | mod->core_size, (void *)mod); |
2025 | #ifdef CONFIG_MODULE_UNLOAD | 2025 | #ifdef CONFIG_MODULE_UNLOAD |
2026 | kdb_printf("%4ld ", module_refcount(mod)); | 2026 | kdb_printf("%4d ", module_refcount(mod)); |
2027 | #endif | 2027 | #endif |
2028 | if (mod->state == MODULE_STATE_GOING) | 2028 | if (mod->state == MODULE_STATE_GOING) |
2029 | kdb_printf(" (Unloading)"); | 2029 | kdb_printf(" (Unloading)"); |
diff --git a/kernel/kprobes.c b/kernel/kprobes.c index 06f58309fed2..ee619929cf90 100644 --- a/kernel/kprobes.c +++ b/kernel/kprobes.c | |||
@@ -127,7 +127,7 @@ static void *alloc_insn_page(void) | |||
127 | 127 | ||
128 | static void free_insn_page(void *page) | 128 | static void free_insn_page(void *page) |
129 | { | 129 | { |
130 | module_free(NULL, page); | 130 | module_memfree(page); |
131 | } | 131 | } |
132 | 132 | ||
133 | struct kprobe_insn_cache kprobe_insn_slots = { | 133 | struct kprobe_insn_cache kprobe_insn_slots = { |
diff --git a/kernel/module.c b/kernel/module.c index 3965511ae133..d856e96a3cce 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -772,9 +772,18 @@ static int try_stop_module(struct module *mod, int flags, int *forced) | |||
772 | return 0; | 772 | return 0; |
773 | } | 773 | } |
774 | 774 | ||
775 | unsigned long module_refcount(struct module *mod) | 775 | /** |
776 | * module_refcount - return the refcount or -1 if unloading | ||
777 | * | ||
778 | * @mod: the module we're checking | ||
779 | * | ||
780 | * Returns: | ||
781 | * -1 if the module is in the process of unloading | ||
782 | * otherwise the number of references in the kernel to the module | ||
783 | */ | ||
784 | int module_refcount(struct module *mod) | ||
776 | { | 785 | { |
777 | return (unsigned long)atomic_read(&mod->refcnt) - MODULE_REF_BASE; | 786 | return atomic_read(&mod->refcnt) - MODULE_REF_BASE; |
778 | } | 787 | } |
779 | EXPORT_SYMBOL(module_refcount); | 788 | EXPORT_SYMBOL(module_refcount); |
780 | 789 | ||
@@ -856,7 +865,7 @@ static inline void print_unload_info(struct seq_file *m, struct module *mod) | |||
856 | struct module_use *use; | 865 | struct module_use *use; |
857 | int printed_something = 0; | 866 | int printed_something = 0; |
858 | 867 | ||
859 | seq_printf(m, " %lu ", module_refcount(mod)); | 868 | seq_printf(m, " %i ", module_refcount(mod)); |
860 | 869 | ||
861 | /* | 870 | /* |
862 | * Always include a trailing , so userspace can differentiate | 871 | * Always include a trailing , so userspace can differentiate |
@@ -908,7 +917,7 @@ EXPORT_SYMBOL_GPL(symbol_put_addr); | |||
908 | static ssize_t show_refcnt(struct module_attribute *mattr, | 917 | static ssize_t show_refcnt(struct module_attribute *mattr, |
909 | struct module_kobject *mk, char *buffer) | 918 | struct module_kobject *mk, char *buffer) |
910 | { | 919 | { |
911 | return sprintf(buffer, "%lu\n", module_refcount(mk->mod)); | 920 | return sprintf(buffer, "%i\n", module_refcount(mk->mod)); |
912 | } | 921 | } |
913 | 922 | ||
914 | static struct module_attribute modinfo_refcnt = | 923 | static struct module_attribute modinfo_refcnt = |
@@ -1795,7 +1804,7 @@ static void unset_module_core_ro_nx(struct module *mod) { } | |||
1795 | static void unset_module_init_ro_nx(struct module *mod) { } | 1804 | static void unset_module_init_ro_nx(struct module *mod) { } |
1796 | #endif | 1805 | #endif |
1797 | 1806 | ||
1798 | void __weak module_free(struct module *mod, void *module_region) | 1807 | void __weak module_memfree(void *module_region) |
1799 | { | 1808 | { |
1800 | vfree(module_region); | 1809 | vfree(module_region); |
1801 | } | 1810 | } |
@@ -1804,6 +1813,10 @@ void __weak module_arch_cleanup(struct module *mod) | |||
1804 | { | 1813 | { |
1805 | } | 1814 | } |
1806 | 1815 | ||
1816 | void __weak module_arch_freeing_init(struct module *mod) | ||
1817 | { | ||
1818 | } | ||
1819 | |||
1807 | /* Free a module, remove from lists, etc. */ | 1820 | /* Free a module, remove from lists, etc. */ |
1808 | static void free_module(struct module *mod) | 1821 | static void free_module(struct module *mod) |
1809 | { | 1822 | { |
@@ -1841,7 +1854,8 @@ static void free_module(struct module *mod) | |||
1841 | 1854 | ||
1842 | /* This may be NULL, but that's OK */ | 1855 | /* This may be NULL, but that's OK */ |
1843 | unset_module_init_ro_nx(mod); | 1856 | unset_module_init_ro_nx(mod); |
1844 | module_free(mod, mod->module_init); | 1857 | module_arch_freeing_init(mod); |
1858 | module_memfree(mod->module_init); | ||
1845 | kfree(mod->args); | 1859 | kfree(mod->args); |
1846 | percpu_modfree(mod); | 1860 | percpu_modfree(mod); |
1847 | 1861 | ||
@@ -1850,7 +1864,7 @@ static void free_module(struct module *mod) | |||
1850 | 1864 | ||
1851 | /* Finally, free the core (containing the module structure) */ | 1865 | /* Finally, free the core (containing the module structure) */ |
1852 | unset_module_core_ro_nx(mod); | 1866 | unset_module_core_ro_nx(mod); |
1853 | module_free(mod, mod->module_core); | 1867 | module_memfree(mod->module_core); |
1854 | 1868 | ||
1855 | #ifdef CONFIG_MPU | 1869 | #ifdef CONFIG_MPU |
1856 | update_protections(current->mm); | 1870 | update_protections(current->mm); |
@@ -2785,7 +2799,7 @@ static int move_module(struct module *mod, struct load_info *info) | |||
2785 | */ | 2799 | */ |
2786 | kmemleak_ignore(ptr); | 2800 | kmemleak_ignore(ptr); |
2787 | if (!ptr) { | 2801 | if (!ptr) { |
2788 | module_free(mod, mod->module_core); | 2802 | module_memfree(mod->module_core); |
2789 | return -ENOMEM; | 2803 | return -ENOMEM; |
2790 | } | 2804 | } |
2791 | memset(ptr, 0, mod->init_size); | 2805 | memset(ptr, 0, mod->init_size); |
@@ -2930,8 +2944,9 @@ static struct module *layout_and_allocate(struct load_info *info, int flags) | |||
2930 | static void module_deallocate(struct module *mod, struct load_info *info) | 2944 | static void module_deallocate(struct module *mod, struct load_info *info) |
2931 | { | 2945 | { |
2932 | percpu_modfree(mod); | 2946 | percpu_modfree(mod); |
2933 | module_free(mod, mod->module_init); | 2947 | module_arch_freeing_init(mod); |
2934 | module_free(mod, mod->module_core); | 2948 | module_memfree(mod->module_init); |
2949 | module_memfree(mod->module_core); | ||
2935 | } | 2950 | } |
2936 | 2951 | ||
2937 | int __weak module_finalize(const Elf_Ehdr *hdr, | 2952 | int __weak module_finalize(const Elf_Ehdr *hdr, |
@@ -2983,10 +2998,31 @@ static void do_mod_ctors(struct module *mod) | |||
2983 | #endif | 2998 | #endif |
2984 | } | 2999 | } |
2985 | 3000 | ||
3001 | /* For freeing module_init on success, in case kallsyms traversing */ | ||
3002 | struct mod_initfree { | ||
3003 | struct rcu_head rcu; | ||
3004 | void *module_init; | ||
3005 | }; | ||
3006 | |||
3007 | static void do_free_init(struct rcu_head *head) | ||
3008 | { | ||
3009 | struct mod_initfree *m = container_of(head, struct mod_initfree, rcu); | ||
3010 | module_memfree(m->module_init); | ||
3011 | kfree(m); | ||
3012 | } | ||
3013 | |||
2986 | /* This is where the real work happens */ | 3014 | /* This is where the real work happens */ |
2987 | static int do_init_module(struct module *mod) | 3015 | static int do_init_module(struct module *mod) |
2988 | { | 3016 | { |
2989 | int ret = 0; | 3017 | int ret = 0; |
3018 | struct mod_initfree *freeinit; | ||
3019 | |||
3020 | freeinit = kmalloc(sizeof(*freeinit), GFP_KERNEL); | ||
3021 | if (!freeinit) { | ||
3022 | ret = -ENOMEM; | ||
3023 | goto fail; | ||
3024 | } | ||
3025 | freeinit->module_init = mod->module_init; | ||
2990 | 3026 | ||
2991 | /* | 3027 | /* |
2992 | * We want to find out whether @mod uses async during init. Clear | 3028 | * We want to find out whether @mod uses async during init. Clear |
@@ -2999,18 +3035,7 @@ static int do_init_module(struct module *mod) | |||
2999 | if (mod->init != NULL) | 3035 | if (mod->init != NULL) |
3000 | ret = do_one_initcall(mod->init); | 3036 | ret = do_one_initcall(mod->init); |
3001 | if (ret < 0) { | 3037 | if (ret < 0) { |
3002 | /* | 3038 | goto fail_free_freeinit; |
3003 | * Init routine failed: abort. Try to protect us from | ||
3004 | * buggy refcounters. | ||
3005 | */ | ||
3006 | mod->state = MODULE_STATE_GOING; | ||
3007 | synchronize_sched(); | ||
3008 | module_put(mod); | ||
3009 | blocking_notifier_call_chain(&module_notify_list, | ||
3010 | MODULE_STATE_GOING, mod); | ||
3011 | free_module(mod); | ||
3012 | wake_up_all(&module_wq); | ||
3013 | return ret; | ||
3014 | } | 3039 | } |
3015 | if (ret > 0) { | 3040 | if (ret > 0) { |
3016 | pr_warn("%s: '%s'->init suspiciously returned %d, it should " | 3041 | pr_warn("%s: '%s'->init suspiciously returned %d, it should " |
@@ -3055,15 +3080,35 @@ static int do_init_module(struct module *mod) | |||
3055 | mod->strtab = mod->core_strtab; | 3080 | mod->strtab = mod->core_strtab; |
3056 | #endif | 3081 | #endif |
3057 | unset_module_init_ro_nx(mod); | 3082 | unset_module_init_ro_nx(mod); |
3058 | module_free(mod, mod->module_init); | 3083 | module_arch_freeing_init(mod); |
3059 | mod->module_init = NULL; | 3084 | mod->module_init = NULL; |
3060 | mod->init_size = 0; | 3085 | mod->init_size = 0; |
3061 | mod->init_ro_size = 0; | 3086 | mod->init_ro_size = 0; |
3062 | mod->init_text_size = 0; | 3087 | mod->init_text_size = 0; |
3088 | /* | ||
3089 | * We want to free module_init, but be aware that kallsyms may be | ||
3090 | * walking this with preempt disabled. In all the failure paths, | ||
3091 | * we call synchronize_rcu/synchronize_sched, but we don't want | ||
3092 | * to slow down the success path, so use actual RCU here. | ||
3093 | */ | ||
3094 | call_rcu(&freeinit->rcu, do_free_init); | ||
3063 | mutex_unlock(&module_mutex); | 3095 | mutex_unlock(&module_mutex); |
3064 | wake_up_all(&module_wq); | 3096 | wake_up_all(&module_wq); |
3065 | 3097 | ||
3066 | return 0; | 3098 | return 0; |
3099 | |||
3100 | fail_free_freeinit: | ||
3101 | kfree(freeinit); | ||
3102 | fail: | ||
3103 | /* Try to protect us from buggy refcounters. */ | ||
3104 | mod->state = MODULE_STATE_GOING; | ||
3105 | synchronize_sched(); | ||
3106 | module_put(mod); | ||
3107 | blocking_notifier_call_chain(&module_notify_list, | ||
3108 | MODULE_STATE_GOING, mod); | ||
3109 | free_module(mod); | ||
3110 | wake_up_all(&module_wq); | ||
3111 | return ret; | ||
3067 | } | 3112 | } |
3068 | 3113 | ||
3069 | static int may_init_module(void) | 3114 | static int may_init_module(void) |
diff --git a/kernel/params.c b/kernel/params.c index 0af9b2c4e56c..728e05b167de 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -642,12 +642,15 @@ static __modinit int add_sysfs_param(struct module_kobject *mk, | |||
642 | mk->mp->grp.attrs = new_attrs; | 642 | mk->mp->grp.attrs = new_attrs; |
643 | 643 | ||
644 | /* Tack new one on the end. */ | 644 | /* Tack new one on the end. */ |
645 | memset(&mk->mp->attrs[mk->mp->num], 0, sizeof(mk->mp->attrs[0])); | ||
645 | sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr); | 646 | sysfs_attr_init(&mk->mp->attrs[mk->mp->num].mattr.attr); |
646 | mk->mp->attrs[mk->mp->num].param = kp; | 647 | mk->mp->attrs[mk->mp->num].param = kp; |
647 | mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show; | 648 | mk->mp->attrs[mk->mp->num].mattr.show = param_attr_show; |
648 | /* Do not allow runtime DAC changes to make param writable. */ | 649 | /* Do not allow runtime DAC changes to make param writable. */ |
649 | if ((kp->perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0) | 650 | if ((kp->perm & (S_IWUSR | S_IWGRP | S_IWOTH)) != 0) |
650 | mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store; | 651 | mk->mp->attrs[mk->mp->num].mattr.store = param_attr_store; |
652 | else | ||
653 | mk->mp->attrs[mk->mp->num].mattr.store = NULL; | ||
651 | mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name; | 654 | mk->mp->attrs[mk->mp->num].mattr.attr.name = (char *)name; |
652 | mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm; | 655 | mk->mp->attrs[mk->mp->num].mattr.attr.mode = kp->perm; |
653 | mk->mp->num++; | 656 | mk->mp->num++; |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 6202b08f1933..beeeac9e0e3e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -1841,17 +1841,11 @@ static void pool_mayday_timeout(unsigned long __pool) | |||
1841 | * spin_lock_irq(pool->lock) which may be released and regrabbed | 1841 | * spin_lock_irq(pool->lock) which may be released and regrabbed |
1842 | * multiple times. Does GFP_KERNEL allocations. Called only from | 1842 | * multiple times. Does GFP_KERNEL allocations. Called only from |
1843 | * manager. | 1843 | * manager. |
1844 | * | ||
1845 | * Return: | ||
1846 | * %false if no action was taken and pool->lock stayed locked, %true | ||
1847 | * otherwise. | ||
1848 | */ | 1844 | */ |
1849 | static bool maybe_create_worker(struct worker_pool *pool) | 1845 | static void maybe_create_worker(struct worker_pool *pool) |
1850 | __releases(&pool->lock) | 1846 | __releases(&pool->lock) |
1851 | __acquires(&pool->lock) | 1847 | __acquires(&pool->lock) |
1852 | { | 1848 | { |
1853 | if (!need_to_create_worker(pool)) | ||
1854 | return false; | ||
1855 | restart: | 1849 | restart: |
1856 | spin_unlock_irq(&pool->lock); | 1850 | spin_unlock_irq(&pool->lock); |
1857 | 1851 | ||
@@ -1877,7 +1871,6 @@ restart: | |||
1877 | */ | 1871 | */ |
1878 | if (need_to_create_worker(pool)) | 1872 | if (need_to_create_worker(pool)) |
1879 | goto restart; | 1873 | goto restart; |
1880 | return true; | ||
1881 | } | 1874 | } |
1882 | 1875 | ||
1883 | /** | 1876 | /** |
@@ -1897,16 +1890,14 @@ restart: | |||
1897 | * multiple times. Does GFP_KERNEL allocations. | 1890 | * multiple times. Does GFP_KERNEL allocations. |
1898 | * | 1891 | * |
1899 | * Return: | 1892 | * Return: |
1900 | * %false if the pool don't need management and the caller can safely start | 1893 | * %false if the pool doesn't need management and the caller can safely |
1901 | * processing works, %true indicates that the function released pool->lock | 1894 | * start processing works, %true if management function was performed and |
1902 | * and reacquired it to perform some management function and that the | 1895 | * the conditions that the caller verified before calling the function may |
1903 | * conditions that the caller verified while holding the lock before | 1896 | * no longer be true. |
1904 | * calling the function might no longer be true. | ||
1905 | */ | 1897 | */ |
1906 | static bool manage_workers(struct worker *worker) | 1898 | static bool manage_workers(struct worker *worker) |
1907 | { | 1899 | { |
1908 | struct worker_pool *pool = worker->pool; | 1900 | struct worker_pool *pool = worker->pool; |
1909 | bool ret = false; | ||
1910 | 1901 | ||
1911 | /* | 1902 | /* |
1912 | * Anyone who successfully grabs manager_arb wins the arbitration | 1903 | * Anyone who successfully grabs manager_arb wins the arbitration |
@@ -1919,12 +1910,12 @@ static bool manage_workers(struct worker *worker) | |||
1919 | * actual management, the pool may stall indefinitely. | 1910 | * actual management, the pool may stall indefinitely. |
1920 | */ | 1911 | */ |
1921 | if (!mutex_trylock(&pool->manager_arb)) | 1912 | if (!mutex_trylock(&pool->manager_arb)) |
1922 | return ret; | 1913 | return false; |
1923 | 1914 | ||
1924 | ret |= maybe_create_worker(pool); | 1915 | maybe_create_worker(pool); |
1925 | 1916 | ||
1926 | mutex_unlock(&pool->manager_arb); | 1917 | mutex_unlock(&pool->manager_arb); |
1927 | return ret; | 1918 | return true; |
1928 | } | 1919 | } |
1929 | 1920 | ||
1930 | /** | 1921 | /** |
diff --git a/net/core/dev.c b/net/core/dev.c index 683d493aa1bf..171420e75b03 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -7072,10 +7072,20 @@ static int dev_cpu_callback(struct notifier_block *nfb, | |||
7072 | oldsd->output_queue = NULL; | 7072 | oldsd->output_queue = NULL; |
7073 | oldsd->output_queue_tailp = &oldsd->output_queue; | 7073 | oldsd->output_queue_tailp = &oldsd->output_queue; |
7074 | } | 7074 | } |
7075 | /* Append NAPI poll list from offline CPU. */ | 7075 | /* Append NAPI poll list from offline CPU, with one exception : |
7076 | if (!list_empty(&oldsd->poll_list)) { | 7076 | * process_backlog() must be called by cpu owning percpu backlog. |
7077 | list_splice_init(&oldsd->poll_list, &sd->poll_list); | 7077 | * We properly handle process_queue & input_pkt_queue later. |
7078 | raise_softirq_irqoff(NET_RX_SOFTIRQ); | 7078 | */ |
7079 | while (!list_empty(&oldsd->poll_list)) { | ||
7080 | struct napi_struct *napi = list_first_entry(&oldsd->poll_list, | ||
7081 | struct napi_struct, | ||
7082 | poll_list); | ||
7083 | |||
7084 | list_del_init(&napi->poll_list); | ||
7085 | if (napi->poll == process_backlog) | ||
7086 | napi->state = 0; | ||
7087 | else | ||
7088 | ____napi_schedule(sd, napi); | ||
7079 | } | 7089 | } |
7080 | 7090 | ||
7081 | raise_softirq_irqoff(NET_TX_SOFTIRQ); | 7091 | raise_softirq_irqoff(NET_TX_SOFTIRQ); |
@@ -7086,7 +7096,7 @@ static int dev_cpu_callback(struct notifier_block *nfb, | |||
7086 | netif_rx_internal(skb); | 7096 | netif_rx_internal(skb); |
7087 | input_queue_head_incr(oldsd); | 7097 | input_queue_head_incr(oldsd); |
7088 | } | 7098 | } |
7089 | while ((skb = __skb_dequeue(&oldsd->input_pkt_queue))) { | 7099 | while ((skb = skb_dequeue(&oldsd->input_pkt_queue))) { |
7090 | netif_rx_internal(skb); | 7100 | netif_rx_internal(skb); |
7091 | input_queue_head_incr(oldsd); | 7101 | input_queue_head_incr(oldsd); |
7092 | } | 7102 | } |
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c index 8a89c738b7a3..6b85adb05003 100644 --- a/net/ipv4/ip_sockglue.c +++ b/net/ipv4/ip_sockglue.c | |||
@@ -461,17 +461,13 @@ int ip_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
461 | 461 | ||
462 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); | 462 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); |
463 | sin = &errhdr.offender; | 463 | sin = &errhdr.offender; |
464 | sin->sin_family = AF_UNSPEC; | 464 | memset(sin, 0, sizeof(*sin)); |
465 | 465 | ||
466 | if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP || | 466 | if (serr->ee.ee_origin == SO_EE_ORIGIN_ICMP || |
467 | ipv4_pktinfo_prepare_errqueue(sk, skb, serr->ee.ee_origin)) { | 467 | ipv4_pktinfo_prepare_errqueue(sk, skb, serr->ee.ee_origin)) { |
468 | struct inet_sock *inet = inet_sk(sk); | ||
469 | |||
470 | sin->sin_family = AF_INET; | 468 | sin->sin_family = AF_INET; |
471 | sin->sin_addr.s_addr = ip_hdr(skb)->saddr; | 469 | sin->sin_addr.s_addr = ip_hdr(skb)->saddr; |
472 | sin->sin_port = 0; | 470 | if (inet_sk(sk)->cmsg_flags) |
473 | memset(&sin->sin_zero, 0, sizeof(sin->sin_zero)); | ||
474 | if (inet->cmsg_flags) | ||
475 | ip_cmsg_recv(msg, skb); | 471 | ip_cmsg_recv(msg, skb); |
476 | } | 472 | } |
477 | 473 | ||
diff --git a/net/ipv6/datagram.c b/net/ipv6/datagram.c index 100c589a2a6c..49f5e73db122 100644 --- a/net/ipv6/datagram.c +++ b/net/ipv6/datagram.c | |||
@@ -393,11 +393,10 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
393 | 393 | ||
394 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); | 394 | memcpy(&errhdr.ee, &serr->ee, sizeof(struct sock_extended_err)); |
395 | sin = &errhdr.offender; | 395 | sin = &errhdr.offender; |
396 | sin->sin6_family = AF_UNSPEC; | 396 | memset(sin, 0, sizeof(*sin)); |
397 | |||
397 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) { | 398 | if (serr->ee.ee_origin != SO_EE_ORIGIN_LOCAL) { |
398 | sin->sin6_family = AF_INET6; | 399 | sin->sin6_family = AF_INET6; |
399 | sin->sin6_flowinfo = 0; | ||
400 | sin->sin6_port = 0; | ||
401 | if (np->rxopt.all) { | 400 | if (np->rxopt.all) { |
402 | if (serr->ee.ee_origin != SO_EE_ORIGIN_ICMP && | 401 | if (serr->ee.ee_origin != SO_EE_ORIGIN_ICMP && |
403 | serr->ee.ee_origin != SO_EE_ORIGIN_ICMP6) | 402 | serr->ee.ee_origin != SO_EE_ORIGIN_ICMP6) |
@@ -412,12 +411,9 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) | |||
412 | ipv6_iface_scope_id(&sin->sin6_addr, | 411 | ipv6_iface_scope_id(&sin->sin6_addr, |
413 | IP6CB(skb)->iif); | 412 | IP6CB(skb)->iif); |
414 | } else { | 413 | } else { |
415 | struct inet_sock *inet = inet_sk(sk); | ||
416 | |||
417 | ipv6_addr_set_v4mapped(ip_hdr(skb)->saddr, | 414 | ipv6_addr_set_v4mapped(ip_hdr(skb)->saddr, |
418 | &sin->sin6_addr); | 415 | &sin->sin6_addr); |
419 | sin->sin6_scope_id = 0; | 416 | if (inet_sk(sk)->cmsg_flags) |
420 | if (inet->cmsg_flags) | ||
421 | ip_cmsg_recv(msg, skb); | 417 | ip_cmsg_recv(msg, skb); |
422 | } | 418 | } |
423 | } | 419 | } |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c91083156edb..166e33bed222 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -1160,12 +1160,9 @@ static void ip6_rt_update_pmtu(struct dst_entry *dst, struct sock *sk, | |||
1160 | struct net *net = dev_net(dst->dev); | 1160 | struct net *net = dev_net(dst->dev); |
1161 | 1161 | ||
1162 | rt6->rt6i_flags |= RTF_MODIFIED; | 1162 | rt6->rt6i_flags |= RTF_MODIFIED; |
1163 | if (mtu < IPV6_MIN_MTU) { | 1163 | if (mtu < IPV6_MIN_MTU) |
1164 | u32 features = dst_metric(dst, RTAX_FEATURES); | ||
1165 | mtu = IPV6_MIN_MTU; | 1164 | mtu = IPV6_MIN_MTU; |
1166 | features |= RTAX_FEATURE_ALLFRAG; | 1165 | |
1167 | dst_metric_set(dst, RTAX_FEATURES, features); | ||
1168 | } | ||
1169 | dst_metric_set(dst, RTAX_MTU, mtu); | 1166 | dst_metric_set(dst, RTAX_MTU, mtu); |
1170 | rt6_update_expires(rt6, net->ipv6.sysctl.ip6_rt_mtu_expires); | 1167 | rt6_update_expires(rt6, net->ipv6.sysctl.ip6_rt_mtu_expires); |
1171 | } | 1168 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 2c36c4765f47..837a406a9dd6 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -1643,7 +1643,7 @@ __ieee80211_sta_handle_tspec_ac_params(struct ieee80211_sub_if_data *sdata) | |||
1643 | { | 1643 | { |
1644 | struct ieee80211_local *local = sdata->local; | 1644 | struct ieee80211_local *local = sdata->local; |
1645 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; | 1645 | struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; |
1646 | bool ret; | 1646 | bool ret = false; |
1647 | int ac; | 1647 | int ac; |
1648 | 1648 | ||
1649 | if (local->hw.queues < IEEE80211_NUM_ACS) | 1649 | if (local->hw.queues < IEEE80211_NUM_ACS) |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 84ea76ca3f1f..02fdde28dada 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -61,6 +61,7 @@ | |||
61 | #include <linux/rhashtable.h> | 61 | #include <linux/rhashtable.h> |
62 | #include <asm/cacheflush.h> | 62 | #include <asm/cacheflush.h> |
63 | #include <linux/hash.h> | 63 | #include <linux/hash.h> |
64 | #include <linux/genetlink.h> | ||
64 | 65 | ||
65 | #include <net/net_namespace.h> | 66 | #include <net/net_namespace.h> |
66 | #include <net/sock.h> | 67 | #include <net/sock.h> |
@@ -1095,6 +1096,8 @@ static void netlink_remove(struct sock *sk) | |||
1095 | __sk_del_bind_node(sk); | 1096 | __sk_del_bind_node(sk); |
1096 | netlink_update_listeners(sk); | 1097 | netlink_update_listeners(sk); |
1097 | } | 1098 | } |
1099 | if (sk->sk_protocol == NETLINK_GENERIC) | ||
1100 | atomic_inc(&genl_sk_destructing_cnt); | ||
1098 | netlink_table_ungrab(); | 1101 | netlink_table_ungrab(); |
1099 | } | 1102 | } |
1100 | 1103 | ||
@@ -1211,6 +1214,20 @@ static int netlink_release(struct socket *sock) | |||
1211 | * will be purged. | 1214 | * will be purged. |
1212 | */ | 1215 | */ |
1213 | 1216 | ||
1217 | /* must not acquire netlink_table_lock in any way again before unbind | ||
1218 | * and notifying genetlink is done as otherwise it might deadlock | ||
1219 | */ | ||
1220 | if (nlk->netlink_unbind) { | ||
1221 | int i; | ||
1222 | |||
1223 | for (i = 0; i < nlk->ngroups; i++) | ||
1224 | if (test_bit(i, nlk->groups)) | ||
1225 | nlk->netlink_unbind(sock_net(sk), i + 1); | ||
1226 | } | ||
1227 | if (sk->sk_protocol == NETLINK_GENERIC && | ||
1228 | atomic_dec_return(&genl_sk_destructing_cnt) == 0) | ||
1229 | wake_up(&genl_sk_destructing_waitq); | ||
1230 | |||
1214 | sock->sk = NULL; | 1231 | sock->sk = NULL; |
1215 | wake_up_interruptible_all(&nlk->wait); | 1232 | wake_up_interruptible_all(&nlk->wait); |
1216 | 1233 | ||
@@ -1246,13 +1263,6 @@ static int netlink_release(struct socket *sock) | |||
1246 | netlink_table_ungrab(); | 1263 | netlink_table_ungrab(); |
1247 | } | 1264 | } |
1248 | 1265 | ||
1249 | if (nlk->netlink_unbind) { | ||
1250 | int i; | ||
1251 | |||
1252 | for (i = 0; i < nlk->ngroups; i++) | ||
1253 | if (test_bit(i, nlk->groups)) | ||
1254 | nlk->netlink_unbind(sock_net(sk), i + 1); | ||
1255 | } | ||
1256 | kfree(nlk->groups); | 1266 | kfree(nlk->groups); |
1257 | nlk->groups = NULL; | 1267 | nlk->groups = NULL; |
1258 | 1268 | ||
diff --git a/net/netlink/af_netlink.h b/net/netlink/af_netlink.h index f123a88496f8..f1c31b39aa3e 100644 --- a/net/netlink/af_netlink.h +++ b/net/netlink/af_netlink.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _AF_NETLINK_H | 2 | #define _AF_NETLINK_H |
3 | 3 | ||
4 | #include <linux/rhashtable.h> | 4 | #include <linux/rhashtable.h> |
5 | #include <linux/atomic.h> | ||
5 | #include <net/sock.h> | 6 | #include <net/sock.h> |
6 | 7 | ||
7 | #define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8) | 8 | #define NLGRPSZ(x) (ALIGN(x, sizeof(unsigned long) * 8) / 8) |
diff --git a/net/netlink/genetlink.c b/net/netlink/genetlink.c index 2e11061ef885..ee57459fc258 100644 --- a/net/netlink/genetlink.c +++ b/net/netlink/genetlink.c | |||
@@ -23,6 +23,9 @@ | |||
23 | static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */ | 23 | static DEFINE_MUTEX(genl_mutex); /* serialization of message processing */ |
24 | static DECLARE_RWSEM(cb_lock); | 24 | static DECLARE_RWSEM(cb_lock); |
25 | 25 | ||
26 | atomic_t genl_sk_destructing_cnt = ATOMIC_INIT(0); | ||
27 | DECLARE_WAIT_QUEUE_HEAD(genl_sk_destructing_waitq); | ||
28 | |||
26 | void genl_lock(void) | 29 | void genl_lock(void) |
27 | { | 30 | { |
28 | mutex_lock(&genl_mutex); | 31 | mutex_lock(&genl_mutex); |
@@ -435,15 +438,18 @@ int genl_unregister_family(struct genl_family *family) | |||
435 | 438 | ||
436 | genl_lock_all(); | 439 | genl_lock_all(); |
437 | 440 | ||
438 | genl_unregister_mc_groups(family); | ||
439 | |||
440 | list_for_each_entry(rc, genl_family_chain(family->id), family_list) { | 441 | list_for_each_entry(rc, genl_family_chain(family->id), family_list) { |
441 | if (family->id != rc->id || strcmp(rc->name, family->name)) | 442 | if (family->id != rc->id || strcmp(rc->name, family->name)) |
442 | continue; | 443 | continue; |
443 | 444 | ||
445 | genl_unregister_mc_groups(family); | ||
446 | |||
444 | list_del(&rc->family_list); | 447 | list_del(&rc->family_list); |
445 | family->n_ops = 0; | 448 | family->n_ops = 0; |
446 | genl_unlock_all(); | 449 | up_write(&cb_lock); |
450 | wait_event(genl_sk_destructing_waitq, | ||
451 | atomic_read(&genl_sk_destructing_cnt) == 0); | ||
452 | genl_unlock(); | ||
447 | 453 | ||
448 | kfree(family->attrbuf); | 454 | kfree(family->attrbuf); |
449 | genl_ctrl_event(CTRL_CMD_DELFAMILY, family, NULL, 0); | 455 | genl_ctrl_event(CTRL_CMD_DELFAMILY, family, NULL, 0); |
@@ -985,7 +991,7 @@ static struct genl_multicast_group genl_ctrl_groups[] = { | |||
985 | 991 | ||
986 | static int genl_bind(struct net *net, int group) | 992 | static int genl_bind(struct net *net, int group) |
987 | { | 993 | { |
988 | int i, err = 0; | 994 | int i, err = -ENOENT; |
989 | 995 | ||
990 | down_read(&cb_lock); | 996 | down_read(&cb_lock); |
991 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { | 997 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { |
@@ -1014,7 +1020,6 @@ static int genl_bind(struct net *net, int group) | |||
1014 | static void genl_unbind(struct net *net, int group) | 1020 | static void genl_unbind(struct net *net, int group) |
1015 | { | 1021 | { |
1016 | int i; | 1022 | int i; |
1017 | bool found = false; | ||
1018 | 1023 | ||
1019 | down_read(&cb_lock); | 1024 | down_read(&cb_lock); |
1020 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { | 1025 | for (i = 0; i < GENL_FAM_TAB_SIZE; i++) { |
@@ -1027,14 +1032,11 @@ static void genl_unbind(struct net *net, int group) | |||
1027 | 1032 | ||
1028 | if (f->mcast_unbind) | 1033 | if (f->mcast_unbind) |
1029 | f->mcast_unbind(net, fam_grp); | 1034 | f->mcast_unbind(net, fam_grp); |
1030 | found = true; | ||
1031 | break; | 1035 | break; |
1032 | } | 1036 | } |
1033 | } | 1037 | } |
1034 | } | 1038 | } |
1035 | up_read(&cb_lock); | 1039 | up_read(&cb_lock); |
1036 | |||
1037 | WARN_ON(!found); | ||
1038 | } | 1040 | } |
1039 | 1041 | ||
1040 | static int __net_init genl_pernet_init(struct net *net) | 1042 | static int __net_init genl_pernet_init(struct net *net) |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index 2625eccb77d5..aafe94bf292e 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -1603,7 +1603,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1603 | sctp_assoc_t associd = 0; | 1603 | sctp_assoc_t associd = 0; |
1604 | sctp_cmsgs_t cmsgs = { NULL }; | 1604 | sctp_cmsgs_t cmsgs = { NULL }; |
1605 | sctp_scope_t scope; | 1605 | sctp_scope_t scope; |
1606 | bool fill_sinfo_ttl = false; | 1606 | bool fill_sinfo_ttl = false, wait_connect = false; |
1607 | struct sctp_datamsg *datamsg; | 1607 | struct sctp_datamsg *datamsg; |
1608 | int msg_flags = msg->msg_flags; | 1608 | int msg_flags = msg->msg_flags; |
1609 | __u16 sinfo_flags = 0; | 1609 | __u16 sinfo_flags = 0; |
@@ -1943,6 +1943,7 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1943 | if (err < 0) | 1943 | if (err < 0) |
1944 | goto out_free; | 1944 | goto out_free; |
1945 | 1945 | ||
1946 | wait_connect = true; | ||
1946 | pr_debug("%s: we associated primitively\n", __func__); | 1947 | pr_debug("%s: we associated primitively\n", __func__); |
1947 | } | 1948 | } |
1948 | 1949 | ||
@@ -1980,6 +1981,11 @@ static int sctp_sendmsg(struct kiocb *iocb, struct sock *sk, | |||
1980 | sctp_datamsg_put(datamsg); | 1981 | sctp_datamsg_put(datamsg); |
1981 | err = msg_len; | 1982 | err = msg_len; |
1982 | 1983 | ||
1984 | if (unlikely(wait_connect)) { | ||
1985 | timeo = sock_sndtimeo(sk, msg_flags & MSG_DONTWAIT); | ||
1986 | sctp_wait_for_connect(asoc, &timeo); | ||
1987 | } | ||
1988 | |||
1983 | /* If we are already past ASSOCIATE, the lower | 1989 | /* If we are already past ASSOCIATE, the lower |
1984 | * layers are responsible for association cleanup. | 1990 | * layers are responsible for association cleanup. |
1985 | */ | 1991 | */ |
diff --git a/net/wireless/reg.c b/net/wireless/reg.c index 7b8309840d4e..d39d1cbc86b1 100644 --- a/net/wireless/reg.c +++ b/net/wireless/reg.c | |||
@@ -1530,45 +1530,40 @@ static void reg_call_notifier(struct wiphy *wiphy, | |||
1530 | 1530 | ||
1531 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | 1531 | static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) |
1532 | { | 1532 | { |
1533 | struct ieee80211_channel *ch; | ||
1534 | struct cfg80211_chan_def chandef; | 1533 | struct cfg80211_chan_def chandef; |
1535 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); | 1534 | struct cfg80211_registered_device *rdev = wiphy_to_rdev(wiphy); |
1536 | bool ret = true; | 1535 | enum nl80211_iftype iftype; |
1537 | 1536 | ||
1538 | wdev_lock(wdev); | 1537 | wdev_lock(wdev); |
1538 | iftype = wdev->iftype; | ||
1539 | 1539 | ||
1540 | /* make sure the interface is active */ | ||
1540 | if (!wdev->netdev || !netif_running(wdev->netdev)) | 1541 | if (!wdev->netdev || !netif_running(wdev->netdev)) |
1541 | goto out; | 1542 | goto wdev_inactive_unlock; |
1542 | 1543 | ||
1543 | switch (wdev->iftype) { | 1544 | switch (iftype) { |
1544 | case NL80211_IFTYPE_AP: | 1545 | case NL80211_IFTYPE_AP: |
1545 | case NL80211_IFTYPE_P2P_GO: | 1546 | case NL80211_IFTYPE_P2P_GO: |
1546 | if (!wdev->beacon_interval) | 1547 | if (!wdev->beacon_interval) |
1547 | goto out; | 1548 | goto wdev_inactive_unlock; |
1548 | 1549 | chandef = wdev->chandef; | |
1549 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1550 | &wdev->chandef, wdev->iftype); | ||
1551 | break; | 1550 | break; |
1552 | case NL80211_IFTYPE_ADHOC: | 1551 | case NL80211_IFTYPE_ADHOC: |
1553 | if (!wdev->ssid_len) | 1552 | if (!wdev->ssid_len) |
1554 | goto out; | 1553 | goto wdev_inactive_unlock; |
1555 | 1554 | chandef = wdev->chandef; | |
1556 | ret = cfg80211_reg_can_beacon(wiphy, | ||
1557 | &wdev->chandef, wdev->iftype); | ||
1558 | break; | 1555 | break; |
1559 | case NL80211_IFTYPE_STATION: | 1556 | case NL80211_IFTYPE_STATION: |
1560 | case NL80211_IFTYPE_P2P_CLIENT: | 1557 | case NL80211_IFTYPE_P2P_CLIENT: |
1561 | if (!wdev->current_bss || | 1558 | if (!wdev->current_bss || |
1562 | !wdev->current_bss->pub.channel) | 1559 | !wdev->current_bss->pub.channel) |
1563 | goto out; | 1560 | goto wdev_inactive_unlock; |
1564 | 1561 | ||
1565 | ch = wdev->current_bss->pub.channel; | 1562 | if (!rdev->ops->get_channel || |
1566 | if (rdev->ops->get_channel && | 1563 | rdev_get_channel(rdev, wdev, &chandef)) |
1567 | !rdev_get_channel(rdev, wdev, &chandef)) | 1564 | cfg80211_chandef_create(&chandef, |
1568 | ret = cfg80211_chandef_usable(wiphy, &chandef, | 1565 | wdev->current_bss->pub.channel, |
1569 | IEEE80211_CHAN_DISABLED); | 1566 | NL80211_CHAN_NO_HT); |
1570 | else | ||
1571 | ret = !(ch->flags & IEEE80211_CHAN_DISABLED); | ||
1572 | break; | 1567 | break; |
1573 | case NL80211_IFTYPE_MONITOR: | 1568 | case NL80211_IFTYPE_MONITOR: |
1574 | case NL80211_IFTYPE_AP_VLAN: | 1569 | case NL80211_IFTYPE_AP_VLAN: |
@@ -1581,9 +1576,26 @@ static bool reg_wdev_chan_valid(struct wiphy *wiphy, struct wireless_dev *wdev) | |||
1581 | break; | 1576 | break; |
1582 | } | 1577 | } |
1583 | 1578 | ||
1584 | out: | ||
1585 | wdev_unlock(wdev); | 1579 | wdev_unlock(wdev); |
1586 | return ret; | 1580 | |
1581 | switch (iftype) { | ||
1582 | case NL80211_IFTYPE_AP: | ||
1583 | case NL80211_IFTYPE_P2P_GO: | ||
1584 | case NL80211_IFTYPE_ADHOC: | ||
1585 | return cfg80211_reg_can_beacon(wiphy, &chandef, iftype); | ||
1586 | case NL80211_IFTYPE_STATION: | ||
1587 | case NL80211_IFTYPE_P2P_CLIENT: | ||
1588 | return cfg80211_chandef_usable(wiphy, &chandef, | ||
1589 | IEEE80211_CHAN_DISABLED); | ||
1590 | default: | ||
1591 | break; | ||
1592 | } | ||
1593 | |||
1594 | return true; | ||
1595 | |||
1596 | wdev_inactive_unlock: | ||
1597 | wdev_unlock(wdev); | ||
1598 | return true; | ||
1587 | } | 1599 | } |
1588 | 1600 | ||
1589 | static void reg_leave_invalid_chans(struct wiphy *wiphy) | 1601 | static void reg_leave_invalid_chans(struct wiphy *wiphy) |
diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl index 56ea99a12ab7..537c38ca2e1c 100755 --- a/scripts/recordmcount.pl +++ b/scripts/recordmcount.pl | |||
@@ -255,7 +255,6 @@ if ($arch eq "x86_64") { | |||
255 | # force flags for this arch | 255 | # force flags for this arch |
256 | $ld .= " -m shlelf_linux"; | 256 | $ld .= " -m shlelf_linux"; |
257 | $objcopy .= " -O elf32-sh-linux"; | 257 | $objcopy .= " -O elf32-sh-linux"; |
258 | $cc .= " -m32"; | ||
259 | 258 | ||
260 | } elsif ($arch eq "powerpc") { | 259 | } elsif ($arch eq "powerpc") { |
261 | $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; | 260 | $local_regex = "^[0-9a-fA-F]+\\s+t\\s+(\\.?\\S+)"; |
diff --git a/sound/firewire/amdtp.c b/sound/firewire/amdtp.c index 3badc70124ab..0d580186ef1a 100644 --- a/sound/firewire/amdtp.c +++ b/sound/firewire/amdtp.c | |||
@@ -21,7 +21,19 @@ | |||
21 | #define CYCLES_PER_SECOND 8000 | 21 | #define CYCLES_PER_SECOND 8000 |
22 | #define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) | 22 | #define TICKS_PER_SECOND (TICKS_PER_CYCLE * CYCLES_PER_SECOND) |
23 | 23 | ||
24 | #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ | 24 | /* |
25 | * Nominally 3125 bytes/second, but the MIDI port's clock might be | ||
26 | * 1% too slow, and the bus clock 100 ppm too fast. | ||
27 | */ | ||
28 | #define MIDI_BYTES_PER_SECOND 3093 | ||
29 | |||
30 | /* | ||
31 | * Several devices look only at the first eight data blocks. | ||
32 | * In any case, this is more than enough for the MIDI data rate. | ||
33 | */ | ||
34 | #define MAX_MIDI_RX_BLOCKS 8 | ||
35 | |||
36 | #define TRANSFER_DELAY_TICKS 0x2e00 /* 479.17 µs */ | ||
25 | 37 | ||
26 | /* isochronous header parameters */ | 38 | /* isochronous header parameters */ |
27 | #define ISO_DATA_LENGTH_SHIFT 16 | 39 | #define ISO_DATA_LENGTH_SHIFT 16 |
@@ -78,8 +90,6 @@ int amdtp_stream_init(struct amdtp_stream *s, struct fw_unit *unit, | |||
78 | s->callbacked = false; | 90 | s->callbacked = false; |
79 | s->sync_slave = NULL; | 91 | s->sync_slave = NULL; |
80 | 92 | ||
81 | s->rx_blocks_for_midi = UINT_MAX; | ||
82 | |||
83 | return 0; | 93 | return 0; |
84 | } | 94 | } |
85 | EXPORT_SYMBOL(amdtp_stream_init); | 95 | EXPORT_SYMBOL(amdtp_stream_init); |
@@ -222,6 +232,14 @@ sfc_found: | |||
222 | for (i = 0; i < pcm_channels; i++) | 232 | for (i = 0; i < pcm_channels; i++) |
223 | s->pcm_positions[i] = i; | 233 | s->pcm_positions[i] = i; |
224 | s->midi_position = s->pcm_channels; | 234 | s->midi_position = s->pcm_channels; |
235 | |||
236 | /* | ||
237 | * We do not know the actual MIDI FIFO size of most devices. Just | ||
238 | * assume two bytes, i.e., one byte can be received over the bus while | ||
239 | * the previous one is transmitted over MIDI. | ||
240 | * (The value here is adjusted for midi_ratelimit_per_packet().) | ||
241 | */ | ||
242 | s->midi_fifo_limit = rate - MIDI_BYTES_PER_SECOND * s->syt_interval + 1; | ||
225 | } | 243 | } |
226 | EXPORT_SYMBOL(amdtp_stream_set_parameters); | 244 | EXPORT_SYMBOL(amdtp_stream_set_parameters); |
227 | 245 | ||
@@ -463,6 +481,36 @@ static void amdtp_fill_pcm_silence(struct amdtp_stream *s, | |||
463 | } | 481 | } |
464 | } | 482 | } |
465 | 483 | ||
484 | /* | ||
485 | * To avoid sending MIDI bytes at too high a rate, assume that the receiving | ||
486 | * device has a FIFO, and track how much it is filled. This values increases | ||
487 | * by one whenever we send one byte in a packet, but the FIFO empties at | ||
488 | * a constant rate independent of our packet rate. One packet has syt_interval | ||
489 | * samples, so the number of bytes that empty out of the FIFO, per packet(!), | ||
490 | * is MIDI_BYTES_PER_SECOND * syt_interval / sample_rate. To avoid storing | ||
491 | * fractional values, the values in midi_fifo_used[] are measured in bytes | ||
492 | * multiplied by the sample rate. | ||
493 | */ | ||
494 | static bool midi_ratelimit_per_packet(struct amdtp_stream *s, unsigned int port) | ||
495 | { | ||
496 | int used; | ||
497 | |||
498 | used = s->midi_fifo_used[port]; | ||
499 | if (used == 0) /* common shortcut */ | ||
500 | return true; | ||
501 | |||
502 | used -= MIDI_BYTES_PER_SECOND * s->syt_interval; | ||
503 | used = max(used, 0); | ||
504 | s->midi_fifo_used[port] = used; | ||
505 | |||
506 | return used < s->midi_fifo_limit; | ||
507 | } | ||
508 | |||
509 | static void midi_rate_use_one_byte(struct amdtp_stream *s, unsigned int port) | ||
510 | { | ||
511 | s->midi_fifo_used[port] += amdtp_rate_table[s->sfc]; | ||
512 | } | ||
513 | |||
466 | static void amdtp_fill_midi(struct amdtp_stream *s, | 514 | static void amdtp_fill_midi(struct amdtp_stream *s, |
467 | __be32 *buffer, unsigned int frames) | 515 | __be32 *buffer, unsigned int frames) |
468 | { | 516 | { |
@@ -470,16 +518,21 @@ static void amdtp_fill_midi(struct amdtp_stream *s, | |||
470 | u8 *b; | 518 | u8 *b; |
471 | 519 | ||
472 | for (f = 0; f < frames; f++) { | 520 | for (f = 0; f < frames; f++) { |
473 | buffer[s->midi_position] = 0; | ||
474 | b = (u8 *)&buffer[s->midi_position]; | 521 | b = (u8 *)&buffer[s->midi_position]; |
475 | 522 | ||
476 | port = (s->data_block_counter + f) % 8; | 523 | port = (s->data_block_counter + f) % 8; |
477 | if ((f >= s->rx_blocks_for_midi) || | 524 | if (f < MAX_MIDI_RX_BLOCKS && |
478 | (s->midi[port] == NULL) || | 525 | midi_ratelimit_per_packet(s, port) && |
479 | (snd_rawmidi_transmit(s->midi[port], b + 1, 1) <= 0)) | 526 | s->midi[port] != NULL && |
480 | b[0] = 0x80; | 527 | snd_rawmidi_transmit(s->midi[port], &b[1], 1) == 1) { |
481 | else | 528 | midi_rate_use_one_byte(s, port); |
482 | b[0] = 0x81; | 529 | b[0] = 0x81; |
530 | } else { | ||
531 | b[0] = 0x80; | ||
532 | b[1] = 0; | ||
533 | } | ||
534 | b[2] = 0; | ||
535 | b[3] = 0; | ||
483 | 536 | ||
484 | buffer += s->data_block_quadlets; | 537 | buffer += s->data_block_quadlets; |
485 | } | 538 | } |
diff --git a/sound/firewire/amdtp.h b/sound/firewire/amdtp.h index e6e8926275b0..8a03a91e728b 100644 --- a/sound/firewire/amdtp.h +++ b/sound/firewire/amdtp.h | |||
@@ -148,13 +148,12 @@ struct amdtp_stream { | |||
148 | bool double_pcm_frames; | 148 | bool double_pcm_frames; |
149 | 149 | ||
150 | struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8]; | 150 | struct snd_rawmidi_substream *midi[AMDTP_MAX_CHANNELS_FOR_MIDI * 8]; |
151 | int midi_fifo_limit; | ||
152 | int midi_fifo_used[AMDTP_MAX_CHANNELS_FOR_MIDI * 8]; | ||
151 | 153 | ||
152 | /* quirk: fixed interval of dbc between previos/current packets. */ | 154 | /* quirk: fixed interval of dbc between previos/current packets. */ |
153 | unsigned int tx_dbc_interval; | 155 | unsigned int tx_dbc_interval; |
154 | 156 | ||
155 | /* quirk: the first count of data blocks in an rx packet for MIDI */ | ||
156 | unsigned int rx_blocks_for_midi; | ||
157 | |||
158 | bool callbacked; | 157 | bool callbacked; |
159 | wait_queue_head_t callback_wait; | 158 | wait_queue_head_t callback_wait; |
160 | struct amdtp_stream *sync_slave; | 159 | struct amdtp_stream *sync_slave; |
diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 1aab0a32870c..0ebcabfdc7ce 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c | |||
@@ -484,13 +484,6 @@ int snd_bebob_stream_init_duplex(struct snd_bebob *bebob) | |||
484 | amdtp_stream_destroy(&bebob->rx_stream); | 484 | amdtp_stream_destroy(&bebob->rx_stream); |
485 | destroy_both_connections(bebob); | 485 | destroy_both_connections(bebob); |
486 | } | 486 | } |
487 | /* | ||
488 | * The firmware for these devices ignore MIDI messages in more than | ||
489 | * first 8 data blocks of an received AMDTP packet. | ||
490 | */ | ||
491 | if (bebob->spec == &maudio_fw410_spec || | ||
492 | bebob->spec == &maudio_special_spec) | ||
493 | bebob->rx_stream.rx_blocks_for_midi = 8; | ||
494 | end: | 487 | end: |
495 | return err; | 488 | return err; |
496 | } | 489 | } |
diff --git a/sound/firewire/fireworks/fireworks_stream.c b/sound/firewire/fireworks/fireworks_stream.c index b985fc5ebdc6..4f440e163667 100644 --- a/sound/firewire/fireworks/fireworks_stream.c +++ b/sound/firewire/fireworks/fireworks_stream.c | |||
@@ -179,11 +179,6 @@ int snd_efw_stream_init_duplex(struct snd_efw *efw) | |||
179 | destroy_stream(efw, &efw->tx_stream); | 179 | destroy_stream(efw, &efw->tx_stream); |
180 | goto end; | 180 | goto end; |
181 | } | 181 | } |
182 | /* | ||
183 | * Fireworks ignores MIDI messages in more than first 8 data | ||
184 | * blocks of an received AMDTP packet. | ||
185 | */ | ||
186 | efw->rx_stream.rx_blocks_for_midi = 8; | ||
187 | 182 | ||
188 | /* set IEC61883 compliant mode (actually not fully compliant...) */ | 183 | /* set IEC61883 compliant mode (actually not fully compliant...) */ |
189 | err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); | 184 | err = snd_efw_command_set_tx_mode(efw, SND_EFW_TRANSPORT_MODE_IEC61883); |
diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 41650d5b93b7..3e2ef61c627b 100644 --- a/sound/usb/mixer.c +++ b/sound/usb/mixer.c | |||
@@ -913,6 +913,7 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval, | |||
913 | case USB_ID(0x046d, 0x0807): /* Logitech Webcam C500 */ | 913 | case USB_ID(0x046d, 0x0807): /* Logitech Webcam C500 */ |
914 | case USB_ID(0x046d, 0x0808): | 914 | case USB_ID(0x046d, 0x0808): |
915 | case USB_ID(0x046d, 0x0809): | 915 | case USB_ID(0x046d, 0x0809): |
916 | case USB_ID(0x046d, 0x0819): /* Logitech Webcam C210 */ | ||
916 | case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ | 917 | case USB_ID(0x046d, 0x081b): /* HD Webcam c310 */ |
917 | case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ | 918 | case USB_ID(0x046d, 0x081d): /* HD Webcam c510 */ |
918 | case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ | 919 | case USB_ID(0x046d, 0x0825): /* HD Webcam c270 */ |