diff options
author | Mark Brown <broonie@kernel.org> | 2015-09-25 13:01:09 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-09-25 13:01:09 -0400 |
commit | 536b5603e7a3c75c7d2e0c1c56980690909b12d3 (patch) | |
tree | c48d8fe596cf3e6a3392d9688c27cd695d90a23a | |
parent | 6ff33f3902c3b1c5d0db6b1e2c70b6d76fba357f (diff) | |
parent | b4fe8ba7a310da6a2b99e3abe67c7815198cde49 (diff) |
Merge tag 'ib-mfd-regmap-v4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd into regmap-irq-hdr
Immutable branch between MFD and Regmap due for v4.3
473 files changed, 1916 insertions, 1441 deletions
diff --git a/Documentation/gpio/board.txt b/Documentation/gpio/board.txt index b80606de545a..f59c43b6411b 100644 --- a/Documentation/gpio/board.txt +++ b/Documentation/gpio/board.txt | |||
@@ -21,8 +21,8 @@ exact way to do it depends on the GPIO controller providing the GPIOs, see the | |||
21 | device tree bindings for your controller. | 21 | device tree bindings for your controller. |
22 | 22 | ||
23 | GPIOs mappings are defined in the consumer device's node, in a property named | 23 | GPIOs mappings are defined in the consumer device's node, in a property named |
24 | <function>-gpios, where <function> is the function the driver will request | 24 | either <function>-gpios or <function>-gpio, where <function> is the function |
25 | through gpiod_get(). For example: | 25 | the driver will request through gpiod_get(). For example: |
26 | 26 | ||
27 | foo_device { | 27 | foo_device { |
28 | compatible = "acme,foo"; | 28 | compatible = "acme,foo"; |
@@ -31,7 +31,7 @@ through gpiod_get(). For example: | |||
31 | <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */ | 31 | <&gpio 16 GPIO_ACTIVE_HIGH>, /* green */ |
32 | <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */ | 32 | <&gpio 17 GPIO_ACTIVE_HIGH>; /* blue */ |
33 | 33 | ||
34 | power-gpios = <&gpio 1 GPIO_ACTIVE_LOW>; | 34 | power-gpio = <&gpio 1 GPIO_ACTIVE_LOW>; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | This property will make GPIOs 15, 16 and 17 available to the driver under the | 37 | This property will make GPIOs 15, 16 and 17 available to the driver under the |
@@ -39,15 +39,24 @@ This property will make GPIOs 15, 16 and 17 available to the driver under the | |||
39 | 39 | ||
40 | struct gpio_desc *red, *green, *blue, *power; | 40 | struct gpio_desc *red, *green, *blue, *power; |
41 | 41 | ||
42 | red = gpiod_get_index(dev, "led", 0); | 42 | red = gpiod_get_index(dev, "led", 0, GPIOD_OUT_HIGH); |
43 | green = gpiod_get_index(dev, "led", 1); | 43 | green = gpiod_get_index(dev, "led", 1, GPIOD_OUT_HIGH); |
44 | blue = gpiod_get_index(dev, "led", 2); | 44 | blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH); |
45 | 45 | ||
46 | power = gpiod_get(dev, "power"); | 46 | power = gpiod_get(dev, "power", GPIOD_OUT_HIGH); |
47 | 47 | ||
48 | The led GPIOs will be active-high, while the power GPIO will be active-low (i.e. | 48 | The led GPIOs will be active-high, while the power GPIO will be active-low (i.e. |
49 | gpiod_is_active_low(power) will be true). | 49 | gpiod_is_active_low(power) will be true). |
50 | 50 | ||
51 | The second parameter of the gpiod_get() functions, the con_id string, has to be | ||
52 | the <function>-prefix of the GPIO suffixes ("gpios" or "gpio", automatically | ||
53 | looked up by the gpiod functions internally) used in the device tree. With above | ||
54 | "led-gpios" example, use the prefix without the "-" as con_id parameter: "led". | ||
55 | |||
56 | Internally, the GPIO subsystem prefixes the GPIO suffix ("gpios" or "gpio") | ||
57 | with the string passed in con_id to get the resulting string | ||
58 | (snprintf(... "%s-%s", con_id, gpio_suffixes[]). | ||
59 | |||
51 | ACPI | 60 | ACPI |
52 | ---- | 61 | ---- |
53 | ACPI also supports function names for GPIOs in a similar fashion to DT. | 62 | ACPI also supports function names for GPIOs in a similar fashion to DT. |
@@ -142,13 +151,14 @@ The driver controlling "foo.0" will then be able to obtain its GPIOs as follows: | |||
142 | 151 | ||
143 | struct gpio_desc *red, *green, *blue, *power; | 152 | struct gpio_desc *red, *green, *blue, *power; |
144 | 153 | ||
145 | red = gpiod_get_index(dev, "led", 0); | 154 | red = gpiod_get_index(dev, "led", 0, GPIOD_OUT_HIGH); |
146 | green = gpiod_get_index(dev, "led", 1); | 155 | green = gpiod_get_index(dev, "led", 1, GPIOD_OUT_HIGH); |
147 | blue = gpiod_get_index(dev, "led", 2); | 156 | blue = gpiod_get_index(dev, "led", 2, GPIOD_OUT_HIGH); |
148 | 157 | ||
149 | power = gpiod_get(dev, "power"); | 158 | power = gpiod_get(dev, "power", GPIOD_OUT_HIGH); |
150 | gpiod_direction_output(power, 1); | ||
151 | 159 | ||
152 | Since the "power" GPIO is mapped as active-low, its actual signal will be 0 | 160 | Since the "led" GPIOs are mapped as active-high, this example will switch their |
153 | after this code. Contrary to the legacy integer GPIO interface, the active-low | 161 | signals to 1, i.e. enabling the LEDs. And for the "power" GPIO, which is mapped |
154 | property is handled during mapping and is thus transparent to GPIO consumers. | 162 | as active-low, its actual signal will be 0 after this code. Contrary to the legacy |
163 | integer GPIO interface, the active-low property is handled during mapping and is | ||
164 | thus transparent to GPIO consumers. | ||
diff --git a/Documentation/gpio/consumer.txt b/Documentation/gpio/consumer.txt index a206639454ab..e000502fde20 100644 --- a/Documentation/gpio/consumer.txt +++ b/Documentation/gpio/consumer.txt | |||
@@ -39,6 +39,9 @@ device that displays digits), an additional index argument can be specified: | |||
39 | const char *con_id, unsigned int idx, | 39 | const char *con_id, unsigned int idx, |
40 | enum gpiod_flags flags) | 40 | enum gpiod_flags flags) |
41 | 41 | ||
42 | For a more detailed description of the con_id parameter in the DeviceTree case | ||
43 | see Documentation/gpio/board.txt | ||
44 | |||
42 | The flags parameter is used to optionally specify a direction and initial value | 45 | The flags parameter is used to optionally specify a direction and initial value |
43 | for the GPIO. Values can be: | 46 | for the GPIO. Values can be: |
44 | 47 | ||
diff --git a/Documentation/hwmon/nct6775 b/Documentation/hwmon/nct6775 index f0dd3d2fec96..76add4c9cd68 100644 --- a/Documentation/hwmon/nct6775 +++ b/Documentation/hwmon/nct6775 | |||
@@ -32,6 +32,10 @@ Supported chips: | |||
32 | Prefix: 'nct6792' | 32 | Prefix: 'nct6792' |
33 | Addresses scanned: ISA address retrieved from Super I/O registers | 33 | Addresses scanned: ISA address retrieved from Super I/O registers |
34 | Datasheet: Available from Nuvoton upon request | 34 | Datasheet: Available from Nuvoton upon request |
35 | * Nuvoton NCT6793D | ||
36 | Prefix: 'nct6793' | ||
37 | Addresses scanned: ISA address retrieved from Super I/O registers | ||
38 | Datasheet: Available from Nuvoton upon request | ||
35 | 39 | ||
36 | Authors: | 40 | Authors: |
37 | Guenter Roeck <linux@roeck-us.net> | 41 | Guenter Roeck <linux@roeck-us.net> |
diff --git a/Documentation/static-keys.txt b/Documentation/static-keys.txt index f4cb0b2d5cd7..477927becacb 100644 --- a/Documentation/static-keys.txt +++ b/Documentation/static-keys.txt | |||
@@ -15,8 +15,8 @@ The updated API replacements are: | |||
15 | 15 | ||
16 | DEFINE_STATIC_KEY_TRUE(key); | 16 | DEFINE_STATIC_KEY_TRUE(key); |
17 | DEFINE_STATIC_KEY_FALSE(key); | 17 | DEFINE_STATIC_KEY_FALSE(key); |
18 | static_key_likely() | 18 | static_branch_likely() |
19 | statick_key_unlikely() | 19 | static_branch_unlikely() |
20 | 20 | ||
21 | 0) Abstract | 21 | 0) Abstract |
22 | 22 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index 7ba7ab749c85..274f85405584 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -6452,11 +6452,11 @@ F: drivers/hwmon/ltc4261.c | |||
6452 | LTP (Linux Test Project) | 6452 | LTP (Linux Test Project) |
6453 | M: Mike Frysinger <vapier@gentoo.org> | 6453 | M: Mike Frysinger <vapier@gentoo.org> |
6454 | M: Cyril Hrubis <chrubis@suse.cz> | 6454 | M: Cyril Hrubis <chrubis@suse.cz> |
6455 | M: Wanlong Gao <gaowanlong@cn.fujitsu.com> | 6455 | M: Wanlong Gao <wanlong.gao@gmail.com> |
6456 | M: Jan Stancek <jstancek@redhat.com> | 6456 | M: Jan Stancek <jstancek@redhat.com> |
6457 | M: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> | 6457 | M: Stanislav Kholmanskikh <stanislav.kholmanskikh@oracle.com> |
6458 | M: Alexey Kodanev <alexey.kodanev@oracle.com> | 6458 | M: Alexey Kodanev <alexey.kodanev@oracle.com> |
6459 | L: ltp-list@lists.sourceforge.net (subscribers-only) | 6459 | L: ltp@lists.linux.it (subscribers-only) |
6460 | W: http://linux-test-project.github.io/ | 6460 | W: http://linux-test-project.github.io/ |
6461 | T: git git://github.com/linux-test-project/ltp.git | 6461 | T: git git://github.com/linux-test-project/ltp.git |
6462 | S: Maintained | 6462 | S: Maintained |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 4 | 1 | VERSION = 4 |
2 | PATCHLEVEL = 3 | 2 | PATCHLEVEL = 3 |
3 | SUBLEVEL = 0 | 3 | SUBLEVEL = 0 |
4 | EXTRAVERSION = -rc1 | 4 | EXTRAVERSION = -rc2 |
5 | NAME = Hurr durr I'ma sheep | 5 | NAME = Hurr durr I'ma sheep |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index f05bdb4b1cb9..ff4049155c84 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h | |||
@@ -297,7 +297,9 @@ static inline void __iomem * ioremap_nocache(unsigned long offset, | |||
297 | unsigned long size) | 297 | unsigned long size) |
298 | { | 298 | { |
299 | return ioremap(offset, size); | 299 | return ioremap(offset, size); |
300 | } | 300 | } |
301 | |||
302 | #define ioremap_uc ioremap_nocache | ||
301 | 303 | ||
302 | static inline void iounmap(volatile void __iomem *addr) | 304 | static inline void iounmap(volatile void __iomem *addr) |
303 | { | 305 | { |
diff --git a/arch/alpha/kernel/irq.c b/arch/alpha/kernel/irq.c index 2804648c8ff4..2d6efcff3bf3 100644 --- a/arch/alpha/kernel/irq.c +++ b/arch/alpha/kernel/irq.c | |||
@@ -117,6 +117,6 @@ handle_irq(int irq) | |||
117 | } | 117 | } |
118 | 118 | ||
119 | irq_enter(); | 119 | irq_enter(); |
120 | generic_handle_irq_desc(irq, desc); | 120 | generic_handle_irq_desc(desc); |
121 | irq_exit(); | 121 | irq_exit(); |
122 | } | 122 | } |
diff --git a/arch/alpha/lib/udelay.c b/arch/alpha/lib/udelay.c index 69d52aa37bae..f2d81ff38aa6 100644 --- a/arch/alpha/lib/udelay.c +++ b/arch/alpha/lib/udelay.c | |||
@@ -30,6 +30,7 @@ __delay(int loops) | |||
30 | " bgt %0,1b" | 30 | " bgt %0,1b" |
31 | : "=&r" (tmp), "=r" (loops) : "1"(loops)); | 31 | : "=&r" (tmp), "=r" (loops) : "1"(loops)); |
32 | } | 32 | } |
33 | EXPORT_SYMBOL(__delay); | ||
33 | 34 | ||
34 | #ifdef CONFIG_SMP | 35 | #ifdef CONFIG_SMP |
35 | #define LPJ cpu_data[smp_processor_id()].loops_per_jiffy | 36 | #define LPJ cpu_data[smp_processor_id()].loops_per_jiffy |
diff --git a/arch/arc/kernel/mcip.c b/arch/arc/kernel/mcip.c index d9e44b62df05..4ffd1855f1bd 100644 --- a/arch/arc/kernel/mcip.c +++ b/arch/arc/kernel/mcip.c | |||
@@ -252,7 +252,7 @@ static struct irq_chip idu_irq_chip = { | |||
252 | 252 | ||
253 | static int idu_first_irq; | 253 | static int idu_first_irq; |
254 | 254 | ||
255 | static void idu_cascade_isr(unsigned int __core_irq, struct irq_desc *desc) | 255 | static void idu_cascade_isr(struct irq_desc *desc) |
256 | { | 256 | { |
257 | struct irq_domain *domain = irq_desc_get_handler_data(desc); | 257 | struct irq_domain *domain = irq_desc_get_handler_data(desc); |
258 | unsigned int core_irq = irq_desc_get_irq(desc); | 258 | unsigned int core_irq = irq_desc_get_irq(desc); |
diff --git a/arch/arm/Makefile b/arch/arm/Makefile index 7451b447cc2d..2c2b28ee4811 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile | |||
@@ -54,6 +54,14 @@ AS += -EL | |||
54 | LD += -EL | 54 | LD += -EL |
55 | endif | 55 | endif |
56 | 56 | ||
57 | # | ||
58 | # The Scalar Replacement of Aggregates (SRA) optimization pass in GCC 4.9 and | ||
59 | # later may result in code being generated that handles signed short and signed | ||
60 | # char struct members incorrectly. So disable it. | ||
61 | # (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65932) | ||
62 | # | ||
63 | KBUILD_CFLAGS += $(call cc-option,-fno-ipa-sra) | ||
64 | |||
57 | # This selects which instruction set is used. | 65 | # This selects which instruction set is used. |
58 | # Note that GCC does not numerically define an architecture version | 66 | # Note that GCC does not numerically define an architecture version |
59 | # macro, but instead defines a whole series of macros which makes | 67 | # macro, but instead defines a whole series of macros which makes |
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 96dabcb6c621..996aed3b4eee 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
@@ -95,7 +95,7 @@ void it8152_init_irq(void) | |||
95 | } | 95 | } |
96 | } | 96 | } |
97 | 97 | ||
98 | void it8152_irq_demux(unsigned int irq, struct irq_desc *desc) | 98 | void it8152_irq_demux(struct irq_desc *desc) |
99 | { | 99 | { |
100 | int bits_pd, bits_lp, bits_ld; | 100 | int bits_pd, bits_lp, bits_ld; |
101 | int i; | 101 | int i; |
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 304adea4bc52..0e97b4b871f9 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
@@ -138,7 +138,7 @@ static struct locomo_dev_info locomo_devices[] = { | |||
138 | }, | 138 | }, |
139 | }; | 139 | }; |
140 | 140 | ||
141 | static void locomo_handler(unsigned int __irq, struct irq_desc *desc) | 141 | static void locomo_handler(struct irq_desc *desc) |
142 | { | 142 | { |
143 | struct locomo *lchip = irq_desc_get_chip_data(desc); | 143 | struct locomo *lchip = irq_desc_get_chip_data(desc); |
144 | int req, i; | 144 | int req, i; |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 4f290250fa93..3d224941b541 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -196,10 +196,8 @@ static struct sa1111_dev_info sa1111_devices[] = { | |||
196 | * active IRQs causes the interrupt output to pulse, the upper levels | 196 | * active IRQs causes the interrupt output to pulse, the upper levels |
197 | * will call us again if there are more interrupts to process. | 197 | * will call us again if there are more interrupts to process. |
198 | */ | 198 | */ |
199 | static void | 199 | static void sa1111_irq_handler(struct irq_desc *desc) |
200 | sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc) | ||
201 | { | 200 | { |
202 | unsigned int irq = irq_desc_get_irq(desc); | ||
203 | unsigned int stat0, stat1, i; | 201 | unsigned int stat0, stat1, i; |
204 | struct sa1111 *sachip = irq_desc_get_handler_data(desc); | 202 | struct sa1111 *sachip = irq_desc_get_handler_data(desc); |
205 | void __iomem *mapbase = sachip->base + SA1111_INTC; | 203 | void __iomem *mapbase = sachip->base + SA1111_INTC; |
@@ -214,7 +212,7 @@ sa1111_irq_handler(unsigned int __irq, struct irq_desc *desc) | |||
214 | sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); | 212 | sa1111_writel(stat1, mapbase + SA1111_INTSTATCLR1); |
215 | 213 | ||
216 | if (stat0 == 0 && stat1 == 0) { | 214 | if (stat0 == 0 && stat1 == 0) { |
217 | do_bad_IRQ(irq, desc); | 215 | do_bad_IRQ(desc); |
218 | return; | 216 | return; |
219 | } | 217 | } |
220 | 218 | ||
diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h index 7bbf325a4f31..b2bc8e11471d 100644 --- a/arch/arm/include/asm/assembler.h +++ b/arch/arm/include/asm/assembler.h | |||
@@ -491,11 +491,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT ) | |||
491 | #endif | 491 | #endif |
492 | .endm | 492 | .endm |
493 | 493 | ||
494 | .macro uaccess_save_and_disable, tmp | ||
495 | uaccess_save \tmp | ||
496 | uaccess_disable \tmp | ||
497 | .endm | ||
498 | |||
499 | .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo | 494 | .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo |
500 | .macro ret\c, reg | 495 | .macro ret\c, reg |
501 | #if __LINUX_ARM_ARCH__ < 6 | 496 | #if __LINUX_ARM_ARCH__ < 6 |
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h index b274bde24905..e7335a92144e 100644 --- a/arch/arm/include/asm/bug.h +++ b/arch/arm/include/asm/bug.h | |||
@@ -40,6 +40,7 @@ do { \ | |||
40 | "2:\t.asciz " #__file "\n" \ | 40 | "2:\t.asciz " #__file "\n" \ |
41 | ".popsection\n" \ | 41 | ".popsection\n" \ |
42 | ".pushsection __bug_table,\"a\"\n" \ | 42 | ".pushsection __bug_table,\"a\"\n" \ |
43 | ".align 2\n" \ | ||
43 | "3:\t.word 1b, 2b\n" \ | 44 | "3:\t.word 1b, 2b\n" \ |
44 | "\t.hword " #__line ", 0\n" \ | 45 | "\t.hword " #__line ", 0\n" \ |
45 | ".popsection"); \ | 46 | ".popsection"); \ |
diff --git a/arch/arm/include/asm/domain.h b/arch/arm/include/asm/domain.h index e878129f2fee..fc8ba1663601 100644 --- a/arch/arm/include/asm/domain.h +++ b/arch/arm/include/asm/domain.h | |||
@@ -12,6 +12,7 @@ | |||
12 | 12 | ||
13 | #ifndef __ASSEMBLY__ | 13 | #ifndef __ASSEMBLY__ |
14 | #include <asm/barrier.h> | 14 | #include <asm/barrier.h> |
15 | #include <asm/thread_info.h> | ||
15 | #endif | 16 | #endif |
16 | 17 | ||
17 | /* | 18 | /* |
@@ -89,7 +90,8 @@ static inline unsigned int get_domain(void) | |||
89 | 90 | ||
90 | asm( | 91 | asm( |
91 | "mrc p15, 0, %0, c3, c0 @ get domain" | 92 | "mrc p15, 0, %0, c3, c0 @ get domain" |
92 | : "=r" (domain)); | 93 | : "=r" (domain) |
94 | : "m" (current_thread_info()->cpu_domain)); | ||
93 | 95 | ||
94 | return domain; | 96 | return domain; |
95 | } | 97 | } |
@@ -98,7 +100,7 @@ static inline void set_domain(unsigned val) | |||
98 | { | 100 | { |
99 | asm volatile( | 101 | asm volatile( |
100 | "mcr p15, 0, %0, c3, c0 @ set domain" | 102 | "mcr p15, 0, %0, c3, c0 @ set domain" |
101 | : : "r" (val)); | 103 | : : "r" (val) : "memory"); |
102 | isb(); | 104 | isb(); |
103 | } | 105 | } |
104 | 106 | ||
diff --git a/arch/arm/include/asm/hardware/it8152.h b/arch/arm/include/asm/hardware/it8152.h index d36a73d7c0e8..076777ff3daa 100644 --- a/arch/arm/include/asm/hardware/it8152.h +++ b/arch/arm/include/asm/hardware/it8152.h | |||
@@ -106,7 +106,7 @@ extern void __iomem *it8152_base_address; | |||
106 | struct pci_dev; | 106 | struct pci_dev; |
107 | struct pci_sys_data; | 107 | struct pci_sys_data; |
108 | 108 | ||
109 | extern void it8152_irq_demux(unsigned int irq, struct irq_desc *desc); | 109 | extern void it8152_irq_demux(struct irq_desc *desc); |
110 | extern void it8152_init_irq(void); | 110 | extern void it8152_init_irq(void); |
111 | extern int it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | 111 | extern int it8152_pci_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); |
112 | extern int it8152_pci_setup(int nr, struct pci_sys_data *sys); | 112 | extern int it8152_pci_setup(int nr, struct pci_sys_data *sys); |
diff --git a/arch/arm/include/asm/hw_irq.h b/arch/arm/include/asm/hw_irq.h index af79da40af2a..9beb92914f4d 100644 --- a/arch/arm/include/asm/hw_irq.h +++ b/arch/arm/include/asm/hw_irq.h | |||
@@ -11,12 +11,6 @@ static inline void ack_bad_irq(int irq) | |||
11 | pr_crit("unexpected IRQ trap at vector %02x\n", irq); | 11 | pr_crit("unexpected IRQ trap at vector %02x\n", irq); |
12 | } | 12 | } |
13 | 13 | ||
14 | void set_irq_flags(unsigned int irq, unsigned int flags); | ||
15 | |||
16 | #define IRQF_VALID (1 << 0) | ||
17 | #define IRQF_PROBE (1 << 1) | ||
18 | #define IRQF_NOAUTOEN (1 << 2) | ||
19 | |||
20 | #define ARCH_IRQ_INIT_FLAGS (IRQ_NOREQUEST | IRQ_NOPROBE) | 14 | #define ARCH_IRQ_INIT_FLAGS (IRQ_NOREQUEST | IRQ_NOPROBE) |
21 | 15 | ||
22 | #endif | 16 | #endif |
diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index dcba0fa5176e..3df1e975f72a 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h | |||
@@ -29,12 +29,6 @@ | |||
29 | 29 | ||
30 | #define __KVM_HAVE_ARCH_INTC_INITIALIZED | 30 | #define __KVM_HAVE_ARCH_INTC_INITIALIZED |
31 | 31 | ||
32 | #if defined(CONFIG_KVM_ARM_MAX_VCPUS) | ||
33 | #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS | ||
34 | #else | ||
35 | #define KVM_MAX_VCPUS 0 | ||
36 | #endif | ||
37 | |||
38 | #define KVM_USER_MEM_SLOTS 32 | 32 | #define KVM_USER_MEM_SLOTS 32 |
39 | #define KVM_PRIVATE_MEM_SLOTS 4 | 33 | #define KVM_PRIVATE_MEM_SLOTS 4 |
40 | #define KVM_COALESCED_MMIO_PAGE_OFFSET 1 | 34 | #define KVM_COALESCED_MMIO_PAGE_OFFSET 1 |
@@ -44,6 +38,8 @@ | |||
44 | 38 | ||
45 | #include <kvm/arm_vgic.h> | 39 | #include <kvm/arm_vgic.h> |
46 | 40 | ||
41 | #define KVM_MAX_VCPUS VGIC_V2_MAX_CPUS | ||
42 | |||
47 | u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); | 43 | u32 *kvm_vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num, u32 mode); |
48 | int __attribute_const__ kvm_target_cpu(void); | 44 | int __attribute_const__ kvm_target_cpu(void); |
49 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); | 45 | int kvm_reset_vcpu(struct kvm_vcpu *vcpu); |
@@ -148,6 +144,7 @@ struct kvm_vm_stat { | |||
148 | 144 | ||
149 | struct kvm_vcpu_stat { | 145 | struct kvm_vcpu_stat { |
150 | u32 halt_successful_poll; | 146 | u32 halt_successful_poll; |
147 | u32 halt_attempted_poll; | ||
151 | u32 halt_wakeup; | 148 | u32 halt_wakeup; |
152 | }; | 149 | }; |
153 | 150 | ||
diff --git a/arch/arm/include/asm/mach/irq.h b/arch/arm/include/asm/mach/irq.h index 2092ee1e1300..de4634b51456 100644 --- a/arch/arm/include/asm/mach/irq.h +++ b/arch/arm/include/asm/mach/irq.h | |||
@@ -23,10 +23,10 @@ extern int show_fiq_list(struct seq_file *, int); | |||
23 | /* | 23 | /* |
24 | * This is for easy migration, but should be changed in the source | 24 | * This is for easy migration, but should be changed in the source |
25 | */ | 25 | */ |
26 | #define do_bad_IRQ(irq,desc) \ | 26 | #define do_bad_IRQ(desc) \ |
27 | do { \ | 27 | do { \ |
28 | raw_spin_lock(&desc->lock); \ | 28 | raw_spin_lock(&desc->lock); \ |
29 | handle_bad_irq(irq, desc); \ | 29 | handle_bad_irq(desc); \ |
30 | raw_spin_unlock(&desc->lock); \ | 30 | raw_spin_unlock(&desc->lock); \ |
31 | } while(0) | 31 | } while(0) |
32 | 32 | ||
diff --git a/arch/arm/include/asm/thread_info.h b/arch/arm/include/asm/thread_info.h index d0a1119dcaf3..776757d1604a 100644 --- a/arch/arm/include/asm/thread_info.h +++ b/arch/arm/include/asm/thread_info.h | |||
@@ -25,7 +25,6 @@ | |||
25 | struct task_struct; | 25 | struct task_struct; |
26 | 26 | ||
27 | #include <asm/types.h> | 27 | #include <asm/types.h> |
28 | #include <asm/domain.h> | ||
29 | 28 | ||
30 | typedef unsigned long mm_segment_t; | 29 | typedef unsigned long mm_segment_t; |
31 | 30 | ||
diff --git a/arch/arm/kernel/irq.c b/arch/arm/kernel/irq.c index 5ff4826cb154..2766183e69df 100644 --- a/arch/arm/kernel/irq.c +++ b/arch/arm/kernel/irq.c | |||
@@ -79,26 +79,6 @@ asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
79 | handle_IRQ(irq, regs); | 79 | handle_IRQ(irq, regs); |
80 | } | 80 | } |
81 | 81 | ||
82 | void set_irq_flags(unsigned int irq, unsigned int iflags) | ||
83 | { | ||
84 | unsigned long clr = 0, set = IRQ_NOREQUEST | IRQ_NOPROBE | IRQ_NOAUTOEN; | ||
85 | |||
86 | if (irq >= nr_irqs) { | ||
87 | pr_err("Trying to set irq flags for IRQ%d\n", irq); | ||
88 | return; | ||
89 | } | ||
90 | |||
91 | if (iflags & IRQF_VALID) | ||
92 | clr |= IRQ_NOREQUEST; | ||
93 | if (iflags & IRQF_PROBE) | ||
94 | clr |= IRQ_NOPROBE; | ||
95 | if (!(iflags & IRQF_NOAUTOEN)) | ||
96 | clr |= IRQ_NOAUTOEN; | ||
97 | /* Order is clear bits in "clr" then set bits in "set" */ | ||
98 | irq_modify_status(irq, clr, set & ~clr); | ||
99 | } | ||
100 | EXPORT_SYMBOL_GPL(set_irq_flags); | ||
101 | |||
102 | void __init init_IRQ(void) | 82 | void __init init_IRQ(void) |
103 | { | 83 | { |
104 | int ret; | 84 | int ret; |
diff --git a/arch/arm/kernel/kgdb.c b/arch/arm/kernel/kgdb.c index a6ad93c9bce3..fd9eefce0a7b 100644 --- a/arch/arm/kernel/kgdb.c +++ b/arch/arm/kernel/kgdb.c | |||
@@ -259,15 +259,17 @@ int kgdb_arch_set_breakpoint(struct kgdb_bkpt *bpt) | |||
259 | if (err) | 259 | if (err) |
260 | return err; | 260 | return err; |
261 | 261 | ||
262 | patch_text((void *)bpt->bpt_addr, | 262 | /* Machine is already stopped, so we can use __patch_text() directly */ |
263 | *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr); | 263 | __patch_text((void *)bpt->bpt_addr, |
264 | *(unsigned int *)arch_kgdb_ops.gdb_bpt_instr); | ||
264 | 265 | ||
265 | return err; | 266 | return err; |
266 | } | 267 | } |
267 | 268 | ||
268 | int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) | 269 | int kgdb_arch_remove_breakpoint(struct kgdb_bkpt *bpt) |
269 | { | 270 | { |
270 | patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr); | 271 | /* Machine is already stopped, so we can use __patch_text() directly */ |
272 | __patch_text((void *)bpt->bpt_addr, *(unsigned int *)bpt->saved_instr); | ||
271 | 273 | ||
272 | return 0; | 274 | return 0; |
273 | } | 275 | } |
diff --git a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c index a3089bacb8d8..7a7c4cea5523 100644 --- a/arch/arm/kernel/process.c +++ b/arch/arm/kernel/process.c | |||
@@ -226,6 +226,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
226 | 226 | ||
227 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); | 227 | memset(&thread->cpu_context, 0, sizeof(struct cpu_context_save)); |
228 | 228 | ||
229 | #ifdef CONFIG_CPU_USE_DOMAINS | ||
229 | /* | 230 | /* |
230 | * Copy the initial value of the domain access control register | 231 | * Copy the initial value of the domain access control register |
231 | * from the current thread: thread->addr_limit will have been | 232 | * from the current thread: thread->addr_limit will have been |
@@ -233,6 +234,7 @@ copy_thread(unsigned long clone_flags, unsigned long stack_start, | |||
233 | * kernel/fork.c | 234 | * kernel/fork.c |
234 | */ | 235 | */ |
235 | thread->cpu_domain = get_domain(); | 236 | thread->cpu_domain = get_domain(); |
237 | #endif | ||
236 | 238 | ||
237 | if (likely(!(p->flags & PF_KTHREAD))) { | 239 | if (likely(!(p->flags & PF_KTHREAD))) { |
238 | *childregs = *current_pt_regs(); | 240 | *childregs = *current_pt_regs(); |
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index b6cda06b455f..7b8f2141427b 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c | |||
@@ -343,15 +343,18 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig, | |||
343 | */ | 343 | */ |
344 | thumb = handler & 1; | 344 | thumb = handler & 1; |
345 | 345 | ||
346 | #if __LINUX_ARM_ARCH__ >= 7 | ||
347 | /* | 346 | /* |
348 | * Clear the If-Then Thumb-2 execution state | 347 | * Clear the If-Then Thumb-2 execution state. ARM spec |
349 | * ARM spec requires this to be all 000s in ARM mode | 348 | * requires this to be all 000s in ARM mode. Snapdragon |
350 | * Snapdragon S4/Krait misbehaves on a Thumb=>ARM | 349 | * S4/Krait misbehaves on a Thumb=>ARM signal transition |
351 | * signal transition without this. | 350 | * without this. |
351 | * | ||
352 | * We must do this whenever we are running on a Thumb-2 | ||
353 | * capable CPU, which includes ARMv6T2. However, we elect | ||
354 | * to always do this to simplify the code; this field is | ||
355 | * marked UNK/SBZP for older architectures. | ||
352 | */ | 356 | */ |
353 | cpsr &= ~PSR_IT_MASK; | 357 | cpsr &= ~PSR_IT_MASK; |
354 | #endif | ||
355 | 358 | ||
356 | if (thumb) { | 359 | if (thumb) { |
357 | cpsr |= PSR_T_BIT; | 360 | cpsr |= PSR_T_BIT; |
diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig index bfb915d05665..210eccadb69a 100644 --- a/arch/arm/kvm/Kconfig +++ b/arch/arm/kvm/Kconfig | |||
@@ -45,15 +45,4 @@ config KVM_ARM_HOST | |||
45 | ---help--- | 45 | ---help--- |
46 | Provides host support for ARM processors. | 46 | Provides host support for ARM processors. |
47 | 47 | ||
48 | config KVM_ARM_MAX_VCPUS | ||
49 | int "Number maximum supported virtual CPUs per VM" | ||
50 | depends on KVM_ARM_HOST | ||
51 | default 4 | ||
52 | help | ||
53 | Static number of max supported virtual CPUs per VM. | ||
54 | |||
55 | If you choose a high number, the vcpu structures will be quite | ||
56 | large, so only choose a reasonable number that you expect to | ||
57 | actually use. | ||
58 | |||
59 | endif # VIRTUALIZATION | 48 | endif # VIRTUALIZATION |
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c index ce404a5c3062..dc017adfddc8 100644 --- a/arch/arm/kvm/arm.c +++ b/arch/arm/kvm/arm.c | |||
@@ -446,7 +446,7 @@ static int kvm_vcpu_first_run_init(struct kvm_vcpu *vcpu) | |||
446 | * Map the VGIC hardware resources before running a vcpu the first | 446 | * Map the VGIC hardware resources before running a vcpu the first |
447 | * time on this VM. | 447 | * time on this VM. |
448 | */ | 448 | */ |
449 | if (unlikely(!vgic_ready(kvm))) { | 449 | if (unlikely(irqchip_in_kernel(kvm) && !vgic_ready(kvm))) { |
450 | ret = kvm_vgic_map_resources(kvm); | 450 | ret = kvm_vgic_map_resources(kvm); |
451 | if (ret) | 451 | if (ret) |
452 | return ret; | 452 | return ret; |
diff --git a/arch/arm/kvm/interrupts_head.S b/arch/arm/kvm/interrupts_head.S index 702740d37465..51a59504bef4 100644 --- a/arch/arm/kvm/interrupts_head.S +++ b/arch/arm/kvm/interrupts_head.S | |||
@@ -515,8 +515,7 @@ ARM_BE8(rev r6, r6 ) | |||
515 | 515 | ||
516 | mrc p15, 0, r2, c14, c3, 1 @ CNTV_CTL | 516 | mrc p15, 0, r2, c14, c3, 1 @ CNTV_CTL |
517 | str r2, [vcpu, #VCPU_TIMER_CNTV_CTL] | 517 | str r2, [vcpu, #VCPU_TIMER_CNTV_CTL] |
518 | bic r2, #1 @ Clear ENABLE | 518 | |
519 | mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL | ||
520 | isb | 519 | isb |
521 | 520 | ||
522 | mrrc p15, 3, rr_lo_hi(r2, r3), c14 @ CNTV_CVAL | 521 | mrrc p15, 3, rr_lo_hi(r2, r3), c14 @ CNTV_CVAL |
@@ -529,6 +528,9 @@ ARM_BE8(rev r6, r6 ) | |||
529 | mcrr p15, 4, r2, r2, c14 @ CNTVOFF | 528 | mcrr p15, 4, r2, r2, c14 @ CNTVOFF |
530 | 529 | ||
531 | 1: | 530 | 1: |
531 | mov r2, #0 @ Clear ENABLE | ||
532 | mcr p15, 0, r2, c14, c3, 1 @ CNTV_CTL | ||
533 | |||
532 | @ Allow physical timer/counter access for the host | 534 | @ Allow physical timer/counter access for the host |
533 | mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL | 535 | mrc p15, 4, r2, c14, c1, 0 @ CNTHCTL |
534 | orr r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN) | 536 | orr r2, r2, #(CNTHCTL_PL1PCEN | CNTHCTL_PL1PCTEN) |
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index 7b4201294187..6984342da13d 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c | |||
@@ -1792,8 +1792,10 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, | |||
1792 | if (vma->vm_flags & VM_PFNMAP) { | 1792 | if (vma->vm_flags & VM_PFNMAP) { |
1793 | gpa_t gpa = mem->guest_phys_addr + | 1793 | gpa_t gpa = mem->guest_phys_addr + |
1794 | (vm_start - mem->userspace_addr); | 1794 | (vm_start - mem->userspace_addr); |
1795 | phys_addr_t pa = (vma->vm_pgoff << PAGE_SHIFT) + | 1795 | phys_addr_t pa; |
1796 | vm_start - vma->vm_start; | 1796 | |
1797 | pa = (phys_addr_t)vma->vm_pgoff << PAGE_SHIFT; | ||
1798 | pa += vm_start - vma->vm_start; | ||
1797 | 1799 | ||
1798 | /* IO region dirty page logging not allowed */ | 1800 | /* IO region dirty page logging not allowed */ |
1799 | if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES) | 1801 | if (memslot->flags & KVM_MEM_LOG_DIRTY_PAGES) |
diff --git a/arch/arm/kvm/psci.c b/arch/arm/kvm/psci.c index 4b94b513168d..ad6f6424f1d1 100644 --- a/arch/arm/kvm/psci.c +++ b/arch/arm/kvm/psci.c | |||
@@ -126,7 +126,7 @@ static unsigned long kvm_psci_vcpu_on(struct kvm_vcpu *source_vcpu) | |||
126 | 126 | ||
127 | static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) | 127 | static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) |
128 | { | 128 | { |
129 | int i; | 129 | int i, matching_cpus = 0; |
130 | unsigned long mpidr; | 130 | unsigned long mpidr; |
131 | unsigned long target_affinity; | 131 | unsigned long target_affinity; |
132 | unsigned long target_affinity_mask; | 132 | unsigned long target_affinity_mask; |
@@ -151,12 +151,16 @@ static unsigned long kvm_psci_vcpu_affinity_info(struct kvm_vcpu *vcpu) | |||
151 | */ | 151 | */ |
152 | kvm_for_each_vcpu(i, tmp, kvm) { | 152 | kvm_for_each_vcpu(i, tmp, kvm) { |
153 | mpidr = kvm_vcpu_get_mpidr_aff(tmp); | 153 | mpidr = kvm_vcpu_get_mpidr_aff(tmp); |
154 | if (((mpidr & target_affinity_mask) == target_affinity) && | 154 | if ((mpidr & target_affinity_mask) == target_affinity) { |
155 | !tmp->arch.pause) { | 155 | matching_cpus++; |
156 | return PSCI_0_2_AFFINITY_LEVEL_ON; | 156 | if (!tmp->arch.pause) |
157 | return PSCI_0_2_AFFINITY_LEVEL_ON; | ||
157 | } | 158 | } |
158 | } | 159 | } |
159 | 160 | ||
161 | if (!matching_cpus) | ||
162 | return PSCI_RET_INVALID_PARAMS; | ||
163 | |||
160 | return PSCI_0_2_AFFINITY_LEVEL_OFF; | 164 | return PSCI_0_2_AFFINITY_LEVEL_OFF; |
161 | } | 165 | } |
162 | 166 | ||
diff --git a/arch/arm/mach-dove/irq.c b/arch/arm/mach-dove/irq.c index 305d7c6242bb..bfb3703357c5 100644 --- a/arch/arm/mach-dove/irq.c +++ b/arch/arm/mach-dove/irq.c | |||
@@ -69,14 +69,14 @@ static struct irq_chip pmu_irq_chip = { | |||
69 | .irq_ack = pmu_irq_ack, | 69 | .irq_ack = pmu_irq_ack, |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static void pmu_irq_handler(unsigned int __irq, struct irq_desc *desc) | 72 | static void pmu_irq_handler(struct irq_desc *desc) |
73 | { | 73 | { |
74 | unsigned int irq = irq_desc_get_irq(desc); | ||
75 | unsigned long cause = readl(PMU_INTERRUPT_CAUSE); | 74 | unsigned long cause = readl(PMU_INTERRUPT_CAUSE); |
75 | unsigned int irq; | ||
76 | 76 | ||
77 | cause &= readl(PMU_INTERRUPT_MASK); | 77 | cause &= readl(PMU_INTERRUPT_MASK); |
78 | if (cause == 0) { | 78 | if (cause == 0) { |
79 | do_bad_IRQ(irq, desc); | 79 | do_bad_IRQ(desc); |
80 | return; | 80 | return; |
81 | } | 81 | } |
82 | 82 | ||
diff --git a/arch/arm/mach-footbridge/isa-irq.c b/arch/arm/mach-footbridge/isa-irq.c index fcd79bc3a3e1..c01fca11b224 100644 --- a/arch/arm/mach-footbridge/isa-irq.c +++ b/arch/arm/mach-footbridge/isa-irq.c | |||
@@ -87,13 +87,12 @@ static struct irq_chip isa_hi_chip = { | |||
87 | .irq_unmask = isa_unmask_pic_hi_irq, | 87 | .irq_unmask = isa_unmask_pic_hi_irq, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | static void | 90 | static void isa_irq_handler(struct irq_desc *desc) |
91 | isa_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
92 | { | 91 | { |
93 | unsigned int isa_irq = *(unsigned char *)PCIIACK_BASE; | 92 | unsigned int isa_irq = *(unsigned char *)PCIIACK_BASE; |
94 | 93 | ||
95 | if (isa_irq < _ISA_IRQ(0) || isa_irq >= _ISA_IRQ(16)) { | 94 | if (isa_irq < _ISA_IRQ(0) || isa_irq >= _ISA_IRQ(16)) { |
96 | do_bad_IRQ(isa_irq, desc); | 95 | do_bad_IRQ(desc); |
97 | return; | 96 | return; |
98 | } | 97 | } |
99 | 98 | ||
diff --git a/arch/arm/mach-gemini/gpio.c b/arch/arm/mach-gemini/gpio.c index 220333ed741d..2478d9f4d92d 100644 --- a/arch/arm/mach-gemini/gpio.c +++ b/arch/arm/mach-gemini/gpio.c | |||
@@ -126,7 +126,7 @@ static int gpio_set_irq_type(struct irq_data *d, unsigned int type) | |||
126 | return 0; | 126 | return 0; |
127 | } | 127 | } |
128 | 128 | ||
129 | static void gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 129 | static void gpio_irq_handler(struct irq_desc *desc) |
130 | { | 130 | { |
131 | unsigned int port = (unsigned int)irq_desc_get_handler_data(desc); | 131 | unsigned int port = (unsigned int)irq_desc_get_handler_data(desc); |
132 | unsigned int gpio_irq_no, irq_stat; | 132 | unsigned int gpio_irq_no, irq_stat; |
diff --git a/arch/arm/mach-imx/3ds_debugboard.c b/arch/arm/mach-imx/3ds_debugboard.c index 45903be6e7b3..16496a071ecb 100644 --- a/arch/arm/mach-imx/3ds_debugboard.c +++ b/arch/arm/mach-imx/3ds_debugboard.c | |||
@@ -85,7 +85,7 @@ static struct platform_device smsc_lan9217_device = { | |||
85 | .resource = smsc911x_resources, | 85 | .resource = smsc911x_resources, |
86 | }; | 86 | }; |
87 | 87 | ||
88 | static void mxc_expio_irq_handler(u32 irq, struct irq_desc *desc) | 88 | static void mxc_expio_irq_handler(struct irq_desc *desc) |
89 | { | 89 | { |
90 | u32 imr_val; | 90 | u32 imr_val; |
91 | u32 int_valid; | 91 | u32 int_valid; |
diff --git a/arch/arm/mach-imx/mach-mx31ads.c b/arch/arm/mach-imx/mach-mx31ads.c index 2c0853560bd2..2b147e4bf9c9 100644 --- a/arch/arm/mach-imx/mach-mx31ads.c +++ b/arch/arm/mach-imx/mach-mx31ads.c | |||
@@ -154,7 +154,7 @@ static inline void mxc_init_imx_uart(void) | |||
154 | imx31_add_imx_uart0(&uart_pdata); | 154 | imx31_add_imx_uart0(&uart_pdata); |
155 | } | 155 | } |
156 | 156 | ||
157 | static void mx31ads_expio_irq_handler(u32 irq, struct irq_desc *desc) | 157 | static void mx31ads_expio_irq_handler(struct irq_desc *desc) |
158 | { | 158 | { |
159 | u32 imr_val; | 159 | u32 imr_val; |
160 | u32 int_valid; | 160 | u32 int_valid; |
diff --git a/arch/arm/mach-iop13xx/msi.c b/arch/arm/mach-iop13xx/msi.c index 9f89e76dfbb9..f6235b28578c 100644 --- a/arch/arm/mach-iop13xx/msi.c +++ b/arch/arm/mach-iop13xx/msi.c | |||
@@ -91,7 +91,7 @@ static void (*write_imipr[])(u32) = { | |||
91 | write_imipr_3, | 91 | write_imipr_3, |
92 | }; | 92 | }; |
93 | 93 | ||
94 | static void iop13xx_msi_handler(unsigned int irq, struct irq_desc *desc) | 94 | static void iop13xx_msi_handler(struct irq_desc *desc) |
95 | { | 95 | { |
96 | int i, j; | 96 | int i, j; |
97 | unsigned long status; | 97 | unsigned long status; |
diff --git a/arch/arm/mach-lpc32xx/irq.c b/arch/arm/mach-lpc32xx/irq.c index cce4cef12b6e..2ae431e8bc1b 100644 --- a/arch/arm/mach-lpc32xx/irq.c +++ b/arch/arm/mach-lpc32xx/irq.c | |||
@@ -370,7 +370,7 @@ static struct irq_chip lpc32xx_irq_chip = { | |||
370 | .irq_set_wake = lpc32xx_irq_wake | 370 | .irq_set_wake = lpc32xx_irq_wake |
371 | }; | 371 | }; |
372 | 372 | ||
373 | static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc) | 373 | static void lpc32xx_sic1_handler(struct irq_desc *desc) |
374 | { | 374 | { |
375 | unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC1_BASE)); | 375 | unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC1_BASE)); |
376 | 376 | ||
@@ -383,7 +383,7 @@ static void lpc32xx_sic1_handler(unsigned int irq, struct irq_desc *desc) | |||
383 | } | 383 | } |
384 | } | 384 | } |
385 | 385 | ||
386 | static void lpc32xx_sic2_handler(unsigned int irq, struct irq_desc *desc) | 386 | static void lpc32xx_sic2_handler(struct irq_desc *desc) |
387 | { | 387 | { |
388 | unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC2_BASE)); | 388 | unsigned long ints = __raw_readl(LPC32XX_INTC_STAT(LPC32XX_SIC2_BASE)); |
389 | 389 | ||
diff --git a/arch/arm/mach-netx/generic.c b/arch/arm/mach-netx/generic.c index 6373e2bff203..842302df99c1 100644 --- a/arch/arm/mach-netx/generic.c +++ b/arch/arm/mach-netx/generic.c | |||
@@ -69,8 +69,7 @@ static struct platform_device *devices[] __initdata = { | |||
69 | #define DEBUG_IRQ(fmt...) while (0) {} | 69 | #define DEBUG_IRQ(fmt...) while (0) {} |
70 | #endif | 70 | #endif |
71 | 71 | ||
72 | static void | 72 | static void netx_hif_demux_handler(struct irq_desc *desc) |
73 | netx_hif_demux_handler(unsigned int irq_unused, struct irq_desc *desc) | ||
74 | { | 73 | { |
75 | unsigned int irq = NETX_IRQ_HIF_CHAINED(0); | 74 | unsigned int irq = NETX_IRQ_HIF_CHAINED(0); |
76 | unsigned int stat; | 75 | unsigned int stat; |
diff --git a/arch/arm/mach-omap1/fpga.c b/arch/arm/mach-omap1/fpga.c index dfec671b1639..39e20d0ead08 100644 --- a/arch/arm/mach-omap1/fpga.c +++ b/arch/arm/mach-omap1/fpga.c | |||
@@ -87,7 +87,7 @@ static void fpga_mask_ack_irq(struct irq_data *d) | |||
87 | fpga_ack_irq(d); | 87 | fpga_ack_irq(d); |
88 | } | 88 | } |
89 | 89 | ||
90 | static void innovator_fpga_IRQ_demux(unsigned int irq, struct irq_desc *desc) | 90 | static void innovator_fpga_IRQ_demux(struct irq_desc *desc) |
91 | { | 91 | { |
92 | u32 stat; | 92 | u32 stat; |
93 | int fpga_irq; | 93 | int fpga_irq; |
diff --git a/arch/arm/mach-omap2/prm_common.c b/arch/arm/mach-omap2/prm_common.c index 257e98c26618..3fc2cbe52113 100644 --- a/arch/arm/mach-omap2/prm_common.c +++ b/arch/arm/mach-omap2/prm_common.c | |||
@@ -102,7 +102,7 @@ static void omap_prcm_events_filter_priority(unsigned long *events, | |||
102 | * dispatched accordingly. Clearing of the wakeup events should be | 102 | * dispatched accordingly. Clearing of the wakeup events should be |
103 | * done by the SoC specific individual handlers. | 103 | * done by the SoC specific individual handlers. |
104 | */ | 104 | */ |
105 | static void omap_prcm_irq_handler(unsigned int irq, struct irq_desc *desc) | 105 | static void omap_prcm_irq_handler(struct irq_desc *desc) |
106 | { | 106 | { |
107 | unsigned long pending[OMAP_PRCM_MAX_NR_PENDING_REG]; | 107 | unsigned long pending[OMAP_PRCM_MAX_NR_PENDING_REG]; |
108 | unsigned long priority_pending[OMAP_PRCM_MAX_NR_PENDING_REG]; | 108 | unsigned long priority_pending[OMAP_PRCM_MAX_NR_PENDING_REG]; |
diff --git a/arch/arm/mach-pxa/balloon3.c b/arch/arm/mach-pxa/balloon3.c index 70366b35d299..a3ebb517cca1 100644 --- a/arch/arm/mach-pxa/balloon3.c +++ b/arch/arm/mach-pxa/balloon3.c | |||
@@ -496,7 +496,7 @@ static struct irq_chip balloon3_irq_chip = { | |||
496 | .irq_unmask = balloon3_unmask_irq, | 496 | .irq_unmask = balloon3_unmask_irq, |
497 | }; | 497 | }; |
498 | 498 | ||
499 | static void balloon3_irq_handler(unsigned int __irq, struct irq_desc *desc) | 499 | static void balloon3_irq_handler(struct irq_desc *desc) |
500 | { | 500 | { |
501 | unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) & | 501 | unsigned long pending = __raw_readl(BALLOON3_INT_CONTROL_REG) & |
502 | balloon3_irq_enabled; | 502 | balloon3_irq_enabled; |
diff --git a/arch/arm/mach-pxa/cm-x2xx-pci.c b/arch/arm/mach-pxa/cm-x2xx-pci.c index 1fa79f1f832d..3221ae15bef7 100644 --- a/arch/arm/mach-pxa/cm-x2xx-pci.c +++ b/arch/arm/mach-pxa/cm-x2xx-pci.c | |||
@@ -29,13 +29,12 @@ | |||
29 | void __iomem *it8152_base_address; | 29 | void __iomem *it8152_base_address; |
30 | static int cmx2xx_it8152_irq_gpio; | 30 | static int cmx2xx_it8152_irq_gpio; |
31 | 31 | ||
32 | static void cmx2xx_it8152_irq_demux(unsigned int __irq, struct irq_desc *desc) | 32 | static void cmx2xx_it8152_irq_demux(struct irq_desc *desc) |
33 | { | 33 | { |
34 | unsigned int irq = irq_desc_get_irq(desc); | ||
35 | /* clear our parent irq */ | 34 | /* clear our parent irq */ |
36 | desc->irq_data.chip->irq_ack(&desc->irq_data); | 35 | desc->irq_data.chip->irq_ack(&desc->irq_data); |
37 | 36 | ||
38 | it8152_irq_demux(irq, desc); | 37 | it8152_irq_demux(desc); |
39 | } | 38 | } |
40 | 39 | ||
41 | void __cmx2xx_pci_init_irq(int irq_gpio) | 40 | void __cmx2xx_pci_init_irq(int irq_gpio) |
diff --git a/arch/arm/mach-pxa/lpd270.c b/arch/arm/mach-pxa/lpd270.c index b070167deef2..4823d972e647 100644 --- a/arch/arm/mach-pxa/lpd270.c +++ b/arch/arm/mach-pxa/lpd270.c | |||
@@ -120,7 +120,7 @@ static struct irq_chip lpd270_irq_chip = { | |||
120 | .irq_unmask = lpd270_unmask_irq, | 120 | .irq_unmask = lpd270_unmask_irq, |
121 | }; | 121 | }; |
122 | 122 | ||
123 | static void lpd270_irq_handler(unsigned int __irq, struct irq_desc *desc) | 123 | static void lpd270_irq_handler(struct irq_desc *desc) |
124 | { | 124 | { |
125 | unsigned int irq; | 125 | unsigned int irq; |
126 | unsigned long pending; | 126 | unsigned long pending; |
diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index 9a0c8affdadb..d8319b54299a 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c | |||
@@ -284,7 +284,7 @@ static struct irq_chip pcm990_irq_chip = { | |||
284 | .irq_unmask = pcm990_unmask_irq, | 284 | .irq_unmask = pcm990_unmask_irq, |
285 | }; | 285 | }; |
286 | 286 | ||
287 | static void pcm990_irq_handler(unsigned int __irq, struct irq_desc *desc) | 287 | static void pcm990_irq_handler(struct irq_desc *desc) |
288 | { | 288 | { |
289 | unsigned int irq; | 289 | unsigned int irq; |
290 | unsigned long pending; | 290 | unsigned long pending; |
diff --git a/arch/arm/mach-pxa/viper.c b/arch/arm/mach-pxa/viper.c index 4841d6cefe76..8ab26370107e 100644 --- a/arch/arm/mach-pxa/viper.c +++ b/arch/arm/mach-pxa/viper.c | |||
@@ -276,7 +276,7 @@ static inline unsigned long viper_irq_pending(void) | |||
276 | viper_irq_enabled_mask; | 276 | viper_irq_enabled_mask; |
277 | } | 277 | } |
278 | 278 | ||
279 | static void viper_irq_handler(unsigned int __irq, struct irq_desc *desc) | 279 | static void viper_irq_handler(struct irq_desc *desc) |
280 | { | 280 | { |
281 | unsigned int irq; | 281 | unsigned int irq; |
282 | unsigned long pending; | 282 | unsigned long pending; |
diff --git a/arch/arm/mach-pxa/zeus.c b/arch/arm/mach-pxa/zeus.c index 6f94dd7b4dee..30e62a3f0701 100644 --- a/arch/arm/mach-pxa/zeus.c +++ b/arch/arm/mach-pxa/zeus.c | |||
@@ -105,7 +105,7 @@ static inline unsigned long zeus_irq_pending(void) | |||
105 | return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask; | 105 | return __raw_readw(ZEUS_CPLD_ISA_IRQ) & zeus_irq_enabled_mask; |
106 | } | 106 | } |
107 | 107 | ||
108 | static void zeus_irq_handler(unsigned int __irq, struct irq_desc *desc) | 108 | static void zeus_irq_handler(struct irq_desc *desc) |
109 | { | 109 | { |
110 | unsigned int irq; | 110 | unsigned int irq; |
111 | unsigned long pending; | 111 | unsigned long pending; |
diff --git a/arch/arm/mach-rpc/ecard.c b/arch/arm/mach-rpc/ecard.c index f726d4c4e6dd..dc67a7fb3831 100644 --- a/arch/arm/mach-rpc/ecard.c +++ b/arch/arm/mach-rpc/ecard.c | |||
@@ -551,8 +551,7 @@ static void ecard_check_lockup(struct irq_desc *desc) | |||
551 | } | 551 | } |
552 | } | 552 | } |
553 | 553 | ||
554 | static void | 554 | static void ecard_irq_handler(struct irq_desc *desc) |
555 | ecard_irq_handler(unsigned int irq, struct irq_desc *desc) | ||
556 | { | 555 | { |
557 | ecard_t *ec; | 556 | ecard_t *ec; |
558 | int called = 0; | 557 | int called = 0; |
diff --git a/arch/arm/mach-s3c24xx/bast-irq.c b/arch/arm/mach-s3c24xx/bast-irq.c index ced1ab86ac83..2bb08961e934 100644 --- a/arch/arm/mach-s3c24xx/bast-irq.c +++ b/arch/arm/mach-s3c24xx/bast-irq.c | |||
@@ -100,9 +100,7 @@ static struct irq_chip bast_pc104_chip = { | |||
100 | .irq_ack = bast_pc104_maskack | 100 | .irq_ack = bast_pc104_maskack |
101 | }; | 101 | }; |
102 | 102 | ||
103 | static void | 103 | static void bast_irq_pc104_demux(struct irq_desc *desc) |
104 | bast_irq_pc104_demux(unsigned int irq, | ||
105 | struct irq_desc *desc) | ||
106 | { | 104 | { |
107 | unsigned int stat; | 105 | unsigned int stat; |
108 | unsigned int irqno; | 106 | unsigned int irqno; |
diff --git a/arch/arm/mach-s3c64xx/common.c b/arch/arm/mach-s3c64xx/common.c index fd63ecfb2f81..ddb30b8434c5 100644 --- a/arch/arm/mach-s3c64xx/common.c +++ b/arch/arm/mach-s3c64xx/common.c | |||
@@ -388,22 +388,22 @@ static inline void s3c_irq_demux_eint(unsigned int start, unsigned int end) | |||
388 | } | 388 | } |
389 | } | 389 | } |
390 | 390 | ||
391 | static void s3c_irq_demux_eint0_3(unsigned int irq, struct irq_desc *desc) | 391 | static void s3c_irq_demux_eint0_3(struct irq_desc *desc) |
392 | { | 392 | { |
393 | s3c_irq_demux_eint(0, 3); | 393 | s3c_irq_demux_eint(0, 3); |
394 | } | 394 | } |
395 | 395 | ||
396 | static void s3c_irq_demux_eint4_11(unsigned int irq, struct irq_desc *desc) | 396 | static void s3c_irq_demux_eint4_11(struct irq_desc *desc) |
397 | { | 397 | { |
398 | s3c_irq_demux_eint(4, 11); | 398 | s3c_irq_demux_eint(4, 11); |
399 | } | 399 | } |
400 | 400 | ||
401 | static void s3c_irq_demux_eint12_19(unsigned int irq, struct irq_desc *desc) | 401 | static void s3c_irq_demux_eint12_19(struct irq_desc *desc) |
402 | { | 402 | { |
403 | s3c_irq_demux_eint(12, 19); | 403 | s3c_irq_demux_eint(12, 19); |
404 | } | 404 | } |
405 | 405 | ||
406 | static void s3c_irq_demux_eint20_27(unsigned int irq, struct irq_desc *desc) | 406 | static void s3c_irq_demux_eint20_27(struct irq_desc *desc) |
407 | { | 407 | { |
408 | s3c_irq_demux_eint(20, 27); | 408 | s3c_irq_demux_eint(20, 27); |
409 | } | 409 | } |
diff --git a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c index 6d237b4f7a8e..8411985af9ff 100644 --- a/arch/arm/mach-sa1100/neponset.c +++ b/arch/arm/mach-sa1100/neponset.c | |||
@@ -166,7 +166,7 @@ static struct sa1100_port_fns neponset_port_fns = { | |||
166 | * ensure that the IRQ signal is deasserted before returning. This | 166 | * ensure that the IRQ signal is deasserted before returning. This |
167 | * is rather unfortunate. | 167 | * is rather unfortunate. |
168 | */ | 168 | */ |
169 | static void neponset_irq_handler(unsigned int irq, struct irq_desc *desc) | 169 | static void neponset_irq_handler(struct irq_desc *desc) |
170 | { | 170 | { |
171 | struct neponset_drvdata *d = irq_desc_get_handler_data(desc); | 171 | struct neponset_drvdata *d = irq_desc_get_handler_data(desc); |
172 | unsigned int irr; | 172 | unsigned int irr; |
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c index e62604384945..1a7815e5421b 100644 --- a/arch/arm/mm/dma-mapping.c +++ b/arch/arm/mm/dma-mapping.c | |||
@@ -1249,7 +1249,7 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size) | |||
1249 | struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); | 1249 | struct dma_iommu_mapping *mapping = to_dma_iommu_mapping(dev); |
1250 | unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; | 1250 | unsigned int count = PAGE_ALIGN(size) >> PAGE_SHIFT; |
1251 | dma_addr_t dma_addr, iova; | 1251 | dma_addr_t dma_addr, iova; |
1252 | int i, ret = DMA_ERROR_CODE; | 1252 | int i; |
1253 | 1253 | ||
1254 | dma_addr = __alloc_iova(mapping, size); | 1254 | dma_addr = __alloc_iova(mapping, size); |
1255 | if (dma_addr == DMA_ERROR_CODE) | 1255 | if (dma_addr == DMA_ERROR_CODE) |
@@ -1257,6 +1257,8 @@ __iommu_create_mapping(struct device *dev, struct page **pages, size_t size) | |||
1257 | 1257 | ||
1258 | iova = dma_addr; | 1258 | iova = dma_addr; |
1259 | for (i = 0; i < count; ) { | 1259 | for (i = 0; i < count; ) { |
1260 | int ret; | ||
1261 | |||
1260 | unsigned int next_pfn = page_to_pfn(pages[i]) + 1; | 1262 | unsigned int next_pfn = page_to_pfn(pages[i]) + 1; |
1261 | phys_addr_t phys = page_to_phys(pages[i]); | 1263 | phys_addr_t phys = page_to_phys(pages[i]); |
1262 | unsigned int len, j; | 1264 | unsigned int len, j; |
diff --git a/arch/arm/nwfpe/entry.S b/arch/arm/nwfpe/entry.S index 71df43547659..39c20afad7ed 100644 --- a/arch/arm/nwfpe/entry.S +++ b/arch/arm/nwfpe/entry.S | |||
@@ -95,9 +95,10 @@ emulate: | |||
95 | reteq r4 @ no, return failure | 95 | reteq r4 @ no, return failure |
96 | 96 | ||
97 | next: | 97 | next: |
98 | uaccess_enable r3 | ||
98 | .Lx1: ldrt r6, [r5], #4 @ get the next instruction and | 99 | .Lx1: ldrt r6, [r5], #4 @ get the next instruction and |
99 | @ increment PC | 100 | @ increment PC |
100 | 101 | uaccess_disable r3 | |
101 | and r2, r6, #0x0F000000 @ test for FP insns | 102 | and r2, r6, #0x0F000000 @ test for FP insns |
102 | teq r2, #0x0C000000 | 103 | teq r2, #0x0C000000 |
103 | teqne r2, #0x0D000000 | 104 | teqne r2, #0x0D000000 |
diff --git a/arch/arm/plat-orion/gpio.c b/arch/arm/plat-orion/gpio.c index 79c33eca09a3..7bd22d8e5b11 100644 --- a/arch/arm/plat-orion/gpio.c +++ b/arch/arm/plat-orion/gpio.c | |||
@@ -407,7 +407,7 @@ static int gpio_irq_set_type(struct irq_data *d, u32 type) | |||
407 | return 0; | 407 | return 0; |
408 | } | 408 | } |
409 | 409 | ||
410 | static void gpio_irq_handler(unsigned __irq, struct irq_desc *desc) | 410 | static void gpio_irq_handler(struct irq_desc *desc) |
411 | { | 411 | { |
412 | struct orion_gpio_chip *ochip = irq_desc_get_handler_data(desc); | 412 | struct orion_gpio_chip *ochip = irq_desc_get_handler_data(desc); |
413 | u32 cause, type; | 413 | u32 cause, type; |
diff --git a/arch/arm/xen/hypercall.S b/arch/arm/xen/hypercall.S index f00e08075938..10fd99c568c6 100644 --- a/arch/arm/xen/hypercall.S +++ b/arch/arm/xen/hypercall.S | |||
@@ -98,8 +98,23 @@ ENTRY(privcmd_call) | |||
98 | mov r1, r2 | 98 | mov r1, r2 |
99 | mov r2, r3 | 99 | mov r2, r3 |
100 | ldr r3, [sp, #8] | 100 | ldr r3, [sp, #8] |
101 | /* | ||
102 | * Privcmd calls are issued by the userspace. We need to allow the | ||
103 | * kernel to access the userspace memory before issuing the hypercall. | ||
104 | */ | ||
105 | uaccess_enable r4 | ||
106 | |||
107 | /* r4 is loaded now as we use it as scratch register before */ | ||
101 | ldr r4, [sp, #4] | 108 | ldr r4, [sp, #4] |
102 | __HVC(XEN_IMM) | 109 | __HVC(XEN_IMM) |
110 | |||
111 | /* | ||
112 | * Disable userspace access from kernel. This is fine to do it | ||
113 | * unconditionally as no set_fs(KERNEL_DS)/set_fs(get_ds()) is | ||
114 | * called before. | ||
115 | */ | ||
116 | uaccess_disable r4 | ||
117 | |||
103 | ldm sp!, {r4} | 118 | ldm sp!, {r4} |
104 | ret lr | 119 | ret lr |
105 | ENDPROC(privcmd_call); | 120 | ENDPROC(privcmd_call); |
diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 7d95663c0160..07d1811aa03f 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig | |||
@@ -32,6 +32,7 @@ config ARM64 | |||
32 | select GENERIC_CLOCKEVENTS_BROADCAST | 32 | select GENERIC_CLOCKEVENTS_BROADCAST |
33 | select GENERIC_CPU_AUTOPROBE | 33 | select GENERIC_CPU_AUTOPROBE |
34 | select GENERIC_EARLY_IOREMAP | 34 | select GENERIC_EARLY_IOREMAP |
35 | select GENERIC_IDLE_POLL_SETUP | ||
35 | select GENERIC_IRQ_PROBE | 36 | select GENERIC_IRQ_PROBE |
36 | select GENERIC_IRQ_SHOW | 37 | select GENERIC_IRQ_SHOW |
37 | select GENERIC_IRQ_SHOW_LEVEL | 38 | select GENERIC_IRQ_SHOW_LEVEL |
@@ -331,6 +332,22 @@ config ARM64_ERRATUM_845719 | |||
331 | 332 | ||
332 | If unsure, say Y. | 333 | If unsure, say Y. |
333 | 334 | ||
335 | config ARM64_ERRATUM_843419 | ||
336 | bool "Cortex-A53: 843419: A load or store might access an incorrect address" | ||
337 | depends on MODULES | ||
338 | default y | ||
339 | help | ||
340 | This option builds kernel modules using the large memory model in | ||
341 | order to avoid the use of the ADRP instruction, which can cause | ||
342 | a subsequent memory access to use an incorrect address on Cortex-A53 | ||
343 | parts up to r0p4. | ||
344 | |||
345 | Note that the kernel itself must be linked with a version of ld | ||
346 | which fixes potentially affected ADRP instructions through the | ||
347 | use of veneers. | ||
348 | |||
349 | If unsure, say Y. | ||
350 | |||
334 | endmenu | 351 | endmenu |
335 | 352 | ||
336 | 353 | ||
diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index 15ff5b4156fd..f9914d7c1bb0 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile | |||
@@ -41,6 +41,10 @@ endif | |||
41 | 41 | ||
42 | CHECKFLAGS += -D__aarch64__ | 42 | CHECKFLAGS += -D__aarch64__ |
43 | 43 | ||
44 | ifeq ($(CONFIG_ARM64_ERRATUM_843419), y) | ||
45 | CFLAGS_MODULE += -mcmodel=large | ||
46 | endif | ||
47 | |||
44 | # Default value | 48 | # Default value |
45 | head-y := arch/arm64/kernel/head.o | 49 | head-y := arch/arm64/kernel/head.o |
46 | 50 | ||
diff --git a/arch/arm64/include/asm/hardirq.h b/arch/arm64/include/asm/hardirq.h index 2bb7009bdac7..a57601f9d17c 100644 --- a/arch/arm64/include/asm/hardirq.h +++ b/arch/arm64/include/asm/hardirq.h | |||
@@ -43,9 +43,4 @@ static inline void ack_bad_irq(unsigned int irq) | |||
43 | irq_err_count++; | 43 | irq_err_count++; |
44 | } | 44 | } |
45 | 45 | ||
46 | /* | ||
47 | * No arch-specific IRQ flags. | ||
48 | */ | ||
49 | #define set_irq_flags(irq, flags) | ||
50 | |||
51 | #endif /* __ASM_HARDIRQ_H */ | 46 | #endif /* __ASM_HARDIRQ_H */ |
diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h index 7605e095217f..9694f2654593 100644 --- a/arch/arm64/include/asm/kvm_arm.h +++ b/arch/arm64/include/asm/kvm_arm.h | |||
@@ -95,6 +95,7 @@ | |||
95 | SCTLR_EL2_SA | SCTLR_EL2_I) | 95 | SCTLR_EL2_SA | SCTLR_EL2_I) |
96 | 96 | ||
97 | /* TCR_EL2 Registers bits */ | 97 | /* TCR_EL2 Registers bits */ |
98 | #define TCR_EL2_RES1 ((1 << 31) | (1 << 23)) | ||
98 | #define TCR_EL2_TBI (1 << 20) | 99 | #define TCR_EL2_TBI (1 << 20) |
99 | #define TCR_EL2_PS (7 << 16) | 100 | #define TCR_EL2_PS (7 << 16) |
100 | #define TCR_EL2_PS_40B (2 << 16) | 101 | #define TCR_EL2_PS_40B (2 << 16) |
@@ -106,9 +107,10 @@ | |||
106 | #define TCR_EL2_MASK (TCR_EL2_TG0 | TCR_EL2_SH0 | \ | 107 | #define TCR_EL2_MASK (TCR_EL2_TG0 | TCR_EL2_SH0 | \ |
107 | TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ) | 108 | TCR_EL2_ORGN0 | TCR_EL2_IRGN0 | TCR_EL2_T0SZ) |
108 | 109 | ||
109 | #define TCR_EL2_FLAGS (TCR_EL2_PS_40B) | 110 | #define TCR_EL2_FLAGS (TCR_EL2_RES1 | TCR_EL2_PS_40B) |
110 | 111 | ||
111 | /* VTCR_EL2 Registers bits */ | 112 | /* VTCR_EL2 Registers bits */ |
113 | #define VTCR_EL2_RES1 (1 << 31) | ||
112 | #define VTCR_EL2_PS_MASK (7 << 16) | 114 | #define VTCR_EL2_PS_MASK (7 << 16) |
113 | #define VTCR_EL2_TG0_MASK (1 << 14) | 115 | #define VTCR_EL2_TG0_MASK (1 << 14) |
114 | #define VTCR_EL2_TG0_4K (0 << 14) | 116 | #define VTCR_EL2_TG0_4K (0 << 14) |
@@ -147,7 +149,8 @@ | |||
147 | */ | 149 | */ |
148 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ | 150 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_64K | VTCR_EL2_SH0_INNER | \ |
149 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ | 151 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ |
150 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) | 152 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ |
153 | VTCR_EL2_RES1) | ||
151 | #define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) | 154 | #define VTTBR_X (38 - VTCR_EL2_T0SZ_40B) |
152 | #else | 155 | #else |
153 | /* | 156 | /* |
@@ -158,7 +161,8 @@ | |||
158 | */ | 161 | */ |
159 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ | 162 | #define VTCR_EL2_FLAGS (VTCR_EL2_TG0_4K | VTCR_EL2_SH0_INNER | \ |
160 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ | 163 | VTCR_EL2_ORGN0_WBWA | VTCR_EL2_IRGN0_WBWA | \ |
161 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B) | 164 | VTCR_EL2_SL0_LVL1 | VTCR_EL2_T0SZ_40B | \ |
165 | VTCR_EL2_RES1) | ||
162 | #define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) | 166 | #define VTTBR_X (37 - VTCR_EL2_T0SZ_40B) |
163 | #endif | 167 | #endif |
164 | 168 | ||
@@ -168,7 +172,6 @@ | |||
168 | #define VTTBR_VMID_MASK (UL(0xFF) << VTTBR_VMID_SHIFT) | 172 | #define VTTBR_VMID_MASK (UL(0xFF) << VTTBR_VMID_SHIFT) |
169 | 173 | ||
170 | /* Hyp System Trap Register */ | 174 | /* Hyp System Trap Register */ |
171 | #define HSTR_EL2_TTEE (1 << 16) | ||
172 | #define HSTR_EL2_T(x) (1 << x) | 175 | #define HSTR_EL2_T(x) (1 << x) |
173 | 176 | ||
174 | /* Hyp Coproccessor Trap Register Shifts */ | 177 | /* Hyp Coproccessor Trap Register Shifts */ |
diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h index 67fa0de3d483..5e377101f919 100644 --- a/arch/arm64/include/asm/kvm_asm.h +++ b/arch/arm64/include/asm/kvm_asm.h | |||
@@ -53,9 +53,7 @@ | |||
53 | #define IFSR32_EL2 25 /* Instruction Fault Status Register */ | 53 | #define IFSR32_EL2 25 /* Instruction Fault Status Register */ |
54 | #define FPEXC32_EL2 26 /* Floating-Point Exception Control Register */ | 54 | #define FPEXC32_EL2 26 /* Floating-Point Exception Control Register */ |
55 | #define DBGVCR32_EL2 27 /* Debug Vector Catch Register */ | 55 | #define DBGVCR32_EL2 27 /* Debug Vector Catch Register */ |
56 | #define TEECR32_EL1 28 /* ThumbEE Configuration Register */ | 56 | #define NR_SYS_REGS 28 |
57 | #define TEEHBR32_EL1 29 /* ThumbEE Handler Base Register */ | ||
58 | #define NR_SYS_REGS 30 | ||
59 | 57 | ||
60 | /* 32bit mapping */ | 58 | /* 32bit mapping */ |
61 | #define c0_MPIDR (MPIDR_EL1 * 2) /* MultiProcessor ID Register */ | 59 | #define c0_MPIDR (MPIDR_EL1 * 2) /* MultiProcessor ID Register */ |
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 415938dc45cf..4562459456a6 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h | |||
@@ -30,12 +30,6 @@ | |||
30 | 30 | ||
31 | #define __KVM_HAVE_ARCH_INTC_INITIALIZED | 31 | #define __KVM_HAVE_ARCH_INTC_INITIALIZED |
32 | 32 | ||
33 | #if defined(CONFIG_KVM_ARM_MAX_VCPUS) | ||
34 | #define KVM_MAX_VCPUS CONFIG_KVM_ARM_MAX_VCPUS | ||
35 | #else | ||
36 | #define KVM_MAX_VCPUS 0 | ||
37 | #endif | ||
38 | |||
39 | #define KVM_USER_MEM_SLOTS 32 | 33 | #define KVM_USER_MEM_SLOTS 32 |
40 | #define KVM_PRIVATE_MEM_SLOTS 4 | 34 | #define KVM_PRIVATE_MEM_SLOTS 4 |
41 | #define KVM_COALESCED_MMIO_PAGE_OFFSET 1 | 35 | #define KVM_COALESCED_MMIO_PAGE_OFFSET 1 |
@@ -43,6 +37,8 @@ | |||
43 | #include <kvm/arm_vgic.h> | 37 | #include <kvm/arm_vgic.h> |
44 | #include <kvm/arm_arch_timer.h> | 38 | #include <kvm/arm_arch_timer.h> |
45 | 39 | ||
40 | #define KVM_MAX_VCPUS VGIC_V3_MAX_CPUS | ||
41 | |||
46 | #define KVM_VCPU_MAX_FEATURES 3 | 42 | #define KVM_VCPU_MAX_FEATURES 3 |
47 | 43 | ||
48 | int __attribute_const__ kvm_target_cpu(void); | 44 | int __attribute_const__ kvm_target_cpu(void); |
@@ -195,6 +191,7 @@ struct kvm_vm_stat { | |||
195 | 191 | ||
196 | struct kvm_vcpu_stat { | 192 | struct kvm_vcpu_stat { |
197 | u32 halt_successful_poll; | 193 | u32 halt_successful_poll; |
194 | u32 halt_attempted_poll; | ||
198 | u32 halt_wakeup; | 195 | u32 halt_wakeup; |
199 | }; | 196 | }; |
200 | 197 | ||
diff --git a/arch/arm64/include/asm/pgtable.h b/arch/arm64/include/asm/pgtable.h index 6900b2d95371..b0329be95cb1 100644 --- a/arch/arm64/include/asm/pgtable.h +++ b/arch/arm64/include/asm/pgtable.h | |||
@@ -26,13 +26,9 @@ | |||
26 | * Software defined PTE bits definition. | 26 | * Software defined PTE bits definition. |
27 | */ | 27 | */ |
28 | #define PTE_VALID (_AT(pteval_t, 1) << 0) | 28 | #define PTE_VALID (_AT(pteval_t, 1) << 0) |
29 | #define PTE_WRITE (PTE_DBM) /* same as DBM (51) */ | ||
29 | #define PTE_DIRTY (_AT(pteval_t, 1) << 55) | 30 | #define PTE_DIRTY (_AT(pteval_t, 1) << 55) |
30 | #define PTE_SPECIAL (_AT(pteval_t, 1) << 56) | 31 | #define PTE_SPECIAL (_AT(pteval_t, 1) << 56) |
31 | #ifdef CONFIG_ARM64_HW_AFDBM | ||
32 | #define PTE_WRITE (PTE_DBM) /* same as DBM */ | ||
33 | #else | ||
34 | #define PTE_WRITE (_AT(pteval_t, 1) << 57) | ||
35 | #endif | ||
36 | #define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */ | 32 | #define PTE_PROT_NONE (_AT(pteval_t, 1) << 58) /* only when !PTE_VALID */ |
37 | 33 | ||
38 | /* | 34 | /* |
@@ -146,7 +142,7 @@ extern struct page *empty_zero_page; | |||
146 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) | 142 | #define pte_exec(pte) (!(pte_val(pte) & PTE_UXN)) |
147 | 143 | ||
148 | #ifdef CONFIG_ARM64_HW_AFDBM | 144 | #ifdef CONFIG_ARM64_HW_AFDBM |
149 | #define pte_hw_dirty(pte) (!(pte_val(pte) & PTE_RDONLY)) | 145 | #define pte_hw_dirty(pte) (pte_write(pte) && !(pte_val(pte) & PTE_RDONLY)) |
150 | #else | 146 | #else |
151 | #define pte_hw_dirty(pte) (0) | 147 | #define pte_hw_dirty(pte) (0) |
152 | #endif | 148 | #endif |
@@ -238,7 +234,7 @@ extern void __sync_icache_dcache(pte_t pteval, unsigned long addr); | |||
238 | * When hardware DBM is not present, the sofware PTE_DIRTY bit is updated via | 234 | * When hardware DBM is not present, the sofware PTE_DIRTY bit is updated via |
239 | * the page fault mechanism. Checking the dirty status of a pte becomes: | 235 | * the page fault mechanism. Checking the dirty status of a pte becomes: |
240 | * | 236 | * |
241 | * PTE_DIRTY || !PTE_RDONLY | 237 | * PTE_DIRTY || (PTE_WRITE && !PTE_RDONLY) |
242 | */ | 238 | */ |
243 | static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, | 239 | static inline void set_pte_at(struct mm_struct *mm, unsigned long addr, |
244 | pte_t *ptep, pte_t pte) | 240 | pte_t *ptep, pte_t pte) |
@@ -503,7 +499,7 @@ static inline pte_t pte_modify(pte_t pte, pgprot_t newprot) | |||
503 | PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK; | 499 | PTE_PROT_NONE | PTE_WRITE | PTE_TYPE_MASK; |
504 | /* preserve the hardware dirty information */ | 500 | /* preserve the hardware dirty information */ |
505 | if (pte_hw_dirty(pte)) | 501 | if (pte_hw_dirty(pte)) |
506 | newprot |= PTE_DIRTY; | 502 | pte = pte_mkdirty(pte); |
507 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); | 503 | pte_val(pte) = (pte_val(pte) & ~mask) | (pgprot_val(newprot) & mask); |
508 | return pte; | 504 | return pte; |
509 | } | 505 | } |
diff --git a/arch/arm64/kernel/debug-monitors.c b/arch/arm64/kernel/debug-monitors.c index 9b3b62ac9c24..cebf78661a55 100644 --- a/arch/arm64/kernel/debug-monitors.c +++ b/arch/arm64/kernel/debug-monitors.c | |||
@@ -134,7 +134,7 @@ static int os_lock_notify(struct notifier_block *self, | |||
134 | unsigned long action, void *data) | 134 | unsigned long action, void *data) |
135 | { | 135 | { |
136 | int cpu = (unsigned long)data; | 136 | int cpu = (unsigned long)data; |
137 | if (action == CPU_ONLINE) | 137 | if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) |
138 | smp_call_function_single(cpu, clear_os_lock, NULL, 1); | 138 | smp_call_function_single(cpu, clear_os_lock, NULL, 1); |
139 | return NOTIFY_OK; | 139 | return NOTIFY_OK; |
140 | } | 140 | } |
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index a055be6125cf..90d09eddd5b2 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S | |||
@@ -523,6 +523,11 @@ CPU_LE( movk x0, #0x30d0, lsl #16 ) // Clear EE and E0E on LE systems | |||
523 | msr hstr_el2, xzr // Disable CP15 traps to EL2 | 523 | msr hstr_el2, xzr // Disable CP15 traps to EL2 |
524 | #endif | 524 | #endif |
525 | 525 | ||
526 | /* EL2 debug */ | ||
527 | mrs x0, pmcr_el0 // Disable debug access traps | ||
528 | ubfx x0, x0, #11, #5 // to EL2 and allow access to | ||
529 | msr mdcr_el2, x0 // all PMU counters from EL1 | ||
530 | |||
526 | /* Stage-2 translation */ | 531 | /* Stage-2 translation */ |
527 | msr vttbr_el2, xzr | 532 | msr vttbr_el2, xzr |
528 | 533 | ||
diff --git a/arch/arm64/kernel/hw_breakpoint.c b/arch/arm64/kernel/hw_breakpoint.c index c97040ecf838..bba85c8f8037 100644 --- a/arch/arm64/kernel/hw_breakpoint.c +++ b/arch/arm64/kernel/hw_breakpoint.c | |||
@@ -872,7 +872,7 @@ static int hw_breakpoint_reset_notify(struct notifier_block *self, | |||
872 | void *hcpu) | 872 | void *hcpu) |
873 | { | 873 | { |
874 | int cpu = (long)hcpu; | 874 | int cpu = (long)hcpu; |
875 | if (action == CPU_ONLINE) | 875 | if ((action & ~CPU_TASKS_FROZEN) == CPU_ONLINE) |
876 | smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1); | 876 | smp_call_function_single(cpu, hw_breakpoint_reset, NULL, 1); |
877 | return NOTIFY_OK; | 877 | return NOTIFY_OK; |
878 | } | 878 | } |
diff --git a/arch/arm64/kernel/module.c b/arch/arm64/kernel/module.c index 67bf4107f6ef..876eb8df50bf 100644 --- a/arch/arm64/kernel/module.c +++ b/arch/arm64/kernel/module.c | |||
@@ -332,12 +332,14 @@ int apply_relocate_add(Elf64_Shdr *sechdrs, | |||
332 | ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21, | 332 | ovf = reloc_insn_imm(RELOC_OP_PREL, loc, val, 0, 21, |
333 | AARCH64_INSN_IMM_ADR); | 333 | AARCH64_INSN_IMM_ADR); |
334 | break; | 334 | break; |
335 | #ifndef CONFIG_ARM64_ERRATUM_843419 | ||
335 | case R_AARCH64_ADR_PREL_PG_HI21_NC: | 336 | case R_AARCH64_ADR_PREL_PG_HI21_NC: |
336 | overflow_check = false; | 337 | overflow_check = false; |
337 | case R_AARCH64_ADR_PREL_PG_HI21: | 338 | case R_AARCH64_ADR_PREL_PG_HI21: |
338 | ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21, | 339 | ovf = reloc_insn_imm(RELOC_OP_PAGE, loc, val, 12, 21, |
339 | AARCH64_INSN_IMM_ADR); | 340 | AARCH64_INSN_IMM_ADR); |
340 | break; | 341 | break; |
342 | #endif | ||
341 | case R_AARCH64_ADD_ABS_LO12_NC: | 343 | case R_AARCH64_ADD_ABS_LO12_NC: |
342 | case R_AARCH64_LDST8_ABS_LO12_NC: | 344 | case R_AARCH64_LDST8_ABS_LO12_NC: |
343 | overflow_check = false; | 345 | overflow_check = false; |
diff --git a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c index 948f0ad2de23..71ef6dc89ae5 100644 --- a/arch/arm64/kernel/signal32.c +++ b/arch/arm64/kernel/signal32.c | |||
@@ -212,14 +212,32 @@ int copy_siginfo_from_user32(siginfo_t *to, compat_siginfo_t __user *from) | |||
212 | 212 | ||
213 | /* | 213 | /* |
214 | * VFP save/restore code. | 214 | * VFP save/restore code. |
215 | * | ||
216 | * We have to be careful with endianness, since the fpsimd context-switch | ||
217 | * code operates on 128-bit (Q) register values whereas the compat ABI | ||
218 | * uses an array of 64-bit (D) registers. Consequently, we need to swap | ||
219 | * the two halves of each Q register when running on a big-endian CPU. | ||
215 | */ | 220 | */ |
221 | union __fpsimd_vreg { | ||
222 | __uint128_t raw; | ||
223 | struct { | ||
224 | #ifdef __AARCH64EB__ | ||
225 | u64 hi; | ||
226 | u64 lo; | ||
227 | #else | ||
228 | u64 lo; | ||
229 | u64 hi; | ||
230 | #endif | ||
231 | }; | ||
232 | }; | ||
233 | |||
216 | static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame) | 234 | static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame) |
217 | { | 235 | { |
218 | struct fpsimd_state *fpsimd = ¤t->thread.fpsimd_state; | 236 | struct fpsimd_state *fpsimd = ¤t->thread.fpsimd_state; |
219 | compat_ulong_t magic = VFP_MAGIC; | 237 | compat_ulong_t magic = VFP_MAGIC; |
220 | compat_ulong_t size = VFP_STORAGE_SIZE; | 238 | compat_ulong_t size = VFP_STORAGE_SIZE; |
221 | compat_ulong_t fpscr, fpexc; | 239 | compat_ulong_t fpscr, fpexc; |
222 | int err = 0; | 240 | int i, err = 0; |
223 | 241 | ||
224 | /* | 242 | /* |
225 | * Save the hardware registers to the fpsimd_state structure. | 243 | * Save the hardware registers to the fpsimd_state structure. |
@@ -235,10 +253,15 @@ static int compat_preserve_vfp_context(struct compat_vfp_sigframe __user *frame) | |||
235 | /* | 253 | /* |
236 | * Now copy the FP registers. Since the registers are packed, | 254 | * Now copy the FP registers. Since the registers are packed, |
237 | * we can copy the prefix we want (V0-V15) as it is. | 255 | * we can copy the prefix we want (V0-V15) as it is. |
238 | * FIXME: Won't work if big endian. | ||
239 | */ | 256 | */ |
240 | err |= __copy_to_user(&frame->ufp.fpregs, fpsimd->vregs, | 257 | for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) { |
241 | sizeof(frame->ufp.fpregs)); | 258 | union __fpsimd_vreg vreg = { |
259 | .raw = fpsimd->vregs[i >> 1], | ||
260 | }; | ||
261 | |||
262 | __put_user_error(vreg.lo, &frame->ufp.fpregs[i], err); | ||
263 | __put_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err); | ||
264 | } | ||
242 | 265 | ||
243 | /* Create an AArch32 fpscr from the fpsr and the fpcr. */ | 266 | /* Create an AArch32 fpscr from the fpsr and the fpcr. */ |
244 | fpscr = (fpsimd->fpsr & VFP_FPSCR_STAT_MASK) | | 267 | fpscr = (fpsimd->fpsr & VFP_FPSCR_STAT_MASK) | |
@@ -263,7 +286,7 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame) | |||
263 | compat_ulong_t magic = VFP_MAGIC; | 286 | compat_ulong_t magic = VFP_MAGIC; |
264 | compat_ulong_t size = VFP_STORAGE_SIZE; | 287 | compat_ulong_t size = VFP_STORAGE_SIZE; |
265 | compat_ulong_t fpscr; | 288 | compat_ulong_t fpscr; |
266 | int err = 0; | 289 | int i, err = 0; |
267 | 290 | ||
268 | __get_user_error(magic, &frame->magic, err); | 291 | __get_user_error(magic, &frame->magic, err); |
269 | __get_user_error(size, &frame->size, err); | 292 | __get_user_error(size, &frame->size, err); |
@@ -273,12 +296,14 @@ static int compat_restore_vfp_context(struct compat_vfp_sigframe __user *frame) | |||
273 | if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE) | 296 | if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE) |
274 | return -EINVAL; | 297 | return -EINVAL; |
275 | 298 | ||
276 | /* | 299 | /* Copy the FP registers into the start of the fpsimd_state. */ |
277 | * Copy the FP registers into the start of the fpsimd_state. | 300 | for (i = 0; i < ARRAY_SIZE(frame->ufp.fpregs); i += 2) { |
278 | * FIXME: Won't work if big endian. | 301 | union __fpsimd_vreg vreg; |
279 | */ | 302 | |
280 | err |= __copy_from_user(fpsimd.vregs, frame->ufp.fpregs, | 303 | __get_user_error(vreg.lo, &frame->ufp.fpregs[i], err); |
281 | sizeof(frame->ufp.fpregs)); | 304 | __get_user_error(vreg.hi, &frame->ufp.fpregs[i + 1], err); |
305 | fpsimd.vregs[i >> 1] = vreg.raw; | ||
306 | } | ||
282 | 307 | ||
283 | /* Extract the fpsr and the fpcr from the fpscr */ | 308 | /* Extract the fpsr and the fpcr from the fpscr */ |
284 | __get_user_error(fpscr, &frame->ufp.fpscr, err); | 309 | __get_user_error(fpscr, &frame->ufp.fpscr, err); |
diff --git a/arch/arm64/kvm/Kconfig b/arch/arm64/kvm/Kconfig index bfffe8f4bd53..5c7e920e4861 100644 --- a/arch/arm64/kvm/Kconfig +++ b/arch/arm64/kvm/Kconfig | |||
@@ -41,15 +41,4 @@ config KVM_ARM_HOST | |||
41 | ---help--- | 41 | ---help--- |
42 | Provides host support for ARM processors. | 42 | Provides host support for ARM processors. |
43 | 43 | ||
44 | config KVM_ARM_MAX_VCPUS | ||
45 | int "Number maximum supported virtual CPUs per VM" | ||
46 | depends on KVM_ARM_HOST | ||
47 | default 4 | ||
48 | help | ||
49 | Static number of max supported virtual CPUs per VM. | ||
50 | |||
51 | If you choose a high number, the vcpu structures will be quite | ||
52 | large, so only choose a reasonable number that you expect to | ||
53 | actually use. | ||
54 | |||
55 | endif # VIRTUALIZATION | 44 | endif # VIRTUALIZATION |
diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index 37c89ea2c572..e5836138ec42 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S | |||
@@ -433,20 +433,13 @@ | |||
433 | mrs x5, ifsr32_el2 | 433 | mrs x5, ifsr32_el2 |
434 | stp x4, x5, [x3] | 434 | stp x4, x5, [x3] |
435 | 435 | ||
436 | skip_fpsimd_state x8, 3f | 436 | skip_fpsimd_state x8, 2f |
437 | mrs x6, fpexc32_el2 | 437 | mrs x6, fpexc32_el2 |
438 | str x6, [x3, #16] | 438 | str x6, [x3, #16] |
439 | 3: | 439 | 2: |
440 | skip_debug_state x8, 2f | 440 | skip_debug_state x8, 1f |
441 | mrs x7, dbgvcr32_el2 | 441 | mrs x7, dbgvcr32_el2 |
442 | str x7, [x3, #24] | 442 | str x7, [x3, #24] |
443 | 2: | ||
444 | skip_tee_state x8, 1f | ||
445 | |||
446 | add x3, x2, #CPU_SYSREG_OFFSET(TEECR32_EL1) | ||
447 | mrs x4, teecr32_el1 | ||
448 | mrs x5, teehbr32_el1 | ||
449 | stp x4, x5, [x3] | ||
450 | 1: | 443 | 1: |
451 | .endm | 444 | .endm |
452 | 445 | ||
@@ -466,16 +459,9 @@ | |||
466 | msr dacr32_el2, x4 | 459 | msr dacr32_el2, x4 |
467 | msr ifsr32_el2, x5 | 460 | msr ifsr32_el2, x5 |
468 | 461 | ||
469 | skip_debug_state x8, 2f | 462 | skip_debug_state x8, 1f |
470 | ldr x7, [x3, #24] | 463 | ldr x7, [x3, #24] |
471 | msr dbgvcr32_el2, x7 | 464 | msr dbgvcr32_el2, x7 |
472 | 2: | ||
473 | skip_tee_state x8, 1f | ||
474 | |||
475 | add x3, x2, #CPU_SYSREG_OFFSET(TEECR32_EL1) | ||
476 | ldp x4, x5, [x3] | ||
477 | msr teecr32_el1, x4 | ||
478 | msr teehbr32_el1, x5 | ||
479 | 1: | 465 | 1: |
480 | .endm | 466 | .endm |
481 | 467 | ||
@@ -570,8 +556,6 @@ alternative_endif | |||
570 | mrs x3, cntv_ctl_el0 | 556 | mrs x3, cntv_ctl_el0 |
571 | and x3, x3, #3 | 557 | and x3, x3, #3 |
572 | str w3, [x0, #VCPU_TIMER_CNTV_CTL] | 558 | str w3, [x0, #VCPU_TIMER_CNTV_CTL] |
573 | bic x3, x3, #1 // Clear Enable | ||
574 | msr cntv_ctl_el0, x3 | ||
575 | 559 | ||
576 | isb | 560 | isb |
577 | 561 | ||
@@ -579,6 +563,9 @@ alternative_endif | |||
579 | str x3, [x0, #VCPU_TIMER_CNTV_CVAL] | 563 | str x3, [x0, #VCPU_TIMER_CNTV_CVAL] |
580 | 564 | ||
581 | 1: | 565 | 1: |
566 | // Disable the virtual timer | ||
567 | msr cntv_ctl_el0, xzr | ||
568 | |||
582 | // Allow physical timer/counter access for the host | 569 | // Allow physical timer/counter access for the host |
583 | mrs x2, cnthctl_el2 | 570 | mrs x2, cnthctl_el2 |
584 | orr x2, x2, #3 | 571 | orr x2, x2, #3 |
@@ -753,6 +740,9 @@ ENTRY(__kvm_vcpu_run) | |||
753 | // Guest context | 740 | // Guest context |
754 | add x2, x0, #VCPU_CONTEXT | 741 | add x2, x0, #VCPU_CONTEXT |
755 | 742 | ||
743 | // We must restore the 32-bit state before the sysregs, thanks | ||
744 | // to Cortex-A57 erratum #852523. | ||
745 | restore_guest_32bit_state | ||
756 | bl __restore_sysregs | 746 | bl __restore_sysregs |
757 | 747 | ||
758 | skip_debug_state x3, 1f | 748 | skip_debug_state x3, 1f |
@@ -760,7 +750,6 @@ ENTRY(__kvm_vcpu_run) | |||
760 | kern_hyp_va x3 | 750 | kern_hyp_va x3 |
761 | bl __restore_debug | 751 | bl __restore_debug |
762 | 1: | 752 | 1: |
763 | restore_guest_32bit_state | ||
764 | restore_guest_regs | 753 | restore_guest_regs |
765 | 754 | ||
766 | // That's it, no more messing around. | 755 | // That's it, no more messing around. |
diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c index b41607d270ac..d03d3af17e7e 100644 --- a/arch/arm64/kvm/sys_regs.c +++ b/arch/arm64/kvm/sys_regs.c | |||
@@ -272,7 +272,7 @@ static int set_bvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, | |||
272 | { | 272 | { |
273 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; | 273 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bvr[rd->reg]; |
274 | 274 | ||
275 | if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0) | 275 | if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0) |
276 | return -EFAULT; | 276 | return -EFAULT; |
277 | return 0; | 277 | return 0; |
278 | } | 278 | } |
@@ -314,7 +314,7 @@ static int set_bcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, | |||
314 | { | 314 | { |
315 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg]; | 315 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_bcr[rd->reg]; |
316 | 316 | ||
317 | if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0) | 317 | if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0) |
318 | return -EFAULT; | 318 | return -EFAULT; |
319 | 319 | ||
320 | return 0; | 320 | return 0; |
@@ -358,7 +358,7 @@ static int set_wvr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, | |||
358 | { | 358 | { |
359 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]; | 359 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wvr[rd->reg]; |
360 | 360 | ||
361 | if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0) | 361 | if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0) |
362 | return -EFAULT; | 362 | return -EFAULT; |
363 | return 0; | 363 | return 0; |
364 | } | 364 | } |
@@ -400,7 +400,7 @@ static int set_wcr(struct kvm_vcpu *vcpu, const struct sys_reg_desc *rd, | |||
400 | { | 400 | { |
401 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg]; | 401 | __u64 *r = &vcpu->arch.vcpu_debug_state.dbg_wcr[rd->reg]; |
402 | 402 | ||
403 | if (copy_from_user(uaddr, r, KVM_REG_SIZE(reg->id)) != 0) | 403 | if (copy_from_user(r, uaddr, KVM_REG_SIZE(reg->id)) != 0) |
404 | return -EFAULT; | 404 | return -EFAULT; |
405 | return 0; | 405 | return 0; |
406 | } | 406 | } |
@@ -539,13 +539,6 @@ static const struct sys_reg_desc sys_reg_descs[] = { | |||
539 | { Op0(0b10), Op1(0b000), CRn(0b0111), CRm(0b1110), Op2(0b110), | 539 | { Op0(0b10), Op1(0b000), CRn(0b0111), CRm(0b1110), Op2(0b110), |
540 | trap_dbgauthstatus_el1 }, | 540 | trap_dbgauthstatus_el1 }, |
541 | 541 | ||
542 | /* TEECR32_EL1 */ | ||
543 | { Op0(0b10), Op1(0b010), CRn(0b0000), CRm(0b0000), Op2(0b000), | ||
544 | NULL, reset_val, TEECR32_EL1, 0 }, | ||
545 | /* TEEHBR32_EL1 */ | ||
546 | { Op0(0b10), Op1(0b010), CRn(0b0001), CRm(0b0000), Op2(0b000), | ||
547 | NULL, reset_val, TEEHBR32_EL1, 0 }, | ||
548 | |||
549 | /* MDCCSR_EL1 */ | 542 | /* MDCCSR_EL1 */ |
550 | { Op0(0b10), Op1(0b011), CRn(0b0000), CRm(0b0001), Op2(0b000), | 543 | { Op0(0b10), Op1(0b011), CRn(0b0000), CRm(0b0001), Op2(0b000), |
551 | trap_raz_wi }, | 544 | trap_raz_wi }, |
diff --git a/arch/arm64/mm/dma-mapping.c b/arch/arm64/mm/dma-mapping.c index 0bcc4bc94b4a..99224dcebdc5 100644 --- a/arch/arm64/mm/dma-mapping.c +++ b/arch/arm64/mm/dma-mapping.c | |||
@@ -100,7 +100,7 @@ static void *__dma_alloc_coherent(struct device *dev, size_t size, | |||
100 | if (IS_ENABLED(CONFIG_ZONE_DMA) && | 100 | if (IS_ENABLED(CONFIG_ZONE_DMA) && |
101 | dev->coherent_dma_mask <= DMA_BIT_MASK(32)) | 101 | dev->coherent_dma_mask <= DMA_BIT_MASK(32)) |
102 | flags |= GFP_DMA; | 102 | flags |= GFP_DMA; |
103 | if (IS_ENABLED(CONFIG_DMA_CMA) && (flags & __GFP_WAIT)) { | 103 | if (dev_get_cma_area(dev) && (flags & __GFP_WAIT)) { |
104 | struct page *page; | 104 | struct page *page; |
105 | void *addr; | 105 | void *addr; |
106 | 106 | ||
diff --git a/arch/avr32/mach-at32ap/extint.c b/arch/avr32/mach-at32ap/extint.c index d51ff8f1c541..96cabad68489 100644 --- a/arch/avr32/mach-at32ap/extint.c +++ b/arch/avr32/mach-at32ap/extint.c | |||
@@ -144,7 +144,7 @@ static struct irq_chip eic_chip = { | |||
144 | .irq_set_type = eic_set_irq_type, | 144 | .irq_set_type = eic_set_irq_type, |
145 | }; | 145 | }; |
146 | 146 | ||
147 | static void demux_eic_irq(unsigned int irq, struct irq_desc *desc) | 147 | static void demux_eic_irq(struct irq_desc *desc) |
148 | { | 148 | { |
149 | struct eic *eic = irq_desc_get_handler_data(desc); | 149 | struct eic *eic = irq_desc_get_handler_data(desc); |
150 | unsigned long status, pending; | 150 | unsigned long status, pending; |
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c index 157a5e0e789f..4f61378c3453 100644 --- a/arch/avr32/mach-at32ap/pio.c +++ b/arch/avr32/mach-at32ap/pio.c | |||
@@ -281,7 +281,7 @@ static struct irq_chip gpio_irqchip = { | |||
281 | .irq_set_type = gpio_irq_type, | 281 | .irq_set_type = gpio_irq_type, |
282 | }; | 282 | }; |
283 | 283 | ||
284 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 284 | static void gpio_irq_handler(struct irq_desc *desc) |
285 | { | 285 | { |
286 | struct pio_device *pio = irq_desc_get_chip_data(desc); | 286 | struct pio_device *pio = irq_desc_get_chip_data(desc); |
287 | unsigned gpio_irq; | 287 | unsigned gpio_irq; |
diff --git a/arch/blackfin/include/asm/irq_handler.h b/arch/blackfin/include/asm/irq_handler.h index 4b2a992794d7..d2f90c72378e 100644 --- a/arch/blackfin/include/asm/irq_handler.h +++ b/arch/blackfin/include/asm/irq_handler.h | |||
@@ -60,7 +60,7 @@ extern void bfin_internal_mask_irq(unsigned int irq); | |||
60 | extern void bfin_internal_unmask_irq(unsigned int irq); | 60 | extern void bfin_internal_unmask_irq(unsigned int irq); |
61 | 61 | ||
62 | struct irq_desc; | 62 | struct irq_desc; |
63 | extern void bfin_demux_mac_status_irq(unsigned int, struct irq_desc *); | 63 | extern void bfin_demux_mac_status_irq(struct irq_desc *); |
64 | extern void bfin_demux_gpio_irq(unsigned int, struct irq_desc *); | 64 | extern void bfin_demux_gpio_irq(struct irq_desc *); |
65 | 65 | ||
66 | #endif | 66 | #endif |
diff --git a/arch/blackfin/kernel/irqchip.c b/arch/blackfin/kernel/irqchip.c index 0ba25764b8c0..052cde5ed2e4 100644 --- a/arch/blackfin/kernel/irqchip.c +++ b/arch/blackfin/kernel/irqchip.c | |||
@@ -107,7 +107,7 @@ asmlinkage void asm_do_IRQ(unsigned int irq, struct pt_regs *regs) | |||
107 | * than crashing, do something sensible. | 107 | * than crashing, do something sensible. |
108 | */ | 108 | */ |
109 | if (irq >= NR_IRQS) | 109 | if (irq >= NR_IRQS) |
110 | handle_bad_irq(irq, &bad_irq_desc); | 110 | handle_bad_irq(&bad_irq_desc); |
111 | else | 111 | else |
112 | generic_handle_irq(irq); | 112 | generic_handle_irq(irq); |
113 | 113 | ||
diff --git a/arch/blackfin/mach-bf537/ints-priority.c b/arch/blackfin/mach-bf537/ints-priority.c index 14b2f74554dc..a48baae4384d 100644 --- a/arch/blackfin/mach-bf537/ints-priority.c +++ b/arch/blackfin/mach-bf537/ints-priority.c | |||
@@ -89,8 +89,7 @@ static struct irq_chip bf537_generic_error_irqchip = { | |||
89 | .irq_unmask = bf537_generic_error_unmask_irq, | 89 | .irq_unmask = bf537_generic_error_unmask_irq, |
90 | }; | 90 | }; |
91 | 91 | ||
92 | static void bf537_demux_error_irq(unsigned int int_err_irq, | 92 | static void bf537_demux_error_irq(struct irq_desc *inta_desc) |
93 | struct irq_desc *inta_desc) | ||
94 | { | 93 | { |
95 | int irq = 0; | 94 | int irq = 0; |
96 | 95 | ||
@@ -182,15 +181,12 @@ static struct irq_chip bf537_mac_rx_irqchip = { | |||
182 | .irq_unmask = bf537_mac_rx_unmask_irq, | 181 | .irq_unmask = bf537_mac_rx_unmask_irq, |
183 | }; | 182 | }; |
184 | 183 | ||
185 | static void bf537_demux_mac_rx_irq(unsigned int __int_irq, | 184 | static void bf537_demux_mac_rx_irq(struct irq_desc *desc) |
186 | struct irq_desc *desc) | ||
187 | { | 185 | { |
188 | unsigned int int_irq = irq_desc_get_irq(desc); | ||
189 | |||
190 | if (bfin_read_DMA1_IRQ_STATUS() & (DMA_DONE | DMA_ERR)) | 186 | if (bfin_read_DMA1_IRQ_STATUS() & (DMA_DONE | DMA_ERR)) |
191 | bfin_handle_irq(IRQ_MAC_RX); | 187 | bfin_handle_irq(IRQ_MAC_RX); |
192 | else | 188 | else |
193 | bfin_demux_gpio_irq(int_irq, desc); | 189 | bfin_demux_gpio_irq(desc); |
194 | } | 190 | } |
195 | #endif | 191 | #endif |
196 | 192 | ||
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c index a6d1b03cdf36..e8d4d748d0fd 100644 --- a/arch/blackfin/mach-common/ints-priority.c +++ b/arch/blackfin/mach-common/ints-priority.c | |||
@@ -656,8 +656,7 @@ static struct irq_chip bfin_mac_status_irqchip = { | |||
656 | .irq_set_wake = bfin_mac_status_set_wake, | 656 | .irq_set_wake = bfin_mac_status_set_wake, |
657 | }; | 657 | }; |
658 | 658 | ||
659 | void bfin_demux_mac_status_irq(unsigned int int_err_irq, | 659 | void bfin_demux_mac_status_irq(struct irq_desc *inta_desc) |
660 | struct irq_desc *inta_desc) | ||
661 | { | 660 | { |
662 | int i, irq = 0; | 661 | int i, irq = 0; |
663 | u32 status = bfin_read_EMAC_SYSTAT(); | 662 | u32 status = bfin_read_EMAC_SYSTAT(); |
@@ -825,7 +824,7 @@ static void bfin_demux_gpio_block(unsigned int irq) | |||
825 | } | 824 | } |
826 | } | 825 | } |
827 | 826 | ||
828 | void bfin_demux_gpio_irq(unsigned int __inta_irq, struct irq_desc *desc) | 827 | void bfin_demux_gpio_irq(struct irq_desc *desc) |
829 | { | 828 | { |
830 | unsigned int inta_irq = irq_desc_get_irq(desc); | 829 | unsigned int inta_irq = irq_desc_get_irq(desc); |
831 | unsigned int irq; | 830 | unsigned int irq; |
diff --git a/arch/c6x/platforms/megamod-pic.c b/arch/c6x/platforms/megamod-pic.c index d487698e978a..ddcb45d7dfa7 100644 --- a/arch/c6x/platforms/megamod-pic.c +++ b/arch/c6x/platforms/megamod-pic.c | |||
@@ -93,7 +93,7 @@ static struct irq_chip megamod_chip = { | |||
93 | .irq_unmask = unmask_megamod, | 93 | .irq_unmask = unmask_megamod, |
94 | }; | 94 | }; |
95 | 95 | ||
96 | static void megamod_irq_cascade(unsigned int __irq, struct irq_desc *desc) | 96 | static void megamod_irq_cascade(struct irq_desc *desc) |
97 | { | 97 | { |
98 | struct megamod_cascade_data *cascade; | 98 | struct megamod_cascade_data *cascade; |
99 | struct megamod_pic *pic; | 99 | struct megamod_pic *pic; |
diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h index 95c39b95e97e..99c96a5e6016 100644 --- a/arch/ia64/include/asm/unistd.h +++ b/arch/ia64/include/asm/unistd.h | |||
@@ -11,7 +11,7 @@ | |||
11 | 11 | ||
12 | 12 | ||
13 | 13 | ||
14 | #define NR_syscalls 319 /* length of syscall table */ | 14 | #define NR_syscalls 321 /* length of syscall table */ |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * The following defines stop scripts/checksyscalls.sh from complaining about | 17 | * The following defines stop scripts/checksyscalls.sh from complaining about |
diff --git a/arch/ia64/include/uapi/asm/unistd.h b/arch/ia64/include/uapi/asm/unistd.h index 461079560c78..98e94e19a5a0 100644 --- a/arch/ia64/include/uapi/asm/unistd.h +++ b/arch/ia64/include/uapi/asm/unistd.h | |||
@@ -332,5 +332,7 @@ | |||
332 | #define __NR_memfd_create 1340 | 332 | #define __NR_memfd_create 1340 |
333 | #define __NR_bpf 1341 | 333 | #define __NR_bpf 1341 |
334 | #define __NR_execveat 1342 | 334 | #define __NR_execveat 1342 |
335 | #define __NR_userfaultfd 1343 | ||
336 | #define __NR_membarrier 1344 | ||
335 | 337 | ||
336 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ | 338 | #endif /* _UAPI_ASM_IA64_UNISTD_H */ |
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S index ae0de7bf5525..37cc7a65cd3e 100644 --- a/arch/ia64/kernel/entry.S +++ b/arch/ia64/kernel/entry.S | |||
@@ -1768,5 +1768,7 @@ sys_call_table: | |||
1768 | data8 sys_memfd_create // 1340 | 1768 | data8 sys_memfd_create // 1340 |
1769 | data8 sys_bpf | 1769 | data8 sys_bpf |
1770 | data8 sys_execveat | 1770 | data8 sys_execveat |
1771 | data8 sys_userfaultfd | ||
1772 | data8 sys_membarrier | ||
1771 | 1773 | ||
1772 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 1774 | .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls |
diff --git a/arch/m68k/amiga/amiints.c b/arch/m68k/amiga/amiints.c index 47b5f90002ab..7ff739e94896 100644 --- a/arch/m68k/amiga/amiints.c +++ b/arch/m68k/amiga/amiints.c | |||
@@ -46,7 +46,7 @@ static struct irq_chip amiga_irq_chip = { | |||
46 | * The builtin Amiga hardware interrupt handlers. | 46 | * The builtin Amiga hardware interrupt handlers. |
47 | */ | 47 | */ |
48 | 48 | ||
49 | static void ami_int1(unsigned int irq, struct irq_desc *desc) | 49 | static void ami_int1(struct irq_desc *desc) |
50 | { | 50 | { |
51 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; | 51 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; |
52 | 52 | ||
@@ -69,7 +69,7 @@ static void ami_int1(unsigned int irq, struct irq_desc *desc) | |||
69 | } | 69 | } |
70 | } | 70 | } |
71 | 71 | ||
72 | static void ami_int3(unsigned int irq, struct irq_desc *desc) | 72 | static void ami_int3(struct irq_desc *desc) |
73 | { | 73 | { |
74 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; | 74 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; |
75 | 75 | ||
@@ -92,7 +92,7 @@ static void ami_int3(unsigned int irq, struct irq_desc *desc) | |||
92 | } | 92 | } |
93 | } | 93 | } |
94 | 94 | ||
95 | static void ami_int4(unsigned int irq, struct irq_desc *desc) | 95 | static void ami_int4(struct irq_desc *desc) |
96 | { | 96 | { |
97 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; | 97 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; |
98 | 98 | ||
@@ -121,7 +121,7 @@ static void ami_int4(unsigned int irq, struct irq_desc *desc) | |||
121 | } | 121 | } |
122 | } | 122 | } |
123 | 123 | ||
124 | static void ami_int5(unsigned int irq, struct irq_desc *desc) | 124 | static void ami_int5(struct irq_desc *desc) |
125 | { | 125 | { |
126 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; | 126 | unsigned short ints = amiga_custom.intreqr & amiga_custom.intenar; |
127 | 127 | ||
diff --git a/arch/m68k/coldfire/intc-5272.c b/arch/m68k/coldfire/intc-5272.c index 47371de60427..b0a19e207a63 100644 --- a/arch/m68k/coldfire/intc-5272.c +++ b/arch/m68k/coldfire/intc-5272.c | |||
@@ -143,12 +143,10 @@ static int intc_irq_set_type(struct irq_data *d, unsigned int type) | |||
143 | * We need to be careful with the masking/acking due to the side effects | 143 | * We need to be careful with the masking/acking due to the side effects |
144 | * of masking an interrupt. | 144 | * of masking an interrupt. |
145 | */ | 145 | */ |
146 | static void intc_external_irq(unsigned int __irq, struct irq_desc *desc) | 146 | static void intc_external_irq(struct irq_desc *desc) |
147 | { | 147 | { |
148 | unsigned int irq = irq_desc_get_irq(desc); | ||
149 | |||
150 | irq_desc_get_chip(desc)->irq_ack(&desc->irq_data); | 148 | irq_desc_get_chip(desc)->irq_ack(&desc->irq_data); |
151 | handle_simple_irq(irq, desc); | 149 | handle_simple_irq(desc); |
152 | } | 150 | } |
153 | 151 | ||
154 | static struct irq_chip intc_irq_chip = { | 152 | static struct irq_chip intc_irq_chip = { |
diff --git a/arch/m68k/include/asm/irq.h b/arch/m68k/include/asm/irq.h index 81ca118d58af..a644f4a53b94 100644 --- a/arch/m68k/include/asm/irq.h +++ b/arch/m68k/include/asm/irq.h | |||
@@ -64,8 +64,7 @@ extern void m68k_setup_auto_interrupt(void (*handler)(unsigned int, | |||
64 | struct pt_regs *)); | 64 | struct pt_regs *)); |
65 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt); | 65 | extern void m68k_setup_user_interrupt(unsigned int vec, unsigned int cnt); |
66 | extern void m68k_setup_irq_controller(struct irq_chip *, | 66 | extern void m68k_setup_irq_controller(struct irq_chip *, |
67 | void (*handle)(unsigned int irq, | 67 | void (*handle)(struct irq_desc *desc), |
68 | struct irq_desc *desc), | ||
69 | unsigned int irq, unsigned int cnt); | 68 | unsigned int irq, unsigned int cnt); |
70 | 69 | ||
71 | extern unsigned int irq_canonicalize(unsigned int irq); | 70 | extern unsigned int irq_canonicalize(unsigned int irq); |
diff --git a/arch/m68k/include/asm/mac_via.h b/arch/m68k/include/asm/mac_via.h index fe3fc9ae1b69..53c632c85b03 100644 --- a/arch/m68k/include/asm/mac_via.h +++ b/arch/m68k/include/asm/mac_via.h | |||
@@ -261,7 +261,7 @@ extern void via_irq_enable(int); | |||
261 | extern void via_irq_disable(int); | 261 | extern void via_irq_disable(int); |
262 | extern void via_nubus_irq_startup(int irq); | 262 | extern void via_nubus_irq_startup(int irq); |
263 | extern void via_nubus_irq_shutdown(int irq); | 263 | extern void via_nubus_irq_shutdown(int irq); |
264 | extern void via1_irq(unsigned int irq, struct irq_desc *desc); | 264 | extern void via1_irq(struct irq_desc *desc); |
265 | extern void via1_set_head(int); | 265 | extern void via1_set_head(int); |
266 | extern int via2_scsi_drq_pending(void); | 266 | extern int via2_scsi_drq_pending(void); |
267 | 267 | ||
diff --git a/arch/m68k/mac/baboon.c b/arch/m68k/mac/baboon.c index 3fe0e43d44f6..f6f7d42713ec 100644 --- a/arch/m68k/mac/baboon.c +++ b/arch/m68k/mac/baboon.c | |||
@@ -45,7 +45,7 @@ void __init baboon_init(void) | |||
45 | * Baboon interrupt handler. This works a lot like a VIA. | 45 | * Baboon interrupt handler. This works a lot like a VIA. |
46 | */ | 46 | */ |
47 | 47 | ||
48 | static void baboon_irq(unsigned int irq, struct irq_desc *desc) | 48 | static void baboon_irq(struct irq_desc *desc) |
49 | { | 49 | { |
50 | int irq_bit, irq_num; | 50 | int irq_bit, irq_num; |
51 | unsigned char events; | 51 | unsigned char events; |
diff --git a/arch/m68k/mac/oss.c b/arch/m68k/mac/oss.c index 191610d97689..55d6592783f5 100644 --- a/arch/m68k/mac/oss.c +++ b/arch/m68k/mac/oss.c | |||
@@ -63,7 +63,7 @@ void __init oss_nubus_init(void) | |||
63 | * Handle miscellaneous OSS interrupts. | 63 | * Handle miscellaneous OSS interrupts. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | static void oss_irq(unsigned int __irq, struct irq_desc *desc) | 66 | static void oss_irq(struct irq_desc *desc) |
67 | { | 67 | { |
68 | int events = oss->irq_pending & | 68 | int events = oss->irq_pending & |
69 | (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM); | 69 | (OSS_IP_IOPSCC | OSS_IP_SCSI | OSS_IP_IOPISM); |
@@ -99,7 +99,7 @@ static void oss_irq(unsigned int __irq, struct irq_desc *desc) | |||
99 | * Unlike the VIA/RBV this is on its own autovector interrupt level. | 99 | * Unlike the VIA/RBV this is on its own autovector interrupt level. |
100 | */ | 100 | */ |
101 | 101 | ||
102 | static void oss_nubus_irq(unsigned int irq, struct irq_desc *desc) | 102 | static void oss_nubus_irq(struct irq_desc *desc) |
103 | { | 103 | { |
104 | int events, irq_bit, i; | 104 | int events, irq_bit, i; |
105 | 105 | ||
diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 3b9e302e7a37..cd38f29955c8 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c | |||
@@ -113,7 +113,7 @@ void __init psc_init(void) | |||
113 | * PSC interrupt handler. It's a lot like the VIA interrupt handler. | 113 | * PSC interrupt handler. It's a lot like the VIA interrupt handler. |
114 | */ | 114 | */ |
115 | 115 | ||
116 | static void psc_irq(unsigned int __irq, struct irq_desc *desc) | 116 | static void psc_irq(struct irq_desc *desc) |
117 | { | 117 | { |
118 | unsigned int offset = (unsigned int)irq_desc_get_handler_data(desc); | 118 | unsigned int offset = (unsigned int)irq_desc_get_handler_data(desc); |
119 | unsigned int irq = irq_desc_get_irq(desc); | 119 | unsigned int irq = irq_desc_get_irq(desc); |
diff --git a/arch/m68k/mac/via.c b/arch/m68k/mac/via.c index e198dec868e4..ce56e04386e7 100644 --- a/arch/m68k/mac/via.c +++ b/arch/m68k/mac/via.c | |||
@@ -446,7 +446,7 @@ void via_nubus_irq_shutdown(int irq) | |||
446 | * via6522.c :-), disable/pending masks added. | 446 | * via6522.c :-), disable/pending masks added. |
447 | */ | 447 | */ |
448 | 448 | ||
449 | void via1_irq(unsigned int irq, struct irq_desc *desc) | 449 | void via1_irq(struct irq_desc *desc) |
450 | { | 450 | { |
451 | int irq_num; | 451 | int irq_num; |
452 | unsigned char irq_bit, events; | 452 | unsigned char irq_bit, events; |
@@ -467,7 +467,7 @@ void via1_irq(unsigned int irq, struct irq_desc *desc) | |||
467 | } while (events >= irq_bit); | 467 | } while (events >= irq_bit); |
468 | } | 468 | } |
469 | 469 | ||
470 | static void via2_irq(unsigned int irq, struct irq_desc *desc) | 470 | static void via2_irq(struct irq_desc *desc) |
471 | { | 471 | { |
472 | int irq_num; | 472 | int irq_num; |
473 | unsigned char irq_bit, events; | 473 | unsigned char irq_bit, events; |
@@ -493,7 +493,7 @@ static void via2_irq(unsigned int irq, struct irq_desc *desc) | |||
493 | * VIA2 dispatcher as a fast interrupt handler. | 493 | * VIA2 dispatcher as a fast interrupt handler. |
494 | */ | 494 | */ |
495 | 495 | ||
496 | void via_nubus_irq(unsigned int irq, struct irq_desc *desc) | 496 | static void via_nubus_irq(struct irq_desc *desc) |
497 | { | 497 | { |
498 | int slot_irq; | 498 | int slot_irq; |
499 | unsigned char slot_bit, events; | 499 | unsigned char slot_bit, events; |
diff --git a/arch/metag/kernel/irq.c b/arch/metag/kernel/irq.c index a336094a7a6c..3074b64793e6 100644 --- a/arch/metag/kernel/irq.c +++ b/arch/metag/kernel/irq.c | |||
@@ -94,13 +94,11 @@ void do_IRQ(int irq, struct pt_regs *regs) | |||
94 | "MOV D0.5,%0\n" | 94 | "MOV D0.5,%0\n" |
95 | "MOV D1Ar1,%1\n" | 95 | "MOV D1Ar1,%1\n" |
96 | "MOV D1RtP,%2\n" | 96 | "MOV D1RtP,%2\n" |
97 | "MOV D0Ar2,%3\n" | ||
98 | "SWAP A0StP,D0.5\n" | 97 | "SWAP A0StP,D0.5\n" |
99 | "SWAP PC,D1RtP\n" | 98 | "SWAP PC,D1RtP\n" |
100 | "MOV A0StP,D0.5\n" | 99 | "MOV A0StP,D0.5\n" |
101 | : | 100 | : |
102 | : "r" (isp), "r" (irq), "r" (desc->handle_irq), | 101 | : "r" (isp), "r" (desc), "r" (desc->handle_irq) |
103 | "r" (desc) | ||
104 | : "memory", "cc", "D1Ar1", "D0Ar2", "D1Ar3", "D0Ar4", | 102 | : "memory", "cc", "D1Ar1", "D0Ar2", "D1Ar3", "D0Ar4", |
105 | "D1Ar5", "D0Ar6", "D0Re0", "D1Re0", "D0.4", "D1RtP", | 103 | "D1Ar5", "D0Ar6", "D0Re0", "D1Re0", "D0.4", "D1RtP", |
106 | "D0.5" | 104 | "D0.5" |
diff --git a/arch/mips/alchemy/common/irq.c b/arch/mips/alchemy/common/irq.c index 4c496c50edf6..da9f9220048f 100644 --- a/arch/mips/alchemy/common/irq.c +++ b/arch/mips/alchemy/common/irq.c | |||
@@ -851,7 +851,7 @@ static struct syscore_ops alchemy_gpic_pmops = { | |||
851 | 851 | ||
852 | /* create chained handlers for the 4 IC requests to the MIPS IRQ ctrl */ | 852 | /* create chained handlers for the 4 IC requests to the MIPS IRQ ctrl */ |
853 | #define DISP(name, base, addr) \ | 853 | #define DISP(name, base, addr) \ |
854 | static void au1000_##name##_dispatch(unsigned int irq, struct irq_desc *d) \ | 854 | static void au1000_##name##_dispatch(struct irq_desc *d) \ |
855 | { \ | 855 | { \ |
856 | unsigned long r = __raw_readl((void __iomem *)KSEG1ADDR(addr)); \ | 856 | unsigned long r = __raw_readl((void __iomem *)KSEG1ADDR(addr)); \ |
857 | if (likely(r)) \ | 857 | if (likely(r)) \ |
@@ -865,7 +865,7 @@ DISP(ic0r1, AU1000_INTC0_INT_BASE, AU1000_IC0_PHYS_ADDR + IC_REQ1INT) | |||
865 | DISP(ic1r0, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ0INT) | 865 | DISP(ic1r0, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ0INT) |
866 | DISP(ic1r1, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ1INT) | 866 | DISP(ic1r1, AU1000_INTC1_INT_BASE, AU1000_IC1_PHYS_ADDR + IC_REQ1INT) |
867 | 867 | ||
868 | static void alchemy_gpic_dispatch(unsigned int irq, struct irq_desc *d) | 868 | static void alchemy_gpic_dispatch(struct irq_desc *d) |
869 | { | 869 | { |
870 | int i = __raw_readl(AU1300_GPIC_ADDR + AU1300_GPIC_PRIENC); | 870 | int i = __raw_readl(AU1300_GPIC_ADDR + AU1300_GPIC_PRIENC); |
871 | generic_handle_irq(ALCHEMY_GPIC_INT_BASE + i); | 871 | generic_handle_irq(ALCHEMY_GPIC_INT_BASE + i); |
diff --git a/arch/mips/alchemy/devboards/bcsr.c b/arch/mips/alchemy/devboards/bcsr.c index 324ad72d7c36..faeddf119fd4 100644 --- a/arch/mips/alchemy/devboards/bcsr.c +++ b/arch/mips/alchemy/devboards/bcsr.c | |||
@@ -86,7 +86,7 @@ EXPORT_SYMBOL_GPL(bcsr_mod); | |||
86 | /* | 86 | /* |
87 | * DB1200/PB1200 CPLD IRQ muxer | 87 | * DB1200/PB1200 CPLD IRQ muxer |
88 | */ | 88 | */ |
89 | static void bcsr_csc_handler(unsigned int irq, struct irq_desc *d) | 89 | static void bcsr_csc_handler(struct irq_desc *d) |
90 | { | 90 | { |
91 | unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT); | 91 | unsigned short bisr = __raw_readw(bcsr_virt + BCSR_REG_INTSTAT); |
92 | struct irq_chip *chip = irq_desc_get_chip(d); | 92 | struct irq_chip *chip = irq_desc_get_chip(d); |
diff --git a/arch/mips/ath25/ar2315.c b/arch/mips/ath25/ar2315.c index ec9a371f1e62..8da996142d6a 100644 --- a/arch/mips/ath25/ar2315.c +++ b/arch/mips/ath25/ar2315.c | |||
@@ -69,7 +69,7 @@ static struct irqaction ar2315_ahb_err_interrupt = { | |||
69 | .name = "ar2315-ahb-error", | 69 | .name = "ar2315-ahb-error", |
70 | }; | 70 | }; |
71 | 71 | ||
72 | static void ar2315_misc_irq_handler(unsigned irq, struct irq_desc *desc) | 72 | static void ar2315_misc_irq_handler(struct irq_desc *desc) |
73 | { | 73 | { |
74 | u32 pending = ar2315_rst_reg_read(AR2315_ISR) & | 74 | u32 pending = ar2315_rst_reg_read(AR2315_ISR) & |
75 | ar2315_rst_reg_read(AR2315_IMR); | 75 | ar2315_rst_reg_read(AR2315_IMR); |
diff --git a/arch/mips/ath25/ar5312.c b/arch/mips/ath25/ar5312.c index e63e38fa4880..acd55a9cffe3 100644 --- a/arch/mips/ath25/ar5312.c +++ b/arch/mips/ath25/ar5312.c | |||
@@ -73,7 +73,7 @@ static struct irqaction ar5312_ahb_err_interrupt = { | |||
73 | .name = "ar5312-ahb-error", | 73 | .name = "ar5312-ahb-error", |
74 | }; | 74 | }; |
75 | 75 | ||
76 | static void ar5312_misc_irq_handler(unsigned irq, struct irq_desc *desc) | 76 | static void ar5312_misc_irq_handler(struct irq_desc *desc) |
77 | { | 77 | { |
78 | u32 pending = ar5312_rst_reg_read(AR5312_ISR) & | 78 | u32 pending = ar5312_rst_reg_read(AR5312_ISR) & |
79 | ar5312_rst_reg_read(AR5312_IMR); | 79 | ar5312_rst_reg_read(AR5312_IMR); |
diff --git a/arch/mips/ath79/irq.c b/arch/mips/ath79/irq.c index 807132b838b2..15ecb4831e12 100644 --- a/arch/mips/ath79/irq.c +++ b/arch/mips/ath79/irq.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #include "common.h" | 26 | #include "common.h" |
27 | #include "machtypes.h" | 27 | #include "machtypes.h" |
28 | 28 | ||
29 | static void ath79_misc_irq_handler(unsigned int irq, struct irq_desc *desc) | 29 | static void ath79_misc_irq_handler(struct irq_desc *desc) |
30 | { | 30 | { |
31 | void __iomem *base = ath79_reset_base; | 31 | void __iomem *base = ath79_reset_base; |
32 | u32 pending; | 32 | u32 pending; |
@@ -119,7 +119,7 @@ static void __init ath79_misc_irq_init(void) | |||
119 | irq_set_chained_handler(ATH79_CPU_IRQ(6), ath79_misc_irq_handler); | 119 | irq_set_chained_handler(ATH79_CPU_IRQ(6), ath79_misc_irq_handler); |
120 | } | 120 | } |
121 | 121 | ||
122 | static void ar934x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) | 122 | static void ar934x_ip2_irq_dispatch(struct irq_desc *desc) |
123 | { | 123 | { |
124 | u32 status; | 124 | u32 status; |
125 | 125 | ||
@@ -148,7 +148,7 @@ static void ar934x_ip2_irq_init(void) | |||
148 | irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); | 148 | irq_set_chained_handler(ATH79_CPU_IRQ(2), ar934x_ip2_irq_dispatch); |
149 | } | 149 | } |
150 | 150 | ||
151 | static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) | 151 | static void qca955x_ip2_irq_dispatch(struct irq_desc *desc) |
152 | { | 152 | { |
153 | u32 status; | 153 | u32 status; |
154 | 154 | ||
@@ -171,7 +171,7 @@ static void qca955x_ip2_irq_dispatch(unsigned int irq, struct irq_desc *desc) | |||
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | static void qca955x_ip3_irq_dispatch(unsigned int irq, struct irq_desc *desc) | 174 | static void qca955x_ip3_irq_dispatch(struct irq_desc *desc) |
175 | { | 175 | { |
176 | u32 status; | 176 | u32 status; |
177 | 177 | ||
diff --git a/arch/mips/cavium-octeon/octeon-irq.c b/arch/mips/cavium-octeon/octeon-irq.c index f26c3c661cca..0352bc8d56b3 100644 --- a/arch/mips/cavium-octeon/octeon-irq.c +++ b/arch/mips/cavium-octeon/octeon-irq.c | |||
@@ -2221,7 +2221,7 @@ static irqreturn_t octeon_irq_cib_handler(int my_irq, void *data) | |||
2221 | if (irqd_get_trigger_type(irq_data) & | 2221 | if (irqd_get_trigger_type(irq_data) & |
2222 | IRQ_TYPE_EDGE_BOTH) | 2222 | IRQ_TYPE_EDGE_BOTH) |
2223 | cvmx_write_csr(host_data->raw_reg, 1ull << i); | 2223 | cvmx_write_csr(host_data->raw_reg, 1ull << i); |
2224 | generic_handle_irq_desc(irq, desc); | 2224 | generic_handle_irq_desc(desc); |
2225 | } | 2225 | } |
2226 | } | 2226 | } |
2227 | 2227 | ||
diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h index e8c8d9d0c45f..3a54dbca9f7e 100644 --- a/arch/mips/include/asm/kvm_host.h +++ b/arch/mips/include/asm/kvm_host.h | |||
@@ -128,6 +128,7 @@ struct kvm_vcpu_stat { | |||
128 | u32 msa_disabled_exits; | 128 | u32 msa_disabled_exits; |
129 | u32 flush_dcache_exits; | 129 | u32 flush_dcache_exits; |
130 | u32 halt_successful_poll; | 130 | u32 halt_successful_poll; |
131 | u32 halt_attempted_poll; | ||
131 | u32 halt_wakeup; | 132 | u32 halt_wakeup; |
132 | }; | 133 | }; |
133 | 134 | ||
diff --git a/arch/mips/include/asm/netlogic/common.h b/arch/mips/include/asm/netlogic/common.h index 2a4c128277e4..be52c2125d71 100644 --- a/arch/mips/include/asm/netlogic/common.h +++ b/arch/mips/include/asm/netlogic/common.h | |||
@@ -57,8 +57,8 @@ | |||
57 | #include <asm/mach-netlogic/multi-node.h> | 57 | #include <asm/mach-netlogic/multi-node.h> |
58 | 58 | ||
59 | struct irq_desc; | 59 | struct irq_desc; |
60 | void nlm_smp_function_ipi_handler(unsigned int irq, struct irq_desc *desc); | 60 | void nlm_smp_function_ipi_handler(struct irq_desc *desc); |
61 | void nlm_smp_resched_ipi_handler(unsigned int irq, struct irq_desc *desc); | 61 | void nlm_smp_resched_ipi_handler(struct irq_desc *desc); |
62 | void nlm_smp_irq_init(int hwcpuid); | 62 | void nlm_smp_irq_init(int hwcpuid); |
63 | void nlm_boot_secondary_cpus(void); | 63 | void nlm_boot_secondary_cpus(void); |
64 | int nlm_wakeup_secondary_cpus(void); | 64 | int nlm_wakeup_secondary_cpus(void); |
diff --git a/arch/mips/jz4740/gpio.c b/arch/mips/jz4740/gpio.c index 6cd69fdaa1c5..a74e181058b0 100644 --- a/arch/mips/jz4740/gpio.c +++ b/arch/mips/jz4740/gpio.c | |||
@@ -291,7 +291,7 @@ static void jz_gpio_check_trigger_both(struct jz_gpio_chip *chip, unsigned int i | |||
291 | writel(mask, reg); | 291 | writel(mask, reg); |
292 | } | 292 | } |
293 | 293 | ||
294 | static void jz_gpio_irq_demux_handler(unsigned int irq, struct irq_desc *desc) | 294 | static void jz_gpio_irq_demux_handler(struct irq_desc *desc) |
295 | { | 295 | { |
296 | uint32_t flag; | 296 | uint32_t flag; |
297 | unsigned int gpio_irq; | 297 | unsigned int gpio_irq; |
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c index cd4c129ce743..49ff3bfc007e 100644 --- a/arch/mips/kvm/mips.c +++ b/arch/mips/kvm/mips.c | |||
@@ -55,6 +55,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
55 | { "msa_disabled", VCPU_STAT(msa_disabled_exits), KVM_STAT_VCPU }, | 55 | { "msa_disabled", VCPU_STAT(msa_disabled_exits), KVM_STAT_VCPU }, |
56 | { "flush_dcache", VCPU_STAT(flush_dcache_exits), KVM_STAT_VCPU }, | 56 | { "flush_dcache", VCPU_STAT(flush_dcache_exits), KVM_STAT_VCPU }, |
57 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll), KVM_STAT_VCPU }, | 57 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll), KVM_STAT_VCPU }, |
58 | { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll), KVM_STAT_VCPU }, | ||
58 | { "halt_wakeup", VCPU_STAT(halt_wakeup), KVM_STAT_VCPU }, | 59 | { "halt_wakeup", VCPU_STAT(halt_wakeup), KVM_STAT_VCPU }, |
59 | {NULL} | 60 | {NULL} |
60 | }; | 61 | }; |
diff --git a/arch/mips/netlogic/common/smp.c b/arch/mips/netlogic/common/smp.c index 0136b4f9c9cd..10d86d54880a 100644 --- a/arch/mips/netlogic/common/smp.c +++ b/arch/mips/netlogic/common/smp.c | |||
@@ -82,7 +82,7 @@ void nlm_send_ipi_mask(const struct cpumask *mask, unsigned int action) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /* IRQ_IPI_SMP_FUNCTION Handler */ | 84 | /* IRQ_IPI_SMP_FUNCTION Handler */ |
85 | void nlm_smp_function_ipi_handler(unsigned int __irq, struct irq_desc *desc) | 85 | void nlm_smp_function_ipi_handler(struct irq_desc *desc) |
86 | { | 86 | { |
87 | unsigned int irq = irq_desc_get_irq(desc); | 87 | unsigned int irq = irq_desc_get_irq(desc); |
88 | clear_c0_eimr(irq); | 88 | clear_c0_eimr(irq); |
@@ -92,7 +92,7 @@ void nlm_smp_function_ipi_handler(unsigned int __irq, struct irq_desc *desc) | |||
92 | } | 92 | } |
93 | 93 | ||
94 | /* IRQ_IPI_SMP_RESCHEDULE handler */ | 94 | /* IRQ_IPI_SMP_RESCHEDULE handler */ |
95 | void nlm_smp_resched_ipi_handler(unsigned int __irq, struct irq_desc *desc) | 95 | void nlm_smp_resched_ipi_handler(struct irq_desc *desc) |
96 | { | 96 | { |
97 | unsigned int irq = irq_desc_get_irq(desc); | 97 | unsigned int irq = irq_desc_get_irq(desc); |
98 | clear_c0_eimr(irq); | 98 | clear_c0_eimr(irq); |
diff --git a/arch/mips/pci/pci-ar2315.c b/arch/mips/pci/pci-ar2315.c index f8d0acb4f973..b4fa6413c4e5 100644 --- a/arch/mips/pci/pci-ar2315.c +++ b/arch/mips/pci/pci-ar2315.c | |||
@@ -318,7 +318,7 @@ static int ar2315_pci_host_setup(struct ar2315_pci_ctrl *apc) | |||
318 | return 0; | 318 | return 0; |
319 | } | 319 | } |
320 | 320 | ||
321 | static void ar2315_pci_irq_handler(unsigned irq, struct irq_desc *desc) | 321 | static void ar2315_pci_irq_handler(struct irq_desc *desc) |
322 | { | 322 | { |
323 | struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc); | 323 | struct ar2315_pci_ctrl *apc = irq_desc_get_handler_data(desc); |
324 | u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) & | 324 | u32 pending = ar2315_pci_reg_read(apc, AR2315_PCI_ISR) & |
diff --git a/arch/mips/pci/pci-ar71xx.c b/arch/mips/pci/pci-ar71xx.c index ad35a5e6a56c..7db963deec73 100644 --- a/arch/mips/pci/pci-ar71xx.c +++ b/arch/mips/pci/pci-ar71xx.c | |||
@@ -226,7 +226,7 @@ static struct pci_ops ar71xx_pci_ops = { | |||
226 | .write = ar71xx_pci_write_config, | 226 | .write = ar71xx_pci_write_config, |
227 | }; | 227 | }; |
228 | 228 | ||
229 | static void ar71xx_pci_irq_handler(unsigned int irq, struct irq_desc *desc) | 229 | static void ar71xx_pci_irq_handler(struct irq_desc *desc) |
230 | { | 230 | { |
231 | struct ar71xx_pci_controller *apc; | 231 | struct ar71xx_pci_controller *apc; |
232 | void __iomem *base = ath79_reset_base; | 232 | void __iomem *base = ath79_reset_base; |
diff --git a/arch/mips/pci/pci-ar724x.c b/arch/mips/pci/pci-ar724x.c index 907d11dd921b..2013dad700df 100644 --- a/arch/mips/pci/pci-ar724x.c +++ b/arch/mips/pci/pci-ar724x.c | |||
@@ -225,7 +225,7 @@ static struct pci_ops ar724x_pci_ops = { | |||
225 | .write = ar724x_pci_write, | 225 | .write = ar724x_pci_write, |
226 | }; | 226 | }; |
227 | 227 | ||
228 | static void ar724x_pci_irq_handler(unsigned int irq, struct irq_desc *desc) | 228 | static void ar724x_pci_irq_handler(struct irq_desc *desc) |
229 | { | 229 | { |
230 | struct ar724x_pci_controller *apc; | 230 | struct ar724x_pci_controller *apc; |
231 | void __iomem *base; | 231 | void __iomem *base; |
diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c index 53c8efaf1572..ed6732f9aa87 100644 --- a/arch/mips/pci/pci-rt3883.c +++ b/arch/mips/pci/pci-rt3883.c | |||
@@ -129,7 +129,7 @@ static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc, | |||
129 | rt3883_pci_w32(rpc, val, RT3883_PCI_REG_CFGDATA); | 129 | rt3883_pci_w32(rpc, val, RT3883_PCI_REG_CFGDATA); |
130 | } | 130 | } |
131 | 131 | ||
132 | static void rt3883_pci_irq_handler(unsigned int __irq, struct irq_desc *desc) | 132 | static void rt3883_pci_irq_handler(struct irq_desc *desc) |
133 | { | 133 | { |
134 | struct rt3883_pci_controller *rpc; | 134 | struct rt3883_pci_controller *rpc; |
135 | u32 pending; | 135 | u32 pending; |
diff --git a/arch/mips/ralink/irq.c b/arch/mips/ralink/irq.c index 8c624a8b9ea2..4cf77f358395 100644 --- a/arch/mips/ralink/irq.c +++ b/arch/mips/ralink/irq.c | |||
@@ -96,7 +96,7 @@ unsigned int get_c0_compare_int(void) | |||
96 | return CP0_LEGACY_COMPARE_IRQ; | 96 | return CP0_LEGACY_COMPARE_IRQ; |
97 | } | 97 | } |
98 | 98 | ||
99 | static void ralink_intc_irq_handler(unsigned int irq, struct irq_desc *desc) | 99 | static void ralink_intc_irq_handler(struct irq_desc *desc) |
100 | { | 100 | { |
101 | u32 pending = rt_intc_r32(INTC_REG_STATUS0); | 101 | u32 pending = rt_intc_r32(INTC_REG_STATUS0); |
102 | 102 | ||
diff --git a/arch/powerpc/boot/Makefile b/arch/powerpc/boot/Makefile index 73eddda53b8e..4eec430d8fa8 100644 --- a/arch/powerpc/boot/Makefile +++ b/arch/powerpc/boot/Makefile | |||
@@ -28,6 +28,9 @@ BOOTCFLAGS += -m64 | |||
28 | endif | 28 | endif |
29 | ifdef CONFIG_CPU_BIG_ENDIAN | 29 | ifdef CONFIG_CPU_BIG_ENDIAN |
30 | BOOTCFLAGS += -mbig-endian | 30 | BOOTCFLAGS += -mbig-endian |
31 | else | ||
32 | BOOTCFLAGS += -mlittle-endian | ||
33 | BOOTCFLAGS += $(call cc-option,-mabi=elfv2) | ||
31 | endif | 34 | endif |
32 | 35 | ||
33 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc | 36 | BOOTAFLAGS := -D__ASSEMBLY__ $(BOOTCFLAGS) -traditional -nostdinc |
diff --git a/arch/powerpc/include/asm/kvm_host.h b/arch/powerpc/include/asm/kvm_host.h index 98eebbf66340..195886a583ba 100644 --- a/arch/powerpc/include/asm/kvm_host.h +++ b/arch/powerpc/include/asm/kvm_host.h | |||
@@ -108,6 +108,7 @@ struct kvm_vcpu_stat { | |||
108 | u32 dec_exits; | 108 | u32 dec_exits; |
109 | u32 ext_intr_exits; | 109 | u32 ext_intr_exits; |
110 | u32 halt_successful_poll; | 110 | u32 halt_successful_poll; |
111 | u32 halt_attempted_poll; | ||
111 | u32 halt_wakeup; | 112 | u32 halt_wakeup; |
112 | u32 dbell_exits; | 113 | u32 dbell_exits; |
113 | u32 gdbell_exits; | 114 | u32 gdbell_exits; |
diff --git a/arch/powerpc/include/asm/qe_ic.h b/arch/powerpc/include/asm/qe_ic.h index 25784cc959a0..1e155ca6d33c 100644 --- a/arch/powerpc/include/asm/qe_ic.h +++ b/arch/powerpc/include/asm/qe_ic.h | |||
@@ -59,14 +59,14 @@ enum qe_ic_grp_id { | |||
59 | 59 | ||
60 | #ifdef CONFIG_QUICC_ENGINE | 60 | #ifdef CONFIG_QUICC_ENGINE |
61 | void qe_ic_init(struct device_node *node, unsigned int flags, | 61 | void qe_ic_init(struct device_node *node, unsigned int flags, |
62 | void (*low_handler)(unsigned int irq, struct irq_desc *desc), | 62 | void (*low_handler)(struct irq_desc *desc), |
63 | void (*high_handler)(unsigned int irq, struct irq_desc *desc)); | 63 | void (*high_handler)(struct irq_desc *desc)); |
64 | unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic); | 64 | unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic); |
65 | unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic); | 65 | unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic); |
66 | #else | 66 | #else |
67 | static inline void qe_ic_init(struct device_node *node, unsigned int flags, | 67 | static inline void qe_ic_init(struct device_node *node, unsigned int flags, |
68 | void (*low_handler)(unsigned int irq, struct irq_desc *desc), | 68 | void (*low_handler)(struct irq_desc *desc), |
69 | void (*high_handler)(unsigned int irq, struct irq_desc *desc)) | 69 | void (*high_handler)(struct irq_desc *desc)) |
70 | {} | 70 | {} |
71 | static inline unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) | 71 | static inline unsigned int qe_ic_get_low_irq(struct qe_ic *qe_ic) |
72 | { return 0; } | 72 | { return 0; } |
@@ -78,8 +78,7 @@ void qe_ic_set_highest_priority(unsigned int virq, int high); | |||
78 | int qe_ic_set_priority(unsigned int virq, unsigned int priority); | 78 | int qe_ic_set_priority(unsigned int virq, unsigned int priority); |
79 | int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); | 79 | int qe_ic_set_high_priority(unsigned int virq, unsigned int priority, int high); |
80 | 80 | ||
81 | static inline void qe_ic_cascade_low_ipic(unsigned int irq, | 81 | static inline void qe_ic_cascade_low_ipic(struct irq_desc *desc) |
82 | struct irq_desc *desc) | ||
83 | { | 82 | { |
84 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); | 83 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); |
85 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); | 84 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); |
@@ -88,8 +87,7 @@ static inline void qe_ic_cascade_low_ipic(unsigned int irq, | |||
88 | generic_handle_irq(cascade_irq); | 87 | generic_handle_irq(cascade_irq); |
89 | } | 88 | } |
90 | 89 | ||
91 | static inline void qe_ic_cascade_high_ipic(unsigned int irq, | 90 | static inline void qe_ic_cascade_high_ipic(struct irq_desc *desc) |
92 | struct irq_desc *desc) | ||
93 | { | 91 | { |
94 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); | 92 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); |
95 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); | 93 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); |
@@ -98,8 +96,7 @@ static inline void qe_ic_cascade_high_ipic(unsigned int irq, | |||
98 | generic_handle_irq(cascade_irq); | 96 | generic_handle_irq(cascade_irq); |
99 | } | 97 | } |
100 | 98 | ||
101 | static inline void qe_ic_cascade_low_mpic(unsigned int irq, | 99 | static inline void qe_ic_cascade_low_mpic(struct irq_desc *desc) |
102 | struct irq_desc *desc) | ||
103 | { | 100 | { |
104 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); | 101 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); |
105 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); | 102 | unsigned int cascade_irq = qe_ic_get_low_irq(qe_ic); |
@@ -111,8 +108,7 @@ static inline void qe_ic_cascade_low_mpic(unsigned int irq, | |||
111 | chip->irq_eoi(&desc->irq_data); | 108 | chip->irq_eoi(&desc->irq_data); |
112 | } | 109 | } |
113 | 110 | ||
114 | static inline void qe_ic_cascade_high_mpic(unsigned int irq, | 111 | static inline void qe_ic_cascade_high_mpic(struct irq_desc *desc) |
115 | struct irq_desc *desc) | ||
116 | { | 112 | { |
117 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); | 113 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); |
118 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); | 114 | unsigned int cascade_irq = qe_ic_get_high_irq(qe_ic); |
@@ -124,8 +120,7 @@ static inline void qe_ic_cascade_high_mpic(unsigned int irq, | |||
124 | chip->irq_eoi(&desc->irq_data); | 120 | chip->irq_eoi(&desc->irq_data); |
125 | } | 121 | } |
126 | 122 | ||
127 | static inline void qe_ic_cascade_muxed_mpic(unsigned int irq, | 123 | static inline void qe_ic_cascade_muxed_mpic(struct irq_desc *desc) |
128 | struct irq_desc *desc) | ||
129 | { | 124 | { |
130 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); | 125 | struct qe_ic *qe_ic = irq_desc_get_handler_data(desc); |
131 | unsigned int cascade_irq; | 126 | unsigned int cascade_irq; |
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index 71f2b3f02cf8..4d65499ee1c1 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -368,3 +368,4 @@ SYSCALL_SPU(memfd_create) | |||
368 | SYSCALL_SPU(bpf) | 368 | SYSCALL_SPU(bpf) |
369 | COMPAT_SYS(execveat) | 369 | COMPAT_SYS(execveat) |
370 | PPC64ONLY(switch_endian) | 370 | PPC64ONLY(switch_endian) |
371 | SYSCALL_SPU(userfaultfd) | ||
diff --git a/arch/powerpc/include/asm/tsi108_pci.h b/arch/powerpc/include/asm/tsi108_pci.h index 5653d7cc3e24..ae59d5b672b0 100644 --- a/arch/powerpc/include/asm/tsi108_pci.h +++ b/arch/powerpc/include/asm/tsi108_pci.h | |||
@@ -39,7 +39,7 @@ | |||
39 | 39 | ||
40 | extern int tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary); | 40 | extern int tsi108_setup_pci(struct device_node *dev, u32 cfg_phys, int primary); |
41 | extern void tsi108_pci_int_init(struct device_node *node); | 41 | extern void tsi108_pci_int_init(struct device_node *node); |
42 | extern void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc); | 42 | extern void tsi108_irq_cascade(struct irq_desc *desc); |
43 | extern void tsi108_clear_pci_cfg_error(void); | 43 | extern void tsi108_clear_pci_cfg_error(void); |
44 | 44 | ||
45 | #endif /* _ASM_POWERPC_TSI108_PCI_H */ | 45 | #endif /* _ASM_POWERPC_TSI108_PCI_H */ |
diff --git a/arch/powerpc/include/asm/unistd.h b/arch/powerpc/include/asm/unistd.h index f4f8b667d75b..4a055b6c2a64 100644 --- a/arch/powerpc/include/asm/unistd.h +++ b/arch/powerpc/include/asm/unistd.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <uapi/asm/unistd.h> | 12 | #include <uapi/asm/unistd.h> |
13 | 13 | ||
14 | 14 | ||
15 | #define __NR_syscalls 364 | 15 | #define __NR_syscalls 365 |
16 | 16 | ||
17 | #define __NR__exit __NR_exit | 17 | #define __NR__exit __NR_exit |
18 | #define NR_syscalls __NR_syscalls | 18 | #define NR_syscalls __NR_syscalls |
diff --git a/arch/powerpc/include/uapi/asm/unistd.h b/arch/powerpc/include/uapi/asm/unistd.h index e4aa173dae62..6ad58d4c879b 100644 --- a/arch/powerpc/include/uapi/asm/unistd.h +++ b/arch/powerpc/include/uapi/asm/unistd.h | |||
@@ -386,5 +386,6 @@ | |||
386 | #define __NR_bpf 361 | 386 | #define __NR_bpf 361 |
387 | #define __NR_execveat 362 | 387 | #define __NR_execveat 362 |
388 | #define __NR_switch_endian 363 | 388 | #define __NR_switch_endian 363 |
389 | #define __NR_userfaultfd 364 | ||
389 | 390 | ||
390 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ | 391 | #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ |
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c index 45096033d37b..290559df1e8b 100644 --- a/arch/powerpc/kernel/irq.c +++ b/arch/powerpc/kernel/irq.c | |||
@@ -441,7 +441,7 @@ void migrate_irqs(void) | |||
441 | 441 | ||
442 | chip = irq_data_get_irq_chip(data); | 442 | chip = irq_data_get_irq_chip(data); |
443 | 443 | ||
444 | cpumask_and(mask, data->affinity, map); | 444 | cpumask_and(mask, irq_data_get_affinity_mask(data), map); |
445 | if (cpumask_any(mask) >= nr_cpu_ids) { | 445 | if (cpumask_any(mask) >= nr_cpu_ids) { |
446 | pr_warn("Breaking affinity for irq %i\n", irq); | 446 | pr_warn("Breaking affinity for irq %i\n", irq); |
447 | cpumask_copy(mask, map); | 447 | cpumask_copy(mask, map); |
diff --git a/arch/powerpc/kernel/setup_32.c b/arch/powerpc/kernel/setup_32.c index bb02e9f6944e..ad8c9db61237 100644 --- a/arch/powerpc/kernel/setup_32.c +++ b/arch/powerpc/kernel/setup_32.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <asm/udbg.h> | 38 | #include <asm/udbg.h> |
39 | #include <asm/mmu_context.h> | 39 | #include <asm/mmu_context.h> |
40 | #include <asm/epapr_hcalls.h> | 40 | #include <asm/epapr_hcalls.h> |
41 | #include <asm/code-patching.h> | ||
41 | 42 | ||
42 | #define DBG(fmt...) | 43 | #define DBG(fmt...) |
43 | 44 | ||
@@ -109,6 +110,8 @@ notrace unsigned long __init early_init(unsigned long dt_ptr) | |||
109 | * This is called very early on the boot process, after a minimal | 110 | * This is called very early on the boot process, after a minimal |
110 | * MMU environment has been set up but before MMU_init is called. | 111 | * MMU environment has been set up but before MMU_init is called. |
111 | */ | 112 | */ |
113 | extern unsigned int memset_nocache_branch; /* Insn to be replaced by NOP */ | ||
114 | |||
112 | notrace void __init machine_init(u64 dt_ptr) | 115 | notrace void __init machine_init(u64 dt_ptr) |
113 | { | 116 | { |
114 | lockdep_init(); | 117 | lockdep_init(); |
@@ -116,6 +119,9 @@ notrace void __init machine_init(u64 dt_ptr) | |||
116 | /* Enable early debugging if any specified (see udbg.h) */ | 119 | /* Enable early debugging if any specified (see udbg.h) */ |
117 | udbg_early_init(); | 120 | udbg_early_init(); |
118 | 121 | ||
122 | patch_instruction((unsigned int *)&memcpy, PPC_INST_NOP); | ||
123 | patch_instruction(&memset_nocache_branch, PPC_INST_NOP); | ||
124 | |||
119 | /* Do some early initialization based on the flat device tree */ | 125 | /* Do some early initialization based on the flat device tree */ |
120 | early_init_devtree(__va(dt_ptr)); | 126 | early_init_devtree(__va(dt_ptr)); |
121 | 127 | ||
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index d75bf325f54a..cf009167d208 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c | |||
@@ -53,6 +53,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
53 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, | 53 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, |
54 | { "queue_intr", VCPU_STAT(queue_intr) }, | 54 | { "queue_intr", VCPU_STAT(queue_intr) }, |
55 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll), }, | 55 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll), }, |
56 | { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll), }, | ||
56 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | 57 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, |
57 | { "pf_storage", VCPU_STAT(pf_storage) }, | 58 | { "pf_storage", VCPU_STAT(pf_storage) }, |
58 | { "sp_storage", VCPU_STAT(sp_storage) }, | 59 | { "sp_storage", VCPU_STAT(sp_storage) }, |
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index ae458f0fd061..fd5875179e5c 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -63,6 +63,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
63 | { "dec", VCPU_STAT(dec_exits) }, | 63 | { "dec", VCPU_STAT(dec_exits) }, |
64 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, | 64 | { "ext_intr", VCPU_STAT(ext_intr_exits) }, |
65 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, | 65 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, |
66 | { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) }, | ||
66 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | 67 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, |
67 | { "doorbell", VCPU_STAT(dbell_exits) }, | 68 | { "doorbell", VCPU_STAT(dbell_exits) }, |
68 | { "guest doorbell", VCPU_STAT(gdbell_exits) }, | 69 | { "guest doorbell", VCPU_STAT(gdbell_exits) }, |
diff --git a/arch/powerpc/lib/copy_32.S b/arch/powerpc/lib/copy_32.S index 2ef50c629470..c44df2dbedd5 100644 --- a/arch/powerpc/lib/copy_32.S +++ b/arch/powerpc/lib/copy_32.S | |||
@@ -73,6 +73,10 @@ CACHELINE_MASK = (L1_CACHE_BYTES-1) | |||
73 | * Use dcbz on the complete cache lines in the destination | 73 | * Use dcbz on the complete cache lines in the destination |
74 | * to set them to zero. This requires that the destination | 74 | * to set them to zero. This requires that the destination |
75 | * area is cacheable. -- paulus | 75 | * area is cacheable. -- paulus |
76 | * | ||
77 | * During early init, cache might not be active yet, so dcbz cannot be used. | ||
78 | * We therefore skip the optimised bloc that uses dcbz. This jump is | ||
79 | * replaced by a nop once cache is active. This is done in machine_init() | ||
76 | */ | 80 | */ |
77 | _GLOBAL(memset) | 81 | _GLOBAL(memset) |
78 | rlwimi r4,r4,8,16,23 | 82 | rlwimi r4,r4,8,16,23 |
@@ -88,6 +92,8 @@ _GLOBAL(memset) | |||
88 | subf r6,r0,r6 | 92 | subf r6,r0,r6 |
89 | cmplwi 0,r4,0 | 93 | cmplwi 0,r4,0 |
90 | bne 2f /* Use normal procedure if r4 is not zero */ | 94 | bne 2f /* Use normal procedure if r4 is not zero */ |
95 | _GLOBAL(memset_nocache_branch) | ||
96 | b 2f /* Skip optimised bloc until cache is enabled */ | ||
91 | 97 | ||
92 | clrlwi r7,r6,32-LG_CACHELINE_BYTES | 98 | clrlwi r7,r6,32-LG_CACHELINE_BYTES |
93 | add r8,r7,r5 | 99 | add r8,r7,r5 |
@@ -128,6 +134,10 @@ _GLOBAL(memset) | |||
128 | * the destination area is cacheable. | 134 | * the destination area is cacheable. |
129 | * We only use this version if the source and dest don't overlap. | 135 | * We only use this version if the source and dest don't overlap. |
130 | * -- paulus. | 136 | * -- paulus. |
137 | * | ||
138 | * During early init, cache might not be active yet, so dcbz cannot be used. | ||
139 | * We therefore jump to generic_memcpy which doesn't use dcbz. This jump is | ||
140 | * replaced by a nop once cache is active. This is done in machine_init() | ||
131 | */ | 141 | */ |
132 | _GLOBAL(memmove) | 142 | _GLOBAL(memmove) |
133 | cmplw 0,r3,r4 | 143 | cmplw 0,r3,r4 |
@@ -135,6 +145,7 @@ _GLOBAL(memmove) | |||
135 | /* fall through */ | 145 | /* fall through */ |
136 | 146 | ||
137 | _GLOBAL(memcpy) | 147 | _GLOBAL(memcpy) |
148 | b generic_memcpy | ||
138 | add r7,r3,r5 /* test if the src & dst overlap */ | 149 | add r7,r3,r5 /* test if the src & dst overlap */ |
139 | add r8,r4,r5 | 150 | add r8,r4,r5 |
140 | cmplw 0,r4,r7 | 151 | cmplw 0,r4,r7 |
diff --git a/arch/powerpc/mm/hugepage-hash64.c b/arch/powerpc/mm/hugepage-hash64.c index 43dafb9d6a46..4d87122cf6a7 100644 --- a/arch/powerpc/mm/hugepage-hash64.c +++ b/arch/powerpc/mm/hugepage-hash64.c | |||
@@ -85,7 +85,6 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid, | |||
85 | BUG_ON(index >= 4096); | 85 | BUG_ON(index >= 4096); |
86 | 86 | ||
87 | vpn = hpt_vpn(ea, vsid, ssize); | 87 | vpn = hpt_vpn(ea, vsid, ssize); |
88 | hash = hpt_hash(vpn, shift, ssize); | ||
89 | hpte_slot_array = get_hpte_slot_array(pmdp); | 88 | hpte_slot_array = get_hpte_slot_array(pmdp); |
90 | if (psize == MMU_PAGE_4K) { | 89 | if (psize == MMU_PAGE_4K) { |
91 | /* | 90 | /* |
@@ -101,6 +100,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid, | |||
101 | valid = hpte_valid(hpte_slot_array, index); | 100 | valid = hpte_valid(hpte_slot_array, index); |
102 | if (valid) { | 101 | if (valid) { |
103 | /* update the hpte bits */ | 102 | /* update the hpte bits */ |
103 | hash = hpt_hash(vpn, shift, ssize); | ||
104 | hidx = hpte_hash_index(hpte_slot_array, index); | 104 | hidx = hpte_hash_index(hpte_slot_array, index); |
105 | if (hidx & _PTEIDX_SECONDARY) | 105 | if (hidx & _PTEIDX_SECONDARY) |
106 | hash = ~hash; | 106 | hash = ~hash; |
@@ -126,6 +126,7 @@ int __hash_page_thp(unsigned long ea, unsigned long access, unsigned long vsid, | |||
126 | if (!valid) { | 126 | if (!valid) { |
127 | unsigned long hpte_group; | 127 | unsigned long hpte_group; |
128 | 128 | ||
129 | hash = hpt_hash(vpn, shift, ssize); | ||
129 | /* insert new entry */ | 130 | /* insert new entry */ |
130 | pa = pmd_pfn(__pmd(old_pmd)) << PAGE_SHIFT; | 131 | pa = pmd_pfn(__pmd(old_pmd)) << PAGE_SHIFT; |
131 | new_pmd |= _PAGE_HASHPTE; | 132 | new_pmd |= _PAGE_HASHPTE; |
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c index 11090ab4bf59..0035d146df73 100644 --- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c +++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c | |||
@@ -104,9 +104,10 @@ cpld_pic_get_irq(int offset, u8 ignore, u8 __iomem *statusp, | |||
104 | return irq_linear_revmap(cpld_pic_host, cpld_irq); | 104 | return irq_linear_revmap(cpld_pic_host, cpld_irq); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void | 107 | static void cpld_pic_cascade(struct irq_desc *desc) |
108 | cpld_pic_cascade(unsigned int irq, struct irq_desc *desc) | ||
109 | { | 108 | { |
109 | unsigned int irq; | ||
110 | |||
110 | irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, | 111 | irq = cpld_pic_get_irq(0, PCI_IGNORE, &cpld_regs->pci_status, |
111 | &cpld_regs->pci_mask); | 112 | &cpld_regs->pci_mask); |
112 | if (irq != NO_IRQ) { | 113 | if (irq != NO_IRQ) { |
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c index 32cae33c4266..8fb95480fd73 100644 --- a/arch/powerpc/platforms/52xx/media5200.c +++ b/arch/powerpc/platforms/52xx/media5200.c | |||
@@ -80,7 +80,7 @@ static struct irq_chip media5200_irq_chip = { | |||
80 | .irq_mask_ack = media5200_irq_mask, | 80 | .irq_mask_ack = media5200_irq_mask, |
81 | }; | 81 | }; |
82 | 82 | ||
83 | void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc) | 83 | static void media5200_irq_cascade(struct irq_desc *desc) |
84 | { | 84 | { |
85 | struct irq_chip *chip = irq_desc_get_chip(desc); | 85 | struct irq_chip *chip = irq_desc_get_chip(desc); |
86 | int sub_virq, val; | 86 | int sub_virq, val; |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c index 63016621aff8..78ac19aefa4d 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_gpt.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_gpt.c | |||
@@ -191,7 +191,7 @@ static struct irq_chip mpc52xx_gpt_irq_chip = { | |||
191 | .irq_set_type = mpc52xx_gpt_irq_set_type, | 191 | .irq_set_type = mpc52xx_gpt_irq_set_type, |
192 | }; | 192 | }; |
193 | 193 | ||
194 | void mpc52xx_gpt_irq_cascade(unsigned int virq, struct irq_desc *desc) | 194 | static void mpc52xx_gpt_irq_cascade(struct irq_desc *desc) |
195 | { | 195 | { |
196 | struct mpc52xx_gpt_priv *gpt = irq_desc_get_handler_data(desc); | 196 | struct mpc52xx_gpt_priv *gpt = irq_desc_get_handler_data(desc); |
197 | int sub_virq; | 197 | int sub_virq; |
diff --git a/arch/powerpc/platforms/52xx/mpc52xx_pic.c b/arch/powerpc/platforms/52xx/mpc52xx_pic.c index 2944bc84b9d6..4fe2074c88cb 100644 --- a/arch/powerpc/platforms/52xx/mpc52xx_pic.c +++ b/arch/powerpc/platforms/52xx/mpc52xx_pic.c | |||
@@ -196,7 +196,7 @@ static int mpc52xx_extirq_set_type(struct irq_data *d, unsigned int flow_type) | |||
196 | ctrl_reg |= (type << (22 - (l2irq * 2))); | 196 | ctrl_reg |= (type << (22 - (l2irq * 2))); |
197 | out_be32(&intr->ctrl, ctrl_reg); | 197 | out_be32(&intr->ctrl, ctrl_reg); |
198 | 198 | ||
199 | __irq_set_handler_locked(d->irq, handler); | 199 | irq_set_handler_locked(d, handler); |
200 | 200 | ||
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c index 74861a7fb807..60e89fc9c753 100644 --- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c +++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | |||
@@ -78,7 +78,7 @@ static struct irq_chip pq2ads_pci_ic = { | |||
78 | .irq_disable = pq2ads_pci_mask_irq | 78 | .irq_disable = pq2ads_pci_mask_irq |
79 | }; | 79 | }; |
80 | 80 | ||
81 | static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc) | 81 | static void pq2ads_pci_irq_demux(struct irq_desc *desc) |
82 | { | 82 | { |
83 | struct pq2ads_pci_pic *priv = irq_desc_get_handler_data(desc); | 83 | struct pq2ads_pci_pic *priv = irq_desc_get_handler_data(desc); |
84 | u32 stat, mask, pend; | 84 | u32 stat, mask, pend; |
diff --git a/arch/powerpc/platforms/85xx/common.c b/arch/powerpc/platforms/85xx/common.c index 7bfb9b184dd4..23791de7b688 100644 --- a/arch/powerpc/platforms/85xx/common.c +++ b/arch/powerpc/platforms/85xx/common.c | |||
@@ -49,7 +49,7 @@ int __init mpc85xx_common_publish_devices(void) | |||
49 | return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL); | 49 | return of_platform_bus_probe(NULL, mpc85xx_common_ids, NULL); |
50 | } | 50 | } |
51 | #ifdef CONFIG_CPM2 | 51 | #ifdef CONFIG_CPM2 |
52 | static void cpm2_cascade(unsigned int irq, struct irq_desc *desc) | 52 | static void cpm2_cascade(struct irq_desc *desc) |
53 | { | 53 | { |
54 | struct irq_chip *chip = irq_desc_get_chip(desc); | 54 | struct irq_chip *chip = irq_desc_get_chip(desc); |
55 | int cascade_irq; | 55 | int cascade_irq; |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_cds.c b/arch/powerpc/platforms/85xx/mpc85xx_cds.c index b0753e222086..5ac70de3e48a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_cds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_cds.c | |||
@@ -192,8 +192,7 @@ void mpc85xx_cds_fixup_bus(struct pci_bus *bus) | |||
192 | } | 192 | } |
193 | 193 | ||
194 | #ifdef CONFIG_PPC_I8259 | 194 | #ifdef CONFIG_PPC_I8259 |
195 | static void mpc85xx_8259_cascade_handler(unsigned int irq, | 195 | static void mpc85xx_8259_cascade_handler(struct irq_desc *desc) |
196 | struct irq_desc *desc) | ||
197 | { | 196 | { |
198 | unsigned int cascade_irq = i8259_irq(); | 197 | unsigned int cascade_irq = i8259_irq(); |
199 | 198 | ||
@@ -202,7 +201,7 @@ static void mpc85xx_8259_cascade_handler(unsigned int irq, | |||
202 | generic_handle_irq(cascade_irq); | 201 | generic_handle_irq(cascade_irq); |
203 | 202 | ||
204 | /* check for any interrupts from the shared IRQ line */ | 203 | /* check for any interrupts from the shared IRQ line */ |
205 | handle_fasteoi_irq(irq, desc); | 204 | handle_fasteoi_irq(desc); |
206 | } | 205 | } |
207 | 206 | ||
208 | static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id) | 207 | static irqreturn_t mpc85xx_8259_cascade_action(int irq, void *dev_id) |
diff --git a/arch/powerpc/platforms/85xx/mpc85xx_ds.c b/arch/powerpc/platforms/85xx/mpc85xx_ds.c index ffdf02121a7c..f858306dba6a 100644 --- a/arch/powerpc/platforms/85xx/mpc85xx_ds.c +++ b/arch/powerpc/platforms/85xx/mpc85xx_ds.c | |||
@@ -46,7 +46,7 @@ | |||
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | #ifdef CONFIG_PPC_I8259 | 48 | #ifdef CONFIG_PPC_I8259 |
49 | static void mpc85xx_8259_cascade(unsigned int irq, struct irq_desc *desc) | 49 | static void mpc85xx_8259_cascade(struct irq_desc *desc) |
50 | { | 50 | { |
51 | struct irq_chip *chip = irq_desc_get_chip(desc); | 51 | struct irq_chip *chip = irq_desc_get_chip(desc); |
52 | unsigned int cascade_irq = i8259_irq(); | 52 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c index 55a9682b9529..b02d6a5bb035 100644 --- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c +++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c | |||
@@ -91,9 +91,10 @@ static inline unsigned int socrates_fpga_pic_get_irq(unsigned int irq) | |||
91 | (irq_hw_number_t)i); | 91 | (irq_hw_number_t)i); |
92 | } | 92 | } |
93 | 93 | ||
94 | void socrates_fpga_pic_cascade(unsigned int irq, struct irq_desc *desc) | 94 | static void socrates_fpga_pic_cascade(struct irq_desc *desc) |
95 | { | 95 | { |
96 | struct irq_chip *chip = irq_desc_get_chip(desc); | 96 | struct irq_chip *chip = irq_desc_get_chip(desc); |
97 | unsigned int irq = irq_desc_get_irq(desc); | ||
97 | unsigned int cascade_irq; | 98 | unsigned int cascade_irq; |
98 | 99 | ||
99 | /* | 100 | /* |
diff --git a/arch/powerpc/platforms/86xx/pic.c b/arch/powerpc/platforms/86xx/pic.c index d5b98c0f958a..845defa1fd19 100644 --- a/arch/powerpc/platforms/86xx/pic.c +++ b/arch/powerpc/platforms/86xx/pic.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <asm/i8259.h> | 17 | #include <asm/i8259.h> |
18 | 18 | ||
19 | #ifdef CONFIG_PPC_I8259 | 19 | #ifdef CONFIG_PPC_I8259 |
20 | static void mpc86xx_8259_cascade(unsigned int irq, struct irq_desc *desc) | 20 | static void mpc86xx_8259_cascade(struct irq_desc *desc) |
21 | { | 21 | { |
22 | struct irq_chip *chip = irq_desc_get_chip(desc); | 22 | struct irq_chip *chip = irq_desc_get_chip(desc); |
23 | unsigned int cascade_irq = i8259_irq(); | 23 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/powerpc/platforms/8xx/m8xx_setup.c b/arch/powerpc/platforms/8xx/m8xx_setup.c index d3037747031d..c289fc77b4ba 100644 --- a/arch/powerpc/platforms/8xx/m8xx_setup.c +++ b/arch/powerpc/platforms/8xx/m8xx_setup.c | |||
@@ -214,7 +214,7 @@ void mpc8xx_restart(char *cmd) | |||
214 | panic("Restart failed\n"); | 214 | panic("Restart failed\n"); |
215 | } | 215 | } |
216 | 216 | ||
217 | static void cpm_cascade(unsigned int irq, struct irq_desc *desc) | 217 | static void cpm_cascade(struct irq_desc *desc) |
218 | { | 218 | { |
219 | struct irq_chip *chip = irq_desc_get_chip(desc); | 219 | struct irq_chip *chip = irq_desc_get_chip(desc); |
220 | int cascade_irq = cpm_get_irq(); | 220 | int cascade_irq = cpm_get_irq(); |
diff --git a/arch/powerpc/platforms/cell/axon_msi.c b/arch/powerpc/platforms/cell/axon_msi.c index 306888acb737..e0e68a1c0d3c 100644 --- a/arch/powerpc/platforms/cell/axon_msi.c +++ b/arch/powerpc/platforms/cell/axon_msi.c | |||
@@ -93,7 +93,7 @@ static void msic_dcr_write(struct axon_msic *msic, unsigned int dcr_n, u32 val) | |||
93 | dcr_write(msic->dcr_host, dcr_n, val); | 93 | dcr_write(msic->dcr_host, dcr_n, val); |
94 | } | 94 | } |
95 | 95 | ||
96 | static void axon_msi_cascade(unsigned int irq, struct irq_desc *desc) | 96 | static void axon_msi_cascade(struct irq_desc *desc) |
97 | { | 97 | { |
98 | struct irq_chip *chip = irq_desc_get_chip(desc); | 98 | struct irq_chip *chip = irq_desc_get_chip(desc); |
99 | struct axon_msic *msic = irq_desc_get_handler_data(desc); | 99 | struct axon_msic *msic = irq_desc_get_handler_data(desc); |
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c index a15f1efc295f..9f609fc8d331 100644 --- a/arch/powerpc/platforms/cell/interrupt.c +++ b/arch/powerpc/platforms/cell/interrupt.c | |||
@@ -99,11 +99,12 @@ static void iic_ioexc_eoi(struct irq_data *d) | |||
99 | { | 99 | { |
100 | } | 100 | } |
101 | 101 | ||
102 | static void iic_ioexc_cascade(unsigned int irq, struct irq_desc *desc) | 102 | static void iic_ioexc_cascade(struct irq_desc *desc) |
103 | { | 103 | { |
104 | struct irq_chip *chip = irq_desc_get_chip(desc); | 104 | struct irq_chip *chip = irq_desc_get_chip(desc); |
105 | struct cbe_iic_regs __iomem *node_iic = | 105 | struct cbe_iic_regs __iomem *node_iic = |
106 | (void __iomem *)irq_desc_get_handler_data(desc); | 106 | (void __iomem *)irq_desc_get_handler_data(desc); |
107 | unsigned int irq = irq_desc_get_irq(desc); | ||
107 | unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC; | 108 | unsigned int base = (irq & 0xffffff00) | IIC_IRQ_TYPE_IOEXC; |
108 | unsigned long bits, ack; | 109 | unsigned long bits, ack; |
109 | int cascade; | 110 | int cascade; |
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index 1f72f4ab6353..9d27de62dc62 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c | |||
@@ -199,7 +199,7 @@ static const struct irq_domain_ops spider_host_ops = { | |||
199 | .xlate = spider_host_xlate, | 199 | .xlate = spider_host_xlate, |
200 | }; | 200 | }; |
201 | 201 | ||
202 | static void spider_irq_cascade(unsigned int irq, struct irq_desc *desc) | 202 | static void spider_irq_cascade(struct irq_desc *desc) |
203 | { | 203 | { |
204 | struct irq_chip *chip = irq_desc_get_chip(desc); | 204 | struct irq_chip *chip = irq_desc_get_chip(desc); |
205 | struct spider_pic *pic = irq_desc_get_handler_data(desc); | 205 | struct spider_pic *pic = irq_desc_get_handler_data(desc); |
diff --git a/arch/powerpc/platforms/chrp/setup.c b/arch/powerpc/platforms/chrp/setup.c index 15ebc4e8a151..987d1b8d68e3 100644 --- a/arch/powerpc/platforms/chrp/setup.c +++ b/arch/powerpc/platforms/chrp/setup.c | |||
@@ -363,7 +363,7 @@ void __init chrp_setup_arch(void) | |||
363 | if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0); | 363 | if (ppc_md.progress) ppc_md.progress("Linux/PPC "UTS_RELEASE"\n", 0x0); |
364 | } | 364 | } |
365 | 365 | ||
366 | static void chrp_8259_cascade(unsigned int irq, struct irq_desc *desc) | 366 | static void chrp_8259_cascade(struct irq_desc *desc) |
367 | { | 367 | { |
368 | struct irq_chip *chip = irq_desc_get_chip(desc); | 368 | struct irq_chip *chip = irq_desc_get_chip(desc); |
369 | unsigned int cascade_irq = i8259_irq(); | 369 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c index 9dd154d6f89a..9b7975706bfc 100644 --- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c +++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c | |||
@@ -120,8 +120,7 @@ static unsigned int __hlwd_pic_get_irq(struct irq_domain *h) | |||
120 | return irq_linear_revmap(h, irq); | 120 | return irq_linear_revmap(h, irq); |
121 | } | 121 | } |
122 | 122 | ||
123 | static void hlwd_pic_irq_cascade(unsigned int cascade_virq, | 123 | static void hlwd_pic_irq_cascade(struct irq_desc *desc) |
124 | struct irq_desc *desc) | ||
125 | { | 124 | { |
126 | struct irq_chip *chip = irq_desc_get_chip(desc); | 125 | struct irq_chip *chip = irq_desc_get_chip(desc); |
127 | struct irq_domain *irq_domain = irq_desc_get_handler_data(desc); | 126 | struct irq_domain *irq_domain = irq_desc_get_handler_data(desc); |
diff --git a/arch/powerpc/platforms/embedded6xx/mvme5100.c b/arch/powerpc/platforms/embedded6xx/mvme5100.c index 1613303177e6..8f65aa3747f5 100644 --- a/arch/powerpc/platforms/embedded6xx/mvme5100.c +++ b/arch/powerpc/platforms/embedded6xx/mvme5100.c | |||
@@ -42,7 +42,7 @@ | |||
42 | static phys_addr_t pci_membase; | 42 | static phys_addr_t pci_membase; |
43 | static u_char *restart; | 43 | static u_char *restart; |
44 | 44 | ||
45 | static void mvme5100_8259_cascade(unsigned int irq, struct irq_desc *desc) | 45 | static void mvme5100_8259_cascade(struct irq_desc *desc) |
46 | { | 46 | { |
47 | struct irq_chip *chip = irq_desc_get_chip(desc); | 47 | struct irq_chip *chip = irq_desc_get_chip(desc); |
48 | unsigned int cascade_irq = i8259_irq(); | 48 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/powerpc/platforms/pasemi/msi.c b/arch/powerpc/platforms/pasemi/msi.c index e66ef1943338..b304a9fe55cc 100644 --- a/arch/powerpc/platforms/pasemi/msi.c +++ b/arch/powerpc/platforms/pasemi/msi.c | |||
@@ -63,6 +63,7 @@ static struct irq_chip mpic_pasemi_msi_chip = { | |||
63 | static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) | 63 | static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) |
64 | { | 64 | { |
65 | struct msi_desc *entry; | 65 | struct msi_desc *entry; |
66 | irq_hw_number_t hwirq; | ||
66 | 67 | ||
67 | pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); | 68 | pr_debug("pasemi_msi_teardown_msi_irqs, pdev %p\n", pdev); |
68 | 69 | ||
@@ -70,10 +71,10 @@ static void pasemi_msi_teardown_msi_irqs(struct pci_dev *pdev) | |||
70 | if (entry->irq == NO_IRQ) | 71 | if (entry->irq == NO_IRQ) |
71 | continue; | 72 | continue; |
72 | 73 | ||
74 | hwirq = virq_to_hw(entry->irq); | ||
73 | irq_set_msi_desc(entry->irq, NULL); | 75 | irq_set_msi_desc(entry->irq, NULL); |
74 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, | ||
75 | virq_to_hw(entry->irq), ALLOC_CHUNK); | ||
76 | irq_dispose_mapping(entry->irq); | 76 | irq_dispose_mapping(entry->irq); |
77 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, ALLOC_CHUNK); | ||
77 | } | 78 | } |
78 | 79 | ||
79 | return; | 80 | return; |
diff --git a/arch/powerpc/platforms/powernv/pci-ioda.c b/arch/powerpc/platforms/powernv/pci-ioda.c index 2927cd5c8303..414fd1a00fda 100644 --- a/arch/powerpc/platforms/powernv/pci-ioda.c +++ b/arch/powerpc/platforms/powernv/pci-ioda.c | |||
@@ -2049,9 +2049,23 @@ static long pnv_pci_ioda2_setup_default_config(struct pnv_ioda_pe *pe) | |||
2049 | struct iommu_table *tbl = NULL; | 2049 | struct iommu_table *tbl = NULL; |
2050 | long rc; | 2050 | long rc; |
2051 | 2051 | ||
2052 | /* | ||
2053 | * crashkernel= specifies the kdump kernel's maximum memory at | ||
2054 | * some offset and there is no guaranteed the result is a power | ||
2055 | * of 2, which will cause errors later. | ||
2056 | */ | ||
2057 | const u64 max_memory = __rounddown_pow_of_two(memory_hotplug_max()); | ||
2058 | |||
2059 | /* | ||
2060 | * In memory constrained environments, e.g. kdump kernel, the | ||
2061 | * DMA window can be larger than available memory, which will | ||
2062 | * cause errors later. | ||
2063 | */ | ||
2064 | const u64 window_size = min((u64)pe->table_group.tce32_size, max_memory); | ||
2065 | |||
2052 | rc = pnv_pci_ioda2_create_table(&pe->table_group, 0, | 2066 | rc = pnv_pci_ioda2_create_table(&pe->table_group, 0, |
2053 | IOMMU_PAGE_SHIFT_4K, | 2067 | IOMMU_PAGE_SHIFT_4K, |
2054 | pe->table_group.tce32_size, | 2068 | window_size, |
2055 | POWERNV_IOMMU_DEFAULT_LEVELS, &tbl); | 2069 | POWERNV_IOMMU_DEFAULT_LEVELS, &tbl); |
2056 | if (rc) { | 2070 | if (rc) { |
2057 | pe_err(pe, "Failed to create 32-bit TCE table, err %ld", | 2071 | pe_err(pe, "Failed to create 32-bit TCE table, err %ld", |
diff --git a/arch/powerpc/platforms/powernv/pci.c b/arch/powerpc/platforms/powernv/pci.c index 9b2480b265c0..f2dd77234240 100644 --- a/arch/powerpc/platforms/powernv/pci.c +++ b/arch/powerpc/platforms/powernv/pci.c | |||
@@ -99,6 +99,7 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev) | |||
99 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); | 99 | struct pci_controller *hose = pci_bus_to_host(pdev->bus); |
100 | struct pnv_phb *phb = hose->private_data; | 100 | struct pnv_phb *phb = hose->private_data; |
101 | struct msi_desc *entry; | 101 | struct msi_desc *entry; |
102 | irq_hw_number_t hwirq; | ||
102 | 103 | ||
103 | if (WARN_ON(!phb)) | 104 | if (WARN_ON(!phb)) |
104 | return; | 105 | return; |
@@ -106,10 +107,10 @@ void pnv_teardown_msi_irqs(struct pci_dev *pdev) | |||
106 | for_each_pci_msi_entry(entry, pdev) { | 107 | for_each_pci_msi_entry(entry, pdev) { |
107 | if (entry->irq == NO_IRQ) | 108 | if (entry->irq == NO_IRQ) |
108 | continue; | 109 | continue; |
110 | hwirq = virq_to_hw(entry->irq); | ||
109 | irq_set_msi_desc(entry->irq, NULL); | 111 | irq_set_msi_desc(entry->irq, NULL); |
110 | msi_bitmap_free_hwirqs(&phb->msi_bmp, | ||
111 | virq_to_hw(entry->irq) - phb->msi_base, 1); | ||
112 | irq_dispose_mapping(entry->irq); | 112 | irq_dispose_mapping(entry->irq); |
113 | msi_bitmap_free_hwirqs(&phb->msi_bmp, hwirq - phb->msi_base, 1); | ||
113 | } | 114 | } |
114 | } | 115 | } |
115 | #endif /* CONFIG_PCI_MSI */ | 116 | #endif /* CONFIG_PCI_MSI */ |
diff --git a/arch/powerpc/platforms/pseries/dlpar.c b/arch/powerpc/platforms/pseries/dlpar.c index 47d9cebe7159..db17827eb746 100644 --- a/arch/powerpc/platforms/pseries/dlpar.c +++ b/arch/powerpc/platforms/pseries/dlpar.c | |||
@@ -422,8 +422,10 @@ static ssize_t dlpar_cpu_probe(const char *buf, size_t count) | |||
422 | 422 | ||
423 | dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); | 423 | dn = dlpar_configure_connector(cpu_to_be32(drc_index), parent); |
424 | of_node_put(parent); | 424 | of_node_put(parent); |
425 | if (!dn) | 425 | if (!dn) { |
426 | dlpar_release_drc(drc_index); | ||
426 | return -EINVAL; | 427 | return -EINVAL; |
428 | } | ||
427 | 429 | ||
428 | rc = dlpar_attach_node(dn); | 430 | rc = dlpar_attach_node(dn); |
429 | if (rc) { | 431 | if (rc) { |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 39a74fad3e04..9a83eb71b030 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -111,7 +111,7 @@ static void __init fwnmi_init(void) | |||
111 | fwnmi_active = 1; | 111 | fwnmi_active = 1; |
112 | } | 112 | } |
113 | 113 | ||
114 | static void pseries_8259_cascade(unsigned int irq, struct irq_desc *desc) | 114 | static void pseries_8259_cascade(struct irq_desc *desc) |
115 | { | 115 | { |
116 | struct irq_chip *chip = irq_desc_get_chip(desc); | 116 | struct irq_chip *chip = irq_desc_get_chip(desc); |
117 | unsigned int cascade_irq = i8259_irq(); | 117 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c index a11bd1d433ad..9e86074719a9 100644 --- a/arch/powerpc/sysdev/cpm2_pic.c +++ b/arch/powerpc/sysdev/cpm2_pic.c | |||
@@ -155,9 +155,9 @@ static int cpm2_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
155 | 155 | ||
156 | irqd_set_trigger_type(d, flow_type); | 156 | irqd_set_trigger_type(d, flow_type); |
157 | if (flow_type & IRQ_TYPE_LEVEL_LOW) | 157 | if (flow_type & IRQ_TYPE_LEVEL_LOW) |
158 | __irq_set_handler_locked(d->irq, handle_level_irq); | 158 | irq_set_handler_locked(d, handle_level_irq); |
159 | else | 159 | else |
160 | __irq_set_handler_locked(d->irq, handle_edge_irq); | 160 | irq_set_handler_locked(d, handle_edge_irq); |
161 | 161 | ||
162 | /* internal IRQ senses are LEVEL_LOW | 162 | /* internal IRQ senses are LEVEL_LOW |
163 | * EXT IRQ and Port C IRQ senses are programmable | 163 | * EXT IRQ and Port C IRQ senses are programmable |
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c index 5916da1856a7..48a576aa47b9 100644 --- a/arch/powerpc/sysdev/fsl_msi.c +++ b/arch/powerpc/sysdev/fsl_msi.c | |||
@@ -128,15 +128,16 @@ static void fsl_teardown_msi_irqs(struct pci_dev *pdev) | |||
128 | { | 128 | { |
129 | struct msi_desc *entry; | 129 | struct msi_desc *entry; |
130 | struct fsl_msi *msi_data; | 130 | struct fsl_msi *msi_data; |
131 | irq_hw_number_t hwirq; | ||
131 | 132 | ||
132 | for_each_pci_msi_entry(entry, pdev) { | 133 | for_each_pci_msi_entry(entry, pdev) { |
133 | if (entry->irq == NO_IRQ) | 134 | if (entry->irq == NO_IRQ) |
134 | continue; | 135 | continue; |
136 | hwirq = virq_to_hw(entry->irq); | ||
135 | msi_data = irq_get_chip_data(entry->irq); | 137 | msi_data = irq_get_chip_data(entry->irq); |
136 | irq_set_msi_desc(entry->irq, NULL); | 138 | irq_set_msi_desc(entry->irq, NULL); |
137 | msi_bitmap_free_hwirqs(&msi_data->bitmap, | ||
138 | virq_to_hw(entry->irq), 1); | ||
139 | irq_dispose_mapping(entry->irq); | 139 | irq_dispose_mapping(entry->irq); |
140 | msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); | ||
140 | } | 141 | } |
141 | 142 | ||
142 | return; | 143 | return; |
diff --git a/arch/powerpc/sysdev/ge/ge_pic.c b/arch/powerpc/sysdev/ge/ge_pic.c index 2bcb78bb3a15..d57b77573068 100644 --- a/arch/powerpc/sysdev/ge/ge_pic.c +++ b/arch/powerpc/sysdev/ge/ge_pic.c | |||
@@ -91,7 +91,7 @@ static int gef_pic_cascade_irq; | |||
91 | * should be masked out. | 91 | * should be masked out. |
92 | */ | 92 | */ |
93 | 93 | ||
94 | void gef_pic_cascade(unsigned int irq, struct irq_desc *desc) | 94 | static void gef_pic_cascade(struct irq_desc *desc) |
95 | { | 95 | { |
96 | struct irq_chip *chip = irq_desc_get_chip(desc); | 96 | struct irq_chip *chip = irq_desc_get_chip(desc); |
97 | unsigned int cascade_irq; | 97 | unsigned int cascade_irq; |
diff --git a/arch/powerpc/sysdev/ge/ge_pic.h b/arch/powerpc/sysdev/ge/ge_pic.h index 908dbd9826b6..5bf7e4b81e36 100644 --- a/arch/powerpc/sysdev/ge/ge_pic.h +++ b/arch/powerpc/sysdev/ge/ge_pic.h | |||
@@ -1,8 +1,6 @@ | |||
1 | #ifndef __GEF_PIC_H__ | 1 | #ifndef __GEF_PIC_H__ |
2 | #define __GEF_PIC_H__ | 2 | #define __GEF_PIC_H__ |
3 | 3 | ||
4 | |||
5 | void gef_pic_cascade(unsigned int, struct irq_desc *); | ||
6 | unsigned int gef_pic_get_irq(void); | 4 | unsigned int gef_pic_get_irq(void); |
7 | void gef_pic_init(struct device_node *); | 5 | void gef_pic_init(struct device_node *); |
8 | 6 | ||
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c index 6b2b68914810..b1297ab1599b 100644 --- a/arch/powerpc/sysdev/ipic.c +++ b/arch/powerpc/sysdev/ipic.c | |||
@@ -624,10 +624,10 @@ static int ipic_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
624 | 624 | ||
625 | irqd_set_trigger_type(d, flow_type); | 625 | irqd_set_trigger_type(d, flow_type); |
626 | if (flow_type & IRQ_TYPE_LEVEL_LOW) { | 626 | if (flow_type & IRQ_TYPE_LEVEL_LOW) { |
627 | __irq_set_handler_locked(d->irq, handle_level_irq); | 627 | irq_set_handler_locked(d, handle_level_irq); |
628 | d->chip = &ipic_level_irq_chip; | 628 | d->chip = &ipic_level_irq_chip; |
629 | } else { | 629 | } else { |
630 | __irq_set_handler_locked(d->irq, handle_edge_irq); | 630 | irq_set_handler_locked(d, handle_edge_irq); |
631 | d->chip = &ipic_edge_irq_chip; | 631 | d->chip = &ipic_edge_irq_chip; |
632 | } | 632 | } |
633 | 633 | ||
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c index d93a78be4346..9a423975853a 100644 --- a/arch/powerpc/sysdev/mpc8xx_pic.c +++ b/arch/powerpc/sysdev/mpc8xx_pic.c | |||
@@ -55,7 +55,7 @@ static int mpc8xx_set_irq_type(struct irq_data *d, unsigned int flow_type) | |||
55 | unsigned int siel = in_be32(&siu_reg->sc_siel); | 55 | unsigned int siel = in_be32(&siu_reg->sc_siel); |
56 | siel |= mpc8xx_irqd_to_bit(d); | 56 | siel |= mpc8xx_irqd_to_bit(d); |
57 | out_be32(&siu_reg->sc_siel, siel); | 57 | out_be32(&siu_reg->sc_siel, siel); |
58 | __irq_set_handler_locked(d->irq, handle_edge_irq); | 58 | irq_set_handler_locked(d, handle_edge_irq); |
59 | } | 59 | } |
60 | return 0; | 60 | return 0; |
61 | } | 61 | } |
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c index 97a8ae8f94dd..537e5db85a06 100644 --- a/arch/powerpc/sysdev/mpic.c +++ b/arch/powerpc/sysdev/mpic.c | |||
@@ -1181,7 +1181,7 @@ static int mpic_host_xlate(struct irq_domain *h, struct device_node *ct, | |||
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | /* IRQ handler for a secondary MPIC cascaded from another IRQ controller */ | 1183 | /* IRQ handler for a secondary MPIC cascaded from another IRQ controller */ |
1184 | static void mpic_cascade(unsigned int irq, struct irq_desc *desc) | 1184 | static void mpic_cascade(struct irq_desc *desc) |
1185 | { | 1185 | { |
1186 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1186 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1187 | struct mpic *mpic = irq_desc_get_handler_data(desc); | 1187 | struct mpic *mpic = irq_desc_get_handler_data(desc); |
diff --git a/arch/powerpc/sysdev/mpic_u3msi.c b/arch/powerpc/sysdev/mpic_u3msi.c index 70fbd5694a8b..2cbc7e29b85f 100644 --- a/arch/powerpc/sysdev/mpic_u3msi.c +++ b/arch/powerpc/sysdev/mpic_u3msi.c | |||
@@ -107,15 +107,16 @@ static u64 find_u4_magic_addr(struct pci_dev *pdev, unsigned int hwirq) | |||
107 | static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) | 107 | static void u3msi_teardown_msi_irqs(struct pci_dev *pdev) |
108 | { | 108 | { |
109 | struct msi_desc *entry; | 109 | struct msi_desc *entry; |
110 | irq_hw_number_t hwirq; | ||
110 | 111 | ||
111 | for_each_pci_msi_entry(entry, pdev) { | 112 | for_each_pci_msi_entry(entry, pdev) { |
112 | if (entry->irq == NO_IRQ) | 113 | if (entry->irq == NO_IRQ) |
113 | continue; | 114 | continue; |
114 | 115 | ||
116 | hwirq = virq_to_hw(entry->irq); | ||
115 | irq_set_msi_desc(entry->irq, NULL); | 117 | irq_set_msi_desc(entry->irq, NULL); |
116 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, | ||
117 | virq_to_hw(entry->irq), 1); | ||
118 | irq_dispose_mapping(entry->irq); | 118 | irq_dispose_mapping(entry->irq); |
119 | msi_bitmap_free_hwirqs(&msi_mpic->msi_bitmap, hwirq, 1); | ||
119 | } | 120 | } |
120 | 121 | ||
121 | return; | 122 | return; |
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c index 24d0470c1698..8fb806135043 100644 --- a/arch/powerpc/sysdev/ppc4xx_msi.c +++ b/arch/powerpc/sysdev/ppc4xx_msi.c | |||
@@ -124,16 +124,17 @@ void ppc4xx_teardown_msi_irqs(struct pci_dev *dev) | |||
124 | { | 124 | { |
125 | struct msi_desc *entry; | 125 | struct msi_desc *entry; |
126 | struct ppc4xx_msi *msi_data = &ppc4xx_msi; | 126 | struct ppc4xx_msi *msi_data = &ppc4xx_msi; |
127 | irq_hw_number_t hwirq; | ||
127 | 128 | ||
128 | dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); | 129 | dev_dbg(&dev->dev, "PCIE-MSI: tearing down msi irqs\n"); |
129 | 130 | ||
130 | for_each_pci_msi_entry(entry, dev) { | 131 | for_each_pci_msi_entry(entry, dev) { |
131 | if (entry->irq == NO_IRQ) | 132 | if (entry->irq == NO_IRQ) |
132 | continue; | 133 | continue; |
134 | hwirq = virq_to_hw(entry->irq); | ||
133 | irq_set_msi_desc(entry->irq, NULL); | 135 | irq_set_msi_desc(entry->irq, NULL); |
134 | msi_bitmap_free_hwirqs(&msi_data->bitmap, | ||
135 | virq_to_hw(entry->irq), 1); | ||
136 | irq_dispose_mapping(entry->irq); | 136 | irq_dispose_mapping(entry->irq); |
137 | msi_bitmap_free_hwirqs(&msi_data->bitmap, hwirq, 1); | ||
137 | } | 138 | } |
138 | } | 139 | } |
139 | 140 | ||
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c index 47b352e4bc74..fbcc1f855a7f 100644 --- a/arch/powerpc/sysdev/qe_lib/qe_ic.c +++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c | |||
@@ -311,8 +311,8 @@ unsigned int qe_ic_get_high_irq(struct qe_ic *qe_ic) | |||
311 | } | 311 | } |
312 | 312 | ||
313 | void __init qe_ic_init(struct device_node *node, unsigned int flags, | 313 | void __init qe_ic_init(struct device_node *node, unsigned int flags, |
314 | void (*low_handler)(unsigned int irq, struct irq_desc *desc), | 314 | void (*low_handler)(struct irq_desc *desc), |
315 | void (*high_handler)(unsigned int irq, struct irq_desc *desc)) | 315 | void (*high_handler)(struct irq_desc *desc)) |
316 | { | 316 | { |
317 | struct qe_ic *qe_ic; | 317 | struct qe_ic *qe_ic; |
318 | struct resource res; | 318 | struct resource res; |
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c index 57b54476e747..379de955aae3 100644 --- a/arch/powerpc/sysdev/tsi108_pci.c +++ b/arch/powerpc/sysdev/tsi108_pci.c | |||
@@ -428,7 +428,7 @@ void __init tsi108_pci_int_init(struct device_node *node) | |||
428 | init_pci_source(); | 428 | init_pci_source(); |
429 | } | 429 | } |
430 | 430 | ||
431 | void tsi108_irq_cascade(unsigned int irq, struct irq_desc *desc) | 431 | void tsi108_irq_cascade(struct irq_desc *desc) |
432 | { | 432 | { |
433 | struct irq_chip *chip = irq_desc_get_chip(desc); | 433 | struct irq_chip *chip = irq_desc_get_chip(desc); |
434 | unsigned int cascade_irq = get_pci_source(); | 434 | unsigned int cascade_irq = get_pci_source(); |
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c index d77345338671..6893d8f236df 100644 --- a/arch/powerpc/sysdev/uic.c +++ b/arch/powerpc/sysdev/uic.c | |||
@@ -194,7 +194,7 @@ static const struct irq_domain_ops uic_host_ops = { | |||
194 | .xlate = irq_domain_xlate_twocell, | 194 | .xlate = irq_domain_xlate_twocell, |
195 | }; | 195 | }; |
196 | 196 | ||
197 | void uic_irq_cascade(unsigned int virq, struct irq_desc *desc) | 197 | static void uic_irq_cascade(struct irq_desc *desc) |
198 | { | 198 | { |
199 | struct irq_chip *chip = irq_desc_get_chip(desc); | 199 | struct irq_chip *chip = irq_desc_get_chip(desc); |
200 | struct irq_data *idata = irq_desc_get_irq_data(desc); | 200 | struct irq_data *idata = irq_desc_get_irq_data(desc); |
diff --git a/arch/powerpc/sysdev/xics/ics-opal.c b/arch/powerpc/sysdev/xics/ics-opal.c index 11ac964d5175..27c936c080a6 100644 --- a/arch/powerpc/sysdev/xics/ics-opal.c +++ b/arch/powerpc/sysdev/xics/ics-opal.c | |||
@@ -54,7 +54,7 @@ static void ics_opal_unmask_irq(struct irq_data *d) | |||
54 | if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS) | 54 | if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS) |
55 | return; | 55 | return; |
56 | 56 | ||
57 | server = xics_get_irq_server(d->irq, d->affinity, 0); | 57 | server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0); |
58 | server = ics_opal_mangle_server(server); | 58 | server = ics_opal_mangle_server(server); |
59 | 59 | ||
60 | rc = opal_set_xive(hw_irq, server, DEFAULT_PRIORITY); | 60 | rc = opal_set_xive(hw_irq, server, DEFAULT_PRIORITY); |
diff --git a/arch/powerpc/sysdev/xics/ics-rtas.c b/arch/powerpc/sysdev/xics/ics-rtas.c index d1c625c4cc5a..3854dd41558d 100644 --- a/arch/powerpc/sysdev/xics/ics-rtas.c +++ b/arch/powerpc/sysdev/xics/ics-rtas.c | |||
@@ -47,7 +47,7 @@ static void ics_rtas_unmask_irq(struct irq_data *d) | |||
47 | if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS) | 47 | if (hw_irq == XICS_IPI || hw_irq == XICS_IRQ_SPURIOUS) |
48 | return; | 48 | return; |
49 | 49 | ||
50 | server = xics_get_irq_server(d->irq, d->affinity, 0); | 50 | server = xics_get_irq_server(d->irq, irq_data_get_affinity_mask(d), 0); |
51 | 51 | ||
52 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hw_irq, server, | 52 | call_status = rtas_call(ibm_set_xive, 3, 1, NULL, hw_irq, server, |
53 | DEFAULT_PRIORITY); | 53 | DEFAULT_PRIORITY); |
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c index 43b8b275bc5c..0f52d7955796 100644 --- a/arch/powerpc/sysdev/xilinx_intc.c +++ b/arch/powerpc/sysdev/xilinx_intc.c | |||
@@ -222,7 +222,7 @@ int xilinx_intc_get_irq(void) | |||
222 | /* | 222 | /* |
223 | * Support code for cascading to 8259 interrupt controllers | 223 | * Support code for cascading to 8259 interrupt controllers |
224 | */ | 224 | */ |
225 | static void xilinx_i8259_cascade(unsigned int irq, struct irq_desc *desc) | 225 | static void xilinx_i8259_cascade(struct irq_desc *desc) |
226 | { | 226 | { |
227 | struct irq_chip *chip = irq_desc_get_chip(desc); | 227 | struct irq_chip *chip = irq_desc_get_chip(desc); |
228 | unsigned int cascade_irq = i8259_irq(); | 228 | unsigned int cascade_irq = i8259_irq(); |
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 3d012e071647..6ce4a0b7e8da 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -210,6 +210,7 @@ struct kvm_vcpu_stat { | |||
210 | u32 exit_validity; | 210 | u32 exit_validity; |
211 | u32 exit_instruction; | 211 | u32 exit_instruction; |
212 | u32 halt_successful_poll; | 212 | u32 halt_successful_poll; |
213 | u32 halt_attempted_poll; | ||
213 | u32 halt_wakeup; | 214 | u32 halt_wakeup; |
214 | u32 instruction_lctl; | 215 | u32 instruction_lctl; |
215 | u32 instruction_lctlg; | 216 | u32 instruction_lctlg; |
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index c91eb941b444..0a67c40eece9 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c | |||
@@ -63,6 +63,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
63 | { "exit_program_interruption", VCPU_STAT(exit_program_interruption) }, | 63 | { "exit_program_interruption", VCPU_STAT(exit_program_interruption) }, |
64 | { "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) }, | 64 | { "exit_instr_and_program_int", VCPU_STAT(exit_instr_and_program) }, |
65 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, | 65 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, |
66 | { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) }, | ||
66 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | 67 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, |
67 | { "instruction_lctlg", VCPU_STAT(instruction_lctlg) }, | 68 | { "instruction_lctlg", VCPU_STAT(instruction_lctlg) }, |
68 | { "instruction_lctl", VCPU_STAT(instruction_lctl) }, | 69 | { "instruction_lctl", VCPU_STAT(instruction_lctl) }, |
@@ -1574,7 +1575,7 @@ static void kvm_s390_vcpu_request(struct kvm_vcpu *vcpu) | |||
1574 | 1575 | ||
1575 | static void kvm_s390_vcpu_request_handled(struct kvm_vcpu *vcpu) | 1576 | static void kvm_s390_vcpu_request_handled(struct kvm_vcpu *vcpu) |
1576 | { | 1577 | { |
1577 | atomic_or(PROG_REQUEST, &vcpu->arch.sie_block->prog20); | 1578 | atomic_andnot(PROG_REQUEST, &vcpu->arch.sie_block->prog20); |
1578 | } | 1579 | } |
1579 | 1580 | ||
1580 | /* | 1581 | /* |
diff --git a/arch/sh/boards/mach-se/7343/irq.c b/arch/sh/boards/mach-se/7343/irq.c index 6f97a8f0d0d6..6129aef6db76 100644 --- a/arch/sh/boards/mach-se/7343/irq.c +++ b/arch/sh/boards/mach-se/7343/irq.c | |||
@@ -29,7 +29,7 @@ | |||
29 | static void __iomem *se7343_irq_regs; | 29 | static void __iomem *se7343_irq_regs; |
30 | struct irq_domain *se7343_irq_domain; | 30 | struct irq_domain *se7343_irq_domain; |
31 | 31 | ||
32 | static void se7343_irq_demux(unsigned int irq, struct irq_desc *desc) | 32 | static void se7343_irq_demux(struct irq_desc *desc) |
33 | { | 33 | { |
34 | struct irq_data *data = irq_desc_get_irq_data(desc); | 34 | struct irq_data *data = irq_desc_get_irq_data(desc); |
35 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 35 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
diff --git a/arch/sh/boards/mach-se/7722/irq.c b/arch/sh/boards/mach-se/7722/irq.c index 60aebd14ccf8..24c74a88290c 100644 --- a/arch/sh/boards/mach-se/7722/irq.c +++ b/arch/sh/boards/mach-se/7722/irq.c | |||
@@ -28,7 +28,7 @@ | |||
28 | static void __iomem *se7722_irq_regs; | 28 | static void __iomem *se7722_irq_regs; |
29 | struct irq_domain *se7722_irq_domain; | 29 | struct irq_domain *se7722_irq_domain; |
30 | 30 | ||
31 | static void se7722_irq_demux(unsigned int irq, struct irq_desc *desc) | 31 | static void se7722_irq_demux(struct irq_desc *desc) |
32 | { | 32 | { |
33 | struct irq_data *data = irq_desc_get_irq_data(desc); | 33 | struct irq_data *data = irq_desc_get_irq_data(desc); |
34 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 34 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
diff --git a/arch/sh/boards/mach-se/7724/irq.c b/arch/sh/boards/mach-se/7724/irq.c index 9f2033898652..64e681e66c57 100644 --- a/arch/sh/boards/mach-se/7724/irq.c +++ b/arch/sh/boards/mach-se/7724/irq.c | |||
@@ -92,7 +92,7 @@ static struct irq_chip se7724_irq_chip __read_mostly = { | |||
92 | .irq_unmask = enable_se7724_irq, | 92 | .irq_unmask = enable_se7724_irq, |
93 | }; | 93 | }; |
94 | 94 | ||
95 | static void se7724_irq_demux(unsigned int __irq, struct irq_desc *desc) | 95 | static void se7724_irq_demux(struct irq_desc *desc) |
96 | { | 96 | { |
97 | unsigned int irq = irq_desc_get_irq(desc); | 97 | unsigned int irq = irq_desc_get_irq(desc); |
98 | struct fpga_irq set = get_fpga_irq(irq); | 98 | struct fpga_irq set = get_fpga_irq(irq); |
diff --git a/arch/sh/boards/mach-x3proto/gpio.c b/arch/sh/boards/mach-x3proto/gpio.c index 24555c364d5b..1fb2cbee25f2 100644 --- a/arch/sh/boards/mach-x3proto/gpio.c +++ b/arch/sh/boards/mach-x3proto/gpio.c | |||
@@ -60,7 +60,7 @@ static int x3proto_gpio_to_irq(struct gpio_chip *chip, unsigned gpio) | |||
60 | return virq; | 60 | return virq; |
61 | } | 61 | } |
62 | 62 | ||
63 | static void x3proto_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 63 | static void x3proto_gpio_irq_handler(struct irq_desc *desc) |
64 | { | 64 | { |
65 | struct irq_data *data = irq_desc_get_irq_data(desc); | 65 | struct irq_data *data = irq_desc_get_irq_data(desc); |
66 | struct irq_chip *chip = irq_data_get_irq_chip(data); | 66 | struct irq_chip *chip = irq_data_get_irq_chip(data); |
diff --git a/arch/sh/cchips/hd6446x/hd64461.c b/arch/sh/cchips/hd6446x/hd64461.c index e9735616bdc8..8180092502f7 100644 --- a/arch/sh/cchips/hd6446x/hd64461.c +++ b/arch/sh/cchips/hd6446x/hd64461.c | |||
@@ -56,7 +56,7 @@ static struct irq_chip hd64461_irq_chip = { | |||
56 | .irq_unmask = hd64461_unmask_irq, | 56 | .irq_unmask = hd64461_unmask_irq, |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static void hd64461_irq_demux(unsigned int irq, struct irq_desc *desc) | 59 | static void hd64461_irq_demux(struct irq_desc *desc) |
60 | { | 60 | { |
61 | unsigned short intv = __raw_readw(HD64461_NIRR); | 61 | unsigned short intv = __raw_readw(HD64461_NIRR); |
62 | unsigned int ext_irq = HD64461_IRQBASE; | 62 | unsigned int ext_irq = HD64461_IRQBASE; |
diff --git a/arch/sparc/kernel/leon_kernel.c b/arch/sparc/kernel/leon_kernel.c index 0299f052a2ef..42efcf85f721 100644 --- a/arch/sparc/kernel/leon_kernel.c +++ b/arch/sparc/kernel/leon_kernel.c | |||
@@ -53,7 +53,7 @@ static inline unsigned int leon_eirq_get(int cpu) | |||
53 | } | 53 | } |
54 | 54 | ||
55 | /* Handle one or multiple IRQs from the extended interrupt controller */ | 55 | /* Handle one or multiple IRQs from the extended interrupt controller */ |
56 | static void leon_handle_ext_irq(unsigned int irq, struct irq_desc *desc) | 56 | static void leon_handle_ext_irq(struct irq_desc *desc) |
57 | { | 57 | { |
58 | unsigned int eirq; | 58 | unsigned int eirq; |
59 | struct irq_bucket *p; | 59 | struct irq_bucket *p; |
diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c index 3382f7b3eeef..1e77128a8f88 100644 --- a/arch/sparc/kernel/leon_pci_grpci1.c +++ b/arch/sparc/kernel/leon_pci_grpci1.c | |||
@@ -357,7 +357,7 @@ static struct irq_chip grpci1_irq = { | |||
357 | }; | 357 | }; |
358 | 358 | ||
359 | /* Handle one or multiple IRQs from the PCI core */ | 359 | /* Handle one or multiple IRQs from the PCI core */ |
360 | static void grpci1_pci_flow_irq(unsigned int irq, struct irq_desc *desc) | 360 | static void grpci1_pci_flow_irq(struct irq_desc *desc) |
361 | { | 361 | { |
362 | struct grpci1_priv *priv = grpci1priv; | 362 | struct grpci1_priv *priv = grpci1priv; |
363 | int i, ack = 0; | 363 | int i, ack = 0; |
diff --git a/arch/sparc/kernel/leon_pci_grpci2.c b/arch/sparc/kernel/leon_pci_grpci2.c index 814fb1729b12..f727c4de1316 100644 --- a/arch/sparc/kernel/leon_pci_grpci2.c +++ b/arch/sparc/kernel/leon_pci_grpci2.c | |||
@@ -498,7 +498,7 @@ static struct irq_chip grpci2_irq = { | |||
498 | }; | 498 | }; |
499 | 499 | ||
500 | /* Handle one or multiple IRQs from the PCI core */ | 500 | /* Handle one or multiple IRQs from the PCI core */ |
501 | static void grpci2_pci_flow_irq(unsigned int irq, struct irq_desc *desc) | 501 | static void grpci2_pci_flow_irq(struct irq_desc *desc) |
502 | { | 502 | { |
503 | struct grpci2_priv *priv = grpci2priv; | 503 | struct grpci2_priv *priv = grpci2priv; |
504 | int i, ack = 0; | 504 | int i, ack = 0; |
diff --git a/arch/tile/kernel/pci_gx.c b/arch/tile/kernel/pci_gx.c index b3f73fd764a3..4c017d0d2de8 100644 --- a/arch/tile/kernel/pci_gx.c +++ b/arch/tile/kernel/pci_gx.c | |||
@@ -304,17 +304,16 @@ static struct irq_chip tilegx_legacy_irq_chip = { | |||
304 | * to Linux which just calls handle_level_irq() after clearing the | 304 | * to Linux which just calls handle_level_irq() after clearing the |
305 | * MAC INTx Assert status bit associated with this interrupt. | 305 | * MAC INTx Assert status bit associated with this interrupt. |
306 | */ | 306 | */ |
307 | static void trio_handle_level_irq(unsigned int __irq, struct irq_desc *desc) | 307 | static void trio_handle_level_irq(struct irq_desc *desc) |
308 | { | 308 | { |
309 | struct pci_controller *controller = irq_desc_get_handler_data(desc); | 309 | struct pci_controller *controller = irq_desc_get_handler_data(desc); |
310 | gxio_trio_context_t *trio_context = controller->trio; | 310 | gxio_trio_context_t *trio_context = controller->trio; |
311 | uint64_t intx = (uint64_t)irq_desc_get_chip_data(desc); | 311 | uint64_t intx = (uint64_t)irq_desc_get_chip_data(desc); |
312 | unsigned int irq = irq_desc_get_irq(desc); | ||
313 | int mac = controller->mac; | 312 | int mac = controller->mac; |
314 | unsigned int reg_offset; | 313 | unsigned int reg_offset; |
315 | uint64_t level_mask; | 314 | uint64_t level_mask; |
316 | 315 | ||
317 | handle_level_irq(irq, desc); | 316 | handle_level_irq(desc); |
318 | 317 | ||
319 | /* | 318 | /* |
320 | * Clear the INTx Level status, otherwise future interrupts are | 319 | * Clear the INTx Level status, otherwise future interrupts are |
diff --git a/arch/unicore32/kernel/irq.c b/arch/unicore32/kernel/irq.c index c53729d92e8d..eb1fd0030359 100644 --- a/arch/unicore32/kernel/irq.c +++ b/arch/unicore32/kernel/irq.c | |||
@@ -112,7 +112,7 @@ static struct irq_chip puv3_low_gpio_chip = { | |||
112 | * irq_controller_lock held, and IRQs disabled. Decode the IRQ | 112 | * irq_controller_lock held, and IRQs disabled. Decode the IRQ |
113 | * and call the handler. | 113 | * and call the handler. |
114 | */ | 114 | */ |
115 | static void puv3_gpio_handler(unsigned int __irq, struct irq_desc *desc) | 115 | static void puv3_gpio_handler(struct irq_desc *desc) |
116 | { | 116 | { |
117 | unsigned int mask, irq; | 117 | unsigned int mask, irq; |
118 | 118 | ||
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 7aef2d52daa0..328c8352480c 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1006,7 +1006,7 @@ config X86_THERMAL_VECTOR | |||
1006 | depends on X86_MCE_INTEL | 1006 | depends on X86_MCE_INTEL |
1007 | 1007 | ||
1008 | config X86_LEGACY_VM86 | 1008 | config X86_LEGACY_VM86 |
1009 | bool "Legacy VM86 support (obsolete)" | 1009 | bool "Legacy VM86 support" |
1010 | default n | 1010 | default n |
1011 | depends on X86_32 | 1011 | depends on X86_32 |
1012 | ---help--- | 1012 | ---help--- |
@@ -1018,19 +1018,20 @@ config X86_LEGACY_VM86 | |||
1018 | available to accelerate real mode DOS programs. However, any | 1018 | available to accelerate real mode DOS programs. However, any |
1019 | recent version of DOSEMU, X, or vbetool should be fully | 1019 | recent version of DOSEMU, X, or vbetool should be fully |
1020 | functional even without kernel VM86 support, as they will all | 1020 | functional even without kernel VM86 support, as they will all |
1021 | fall back to (pretty well performing) software emulation. | 1021 | fall back to software emulation. Nevertheless, if you are using |
1022 | a 16-bit DOS program where 16-bit performance matters, vm86 | ||
1023 | mode might be faster than emulation and you might want to | ||
1024 | enable this option. | ||
1022 | 1025 | ||
1023 | Anything that works on a 64-bit kernel is unlikely to need | 1026 | Note that any app that works on a 64-bit kernel is unlikely to |
1024 | this option, as 64-bit kernels don't, and can't, support V8086 | 1027 | need this option, as 64-bit kernels don't, and can't, support |
1025 | mode. This option is also unrelated to 16-bit protected mode | 1028 | V8086 mode. This option is also unrelated to 16-bit protected |
1026 | and is not needed to run most 16-bit programs under Wine. | 1029 | mode and is not needed to run most 16-bit programs under Wine. |
1027 | 1030 | ||
1028 | Enabling this option adds considerable attack surface to the | 1031 | Enabling this option increases the complexity of the kernel |
1029 | kernel and slows down system calls and exception handling. | 1032 | and slows down exception handling a tiny bit. |
1030 | 1033 | ||
1031 | Unless you use very old userspace or need the last drop of | 1034 | If unsure, say N here. |
1032 | performance in your real mode DOS games and can't use KVM, | ||
1033 | say N here. | ||
1034 | 1035 | ||
1035 | config VM86 | 1036 | config VM86 |
1036 | bool | 1037 | bool |
diff --git a/arch/x86/include/asm/cpufeature.h b/arch/x86/include/asm/cpufeature.h index 477fc28050e4..e6cf2ad350d1 100644 --- a/arch/x86/include/asm/cpufeature.h +++ b/arch/x86/include/asm/cpufeature.h | |||
@@ -241,6 +241,7 @@ | |||
241 | #define X86_FEATURE_AVX512PF ( 9*32+26) /* AVX-512 Prefetch */ | 241 | #define X86_FEATURE_AVX512PF ( 9*32+26) /* AVX-512 Prefetch */ |
242 | #define X86_FEATURE_AVX512ER ( 9*32+27) /* AVX-512 Exponential and Reciprocal */ | 242 | #define X86_FEATURE_AVX512ER ( 9*32+27) /* AVX-512 Exponential and Reciprocal */ |
243 | #define X86_FEATURE_AVX512CD ( 9*32+28) /* AVX-512 Conflict Detection */ | 243 | #define X86_FEATURE_AVX512CD ( 9*32+28) /* AVX-512 Conflict Detection */ |
244 | #define X86_FEATURE_SHA_NI ( 9*32+29) /* SHA1/SHA256 Instruction Extensions */ | ||
244 | 245 | ||
245 | /* Extended state features, CPUID level 0x0000000d:1 (eax), word 10 */ | 246 | /* Extended state features, CPUID level 0x0000000d:1 (eax), word 10 */ |
246 | #define X86_FEATURE_XSAVEOPT (10*32+ 0) /* XSAVEOPT */ | 247 | #define X86_FEATURE_XSAVEOPT (10*32+ 0) /* XSAVEOPT */ |
diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h index c12e845f59e6..349f80a82b82 100644 --- a/arch/x86/include/asm/kvm_host.h +++ b/arch/x86/include/asm/kvm_host.h | |||
@@ -711,6 +711,7 @@ struct kvm_vcpu_stat { | |||
711 | u32 nmi_window_exits; | 711 | u32 nmi_window_exits; |
712 | u32 halt_exits; | 712 | u32 halt_exits; |
713 | u32 halt_successful_poll; | 713 | u32 halt_successful_poll; |
714 | u32 halt_attempted_poll; | ||
714 | u32 halt_wakeup; | 715 | u32 halt_wakeup; |
715 | u32 request_irq_exits; | 716 | u32 request_irq_exits; |
716 | u32 irq_exits; | 717 | u32 irq_exits; |
diff --git a/arch/x86/include/asm/paravirt_types.h b/arch/x86/include/asm/paravirt_types.h index ce029e4fa7c6..31247b5bff7c 100644 --- a/arch/x86/include/asm/paravirt_types.h +++ b/arch/x86/include/asm/paravirt_types.h | |||
@@ -97,7 +97,6 @@ struct pv_lazy_ops { | |||
97 | struct pv_time_ops { | 97 | struct pv_time_ops { |
98 | unsigned long long (*sched_clock)(void); | 98 | unsigned long long (*sched_clock)(void); |
99 | unsigned long long (*steal_clock)(int cpu); | 99 | unsigned long long (*steal_clock)(int cpu); |
100 | unsigned long (*get_tsc_khz)(void); | ||
101 | }; | 100 | }; |
102 | 101 | ||
103 | struct pv_cpu_ops { | 102 | struct pv_cpu_ops { |
diff --git a/arch/x86/include/asm/qspinlock.h b/arch/x86/include/asm/qspinlock.h index 9d51fae1cba3..eaba08076030 100644 --- a/arch/x86/include/asm/qspinlock.h +++ b/arch/x86/include/asm/qspinlock.h | |||
@@ -39,18 +39,27 @@ static inline void queued_spin_unlock(struct qspinlock *lock) | |||
39 | } | 39 | } |
40 | #endif | 40 | #endif |
41 | 41 | ||
42 | #define virt_queued_spin_lock virt_queued_spin_lock | 42 | #ifdef CONFIG_PARAVIRT |
43 | 43 | #define virt_spin_lock virt_spin_lock | |
44 | static inline bool virt_queued_spin_lock(struct qspinlock *lock) | 44 | static inline bool virt_spin_lock(struct qspinlock *lock) |
45 | { | 45 | { |
46 | if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) | 46 | if (!static_cpu_has(X86_FEATURE_HYPERVISOR)) |
47 | return false; | 47 | return false; |
48 | 48 | ||
49 | while (atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL) != 0) | 49 | /* |
50 | cpu_relax(); | 50 | * On hypervisors without PARAVIRT_SPINLOCKS support we fall |
51 | * back to a Test-and-Set spinlock, because fair locks have | ||
52 | * horrible lock 'holder' preemption issues. | ||
53 | */ | ||
54 | |||
55 | do { | ||
56 | while (atomic_read(&lock->val) != 0) | ||
57 | cpu_relax(); | ||
58 | } while (atomic_cmpxchg(&lock->val, 0, _Q_LOCKED_VAL) != 0); | ||
51 | 59 | ||
52 | return true; | 60 | return true; |
53 | } | 61 | } |
62 | #endif /* CONFIG_PARAVIRT */ | ||
54 | 63 | ||
55 | #include <asm-generic/qspinlock.h> | 64 | #include <asm-generic/qspinlock.h> |
56 | 65 | ||
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c index c42827eb86cf..25f909362b7a 100644 --- a/arch/x86/kernel/alternative.c +++ b/arch/x86/kernel/alternative.c | |||
@@ -338,10 +338,15 @@ done: | |||
338 | 338 | ||
339 | static void __init_or_module optimize_nops(struct alt_instr *a, u8 *instr) | 339 | static void __init_or_module optimize_nops(struct alt_instr *a, u8 *instr) |
340 | { | 340 | { |
341 | unsigned long flags; | ||
342 | |||
341 | if (instr[0] != 0x90) | 343 | if (instr[0] != 0x90) |
342 | return; | 344 | return; |
343 | 345 | ||
346 | local_irq_save(flags); | ||
344 | add_nops(instr + (a->instrlen - a->padlen), a->padlen); | 347 | add_nops(instr + (a->instrlen - a->padlen), a->padlen); |
348 | sync_core(); | ||
349 | local_irq_restore(flags); | ||
345 | 350 | ||
346 | DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ", | 351 | DUMP_BYTES(instr, a->instrlen, "%p: [%d:%d) optimized NOPs: ", |
347 | instr, a->instrlen - a->padlen, a->padlen); | 352 | instr, a->instrlen - a->padlen, a->padlen); |
diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 3ca3e46aa405..24e94ce454e2 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c | |||
@@ -336,6 +336,13 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) | |||
336 | apic_write(APIC_LVTT, lvtt_value); | 336 | apic_write(APIC_LVTT, lvtt_value); |
337 | 337 | ||
338 | if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) { | 338 | if (lvtt_value & APIC_LVT_TIMER_TSCDEADLINE) { |
339 | /* | ||
340 | * See Intel SDM: TSC-Deadline Mode chapter. In xAPIC mode, | ||
341 | * writing to the APIC LVTT and TSC_DEADLINE MSR isn't serialized. | ||
342 | * According to Intel, MFENCE can do the serialization here. | ||
343 | */ | ||
344 | asm volatile("mfence" : : : "memory"); | ||
345 | |||
339 | printk_once(KERN_DEBUG "TSC deadline timer enabled\n"); | 346 | printk_once(KERN_DEBUG "TSC deadline timer enabled\n"); |
340 | return; | 347 | return; |
341 | } | 348 | } |
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c index 38a76f826530..5c60bb162622 100644 --- a/arch/x86/kernel/apic/io_apic.c +++ b/arch/x86/kernel/apic/io_apic.c | |||
@@ -2522,6 +2522,7 @@ void __init setup_ioapic_dest(void) | |||
2522 | int pin, ioapic, irq, irq_entry; | 2522 | int pin, ioapic, irq, irq_entry; |
2523 | const struct cpumask *mask; | 2523 | const struct cpumask *mask; |
2524 | struct irq_data *idata; | 2524 | struct irq_data *idata; |
2525 | struct irq_chip *chip; | ||
2525 | 2526 | ||
2526 | if (skip_ioapic_setup == 1) | 2527 | if (skip_ioapic_setup == 1) |
2527 | return; | 2528 | return; |
@@ -2545,9 +2546,9 @@ void __init setup_ioapic_dest(void) | |||
2545 | else | 2546 | else |
2546 | mask = apic->target_cpus(); | 2547 | mask = apic->target_cpus(); |
2547 | 2548 | ||
2548 | irq_set_affinity(irq, mask); | 2549 | chip = irq_data_get_irq_chip(idata); |
2550 | chip->irq_set_affinity(idata, mask, false); | ||
2549 | } | 2551 | } |
2550 | |||
2551 | } | 2552 | } |
2552 | #endif | 2553 | #endif |
2553 | 2554 | ||
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c index 1bbd0fe2c806..836d11b92811 100644 --- a/arch/x86/kernel/apic/vector.c +++ b/arch/x86/kernel/apic/vector.c | |||
@@ -489,10 +489,8 @@ static int apic_set_affinity(struct irq_data *irq_data, | |||
489 | 489 | ||
490 | err = assign_irq_vector(irq, data, dest); | 490 | err = assign_irq_vector(irq, data, dest); |
491 | if (err) { | 491 | if (err) { |
492 | struct irq_data *top = irq_get_irq_data(irq); | ||
493 | |||
494 | if (assign_irq_vector(irq, data, | 492 | if (assign_irq_vector(irq, data, |
495 | irq_data_get_affinity_mask(top))) | 493 | irq_data_get_affinity_mask(irq_data))) |
496 | pr_err("Failed to recover vector for irq %d\n", irq); | 494 | pr_err("Failed to recover vector for irq %d\n", irq); |
497 | return err; | 495 | return err; |
498 | } | 496 | } |
diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c index 07ce52c22ec8..de22ea7ff82f 100644 --- a/arch/x86/kernel/cpu/common.c +++ b/arch/x86/kernel/cpu/common.c | |||
@@ -1110,10 +1110,10 @@ void print_cpu_info(struct cpuinfo_x86 *c) | |||
1110 | else | 1110 | else |
1111 | printk(KERN_CONT "%d86", c->x86); | 1111 | printk(KERN_CONT "%d86", c->x86); |
1112 | 1112 | ||
1113 | printk(KERN_CONT " (fam: %02x, model: %02x", c->x86, c->x86_model); | 1113 | printk(KERN_CONT " (family: 0x%x, model: 0x%x", c->x86, c->x86_model); |
1114 | 1114 | ||
1115 | if (c->x86_mask || c->cpuid_level >= 0) | 1115 | if (c->x86_mask || c->cpuid_level >= 0) |
1116 | printk(KERN_CONT ", stepping: %02x)\n", c->x86_mask); | 1116 | printk(KERN_CONT ", stepping: 0x%x)\n", c->x86_mask); |
1117 | else | 1117 | else |
1118 | printk(KERN_CONT ")\n"); | 1118 | printk(KERN_CONT ")\n"); |
1119 | 1119 | ||
diff --git a/arch/x86/kernel/cpu/perf_event_intel.c b/arch/x86/kernel/cpu/perf_event_intel.c index cd9b6d0b10bf..3fefebfbdf4b 100644 --- a/arch/x86/kernel/cpu/perf_event_intel.c +++ b/arch/x86/kernel/cpu/perf_event_intel.c | |||
@@ -2316,9 +2316,12 @@ static struct event_constraint * | |||
2316 | intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx, | 2316 | intel_get_event_constraints(struct cpu_hw_events *cpuc, int idx, |
2317 | struct perf_event *event) | 2317 | struct perf_event *event) |
2318 | { | 2318 | { |
2319 | struct event_constraint *c1 = cpuc->event_constraint[idx]; | 2319 | struct event_constraint *c1 = NULL; |
2320 | struct event_constraint *c2; | 2320 | struct event_constraint *c2; |
2321 | 2321 | ||
2322 | if (idx >= 0) /* fake does < 0 */ | ||
2323 | c1 = cpuc->event_constraint[idx]; | ||
2324 | |||
2322 | /* | 2325 | /* |
2323 | * first time only | 2326 | * first time only |
2324 | * - static constraint: no change across incremental scheduling calls | 2327 | * - static constraint: no change across incremental scheduling calls |
diff --git a/arch/x86/kernel/cpu/perf_event_intel_bts.c b/arch/x86/kernel/cpu/perf_event_intel_bts.c index 54690e885759..d1c0f254afbe 100644 --- a/arch/x86/kernel/cpu/perf_event_intel_bts.c +++ b/arch/x86/kernel/cpu/perf_event_intel_bts.c | |||
@@ -222,6 +222,7 @@ static void __bts_event_start(struct perf_event *event) | |||
222 | if (!buf || bts_buffer_is_full(buf, bts)) | 222 | if (!buf || bts_buffer_is_full(buf, bts)) |
223 | return; | 223 | return; |
224 | 224 | ||
225 | event->hw.itrace_started = 1; | ||
225 | event->hw.state = 0; | 226 | event->hw.state = 0; |
226 | 227 | ||
227 | if (!buf->snapshot) | 228 | if (!buf->snapshot) |
diff --git a/arch/x86/kernel/irq_32.c b/arch/x86/kernel/irq_32.c index c80cf6699678..38da8f29a9c8 100644 --- a/arch/x86/kernel/irq_32.c +++ b/arch/x86/kernel/irq_32.c | |||
@@ -68,11 +68,10 @@ static inline void *current_stack(void) | |||
68 | return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); | 68 | return (void *)(current_stack_pointer() & ~(THREAD_SIZE - 1)); |
69 | } | 69 | } |
70 | 70 | ||
71 | static inline int | 71 | static inline int execute_on_irq_stack(int overflow, struct irq_desc *desc) |
72 | execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | ||
73 | { | 72 | { |
74 | struct irq_stack *curstk, *irqstk; | 73 | struct irq_stack *curstk, *irqstk; |
75 | u32 *isp, *prev_esp, arg1, arg2; | 74 | u32 *isp, *prev_esp, arg1; |
76 | 75 | ||
77 | curstk = (struct irq_stack *) current_stack(); | 76 | curstk = (struct irq_stack *) current_stack(); |
78 | irqstk = __this_cpu_read(hardirq_stack); | 77 | irqstk = __this_cpu_read(hardirq_stack); |
@@ -98,8 +97,8 @@ execute_on_irq_stack(int overflow, struct irq_desc *desc, int irq) | |||
98 | asm volatile("xchgl %%ebx,%%esp \n" | 97 | asm volatile("xchgl %%ebx,%%esp \n" |
99 | "call *%%edi \n" | 98 | "call *%%edi \n" |
100 | "movl %%ebx,%%esp \n" | 99 | "movl %%ebx,%%esp \n" |
101 | : "=a" (arg1), "=d" (arg2), "=b" (isp) | 100 | : "=a" (arg1), "=b" (isp) |
102 | : "0" (irq), "1" (desc), "2" (isp), | 101 | : "0" (desc), "1" (isp), |
103 | "D" (desc->handle_irq) | 102 | "D" (desc->handle_irq) |
104 | : "memory", "cc", "ecx"); | 103 | : "memory", "cc", "ecx"); |
105 | return 1; | 104 | return 1; |
@@ -150,19 +149,15 @@ void do_softirq_own_stack(void) | |||
150 | 149 | ||
151 | bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) | 150 | bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) |
152 | { | 151 | { |
153 | unsigned int irq; | 152 | int overflow = check_stack_overflow(); |
154 | int overflow; | ||
155 | |||
156 | overflow = check_stack_overflow(); | ||
157 | 153 | ||
158 | if (IS_ERR_OR_NULL(desc)) | 154 | if (IS_ERR_OR_NULL(desc)) |
159 | return false; | 155 | return false; |
160 | 156 | ||
161 | irq = irq_desc_get_irq(desc); | 157 | if (user_mode(regs) || !execute_on_irq_stack(overflow, desc)) { |
162 | if (user_mode(regs) || !execute_on_irq_stack(overflow, desc, irq)) { | ||
163 | if (unlikely(overflow)) | 158 | if (unlikely(overflow)) |
164 | print_stack_overflow(); | 159 | print_stack_overflow(); |
165 | generic_handle_irq_desc(irq, desc); | 160 | generic_handle_irq_desc(desc); |
166 | } | 161 | } |
167 | 162 | ||
168 | return true; | 163 | return true; |
diff --git a/arch/x86/kernel/irq_64.c b/arch/x86/kernel/irq_64.c index ff16ccb918f2..c767cf2bc80a 100644 --- a/arch/x86/kernel/irq_64.c +++ b/arch/x86/kernel/irq_64.c | |||
@@ -75,6 +75,6 @@ bool handle_irq(struct irq_desc *desc, struct pt_regs *regs) | |||
75 | if (unlikely(IS_ERR_OR_NULL(desc))) | 75 | if (unlikely(IS_ERR_OR_NULL(desc))) |
76 | return false; | 76 | return false; |
77 | 77 | ||
78 | generic_handle_irq_desc(irq_desc_get_irq(desc), desc); | 78 | generic_handle_irq_desc(desc); |
79 | return true; | 79 | return true; |
80 | } | 80 | } |
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index 2bcc0525f1c1..6acc9dd91f36 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c | |||
@@ -58,7 +58,7 @@ static struct ldt_struct *alloc_ldt_struct(int size) | |||
58 | if (alloc_size > PAGE_SIZE) | 58 | if (alloc_size > PAGE_SIZE) |
59 | new_ldt->entries = vzalloc(alloc_size); | 59 | new_ldt->entries = vzalloc(alloc_size); |
60 | else | 60 | else |
61 | new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL); | 61 | new_ldt->entries = (void *)get_zeroed_page(GFP_KERNEL); |
62 | 62 | ||
63 | if (!new_ldt->entries) { | 63 | if (!new_ldt->entries) { |
64 | kfree(new_ldt); | 64 | kfree(new_ldt); |
@@ -95,7 +95,7 @@ static void free_ldt_struct(struct ldt_struct *ldt) | |||
95 | if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE) | 95 | if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE) |
96 | vfree(ldt->entries); | 96 | vfree(ldt->entries); |
97 | else | 97 | else |
98 | kfree(ldt->entries); | 98 | free_page((unsigned long)ldt->entries); |
99 | kfree(ldt); | 99 | kfree(ldt); |
100 | } | 100 | } |
101 | 101 | ||
diff --git a/arch/x86/kernel/pci-dma.c b/arch/x86/kernel/pci-dma.c index 84b8ef82a159..1b55de1267cf 100644 --- a/arch/x86/kernel/pci-dma.c +++ b/arch/x86/kernel/pci-dma.c | |||
@@ -131,8 +131,8 @@ void dma_generic_free_coherent(struct device *dev, size_t size, void *vaddr, | |||
131 | 131 | ||
132 | bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp) | 132 | bool arch_dma_alloc_attrs(struct device **dev, gfp_t *gfp) |
133 | { | 133 | { |
134 | *gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp); | ||
135 | *gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); | 134 | *gfp &= ~(__GFP_DMA | __GFP_HIGHMEM | __GFP_DMA32); |
135 | *gfp = dma_alloc_coherent_gfp_flags(*dev, *gfp); | ||
136 | 136 | ||
137 | if (!*dev) | 137 | if (!*dev) |
138 | *dev = &x86_dma_fallback_dev; | 138 | *dev = &x86_dma_fallback_dev; |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index c8d52cb4cb6e..c3f7602cd038 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <asm/hypervisor.h> | 21 | #include <asm/hypervisor.h> |
22 | #include <asm/nmi.h> | 22 | #include <asm/nmi.h> |
23 | #include <asm/x86_init.h> | 23 | #include <asm/x86_init.h> |
24 | #include <asm/geode.h> | ||
24 | 25 | ||
25 | unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */ | 26 | unsigned int __read_mostly cpu_khz; /* TSC clocks / usec, not used here */ |
26 | EXPORT_SYMBOL(cpu_khz); | 27 | EXPORT_SYMBOL(cpu_khz); |
@@ -1013,15 +1014,17 @@ EXPORT_SYMBOL_GPL(mark_tsc_unstable); | |||
1013 | 1014 | ||
1014 | static void __init check_system_tsc_reliable(void) | 1015 | static void __init check_system_tsc_reliable(void) |
1015 | { | 1016 | { |
1016 | #ifdef CONFIG_MGEODE_LX | 1017 | #if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC) |
1017 | /* RTSC counts during suspend */ | 1018 | if (is_geode_lx()) { |
1019 | /* RTSC counts during suspend */ | ||
1018 | #define RTSC_SUSP 0x100 | 1020 | #define RTSC_SUSP 0x100 |
1019 | unsigned long res_low, res_high; | 1021 | unsigned long res_low, res_high; |
1020 | 1022 | ||
1021 | rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); | 1023 | rdmsr_safe(MSR_GEODE_BUSCONT_CONF0, &res_low, &res_high); |
1022 | /* Geode_LX - the OLPC CPU has a very reliable TSC */ | 1024 | /* Geode_LX - the OLPC CPU has a very reliable TSC */ |
1023 | if (res_low & RTSC_SUSP) | 1025 | if (res_low & RTSC_SUSP) |
1024 | tsc_clocksource_reliable = 1; | 1026 | tsc_clocksource_reliable = 1; |
1027 | } | ||
1025 | #endif | 1028 | #endif |
1026 | if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) | 1029 | if (boot_cpu_has(X86_FEATURE_TSC_RELIABLE)) |
1027 | tsc_clocksource_reliable = 1; | 1030 | tsc_clocksource_reliable = 1; |
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index abd8b856bd2b..524619351961 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c | |||
@@ -45,6 +45,7 @@ | |||
45 | #include <linux/audit.h> | 45 | #include <linux/audit.h> |
46 | #include <linux/stddef.h> | 46 | #include <linux/stddef.h> |
47 | #include <linux/slab.h> | 47 | #include <linux/slab.h> |
48 | #include <linux/security.h> | ||
48 | 49 | ||
49 | #include <asm/uaccess.h> | 50 | #include <asm/uaccess.h> |
50 | #include <asm/io.h> | 51 | #include <asm/io.h> |
@@ -232,6 +233,32 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus) | |||
232 | struct pt_regs *regs = current_pt_regs(); | 233 | struct pt_regs *regs = current_pt_regs(); |
233 | unsigned long err = 0; | 234 | unsigned long err = 0; |
234 | 235 | ||
236 | err = security_mmap_addr(0); | ||
237 | if (err) { | ||
238 | /* | ||
239 | * vm86 cannot virtualize the address space, so vm86 users | ||
240 | * need to manage the low 1MB themselves using mmap. Given | ||
241 | * that BIOS places important data in the first page, vm86 | ||
242 | * is essentially useless if mmap_min_addr != 0. DOSEMU, | ||
243 | * for example, won't even bother trying to use vm86 if it | ||
244 | * can't map a page at virtual address 0. | ||
245 | * | ||
246 | * To reduce the available kernel attack surface, simply | ||
247 | * disallow vm86(old) for users who cannot mmap at va 0. | ||
248 | * | ||
249 | * The implementation of security_mmap_addr will allow | ||
250 | * suitably privileged users to map va 0 even if | ||
251 | * vm.mmap_min_addr is set above 0, and we want this | ||
252 | * behavior for vm86 as well, as it ensures that legacy | ||
253 | * tools like vbetool will not fail just because of | ||
254 | * vm.mmap_min_addr. | ||
255 | */ | ||
256 | pr_info_once("Denied a call to vm86(old) from %s[%d] (uid: %d). Set the vm.mmap_min_addr sysctl to 0 and/or adjust LSM mmap_min_addr policy to enable vm86 if you are using a vm86-based DOS emulator.\n", | ||
257 | current->comm, task_pid_nr(current), | ||
258 | from_kuid_munged(&init_user_ns, current_uid())); | ||
259 | return -EPERM; | ||
260 | } | ||
261 | |||
235 | if (!vm86) { | 262 | if (!vm86) { |
236 | if (!(vm86 = kzalloc(sizeof(*vm86), GFP_KERNEL))) | 263 | if (!(vm86 = kzalloc(sizeof(*vm86), GFP_KERNEL))) |
237 | return -ENOMEM; | 264 | return -ENOMEM; |
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d01986832afc..64076740251e 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c | |||
@@ -6064,6 +6064,8 @@ static __init int hardware_setup(void) | |||
6064 | memcpy(vmx_msr_bitmap_longmode_x2apic, | 6064 | memcpy(vmx_msr_bitmap_longmode_x2apic, |
6065 | vmx_msr_bitmap_longmode, PAGE_SIZE); | 6065 | vmx_msr_bitmap_longmode, PAGE_SIZE); |
6066 | 6066 | ||
6067 | set_bit(0, vmx_vpid_bitmap); /* 0 is reserved for host */ | ||
6068 | |||
6067 | if (enable_apicv) { | 6069 | if (enable_apicv) { |
6068 | for (msr = 0x800; msr <= 0x8ff; msr++) | 6070 | for (msr = 0x800; msr <= 0x8ff; msr++) |
6069 | vmx_disable_intercept_msr_read_x2apic(msr); | 6071 | vmx_disable_intercept_msr_read_x2apic(msr); |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index a60bdbccff51..6bbb0dfb99d0 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -149,6 +149,7 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
149 | { "nmi_window", VCPU_STAT(nmi_window_exits) }, | 149 | { "nmi_window", VCPU_STAT(nmi_window_exits) }, |
150 | { "halt_exits", VCPU_STAT(halt_exits) }, | 150 | { "halt_exits", VCPU_STAT(halt_exits) }, |
151 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, | 151 | { "halt_successful_poll", VCPU_STAT(halt_successful_poll) }, |
152 | { "halt_attempted_poll", VCPU_STAT(halt_attempted_poll) }, | ||
152 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, | 153 | { "halt_wakeup", VCPU_STAT(halt_wakeup) }, |
153 | { "hypercalls", VCPU_STAT(hypercalls) }, | 154 | { "hypercalls", VCPU_STAT(hypercalls) }, |
154 | { "request_irq", VCPU_STAT(request_irq_exits) }, | 155 | { "request_irq", VCPU_STAT(request_irq_exits) }, |
diff --git a/arch/x86/lguest/boot.c b/arch/x86/lguest/boot.c index 161804de124a..a0d09f6c6533 100644 --- a/arch/x86/lguest/boot.c +++ b/arch/x86/lguest/boot.c | |||
@@ -1015,7 +1015,7 @@ static struct clock_event_device lguest_clockevent = { | |||
1015 | * This is the Guest timer interrupt handler (hardware interrupt 0). We just | 1015 | * This is the Guest timer interrupt handler (hardware interrupt 0). We just |
1016 | * call the clockevent infrastructure and it does whatever needs doing. | 1016 | * call the clockevent infrastructure and it does whatever needs doing. |
1017 | */ | 1017 | */ |
1018 | static void lguest_time_irq(unsigned int irq, struct irq_desc *desc) | 1018 | static void lguest_time_irq(struct irq_desc *desc) |
1019 | { | 1019 | { |
1020 | unsigned long flags; | 1020 | unsigned long flags; |
1021 | 1021 | ||
diff --git a/arch/x86/mm/srat.c b/arch/x86/mm/srat.c index 66338a60aa6e..c2aea63bee20 100644 --- a/arch/x86/mm/srat.c +++ b/arch/x86/mm/srat.c | |||
@@ -192,10 +192,11 @@ acpi_numa_memory_affinity_init(struct acpi_srat_mem_affinity *ma) | |||
192 | 192 | ||
193 | node_set(node, numa_nodes_parsed); | 193 | node_set(node, numa_nodes_parsed); |
194 | 194 | ||
195 | pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s\n", | 195 | pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n", |
196 | node, pxm, | 196 | node, pxm, |
197 | (unsigned long long) start, (unsigned long long) end - 1, | 197 | (unsigned long long) start, (unsigned long long) end - 1, |
198 | hotpluggable ? " hotplug" : ""); | 198 | hotpluggable ? " hotplug" : "", |
199 | ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : ""); | ||
199 | 200 | ||
200 | /* Mark hotplug range in memblock. */ | 201 | /* Mark hotplug range in memblock. */ |
201 | if (hotpluggable && memblock_mark_hotplug(start, ma->length)) | 202 | if (hotpluggable && memblock_mark_hotplug(start, ma->length)) |
diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 4aecca79374a..14b8faf8b09d 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c | |||
@@ -140,6 +140,11 @@ int bio_integrity_add_page(struct bio *bio, struct page *page, | |||
140 | 140 | ||
141 | iv = bip->bip_vec + bip->bip_vcnt; | 141 | iv = bip->bip_vec + bip->bip_vcnt; |
142 | 142 | ||
143 | if (bip->bip_vcnt && | ||
144 | bvec_gap_to_prev(bdev_get_queue(bio->bi_bdev), | ||
145 | &bip->bip_vec[bip->bip_vcnt - 1], offset)) | ||
146 | return 0; | ||
147 | |||
143 | iv->bv_page = page; | 148 | iv->bv_page = page; |
144 | iv->bv_len = len; | 149 | iv->bv_len = len; |
145 | iv->bv_offset = offset; | 150 | iv->bv_offset = offset; |
diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c index ac8370cb2515..55512dd62633 100644 --- a/block/blk-cgroup.c +++ b/block/blk-cgroup.c | |||
@@ -370,6 +370,9 @@ static void blkg_destroy_all(struct request_queue *q) | |||
370 | blkg_destroy(blkg); | 370 | blkg_destroy(blkg); |
371 | spin_unlock(&blkcg->lock); | 371 | spin_unlock(&blkcg->lock); |
372 | } | 372 | } |
373 | |||
374 | q->root_blkg = NULL; | ||
375 | q->root_rl.blkg = NULL; | ||
373 | } | 376 | } |
374 | 377 | ||
375 | /* | 378 | /* |
diff --git a/block/blk-integrity.c b/block/blk-integrity.c index f548b64be092..75f29cf70188 100644 --- a/block/blk-integrity.c +++ b/block/blk-integrity.c | |||
@@ -204,6 +204,9 @@ bool blk_integrity_merge_rq(struct request_queue *q, struct request *req, | |||
204 | q->limits.max_integrity_segments) | 204 | q->limits.max_integrity_segments) |
205 | return false; | 205 | return false; |
206 | 206 | ||
207 | if (integrity_req_gap_back_merge(req, next->bio)) | ||
208 | return false; | ||
209 | |||
207 | return true; | 210 | return true; |
208 | } | 211 | } |
209 | EXPORT_SYMBOL(blk_integrity_merge_rq); | 212 | EXPORT_SYMBOL(blk_integrity_merge_rq); |
diff --git a/block/blk-map.c b/block/blk-map.c index 233841644c9d..f565e11f465a 100644 --- a/block/blk-map.c +++ b/block/blk-map.c | |||
@@ -9,6 +9,24 @@ | |||
9 | 9 | ||
10 | #include "blk.h" | 10 | #include "blk.h" |
11 | 11 | ||
12 | static bool iovec_gap_to_prv(struct request_queue *q, | ||
13 | struct iovec *prv, struct iovec *cur) | ||
14 | { | ||
15 | unsigned long prev_end; | ||
16 | |||
17 | if (!queue_virt_boundary(q)) | ||
18 | return false; | ||
19 | |||
20 | if (prv->iov_base == NULL && prv->iov_len == 0) | ||
21 | /* prv is not set - don't check */ | ||
22 | return false; | ||
23 | |||
24 | prev_end = (unsigned long)(prv->iov_base + prv->iov_len); | ||
25 | |||
26 | return (((unsigned long)cur->iov_base & queue_virt_boundary(q)) || | ||
27 | prev_end & queue_virt_boundary(q)); | ||
28 | } | ||
29 | |||
12 | int blk_rq_append_bio(struct request_queue *q, struct request *rq, | 30 | int blk_rq_append_bio(struct request_queue *q, struct request *rq, |
13 | struct bio *bio) | 31 | struct bio *bio) |
14 | { | 32 | { |
@@ -67,7 +85,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
67 | struct bio *bio; | 85 | struct bio *bio; |
68 | int unaligned = 0; | 86 | int unaligned = 0; |
69 | struct iov_iter i; | 87 | struct iov_iter i; |
70 | struct iovec iov; | 88 | struct iovec iov, prv = {.iov_base = NULL, .iov_len = 0}; |
71 | 89 | ||
72 | if (!iter || !iter->count) | 90 | if (!iter || !iter->count) |
73 | return -EINVAL; | 91 | return -EINVAL; |
@@ -81,8 +99,12 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq, | |||
81 | /* | 99 | /* |
82 | * Keep going so we check length of all segments | 100 | * Keep going so we check length of all segments |
83 | */ | 101 | */ |
84 | if (uaddr & queue_dma_alignment(q)) | 102 | if ((uaddr & queue_dma_alignment(q)) || |
103 | iovec_gap_to_prv(q, &prv, &iov)) | ||
85 | unaligned = 1; | 104 | unaligned = 1; |
105 | |||
106 | prv.iov_base = iov.iov_base; | ||
107 | prv.iov_len = iov.iov_len; | ||
86 | } | 108 | } |
87 | 109 | ||
88 | if (unaligned || (q->dma_pad_mask & iter->count) || map_data) | 110 | if (unaligned || (q->dma_pad_mask & iter->count) || map_data) |
diff --git a/block/blk-merge.c b/block/blk-merge.c index d088cffb8105..c4e9c37f3e38 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c | |||
@@ -66,36 +66,33 @@ static struct bio *blk_bio_segment_split(struct request_queue *q, | |||
66 | struct bio *bio, | 66 | struct bio *bio, |
67 | struct bio_set *bs) | 67 | struct bio_set *bs) |
68 | { | 68 | { |
69 | struct bio *split; | 69 | struct bio_vec bv, bvprv, *bvprvp = NULL; |
70 | struct bio_vec bv, bvprv; | ||
71 | struct bvec_iter iter; | 70 | struct bvec_iter iter; |
72 | unsigned seg_size = 0, nsegs = 0, sectors = 0; | 71 | unsigned seg_size = 0, nsegs = 0, sectors = 0; |
73 | int prev = 0; | ||
74 | 72 | ||
75 | bio_for_each_segment(bv, bio, iter) { | 73 | bio_for_each_segment(bv, bio, iter) { |
76 | sectors += bv.bv_len >> 9; | 74 | if (sectors + (bv.bv_len >> 9) > queue_max_sectors(q)) |
77 | |||
78 | if (sectors > queue_max_sectors(q)) | ||
79 | goto split; | 75 | goto split; |
80 | 76 | ||
81 | /* | 77 | /* |
82 | * If the queue doesn't support SG gaps and adding this | 78 | * If the queue doesn't support SG gaps and adding this |
83 | * offset would create a gap, disallow it. | 79 | * offset would create a gap, disallow it. |
84 | */ | 80 | */ |
85 | if (prev && bvec_gap_to_prev(q, &bvprv, bv.bv_offset)) | 81 | if (bvprvp && bvec_gap_to_prev(q, bvprvp, bv.bv_offset)) |
86 | goto split; | 82 | goto split; |
87 | 83 | ||
88 | if (prev && blk_queue_cluster(q)) { | 84 | if (bvprvp && blk_queue_cluster(q)) { |
89 | if (seg_size + bv.bv_len > queue_max_segment_size(q)) | 85 | if (seg_size + bv.bv_len > queue_max_segment_size(q)) |
90 | goto new_segment; | 86 | goto new_segment; |
91 | if (!BIOVEC_PHYS_MERGEABLE(&bvprv, &bv)) | 87 | if (!BIOVEC_PHYS_MERGEABLE(bvprvp, &bv)) |
92 | goto new_segment; | 88 | goto new_segment; |
93 | if (!BIOVEC_SEG_BOUNDARY(q, &bvprv, &bv)) | 89 | if (!BIOVEC_SEG_BOUNDARY(q, bvprvp, &bv)) |
94 | goto new_segment; | 90 | goto new_segment; |
95 | 91 | ||
96 | seg_size += bv.bv_len; | 92 | seg_size += bv.bv_len; |
97 | bvprv = bv; | 93 | bvprv = bv; |
98 | prev = 1; | 94 | bvprvp = &bv; |
95 | sectors += bv.bv_len >> 9; | ||
99 | continue; | 96 | continue; |
100 | } | 97 | } |
101 | new_segment: | 98 | new_segment: |
@@ -104,23 +101,14 @@ new_segment: | |||
104 | 101 | ||
105 | nsegs++; | 102 | nsegs++; |
106 | bvprv = bv; | 103 | bvprv = bv; |
107 | prev = 1; | 104 | bvprvp = &bv; |
108 | seg_size = bv.bv_len; | 105 | seg_size = bv.bv_len; |
106 | sectors += bv.bv_len >> 9; | ||
109 | } | 107 | } |
110 | 108 | ||
111 | return NULL; | 109 | return NULL; |
112 | split: | 110 | split: |
113 | split = bio_clone_bioset(bio, GFP_NOIO, bs); | 111 | return bio_split(bio, sectors, GFP_NOIO, bs); |
114 | |||
115 | split->bi_iter.bi_size -= iter.bi_size; | ||
116 | bio->bi_iter = iter; | ||
117 | |||
118 | if (bio_integrity(bio)) { | ||
119 | bio_integrity_advance(bio, split->bi_iter.bi_size); | ||
120 | bio_integrity_trim(split, 0, bio_sectors(split)); | ||
121 | } | ||
122 | |||
123 | return split; | ||
124 | } | 112 | } |
125 | 113 | ||
126 | void blk_queue_split(struct request_queue *q, struct bio **bio, | 114 | void blk_queue_split(struct request_queue *q, struct bio **bio, |
@@ -439,6 +427,11 @@ no_merge: | |||
439 | int ll_back_merge_fn(struct request_queue *q, struct request *req, | 427 | int ll_back_merge_fn(struct request_queue *q, struct request *req, |
440 | struct bio *bio) | 428 | struct bio *bio) |
441 | { | 429 | { |
430 | if (req_gap_back_merge(req, bio)) | ||
431 | return 0; | ||
432 | if (blk_integrity_rq(req) && | ||
433 | integrity_req_gap_back_merge(req, bio)) | ||
434 | return 0; | ||
442 | if (blk_rq_sectors(req) + bio_sectors(bio) > | 435 | if (blk_rq_sectors(req) + bio_sectors(bio) > |
443 | blk_rq_get_max_sectors(req)) { | 436 | blk_rq_get_max_sectors(req)) { |
444 | req->cmd_flags |= REQ_NOMERGE; | 437 | req->cmd_flags |= REQ_NOMERGE; |
@@ -457,6 +450,12 @@ int ll_back_merge_fn(struct request_queue *q, struct request *req, | |||
457 | int ll_front_merge_fn(struct request_queue *q, struct request *req, | 450 | int ll_front_merge_fn(struct request_queue *q, struct request *req, |
458 | struct bio *bio) | 451 | struct bio *bio) |
459 | { | 452 | { |
453 | |||
454 | if (req_gap_front_merge(req, bio)) | ||
455 | return 0; | ||
456 | if (blk_integrity_rq(req) && | ||
457 | integrity_req_gap_front_merge(req, bio)) | ||
458 | return 0; | ||
460 | if (blk_rq_sectors(req) + bio_sectors(bio) > | 459 | if (blk_rq_sectors(req) + bio_sectors(bio) > |
461 | blk_rq_get_max_sectors(req)) { | 460 | blk_rq_get_max_sectors(req)) { |
462 | req->cmd_flags |= REQ_NOMERGE; | 461 | req->cmd_flags |= REQ_NOMERGE; |
@@ -483,14 +482,6 @@ static bool req_no_special_merge(struct request *req) | |||
483 | return !q->mq_ops && req->special; | 482 | return !q->mq_ops && req->special; |
484 | } | 483 | } |
485 | 484 | ||
486 | static int req_gap_to_prev(struct request *req, struct bio *next) | ||
487 | { | ||
488 | struct bio *prev = req->biotail; | ||
489 | |||
490 | return bvec_gap_to_prev(req->q, &prev->bi_io_vec[prev->bi_vcnt - 1], | ||
491 | next->bi_io_vec[0].bv_offset); | ||
492 | } | ||
493 | |||
494 | static int ll_merge_requests_fn(struct request_queue *q, struct request *req, | 485 | static int ll_merge_requests_fn(struct request_queue *q, struct request *req, |
495 | struct request *next) | 486 | struct request *next) |
496 | { | 487 | { |
@@ -505,7 +496,7 @@ static int ll_merge_requests_fn(struct request_queue *q, struct request *req, | |||
505 | if (req_no_special_merge(req) || req_no_special_merge(next)) | 496 | if (req_no_special_merge(req) || req_no_special_merge(next)) |
506 | return 0; | 497 | return 0; |
507 | 498 | ||
508 | if (req_gap_to_prev(req, next->bio)) | 499 | if (req_gap_back_merge(req, next->bio)) |
509 | return 0; | 500 | return 0; |
510 | 501 | ||
511 | /* | 502 | /* |
@@ -713,10 +704,6 @@ bool blk_rq_merge_ok(struct request *rq, struct bio *bio) | |||
713 | !blk_write_same_mergeable(rq->bio, bio)) | 704 | !blk_write_same_mergeable(rq->bio, bio)) |
714 | return false; | 705 | return false; |
715 | 706 | ||
716 | /* Only check gaps if the bio carries data */ | ||
717 | if (bio_has_data(bio) && req_gap_to_prev(rq, bio)) | ||
718 | return false; | ||
719 | |||
720 | return true; | 707 | return true; |
721 | } | 708 | } |
722 | 709 | ||
diff --git a/block/bounce.c b/block/bounce.c index 0611aea1cfe9..1cb5dd3a5da1 100644 --- a/block/bounce.c +++ b/block/bounce.c | |||
@@ -128,12 +128,14 @@ static void bounce_end_io(struct bio *bio, mempool_t *pool) | |||
128 | struct bio *bio_orig = bio->bi_private; | 128 | struct bio *bio_orig = bio->bi_private; |
129 | struct bio_vec *bvec, *org_vec; | 129 | struct bio_vec *bvec, *org_vec; |
130 | int i; | 130 | int i; |
131 | int start = bio_orig->bi_iter.bi_idx; | ||
131 | 132 | ||
132 | /* | 133 | /* |
133 | * free up bounce indirect pages used | 134 | * free up bounce indirect pages used |
134 | */ | 135 | */ |
135 | bio_for_each_segment_all(bvec, bio, i) { | 136 | bio_for_each_segment_all(bvec, bio, i) { |
136 | org_vec = bio_orig->bi_io_vec + i; | 137 | org_vec = bio_orig->bi_io_vec + i + start; |
138 | |||
137 | if (bvec->bv_page == org_vec->bv_page) | 139 | if (bvec->bv_page == org_vec->bv_page) |
138 | continue; | 140 | continue; |
139 | 141 | ||
diff --git a/crypto/testmgr.c b/crypto/testmgr.c index 35c2de136971..fa18753f5c34 100644 --- a/crypto/testmgr.c +++ b/crypto/testmgr.c | |||
@@ -940,6 +940,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
940 | char *xbuf[XBUFSIZE]; | 940 | char *xbuf[XBUFSIZE]; |
941 | char *xoutbuf[XBUFSIZE]; | 941 | char *xoutbuf[XBUFSIZE]; |
942 | int ret = -ENOMEM; | 942 | int ret = -ENOMEM; |
943 | unsigned int ivsize = crypto_skcipher_ivsize(tfm); | ||
943 | 944 | ||
944 | if (testmgr_alloc_buf(xbuf)) | 945 | if (testmgr_alloc_buf(xbuf)) |
945 | goto out_nobuf; | 946 | goto out_nobuf; |
@@ -975,7 +976,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
975 | continue; | 976 | continue; |
976 | 977 | ||
977 | if (template[i].iv) | 978 | if (template[i].iv) |
978 | memcpy(iv, template[i].iv, MAX_IVLEN); | 979 | memcpy(iv, template[i].iv, ivsize); |
979 | else | 980 | else |
980 | memset(iv, 0, MAX_IVLEN); | 981 | memset(iv, 0, MAX_IVLEN); |
981 | 982 | ||
@@ -1051,7 +1052,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc, | |||
1051 | continue; | 1052 | continue; |
1052 | 1053 | ||
1053 | if (template[i].iv) | 1054 | if (template[i].iv) |
1054 | memcpy(iv, template[i].iv, MAX_IVLEN); | 1055 | memcpy(iv, template[i].iv, ivsize); |
1055 | else | 1056 | else |
1056 | memset(iv, 0, MAX_IVLEN); | 1057 | memset(iv, 0, MAX_IVLEN); |
1057 | 1058 | ||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 46506e7687cd..a212cefae524 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
@@ -315,14 +315,10 @@ static void acpi_bus_osc_support(void) | |||
315 | 315 | ||
316 | capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE; | 316 | capbuf[OSC_QUERY_DWORD] = OSC_QUERY_ENABLE; |
317 | capbuf[OSC_SUPPORT_DWORD] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */ | 317 | capbuf[OSC_SUPPORT_DWORD] = OSC_SB_PR3_SUPPORT; /* _PR3 is in use */ |
318 | #if defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR) ||\ | 318 | if (IS_ENABLED(CONFIG_ACPI_PROCESSOR_AGGREGATOR)) |
319 | defined(CONFIG_ACPI_PROCESSOR_AGGREGATOR_MODULE) | 319 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT; |
320 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PAD_SUPPORT; | 320 | if (IS_ENABLED(CONFIG_ACPI_PROCESSOR)) |
321 | #endif | 321 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT; |
322 | |||
323 | #if defined(CONFIG_ACPI_PROCESSOR) || defined(CONFIG_ACPI_PROCESSOR_MODULE) | ||
324 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_PPC_OST_SUPPORT; | ||
325 | #endif | ||
326 | 322 | ||
327 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT; | 323 | capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_HOTPLUG_OST_SUPPORT; |
328 | 324 | ||
diff --git a/drivers/acpi/int340x_thermal.c b/drivers/acpi/int340x_thermal.c index 9dcf83682e36..33505c651f62 100644 --- a/drivers/acpi/int340x_thermal.c +++ b/drivers/acpi/int340x_thermal.c | |||
@@ -33,13 +33,12 @@ static const struct acpi_device_id int340x_thermal_device_ids[] = { | |||
33 | static int int340x_thermal_handler_attach(struct acpi_device *adev, | 33 | static int int340x_thermal_handler_attach(struct acpi_device *adev, |
34 | const struct acpi_device_id *id) | 34 | const struct acpi_device_id *id) |
35 | { | 35 | { |
36 | #if defined(CONFIG_INT340X_THERMAL) || defined(CONFIG_INT340X_THERMAL_MODULE) | 36 | if (IS_ENABLED(CONFIG_INT340X_THERMAL)) |
37 | acpi_create_platform_device(adev); | 37 | acpi_create_platform_device(adev); |
38 | #elif defined(INTEL_SOC_DTS_THERMAL) || defined(INTEL_SOC_DTS_THERMAL_MODULE) | ||
39 | /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */ | 38 | /* Intel SoC DTS thermal driver needs INT3401 to set IRQ descriptor */ |
40 | if (id->driver_data == INT3401_DEVICE) | 39 | else if (IS_ENABLED(CONFIG_INTEL_SOC_DTS_THERMAL) && |
40 | id->driver_data == INT3401_DEVICE) | ||
41 | acpi_create_platform_device(adev); | 41 | acpi_create_platform_device(adev); |
42 | #endif | ||
43 | return 1; | 42 | return 1; |
44 | } | 43 | } |
45 | 44 | ||
diff --git a/drivers/base/platform-msi.c b/drivers/base/platform-msi.c index 1857a5dd0816..134483daac25 100644 --- a/drivers/base/platform-msi.c +++ b/drivers/base/platform-msi.c | |||
@@ -63,20 +63,8 @@ static int platform_msi_init(struct irq_domain *domain, | |||
63 | unsigned int virq, irq_hw_number_t hwirq, | 63 | unsigned int virq, irq_hw_number_t hwirq, |
64 | msi_alloc_info_t *arg) | 64 | msi_alloc_info_t *arg) |
65 | { | 65 | { |
66 | struct irq_data *data; | 66 | return irq_domain_set_hwirq_and_chip(domain, virq, hwirq, |
67 | 67 | info->chip, info->chip_data); | |
68 | irq_domain_set_hwirq_and_chip(domain, virq, hwirq, | ||
69 | info->chip, info->chip_data); | ||
70 | |||
71 | /* | ||
72 | * Save the MSI descriptor in handler_data so that the | ||
73 | * irq_write_msi_msg callback can retrieve it (and the | ||
74 | * associated device). | ||
75 | */ | ||
76 | data = irq_domain_get_irq_data(domain, virq); | ||
77 | data->handler_data = arg->desc; | ||
78 | |||
79 | return 0; | ||
80 | } | 68 | } |
81 | #else | 69 | #else |
82 | #define platform_msi_set_desc NULL | 70 | #define platform_msi_set_desc NULL |
@@ -97,7 +85,7 @@ static void platform_msi_update_dom_ops(struct msi_domain_info *info) | |||
97 | 85 | ||
98 | static void platform_msi_write_msg(struct irq_data *data, struct msi_msg *msg) | 86 | static void platform_msi_write_msg(struct irq_data *data, struct msi_msg *msg) |
99 | { | 87 | { |
100 | struct msi_desc *desc = irq_data_get_irq_handler_data(data); | 88 | struct msi_desc *desc = irq_data_get_msi_desc(data); |
101 | struct platform_msi_priv_data *priv_data; | 89 | struct platform_msi_priv_data *priv_data; |
102 | 90 | ||
103 | priv_data = desc->platform.msi_priv_data; | 91 | priv_data = desc->platform.msi_priv_data; |
diff --git a/drivers/block/null_blk.c b/drivers/block/null_blk.c index 17269a3b85f2..a295b98c6bae 100644 --- a/drivers/block/null_blk.c +++ b/drivers/block/null_blk.c | |||
@@ -406,6 +406,22 @@ static struct blk_mq_ops null_mq_ops = { | |||
406 | .complete = null_softirq_done_fn, | 406 | .complete = null_softirq_done_fn, |
407 | }; | 407 | }; |
408 | 408 | ||
409 | static void cleanup_queue(struct nullb_queue *nq) | ||
410 | { | ||
411 | kfree(nq->tag_map); | ||
412 | kfree(nq->cmds); | ||
413 | } | ||
414 | |||
415 | static void cleanup_queues(struct nullb *nullb) | ||
416 | { | ||
417 | int i; | ||
418 | |||
419 | for (i = 0; i < nullb->nr_queues; i++) | ||
420 | cleanup_queue(&nullb->queues[i]); | ||
421 | |||
422 | kfree(nullb->queues); | ||
423 | } | ||
424 | |||
409 | static void null_del_dev(struct nullb *nullb) | 425 | static void null_del_dev(struct nullb *nullb) |
410 | { | 426 | { |
411 | list_del_init(&nullb->list); | 427 | list_del_init(&nullb->list); |
@@ -415,6 +431,7 @@ static void null_del_dev(struct nullb *nullb) | |||
415 | if (queue_mode == NULL_Q_MQ) | 431 | if (queue_mode == NULL_Q_MQ) |
416 | blk_mq_free_tag_set(&nullb->tag_set); | 432 | blk_mq_free_tag_set(&nullb->tag_set); |
417 | put_disk(nullb->disk); | 433 | put_disk(nullb->disk); |
434 | cleanup_queues(nullb); | ||
418 | kfree(nullb); | 435 | kfree(nullb); |
419 | } | 436 | } |
420 | 437 | ||
@@ -459,22 +476,6 @@ static int setup_commands(struct nullb_queue *nq) | |||
459 | return 0; | 476 | return 0; |
460 | } | 477 | } |
461 | 478 | ||
462 | static void cleanup_queue(struct nullb_queue *nq) | ||
463 | { | ||
464 | kfree(nq->tag_map); | ||
465 | kfree(nq->cmds); | ||
466 | } | ||
467 | |||
468 | static void cleanup_queues(struct nullb *nullb) | ||
469 | { | ||
470 | int i; | ||
471 | |||
472 | for (i = 0; i < nullb->nr_queues; i++) | ||
473 | cleanup_queue(&nullb->queues[i]); | ||
474 | |||
475 | kfree(nullb->queues); | ||
476 | } | ||
477 | |||
478 | static int setup_queues(struct nullb *nullb) | 479 | static int setup_queues(struct nullb *nullb) |
479 | { | 480 | { |
480 | nullb->queues = kzalloc(submit_queues * sizeof(struct nullb_queue), | 481 | nullb->queues = kzalloc(submit_queues * sizeof(struct nullb_queue), |
@@ -588,8 +589,7 @@ static int null_add_dev(void) | |||
588 | blk_queue_physical_block_size(nullb->q, bs); | 589 | blk_queue_physical_block_size(nullb->q, bs); |
589 | 590 | ||
590 | size = gb * 1024 * 1024 * 1024ULL; | 591 | size = gb * 1024 * 1024 * 1024ULL; |
591 | sector_div(size, bs); | 592 | set_capacity(disk, size >> 9); |
592 | set_capacity(disk, size); | ||
593 | 593 | ||
594 | disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO; | 594 | disk->flags |= GENHD_FL_EXT_DEVT | GENHD_FL_SUPPRESS_PARTITION_INFO; |
595 | disk->major = null_major; | 595 | disk->major = null_major; |
diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c index 965d1afb0eaa..5cb13ca3a3ac 100644 --- a/drivers/block/zram/zcomp.c +++ b/drivers/block/zram/zcomp.c | |||
@@ -330,12 +330,14 @@ void zcomp_destroy(struct zcomp *comp) | |||
330 | * allocate new zcomp and initialize it. return compressing | 330 | * allocate new zcomp and initialize it. return compressing |
331 | * backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL) | 331 | * backend pointer or ERR_PTR if things went bad. ERR_PTR(-EINVAL) |
332 | * if requested algorithm is not supported, ERR_PTR(-ENOMEM) in | 332 | * if requested algorithm is not supported, ERR_PTR(-ENOMEM) in |
333 | * case of allocation error. | 333 | * case of allocation error, or any other error potentially |
334 | * returned by functions zcomp_strm_{multi,single}_create. | ||
334 | */ | 335 | */ |
335 | struct zcomp *zcomp_create(const char *compress, int max_strm) | 336 | struct zcomp *zcomp_create(const char *compress, int max_strm) |
336 | { | 337 | { |
337 | struct zcomp *comp; | 338 | struct zcomp *comp; |
338 | struct zcomp_backend *backend; | 339 | struct zcomp_backend *backend; |
340 | int error; | ||
339 | 341 | ||
340 | backend = find_backend(compress); | 342 | backend = find_backend(compress); |
341 | if (!backend) | 343 | if (!backend) |
@@ -347,12 +349,12 @@ struct zcomp *zcomp_create(const char *compress, int max_strm) | |||
347 | 349 | ||
348 | comp->backend = backend; | 350 | comp->backend = backend; |
349 | if (max_strm > 1) | 351 | if (max_strm > 1) |
350 | zcomp_strm_multi_create(comp, max_strm); | 352 | error = zcomp_strm_multi_create(comp, max_strm); |
351 | else | 353 | else |
352 | zcomp_strm_single_create(comp); | 354 | error = zcomp_strm_single_create(comp); |
353 | if (!comp->stream) { | 355 | if (error) { |
354 | kfree(comp); | 356 | kfree(comp); |
355 | return ERR_PTR(-ENOMEM); | 357 | return ERR_PTR(error); |
356 | } | 358 | } |
357 | return comp; | 359 | return comp; |
358 | } | 360 | } |
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 43e2c3ad6c31..0ebcf449778a 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -2437,7 +2437,8 @@ static int __clk_init(struct device *dev, struct clk *clk_user) | |||
2437 | hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) { | 2437 | hlist_for_each_entry_safe(orphan, tmp2, &clk_orphan_list, child_node) { |
2438 | if (orphan->num_parents && orphan->ops->get_parent) { | 2438 | if (orphan->num_parents && orphan->ops->get_parent) { |
2439 | i = orphan->ops->get_parent(orphan->hw); | 2439 | i = orphan->ops->get_parent(orphan->hw); |
2440 | if (!strcmp(core->name, orphan->parent_names[i])) | 2440 | if (i >= 0 && i < orphan->num_parents && |
2441 | !strcmp(core->name, orphan->parent_names[i])) | ||
2441 | clk_core_reparent(orphan, core); | 2442 | clk_core_reparent(orphan, core); |
2442 | continue; | 2443 | continue; |
2443 | } | 2444 | } |
diff --git a/drivers/clk/h8300/clk-h8s2678.c b/drivers/clk/h8300/clk-h8s2678.c index 2a38eb4a2552..6cf38dc1c929 100644 --- a/drivers/clk/h8300/clk-h8s2678.c +++ b/drivers/clk/h8300/clk-h8s2678.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/err.h> | 8 | #include <linux/err.h> |
9 | #include <linux/device.h> | 9 | #include <linux/device.h> |
10 | #include <linux/of_address.h> | 10 | #include <linux/of_address.h> |
11 | #include <linux/slab.h> | ||
11 | 12 | ||
12 | static DEFINE_SPINLOCK(clklock); | 13 | static DEFINE_SPINLOCK(clklock); |
13 | 14 | ||
diff --git a/drivers/clk/hisilicon/Kconfig b/drivers/clk/hisilicon/Kconfig index 2c16807341dc..e43485448612 100644 --- a/drivers/clk/hisilicon/Kconfig +++ b/drivers/clk/hisilicon/Kconfig | |||
@@ -1,6 +1,12 @@ | |||
1 | config COMMON_CLK_HI6220 | 1 | config COMMON_CLK_HI6220 |
2 | bool "Hi6220 Clock Driver" | 2 | bool "Hi6220 Clock Driver" |
3 | depends on (ARCH_HISI || COMPILE_TEST) && MAILBOX | 3 | depends on ARCH_HISI || COMPILE_TEST |
4 | default ARCH_HISI | 4 | default ARCH_HISI |
5 | help | 5 | help |
6 | Build the Hisilicon Hi6220 clock driver based on the common clock framework. | 6 | Build the Hisilicon Hi6220 clock driver based on the common clock framework. |
7 | |||
8 | config STUB_CLK_HI6220 | ||
9 | bool "Hi6220 Stub Clock Driver" | ||
10 | depends on COMMON_CLK_HI6220 && MAILBOX | ||
11 | help | ||
12 | Build the Hisilicon Hi6220 stub clock driver. | ||
diff --git a/drivers/clk/hisilicon/Makefile b/drivers/clk/hisilicon/Makefile index 4a1001a11f04..74dba31590f9 100644 --- a/drivers/clk/hisilicon/Makefile +++ b/drivers/clk/hisilicon/Makefile | |||
@@ -7,4 +7,5 @@ obj-y += clk.o clkgate-separated.o clkdivider-hi6220.o | |||
7 | obj-$(CONFIG_ARCH_HI3xxx) += clk-hi3620.o | 7 | obj-$(CONFIG_ARCH_HI3xxx) += clk-hi3620.o |
8 | obj-$(CONFIG_ARCH_HIP04) += clk-hip04.o | 8 | obj-$(CONFIG_ARCH_HIP04) += clk-hip04.o |
9 | obj-$(CONFIG_ARCH_HIX5HD2) += clk-hix5hd2.o | 9 | obj-$(CONFIG_ARCH_HIX5HD2) += clk-hix5hd2.o |
10 | obj-$(CONFIG_COMMON_CLK_HI6220) += clk-hi6220.o clk-hi6220-stub.o | 10 | obj-$(CONFIG_COMMON_CLK_HI6220) += clk-hi6220.o |
11 | obj-$(CONFIG_STUB_CLK_HI6220) += clk-hi6220-stub.o | ||
diff --git a/drivers/clk/rockchip/clk-rk3188.c b/drivers/clk/rockchip/clk-rk3188.c index ed02bbc7b11f..abb47608713b 100644 --- a/drivers/clk/rockchip/clk-rk3188.c +++ b/drivers/clk/rockchip/clk-rk3188.c | |||
@@ -716,6 +716,8 @@ static const char *const rk3188_critical_clocks[] __initconst = { | |||
716 | "aclk_cpu", | 716 | "aclk_cpu", |
717 | "aclk_peri", | 717 | "aclk_peri", |
718 | "hclk_peri", | 718 | "hclk_peri", |
719 | "pclk_cpu", | ||
720 | "pclk_peri", | ||
719 | }; | 721 | }; |
720 | 722 | ||
721 | static void __init rk3188_common_clk_init(struct device_node *np) | 723 | static void __init rk3188_common_clk_init(struct device_node *np) |
@@ -744,8 +746,6 @@ static void __init rk3188_common_clk_init(struct device_node *np) | |||
744 | 746 | ||
745 | rockchip_clk_register_branches(common_clk_branches, | 747 | rockchip_clk_register_branches(common_clk_branches, |
746 | ARRAY_SIZE(common_clk_branches)); | 748 | ARRAY_SIZE(common_clk_branches)); |
747 | rockchip_clk_protect_critical(rk3188_critical_clocks, | ||
748 | ARRAY_SIZE(rk3188_critical_clocks)); | ||
749 | 749 | ||
750 | rockchip_register_softrst(np, 9, reg_base + RK2928_SOFTRST_CON(0), | 750 | rockchip_register_softrst(np, 9, reg_base + RK2928_SOFTRST_CON(0), |
751 | ROCKCHIP_SOFTRST_HIWORD_MASK); | 751 | ROCKCHIP_SOFTRST_HIWORD_MASK); |
@@ -765,6 +765,8 @@ static void __init rk3066a_clk_init(struct device_node *np) | |||
765 | mux_armclk_p, ARRAY_SIZE(mux_armclk_p), | 765 | mux_armclk_p, ARRAY_SIZE(mux_armclk_p), |
766 | &rk3066_cpuclk_data, rk3066_cpuclk_rates, | 766 | &rk3066_cpuclk_data, rk3066_cpuclk_rates, |
767 | ARRAY_SIZE(rk3066_cpuclk_rates)); | 767 | ARRAY_SIZE(rk3066_cpuclk_rates)); |
768 | rockchip_clk_protect_critical(rk3188_critical_clocks, | ||
769 | ARRAY_SIZE(rk3188_critical_clocks)); | ||
768 | } | 770 | } |
769 | CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init); | 771 | CLK_OF_DECLARE(rk3066a_cru, "rockchip,rk3066a-cru", rk3066a_clk_init); |
770 | 772 | ||
@@ -801,6 +803,9 @@ static void __init rk3188a_clk_init(struct device_node *np) | |||
801 | pr_warn("%s: missing clocks to reparent aclk_cpu_pre to gpll\n", | 803 | pr_warn("%s: missing clocks to reparent aclk_cpu_pre to gpll\n", |
802 | __func__); | 804 | __func__); |
803 | } | 805 | } |
806 | |||
807 | rockchip_clk_protect_critical(rk3188_critical_clocks, | ||
808 | ARRAY_SIZE(rk3188_critical_clocks)); | ||
804 | } | 809 | } |
805 | CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init); | 810 | CLK_OF_DECLARE(rk3188a_cru, "rockchip,rk3188a-cru", rk3188a_clk_init); |
806 | 811 | ||
diff --git a/drivers/clk/rockchip/clk-rk3368.c b/drivers/clk/rockchip/clk-rk3368.c index 9c5d61e698ef..7e6b783e6eee 100644 --- a/drivers/clk/rockchip/clk-rk3368.c +++ b/drivers/clk/rockchip/clk-rk3368.c | |||
@@ -818,6 +818,10 @@ static struct rockchip_clk_branch rk3368_clk_branches[] __initdata = { | |||
818 | GATE(0, "sclk_timer00", "xin24m", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(24), 0, GFLAGS), | 818 | GATE(0, "sclk_timer00", "xin24m", CLK_IGNORE_UNUSED, RK3368_CLKGATE_CON(24), 0, GFLAGS), |
819 | }; | 819 | }; |
820 | 820 | ||
821 | static const char *const rk3368_critical_clocks[] __initconst = { | ||
822 | "pclk_pd_pmu", | ||
823 | }; | ||
824 | |||
821 | static void __init rk3368_clk_init(struct device_node *np) | 825 | static void __init rk3368_clk_init(struct device_node *np) |
822 | { | 826 | { |
823 | void __iomem *reg_base; | 827 | void __iomem *reg_base; |
@@ -862,6 +866,8 @@ static void __init rk3368_clk_init(struct device_node *np) | |||
862 | RK3368_GRF_SOC_STATUS0); | 866 | RK3368_GRF_SOC_STATUS0); |
863 | rockchip_clk_register_branches(rk3368_clk_branches, | 867 | rockchip_clk_register_branches(rk3368_clk_branches, |
864 | ARRAY_SIZE(rk3368_clk_branches)); | 868 | ARRAY_SIZE(rk3368_clk_branches)); |
869 | rockchip_clk_protect_critical(rk3368_critical_clocks, | ||
870 | ARRAY_SIZE(rk3368_critical_clocks)); | ||
865 | 871 | ||
866 | rockchip_clk_register_armclk(ARMCLKB, "armclkb", | 872 | rockchip_clk_register_armclk(ARMCLKB, "armclkb", |
867 | mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p), | 873 | mux_armclkb_p, ARRAY_SIZE(mux_armclkb_p), |
diff --git a/drivers/clk/st/clkgen-fsyn.c b/drivers/clk/st/clkgen-fsyn.c index 83ccf142ff2a..576cd0354d48 100644 --- a/drivers/clk/st/clkgen-fsyn.c +++ b/drivers/clk/st/clkgen-fsyn.c | |||
@@ -307,7 +307,7 @@ static const struct clkgen_quadfs_data st_fs660c32_F_416 = { | |||
307 | .get_rate = clk_fs660c32_dig_get_rate, | 307 | .get_rate = clk_fs660c32_dig_get_rate, |
308 | }; | 308 | }; |
309 | 309 | ||
310 | static const struct clkgen_quadfs_data st_fs660c32_C_407 = { | 310 | static const struct clkgen_quadfs_data st_fs660c32_C = { |
311 | .nrst_present = true, | 311 | .nrst_present = true, |
312 | .nrst = { CLKGEN_FIELD(0x2f0, 0x1, 0), | 312 | .nrst = { CLKGEN_FIELD(0x2f0, 0x1, 0), |
313 | CLKGEN_FIELD(0x2f0, 0x1, 1), | 313 | CLKGEN_FIELD(0x2f0, 0x1, 1), |
@@ -350,7 +350,7 @@ static const struct clkgen_quadfs_data st_fs660c32_C_407 = { | |||
350 | .get_rate = clk_fs660c32_dig_get_rate, | 350 | .get_rate = clk_fs660c32_dig_get_rate, |
351 | }; | 351 | }; |
352 | 352 | ||
353 | static const struct clkgen_quadfs_data st_fs660c32_D_407 = { | 353 | static const struct clkgen_quadfs_data st_fs660c32_D = { |
354 | .nrst_present = true, | 354 | .nrst_present = true, |
355 | .nrst = { CLKGEN_FIELD(0x2a0, 0x1, 0), | 355 | .nrst = { CLKGEN_FIELD(0x2a0, 0x1, 0), |
356 | CLKGEN_FIELD(0x2a0, 0x1, 1), | 356 | CLKGEN_FIELD(0x2a0, 0x1, 1), |
@@ -1077,11 +1077,11 @@ static const struct of_device_id quadfs_of_match[] = { | |||
1077 | }, | 1077 | }, |
1078 | { | 1078 | { |
1079 | .compatible = "st,stih407-quadfs660-C", | 1079 | .compatible = "st,stih407-quadfs660-C", |
1080 | .data = &st_fs660c32_C_407 | 1080 | .data = &st_fs660c32_C |
1081 | }, | 1081 | }, |
1082 | { | 1082 | { |
1083 | .compatible = "st,stih407-quadfs660-D", | 1083 | .compatible = "st,stih407-quadfs660-D", |
1084 | .data = &st_fs660c32_D_407 | 1084 | .data = &st_fs660c32_D |
1085 | }, | 1085 | }, |
1086 | {} | 1086 | {} |
1087 | }; | 1087 | }; |
diff --git a/drivers/clk/st/clkgen-pll.c b/drivers/clk/st/clkgen-pll.c index 47a38a994cac..b2a332cf8985 100644 --- a/drivers/clk/st/clkgen-pll.c +++ b/drivers/clk/st/clkgen-pll.c | |||
@@ -193,7 +193,7 @@ static const struct clkgen_pll_data st_pll3200c32_407_a0 = { | |||
193 | .ops = &stm_pll3200c32_ops, | 193 | .ops = &stm_pll3200c32_ops, |
194 | }; | 194 | }; |
195 | 195 | ||
196 | static const struct clkgen_pll_data st_pll3200c32_407_c0_0 = { | 196 | static const struct clkgen_pll_data st_pll3200c32_cx_0 = { |
197 | /* 407 C0 PLL0 */ | 197 | /* 407 C0 PLL0 */ |
198 | .pdn_status = CLKGEN_FIELD(0x2a0, 0x1, 8), | 198 | .pdn_status = CLKGEN_FIELD(0x2a0, 0x1, 8), |
199 | .locked_status = CLKGEN_FIELD(0x2a0, 0x1, 24), | 199 | .locked_status = CLKGEN_FIELD(0x2a0, 0x1, 24), |
@@ -205,7 +205,7 @@ static const struct clkgen_pll_data st_pll3200c32_407_c0_0 = { | |||
205 | .ops = &stm_pll3200c32_ops, | 205 | .ops = &stm_pll3200c32_ops, |
206 | }; | 206 | }; |
207 | 207 | ||
208 | static const struct clkgen_pll_data st_pll3200c32_407_c0_1 = { | 208 | static const struct clkgen_pll_data st_pll3200c32_cx_1 = { |
209 | /* 407 C0 PLL1 */ | 209 | /* 407 C0 PLL1 */ |
210 | .pdn_status = CLKGEN_FIELD(0x2c8, 0x1, 8), | 210 | .pdn_status = CLKGEN_FIELD(0x2c8, 0x1, 8), |
211 | .locked_status = CLKGEN_FIELD(0x2c8, 0x1, 24), | 211 | .locked_status = CLKGEN_FIELD(0x2c8, 0x1, 24), |
@@ -624,12 +624,12 @@ static const struct of_device_id c32_pll_of_match[] = { | |||
624 | .data = &st_pll3200c32_407_a0, | 624 | .data = &st_pll3200c32_407_a0, |
625 | }, | 625 | }, |
626 | { | 626 | { |
627 | .compatible = "st,stih407-plls-c32-c0_0", | 627 | .compatible = "st,plls-c32-cx_0", |
628 | .data = &st_pll3200c32_407_c0_0, | 628 | .data = &st_pll3200c32_cx_0, |
629 | }, | 629 | }, |
630 | { | 630 | { |
631 | .compatible = "st,stih407-plls-c32-c0_1", | 631 | .compatible = "st,plls-c32-cx_1", |
632 | .data = &st_pll3200c32_407_c0_1, | 632 | .data = &st_pll3200c32_cx_1, |
633 | }, | 633 | }, |
634 | { | 634 | { |
635 | .compatible = "st,stih407-plls-c32-a9", | 635 | .compatible = "st,stih407-plls-c32-a9", |
diff --git a/drivers/clk/tegra/clk-dfll.c b/drivers/clk/tegra/clk-dfll.c index c2ff859ee0e8..c4e3a52e225b 100644 --- a/drivers/clk/tegra/clk-dfll.c +++ b/drivers/clk/tegra/clk-dfll.c | |||
@@ -682,11 +682,17 @@ static int find_lut_index_for_rate(struct tegra_dfll *td, unsigned long rate) | |||
682 | struct dev_pm_opp *opp; | 682 | struct dev_pm_opp *opp; |
683 | int i, uv; | 683 | int i, uv; |
684 | 684 | ||
685 | rcu_read_lock(); | ||
686 | |||
685 | opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); | 687 | opp = dev_pm_opp_find_freq_ceil(td->soc->dev, &rate); |
686 | if (IS_ERR(opp)) | 688 | if (IS_ERR(opp)) { |
689 | rcu_read_unlock(); | ||
687 | return PTR_ERR(opp); | 690 | return PTR_ERR(opp); |
691 | } | ||
688 | uv = dev_pm_opp_get_voltage(opp); | 692 | uv = dev_pm_opp_get_voltage(opp); |
689 | 693 | ||
694 | rcu_read_unlock(); | ||
695 | |||
690 | for (i = 0; i < td->i2c_lut_size; i++) { | 696 | for (i = 0; i < td->i2c_lut_size; i++) { |
691 | if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv) | 697 | if (regulator_list_voltage(td->vdd_reg, td->i2c_lut[i]) == uv) |
692 | return i; | 698 | return i; |
diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c index 15b921a9248c..798277227de7 100644 --- a/drivers/cpufreq/acpi-cpufreq.c +++ b/drivers/cpufreq/acpi-cpufreq.c | |||
@@ -375,12 +375,11 @@ static unsigned int get_cur_freq_on_cpu(unsigned int cpu) | |||
375 | 375 | ||
376 | pr_debug("get_cur_freq_on_cpu (%d)\n", cpu); | 376 | pr_debug("get_cur_freq_on_cpu (%d)\n", cpu); |
377 | 377 | ||
378 | policy = cpufreq_cpu_get(cpu); | 378 | policy = cpufreq_cpu_get_raw(cpu); |
379 | if (unlikely(!policy)) | 379 | if (unlikely(!policy)) |
380 | return 0; | 380 | return 0; |
381 | 381 | ||
382 | data = policy->driver_data; | 382 | data = policy->driver_data; |
383 | cpufreq_cpu_put(policy); | ||
384 | if (unlikely(!data || !data->freq_table)) | 383 | if (unlikely(!data || !data->freq_table)) |
385 | return 0; | 384 | return 0; |
386 | 385 | ||
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c index 6633b3fa996e..ef5ed9470de9 100644 --- a/drivers/cpufreq/cpufreq.c +++ b/drivers/cpufreq/cpufreq.c | |||
@@ -238,13 +238,13 @@ int cpufreq_generic_init(struct cpufreq_policy *policy, | |||
238 | } | 238 | } |
239 | EXPORT_SYMBOL_GPL(cpufreq_generic_init); | 239 | EXPORT_SYMBOL_GPL(cpufreq_generic_init); |
240 | 240 | ||
241 | /* Only for cpufreq core internal use */ | 241 | struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu) |
242 | static struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu) | ||
243 | { | 242 | { |
244 | struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); | 243 | struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu); |
245 | 244 | ||
246 | return policy && cpumask_test_cpu(cpu, policy->cpus) ? policy : NULL; | 245 | return policy && cpumask_test_cpu(cpu, policy->cpus) ? policy : NULL; |
247 | } | 246 | } |
247 | EXPORT_SYMBOL_GPL(cpufreq_cpu_get_raw); | ||
248 | 248 | ||
249 | unsigned int cpufreq_generic_get(unsigned int cpu) | 249 | unsigned int cpufreq_generic_get(unsigned int cpu) |
250 | { | 250 | { |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index 07bc7aa6b224..d234719065a5 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
@@ -461,7 +461,7 @@ config CRYPTO_DEV_QCE | |||
461 | 461 | ||
462 | config CRYPTO_DEV_VMX | 462 | config CRYPTO_DEV_VMX |
463 | bool "Support for VMX cryptographic acceleration instructions" | 463 | bool "Support for VMX cryptographic acceleration instructions" |
464 | depends on PPC64 | 464 | depends on PPC64 && VSX |
465 | help | 465 | help |
466 | Support for VMX cryptographic acceleration instructions. | 466 | Support for VMX cryptographic acceleration instructions. |
467 | 467 | ||
diff --git a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c index e070c316e8b7..a19ee127edca 100644 --- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c +++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | |||
@@ -104,7 +104,7 @@ static int sun4i_ss_opti_poll(struct ablkcipher_request *areq) | |||
104 | sg_miter_next(&mo); | 104 | sg_miter_next(&mo); |
105 | oo = 0; | 105 | oo = 0; |
106 | } | 106 | } |
107 | } while (mo.length > 0); | 107 | } while (oleft > 0); |
108 | 108 | ||
109 | if (areq->info) { | 109 | if (areq->info) { |
110 | for (i = 0; i < 4 && i < ivsize / 4; i++) { | 110 | for (i = 0; i < 4 && i < ivsize / 4; i++) { |
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index ca1b362d77e2..3927ed9fdbd5 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -53,7 +53,7 @@ static struct devfreq *find_device_devfreq(struct device *dev) | |||
53 | { | 53 | { |
54 | struct devfreq *tmp_devfreq; | 54 | struct devfreq *tmp_devfreq; |
55 | 55 | ||
56 | if (unlikely(IS_ERR_OR_NULL(dev))) { | 56 | if (IS_ERR_OR_NULL(dev)) { |
57 | pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); | 57 | pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); |
58 | return ERR_PTR(-EINVAL); | 58 | return ERR_PTR(-EINVAL); |
59 | } | 59 | } |
@@ -133,7 +133,7 @@ static struct devfreq_governor *find_devfreq_governor(const char *name) | |||
133 | { | 133 | { |
134 | struct devfreq_governor *tmp_governor; | 134 | struct devfreq_governor *tmp_governor; |
135 | 135 | ||
136 | if (unlikely(IS_ERR_OR_NULL(name))) { | 136 | if (IS_ERR_OR_NULL(name)) { |
137 | pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); | 137 | pr_err("DEVFREQ: %s: Invalid parameters\n", __func__); |
138 | return ERR_PTR(-EINVAL); | 138 | return ERR_PTR(-EINVAL); |
139 | } | 139 | } |
@@ -177,10 +177,10 @@ int update_devfreq(struct devfreq *devfreq) | |||
177 | return err; | 177 | return err; |
178 | 178 | ||
179 | /* | 179 | /* |
180 | * Adjust the freuqency with user freq and QoS. | 180 | * Adjust the frequency with user freq and QoS. |
181 | * | 181 | * |
182 | * List from the highest proiority | 182 | * List from the highest priority |
183 | * max_freq (probably called by thermal when it's too hot) | 183 | * max_freq |
184 | * min_freq | 184 | * min_freq |
185 | */ | 185 | */ |
186 | 186 | ||
@@ -482,7 +482,7 @@ struct devfreq *devfreq_add_device(struct device *dev, | |||
482 | devfreq->profile->max_state * | 482 | devfreq->profile->max_state * |
483 | devfreq->profile->max_state, | 483 | devfreq->profile->max_state, |
484 | GFP_KERNEL); | 484 | GFP_KERNEL); |
485 | devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned int) * | 485 | devfreq->time_in_state = devm_kzalloc(dev, sizeof(unsigned long) * |
486 | devfreq->profile->max_state, | 486 | devfreq->profile->max_state, |
487 | GFP_KERNEL); | 487 | GFP_KERNEL); |
488 | devfreq->last_stat_updated = jiffies; | 488 | devfreq->last_stat_updated = jiffies; |
diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c index f9901f52a225..f312485f1451 100644 --- a/drivers/devfreq/event/exynos-ppmu.c +++ b/drivers/devfreq/event/exynos-ppmu.c | |||
@@ -319,7 +319,8 @@ static int exynos_ppmu_v2_get_event(struct devfreq_event_dev *edev, | |||
319 | case PPMU_PMNCNT3: | 319 | case PPMU_PMNCNT3: |
320 | pmcnt_high = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_HIGH); | 320 | pmcnt_high = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_HIGH); |
321 | pmcnt_low = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_LOW); | 321 | pmcnt_low = __raw_readl(info->ppmu.base + PPMU_V2_PMCNT3_LOW); |
322 | load_count = (u64)((pmcnt_high & 0xff) << 32) + (u64)pmcnt_low; | 322 | load_count = ((u64)((pmcnt_high & 0xff)) << 32) |
323 | + (u64)pmcnt_low; | ||
323 | break; | 324 | break; |
324 | } | 325 | } |
325 | edata->load_count = load_count; | 326 | edata->load_count = load_count; |
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c index 0720ba84ca92..ae72ba5e78df 100644 --- a/drivers/devfreq/governor_simpleondemand.c +++ b/drivers/devfreq/governor_simpleondemand.c | |||
@@ -21,17 +21,20 @@ | |||
21 | static int devfreq_simple_ondemand_func(struct devfreq *df, | 21 | static int devfreq_simple_ondemand_func(struct devfreq *df, |
22 | unsigned long *freq) | 22 | unsigned long *freq) |
23 | { | 23 | { |
24 | struct devfreq_dev_status stat; | 24 | int err; |
25 | int err = df->profile->get_dev_status(df->dev.parent, &stat); | 25 | struct devfreq_dev_status *stat; |
26 | unsigned long long a, b; | 26 | unsigned long long a, b; |
27 | unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD; | 27 | unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD; |
28 | unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL; | 28 | unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL; |
29 | struct devfreq_simple_ondemand_data *data = df->data; | 29 | struct devfreq_simple_ondemand_data *data = df->data; |
30 | unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX; | 30 | unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX; |
31 | 31 | ||
32 | err = devfreq_update_stats(df); | ||
32 | if (err) | 33 | if (err) |
33 | return err; | 34 | return err; |
34 | 35 | ||
36 | stat = &df->last_status; | ||
37 | |||
35 | if (data) { | 38 | if (data) { |
36 | if (data->upthreshold) | 39 | if (data->upthreshold) |
37 | dfso_upthreshold = data->upthreshold; | 40 | dfso_upthreshold = data->upthreshold; |
@@ -43,41 +46,41 @@ static int devfreq_simple_ondemand_func(struct devfreq *df, | |||
43 | return -EINVAL; | 46 | return -EINVAL; |
44 | 47 | ||
45 | /* Assume MAX if it is going to be divided by zero */ | 48 | /* Assume MAX if it is going to be divided by zero */ |
46 | if (stat.total_time == 0) { | 49 | if (stat->total_time == 0) { |
47 | *freq = max; | 50 | *freq = max; |
48 | return 0; | 51 | return 0; |
49 | } | 52 | } |
50 | 53 | ||
51 | /* Prevent overflow */ | 54 | /* Prevent overflow */ |
52 | if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) { | 55 | if (stat->busy_time >= (1 << 24) || stat->total_time >= (1 << 24)) { |
53 | stat.busy_time >>= 7; | 56 | stat->busy_time >>= 7; |
54 | stat.total_time >>= 7; | 57 | stat->total_time >>= 7; |
55 | } | 58 | } |
56 | 59 | ||
57 | /* Set MAX if it's busy enough */ | 60 | /* Set MAX if it's busy enough */ |
58 | if (stat.busy_time * 100 > | 61 | if (stat->busy_time * 100 > |
59 | stat.total_time * dfso_upthreshold) { | 62 | stat->total_time * dfso_upthreshold) { |
60 | *freq = max; | 63 | *freq = max; |
61 | return 0; | 64 | return 0; |
62 | } | 65 | } |
63 | 66 | ||
64 | /* Set MAX if we do not know the initial frequency */ | 67 | /* Set MAX if we do not know the initial frequency */ |
65 | if (stat.current_frequency == 0) { | 68 | if (stat->current_frequency == 0) { |
66 | *freq = max; | 69 | *freq = max; |
67 | return 0; | 70 | return 0; |
68 | } | 71 | } |
69 | 72 | ||
70 | /* Keep the current frequency */ | 73 | /* Keep the current frequency */ |
71 | if (stat.busy_time * 100 > | 74 | if (stat->busy_time * 100 > |
72 | stat.total_time * (dfso_upthreshold - dfso_downdifferential)) { | 75 | stat->total_time * (dfso_upthreshold - dfso_downdifferential)) { |
73 | *freq = stat.current_frequency; | 76 | *freq = stat->current_frequency; |
74 | return 0; | 77 | return 0; |
75 | } | 78 | } |
76 | 79 | ||
77 | /* Set the desired frequency based on the load */ | 80 | /* Set the desired frequency based on the load */ |
78 | a = stat.busy_time; | 81 | a = stat->busy_time; |
79 | a *= stat.current_frequency; | 82 | a *= stat->current_frequency; |
80 | b = div_u64(a, stat.total_time); | 83 | b = div_u64(a, stat->total_time); |
81 | b *= 100; | 84 | b *= 100; |
82 | b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2)); | 85 | b = div_u64(b, (dfso_upthreshold - dfso_downdifferential / 2)); |
83 | *freq = (unsigned long) b; | 86 | *freq = (unsigned long) b; |
diff --git a/drivers/devfreq/tegra-devfreq.c b/drivers/devfreq/tegra-devfreq.c index 13a1a6e8108c..848b93ee930f 100644 --- a/drivers/devfreq/tegra-devfreq.c +++ b/drivers/devfreq/tegra-devfreq.c | |||
@@ -541,18 +541,20 @@ static struct devfreq_dev_profile tegra_devfreq_profile = { | |||
541 | static int tegra_governor_get_target(struct devfreq *devfreq, | 541 | static int tegra_governor_get_target(struct devfreq *devfreq, |
542 | unsigned long *freq) | 542 | unsigned long *freq) |
543 | { | 543 | { |
544 | struct devfreq_dev_status stat; | 544 | struct devfreq_dev_status *stat; |
545 | struct tegra_devfreq *tegra; | 545 | struct tegra_devfreq *tegra; |
546 | struct tegra_devfreq_device *dev; | 546 | struct tegra_devfreq_device *dev; |
547 | unsigned long target_freq = 0; | 547 | unsigned long target_freq = 0; |
548 | unsigned int i; | 548 | unsigned int i; |
549 | int err; | 549 | int err; |
550 | 550 | ||
551 | err = devfreq->profile->get_dev_status(devfreq->dev.parent, &stat); | 551 | err = devfreq_update_stats(devfreq); |
552 | if (err) | 552 | if (err) |
553 | return err; | 553 | return err; |
554 | 554 | ||
555 | tegra = stat.private_data; | 555 | stat = &devfreq->last_status; |
556 | |||
557 | tegra = stat->private_data; | ||
556 | 558 | ||
557 | for (i = 0; i < ARRAY_SIZE(tegra->devices); i++) { | 559 | for (i = 0; i < ARRAY_SIZE(tegra->devices); i++) { |
558 | dev = &tegra->devices[i]; | 560 | dev = &tegra->devices[i]; |
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c index 4768a829253a..2bf37e68ad0f 100644 --- a/drivers/dma/ipu/ipu_irq.c +++ b/drivers/dma/ipu/ipu_irq.c | |||
@@ -266,7 +266,7 @@ int ipu_irq_unmap(unsigned int source) | |||
266 | } | 266 | } |
267 | 267 | ||
268 | /* Chained IRQ handler for IPU function and error interrupt */ | 268 | /* Chained IRQ handler for IPU function and error interrupt */ |
269 | static void ipu_irq_handler(unsigned int __irq, struct irq_desc *desc) | 269 | static void ipu_irq_handler(struct irq_desc *desc) |
270 | { | 270 | { |
271 | struct ipu *ipu = irq_desc_get_handler_data(desc); | 271 | struct ipu *ipu = irq_desc_get_handler_data(desc); |
272 | u32 status; | 272 | u32 status; |
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig index b4fc9e4d24c6..8949b3f6f74d 100644 --- a/drivers/gpio/Kconfig +++ b/drivers/gpio/Kconfig | |||
@@ -356,7 +356,7 @@ config GPIO_PXA | |||
356 | 356 | ||
357 | config GPIO_RCAR | 357 | config GPIO_RCAR |
358 | tristate "Renesas R-Car GPIO" | 358 | tristate "Renesas R-Car GPIO" |
359 | depends on ARM && (ARCH_SHMOBILE || COMPILE_TEST) | 359 | depends on ARCH_SHMOBILE || COMPILE_TEST |
360 | select GPIOLIB_IRQCHIP | 360 | select GPIOLIB_IRQCHIP |
361 | help | 361 | help |
362 | Say yes here to support GPIO on Renesas R-Car SoCs. | 362 | Say yes here to support GPIO on Renesas R-Car SoCs. |
diff --git a/drivers/gpio/gpio-altera.c b/drivers/gpio/gpio-altera.c index 9b7e0b3db387..1b44941574fa 100644 --- a/drivers/gpio/gpio-altera.c +++ b/drivers/gpio/gpio-altera.c | |||
@@ -201,8 +201,7 @@ static int altera_gpio_direction_output(struct gpio_chip *gc, | |||
201 | return 0; | 201 | return 0; |
202 | } | 202 | } |
203 | 203 | ||
204 | static void altera_gpio_irq_edge_handler(unsigned int irq, | 204 | static void altera_gpio_irq_edge_handler(struct irq_desc *desc) |
205 | struct irq_desc *desc) | ||
206 | { | 205 | { |
207 | struct altera_gpio_chip *altera_gc; | 206 | struct altera_gpio_chip *altera_gc; |
208 | struct irq_chip *chip; | 207 | struct irq_chip *chip; |
@@ -231,8 +230,7 @@ static void altera_gpio_irq_edge_handler(unsigned int irq, | |||
231 | } | 230 | } |
232 | 231 | ||
233 | 232 | ||
234 | static void altera_gpio_irq_leveL_high_handler(unsigned int irq, | 233 | static void altera_gpio_irq_leveL_high_handler(struct irq_desc *desc) |
235 | struct irq_desc *desc) | ||
236 | { | 234 | { |
237 | struct altera_gpio_chip *altera_gc; | 235 | struct altera_gpio_chip *altera_gc; |
238 | struct irq_chip *chip; | 236 | struct irq_chip *chip; |
diff --git a/drivers/gpio/gpio-bcm-kona.c b/drivers/gpio/gpio-bcm-kona.c index 31b90ac15204..33a1f9779b86 100644 --- a/drivers/gpio/gpio-bcm-kona.c +++ b/drivers/gpio/gpio-bcm-kona.c | |||
@@ -433,7 +433,7 @@ static int bcm_kona_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
433 | return 0; | 433 | return 0; |
434 | } | 434 | } |
435 | 435 | ||
436 | static void bcm_kona_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 436 | static void bcm_kona_gpio_irq_handler(struct irq_desc *desc) |
437 | { | 437 | { |
438 | void __iomem *reg_base; | 438 | void __iomem *reg_base; |
439 | int bit, bank_id; | 439 | int bit, bank_id; |
diff --git a/drivers/gpio/gpio-brcmstb.c b/drivers/gpio/gpio-brcmstb.c index 9ea86d2ac054..4c64627c6bb5 100644 --- a/drivers/gpio/gpio-brcmstb.c +++ b/drivers/gpio/gpio-brcmstb.c | |||
@@ -236,7 +236,7 @@ static void brcmstb_gpio_irq_bank_handler(struct brcmstb_gpio_bank *bank) | |||
236 | } | 236 | } |
237 | 237 | ||
238 | /* Each UPG GIO block has one IRQ for all banks */ | 238 | /* Each UPG GIO block has one IRQ for all banks */ |
239 | static void brcmstb_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 239 | static void brcmstb_gpio_irq_handler(struct irq_desc *desc) |
240 | { | 240 | { |
241 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 241 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
242 | struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc); | 242 | struct brcmstb_gpio_priv *priv = brcmstb_gpio_gc_to_priv(gc); |
diff --git a/drivers/gpio/gpio-davinci.c b/drivers/gpio/gpio-davinci.c index 94b0ab709721..5e715388803d 100644 --- a/drivers/gpio/gpio-davinci.c +++ b/drivers/gpio/gpio-davinci.c | |||
@@ -326,8 +326,7 @@ static struct irq_chip gpio_irqchip = { | |||
326 | .flags = IRQCHIP_SET_TYPE_MASKED, | 326 | .flags = IRQCHIP_SET_TYPE_MASKED, |
327 | }; | 327 | }; |
328 | 328 | ||
329 | static void | 329 | static void gpio_irq_handler(struct irq_desc *desc) |
330 | gpio_irq_handler(unsigned __irq, struct irq_desc *desc) | ||
331 | { | 330 | { |
332 | unsigned int irq = irq_desc_get_irq(desc); | 331 | unsigned int irq = irq_desc_get_irq(desc); |
333 | struct davinci_gpio_regs __iomem *g; | 332 | struct davinci_gpio_regs __iomem *g; |
diff --git a/drivers/gpio/gpio-dwapb.c b/drivers/gpio/gpio-dwapb.c index c5be4b9b8baf..fcd5b0acfc72 100644 --- a/drivers/gpio/gpio-dwapb.c +++ b/drivers/gpio/gpio-dwapb.c | |||
@@ -147,7 +147,7 @@ static u32 dwapb_do_irq(struct dwapb_gpio *gpio) | |||
147 | return ret; | 147 | return ret; |
148 | } | 148 | } |
149 | 149 | ||
150 | static void dwapb_irq_handler(u32 irq, struct irq_desc *desc) | 150 | static void dwapb_irq_handler(struct irq_desc *desc) |
151 | { | 151 | { |
152 | struct dwapb_gpio *gpio = irq_desc_get_handler_data(desc); | 152 | struct dwapb_gpio *gpio = irq_desc_get_handler_data(desc); |
153 | struct irq_chip *chip = irq_desc_get_chip(desc); | 153 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/gpio/gpio-ep93xx.c b/drivers/gpio/gpio-ep93xx.c index 9d90366ea259..3e3947b35c83 100644 --- a/drivers/gpio/gpio-ep93xx.c +++ b/drivers/gpio/gpio-ep93xx.c | |||
@@ -78,7 +78,7 @@ static void ep93xx_gpio_int_debounce(unsigned int irq, bool enable) | |||
78 | EP93XX_GPIO_REG(int_debounce_register_offset[port])); | 78 | EP93XX_GPIO_REG(int_debounce_register_offset[port])); |
79 | } | 79 | } |
80 | 80 | ||
81 | static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | 81 | static void ep93xx_gpio_ab_irq_handler(struct irq_desc *desc) |
82 | { | 82 | { |
83 | unsigned char status; | 83 | unsigned char status; |
84 | int i; | 84 | int i; |
@@ -100,8 +100,7 @@ static void ep93xx_gpio_ab_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | static void ep93xx_gpio_f_irq_handler(unsigned int __irq, | 103 | static void ep93xx_gpio_f_irq_handler(struct irq_desc *desc) |
104 | struct irq_desc *desc) | ||
105 | { | 104 | { |
106 | /* | 105 | /* |
107 | * map discontiguous hw irq range to continuous sw irq range: | 106 | * map discontiguous hw irq range to continuous sw irq range: |
diff --git a/drivers/gpio/gpio-intel-mid.c b/drivers/gpio/gpio-intel-mid.c index aa28c65eb6b4..70097472b02c 100644 --- a/drivers/gpio/gpio-intel-mid.c +++ b/drivers/gpio/gpio-intel-mid.c | |||
@@ -301,7 +301,7 @@ static const struct pci_device_id intel_gpio_ids[] = { | |||
301 | }; | 301 | }; |
302 | MODULE_DEVICE_TABLE(pci, intel_gpio_ids); | 302 | MODULE_DEVICE_TABLE(pci, intel_gpio_ids); |
303 | 303 | ||
304 | static void intel_mid_irq_handler(unsigned irq, struct irq_desc *desc) | 304 | static void intel_mid_irq_handler(struct irq_desc *desc) |
305 | { | 305 | { |
306 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 306 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
307 | struct intel_mid_gpio *priv = to_intel_gpio_priv(gc); | 307 | struct intel_mid_gpio *priv = to_intel_gpio_priv(gc); |
diff --git a/drivers/gpio/gpio-lynxpoint.c b/drivers/gpio/gpio-lynxpoint.c index 153af464c7a7..127c37b380ae 100644 --- a/drivers/gpio/gpio-lynxpoint.c +++ b/drivers/gpio/gpio-lynxpoint.c | |||
@@ -234,7 +234,7 @@ static int lp_gpio_direction_output(struct gpio_chip *chip, | |||
234 | return 0; | 234 | return 0; |
235 | } | 235 | } |
236 | 236 | ||
237 | static void lp_gpio_irq_handler(unsigned hwirq, struct irq_desc *desc) | 237 | static void lp_gpio_irq_handler(struct irq_desc *desc) |
238 | { | 238 | { |
239 | struct irq_data *data = irq_desc_get_irq_data(desc); | 239 | struct irq_data *data = irq_desc_get_irq_data(desc); |
240 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 240 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
diff --git a/drivers/gpio/gpio-mpc8xxx.c b/drivers/gpio/gpio-mpc8xxx.c index 8ef7a12de983..48ef368347ab 100644 --- a/drivers/gpio/gpio-mpc8xxx.c +++ b/drivers/gpio/gpio-mpc8xxx.c | |||
@@ -194,7 +194,7 @@ static int mpc8xxx_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | |||
194 | return -ENXIO; | 194 | return -ENXIO; |
195 | } | 195 | } |
196 | 196 | ||
197 | static void mpc8xxx_gpio_irq_cascade(unsigned int irq, struct irq_desc *desc) | 197 | static void mpc8xxx_gpio_irq_cascade(struct irq_desc *desc) |
198 | { | 198 | { |
199 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_desc_get_handler_data(desc); | 199 | struct mpc8xxx_gpio_chip *mpc8xxx_gc = irq_desc_get_handler_data(desc); |
200 | struct irq_chip *chip = irq_desc_get_chip(desc); | 200 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/gpio/gpio-msic.c b/drivers/gpio/gpio-msic.c index 7bcfb87a5fa6..22523aae8abe 100644 --- a/drivers/gpio/gpio-msic.c +++ b/drivers/gpio/gpio-msic.c | |||
@@ -232,7 +232,7 @@ static struct irq_chip msic_irqchip = { | |||
232 | .irq_bus_sync_unlock = msic_bus_sync_unlock, | 232 | .irq_bus_sync_unlock = msic_bus_sync_unlock, |
233 | }; | 233 | }; |
234 | 234 | ||
235 | static void msic_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 235 | static void msic_gpio_irq_handler(struct irq_desc *desc) |
236 | { | 236 | { |
237 | struct irq_data *data = irq_desc_get_irq_data(desc); | 237 | struct irq_data *data = irq_desc_get_irq_data(desc); |
238 | struct msic_gpio *mg = irq_data_get_irq_handler_data(data); | 238 | struct msic_gpio *mg = irq_data_get_irq_handler_data(data); |
diff --git a/drivers/gpio/gpio-msm-v2.c b/drivers/gpio/gpio-msm-v2.c index d2012cfb5571..4b4222145f10 100644 --- a/drivers/gpio/gpio-msm-v2.c +++ b/drivers/gpio/gpio-msm-v2.c | |||
@@ -305,7 +305,7 @@ static int msm_gpio_irq_set_type(struct irq_data *d, unsigned int flow_type) | |||
305 | * which have been set as summary IRQ lines and which are triggered, | 305 | * which have been set as summary IRQ lines and which are triggered, |
306 | * and to call their interrupt handlers. | 306 | * and to call their interrupt handlers. |
307 | */ | 307 | */ |
308 | static void msm_summary_irq_handler(unsigned int irq, struct irq_desc *desc) | 308 | static void msm_summary_irq_handler(struct irq_desc *desc) |
309 | { | 309 | { |
310 | unsigned long i; | 310 | unsigned long i; |
311 | struct irq_chip *chip = irq_desc_get_chip(desc); | 311 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c index b396bf3bf294..df418b81456d 100644 --- a/drivers/gpio/gpio-mvebu.c +++ b/drivers/gpio/gpio-mvebu.c | |||
@@ -458,7 +458,7 @@ static int mvebu_gpio_irq_set_type(struct irq_data *d, unsigned int type) | |||
458 | return 0; | 458 | return 0; |
459 | } | 459 | } |
460 | 460 | ||
461 | static void mvebu_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc) | 461 | static void mvebu_gpio_irq_handler(struct irq_desc *desc) |
462 | { | 462 | { |
463 | struct mvebu_gpio_chip *mvchip = irq_desc_get_handler_data(desc); | 463 | struct mvebu_gpio_chip *mvchip = irq_desc_get_handler_data(desc); |
464 | struct irq_chip *chip = irq_desc_get_chip(desc); | 464 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/gpio/gpio-mxc.c b/drivers/gpio/gpio-mxc.c index b752b560126e..b8dd847443c5 100644 --- a/drivers/gpio/gpio-mxc.c +++ b/drivers/gpio/gpio-mxc.c | |||
@@ -272,7 +272,7 @@ static void mxc_gpio_irq_handler(struct mxc_gpio_port *port, u32 irq_stat) | |||
272 | } | 272 | } |
273 | 273 | ||
274 | /* MX1 and MX3 has one interrupt *per* gpio port */ | 274 | /* MX1 and MX3 has one interrupt *per* gpio port */ |
275 | static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) | 275 | static void mx3_gpio_irq_handler(struct irq_desc *desc) |
276 | { | 276 | { |
277 | u32 irq_stat; | 277 | u32 irq_stat; |
278 | struct mxc_gpio_port *port = irq_desc_get_handler_data(desc); | 278 | struct mxc_gpio_port *port = irq_desc_get_handler_data(desc); |
@@ -288,7 +288,7 @@ static void mx3_gpio_irq_handler(u32 irq, struct irq_desc *desc) | |||
288 | } | 288 | } |
289 | 289 | ||
290 | /* MX2 has one interrupt *for all* gpio ports */ | 290 | /* MX2 has one interrupt *for all* gpio ports */ |
291 | static void mx2_gpio_irq_handler(u32 irq, struct irq_desc *desc) | 291 | static void mx2_gpio_irq_handler(struct irq_desc *desc) |
292 | { | 292 | { |
293 | u32 irq_msk, irq_stat; | 293 | u32 irq_msk, irq_stat; |
294 | struct mxc_gpio_port *port; | 294 | struct mxc_gpio_port *port; |
@@ -339,13 +339,15 @@ static int gpio_set_wake_irq(struct irq_data *d, u32 enable) | |||
339 | return 0; | 339 | return 0; |
340 | } | 340 | } |
341 | 341 | ||
342 | static void mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base) | 342 | static int mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base) |
343 | { | 343 | { |
344 | struct irq_chip_generic *gc; | 344 | struct irq_chip_generic *gc; |
345 | struct irq_chip_type *ct; | 345 | struct irq_chip_type *ct; |
346 | 346 | ||
347 | gc = irq_alloc_generic_chip("gpio-mxc", 1, irq_base, | 347 | gc = irq_alloc_generic_chip("gpio-mxc", 1, irq_base, |
348 | port->base, handle_level_irq); | 348 | port->base, handle_level_irq); |
349 | if (!gc) | ||
350 | return -ENOMEM; | ||
349 | gc->private = port; | 351 | gc->private = port; |
350 | 352 | ||
351 | ct = gc->chip_types; | 353 | ct = gc->chip_types; |
@@ -360,6 +362,8 @@ static void mxc_gpio_init_gc(struct mxc_gpio_port *port, int irq_base) | |||
360 | 362 | ||
361 | irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK, | 363 | irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK, |
362 | IRQ_NOREQUEST, 0); | 364 | IRQ_NOREQUEST, 0); |
365 | |||
366 | return 0; | ||
363 | } | 367 | } |
364 | 368 | ||
365 | static void mxc_gpio_get_hw(struct platform_device *pdev) | 369 | static void mxc_gpio_get_hw(struct platform_device *pdev) |
@@ -477,12 +481,16 @@ static int mxc_gpio_probe(struct platform_device *pdev) | |||
477 | } | 481 | } |
478 | 482 | ||
479 | /* gpio-mxc can be a generic irq chip */ | 483 | /* gpio-mxc can be a generic irq chip */ |
480 | mxc_gpio_init_gc(port, irq_base); | 484 | err = mxc_gpio_init_gc(port, irq_base); |
485 | if (err < 0) | ||
486 | goto out_irqdomain_remove; | ||
481 | 487 | ||
482 | list_add_tail(&port->node, &mxc_gpio_ports); | 488 | list_add_tail(&port->node, &mxc_gpio_ports); |
483 | 489 | ||
484 | return 0; | 490 | return 0; |
485 | 491 | ||
492 | out_irqdomain_remove: | ||
493 | irq_domain_remove(port->domain); | ||
486 | out_irqdesc_free: | 494 | out_irqdesc_free: |
487 | irq_free_descs(irq_base, 32); | 495 | irq_free_descs(irq_base, 32); |
488 | out_gpiochip_remove: | 496 | out_gpiochip_remove: |
diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c index b7f383eb18d9..a4288f428819 100644 --- a/drivers/gpio/gpio-mxs.c +++ b/drivers/gpio/gpio-mxs.c | |||
@@ -154,7 +154,7 @@ static void mxs_flip_edge(struct mxs_gpio_port *port, u32 gpio) | |||
154 | } | 154 | } |
155 | 155 | ||
156 | /* MXS has one interrupt *per* gpio port */ | 156 | /* MXS has one interrupt *per* gpio port */ |
157 | static void mxs_gpio_irq_handler(u32 irq, struct irq_desc *desc) | 157 | static void mxs_gpio_irq_handler(struct irq_desc *desc) |
158 | { | 158 | { |
159 | u32 irq_stat; | 159 | u32 irq_stat; |
160 | struct mxs_gpio_port *port = irq_desc_get_handler_data(desc); | 160 | struct mxs_gpio_port *port = irq_desc_get_handler_data(desc); |
@@ -196,13 +196,16 @@ static int mxs_gpio_set_wake_irq(struct irq_data *d, unsigned int enable) | |||
196 | return 0; | 196 | return 0; |
197 | } | 197 | } |
198 | 198 | ||
199 | static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base) | 199 | static int __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base) |
200 | { | 200 | { |
201 | struct irq_chip_generic *gc; | 201 | struct irq_chip_generic *gc; |
202 | struct irq_chip_type *ct; | 202 | struct irq_chip_type *ct; |
203 | 203 | ||
204 | gc = irq_alloc_generic_chip("gpio-mxs", 1, irq_base, | 204 | gc = irq_alloc_generic_chip("gpio-mxs", 1, irq_base, |
205 | port->base, handle_level_irq); | 205 | port->base, handle_level_irq); |
206 | if (!gc) | ||
207 | return -ENOMEM; | ||
208 | |||
206 | gc->private = port; | 209 | gc->private = port; |
207 | 210 | ||
208 | ct = gc->chip_types; | 211 | ct = gc->chip_types; |
@@ -216,6 +219,8 @@ static void __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base) | |||
216 | 219 | ||
217 | irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK, | 220 | irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK, |
218 | IRQ_NOREQUEST, 0); | 221 | IRQ_NOREQUEST, 0); |
222 | |||
223 | return 0; | ||
219 | } | 224 | } |
220 | 225 | ||
221 | static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset) | 226 | static int mxs_gpio_to_irq(struct gpio_chip *gc, unsigned offset) |
@@ -317,7 +322,9 @@ static int mxs_gpio_probe(struct platform_device *pdev) | |||
317 | } | 322 | } |
318 | 323 | ||
319 | /* gpio-mxs can be a generic irq chip */ | 324 | /* gpio-mxs can be a generic irq chip */ |
320 | mxs_gpio_init_gc(port, irq_base); | 325 | err = mxs_gpio_init_gc(port, irq_base); |
326 | if (err < 0) | ||
327 | goto out_irqdomain_remove; | ||
321 | 328 | ||
322 | /* setup one handler for each entry */ | 329 | /* setup one handler for each entry */ |
323 | irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler, | 330 | irq_set_chained_handler_and_data(port->irq, mxs_gpio_irq_handler, |
@@ -343,6 +350,8 @@ static int mxs_gpio_probe(struct platform_device *pdev) | |||
343 | 350 | ||
344 | out_bgpio_remove: | 351 | out_bgpio_remove: |
345 | bgpio_remove(&port->bgc); | 352 | bgpio_remove(&port->bgc); |
353 | out_irqdomain_remove: | ||
354 | irq_domain_remove(port->domain); | ||
346 | out_irqdesc_free: | 355 | out_irqdesc_free: |
347 | irq_free_descs(irq_base, 32); | 356 | irq_free_descs(irq_base, 32); |
348 | return err; | 357 | return err; |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 2ae0d47e9554..5236db161e76 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -709,7 +709,7 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset) | |||
709 | * line's interrupt handler has been run, we may miss some nested | 709 | * line's interrupt handler has been run, we may miss some nested |
710 | * interrupts. | 710 | * interrupts. |
711 | */ | 711 | */ |
712 | static void omap_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 712 | static void omap_gpio_irq_handler(struct irq_desc *desc) |
713 | { | 713 | { |
714 | void __iomem *isr_reg = NULL; | 714 | void __iomem *isr_reg = NULL; |
715 | u32 isr; | 715 | u32 isr; |
@@ -1098,7 +1098,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) | |||
1098 | } else { | 1098 | } else { |
1099 | bank->chip.label = "gpio"; | 1099 | bank->chip.label = "gpio"; |
1100 | bank->chip.base = gpio; | 1100 | bank->chip.base = gpio; |
1101 | gpio += bank->width; | ||
1102 | } | 1101 | } |
1103 | bank->chip.ngpio = bank->width; | 1102 | bank->chip.ngpio = bank->width; |
1104 | 1103 | ||
@@ -1108,6 +1107,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) | |||
1108 | return ret; | 1107 | return ret; |
1109 | } | 1108 | } |
1110 | 1109 | ||
1110 | if (!bank->is_mpuio) | ||
1111 | gpio += bank->width; | ||
1112 | |||
1111 | #ifdef CONFIG_ARCH_OMAP1 | 1113 | #ifdef CONFIG_ARCH_OMAP1 |
1112 | /* | 1114 | /* |
1113 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop | 1115 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop |
@@ -1253,8 +1255,11 @@ static int omap_gpio_probe(struct platform_device *pdev) | |||
1253 | omap_gpio_mod_init(bank); | 1255 | omap_gpio_mod_init(bank); |
1254 | 1256 | ||
1255 | ret = omap_gpio_chip_init(bank, irqc); | 1257 | ret = omap_gpio_chip_init(bank, irqc); |
1256 | if (ret) | 1258 | if (ret) { |
1259 | pm_runtime_put_sync(bank->dev); | ||
1260 | pm_runtime_disable(bank->dev); | ||
1257 | return ret; | 1261 | return ret; |
1262 | } | ||
1258 | 1263 | ||
1259 | omap_gpio_show_rev(bank); | 1264 | omap_gpio_show_rev(bank); |
1260 | 1265 | ||
diff --git a/drivers/gpio/gpio-pl061.c b/drivers/gpio/gpio-pl061.c index 04756130437f..229ef653e0f8 100644 --- a/drivers/gpio/gpio-pl061.c +++ b/drivers/gpio/gpio-pl061.c | |||
@@ -187,7 +187,7 @@ static int pl061_irq_type(struct irq_data *d, unsigned trigger) | |||
187 | return 0; | 187 | return 0; |
188 | } | 188 | } |
189 | 189 | ||
190 | static void pl061_irq_handler(unsigned irq, struct irq_desc *desc) | 190 | static void pl061_irq_handler(struct irq_desc *desc) |
191 | { | 191 | { |
192 | unsigned long pending; | 192 | unsigned long pending; |
193 | int offset; | 193 | int offset; |
diff --git a/drivers/gpio/gpio-pxa.c b/drivers/gpio/gpio-pxa.c index 55a11de3d5b7..df2ce550f309 100644 --- a/drivers/gpio/gpio-pxa.c +++ b/drivers/gpio/gpio-pxa.c | |||
@@ -401,7 +401,7 @@ static int pxa_gpio_irq_type(struct irq_data *d, unsigned int type) | |||
401 | return 0; | 401 | return 0; |
402 | } | 402 | } |
403 | 403 | ||
404 | static void pxa_gpio_demux_handler(unsigned int irq, struct irq_desc *desc) | 404 | static void pxa_gpio_demux_handler(struct irq_desc *desc) |
405 | { | 405 | { |
406 | struct pxa_gpio_chip *c; | 406 | struct pxa_gpio_chip *c; |
407 | int loop, gpio, gpio_base, n; | 407 | int loop, gpio, gpio_base, n; |
diff --git a/drivers/gpio/gpio-sa1100.c b/drivers/gpio/gpio-sa1100.c index 67bd2f5d89e8..990fa9023e22 100644 --- a/drivers/gpio/gpio-sa1100.c +++ b/drivers/gpio/gpio-sa1100.c | |||
@@ -172,8 +172,7 @@ static struct irq_domain *sa1100_gpio_irqdomain; | |||
172 | * irq_controller_lock held, and IRQs disabled. Decode the IRQ | 172 | * irq_controller_lock held, and IRQs disabled. Decode the IRQ |
173 | * and call the handler. | 173 | * and call the handler. |
174 | */ | 174 | */ |
175 | static void | 175 | static void sa1100_gpio_handler(struct irq_desc *desc) |
176 | sa1100_gpio_handler(unsigned int __irq, struct irq_desc *desc) | ||
177 | { | 176 | { |
178 | unsigned int irq, mask; | 177 | unsigned int irq, mask; |
179 | 178 | ||
diff --git a/drivers/gpio/gpio-sx150x.c b/drivers/gpio/gpio-sx150x.c index 458d9d7952b8..9c6b96707c9f 100644 --- a/drivers/gpio/gpio-sx150x.c +++ b/drivers/gpio/gpio-sx150x.c | |||
@@ -706,4 +706,3 @@ module_exit(sx150x_exit); | |||
706 | MODULE_AUTHOR("Gregory Bean <gbean@codeaurora.org>"); | 706 | MODULE_AUTHOR("Gregory Bean <gbean@codeaurora.org>"); |
707 | MODULE_DESCRIPTION("Driver for Semtech SX150X I2C GPIO Expanders"); | 707 | MODULE_DESCRIPTION("Driver for Semtech SX150X I2C GPIO Expanders"); |
708 | MODULE_LICENSE("GPL v2"); | 708 | MODULE_LICENSE("GPL v2"); |
709 | MODULE_ALIAS("i2c:sx150x"); | ||
diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c index 9b14aafb576d..027e5f47dd28 100644 --- a/drivers/gpio/gpio-tegra.c +++ b/drivers/gpio/gpio-tegra.c | |||
@@ -266,7 +266,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d) | |||
266 | gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio); | 266 | gpiochip_unlock_as_irq(&tegra_gpio_chip, gpio); |
267 | } | 267 | } |
268 | 268 | ||
269 | static void tegra_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 269 | static void tegra_gpio_irq_handler(struct irq_desc *desc) |
270 | { | 270 | { |
271 | int port; | 271 | int port; |
272 | int pin; | 272 | int pin; |
diff --git a/drivers/gpio/gpio-timberdale.c b/drivers/gpio/gpio-timberdale.c index 5a492054589f..30653e6319e9 100644 --- a/drivers/gpio/gpio-timberdale.c +++ b/drivers/gpio/gpio-timberdale.c | |||
@@ -192,7 +192,7 @@ out: | |||
192 | return ret; | 192 | return ret; |
193 | } | 193 | } |
194 | 194 | ||
195 | static void timbgpio_irq(unsigned int irq, struct irq_desc *desc) | 195 | static void timbgpio_irq(struct irq_desc *desc) |
196 | { | 196 | { |
197 | struct timbgpio *tgpio = irq_desc_get_handler_data(desc); | 197 | struct timbgpio *tgpio = irq_desc_get_handler_data(desc); |
198 | struct irq_data *data = irq_desc_get_irq_data(desc); | 198 | struct irq_data *data = irq_desc_get_irq_data(desc); |
diff --git a/drivers/gpio/gpio-tz1090.c b/drivers/gpio/gpio-tz1090.c index bbac92ae4c32..87bb1b1eee8d 100644 --- a/drivers/gpio/gpio-tz1090.c +++ b/drivers/gpio/gpio-tz1090.c | |||
@@ -375,7 +375,7 @@ static int gpio_set_irq_wake(struct irq_data *data, unsigned int on) | |||
375 | #define gpio_set_irq_wake NULL | 375 | #define gpio_set_irq_wake NULL |
376 | #endif | 376 | #endif |
377 | 377 | ||
378 | static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 378 | static void tz1090_gpio_irq_handler(struct irq_desc *desc) |
379 | { | 379 | { |
380 | irq_hw_number_t hw; | 380 | irq_hw_number_t hw; |
381 | unsigned int irq_stat, irq_no; | 381 | unsigned int irq_stat, irq_no; |
@@ -400,7 +400,7 @@ static void tz1090_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
400 | == IRQ_TYPE_EDGE_BOTH) | 400 | == IRQ_TYPE_EDGE_BOTH) |
401 | tz1090_gpio_irq_next_edge(bank, hw); | 401 | tz1090_gpio_irq_next_edge(bank, hw); |
402 | 402 | ||
403 | generic_handle_irq_desc(irq_no, child_desc); | 403 | generic_handle_irq_desc(child_desc); |
404 | } | 404 | } |
405 | } | 405 | } |
406 | 406 | ||
diff --git a/drivers/gpio/gpio-vf610.c b/drivers/gpio/gpio-vf610.c index 3d5714d4f405..069f9e4b7daa 100644 --- a/drivers/gpio/gpio-vf610.c +++ b/drivers/gpio/gpio-vf610.c | |||
@@ -120,7 +120,7 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, | |||
120 | return pinctrl_gpio_direction_output(chip->base + gpio); | 120 | return pinctrl_gpio_direction_output(chip->base + gpio); |
121 | } | 121 | } |
122 | 122 | ||
123 | static void vf610_gpio_irq_handler(u32 irq, struct irq_desc *desc) | 123 | static void vf610_gpio_irq_handler(struct irq_desc *desc) |
124 | { | 124 | { |
125 | struct vf610_gpio_port *port = irq_desc_get_handler_data(desc); | 125 | struct vf610_gpio_port *port = irq_desc_get_handler_data(desc); |
126 | struct irq_chip *chip = irq_desc_get_chip(desc); | 126 | struct irq_chip *chip = irq_desc_get_chip(desc); |
@@ -176,9 +176,9 @@ static int vf610_gpio_irq_set_type(struct irq_data *d, u32 type) | |||
176 | port->irqc[d->hwirq] = irqc; | 176 | port->irqc[d->hwirq] = irqc; |
177 | 177 | ||
178 | if (type & IRQ_TYPE_LEVEL_MASK) | 178 | if (type & IRQ_TYPE_LEVEL_MASK) |
179 | __irq_set_handler_locked(d->irq, handle_level_irq); | 179 | irq_set_handler_locked(d, handle_level_irq); |
180 | else | 180 | else |
181 | __irq_set_handler_locked(d->irq, handle_edge_irq); | 181 | irq_set_handler_locked(d, handle_edge_irq); |
182 | 182 | ||
183 | return 0; | 183 | return 0; |
184 | } | 184 | } |
diff --git a/drivers/gpio/gpio-zx.c b/drivers/gpio/gpio-zx.c index 12ee1969298c..4b8a26910705 100644 --- a/drivers/gpio/gpio-zx.c +++ b/drivers/gpio/gpio-zx.c | |||
@@ -177,7 +177,7 @@ static int zx_irq_type(struct irq_data *d, unsigned trigger) | |||
177 | return 0; | 177 | return 0; |
178 | } | 178 | } |
179 | 179 | ||
180 | static void zx_irq_handler(unsigned irq, struct irq_desc *desc) | 180 | static void zx_irq_handler(struct irq_desc *desc) |
181 | { | 181 | { |
182 | unsigned long pending; | 182 | unsigned long pending; |
183 | int offset; | 183 | int offset; |
diff --git a/drivers/gpio/gpio-zynq.c b/drivers/gpio/gpio-zynq.c index 27348e7cb705..1d1a5865ede9 100644 --- a/drivers/gpio/gpio-zynq.c +++ b/drivers/gpio/gpio-zynq.c | |||
@@ -514,7 +514,7 @@ static void zynq_gpio_handle_bank_irq(struct zynq_gpio *gpio, | |||
514 | * application for that pin. | 514 | * application for that pin. |
515 | * Note: A bug is reported if no handler is set for the gpio pin. | 515 | * Note: A bug is reported if no handler is set for the gpio pin. |
516 | */ | 516 | */ |
517 | static void zynq_gpio_irqhandler(unsigned int irq, struct irq_desc *desc) | 517 | static void zynq_gpio_irqhandler(struct irq_desc *desc) |
518 | { | 518 | { |
519 | u32 int_sts, int_enb; | 519 | u32 int_sts, int_enb; |
520 | unsigned int bank_num; | 520 | unsigned int bank_num; |
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 980c1f87866a..5db3445552b1 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c | |||
@@ -1174,15 +1174,16 @@ EXPORT_SYMBOL_GPL(gpiod_is_active_low); | |||
1174 | * that the GPIO was actually requested. | 1174 | * that the GPIO was actually requested. |
1175 | */ | 1175 | */ |
1176 | 1176 | ||
1177 | static bool _gpiod_get_raw_value(const struct gpio_desc *desc) | 1177 | static int _gpiod_get_raw_value(const struct gpio_desc *desc) |
1178 | { | 1178 | { |
1179 | struct gpio_chip *chip; | 1179 | struct gpio_chip *chip; |
1180 | bool value; | ||
1181 | int offset; | 1180 | int offset; |
1181 | int value; | ||
1182 | 1182 | ||
1183 | chip = desc->chip; | 1183 | chip = desc->chip; |
1184 | offset = gpio_chip_hwgpio(desc); | 1184 | offset = gpio_chip_hwgpio(desc); |
1185 | value = chip->get ? chip->get(chip, offset) : false; | 1185 | value = chip->get ? chip->get(chip, offset) : -EIO; |
1186 | value = value < 0 ? value : !!value; | ||
1186 | trace_gpio_value(desc_to_gpio(desc), 1, value); | 1187 | trace_gpio_value(desc_to_gpio(desc), 1, value); |
1187 | return value; | 1188 | return value; |
1188 | } | 1189 | } |
@@ -1192,7 +1193,7 @@ static bool _gpiod_get_raw_value(const struct gpio_desc *desc) | |||
1192 | * @desc: gpio whose value will be returned | 1193 | * @desc: gpio whose value will be returned |
1193 | * | 1194 | * |
1194 | * Return the GPIO's raw value, i.e. the value of the physical line disregarding | 1195 | * Return the GPIO's raw value, i.e. the value of the physical line disregarding |
1195 | * its ACTIVE_LOW status. | 1196 | * its ACTIVE_LOW status, or negative errno on failure. |
1196 | * | 1197 | * |
1197 | * This function should be called from contexts where we cannot sleep, and will | 1198 | * This function should be called from contexts where we cannot sleep, and will |
1198 | * complain if the GPIO chip functions potentially sleep. | 1199 | * complain if the GPIO chip functions potentially sleep. |
@@ -1212,7 +1213,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_raw_value); | |||
1212 | * @desc: gpio whose value will be returned | 1213 | * @desc: gpio whose value will be returned |
1213 | * | 1214 | * |
1214 | * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into | 1215 | * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into |
1215 | * account. | 1216 | * account, or negative errno on failure. |
1216 | * | 1217 | * |
1217 | * This function should be called from contexts where we cannot sleep, and will | 1218 | * This function should be called from contexts where we cannot sleep, and will |
1218 | * complain if the GPIO chip functions potentially sleep. | 1219 | * complain if the GPIO chip functions potentially sleep. |
@@ -1226,6 +1227,9 @@ int gpiod_get_value(const struct gpio_desc *desc) | |||
1226 | WARN_ON(desc->chip->can_sleep); | 1227 | WARN_ON(desc->chip->can_sleep); |
1227 | 1228 | ||
1228 | value = _gpiod_get_raw_value(desc); | 1229 | value = _gpiod_get_raw_value(desc); |
1230 | if (value < 0) | ||
1231 | return value; | ||
1232 | |||
1229 | if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) | 1233 | if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) |
1230 | value = !value; | 1234 | value = !value; |
1231 | 1235 | ||
@@ -1548,7 +1552,7 @@ EXPORT_SYMBOL_GPL(gpiochip_unlock_as_irq); | |||
1548 | * @desc: gpio whose value will be returned | 1552 | * @desc: gpio whose value will be returned |
1549 | * | 1553 | * |
1550 | * Return the GPIO's raw value, i.e. the value of the physical line disregarding | 1554 | * Return the GPIO's raw value, i.e. the value of the physical line disregarding |
1551 | * its ACTIVE_LOW status. | 1555 | * its ACTIVE_LOW status, or negative errno on failure. |
1552 | * | 1556 | * |
1553 | * This function is to be called from contexts that can sleep. | 1557 | * This function is to be called from contexts that can sleep. |
1554 | */ | 1558 | */ |
@@ -1566,7 +1570,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_raw_value_cansleep); | |||
1566 | * @desc: gpio whose value will be returned | 1570 | * @desc: gpio whose value will be returned |
1567 | * | 1571 | * |
1568 | * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into | 1572 | * Return the GPIO's logical value, i.e. taking the ACTIVE_LOW status into |
1569 | * account. | 1573 | * account, or negative errno on failure. |
1570 | * | 1574 | * |
1571 | * This function is to be called from contexts that can sleep. | 1575 | * This function is to be called from contexts that can sleep. |
1572 | */ | 1576 | */ |
@@ -1579,6 +1583,9 @@ int gpiod_get_value_cansleep(const struct gpio_desc *desc) | |||
1579 | return 0; | 1583 | return 0; |
1580 | 1584 | ||
1581 | value = _gpiod_get_raw_value(desc); | 1585 | value = _gpiod_get_raw_value(desc); |
1586 | if (value < 0) | ||
1587 | return value; | ||
1588 | |||
1582 | if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) | 1589 | if (test_bit(FLAG_ACTIVE_LOW, &desc->flags)) |
1583 | value = !value; | 1590 | value = !value; |
1584 | 1591 | ||
diff --git a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c index b1f73bee1368..b0d4b53b97f4 100644 --- a/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c +++ b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_irq.c | |||
@@ -178,7 +178,6 @@ static int mdp5_hw_irqdomain_map(struct irq_domain *d, | |||
178 | 178 | ||
179 | irq_set_chip_and_handler(irq, &mdp5_hw_irq_chip, handle_level_irq); | 179 | irq_set_chip_and_handler(irq, &mdp5_hw_irq_chip, handle_level_irq); |
180 | irq_set_chip_data(irq, mdp5_kms); | 180 | irq_set_chip_data(irq, mdp5_kms); |
181 | set_irq_flags(irq, IRQF_VALID); | ||
182 | 181 | ||
183 | return 0; | 182 | return 0; |
184 | } | 183 | } |
diff --git a/drivers/gpu/ipu-v3/ipu-common.c b/drivers/gpu/ipu-v3/ipu-common.c index 243f99a80253..e5a38d202a21 100644 --- a/drivers/gpu/ipu-v3/ipu-common.c +++ b/drivers/gpu/ipu-v3/ipu-common.c | |||
@@ -912,7 +912,7 @@ static void ipu_irq_handle(struct ipu_soc *ipu, const int *regs, int num_regs) | |||
912 | } | 912 | } |
913 | } | 913 | } |
914 | 914 | ||
915 | static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc) | 915 | static void ipu_irq_handler(struct irq_desc *desc) |
916 | { | 916 | { |
917 | struct ipu_soc *ipu = irq_desc_get_handler_data(desc); | 917 | struct ipu_soc *ipu = irq_desc_get_handler_data(desc); |
918 | struct irq_chip *chip = irq_desc_get_chip(desc); | 918 | struct irq_chip *chip = irq_desc_get_chip(desc); |
@@ -925,7 +925,7 @@ static void ipu_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
925 | chained_irq_exit(chip, desc); | 925 | chained_irq_exit(chip, desc); |
926 | } | 926 | } |
927 | 927 | ||
928 | static void ipu_err_irq_handler(unsigned int irq, struct irq_desc *desc) | 928 | static void ipu_err_irq_handler(struct irq_desc *desc) |
929 | { | 929 | { |
930 | struct ipu_soc *ipu = irq_desc_get_handler_data(desc); | 930 | struct ipu_soc *ipu = irq_desc_get_handler_data(desc); |
931 | struct irq_chip *chip = irq_desc_get_chip(desc); | 931 | struct irq_chip *chip = irq_desc_get_chip(desc); |
@@ -1099,8 +1099,7 @@ static int ipu_irq_init(struct ipu_soc *ipu) | |||
1099 | } | 1099 | } |
1100 | 1100 | ||
1101 | ret = irq_alloc_domain_generic_chips(ipu->domain, 32, 1, "IPU", | 1101 | ret = irq_alloc_domain_generic_chips(ipu->domain, 32, 1, "IPU", |
1102 | handle_level_irq, 0, | 1102 | handle_level_irq, 0, 0, 0); |
1103 | IRQF_VALID, 0); | ||
1104 | if (ret < 0) { | 1103 | if (ret < 0) { |
1105 | dev_err(ipu->dev, "failed to alloc generic irq chips\n"); | 1104 | dev_err(ipu->dev, "failed to alloc generic irq chips\n"); |
1106 | irq_domain_remove(ipu->domain); | 1105 | irq_domain_remove(ipu->domain); |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index 500b262b89bb..e13c902e8966 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -1140,8 +1140,8 @@ config SENSORS_NCT6775 | |||
1140 | help | 1140 | help |
1141 | If you say yes here you get support for the hardware monitoring | 1141 | If you say yes here you get support for the hardware monitoring |
1142 | functionality of the Nuvoton NCT6106D, NCT6775F, NCT6776F, NCT6779D, | 1142 | functionality of the Nuvoton NCT6106D, NCT6775F, NCT6776F, NCT6779D, |
1143 | NCT6791D, NCT6792D and compatible Super-I/O chips. This driver | 1143 | NCT6791D, NCT6792D, NCT6793D, and compatible Super-I/O chips. This |
1144 | replaces the w83627ehf driver for NCT6775F and NCT6776F. | 1144 | driver replaces the w83627ehf driver for NCT6775F and NCT6776F. |
1145 | 1145 | ||
1146 | This driver can also be built as a module. If so, the module | 1146 | This driver can also be built as a module. If so, the module |
1147 | will be called nct6775. | 1147 | will be called nct6775. |
diff --git a/drivers/hwmon/nct6775.c b/drivers/hwmon/nct6775.c index bd1c99deac71..8b4fa55e46c6 100644 --- a/drivers/hwmon/nct6775.c +++ b/drivers/hwmon/nct6775.c | |||
@@ -39,6 +39,7 @@ | |||
39 | * nct6779d 15 5 5 2+6 0xc560 0xc1 0x5ca3 | 39 | * nct6779d 15 5 5 2+6 0xc560 0xc1 0x5ca3 |
40 | * nct6791d 15 6 6 2+6 0xc800 0xc1 0x5ca3 | 40 | * nct6791d 15 6 6 2+6 0xc800 0xc1 0x5ca3 |
41 | * nct6792d 15 6 6 2+6 0xc910 0xc1 0x5ca3 | 41 | * nct6792d 15 6 6 2+6 0xc910 0xc1 0x5ca3 |
42 | * nct6793d 15 6 6 2+6 0xd120 0xc1 0x5ca3 | ||
42 | * | 43 | * |
43 | * #temp lists the number of monitored temperature sources (first value) plus | 44 | * #temp lists the number of monitored temperature sources (first value) plus |
44 | * the number of directly connectable temperature sensors (second value). | 45 | * the number of directly connectable temperature sensors (second value). |
@@ -63,7 +64,7 @@ | |||
63 | 64 | ||
64 | #define USE_ALTERNATE | 65 | #define USE_ALTERNATE |
65 | 66 | ||
66 | enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792 }; | 67 | enum kinds { nct6106, nct6775, nct6776, nct6779, nct6791, nct6792, nct6793 }; |
67 | 68 | ||
68 | /* used to set data->name = nct6775_device_names[data->sio_kind] */ | 69 | /* used to set data->name = nct6775_device_names[data->sio_kind] */ |
69 | static const char * const nct6775_device_names[] = { | 70 | static const char * const nct6775_device_names[] = { |
@@ -73,6 +74,17 @@ static const char * const nct6775_device_names[] = { | |||
73 | "nct6779", | 74 | "nct6779", |
74 | "nct6791", | 75 | "nct6791", |
75 | "nct6792", | 76 | "nct6792", |
77 | "nct6793", | ||
78 | }; | ||
79 | |||
80 | static const char * const nct6775_sio_names[] __initconst = { | ||
81 | "NCT6106D", | ||
82 | "NCT6775F", | ||
83 | "NCT6776D/F", | ||
84 | "NCT6779D", | ||
85 | "NCT6791D", | ||
86 | "NCT6792D", | ||
87 | "NCT6793D", | ||
76 | }; | 88 | }; |
77 | 89 | ||
78 | static unsigned short force_id; | 90 | static unsigned short force_id; |
@@ -104,6 +116,7 @@ MODULE_PARM_DESC(fan_debounce, "Enable debouncing for fan RPM signal"); | |||
104 | #define SIO_NCT6779_ID 0xc560 | 116 | #define SIO_NCT6779_ID 0xc560 |
105 | #define SIO_NCT6791_ID 0xc800 | 117 | #define SIO_NCT6791_ID 0xc800 |
106 | #define SIO_NCT6792_ID 0xc910 | 118 | #define SIO_NCT6792_ID 0xc910 |
119 | #define SIO_NCT6793_ID 0xd120 | ||
107 | #define SIO_ID_MASK 0xFFF0 | 120 | #define SIO_ID_MASK 0xFFF0 |
108 | 121 | ||
109 | enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 }; | 122 | enum pwm_enable { off, manual, thermal_cruise, speed_cruise, sf3, sf4 }; |
@@ -354,6 +367,10 @@ static const u16 NCT6775_REG_TEMP_CRIT[ARRAY_SIZE(nct6775_temp_label) - 1] | |||
354 | 367 | ||
355 | /* NCT6776 specific data */ | 368 | /* NCT6776 specific data */ |
356 | 369 | ||
370 | /* STEP_UP_TIME and STEP_DOWN_TIME regs are swapped for all chips but NCT6775 */ | ||
371 | #define NCT6776_REG_FAN_STEP_UP_TIME NCT6775_REG_FAN_STEP_DOWN_TIME | ||
372 | #define NCT6776_REG_FAN_STEP_DOWN_TIME NCT6775_REG_FAN_STEP_UP_TIME | ||
373 | |||
357 | static const s8 NCT6776_ALARM_BITS[] = { | 374 | static const s8 NCT6776_ALARM_BITS[] = { |
358 | 0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */ | 375 | 0, 1, 2, 3, 8, 21, 20, 16, /* in0.. in7 */ |
359 | 17, -1, -1, -1, -1, -1, -1, /* in8..in14 */ | 376 | 17, -1, -1, -1, -1, -1, -1, /* in8..in14 */ |
@@ -533,7 +550,7 @@ static const s8 NCT6791_ALARM_BITS[] = { | |||
533 | 4, 5, 13, -1, -1, -1, /* temp1..temp6 */ | 550 | 4, 5, 13, -1, -1, -1, /* temp1..temp6 */ |
534 | 12, 9 }; /* intrusion0, intrusion1 */ | 551 | 12, 9 }; /* intrusion0, intrusion1 */ |
535 | 552 | ||
536 | /* NCT6792 specific data */ | 553 | /* NCT6792/NCT6793 specific data */ |
537 | 554 | ||
538 | static const u16 NCT6792_REG_TEMP_MON[] = { | 555 | static const u16 NCT6792_REG_TEMP_MON[] = { |
539 | 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d }; | 556 | 0x73, 0x75, 0x77, 0x79, 0x7b, 0x7d }; |
@@ -1056,6 +1073,7 @@ static bool is_word_sized(struct nct6775_data *data, u16 reg) | |||
1056 | case nct6779: | 1073 | case nct6779: |
1057 | case nct6791: | 1074 | case nct6791: |
1058 | case nct6792: | 1075 | case nct6792: |
1076 | case nct6793: | ||
1059 | return reg == 0x150 || reg == 0x153 || reg == 0x155 || | 1077 | return reg == 0x150 || reg == 0x153 || reg == 0x155 || |
1060 | ((reg & 0xfff0) == 0x4b0 && (reg & 0x000f) < 0x0b) || | 1078 | ((reg & 0xfff0) == 0x4b0 && (reg & 0x000f) < 0x0b) || |
1061 | reg == 0x402 || | 1079 | reg == 0x402 || |
@@ -1407,6 +1425,7 @@ static void nct6775_update_pwm_limits(struct device *dev) | |||
1407 | case nct6779: | 1425 | case nct6779: |
1408 | case nct6791: | 1426 | case nct6791: |
1409 | case nct6792: | 1427 | case nct6792: |
1428 | case nct6793: | ||
1410 | reg = nct6775_read_value(data, | 1429 | reg = nct6775_read_value(data, |
1411 | data->REG_CRITICAL_PWM_ENABLE[i]); | 1430 | data->REG_CRITICAL_PWM_ENABLE[i]); |
1412 | if (reg & data->CRITICAL_PWM_ENABLE_MASK) | 1431 | if (reg & data->CRITICAL_PWM_ENABLE_MASK) |
@@ -2822,6 +2841,7 @@ store_auto_pwm(struct device *dev, struct device_attribute *attr, | |||
2822 | case nct6779: | 2841 | case nct6779: |
2823 | case nct6791: | 2842 | case nct6791: |
2824 | case nct6792: | 2843 | case nct6792: |
2844 | case nct6793: | ||
2825 | nct6775_write_value(data, data->REG_CRITICAL_PWM[nr], | 2845 | nct6775_write_value(data, data->REG_CRITICAL_PWM[nr], |
2826 | val); | 2846 | val); |
2827 | reg = nct6775_read_value(data, | 2847 | reg = nct6775_read_value(data, |
@@ -3256,7 +3276,7 @@ nct6775_check_fan_inputs(struct nct6775_data *data) | |||
3256 | pwm4pin = false; | 3276 | pwm4pin = false; |
3257 | pwm5pin = false; | 3277 | pwm5pin = false; |
3258 | pwm6pin = false; | 3278 | pwm6pin = false; |
3259 | } else { /* NCT6779D, NCT6791D, or NCT6792D */ | 3279 | } else { /* NCT6779D, NCT6791D, NCT6792D, or NCT6793D */ |
3260 | regval = superio_inb(sioreg, 0x1c); | 3280 | regval = superio_inb(sioreg, 0x1c); |
3261 | 3281 | ||
3262 | fan3pin = !(regval & (1 << 5)); | 3282 | fan3pin = !(regval & (1 << 5)); |
@@ -3269,7 +3289,8 @@ nct6775_check_fan_inputs(struct nct6775_data *data) | |||
3269 | 3289 | ||
3270 | fan4min = fan4pin; | 3290 | fan4min = fan4pin; |
3271 | 3291 | ||
3272 | if (data->kind == nct6791 || data->kind == nct6792) { | 3292 | if (data->kind == nct6791 || data->kind == nct6792 || |
3293 | data->kind == nct6793) { | ||
3273 | regval = superio_inb(sioreg, 0x2d); | 3294 | regval = superio_inb(sioreg, 0x2d); |
3274 | fan6pin = (regval & (1 << 1)); | 3295 | fan6pin = (regval & (1 << 1)); |
3275 | pwm6pin = (regval & (1 << 0)); | 3296 | pwm6pin = (regval & (1 << 0)); |
@@ -3528,8 +3549,8 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3528 | data->REG_FAN_PULSES = NCT6776_REG_FAN_PULSES; | 3549 | data->REG_FAN_PULSES = NCT6776_REG_FAN_PULSES; |
3529 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; | 3550 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; |
3530 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; | 3551 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; |
3531 | data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; | 3552 | data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; |
3532 | data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; | 3553 | data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; |
3533 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; | 3554 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; |
3534 | data->REG_PWM[0] = NCT6775_REG_PWM; | 3555 | data->REG_PWM[0] = NCT6775_REG_PWM; |
3535 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; | 3556 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; |
@@ -3600,8 +3621,8 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3600 | data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; | 3621 | data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; |
3601 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; | 3622 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; |
3602 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; | 3623 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; |
3603 | data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; | 3624 | data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; |
3604 | data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; | 3625 | data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; |
3605 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; | 3626 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; |
3606 | data->REG_PWM[0] = NCT6775_REG_PWM; | 3627 | data->REG_PWM[0] = NCT6775_REG_PWM; |
3607 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; | 3628 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; |
@@ -3643,6 +3664,7 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3643 | break; | 3664 | break; |
3644 | case nct6791: | 3665 | case nct6791: |
3645 | case nct6792: | 3666 | case nct6792: |
3667 | case nct6793: | ||
3646 | data->in_num = 15; | 3668 | data->in_num = 15; |
3647 | data->pwm_num = 6; | 3669 | data->pwm_num = 6; |
3648 | data->auto_pwm_num = 4; | 3670 | data->auto_pwm_num = 4; |
@@ -3677,8 +3699,8 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3677 | data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; | 3699 | data->REG_FAN_PULSES = NCT6779_REG_FAN_PULSES; |
3678 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; | 3700 | data->FAN_PULSE_SHIFT = NCT6775_FAN_PULSE_SHIFT; |
3679 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; | 3701 | data->REG_FAN_TIME[0] = NCT6775_REG_FAN_STOP_TIME; |
3680 | data->REG_FAN_TIME[1] = NCT6775_REG_FAN_STEP_UP_TIME; | 3702 | data->REG_FAN_TIME[1] = NCT6776_REG_FAN_STEP_UP_TIME; |
3681 | data->REG_FAN_TIME[2] = NCT6775_REG_FAN_STEP_DOWN_TIME; | 3703 | data->REG_FAN_TIME[2] = NCT6776_REG_FAN_STEP_DOWN_TIME; |
3682 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; | 3704 | data->REG_TOLERANCE_H = NCT6776_REG_TOLERANCE_H; |
3683 | data->REG_PWM[0] = NCT6775_REG_PWM; | 3705 | data->REG_PWM[0] = NCT6775_REG_PWM; |
3684 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; | 3706 | data->REG_PWM[1] = NCT6775_REG_FAN_START_OUTPUT; |
@@ -3918,6 +3940,7 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3918 | case nct6779: | 3940 | case nct6779: |
3919 | case nct6791: | 3941 | case nct6791: |
3920 | case nct6792: | 3942 | case nct6792: |
3943 | case nct6793: | ||
3921 | break; | 3944 | break; |
3922 | } | 3945 | } |
3923 | 3946 | ||
@@ -3950,6 +3973,7 @@ static int nct6775_probe(struct platform_device *pdev) | |||
3950 | break; | 3973 | break; |
3951 | case nct6791: | 3974 | case nct6791: |
3952 | case nct6792: | 3975 | case nct6792: |
3976 | case nct6793: | ||
3953 | tmp |= 0x7e; | 3977 | tmp |= 0x7e; |
3954 | break; | 3978 | break; |
3955 | } | 3979 | } |
@@ -4047,7 +4071,8 @@ static int __maybe_unused nct6775_resume(struct device *dev) | |||
4047 | if (reg != data->sio_reg_enable) | 4071 | if (reg != data->sio_reg_enable) |
4048 | superio_outb(sioreg, SIO_REG_ENABLE, data->sio_reg_enable); | 4072 | superio_outb(sioreg, SIO_REG_ENABLE, data->sio_reg_enable); |
4049 | 4073 | ||
4050 | if (data->kind == nct6791 || data->kind == nct6792) | 4074 | if (data->kind == nct6791 || data->kind == nct6792 || |
4075 | data->kind == nct6793) | ||
4051 | nct6791_enable_io_mapping(sioreg); | 4076 | nct6791_enable_io_mapping(sioreg); |
4052 | 4077 | ||
4053 | superio_exit(sioreg); | 4078 | superio_exit(sioreg); |
@@ -4106,15 +4131,6 @@ static struct platform_driver nct6775_driver = { | |||
4106 | .probe = nct6775_probe, | 4131 | .probe = nct6775_probe, |
4107 | }; | 4132 | }; |
4108 | 4133 | ||
4109 | static const char * const nct6775_sio_names[] __initconst = { | ||
4110 | "NCT6106D", | ||
4111 | "NCT6775F", | ||
4112 | "NCT6776D/F", | ||
4113 | "NCT6779D", | ||
4114 | "NCT6791D", | ||
4115 | "NCT6792D", | ||
4116 | }; | ||
4117 | |||
4118 | /* nct6775_find() looks for a '627 in the Super-I/O config space */ | 4134 | /* nct6775_find() looks for a '627 in the Super-I/O config space */ |
4119 | static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) | 4135 | static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) |
4120 | { | 4136 | { |
@@ -4150,6 +4166,9 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) | |||
4150 | case SIO_NCT6792_ID: | 4166 | case SIO_NCT6792_ID: |
4151 | sio_data->kind = nct6792; | 4167 | sio_data->kind = nct6792; |
4152 | break; | 4168 | break; |
4169 | case SIO_NCT6793_ID: | ||
4170 | sio_data->kind = nct6793; | ||
4171 | break; | ||
4153 | default: | 4172 | default: |
4154 | if (val != 0xffff) | 4173 | if (val != 0xffff) |
4155 | pr_debug("unsupported chip ID: 0x%04x\n", val); | 4174 | pr_debug("unsupported chip ID: 0x%04x\n", val); |
@@ -4175,7 +4194,8 @@ static int __init nct6775_find(int sioaddr, struct nct6775_sio_data *sio_data) | |||
4175 | superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01); | 4194 | superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01); |
4176 | } | 4195 | } |
4177 | 4196 | ||
4178 | if (sio_data->kind == nct6791 || sio_data->kind == nct6792) | 4197 | if (sio_data->kind == nct6791 || sio_data->kind == nct6792 || |
4198 | sio_data->kind == nct6793) | ||
4179 | nct6791_enable_io_mapping(sioaddr); | 4199 | nct6791_enable_io_mapping(sioaddr); |
4180 | 4200 | ||
4181 | superio_exit(sioaddr); | 4201 | superio_exit(sioaddr); |
@@ -4285,7 +4305,7 @@ static void __exit sensors_nct6775_exit(void) | |||
4285 | } | 4305 | } |
4286 | 4306 | ||
4287 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); | 4307 | MODULE_AUTHOR("Guenter Roeck <linux@roeck-us.net>"); |
4288 | MODULE_DESCRIPTION("NCT6106D/NCT6775F/NCT6776F/NCT6779D/NCT6791D/NCT6792D driver"); | 4308 | MODULE_DESCRIPTION("Driver for NCT6775F and compatible chips"); |
4289 | MODULE_LICENSE("GPL"); | 4309 | MODULE_LICENSE("GPL"); |
4290 | 4310 | ||
4291 | module_init(sensors_nct6775_init); | 4311 | module_init(sensors_nct6775_init); |
diff --git a/drivers/infiniband/Kconfig b/drivers/infiniband/Kconfig index da4c6979fbb8..aa26f3c3416b 100644 --- a/drivers/infiniband/Kconfig +++ b/drivers/infiniband/Kconfig | |||
@@ -56,7 +56,6 @@ config INFINIBAND_ADDR_TRANS | |||
56 | 56 | ||
57 | source "drivers/infiniband/hw/mthca/Kconfig" | 57 | source "drivers/infiniband/hw/mthca/Kconfig" |
58 | source "drivers/infiniband/hw/qib/Kconfig" | 58 | source "drivers/infiniband/hw/qib/Kconfig" |
59 | source "drivers/infiniband/hw/ehca/Kconfig" | ||
60 | source "drivers/infiniband/hw/cxgb3/Kconfig" | 59 | source "drivers/infiniband/hw/cxgb3/Kconfig" |
61 | source "drivers/infiniband/hw/cxgb4/Kconfig" | 60 | source "drivers/infiniband/hw/cxgb4/Kconfig" |
62 | source "drivers/infiniband/hw/mlx4/Kconfig" | 61 | source "drivers/infiniband/hw/mlx4/Kconfig" |
diff --git a/drivers/infiniband/hw/Makefile b/drivers/infiniband/hw/Makefile index 1bdb9996d371..aded2a5cc2d5 100644 --- a/drivers/infiniband/hw/Makefile +++ b/drivers/infiniband/hw/Makefile | |||
@@ -1,6 +1,5 @@ | |||
1 | obj-$(CONFIG_INFINIBAND_MTHCA) += mthca/ | 1 | obj-$(CONFIG_INFINIBAND_MTHCA) += mthca/ |
2 | obj-$(CONFIG_INFINIBAND_QIB) += qib/ | 2 | obj-$(CONFIG_INFINIBAND_QIB) += qib/ |
3 | obj-$(CONFIG_INFINIBAND_EHCA) += ehca/ | ||
4 | obj-$(CONFIG_INFINIBAND_CXGB3) += cxgb3/ | 3 | obj-$(CONFIG_INFINIBAND_CXGB3) += cxgb3/ |
5 | obj-$(CONFIG_INFINIBAND_CXGB4) += cxgb4/ | 4 | obj-$(CONFIG_INFINIBAND_CXGB4) += cxgb4/ |
6 | obj-$(CONFIG_MLX4_INFINIBAND) += mlx4/ | 5 | obj-$(CONFIG_MLX4_INFINIBAND) += mlx4/ |
diff --git a/drivers/irqchip/exynos-combiner.c b/drivers/irqchip/exynos-combiner.c index e9c6f2a5b52d..cd7d3bc78e34 100644 --- a/drivers/irqchip/exynos-combiner.c +++ b/drivers/irqchip/exynos-combiner.c | |||
@@ -65,12 +65,10 @@ static void combiner_unmask_irq(struct irq_data *data) | |||
65 | __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET); | 65 | __raw_writel(mask, combiner_base(data) + COMBINER_ENABLE_SET); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void combiner_handle_cascade_irq(unsigned int __irq, | 68 | static void combiner_handle_cascade_irq(struct irq_desc *desc) |
69 | struct irq_desc *desc) | ||
70 | { | 69 | { |
71 | struct combiner_chip_data *chip_data = irq_desc_get_handler_data(desc); | 70 | struct combiner_chip_data *chip_data = irq_desc_get_handler_data(desc); |
72 | struct irq_chip *chip = irq_desc_get_chip(desc); | 71 | struct irq_chip *chip = irq_desc_get_chip(desc); |
73 | unsigned int irq = irq_desc_get_irq(desc); | ||
74 | unsigned int cascade_irq, combiner_irq; | 72 | unsigned int cascade_irq, combiner_irq; |
75 | unsigned long status; | 73 | unsigned long status; |
76 | 74 | ||
@@ -88,7 +86,7 @@ static void combiner_handle_cascade_irq(unsigned int __irq, | |||
88 | cascade_irq = irq_find_mapping(combiner_irq_domain, combiner_irq); | 86 | cascade_irq = irq_find_mapping(combiner_irq_domain, combiner_irq); |
89 | 87 | ||
90 | if (unlikely(!cascade_irq)) | 88 | if (unlikely(!cascade_irq)) |
91 | handle_bad_irq(irq, desc); | 89 | handle_bad_irq(desc); |
92 | else | 90 | else |
93 | generic_handle_irq(cascade_irq); | 91 | generic_handle_irq(cascade_irq); |
94 | 92 | ||
@@ -165,7 +163,7 @@ static int combiner_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
165 | 163 | ||
166 | irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq); | 164 | irq_set_chip_and_handler(irq, &combiner_chip, handle_level_irq); |
167 | irq_set_chip_data(irq, &combiner_data[hw >> 3]); | 165 | irq_set_chip_data(irq, &combiner_data[hw >> 3]); |
168 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 166 | irq_set_probe(irq); |
169 | 167 | ||
170 | return 0; | 168 | return 0; |
171 | } | 169 | } |
diff --git a/drivers/irqchip/irq-armada-370-xp.c b/drivers/irqchip/irq-armada-370-xp.c index 39b72da0c143..655cb967a1f2 100644 --- a/drivers/irqchip/irq-armada-370-xp.c +++ b/drivers/irqchip/irq-armada-370-xp.c | |||
@@ -200,7 +200,6 @@ static int armada_370_xp_msi_map(struct irq_domain *domain, unsigned int virq, | |||
200 | { | 200 | { |
201 | irq_set_chip_and_handler(virq, &armada_370_xp_msi_irq_chip, | 201 | irq_set_chip_and_handler(virq, &armada_370_xp_msi_irq_chip, |
202 | handle_simple_irq); | 202 | handle_simple_irq); |
203 | set_irq_flags(virq, IRQF_VALID); | ||
204 | 203 | ||
205 | return 0; | 204 | return 0; |
206 | } | 205 | } |
@@ -317,7 +316,7 @@ static int armada_370_xp_mpic_irq_map(struct irq_domain *h, | |||
317 | irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip, | 316 | irq_set_chip_and_handler(virq, &armada_370_xp_irq_chip, |
318 | handle_level_irq); | 317 | handle_level_irq); |
319 | } | 318 | } |
320 | set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); | 319 | irq_set_probe(virq); |
321 | 320 | ||
322 | return 0; | 321 | return 0; |
323 | } | 322 | } |
@@ -447,8 +446,7 @@ static void armada_370_xp_handle_msi_irq(struct pt_regs *regs, bool is_chained) | |||
447 | static void armada_370_xp_handle_msi_irq(struct pt_regs *r, bool b) {} | 446 | static void armada_370_xp_handle_msi_irq(struct pt_regs *r, bool b) {} |
448 | #endif | 447 | #endif |
449 | 448 | ||
450 | static void armada_370_xp_mpic_handle_cascade_irq(unsigned int irq, | 449 | static void armada_370_xp_mpic_handle_cascade_irq(struct irq_desc *desc) |
451 | struct irq_desc *desc) | ||
452 | { | 450 | { |
453 | struct irq_chip *chip = irq_desc_get_chip(desc); | 451 | struct irq_chip *chip = irq_desc_get_chip(desc); |
454 | unsigned long irqmap, irqn, irqsrc, cpuid; | 452 | unsigned long irqmap, irqn, irqsrc, cpuid; |
diff --git a/drivers/irqchip/irq-bcm2835.c b/drivers/irqchip/irq-bcm2835.c index ed4ca9deca70..bf9cc5f2e839 100644 --- a/drivers/irqchip/irq-bcm2835.c +++ b/drivers/irqchip/irq-bcm2835.c | |||
@@ -96,7 +96,7 @@ struct armctrl_ic { | |||
96 | static struct armctrl_ic intc __read_mostly; | 96 | static struct armctrl_ic intc __read_mostly; |
97 | static void __exception_irq_entry bcm2835_handle_irq( | 97 | static void __exception_irq_entry bcm2835_handle_irq( |
98 | struct pt_regs *regs); | 98 | struct pt_regs *regs); |
99 | static void bcm2836_chained_handle_irq(unsigned int irq, struct irq_desc *desc); | 99 | static void bcm2836_chained_handle_irq(struct irq_desc *desc); |
100 | 100 | ||
101 | static void armctrl_mask_irq(struct irq_data *d) | 101 | static void armctrl_mask_irq(struct irq_data *d) |
102 | { | 102 | { |
@@ -166,7 +166,7 @@ static int __init armctrl_of_init(struct device_node *node, | |||
166 | BUG_ON(irq <= 0); | 166 | BUG_ON(irq <= 0); |
167 | irq_set_chip_and_handler(irq, &armctrl_chip, | 167 | irq_set_chip_and_handler(irq, &armctrl_chip, |
168 | handle_level_irq); | 168 | handle_level_irq); |
169 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 169 | irq_set_probe(irq); |
170 | } | 170 | } |
171 | } | 171 | } |
172 | 172 | ||
@@ -245,7 +245,7 @@ static void __exception_irq_entry bcm2835_handle_irq( | |||
245 | handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs); | 245 | handle_IRQ(irq_linear_revmap(intc.domain, hwirq), regs); |
246 | } | 246 | } |
247 | 247 | ||
248 | static void bcm2836_chained_handle_irq(unsigned int irq, struct irq_desc *desc) | 248 | static void bcm2836_chained_handle_irq(struct irq_desc *desc) |
249 | { | 249 | { |
250 | u32 hwirq; | 250 | u32 hwirq; |
251 | 251 | ||
diff --git a/drivers/irqchip/irq-bcm7038-l1.c b/drivers/irqchip/irq-bcm7038-l1.c index 409bdc6366c2..0fea985ef1dc 100644 --- a/drivers/irqchip/irq-bcm7038-l1.c +++ b/drivers/irqchip/irq-bcm7038-l1.c | |||
@@ -115,7 +115,7 @@ static inline void l1_writel(u32 val, void __iomem *reg) | |||
115 | writel(val, reg); | 115 | writel(val, reg); |
116 | } | 116 | } |
117 | 117 | ||
118 | static void bcm7038_l1_irq_handle(unsigned int irq, struct irq_desc *desc) | 118 | static void bcm7038_l1_irq_handle(struct irq_desc *desc) |
119 | { | 119 | { |
120 | struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc); | 120 | struct bcm7038_l1_chip *intc = irq_desc_get_handler_data(desc); |
121 | struct bcm7038_l1_cpu *cpu; | 121 | struct bcm7038_l1_cpu *cpu; |
diff --git a/drivers/irqchip/irq-bcm7120-l2.c b/drivers/irqchip/irq-bcm7120-l2.c index d3f976913a6f..61b18ab33ad9 100644 --- a/drivers/irqchip/irq-bcm7120-l2.c +++ b/drivers/irqchip/irq-bcm7120-l2.c | |||
@@ -56,7 +56,7 @@ struct bcm7120_l2_intc_data { | |||
56 | const __be32 *map_mask_prop; | 56 | const __be32 *map_mask_prop; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | static void bcm7120_l2_intc_irq_handle(unsigned int irq, struct irq_desc *desc) | 59 | static void bcm7120_l2_intc_irq_handle(struct irq_desc *desc) |
60 | { | 60 | { |
61 | struct bcm7120_l1_intc_data *data = irq_desc_get_handler_data(desc); | 61 | struct bcm7120_l1_intc_data *data = irq_desc_get_handler_data(desc); |
62 | struct bcm7120_l2_intc_data *b = data->b; | 62 | struct bcm7120_l2_intc_data *b = data->b; |
diff --git a/drivers/irqchip/irq-brcmstb-l2.c b/drivers/irqchip/irq-brcmstb-l2.c index aedda06191eb..65cd341f331a 100644 --- a/drivers/irqchip/irq-brcmstb-l2.c +++ b/drivers/irqchip/irq-brcmstb-l2.c | |||
@@ -49,13 +49,12 @@ struct brcmstb_l2_intc_data { | |||
49 | u32 saved_mask; /* for suspend/resume */ | 49 | u32 saved_mask; /* for suspend/resume */ |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static void brcmstb_l2_intc_irq_handle(unsigned int __irq, | 52 | static void brcmstb_l2_intc_irq_handle(struct irq_desc *desc) |
53 | struct irq_desc *desc) | ||
54 | { | 53 | { |
55 | struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc); | 54 | struct brcmstb_l2_intc_data *b = irq_desc_get_handler_data(desc); |
56 | struct irq_chip_generic *gc = irq_get_domain_generic_chip(b->domain, 0); | 55 | struct irq_chip_generic *gc = irq_get_domain_generic_chip(b->domain, 0); |
57 | struct irq_chip *chip = irq_desc_get_chip(desc); | 56 | struct irq_chip *chip = irq_desc_get_chip(desc); |
58 | unsigned int irq = irq_desc_get_irq(desc); | 57 | unsigned int irq; |
59 | u32 status; | 58 | u32 status; |
60 | 59 | ||
61 | chained_irq_enter(chip, desc); | 60 | chained_irq_enter(chip, desc); |
@@ -65,7 +64,7 @@ static void brcmstb_l2_intc_irq_handle(unsigned int __irq, | |||
65 | 64 | ||
66 | if (status == 0) { | 65 | if (status == 0) { |
67 | raw_spin_lock(&desc->lock); | 66 | raw_spin_lock(&desc->lock); |
68 | handle_bad_irq(irq, desc); | 67 | handle_bad_irq(desc); |
69 | raw_spin_unlock(&desc->lock); | 68 | raw_spin_unlock(&desc->lock); |
70 | goto out; | 69 | goto out; |
71 | } | 70 | } |
diff --git a/drivers/irqchip/irq-clps711x.c b/drivers/irqchip/irq-clps711x.c index 2dd929eed9e0..eb5eb0cd414d 100644 --- a/drivers/irqchip/irq-clps711x.c +++ b/drivers/irqchip/irq-clps711x.c | |||
@@ -132,14 +132,14 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq, | |||
132 | irq_hw_number_t hw) | 132 | irq_hw_number_t hw) |
133 | { | 133 | { |
134 | irq_flow_handler_t handler = handle_level_irq; | 134 | irq_flow_handler_t handler = handle_level_irq; |
135 | unsigned int flags = IRQF_VALID | IRQF_PROBE; | 135 | unsigned int flags = 0; |
136 | 136 | ||
137 | if (!clps711x_irqs[hw].flags) | 137 | if (!clps711x_irqs[hw].flags) |
138 | return 0; | 138 | return 0; |
139 | 139 | ||
140 | if (clps711x_irqs[hw].flags & CLPS711X_FLAG_FIQ) { | 140 | if (clps711x_irqs[hw].flags & CLPS711X_FLAG_FIQ) { |
141 | handler = handle_bad_irq; | 141 | handler = handle_bad_irq; |
142 | flags |= IRQF_NOAUTOEN; | 142 | flags |= IRQ_NOAUTOEN; |
143 | } else if (clps711x_irqs[hw].eoi) { | 143 | } else if (clps711x_irqs[hw].eoi) { |
144 | handler = handle_fasteoi_irq; | 144 | handler = handle_fasteoi_irq; |
145 | } | 145 | } |
@@ -149,7 +149,7 @@ static int __init clps711x_intc_irq_map(struct irq_domain *h, unsigned int virq, | |||
149 | writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi); | 149 | writel_relaxed(0, clps711x_intc->base + clps711x_irqs[hw].eoi); |
150 | 150 | ||
151 | irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler); | 151 | irq_set_chip_and_handler(virq, &clps711x_intc_chip, handler); |
152 | set_irq_flags(virq, flags); | 152 | irq_modify_status(virq, IRQ_NOPROBE, flags); |
153 | 153 | ||
154 | return 0; | 154 | return 0; |
155 | } | 155 | } |
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c b/drivers/irqchip/irq-dw-apb-ictl.c index efd95d9955e7..052f266364c0 100644 --- a/drivers/irqchip/irq-dw-apb-ictl.c +++ b/drivers/irqchip/irq-dw-apb-ictl.c | |||
@@ -26,7 +26,7 @@ | |||
26 | #define APB_INT_FINALSTATUS_H 0x34 | 26 | #define APB_INT_FINALSTATUS_H 0x34 |
27 | #define APB_INT_BASE_OFFSET 0x04 | 27 | #define APB_INT_BASE_OFFSET 0x04 |
28 | 28 | ||
29 | static void dw_apb_ictl_handler(unsigned int irq, struct irq_desc *desc) | 29 | static void dw_apb_ictl_handler(struct irq_desc *desc) |
30 | { | 30 | { |
31 | struct irq_domain *d = irq_desc_get_handler_data(desc); | 31 | struct irq_domain *d = irq_desc_get_handler_data(desc); |
32 | struct irq_chip *chip = irq_desc_get_chip(desc); | 32 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/irqchip/irq-gic-v2m.c b/drivers/irqchip/irq-gic-v2m.c index db04fc1f56b2..12985daa66ab 100644 --- a/drivers/irqchip/irq-gic-v2m.c +++ b/drivers/irqchip/irq-gic-v2m.c | |||
@@ -95,8 +95,8 @@ static void gicv2m_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) | |||
95 | struct v2m_data *v2m = irq_data_get_irq_chip_data(data); | 95 | struct v2m_data *v2m = irq_data_get_irq_chip_data(data); |
96 | phys_addr_t addr = v2m->res.start + V2M_MSI_SETSPI_NS; | 96 | phys_addr_t addr = v2m->res.start + V2M_MSI_SETSPI_NS; |
97 | 97 | ||
98 | msg->address_hi = (u32) (addr >> 32); | 98 | msg->address_hi = upper_32_bits(addr); |
99 | msg->address_lo = (u32) (addr); | 99 | msg->address_lo = lower_32_bits(addr); |
100 | msg->data = data->hwirq; | 100 | msg->data = data->hwirq; |
101 | } | 101 | } |
102 | 102 | ||
diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c index 26b55c53755f..ac7ae2b3cb83 100644 --- a/drivers/irqchip/irq-gic-v3-its.c +++ b/drivers/irqchip/irq-gic-v3-its.c | |||
@@ -898,8 +898,10 @@ retry_baser: | |||
898 | * non-cacheable as well. | 898 | * non-cacheable as well. |
899 | */ | 899 | */ |
900 | shr = tmp & GITS_BASER_SHAREABILITY_MASK; | 900 | shr = tmp & GITS_BASER_SHAREABILITY_MASK; |
901 | if (!shr) | 901 | if (!shr) { |
902 | cache = GITS_BASER_nC; | 902 | cache = GITS_BASER_nC; |
903 | __flush_dcache_area(base, alloc_size); | ||
904 | } | ||
903 | goto retry_baser; | 905 | goto retry_baser; |
904 | } | 906 | } |
905 | 907 | ||
@@ -1140,6 +1142,8 @@ static struct its_device *its_create_device(struct its_node *its, u32 dev_id, | |||
1140 | return NULL; | 1142 | return NULL; |
1141 | } | 1143 | } |
1142 | 1144 | ||
1145 | __flush_dcache_area(itt, sz); | ||
1146 | |||
1143 | dev->its = its; | 1147 | dev->its = its; |
1144 | dev->itt = itt; | 1148 | dev->itt = itt; |
1145 | dev->nr_ites = nr_ites; | 1149 | dev->nr_ites = nr_ites; |
diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 7deed6ef54c2..36ecfc870e5a 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c | |||
@@ -70,11 +70,6 @@ static inline int gic_irq_in_rdist(struct irq_data *d) | |||
70 | return gic_irq(d) < 32; | 70 | return gic_irq(d) < 32; |
71 | } | 71 | } |
72 | 72 | ||
73 | static inline bool forwarded_irq(struct irq_data *d) | ||
74 | { | ||
75 | return d->handler_data != NULL; | ||
76 | } | ||
77 | |||
78 | static inline void __iomem *gic_dist_base(struct irq_data *d) | 73 | static inline void __iomem *gic_dist_base(struct irq_data *d) |
79 | { | 74 | { |
80 | if (gic_irq_in_rdist(d)) /* SGI+PPI -> SGI_base for this CPU */ | 75 | if (gic_irq_in_rdist(d)) /* SGI+PPI -> SGI_base for this CPU */ |
@@ -249,7 +244,7 @@ static void gic_eoimode1_mask_irq(struct irq_data *d) | |||
249 | * disabled/masked will not get "stuck", because there is | 244 | * disabled/masked will not get "stuck", because there is |
250 | * noone to deactivate it (guest is being terminated). | 245 | * noone to deactivate it (guest is being terminated). |
251 | */ | 246 | */ |
252 | if (forwarded_irq(d)) | 247 | if (irqd_is_forwarded_to_vcpu(d)) |
253 | gic_poke_irq(d, GICD_ICACTIVER); | 248 | gic_poke_irq(d, GICD_ICACTIVER); |
254 | } | 249 | } |
255 | 250 | ||
@@ -324,7 +319,7 @@ static void gic_eoimode1_eoi_irq(struct irq_data *d) | |||
324 | * No need to deactivate an LPI, or an interrupt that | 319 | * No need to deactivate an LPI, or an interrupt that |
325 | * is is getting forwarded to a vcpu. | 320 | * is is getting forwarded to a vcpu. |
326 | */ | 321 | */ |
327 | if (gic_irq(d) >= 8192 || forwarded_irq(d)) | 322 | if (gic_irq(d) >= 8192 || irqd_is_forwarded_to_vcpu(d)) |
328 | return; | 323 | return; |
329 | gic_write_dir(gic_irq(d)); | 324 | gic_write_dir(gic_irq(d)); |
330 | } | 325 | } |
@@ -357,7 +352,10 @@ static int gic_set_type(struct irq_data *d, unsigned int type) | |||
357 | 352 | ||
358 | static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) | 353 | static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) |
359 | { | 354 | { |
360 | d->handler_data = vcpu; | 355 | if (vcpu) |
356 | irqd_set_forwarded_to_vcpu(d); | ||
357 | else | ||
358 | irqd_clr_forwarded_to_vcpu(d); | ||
361 | return 0; | 359 | return 0; |
362 | } | 360 | } |
363 | 361 | ||
@@ -754,13 +752,13 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
754 | irq_set_percpu_devid(irq); | 752 | irq_set_percpu_devid(irq); |
755 | irq_domain_set_info(d, irq, hw, chip, d->host_data, | 753 | irq_domain_set_info(d, irq, hw, chip, d->host_data, |
756 | handle_percpu_devid_irq, NULL, NULL); | 754 | handle_percpu_devid_irq, NULL, NULL); |
757 | set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN); | 755 | irq_set_status_flags(irq, IRQ_NOAUTOEN); |
758 | } | 756 | } |
759 | /* SPIs */ | 757 | /* SPIs */ |
760 | if (hw >= 32 && hw < gic_data.irq_nr) { | 758 | if (hw >= 32 && hw < gic_data.irq_nr) { |
761 | irq_domain_set_info(d, irq, hw, chip, d->host_data, | 759 | irq_domain_set_info(d, irq, hw, chip, d->host_data, |
762 | handle_fasteoi_irq, NULL, NULL); | 760 | handle_fasteoi_irq, NULL, NULL); |
763 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 761 | irq_set_probe(irq); |
764 | } | 762 | } |
765 | /* LPIs */ | 763 | /* LPIs */ |
766 | if (hw >= 8192 && hw < GIC_ID_NR) { | 764 | if (hw >= 8192 && hw < GIC_ID_NR) { |
@@ -768,7 +766,6 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
768 | return -EPERM; | 766 | return -EPERM; |
769 | irq_domain_set_info(d, irq, hw, chip, d->host_data, | 767 | irq_domain_set_info(d, irq, hw, chip, d->host_data, |
770 | handle_fasteoi_irq, NULL, NULL); | 768 | handle_fasteoi_irq, NULL, NULL); |
771 | set_irq_flags(irq, IRQF_VALID); | ||
772 | } | 769 | } |
773 | 770 | ||
774 | return 0; | 771 | return 0; |
diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c index e6b7ed537952..982c09c2d791 100644 --- a/drivers/irqchip/irq-gic.c +++ b/drivers/irqchip/irq-gic.c | |||
@@ -145,29 +145,10 @@ static inline bool cascading_gic_irq(struct irq_data *d) | |||
145 | void *data = irq_data_get_irq_handler_data(d); | 145 | void *data = irq_data_get_irq_handler_data(d); |
146 | 146 | ||
147 | /* | 147 | /* |
148 | * If handler_data pointing to one of the secondary GICs, then | 148 | * If handler_data is set, this is a cascading interrupt, and |
149 | * this is a cascading interrupt, and it cannot possibly be | 149 | * it cannot possibly be forwarded. |
150 | * forwarded. | ||
151 | */ | 150 | */ |
152 | if (data >= (void *)(gic_data + 1) && | 151 | return data != NULL; |
153 | data < (void *)(gic_data + MAX_GIC_NR)) | ||
154 | return true; | ||
155 | |||
156 | return false; | ||
157 | } | ||
158 | |||
159 | static inline bool forwarded_irq(struct irq_data *d) | ||
160 | { | ||
161 | /* | ||
162 | * A forwarded interrupt: | ||
163 | * - is on the primary GIC | ||
164 | * - has its handler_data set to a value | ||
165 | * - that isn't a secondary GIC | ||
166 | */ | ||
167 | if (d->handler_data && !cascading_gic_irq(d)) | ||
168 | return true; | ||
169 | |||
170 | return false; | ||
171 | } | 152 | } |
172 | 153 | ||
173 | /* | 154 | /* |
@@ -201,7 +182,7 @@ static void gic_eoimode1_mask_irq(struct irq_data *d) | |||
201 | * disabled/masked will not get "stuck", because there is | 182 | * disabled/masked will not get "stuck", because there is |
202 | * noone to deactivate it (guest is being terminated). | 183 | * noone to deactivate it (guest is being terminated). |
203 | */ | 184 | */ |
204 | if (forwarded_irq(d)) | 185 | if (irqd_is_forwarded_to_vcpu(d)) |
205 | gic_poke_irq(d, GIC_DIST_ACTIVE_CLEAR); | 186 | gic_poke_irq(d, GIC_DIST_ACTIVE_CLEAR); |
206 | } | 187 | } |
207 | 188 | ||
@@ -218,7 +199,7 @@ static void gic_eoi_irq(struct irq_data *d) | |||
218 | static void gic_eoimode1_eoi_irq(struct irq_data *d) | 199 | static void gic_eoimode1_eoi_irq(struct irq_data *d) |
219 | { | 200 | { |
220 | /* Do not deactivate an IRQ forwarded to a vcpu. */ | 201 | /* Do not deactivate an IRQ forwarded to a vcpu. */ |
221 | if (forwarded_irq(d)) | 202 | if (irqd_is_forwarded_to_vcpu(d)) |
222 | return; | 203 | return; |
223 | 204 | ||
224 | writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_DEACTIVATE); | 205 | writel_relaxed(gic_irq(d), gic_cpu_base(d) + GIC_CPU_DEACTIVATE); |
@@ -296,7 +277,10 @@ static int gic_irq_set_vcpu_affinity(struct irq_data *d, void *vcpu) | |||
296 | if (cascading_gic_irq(d)) | 277 | if (cascading_gic_irq(d)) |
297 | return -EINVAL; | 278 | return -EINVAL; |
298 | 279 | ||
299 | d->handler_data = vcpu; | 280 | if (vcpu) |
281 | irqd_set_forwarded_to_vcpu(d); | ||
282 | else | ||
283 | irqd_clr_forwarded_to_vcpu(d); | ||
300 | return 0; | 284 | return 0; |
301 | } | 285 | } |
302 | 286 | ||
@@ -357,7 +341,7 @@ static void __exception_irq_entry gic_handle_irq(struct pt_regs *regs) | |||
357 | } while (1); | 341 | } while (1); |
358 | } | 342 | } |
359 | 343 | ||
360 | static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) | 344 | static void gic_handle_cascade_irq(struct irq_desc *desc) |
361 | { | 345 | { |
362 | struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc); | 346 | struct gic_chip_data *chip_data = irq_desc_get_handler_data(desc); |
363 | struct irq_chip *chip = irq_desc_get_chip(desc); | 347 | struct irq_chip *chip = irq_desc_get_chip(desc); |
@@ -376,7 +360,7 @@ static void gic_handle_cascade_irq(unsigned int irq, struct irq_desc *desc) | |||
376 | 360 | ||
377 | cascade_irq = irq_find_mapping(chip_data->domain, gic_irq); | 361 | cascade_irq = irq_find_mapping(chip_data->domain, gic_irq); |
378 | if (unlikely(gic_irq < 32 || gic_irq > 1020)) | 362 | if (unlikely(gic_irq < 32 || gic_irq > 1020)) |
379 | handle_bad_irq(cascade_irq, desc); | 363 | handle_bad_irq(desc); |
380 | else | 364 | else |
381 | generic_handle_irq(cascade_irq); | 365 | generic_handle_irq(cascade_irq); |
382 | 366 | ||
@@ -906,11 +890,11 @@ static int gic_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
906 | irq_set_percpu_devid(irq); | 890 | irq_set_percpu_devid(irq); |
907 | irq_domain_set_info(d, irq, hw, chip, d->host_data, | 891 | irq_domain_set_info(d, irq, hw, chip, d->host_data, |
908 | handle_percpu_devid_irq, NULL, NULL); | 892 | handle_percpu_devid_irq, NULL, NULL); |
909 | set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN); | 893 | irq_set_status_flags(irq, IRQ_NOAUTOEN); |
910 | } else { | 894 | } else { |
911 | irq_domain_set_info(d, irq, hw, chip, d->host_data, | 895 | irq_domain_set_info(d, irq, hw, chip, d->host_data, |
912 | handle_fasteoi_irq, NULL, NULL); | 896 | handle_fasteoi_irq, NULL, NULL); |
913 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 897 | irq_set_probe(irq); |
914 | } | 898 | } |
915 | return 0; | 899 | return 0; |
916 | } | 900 | } |
@@ -1119,12 +1103,49 @@ void __init gic_init_bases(unsigned int gic_nr, int irq_start, | |||
1119 | #ifdef CONFIG_OF | 1103 | #ifdef CONFIG_OF |
1120 | static int gic_cnt __initdata; | 1104 | static int gic_cnt __initdata; |
1121 | 1105 | ||
1106 | static bool gic_check_eoimode(struct device_node *node, void __iomem **base) | ||
1107 | { | ||
1108 | struct resource cpuif_res; | ||
1109 | |||
1110 | of_address_to_resource(node, 1, &cpuif_res); | ||
1111 | |||
1112 | if (!is_hyp_mode_available()) | ||
1113 | return false; | ||
1114 | if (resource_size(&cpuif_res) < SZ_8K) | ||
1115 | return false; | ||
1116 | if (resource_size(&cpuif_res) == SZ_128K) { | ||
1117 | u32 val_low, val_high; | ||
1118 | |||
1119 | /* | ||
1120 | * Verify that we have the first 4kB of a GIC400 | ||
1121 | * aliased over the first 64kB by checking the | ||
1122 | * GICC_IIDR register on both ends. | ||
1123 | */ | ||
1124 | val_low = readl_relaxed(*base + GIC_CPU_IDENT); | ||
1125 | val_high = readl_relaxed(*base + GIC_CPU_IDENT + 0xf000); | ||
1126 | if ((val_low & 0xffff0fff) != 0x0202043B || | ||
1127 | val_low != val_high) | ||
1128 | return false; | ||
1129 | |||
1130 | /* | ||
1131 | * Move the base up by 60kB, so that we have a 8kB | ||
1132 | * contiguous region, which allows us to use GICC_DIR | ||
1133 | * at its normal offset. Please pass me that bucket. | ||
1134 | */ | ||
1135 | *base += 0xf000; | ||
1136 | cpuif_res.start += 0xf000; | ||
1137 | pr_warn("GIC: Adjusting CPU interface base to %pa", | ||
1138 | &cpuif_res.start); | ||
1139 | } | ||
1140 | |||
1141 | return true; | ||
1142 | } | ||
1143 | |||
1122 | static int __init | 1144 | static int __init |
1123 | gic_of_init(struct device_node *node, struct device_node *parent) | 1145 | gic_of_init(struct device_node *node, struct device_node *parent) |
1124 | { | 1146 | { |
1125 | void __iomem *cpu_base; | 1147 | void __iomem *cpu_base; |
1126 | void __iomem *dist_base; | 1148 | void __iomem *dist_base; |
1127 | struct resource cpu_res; | ||
1128 | u32 percpu_offset; | 1149 | u32 percpu_offset; |
1129 | int irq; | 1150 | int irq; |
1130 | 1151 | ||
@@ -1137,14 +1158,11 @@ gic_of_init(struct device_node *node, struct device_node *parent) | |||
1137 | cpu_base = of_iomap(node, 1); | 1158 | cpu_base = of_iomap(node, 1); |
1138 | WARN(!cpu_base, "unable to map gic cpu registers\n"); | 1159 | WARN(!cpu_base, "unable to map gic cpu registers\n"); |
1139 | 1160 | ||
1140 | of_address_to_resource(node, 1, &cpu_res); | ||
1141 | |||
1142 | /* | 1161 | /* |
1143 | * Disable split EOI/Deactivate if either HYP is not available | 1162 | * Disable split EOI/Deactivate if either HYP is not available |
1144 | * or the CPU interface is too small. | 1163 | * or the CPU interface is too small. |
1145 | */ | 1164 | */ |
1146 | if (gic_cnt == 0 && (!is_hyp_mode_available() || | 1165 | if (gic_cnt == 0 && !gic_check_eoimode(node, &cpu_base)) |
1147 | resource_size(&cpu_res) < SZ_8K)) | ||
1148 | static_key_slow_dec(&supports_deactivate); | 1166 | static_key_slow_dec(&supports_deactivate); |
1149 | 1167 | ||
1150 | if (of_property_read_u32(node, "cpu-offset", &percpu_offset)) | 1168 | if (of_property_read_u32(node, "cpu-offset", &percpu_offset)) |
diff --git a/drivers/irqchip/irq-hip04.c b/drivers/irqchip/irq-hip04.c index a0128c7c98dd..8f3ca8f3a62b 100644 --- a/drivers/irqchip/irq-hip04.c +++ b/drivers/irqchip/irq-hip04.c | |||
@@ -307,11 +307,11 @@ static int hip04_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
307 | irq_set_percpu_devid(irq); | 307 | irq_set_percpu_devid(irq); |
308 | irq_set_chip_and_handler(irq, &hip04_irq_chip, | 308 | irq_set_chip_and_handler(irq, &hip04_irq_chip, |
309 | handle_percpu_devid_irq); | 309 | handle_percpu_devid_irq); |
310 | set_irq_flags(irq, IRQF_VALID | IRQF_NOAUTOEN); | 310 | irq_set_status_flags(irq, IRQ_NOAUTOEN); |
311 | } else { | 311 | } else { |
312 | irq_set_chip_and_handler(irq, &hip04_irq_chip, | 312 | irq_set_chip_and_handler(irq, &hip04_irq_chip, |
313 | handle_fasteoi_irq); | 313 | handle_fasteoi_irq); |
314 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 314 | irq_set_probe(irq); |
315 | } | 315 | } |
316 | irq_set_chip_data(irq, d->host_data); | 316 | irq_set_chip_data(irq, d->host_data); |
317 | return 0; | 317 | return 0; |
diff --git a/drivers/irqchip/irq-i8259.c b/drivers/irqchip/irq-i8259.c index 4836102ba312..e484fd255321 100644 --- a/drivers/irqchip/irq-i8259.c +++ b/drivers/irqchip/irq-i8259.c | |||
@@ -352,7 +352,7 @@ void __init init_i8259_irqs(void) | |||
352 | __init_i8259_irqs(NULL); | 352 | __init_i8259_irqs(NULL); |
353 | } | 353 | } |
354 | 354 | ||
355 | static void i8259_irq_dispatch(unsigned int __irq, struct irq_desc *desc) | 355 | static void i8259_irq_dispatch(struct irq_desc *desc) |
356 | { | 356 | { |
357 | struct irq_domain *domain = irq_desc_get_handler_data(desc); | 357 | struct irq_domain *domain = irq_desc_get_handler_data(desc); |
358 | int hwirq = i8259_irq(); | 358 | int hwirq = i8259_irq(); |
diff --git a/drivers/irqchip/irq-imgpdc.c b/drivers/irqchip/irq-imgpdc.c index 841604b81004..c02d29c9dc05 100644 --- a/drivers/irqchip/irq-imgpdc.c +++ b/drivers/irqchip/irq-imgpdc.c | |||
@@ -218,7 +218,7 @@ static int pdc_irq_set_wake(struct irq_data *data, unsigned int on) | |||
218 | return 0; | 218 | return 0; |
219 | } | 219 | } |
220 | 220 | ||
221 | static void pdc_intc_perip_isr(unsigned int __irq, struct irq_desc *desc) | 221 | static void pdc_intc_perip_isr(struct irq_desc *desc) |
222 | { | 222 | { |
223 | unsigned int irq = irq_desc_get_irq(desc); | 223 | unsigned int irq = irq_desc_get_irq(desc); |
224 | struct pdc_intc_priv *priv; | 224 | struct pdc_intc_priv *priv; |
@@ -240,7 +240,7 @@ found: | |||
240 | generic_handle_irq(irq_no); | 240 | generic_handle_irq(irq_no); |
241 | } | 241 | } |
242 | 242 | ||
243 | static void pdc_intc_syswake_isr(unsigned int irq, struct irq_desc *desc) | 243 | static void pdc_intc_syswake_isr(struct irq_desc *desc) |
244 | { | 244 | { |
245 | struct pdc_intc_priv *priv; | 245 | struct pdc_intc_priv *priv; |
246 | unsigned int syswake, irq_no; | 246 | unsigned int syswake, irq_no; |
diff --git a/drivers/irqchip/irq-keystone.c b/drivers/irqchip/irq-keystone.c index c1517267b5db..deb89d63a728 100644 --- a/drivers/irqchip/irq-keystone.c +++ b/drivers/irqchip/irq-keystone.c | |||
@@ -83,7 +83,7 @@ static void keystone_irq_ack(struct irq_data *d) | |||
83 | /* nothing to do here */ | 83 | /* nothing to do here */ |
84 | } | 84 | } |
85 | 85 | ||
86 | static void keystone_irq_handler(unsigned __irq, struct irq_desc *desc) | 86 | static void keystone_irq_handler(struct irq_desc *desc) |
87 | { | 87 | { |
88 | unsigned int irq = irq_desc_get_irq(desc); | 88 | unsigned int irq = irq_desc_get_irq(desc); |
89 | struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc); | 89 | struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc); |
@@ -127,7 +127,7 @@ static int keystone_irq_map(struct irq_domain *h, unsigned int virq, | |||
127 | 127 | ||
128 | irq_set_chip_data(virq, kirq); | 128 | irq_set_chip_data(virq, kirq); |
129 | irq_set_chip_and_handler(virq, &kirq->chip, handle_level_irq); | 129 | irq_set_chip_and_handler(virq, &kirq->chip, handle_level_irq); |
130 | set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); | 130 | irq_set_probe(virq); |
131 | return 0; | 131 | return 0; |
132 | } | 132 | } |
133 | 133 | ||
diff --git a/drivers/irqchip/irq-metag-ext.c b/drivers/irqchip/irq-metag-ext.c index 5f4c52928d16..8c38b3d92e1c 100644 --- a/drivers/irqchip/irq-metag-ext.c +++ b/drivers/irqchip/irq-metag-ext.c | |||
@@ -446,7 +446,7 @@ static int meta_intc_irq_set_type(struct irq_data *data, unsigned int flow_type) | |||
446 | * Whilst using TR2 to detect external interrupts is a software convention it is | 446 | * Whilst using TR2 to detect external interrupts is a software convention it is |
447 | * (hopefully) unlikely to change. | 447 | * (hopefully) unlikely to change. |
448 | */ | 448 | */ |
449 | static void meta_intc_irq_demux(unsigned int irq, struct irq_desc *desc) | 449 | static void meta_intc_irq_demux(struct irq_desc *desc) |
450 | { | 450 | { |
451 | struct meta_intc_priv *priv = &meta_intc_priv; | 451 | struct meta_intc_priv *priv = &meta_intc_priv; |
452 | irq_hw_number_t hw; | 452 | irq_hw_number_t hw; |
diff --git a/drivers/irqchip/irq-metag.c b/drivers/irqchip/irq-metag.c index 3d23ce3edb5c..a5f053bd2f44 100644 --- a/drivers/irqchip/irq-metag.c +++ b/drivers/irqchip/irq-metag.c | |||
@@ -220,7 +220,7 @@ static int metag_internal_irq_set_affinity(struct irq_data *data, | |||
220 | * occurred. It is this function's job to demux this irq and | 220 | * occurred. It is this function's job to demux this irq and |
221 | * figure out exactly which trigger needs servicing. | 221 | * figure out exactly which trigger needs servicing. |
222 | */ | 222 | */ |
223 | static void metag_internal_irq_demux(unsigned int irq, struct irq_desc *desc) | 223 | static void metag_internal_irq_demux(struct irq_desc *desc) |
224 | { | 224 | { |
225 | struct metag_internal_irq_priv *priv = irq_desc_get_handler_data(desc); | 225 | struct metag_internal_irq_priv *priv = irq_desc_get_handler_data(desc); |
226 | irq_hw_number_t hw; | 226 | irq_hw_number_t hw; |
diff --git a/drivers/irqchip/irq-mips-gic.c b/drivers/irqchip/irq-mips-gic.c index 1764bcf8ee6b..af2f16bb8a94 100644 --- a/drivers/irqchip/irq-mips-gic.c +++ b/drivers/irqchip/irq-mips-gic.c | |||
@@ -546,7 +546,7 @@ static void __gic_irq_dispatch(void) | |||
546 | gic_handle_shared_int(false); | 546 | gic_handle_shared_int(false); |
547 | } | 547 | } |
548 | 548 | ||
549 | static void gic_irq_dispatch(unsigned int irq, struct irq_desc *desc) | 549 | static void gic_irq_dispatch(struct irq_desc *desc) |
550 | { | 550 | { |
551 | gic_handle_local_int(true); | 551 | gic_handle_local_int(true); |
552 | gic_handle_shared_int(true); | 552 | gic_handle_shared_int(true); |
diff --git a/drivers/irqchip/irq-mmp.c b/drivers/irqchip/irq-mmp.c index 781ed6e71dbb..013fc9659a84 100644 --- a/drivers/irqchip/irq-mmp.c +++ b/drivers/irqchip/irq-mmp.c | |||
@@ -129,7 +129,7 @@ struct irq_chip icu_irq_chip = { | |||
129 | .irq_unmask = icu_unmask_irq, | 129 | .irq_unmask = icu_unmask_irq, |
130 | }; | 130 | }; |
131 | 131 | ||
132 | static void icu_mux_irq_demux(unsigned int __irq, struct irq_desc *desc) | 132 | static void icu_mux_irq_demux(struct irq_desc *desc) |
133 | { | 133 | { |
134 | unsigned int irq = irq_desc_get_irq(desc); | 134 | unsigned int irq = irq_desc_get_irq(desc); |
135 | struct irq_domain *domain; | 135 | struct irq_domain *domain; |
@@ -164,7 +164,6 @@ static int mmp_irq_domain_map(struct irq_domain *d, unsigned int irq, | |||
164 | irq_hw_number_t hw) | 164 | irq_hw_number_t hw) |
165 | { | 165 | { |
166 | irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq); | 166 | irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq); |
167 | set_irq_flags(irq, IRQF_VALID); | ||
168 | return 0; | 167 | return 0; |
169 | } | 168 | } |
170 | 169 | ||
@@ -234,7 +233,6 @@ void __init icu_init_irq(void) | |||
234 | for (irq = 0; irq < 64; irq++) { | 233 | for (irq = 0; irq < 64; irq++) { |
235 | icu_mask_irq(irq_get_irq_data(irq)); | 234 | icu_mask_irq(irq_get_irq_data(irq)); |
236 | irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq); | 235 | irq_set_chip_and_handler(irq, &icu_irq_chip, handle_level_irq); |
237 | set_irq_flags(irq, IRQF_VALID); | ||
238 | } | 236 | } |
239 | irq_set_default_host(icu_data[0].domain); | 237 | irq_set_default_host(icu_data[0].domain); |
240 | set_handle_irq(mmp_handle_irq); | 238 | set_handle_irq(mmp_handle_irq); |
@@ -337,7 +335,6 @@ void __init mmp2_init_icu(void) | |||
337 | irq_set_chip_and_handler(irq, &icu_irq_chip, | 335 | irq_set_chip_and_handler(irq, &icu_irq_chip, |
338 | handle_level_irq); | 336 | handle_level_irq); |
339 | } | 337 | } |
340 | set_irq_flags(irq, IRQF_VALID); | ||
341 | } | 338 | } |
342 | irq_set_default_host(icu_data[0].domain); | 339 | irq_set_default_host(icu_data[0].domain); |
343 | set_handle_irq(mmp2_handle_irq); | 340 | set_handle_irq(mmp2_handle_irq); |
diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c index 1faf812f3dc8..604df63e2edf 100644 --- a/drivers/irqchip/irq-mxs.c +++ b/drivers/irqchip/irq-mxs.c | |||
@@ -84,7 +84,6 @@ static int icoll_irq_domain_map(struct irq_domain *d, unsigned int virq, | |||
84 | irq_hw_number_t hw) | 84 | irq_hw_number_t hw) |
85 | { | 85 | { |
86 | irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq); | 86 | irq_set_chip_and_handler(virq, &mxs_icoll_chip, handle_level_irq); |
87 | set_irq_flags(virq, IRQF_VALID); | ||
88 | 87 | ||
89 | return 0; | 88 | return 0; |
90 | } | 89 | } |
diff --git a/drivers/irqchip/irq-orion.c b/drivers/irqchip/irq-orion.c index 5ea999a724b5..be4c5a8c9659 100644 --- a/drivers/irqchip/irq-orion.c +++ b/drivers/irqchip/irq-orion.c | |||
@@ -106,7 +106,7 @@ IRQCHIP_DECLARE(orion_intc, "marvell,orion-intc", orion_irq_init); | |||
106 | #define ORION_BRIDGE_IRQ_CAUSE 0x00 | 106 | #define ORION_BRIDGE_IRQ_CAUSE 0x00 |
107 | #define ORION_BRIDGE_IRQ_MASK 0x04 | 107 | #define ORION_BRIDGE_IRQ_MASK 0x04 |
108 | 108 | ||
109 | static void orion_bridge_irq_handler(unsigned int irq, struct irq_desc *desc) | 109 | static void orion_bridge_irq_handler(struct irq_desc *desc) |
110 | { | 110 | { |
111 | struct irq_domain *d = irq_desc_get_handler_data(desc); | 111 | struct irq_domain *d = irq_desc_get_handler_data(desc); |
112 | 112 | ||
diff --git a/drivers/irqchip/irq-renesas-intc-irqpin.c b/drivers/irqchip/irq-renesas-intc-irqpin.c index 0670ab4e3897..9525335723f6 100644 --- a/drivers/irqchip/irq-renesas-intc-irqpin.c +++ b/drivers/irqchip/irq-renesas-intc-irqpin.c | |||
@@ -283,6 +283,9 @@ static int intc_irqpin_irq_set_type(struct irq_data *d, unsigned int type) | |||
283 | static int intc_irqpin_irq_set_wake(struct irq_data *d, unsigned int on) | 283 | static int intc_irqpin_irq_set_wake(struct irq_data *d, unsigned int on) |
284 | { | 284 | { |
285 | struct intc_irqpin_priv *p = irq_data_get_irq_chip_data(d); | 285 | struct intc_irqpin_priv *p = irq_data_get_irq_chip_data(d); |
286 | int hw_irq = irqd_to_hwirq(d); | ||
287 | |||
288 | irq_set_irq_wake(p->irq[hw_irq].requested_irq, on); | ||
286 | 289 | ||
287 | if (!p->clk) | 290 | if (!p->clk) |
288 | return 0; | 291 | return 0; |
@@ -332,6 +335,12 @@ static irqreturn_t intc_irqpin_shared_irq_handler(int irq, void *dev_id) | |||
332 | return status; | 335 | return status; |
333 | } | 336 | } |
334 | 337 | ||
338 | /* | ||
339 | * This lock class tells lockdep that INTC External IRQ Pin irqs are in a | ||
340 | * different category than their parents, so it won't report false recursion. | ||
341 | */ | ||
342 | static struct lock_class_key intc_irqpin_irq_lock_class; | ||
343 | |||
335 | static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, | 344 | static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, |
336 | irq_hw_number_t hw) | 345 | irq_hw_number_t hw) |
337 | { | 346 | { |
@@ -342,8 +351,8 @@ static int intc_irqpin_irq_domain_map(struct irq_domain *h, unsigned int virq, | |||
342 | 351 | ||
343 | intc_irqpin_dbg(&p->irq[hw], "map"); | 352 | intc_irqpin_dbg(&p->irq[hw], "map"); |
344 | irq_set_chip_data(virq, h->host_data); | 353 | irq_set_chip_data(virq, h->host_data); |
354 | irq_set_lockdep_class(virq, &intc_irqpin_irq_lock_class); | ||
345 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); | 355 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); |
346 | set_irq_flags(virq, IRQF_VALID); /* kill me now */ | ||
347 | return 0; | 356 | return 0; |
348 | } | 357 | } |
349 | 358 | ||
diff --git a/drivers/irqchip/irq-renesas-irqc.c b/drivers/irqchip/irq-renesas-irqc.c index 2aa3add711a6..35bf97ba4a3d 100644 --- a/drivers/irqchip/irq-renesas-irqc.c +++ b/drivers/irqchip/irq-renesas-irqc.c | |||
@@ -121,6 +121,9 @@ static int irqc_irq_set_type(struct irq_data *d, unsigned int type) | |||
121 | static int irqc_irq_set_wake(struct irq_data *d, unsigned int on) | 121 | static int irqc_irq_set_wake(struct irq_data *d, unsigned int on) |
122 | { | 122 | { |
123 | struct irqc_priv *p = irq_data_get_irq_chip_data(d); | 123 | struct irqc_priv *p = irq_data_get_irq_chip_data(d); |
124 | int hw_irq = irqd_to_hwirq(d); | ||
125 | |||
126 | irq_set_irq_wake(p->irq[hw_irq].requested_irq, on); | ||
124 | 127 | ||
125 | if (!p->clk) | 128 | if (!p->clk) |
126 | return 0; | 129 | return 0; |
@@ -150,6 +153,12 @@ static irqreturn_t irqc_irq_handler(int irq, void *dev_id) | |||
150 | return IRQ_NONE; | 153 | return IRQ_NONE; |
151 | } | 154 | } |
152 | 155 | ||
156 | /* | ||
157 | * This lock class tells lockdep that IRQC irqs are in a different | ||
158 | * category than their parents, so it won't report false recursion. | ||
159 | */ | ||
160 | static struct lock_class_key irqc_irq_lock_class; | ||
161 | |||
153 | static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq, | 162 | static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq, |
154 | irq_hw_number_t hw) | 163 | irq_hw_number_t hw) |
155 | { | 164 | { |
@@ -157,6 +166,7 @@ static int irqc_irq_domain_map(struct irq_domain *h, unsigned int virq, | |||
157 | 166 | ||
158 | irqc_dbg(&p->irq[hw], "map"); | 167 | irqc_dbg(&p->irq[hw], "map"); |
159 | irq_set_chip_data(virq, h->host_data); | 168 | irq_set_chip_data(virq, h->host_data); |
169 | irq_set_lockdep_class(virq, &irqc_irq_lock_class); | ||
160 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); | 170 | irq_set_chip_and_handler(virq, &p->irq_chip, handle_level_irq); |
161 | return 0; | 171 | return 0; |
162 | } | 172 | } |
diff --git a/drivers/irqchip/irq-s3c24xx.c b/drivers/irqchip/irq-s3c24xx.c index 506d9f20ca51..7154b011ddd2 100644 --- a/drivers/irqchip/irq-s3c24xx.c +++ b/drivers/irqchip/irq-s3c24xx.c | |||
@@ -298,7 +298,7 @@ static struct irq_chip s3c_irq_eint0t4 = { | |||
298 | .irq_set_type = s3c_irqext0_type, | 298 | .irq_set_type = s3c_irqext0_type, |
299 | }; | 299 | }; |
300 | 300 | ||
301 | static void s3c_irq_demux(unsigned int __irq, struct irq_desc *desc) | 301 | static void s3c_irq_demux(struct irq_desc *desc) |
302 | { | 302 | { |
303 | struct irq_chip *chip = irq_desc_get_chip(desc); | 303 | struct irq_chip *chip = irq_desc_get_chip(desc); |
304 | struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc); | 304 | struct s3c_irq_data *irq_data = irq_desc_get_chip_data(desc); |
@@ -466,13 +466,11 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq, | |||
466 | 466 | ||
467 | irq_set_chip_data(virq, irq_data); | 467 | irq_set_chip_data(virq, irq_data); |
468 | 468 | ||
469 | set_irq_flags(virq, IRQF_VALID); | ||
470 | |||
471 | if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) { | 469 | if (parent_intc && irq_data->type != S3C_IRQTYPE_NONE) { |
472 | if (irq_data->parent_irq > 31) { | 470 | if (irq_data->parent_irq > 31) { |
473 | pr_err("irq-s3c24xx: parent irq %lu is out of range\n", | 471 | pr_err("irq-s3c24xx: parent irq %lu is out of range\n", |
474 | irq_data->parent_irq); | 472 | irq_data->parent_irq); |
475 | goto err; | 473 | return -EINVAL; |
476 | } | 474 | } |
477 | 475 | ||
478 | parent_irq_data = &parent_intc->irqs[irq_data->parent_irq]; | 476 | parent_irq_data = &parent_intc->irqs[irq_data->parent_irq]; |
@@ -485,18 +483,12 @@ static int s3c24xx_irq_map(struct irq_domain *h, unsigned int virq, | |||
485 | if (!irqno) { | 483 | if (!irqno) { |
486 | pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n", | 484 | pr_err("irq-s3c24xx: could not find mapping for parent irq %lu\n", |
487 | irq_data->parent_irq); | 485 | irq_data->parent_irq); |
488 | goto err; | 486 | return -EINVAL; |
489 | } | 487 | } |
490 | irq_set_chained_handler(irqno, s3c_irq_demux); | 488 | irq_set_chained_handler(irqno, s3c_irq_demux); |
491 | } | 489 | } |
492 | 490 | ||
493 | return 0; | 491 | return 0; |
494 | |||
495 | err: | ||
496 | set_irq_flags(virq, 0); | ||
497 | |||
498 | /* the only error can result from bad mapping data*/ | ||
499 | return -EINVAL; | ||
500 | } | 492 | } |
501 | 493 | ||
502 | static const struct irq_domain_ops s3c24xx_irq_ops = { | 494 | static const struct irq_domain_ops s3c24xx_irq_ops = { |
@@ -1174,8 +1166,6 @@ static int s3c24xx_irq_map_of(struct irq_domain *h, unsigned int virq, | |||
1174 | 1166 | ||
1175 | irq_set_chip_data(virq, irq_data); | 1167 | irq_set_chip_data(virq, irq_data); |
1176 | 1168 | ||
1177 | set_irq_flags(virq, IRQF_VALID); | ||
1178 | |||
1179 | return 0; | 1169 | return 0; |
1180 | } | 1170 | } |
1181 | 1171 | ||
diff --git a/drivers/irqchip/irq-sun4i.c b/drivers/irqchip/irq-sun4i.c index 4ad3e7c69aa7..0704362f4c82 100644 --- a/drivers/irqchip/irq-sun4i.c +++ b/drivers/irqchip/irq-sun4i.c | |||
@@ -83,7 +83,7 @@ static int sun4i_irq_map(struct irq_domain *d, unsigned int virq, | |||
83 | irq_hw_number_t hw) | 83 | irq_hw_number_t hw) |
84 | { | 84 | { |
85 | irq_set_chip_and_handler(virq, &sun4i_irq_chip, handle_fasteoi_irq); | 85 | irq_set_chip_and_handler(virq, &sun4i_irq_chip, handle_fasteoi_irq); |
86 | set_irq_flags(virq, IRQF_VALID | IRQF_PROBE); | 86 | irq_set_probe(virq); |
87 | 87 | ||
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
diff --git a/drivers/irqchip/irq-sunxi-nmi.c b/drivers/irqchip/irq-sunxi-nmi.c index 772a82cacbf7..c143dd58410c 100644 --- a/drivers/irqchip/irq-sunxi-nmi.c +++ b/drivers/irqchip/irq-sunxi-nmi.c | |||
@@ -58,7 +58,7 @@ static inline u32 sunxi_sc_nmi_read(struct irq_chip_generic *gc, u32 off) | |||
58 | return irq_reg_readl(gc, off); | 58 | return irq_reg_readl(gc, off); |
59 | } | 59 | } |
60 | 60 | ||
61 | static void sunxi_sc_nmi_handle_irq(unsigned int irq, struct irq_desc *desc) | 61 | static void sunxi_sc_nmi_handle_irq(struct irq_desc *desc) |
62 | { | 62 | { |
63 | struct irq_domain *domain = irq_desc_get_handler_data(desc); | 63 | struct irq_domain *domain = irq_desc_get_handler_data(desc); |
64 | struct irq_chip *chip = irq_desc_get_chip(desc); | 64 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/irqchip/irq-tb10x.c b/drivers/irqchip/irq-tb10x.c index 331829661366..848d782a2a3b 100644 --- a/drivers/irqchip/irq-tb10x.c +++ b/drivers/irqchip/irq-tb10x.c | |||
@@ -97,7 +97,7 @@ static int tb10x_irq_set_type(struct irq_data *data, unsigned int flow_type) | |||
97 | return IRQ_SET_MASK_OK; | 97 | return IRQ_SET_MASK_OK; |
98 | } | 98 | } |
99 | 99 | ||
100 | static void tb10x_irq_cascade(unsigned int __irq, struct irq_desc *desc) | 100 | static void tb10x_irq_cascade(struct irq_desc *desc) |
101 | { | 101 | { |
102 | struct irq_domain *domain = irq_desc_get_handler_data(desc); | 102 | struct irq_domain *domain = irq_desc_get_handler_data(desc); |
103 | unsigned int irq = irq_desc_get_irq(desc); | 103 | unsigned int irq = irq_desc_get_irq(desc); |
diff --git a/drivers/irqchip/irq-versatile-fpga.c b/drivers/irqchip/irq-versatile-fpga.c index 16123f688768..598ab3f0e0ac 100644 --- a/drivers/irqchip/irq-versatile-fpga.c +++ b/drivers/irqchip/irq-versatile-fpga.c | |||
@@ -65,19 +65,19 @@ static void fpga_irq_unmask(struct irq_data *d) | |||
65 | writel(mask, f->base + IRQ_ENABLE_SET); | 65 | writel(mask, f->base + IRQ_ENABLE_SET); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void fpga_irq_handle(unsigned int __irq, struct irq_desc *desc) | 68 | static void fpga_irq_handle(struct irq_desc *desc) |
69 | { | 69 | { |
70 | struct fpga_irq_data *f = irq_desc_get_handler_data(desc); | 70 | struct fpga_irq_data *f = irq_desc_get_handler_data(desc); |
71 | unsigned int irq = irq_desc_get_irq(desc); | ||
72 | u32 status = readl(f->base + IRQ_STATUS); | 71 | u32 status = readl(f->base + IRQ_STATUS); |
73 | 72 | ||
74 | if (status == 0) { | 73 | if (status == 0) { |
75 | do_bad_IRQ(irq, desc); | 74 | do_bad_IRQ(desc); |
76 | return; | 75 | return; |
77 | } | 76 | } |
78 | 77 | ||
79 | do { | 78 | do { |
80 | irq = ffs(status) - 1; | 79 | unsigned int irq = ffs(status) - 1; |
80 | |||
81 | status &= ~(1 << irq); | 81 | status &= ~(1 << irq); |
82 | generic_handle_irq(irq_find_mapping(f->domain, irq)); | 82 | generic_handle_irq(irq_find_mapping(f->domain, irq)); |
83 | } while (status); | 83 | } while (status); |
@@ -128,7 +128,7 @@ static int fpga_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
128 | irq_set_chip_data(irq, f); | 128 | irq_set_chip_data(irq, f); |
129 | irq_set_chip_and_handler(irq, &f->chip, | 129 | irq_set_chip_and_handler(irq, &f->chip, |
130 | handle_level_irq); | 130 | handle_level_irq); |
131 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 131 | irq_set_probe(irq); |
132 | return 0; | 132 | return 0; |
133 | } | 133 | } |
134 | 134 | ||
diff --git a/drivers/irqchip/irq-vic.c b/drivers/irqchip/irq-vic.c index 03846dff4212..b956dfffe78c 100644 --- a/drivers/irqchip/irq-vic.c +++ b/drivers/irqchip/irq-vic.c | |||
@@ -201,7 +201,7 @@ static int vic_irqdomain_map(struct irq_domain *d, unsigned int irq, | |||
201 | return -EPERM; | 201 | return -EPERM; |
202 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); | 202 | irq_set_chip_and_handler(irq, &vic_chip, handle_level_irq); |
203 | irq_set_chip_data(irq, v->base); | 203 | irq_set_chip_data(irq, v->base); |
204 | set_irq_flags(irq, IRQF_VALID | IRQF_PROBE); | 204 | irq_set_probe(irq); |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
207 | 207 | ||
@@ -225,7 +225,7 @@ static int handle_one_vic(struct vic_device *vic, struct pt_regs *regs) | |||
225 | return handled; | 225 | return handled; |
226 | } | 226 | } |
227 | 227 | ||
228 | static void vic_handle_irq_cascaded(unsigned int irq, struct irq_desc *desc) | 228 | static void vic_handle_irq_cascaded(struct irq_desc *desc) |
229 | { | 229 | { |
230 | u32 stat, hwirq; | 230 | u32 stat, hwirq; |
231 | struct irq_chip *host_chip = irq_desc_get_chip(desc); | 231 | struct irq_chip *host_chip = irq_desc_get_chip(desc); |
diff --git a/drivers/irqchip/irq-vt8500.c b/drivers/irqchip/irq-vt8500.c index 8371d9978d31..f9af0af21751 100644 --- a/drivers/irqchip/irq-vt8500.c +++ b/drivers/irqchip/irq-vt8500.c | |||
@@ -167,7 +167,6 @@ static int vt8500_irq_map(struct irq_domain *h, unsigned int virq, | |||
167 | irq_hw_number_t hw) | 167 | irq_hw_number_t hw) |
168 | { | 168 | { |
169 | irq_set_chip_and_handler(virq, &vt8500_irq_chip, handle_level_irq); | 169 | irq_set_chip_and_handler(virq, &vt8500_irq_chip, handle_level_irq); |
170 | set_irq_flags(virq, IRQF_VALID); | ||
171 | 170 | ||
172 | return 0; | 171 | return 0; |
173 | } | 172 | } |
diff --git a/drivers/irqchip/spear-shirq.c b/drivers/irqchip/spear-shirq.c index 4cbd9c5dc1e6..1ccd2abed65f 100644 --- a/drivers/irqchip/spear-shirq.c +++ b/drivers/irqchip/spear-shirq.c | |||
@@ -182,7 +182,7 @@ static struct spear_shirq *spear320_shirq_blocks[] = { | |||
182 | &spear320_shirq_intrcomm_ras, | 182 | &spear320_shirq_intrcomm_ras, |
183 | }; | 183 | }; |
184 | 184 | ||
185 | static void shirq_handler(unsigned __irq, struct irq_desc *desc) | 185 | static void shirq_handler(struct irq_desc *desc) |
186 | { | 186 | { |
187 | struct spear_shirq *shirq = irq_desc_get_handler_data(desc); | 187 | struct spear_shirq *shirq = irq_desc_get_handler_data(desc); |
188 | u32 pend; | 188 | u32 pend; |
@@ -211,7 +211,6 @@ static void __init spear_shirq_register(struct spear_shirq *shirq, | |||
211 | for (i = 0; i < shirq->nr_irqs; i++) { | 211 | for (i = 0; i < shirq->nr_irqs; i++) { |
212 | irq_set_chip_and_handler(shirq->virq_base + i, | 212 | irq_set_chip_and_handler(shirq->virq_base + i, |
213 | shirq->irq_chip, handle_simple_irq); | 213 | shirq->irq_chip, handle_simple_irq); |
214 | set_irq_flags(shirq->virq_base + i, IRQF_VALID); | ||
215 | irq_set_chip_data(shirq->virq_base + i, shirq); | 214 | irq_set_chip_data(shirq->virq_base + i, shirq); |
216 | } | 215 | } |
217 | } | 216 | } |
diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index 70f4255ff291..42990f2d0317 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig | |||
@@ -170,6 +170,7 @@ config LEDS_SUNFIRE | |||
170 | 170 | ||
171 | config LEDS_IPAQ_MICRO | 171 | config LEDS_IPAQ_MICRO |
172 | tristate "LED Support for the Compaq iPAQ h3xxx" | 172 | tristate "LED Support for the Compaq iPAQ h3xxx" |
173 | depends on LEDS_CLASS | ||
173 | depends on MFD_IPAQ_MICRO | 174 | depends on MFD_IPAQ_MICRO |
174 | help | 175 | help |
175 | Choose this option if you want to use the notification LED on | 176 | Choose this option if you want to use the notification LED on |
@@ -229,7 +230,7 @@ config LEDS_LP55XX_COMMON | |||
229 | tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501" | 230 | tristate "Common Driver for TI/National LP5521/5523/55231/5562/8501" |
230 | depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501 | 231 | depends on LEDS_LP5521 || LEDS_LP5523 || LEDS_LP5562 || LEDS_LP8501 |
231 | select FW_LOADER | 232 | select FW_LOADER |
232 | select FW_LOADER_USER_HELPER_FALLBACK | 233 | select FW_LOADER_USER_HELPER |
233 | help | 234 | help |
234 | This option supports common operations for LP5521/5523/55231/5562/8501 | 235 | This option supports common operations for LP5521/5523/55231/5562/8501 |
235 | devices. | 236 | devices. |
diff --git a/drivers/leds/leds-aat1290.c b/drivers/leds/leds-aat1290.c index fd7c25fd29c1..ac77d36b630c 100644 --- a/drivers/leds/leds-aat1290.c +++ b/drivers/leds/leds-aat1290.c | |||
@@ -331,7 +331,7 @@ static void aat1290_led_validate_mm_current(struct aat1290_led *led, | |||
331 | cfg->max_brightness = b + 1; | 331 | cfg->max_brightness = b + 1; |
332 | } | 332 | } |
333 | 333 | ||
334 | int init_mm_current_scale(struct aat1290_led *led, | 334 | static int init_mm_current_scale(struct aat1290_led *led, |
335 | struct aat1290_led_config_data *cfg) | 335 | struct aat1290_led_config_data *cfg) |
336 | { | 336 | { |
337 | int max_mm_current_percent[] = { 20, 22, 25, 28, 32, 36, 40, 45, 50, 56, | 337 | int max_mm_current_percent[] = { 20, 22, 25, 28, 32, 36, 40, 45, 50, 56, |
@@ -559,6 +559,7 @@ static const struct of_device_id aat1290_led_dt_match[] = { | |||
559 | { .compatible = "skyworks,aat1290" }, | 559 | { .compatible = "skyworks,aat1290" }, |
560 | {}, | 560 | {}, |
561 | }; | 561 | }; |
562 | MODULE_DEVICE_TABLE(of, aat1290_led_dt_match); | ||
562 | 563 | ||
563 | static struct platform_driver aat1290_led_driver = { | 564 | static struct platform_driver aat1290_led_driver = { |
564 | .probe = aat1290_led_probe, | 565 | .probe = aat1290_led_probe, |
diff --git a/drivers/leds/leds-bcm6328.c b/drivers/leds/leds-bcm6328.c index 986fe1e28f84..1793727bc9ae 100644 --- a/drivers/leds/leds-bcm6328.c +++ b/drivers/leds/leds-bcm6328.c | |||
@@ -395,6 +395,7 @@ static const struct of_device_id bcm6328_leds_of_match[] = { | |||
395 | { .compatible = "brcm,bcm6328-leds", }, | 395 | { .compatible = "brcm,bcm6328-leds", }, |
396 | { }, | 396 | { }, |
397 | }; | 397 | }; |
398 | MODULE_DEVICE_TABLE(of, bcm6328_leds_of_match); | ||
398 | 399 | ||
399 | static struct platform_driver bcm6328_leds_driver = { | 400 | static struct platform_driver bcm6328_leds_driver = { |
400 | .probe = bcm6328_leds_probe, | 401 | .probe = bcm6328_leds_probe, |
diff --git a/drivers/leds/leds-bcm6358.c b/drivers/leds/leds-bcm6358.c index 21f96930b3be..7ea3526702e0 100644 --- a/drivers/leds/leds-bcm6358.c +++ b/drivers/leds/leds-bcm6358.c | |||
@@ -226,6 +226,7 @@ static const struct of_device_id bcm6358_leds_of_match[] = { | |||
226 | { .compatible = "brcm,bcm6358-leds", }, | 226 | { .compatible = "brcm,bcm6358-leds", }, |
227 | { }, | 227 | { }, |
228 | }; | 228 | }; |
229 | MODULE_DEVICE_TABLE(of, bcm6358_leds_of_match); | ||
229 | 230 | ||
230 | static struct platform_driver bcm6358_leds_driver = { | 231 | static struct platform_driver bcm6358_leds_driver = { |
231 | .probe = bcm6358_leds_probe, | 232 | .probe = bcm6358_leds_probe, |
diff --git a/drivers/leds/leds-ktd2692.c b/drivers/leds/leds-ktd2692.c index 2ae8c4d17ff8..feca07be85f5 100644 --- a/drivers/leds/leds-ktd2692.c +++ b/drivers/leds/leds-ktd2692.c | |||
@@ -426,6 +426,7 @@ static const struct of_device_id ktd2692_match[] = { | |||
426 | { .compatible = "kinetic,ktd2692", }, | 426 | { .compatible = "kinetic,ktd2692", }, |
427 | { /* sentinel */ }, | 427 | { /* sentinel */ }, |
428 | }; | 428 | }; |
429 | MODULE_DEVICE_TABLE(of, ktd2692_match); | ||
429 | 430 | ||
430 | static struct platform_driver ktd2692_driver = { | 431 | static struct platform_driver ktd2692_driver = { |
431 | .driver = { | 432 | .driver = { |
diff --git a/drivers/leds/leds-max77693.c b/drivers/leds/leds-max77693.c index df348a06d8c7..afbb1409b2e2 100644 --- a/drivers/leds/leds-max77693.c +++ b/drivers/leds/leds-max77693.c | |||
@@ -1080,6 +1080,7 @@ static const struct of_device_id max77693_led_dt_match[] = { | |||
1080 | { .compatible = "maxim,max77693-led" }, | 1080 | { .compatible = "maxim,max77693-led" }, |
1081 | {}, | 1081 | {}, |
1082 | }; | 1082 | }; |
1083 | MODULE_DEVICE_TABLE(of, max77693_led_dt_match); | ||
1083 | 1084 | ||
1084 | static struct platform_driver max77693_led_driver = { | 1085 | static struct platform_driver max77693_led_driver = { |
1085 | .probe = max77693_led_probe, | 1086 | .probe = max77693_led_probe, |
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index b33514d9f427..a95a61220169 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c | |||
@@ -337,6 +337,7 @@ static const struct of_device_id of_ns2_leds_match[] = { | |||
337 | { .compatible = "lacie,ns2-leds", }, | 337 | { .compatible = "lacie,ns2-leds", }, |
338 | {}, | 338 | {}, |
339 | }; | 339 | }; |
340 | MODULE_DEVICE_TABLE(of, of_ns2_leds_match); | ||
340 | #endif /* CONFIG_OF_GPIO */ | 341 | #endif /* CONFIG_OF_GPIO */ |
341 | 342 | ||
342 | struct ns2_led_priv { | 343 | struct ns2_led_priv { |
diff --git a/drivers/mfd/asic3.c b/drivers/mfd/asic3.c index 4b54128bc78e..a726f01e3b02 100644 --- a/drivers/mfd/asic3.c +++ b/drivers/mfd/asic3.c | |||
@@ -138,7 +138,7 @@ static void asic3_irq_flip_edge(struct asic3 *asic, | |||
138 | spin_unlock_irqrestore(&asic->lock, flags); | 138 | spin_unlock_irqrestore(&asic->lock, flags); |
139 | } | 139 | } |
140 | 140 | ||
141 | static void asic3_irq_demux(unsigned int irq, struct irq_desc *desc) | 141 | static void asic3_irq_demux(struct irq_desc *desc) |
142 | { | 142 | { |
143 | struct asic3 *asic = irq_desc_get_handler_data(desc); | 143 | struct asic3 *asic = irq_desc_get_handler_data(desc); |
144 | struct irq_data *data = irq_desc_get_irq_data(desc); | 144 | struct irq_data *data = irq_desc_get_irq_data(desc); |
diff --git a/drivers/mfd/ezx-pcap.c b/drivers/mfd/ezx-pcap.c index a76eb6ef47a0..b279205659a4 100644 --- a/drivers/mfd/ezx-pcap.c +++ b/drivers/mfd/ezx-pcap.c | |||
@@ -205,7 +205,7 @@ static void pcap_isr_work(struct work_struct *work) | |||
205 | } while (gpio_get_value(pdata->gpio)); | 205 | } while (gpio_get_value(pdata->gpio)); |
206 | } | 206 | } |
207 | 207 | ||
208 | static void pcap_irq_handler(unsigned int irq, struct irq_desc *desc) | 208 | static void pcap_irq_handler(struct irq_desc *desc) |
209 | { | 209 | { |
210 | struct pcap_chip *pcap = irq_desc_get_handler_data(desc); | 210 | struct pcap_chip *pcap = irq_desc_get_handler_data(desc); |
211 | 211 | ||
diff --git a/drivers/mfd/htc-egpio.c b/drivers/mfd/htc-egpio.c index 9131cdcdc64a..6ccaf90d98fd 100644 --- a/drivers/mfd/htc-egpio.c +++ b/drivers/mfd/htc-egpio.c | |||
@@ -98,7 +98,7 @@ static struct irq_chip egpio_muxed_chip = { | |||
98 | .irq_unmask = egpio_unmask, | 98 | .irq_unmask = egpio_unmask, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | static void egpio_handler(unsigned int irq, struct irq_desc *desc) | 101 | static void egpio_handler(struct irq_desc *desc) |
102 | { | 102 | { |
103 | struct egpio_info *ei = irq_desc_get_handler_data(desc); | 103 | struct egpio_info *ei = irq_desc_get_handler_data(desc); |
104 | int irqpin; | 104 | int irqpin; |
diff --git a/drivers/mfd/jz4740-adc.c b/drivers/mfd/jz4740-adc.c index 5bb49f08955d..798e44306382 100644 --- a/drivers/mfd/jz4740-adc.c +++ b/drivers/mfd/jz4740-adc.c | |||
@@ -65,7 +65,7 @@ struct jz4740_adc { | |||
65 | spinlock_t lock; | 65 | spinlock_t lock; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | static void jz4740_adc_irq_demux(unsigned int irq, struct irq_desc *desc) | 68 | static void jz4740_adc_irq_demux(struct irq_desc *desc) |
69 | { | 69 | { |
70 | struct irq_chip_generic *gc = irq_desc_get_handler_data(desc); | 70 | struct irq_chip_generic *gc = irq_desc_get_handler_data(desc); |
71 | uint8_t status; | 71 | uint8_t status; |
diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c index 59502d02cd15..1b7ec0870c2a 100644 --- a/drivers/mfd/pm8921-core.c +++ b/drivers/mfd/pm8921-core.c | |||
@@ -156,7 +156,7 @@ static int pm8xxx_irq_master_handler(struct pm_irq_chip *chip, int master) | |||
156 | return ret; | 156 | return ret; |
157 | } | 157 | } |
158 | 158 | ||
159 | static void pm8xxx_irq_handler(unsigned int irq, struct irq_desc *desc) | 159 | static void pm8xxx_irq_handler(struct irq_desc *desc) |
160 | { | 160 | { |
161 | struct pm_irq_chip *chip = irq_desc_get_handler_data(desc); | 161 | struct pm_irq_chip *chip = irq_desc_get_handler_data(desc); |
162 | struct irq_chip *irq_chip = irq_desc_get_chip(desc); | 162 | struct irq_chip *irq_chip = irq_desc_get_chip(desc); |
diff --git a/drivers/mfd/t7l66xb.c b/drivers/mfd/t7l66xb.c index 16fc1adc4fa3..94bd89cb1f06 100644 --- a/drivers/mfd/t7l66xb.c +++ b/drivers/mfd/t7l66xb.c | |||
@@ -185,7 +185,7 @@ static struct mfd_cell t7l66xb_cells[] = { | |||
185 | /*--------------------------------------------------------------------------*/ | 185 | /*--------------------------------------------------------------------------*/ |
186 | 186 | ||
187 | /* Handle the T7L66XB interrupt mux */ | 187 | /* Handle the T7L66XB interrupt mux */ |
188 | static void t7l66xb_irq(unsigned int irq, struct irq_desc *desc) | 188 | static void t7l66xb_irq(struct irq_desc *desc) |
189 | { | 189 | { |
190 | struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc); | 190 | struct t7l66xb *t7l66xb = irq_desc_get_handler_data(desc); |
191 | unsigned int isr; | 191 | unsigned int isr; |
diff --git a/drivers/mfd/tc6393xb.c b/drivers/mfd/tc6393xb.c index 775b9aca871a..8c84a513016b 100644 --- a/drivers/mfd/tc6393xb.c +++ b/drivers/mfd/tc6393xb.c | |||
@@ -522,8 +522,7 @@ static int tc6393xb_register_gpio(struct tc6393xb *tc6393xb, int gpio_base) | |||
522 | 522 | ||
523 | /*--------------------------------------------------------------------------*/ | 523 | /*--------------------------------------------------------------------------*/ |
524 | 524 | ||
525 | static void | 525 | static void tc6393xb_irq(struct irq_desc *desc) |
526 | tc6393xb_irq(unsigned int irq, struct irq_desc *desc) | ||
527 | { | 526 | { |
528 | struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc); | 527 | struct tc6393xb *tc6393xb = irq_desc_get_handler_data(desc); |
529 | unsigned int isr; | 528 | unsigned int isr; |
diff --git a/drivers/mfd/ucb1x00-core.c b/drivers/mfd/ucb1x00-core.c index 9a2302129711..f691d7ecad52 100644 --- a/drivers/mfd/ucb1x00-core.c +++ b/drivers/mfd/ucb1x00-core.c | |||
@@ -282,7 +282,7 @@ void ucb1x00_adc_disable(struct ucb1x00 *ucb) | |||
282 | * SIBCLK to talk to the chip. We leave the clock running until | 282 | * SIBCLK to talk to the chip. We leave the clock running until |
283 | * we have finished processing all interrupts from the chip. | 283 | * we have finished processing all interrupts from the chip. |
284 | */ | 284 | */ |
285 | static void ucb1x00_irq(unsigned int __irq, struct irq_desc *desc) | 285 | static void ucb1x00_irq(struct irq_desc *desc) |
286 | { | 286 | { |
287 | struct ucb1x00 *ucb = irq_desc_get_handler_data(desc); | 287 | struct ucb1x00 *ucb = irq_desc_get_handler_data(desc); |
288 | unsigned int isr, i; | 288 | unsigned int isr, i; |
diff --git a/drivers/misc/cxl/Makefile b/drivers/misc/cxl/Makefile index 6f484dfe78f9..6982f603fadc 100644 --- a/drivers/misc/cxl/Makefile +++ b/drivers/misc/cxl/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | ccflags-y := -Werror | 1 | ccflags-y := -Werror -Wno-unused-const-variable |
2 | 2 | ||
3 | cxl-y += main.o file.o irq.o fault.o native.o | 3 | cxl-y += main.o file.o irq.o fault.o native.o |
4 | cxl-y += context.o sysfs.o debugfs.o pci.o trace.o | 4 | cxl-y += context.o sysfs.o debugfs.o pci.o trace.o |
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c index 02c85160bfe9..a5e977192b61 100644 --- a/drivers/misc/cxl/pci.c +++ b/drivers/misc/cxl/pci.c | |||
@@ -1249,8 +1249,6 @@ static int cxl_probe(struct pci_dev *dev, const struct pci_device_id *id) | |||
1249 | int slice; | 1249 | int slice; |
1250 | int rc; | 1250 | int rc; |
1251 | 1251 | ||
1252 | pci_dev_get(dev); | ||
1253 | |||
1254 | if (cxl_verbose) | 1252 | if (cxl_verbose) |
1255 | dump_cxl_config_space(dev); | 1253 | dump_cxl_config_space(dev); |
1256 | 1254 | ||
diff --git a/drivers/misc/cxl/vphb.c b/drivers/misc/cxl/vphb.c index 6dd16a6d153f..94b520896b18 100644 --- a/drivers/misc/cxl/vphb.c +++ b/drivers/misc/cxl/vphb.c | |||
@@ -48,6 +48,12 @@ static bool cxl_pci_enable_device_hook(struct pci_dev *dev) | |||
48 | 48 | ||
49 | phb = pci_bus_to_host(dev->bus); | 49 | phb = pci_bus_to_host(dev->bus); |
50 | afu = (struct cxl_afu *)phb->private_data; | 50 | afu = (struct cxl_afu *)phb->private_data; |
51 | |||
52 | if (!cxl_adapter_link_ok(afu->adapter)) { | ||
53 | dev_warn(&dev->dev, "%s: Device link is down, refusing to enable AFU\n", __func__); | ||
54 | return false; | ||
55 | } | ||
56 | |||
51 | set_dma_ops(&dev->dev, &dma_direct_ops); | 57 | set_dma_ops(&dev->dev, &dma_direct_ops); |
52 | set_dma_offset(&dev->dev, PAGE_OFFSET); | 58 | set_dma_offset(&dev->dev, PAGE_OFFSET); |
53 | 59 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c index 4402a1e48c9b..4c7de8c44659 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c | |||
@@ -1047,13 +1047,15 @@ int mlx4_en_poll_rx_cq(struct napi_struct *napi, int budget) | |||
1047 | 1047 | ||
1048 | /* If we used up all the quota - we're probably not done yet... */ | 1048 | /* If we used up all the quota - we're probably not done yet... */ |
1049 | if (done == budget) { | 1049 | if (done == budget) { |
1050 | int cpu_curr; | ||
1051 | const struct cpumask *aff; | 1050 | const struct cpumask *aff; |
1051 | struct irq_data *idata; | ||
1052 | int cpu_curr; | ||
1052 | 1053 | ||
1053 | INC_PERF_COUNTER(priv->pstats.napi_quota); | 1054 | INC_PERF_COUNTER(priv->pstats.napi_quota); |
1054 | 1055 | ||
1055 | cpu_curr = smp_processor_id(); | 1056 | cpu_curr = smp_processor_id(); |
1056 | aff = irq_desc_get_irq_data(cq->irq_desc)->affinity; | 1057 | idata = irq_desc_get_irq_data(cq->irq_desc); |
1058 | aff = irq_data_get_affinity_mask(idata); | ||
1057 | 1059 | ||
1058 | if (likely(cpumask_test_cpu(cpu_curr, aff))) | 1060 | if (likely(cpumask_test_cpu(cpu_curr, aff))) |
1059 | return budget; | 1061 | return budget; |
diff --git a/drivers/nvdimm/btt_devs.c b/drivers/nvdimm/btt_devs.c index 59ad54a63d9f..cb477518dd0e 100644 --- a/drivers/nvdimm/btt_devs.c +++ b/drivers/nvdimm/btt_devs.c | |||
@@ -128,13 +128,13 @@ static ssize_t namespace_store(struct device *dev, | |||
128 | struct nd_btt *nd_btt = to_nd_btt(dev); | 128 | struct nd_btt *nd_btt = to_nd_btt(dev); |
129 | ssize_t rc; | 129 | ssize_t rc; |
130 | 130 | ||
131 | nvdimm_bus_lock(dev); | ||
132 | device_lock(dev); | 131 | device_lock(dev); |
132 | nvdimm_bus_lock(dev); | ||
133 | rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); | 133 | rc = nd_namespace_store(dev, &nd_btt->ndns, buf, len); |
134 | dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, | 134 | dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, |
135 | rc, buf, buf[len - 1] == '\n' ? "" : "\n"); | 135 | rc, buf, buf[len - 1] == '\n' ? "" : "\n"); |
136 | device_unlock(dev); | ||
137 | nvdimm_bus_unlock(dev); | 136 | nvdimm_bus_unlock(dev); |
137 | device_unlock(dev); | ||
138 | 138 | ||
139 | return rc; | 139 | return rc; |
140 | } | 140 | } |
diff --git a/drivers/nvdimm/pfn_devs.c b/drivers/nvdimm/pfn_devs.c index 3fd7d0d81a47..71805a1aa0f3 100644 --- a/drivers/nvdimm/pfn_devs.c +++ b/drivers/nvdimm/pfn_devs.c | |||
@@ -148,13 +148,13 @@ static ssize_t namespace_store(struct device *dev, | |||
148 | struct nd_pfn *nd_pfn = to_nd_pfn(dev); | 148 | struct nd_pfn *nd_pfn = to_nd_pfn(dev); |
149 | ssize_t rc; | 149 | ssize_t rc; |
150 | 150 | ||
151 | nvdimm_bus_lock(dev); | ||
152 | device_lock(dev); | 151 | device_lock(dev); |
152 | nvdimm_bus_lock(dev); | ||
153 | rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); | 153 | rc = nd_namespace_store(dev, &nd_pfn->ndns, buf, len); |
154 | dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, | 154 | dev_dbg(dev, "%s: result: %zd wrote: %s%s", __func__, |
155 | rc, buf, buf[len - 1] == '\n' ? "" : "\n"); | 155 | rc, buf, buf[len - 1] == '\n' ? "" : "\n"); |
156 | device_unlock(dev); | ||
157 | nvdimm_bus_unlock(dev); | 156 | nvdimm_bus_unlock(dev); |
157 | device_unlock(dev); | ||
158 | 158 | ||
159 | return rc; | 159 | return rc; |
160 | } | 160 | } |
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c index b9525385c0dc..0ba6a978f227 100644 --- a/drivers/nvdimm/pmem.c +++ b/drivers/nvdimm/pmem.c | |||
@@ -92,6 +92,8 @@ static int pmem_rw_page(struct block_device *bdev, sector_t sector, | |||
92 | struct pmem_device *pmem = bdev->bd_disk->private_data; | 92 | struct pmem_device *pmem = bdev->bd_disk->private_data; |
93 | 93 | ||
94 | pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector); | 94 | pmem_do_bvec(pmem, page, PAGE_CACHE_SIZE, 0, rw, sector); |
95 | if (rw & WRITE) | ||
96 | wmb_pmem(); | ||
95 | page_endio(page, rw & WRITE, 0); | 97 | page_endio(page, rw & WRITE, 0); |
96 | 98 | ||
97 | return 0; | 99 | return 0; |
diff --git a/drivers/pci/host/pci-keystone.c b/drivers/pci/host/pci-keystone.c index 81253e70b1c5..0aa81bd3de12 100644 --- a/drivers/pci/host/pci-keystone.c +++ b/drivers/pci/host/pci-keystone.c | |||
@@ -110,7 +110,7 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie) | |||
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | } | 111 | } |
112 | 112 | ||
113 | static void ks_pcie_msi_irq_handler(unsigned int __irq, struct irq_desc *desc) | 113 | static void ks_pcie_msi_irq_handler(struct irq_desc *desc) |
114 | { | 114 | { |
115 | unsigned int irq = irq_desc_get_irq(desc); | 115 | unsigned int irq = irq_desc_get_irq(desc); |
116 | struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc); | 116 | struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc); |
@@ -138,8 +138,7 @@ static void ks_pcie_msi_irq_handler(unsigned int __irq, struct irq_desc *desc) | |||
138 | * Traverse through pending legacy interrupts and invoke handler for each. Also | 138 | * Traverse through pending legacy interrupts and invoke handler for each. Also |
139 | * takes care of interrupt controller level mask/ack operation. | 139 | * takes care of interrupt controller level mask/ack operation. |
140 | */ | 140 | */ |
141 | static void ks_pcie_legacy_irq_handler(unsigned int __irq, | 141 | static void ks_pcie_legacy_irq_handler(struct irq_desc *desc) |
142 | struct irq_desc *desc) | ||
143 | { | 142 | { |
144 | unsigned int irq = irq_desc_get_irq(desc); | 143 | unsigned int irq = irq_desc_get_irq(desc); |
145 | struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc); | 144 | struct keystone_pcie *ks_pcie = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pci/host/pci-xgene-msi.c b/drivers/pci/host/pci-xgene-msi.c index 996327cfa1e1..e491681daf22 100644 --- a/drivers/pci/host/pci-xgene-msi.c +++ b/drivers/pci/host/pci-xgene-msi.c | |||
@@ -295,7 +295,7 @@ static int xgene_msi_init_allocator(struct xgene_msi *xgene_msi) | |||
295 | return 0; | 295 | return 0; |
296 | } | 296 | } |
297 | 297 | ||
298 | static void xgene_msi_isr(unsigned int irq, struct irq_desc *desc) | 298 | static void xgene_msi_isr(struct irq_desc *desc) |
299 | { | 299 | { |
300 | struct irq_chip *chip = irq_desc_get_chip(desc); | 300 | struct irq_chip *chip = irq_desc_get_chip(desc); |
301 | struct xgene_msi_group *msi_groups; | 301 | struct xgene_msi_group *msi_groups; |
diff --git a/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c b/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c index 7d9482bf8252..1ca783098e47 100644 --- a/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c +++ b/drivers/pinctrl/bcm/pinctrl-cygnus-gpio.c | |||
@@ -143,7 +143,7 @@ static inline bool cygnus_get_bit(struct cygnus_gpio *chip, unsigned int reg, | |||
143 | return !!(readl(chip->base + offset) & BIT(shift)); | 143 | return !!(readl(chip->base + offset) & BIT(shift)); |
144 | } | 144 | } |
145 | 145 | ||
146 | static void cygnus_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 146 | static void cygnus_gpio_irq_handler(struct irq_desc *desc) |
147 | { | 147 | { |
148 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 148 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
149 | struct cygnus_gpio *chip = to_cygnus_gpio(gc); | 149 | struct cygnus_gpio *chip = to_cygnus_gpio(gc); |
diff --git a/drivers/pinctrl/core.c b/drivers/pinctrl/core.c index 69723e07036b..9638a00c67c2 100644 --- a/drivers/pinctrl/core.c +++ b/drivers/pinctrl/core.c | |||
@@ -349,6 +349,9 @@ static bool pinctrl_ready_for_gpio_range(unsigned gpio) | |||
349 | struct pinctrl_gpio_range *range = NULL; | 349 | struct pinctrl_gpio_range *range = NULL; |
350 | struct gpio_chip *chip = gpio_to_chip(gpio); | 350 | struct gpio_chip *chip = gpio_to_chip(gpio); |
351 | 351 | ||
352 | if (WARN(!chip, "no gpio_chip for gpio%i?", gpio)) | ||
353 | return false; | ||
354 | |||
352 | mutex_lock(&pinctrldev_list_mutex); | 355 | mutex_lock(&pinctrldev_list_mutex); |
353 | 356 | ||
354 | /* Loop over the pin controllers */ | 357 | /* Loop over the pin controllers */ |
diff --git a/drivers/pinctrl/intel/pinctrl-baytrail.c b/drivers/pinctrl/intel/pinctrl-baytrail.c index dac4865f3203..f79ea430f651 100644 --- a/drivers/pinctrl/intel/pinctrl-baytrail.c +++ b/drivers/pinctrl/intel/pinctrl-baytrail.c | |||
@@ -425,7 +425,7 @@ static void byt_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) | |||
425 | } | 425 | } |
426 | } | 426 | } |
427 | 427 | ||
428 | static void byt_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 428 | static void byt_gpio_irq_handler(struct irq_desc *desc) |
429 | { | 429 | { |
430 | struct irq_data *data = irq_desc_get_irq_data(desc); | 430 | struct irq_data *data = irq_desc_get_irq_data(desc); |
431 | struct byt_gpio *vg = to_byt_gpio(irq_desc_get_handler_data(desc)); | 431 | struct byt_gpio *vg = to_byt_gpio(irq_desc_get_handler_data(desc)); |
diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c index 2d5d3ddc36e5..270c127e03ea 100644 --- a/drivers/pinctrl/intel/pinctrl-cherryview.c +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c | |||
@@ -1414,7 +1414,7 @@ static struct irq_chip chv_gpio_irqchip = { | |||
1414 | .flags = IRQCHIP_SKIP_SET_WAKE, | 1414 | .flags = IRQCHIP_SKIP_SET_WAKE, |
1415 | }; | 1415 | }; |
1416 | 1416 | ||
1417 | static void chv_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 1417 | static void chv_gpio_irq_handler(struct irq_desc *desc) |
1418 | { | 1418 | { |
1419 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 1419 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
1420 | struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc); | 1420 | struct chv_pinctrl *pctrl = gpiochip_to_pinctrl(gc); |
diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c index bb377c110541..54848b8decef 100644 --- a/drivers/pinctrl/intel/pinctrl-intel.c +++ b/drivers/pinctrl/intel/pinctrl-intel.c | |||
@@ -836,7 +836,7 @@ static void intel_gpio_community_irq_handler(struct gpio_chip *gc, | |||
836 | } | 836 | } |
837 | } | 837 | } |
838 | 838 | ||
839 | static void intel_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 839 | static void intel_gpio_irq_handler(struct irq_desc *desc) |
840 | { | 840 | { |
841 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 841 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
842 | struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(gc); | 842 | struct intel_pinctrl *pctrl = gpiochip_to_pinctrl(gc); |
diff --git a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c index 7726c6caaf83..1b22f96ba839 100644 --- a/drivers/pinctrl/mediatek/pinctrl-mtk-common.c +++ b/drivers/pinctrl/mediatek/pinctrl-mtk-common.c | |||
@@ -1190,7 +1190,7 @@ mtk_eint_debounce_process(struct mtk_pinctrl *pctl, int index) | |||
1190 | } | 1190 | } |
1191 | } | 1191 | } |
1192 | 1192 | ||
1193 | static void mtk_eint_irq_handler(unsigned irq, struct irq_desc *desc) | 1193 | static void mtk_eint_irq_handler(struct irq_desc *desc) |
1194 | { | 1194 | { |
1195 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1195 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1196 | struct mtk_pinctrl *pctl = irq_desc_get_handler_data(desc); | 1196 | struct mtk_pinctrl *pctl = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pinctrl/nomadik/pinctrl-nomadik.c b/drivers/pinctrl/nomadik/pinctrl-nomadik.c index 352ede13a9e9..96cf03908e93 100644 --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c | |||
@@ -860,7 +860,7 @@ static void __nmk_gpio_irq_handler(struct irq_desc *desc, u32 status) | |||
860 | chained_irq_exit(host_chip, desc); | 860 | chained_irq_exit(host_chip, desc); |
861 | } | 861 | } |
862 | 862 | ||
863 | static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | 863 | static void nmk_gpio_irq_handler(struct irq_desc *desc) |
864 | { | 864 | { |
865 | struct gpio_chip *chip = irq_desc_get_handler_data(desc); | 865 | struct gpio_chip *chip = irq_desc_get_handler_data(desc); |
866 | struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip); | 866 | struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip); |
@@ -873,7 +873,7 @@ static void nmk_gpio_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
873 | __nmk_gpio_irq_handler(desc, status); | 873 | __nmk_gpio_irq_handler(desc, status); |
874 | } | 874 | } |
875 | 875 | ||
876 | static void nmk_gpio_latent_irq_handler(unsigned int irq, struct irq_desc *desc) | 876 | static void nmk_gpio_latent_irq_handler(struct irq_desc *desc) |
877 | { | 877 | { |
878 | struct gpio_chip *chip = irq_desc_get_handler_data(desc); | 878 | struct gpio_chip *chip = irq_desc_get_handler_data(desc); |
879 | struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip); | 879 | struct nmk_gpio_chip *nmk_chip = container_of(chip, struct nmk_gpio_chip, chip); |
diff --git a/drivers/pinctrl/pinctrl-adi2.c b/drivers/pinctrl/pinctrl-adi2.c index a5976ebc4482..f6be68518c87 100644 --- a/drivers/pinctrl/pinctrl-adi2.c +++ b/drivers/pinctrl/pinctrl-adi2.c | |||
@@ -530,8 +530,7 @@ static inline void preflow_handler(struct irq_desc *desc) | |||
530 | static inline void preflow_handler(struct irq_desc *desc) { } | 530 | static inline void preflow_handler(struct irq_desc *desc) { } |
531 | #endif | 531 | #endif |
532 | 532 | ||
533 | static void adi_gpio_handle_pint_irq(unsigned int inta_irq, | 533 | static void adi_gpio_handle_pint_irq(struct irq_desc *desc) |
534 | struct irq_desc *desc) | ||
535 | { | 534 | { |
536 | u32 request; | 535 | u32 request; |
537 | u32 level_mask, hwirq; | 536 | u32 level_mask, hwirq; |
diff --git a/drivers/pinctrl/pinctrl-amd.c b/drivers/pinctrl/pinctrl-amd.c index 5e86bb8ca80e..3318f1d6193c 100644 --- a/drivers/pinctrl/pinctrl-amd.c +++ b/drivers/pinctrl/pinctrl-amd.c | |||
@@ -492,15 +492,15 @@ static struct irq_chip amd_gpio_irqchip = { | |||
492 | .irq_set_type = amd_gpio_irq_set_type, | 492 | .irq_set_type = amd_gpio_irq_set_type, |
493 | }; | 493 | }; |
494 | 494 | ||
495 | static void amd_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc) | 495 | static void amd_gpio_irq_handler(struct irq_desc *desc) |
496 | { | 496 | { |
497 | unsigned int irq = irq_desc_get_irq(desc); | ||
498 | u32 i; | 497 | u32 i; |
499 | u32 off; | 498 | u32 off; |
500 | u32 reg; | 499 | u32 reg; |
501 | u32 pin_reg; | 500 | u32 pin_reg; |
502 | u64 reg64; | 501 | u64 reg64; |
503 | int handled = 0; | 502 | int handled = 0; |
503 | unsigned int irq; | ||
504 | unsigned long flags; | 504 | unsigned long flags; |
505 | struct irq_chip *chip = irq_desc_get_chip(desc); | 505 | struct irq_chip *chip = irq_desc_get_chip(desc); |
506 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 506 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
@@ -541,7 +541,7 @@ static void amd_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc) | |||
541 | } | 541 | } |
542 | 542 | ||
543 | if (handled == 0) | 543 | if (handled == 0) |
544 | handle_bad_irq(irq, desc); | 544 | handle_bad_irq(desc); |
545 | 545 | ||
546 | spin_lock_irqsave(&gpio_dev->lock, flags); | 546 | spin_lock_irqsave(&gpio_dev->lock, flags); |
547 | reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG); | 547 | reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG); |
diff --git a/drivers/pinctrl/pinctrl-at91.c b/drivers/pinctrl/pinctrl-at91.c index bae0012ee356..b0fde0f385e6 100644 --- a/drivers/pinctrl/pinctrl-at91.c +++ b/drivers/pinctrl/pinctrl-at91.c | |||
@@ -1585,7 +1585,7 @@ static struct irq_chip gpio_irqchip = { | |||
1585 | .irq_set_wake = gpio_irq_set_wake, | 1585 | .irq_set_wake = gpio_irq_set_wake, |
1586 | }; | 1586 | }; |
1587 | 1587 | ||
1588 | static void gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 1588 | static void gpio_irq_handler(struct irq_desc *desc) |
1589 | { | 1589 | { |
1590 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1590 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1591 | struct gpio_chip *gpio_chip = irq_desc_get_handler_data(desc); | 1591 | struct gpio_chip *gpio_chip = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pinctrl/pinctrl-coh901.c b/drivers/pinctrl/pinctrl-coh901.c index 3731cc67a88b..9c9b88934bcc 100644 --- a/drivers/pinctrl/pinctrl-coh901.c +++ b/drivers/pinctrl/pinctrl-coh901.c | |||
@@ -519,7 +519,7 @@ static struct irq_chip u300_gpio_irqchip = { | |||
519 | .irq_set_type = u300_gpio_irq_type, | 519 | .irq_set_type = u300_gpio_irq_type, |
520 | }; | 520 | }; |
521 | 521 | ||
522 | static void u300_gpio_irq_handler(unsigned __irq, struct irq_desc *desc) | 522 | static void u300_gpio_irq_handler(struct irq_desc *desc) |
523 | { | 523 | { |
524 | unsigned int irq = irq_desc_get_irq(desc); | 524 | unsigned int irq = irq_desc_get_irq(desc); |
525 | struct irq_chip *parent_chip = irq_desc_get_chip(desc); | 525 | struct irq_chip *parent_chip = irq_desc_get_chip(desc); |
diff --git a/drivers/pinctrl/pinctrl-digicolor.c b/drivers/pinctrl/pinctrl-digicolor.c index 461fffc4c62a..11f8b835d3b6 100644 --- a/drivers/pinctrl/pinctrl-digicolor.c +++ b/drivers/pinctrl/pinctrl-digicolor.c | |||
@@ -337,9 +337,9 @@ static int dc_pinctrl_probe(struct platform_device *pdev) | |||
337 | pmap->dev = &pdev->dev; | 337 | pmap->dev = &pdev->dev; |
338 | 338 | ||
339 | pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap); | 339 | pmap->pctl = pinctrl_register(pctl_desc, &pdev->dev, pmap); |
340 | if (!pmap->pctl) { | 340 | if (IS_ERR(pmap->pctl)) { |
341 | dev_err(&pdev->dev, "pinctrl driver registration failed\n"); | 341 | dev_err(&pdev->dev, "pinctrl driver registration failed\n"); |
342 | return -EINVAL; | 342 | return PTR_ERR(pmap->pctl); |
343 | } | 343 | } |
344 | 344 | ||
345 | ret = dc_gpiochip_add(pmap, pdev->dev.of_node); | 345 | ret = dc_gpiochip_add(pmap, pdev->dev.of_node); |
diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c index 3dc2ae15f3a1..952b1c623887 100644 --- a/drivers/pinctrl/pinctrl-pistachio.c +++ b/drivers/pinctrl/pinctrl-pistachio.c | |||
@@ -1303,20 +1303,18 @@ static int pistachio_gpio_irq_set_type(struct irq_data *data, unsigned int type) | |||
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | if (type & IRQ_TYPE_LEVEL_MASK) | 1305 | if (type & IRQ_TYPE_LEVEL_MASK) |
1306 | __irq_set_handler_locked(data->irq, handle_level_irq); | 1306 | irq_set_handler_locked(data, handle_level_irq); |
1307 | else | 1307 | else |
1308 | __irq_set_handler_locked(data->irq, handle_edge_irq); | 1308 | irq_set_handler_locked(data, handle_edge_irq); |
1309 | 1309 | ||
1310 | return 0; | 1310 | return 0; |
1311 | } | 1311 | } |
1312 | 1312 | ||
1313 | static void pistachio_gpio_irq_handler(unsigned int __irq, | 1313 | static void pistachio_gpio_irq_handler(struct irq_desc *desc) |
1314 | struct irq_desc *desc) | ||
1315 | { | 1314 | { |
1316 | unsigned int irq = irq_desc_get_irq(desc); | ||
1317 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 1315 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
1318 | struct pistachio_gpio_bank *bank = gc_to_bank(gc); | 1316 | struct pistachio_gpio_bank *bank = gc_to_bank(gc); |
1319 | struct irq_chip *chip = irq_get_chip(irq); | 1317 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1320 | unsigned long pending; | 1318 | unsigned long pending; |
1321 | unsigned int pin; | 1319 | unsigned int pin; |
1322 | 1320 | ||
diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index c5246c05f70c..88bb707e107a 100644 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c | |||
@@ -1475,7 +1475,7 @@ static const struct gpio_chip rockchip_gpiolib_chip = { | |||
1475 | * Interrupt handling | 1475 | * Interrupt handling |
1476 | */ | 1476 | */ |
1477 | 1477 | ||
1478 | static void rockchip_irq_demux(unsigned int __irq, struct irq_desc *desc) | 1478 | static void rockchip_irq_demux(struct irq_desc *desc) |
1479 | { | 1479 | { |
1480 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1480 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1481 | struct rockchip_pin_bank *bank = irq_desc_get_handler_data(desc); | 1481 | struct rockchip_pin_bank *bank = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c index bf548c2a7a9d..ef04b962c3d5 100644 --- a/drivers/pinctrl/pinctrl-single.c +++ b/drivers/pinctrl/pinctrl-single.c | |||
@@ -1679,7 +1679,7 @@ static irqreturn_t pcs_irq_handler(int irq, void *d) | |||
1679 | * Use this if you have a separate interrupt for each | 1679 | * Use this if you have a separate interrupt for each |
1680 | * pinctrl-single instance. | 1680 | * pinctrl-single instance. |
1681 | */ | 1681 | */ |
1682 | static void pcs_irq_chain_handler(unsigned int irq, struct irq_desc *desc) | 1682 | static void pcs_irq_chain_handler(struct irq_desc *desc) |
1683 | { | 1683 | { |
1684 | struct pcs_soc_data *pcs_soc = irq_desc_get_handler_data(desc); | 1684 | struct pcs_soc_data *pcs_soc = irq_desc_get_handler_data(desc); |
1685 | struct irq_chip *chip; | 1685 | struct irq_chip *chip; |
diff --git a/drivers/pinctrl/pinctrl-st.c b/drivers/pinctrl/pinctrl-st.c index f8338d2e6b6b..389526e704fb 100644 --- a/drivers/pinctrl/pinctrl-st.c +++ b/drivers/pinctrl/pinctrl-st.c | |||
@@ -1460,7 +1460,7 @@ static void __gpio_irq_handler(struct st_gpio_bank *bank) | |||
1460 | } | 1460 | } |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | 1463 | static void st_gpio_irq_handler(struct irq_desc *desc) |
1464 | { | 1464 | { |
1465 | /* interrupt dedicated per bank */ | 1465 | /* interrupt dedicated per bank */ |
1466 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1466 | struct irq_chip *chip = irq_desc_get_chip(desc); |
@@ -1472,7 +1472,7 @@ static void st_gpio_irq_handler(unsigned irq, struct irq_desc *desc) | |||
1472 | chained_irq_exit(chip, desc); | 1472 | chained_irq_exit(chip, desc); |
1473 | } | 1473 | } |
1474 | 1474 | ||
1475 | static void st_gpio_irqmux_handler(unsigned irq, struct irq_desc *desc) | 1475 | static void st_gpio_irqmux_handler(struct irq_desc *desc) |
1476 | { | 1476 | { |
1477 | struct irq_chip *chip = irq_desc_get_chip(desc); | 1477 | struct irq_chip *chip = irq_desc_get_chip(desc); |
1478 | struct st_pinctrl *info = irq_desc_get_handler_data(desc); | 1478 | struct st_pinctrl *info = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pinctrl/pinmux.c b/drivers/pinctrl/pinmux.c index 67e08cb315c4..29984b36926a 100644 --- a/drivers/pinctrl/pinmux.c +++ b/drivers/pinctrl/pinmux.c | |||
@@ -313,8 +313,7 @@ static int pinmux_func_name_to_selector(struct pinctrl_dev *pctldev, | |||
313 | 313 | ||
314 | /* See if this pctldev has this function */ | 314 | /* See if this pctldev has this function */ |
315 | while (selector < nfuncs) { | 315 | while (selector < nfuncs) { |
316 | const char *fname = ops->get_function_name(pctldev, | 316 | const char *fname = ops->get_function_name(pctldev, selector); |
317 | selector); | ||
318 | 317 | ||
319 | if (!strcmp(function, fname)) | 318 | if (!strcmp(function, fname)) |
320 | return selector; | 319 | return selector; |
diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c index 492cdd51dc5c..a0c7407c1cac 100644 --- a/drivers/pinctrl/qcom/pinctrl-msm.c +++ b/drivers/pinctrl/qcom/pinctrl-msm.c | |||
@@ -765,9 +765,8 @@ static struct irq_chip msm_gpio_irq_chip = { | |||
765 | .irq_set_wake = msm_gpio_irq_set_wake, | 765 | .irq_set_wake = msm_gpio_irq_set_wake, |
766 | }; | 766 | }; |
767 | 767 | ||
768 | static void msm_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc) | 768 | static void msm_gpio_irq_handler(struct irq_desc *desc) |
769 | { | 769 | { |
770 | unsigned int irq = irq_desc_get_irq(desc); | ||
771 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 770 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
772 | const struct msm_pingroup *g; | 771 | const struct msm_pingroup *g; |
773 | struct msm_pinctrl *pctrl = to_msm_pinctrl(gc); | 772 | struct msm_pinctrl *pctrl = to_msm_pinctrl(gc); |
@@ -795,7 +794,7 @@ static void msm_gpio_irq_handler(unsigned int __irq, struct irq_desc *desc) | |||
795 | 794 | ||
796 | /* No interrupts were flagged */ | 795 | /* No interrupts were flagged */ |
797 | if (handled == 0) | 796 | if (handled == 0) |
798 | handle_bad_irq(irq, desc); | 797 | handle_bad_irq(desc); |
799 | 798 | ||
800 | chained_irq_exit(chip, desc); | 799 | chained_irq_exit(chip, desc); |
801 | } | 800 | } |
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c index c978b311031b..e1a3721bc8e5 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-gpio.c | |||
@@ -723,9 +723,9 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev) | |||
723 | #endif | 723 | #endif |
724 | 724 | ||
725 | pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); | 725 | pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); |
726 | if (!pctrl->pctrl) { | 726 | if (IS_ERR(pctrl->pctrl)) { |
727 | dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n"); | 727 | dev_err(&pdev->dev, "couldn't register pm8xxx gpio driver\n"); |
728 | return -ENODEV; | 728 | return PTR_ERR(pctrl->pctrl); |
729 | } | 729 | } |
730 | 730 | ||
731 | pctrl->chip = pm8xxx_gpio_template; | 731 | pctrl->chip = pm8xxx_gpio_template; |
diff --git a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c index 2d1b69f171be..6652b8d7f707 100644 --- a/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c +++ b/drivers/pinctrl/qcom/pinctrl-ssbi-mpp.c | |||
@@ -814,9 +814,9 @@ static int pm8xxx_mpp_probe(struct platform_device *pdev) | |||
814 | #endif | 814 | #endif |
815 | 815 | ||
816 | pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); | 816 | pctrl->pctrl = pinctrl_register(&pctrl->desc, &pdev->dev, pctrl); |
817 | if (!pctrl->pctrl) { | 817 | if (IS_ERR(pctrl->pctrl)) { |
818 | dev_err(&pdev->dev, "couldn't register pm8xxx mpp driver\n"); | 818 | dev_err(&pdev->dev, "couldn't register pm8xxx mpp driver\n"); |
819 | return -ENODEV; | 819 | return PTR_ERR(pctrl->pctrl); |
820 | } | 820 | } |
821 | 821 | ||
822 | pctrl->chip = pm8xxx_mpp_template; | 822 | pctrl->chip = pm8xxx_mpp_template; |
diff --git a/drivers/pinctrl/samsung/pinctrl-exynos.c b/drivers/pinctrl/samsung/pinctrl-exynos.c index 5f45caaef46d..71ccf6a90b22 100644 --- a/drivers/pinctrl/samsung/pinctrl-exynos.c +++ b/drivers/pinctrl/samsung/pinctrl-exynos.c | |||
@@ -419,7 +419,7 @@ static const struct of_device_id exynos_wkup_irq_ids[] = { | |||
419 | }; | 419 | }; |
420 | 420 | ||
421 | /* interrupt handler for wakeup interrupts 0..15 */ | 421 | /* interrupt handler for wakeup interrupts 0..15 */ |
422 | static void exynos_irq_eint0_15(unsigned int irq, struct irq_desc *desc) | 422 | static void exynos_irq_eint0_15(struct irq_desc *desc) |
423 | { | 423 | { |
424 | struct exynos_weint_data *eintd = irq_desc_get_handler_data(desc); | 424 | struct exynos_weint_data *eintd = irq_desc_get_handler_data(desc); |
425 | struct samsung_pin_bank *bank = eintd->bank; | 425 | struct samsung_pin_bank *bank = eintd->bank; |
@@ -451,7 +451,7 @@ static inline void exynos_irq_demux_eint(unsigned long pend, | |||
451 | } | 451 | } |
452 | 452 | ||
453 | /* interrupt handler for wakeup interrupt 16 */ | 453 | /* interrupt handler for wakeup interrupt 16 */ |
454 | static void exynos_irq_demux_eint16_31(unsigned int irq, struct irq_desc *desc) | 454 | static void exynos_irq_demux_eint16_31(struct irq_desc *desc) |
455 | { | 455 | { |
456 | struct irq_chip *chip = irq_desc_get_chip(desc); | 456 | struct irq_chip *chip = irq_desc_get_chip(desc); |
457 | struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc); | 457 | struct exynos_muxed_weint_data *eintd = irq_desc_get_handler_data(desc); |
diff --git a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c index 019844d479bb..3d92f827da7a 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c24xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c24xx.c | |||
@@ -240,7 +240,7 @@ static struct irq_chip s3c2410_eint0_3_chip = { | |||
240 | .irq_set_type = s3c24xx_eint_type, | 240 | .irq_set_type = s3c24xx_eint_type, |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static void s3c2410_demux_eint0_3(unsigned int irq, struct irq_desc *desc) | 243 | static void s3c2410_demux_eint0_3(struct irq_desc *desc) |
244 | { | 244 | { |
245 | struct irq_data *data = irq_desc_get_irq_data(desc); | 245 | struct irq_data *data = irq_desc_get_irq_data(desc); |
246 | struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc); | 246 | struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc); |
@@ -295,7 +295,7 @@ static struct irq_chip s3c2412_eint0_3_chip = { | |||
295 | .irq_set_type = s3c24xx_eint_type, | 295 | .irq_set_type = s3c24xx_eint_type, |
296 | }; | 296 | }; |
297 | 297 | ||
298 | static void s3c2412_demux_eint0_3(unsigned int irq, struct irq_desc *desc) | 298 | static void s3c2412_demux_eint0_3(struct irq_desc *desc) |
299 | { | 299 | { |
300 | struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc); | 300 | struct s3c24xx_eint_data *eint_data = irq_desc_get_handler_data(desc); |
301 | struct irq_data *data = irq_desc_get_irq_data(desc); | 301 | struct irq_data *data = irq_desc_get_irq_data(desc); |
@@ -361,7 +361,7 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc, | |||
361 | u32 offset, u32 range) | 361 | u32 offset, u32 range) |
362 | { | 362 | { |
363 | struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc); | 363 | struct s3c24xx_eint_data *data = irq_desc_get_handler_data(desc); |
364 | struct irq_chip *chip = irq_desc_get_irq_chip(desc); | 364 | struct irq_chip *chip = irq_desc_get_chip(desc); |
365 | struct samsung_pinctrl_drv_data *d = data->drvdata; | 365 | struct samsung_pinctrl_drv_data *d = data->drvdata; |
366 | unsigned int pend, mask; | 366 | unsigned int pend, mask; |
367 | 367 | ||
@@ -388,12 +388,12 @@ static inline void s3c24xx_demux_eint(struct irq_desc *desc, | |||
388 | chained_irq_exit(chip, desc); | 388 | chained_irq_exit(chip, desc); |
389 | } | 389 | } |
390 | 390 | ||
391 | static void s3c24xx_demux_eint4_7(unsigned int irq, struct irq_desc *desc) | 391 | static void s3c24xx_demux_eint4_7(struct irq_desc *desc) |
392 | { | 392 | { |
393 | s3c24xx_demux_eint(desc, 0, 0xf0); | 393 | s3c24xx_demux_eint(desc, 0, 0xf0); |
394 | } | 394 | } |
395 | 395 | ||
396 | static void s3c24xx_demux_eint8_23(unsigned int irq, struct irq_desc *desc) | 396 | static void s3c24xx_demux_eint8_23(struct irq_desc *desc) |
397 | { | 397 | { |
398 | s3c24xx_demux_eint(desc, 8, 0xffff00); | 398 | s3c24xx_demux_eint(desc, 8, 0xffff00); |
399 | } | 399 | } |
diff --git a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c index f5ea40a69711..43407ab248f5 100644 --- a/drivers/pinctrl/samsung/pinctrl-s3c64xx.c +++ b/drivers/pinctrl/samsung/pinctrl-s3c64xx.c | |||
@@ -407,7 +407,7 @@ static const struct irq_domain_ops s3c64xx_gpio_irqd_ops = { | |||
407 | .xlate = irq_domain_xlate_twocell, | 407 | .xlate = irq_domain_xlate_twocell, |
408 | }; | 408 | }; |
409 | 409 | ||
410 | static void s3c64xx_eint_gpio_irq(unsigned int irq, struct irq_desc *desc) | 410 | static void s3c64xx_eint_gpio_irq(struct irq_desc *desc) |
411 | { | 411 | { |
412 | struct irq_chip *chip = irq_desc_get_chip(desc); | 412 | struct irq_chip *chip = irq_desc_get_chip(desc); |
413 | struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc); | 413 | struct s3c64xx_eint_gpio_data *data = irq_desc_get_handler_data(desc); |
@@ -631,22 +631,22 @@ static inline void s3c64xx_irq_demux_eint(struct irq_desc *desc, u32 range) | |||
631 | chained_irq_exit(chip, desc); | 631 | chained_irq_exit(chip, desc); |
632 | } | 632 | } |
633 | 633 | ||
634 | static void s3c64xx_demux_eint0_3(unsigned int irq, struct irq_desc *desc) | 634 | static void s3c64xx_demux_eint0_3(struct irq_desc *desc) |
635 | { | 635 | { |
636 | s3c64xx_irq_demux_eint(desc, 0xf); | 636 | s3c64xx_irq_demux_eint(desc, 0xf); |
637 | } | 637 | } |
638 | 638 | ||
639 | static void s3c64xx_demux_eint4_11(unsigned int irq, struct irq_desc *desc) | 639 | static void s3c64xx_demux_eint4_11(struct irq_desc *desc) |
640 | { | 640 | { |
641 | s3c64xx_irq_demux_eint(desc, 0xff0); | 641 | s3c64xx_irq_demux_eint(desc, 0xff0); |
642 | } | 642 | } |
643 | 643 | ||
644 | static void s3c64xx_demux_eint12_19(unsigned int irq, struct irq_desc *desc) | 644 | static void s3c64xx_demux_eint12_19(struct irq_desc *desc) |
645 | { | 645 | { |
646 | s3c64xx_irq_demux_eint(desc, 0xff000); | 646 | s3c64xx_irq_demux_eint(desc, 0xff000); |
647 | } | 647 | } |
648 | 648 | ||
649 | static void s3c64xx_demux_eint20_27(unsigned int irq, struct irq_desc *desc) | 649 | static void s3c64xx_demux_eint20_27(struct irq_desc *desc) |
650 | { | 650 | { |
651 | s3c64xx_irq_demux_eint(desc, 0xff00000); | 651 | s3c64xx_irq_demux_eint(desc, 0xff00000); |
652 | } | 652 | } |
diff --git a/drivers/pinctrl/sirf/pinctrl-atlas7.c b/drivers/pinctrl/sirf/pinctrl-atlas7.c index 9df0c5f25824..0d24d9e4b70c 100644 --- a/drivers/pinctrl/sirf/pinctrl-atlas7.c +++ b/drivers/pinctrl/sirf/pinctrl-atlas7.c | |||
@@ -4489,7 +4489,7 @@ static struct irq_chip atlas7_gpio_irq_chip = { | |||
4489 | .irq_set_type = atlas7_gpio_irq_type, | 4489 | .irq_set_type = atlas7_gpio_irq_type, |
4490 | }; | 4490 | }; |
4491 | 4491 | ||
4492 | static void atlas7_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc) | 4492 | static void atlas7_gpio_handle_irq(struct irq_desc *desc) |
4493 | { | 4493 | { |
4494 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 4494 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
4495 | struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); | 4495 | struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc); |
@@ -4512,7 +4512,7 @@ static void atlas7_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc) | |||
4512 | if (!status) { | 4512 | if (!status) { |
4513 | pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n", | 4513 | pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n", |
4514 | __func__, gc->label, status); | 4514 | __func__, gc->label, status); |
4515 | handle_bad_irq(irq, desc); | 4515 | handle_bad_irq(desc); |
4516 | return; | 4516 | return; |
4517 | } | 4517 | } |
4518 | 4518 | ||
diff --git a/drivers/pinctrl/sirf/pinctrl-sirf.c b/drivers/pinctrl/sirf/pinctrl-sirf.c index f8bd9fb52033..2a8d69725de8 100644 --- a/drivers/pinctrl/sirf/pinctrl-sirf.c +++ b/drivers/pinctrl/sirf/pinctrl-sirf.c | |||
@@ -545,7 +545,7 @@ static struct irq_chip sirfsoc_irq_chip = { | |||
545 | .irq_set_type = sirfsoc_gpio_irq_type, | 545 | .irq_set_type = sirfsoc_gpio_irq_type, |
546 | }; | 546 | }; |
547 | 547 | ||
548 | static void sirfsoc_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc) | 548 | static void sirfsoc_gpio_handle_irq(struct irq_desc *desc) |
549 | { | 549 | { |
550 | unsigned int irq = irq_desc_get_irq(desc); | 550 | unsigned int irq = irq_desc_get_irq(desc); |
551 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 551 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
@@ -570,7 +570,7 @@ static void sirfsoc_gpio_handle_irq(unsigned int __irq, struct irq_desc *desc) | |||
570 | printk(KERN_WARNING | 570 | printk(KERN_WARNING |
571 | "%s: gpio id %d status %#x no interrupt is flagged\n", | 571 | "%s: gpio id %d status %#x no interrupt is flagged\n", |
572 | __func__, bank->id, status); | 572 | __func__, bank->id, status); |
573 | handle_bad_irq(irq, desc); | 573 | handle_bad_irq(desc); |
574 | return; | 574 | return; |
575 | } | 575 | } |
576 | 576 | ||
diff --git a/drivers/pinctrl/spear/pinctrl-plgpio.c b/drivers/pinctrl/spear/pinctrl-plgpio.c index ae8f29fb5536..1f0af250dbb5 100644 --- a/drivers/pinctrl/spear/pinctrl-plgpio.c +++ b/drivers/pinctrl/spear/pinctrl-plgpio.c | |||
@@ -356,7 +356,7 @@ static struct irq_chip plgpio_irqchip = { | |||
356 | .irq_set_type = plgpio_irq_set_type, | 356 | .irq_set_type = plgpio_irq_set_type, |
357 | }; | 357 | }; |
358 | 358 | ||
359 | static void plgpio_irq_handler(unsigned irq, struct irq_desc *desc) | 359 | static void plgpio_irq_handler(struct irq_desc *desc) |
360 | { | 360 | { |
361 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); | 361 | struct gpio_chip *gc = irq_desc_get_handler_data(desc); |
362 | struct plgpio *plgpio = container_of(gc, struct plgpio, chip); | 362 | struct plgpio *plgpio = container_of(gc, struct plgpio, chip); |
diff --git a/drivers/pinctrl/sunxi/pinctrl-sunxi.c b/drivers/pinctrl/sunxi/pinctrl-sunxi.c index fb4669c0ce0e..38e0c7bdd2ac 100644 --- a/drivers/pinctrl/sunxi/pinctrl-sunxi.c +++ b/drivers/pinctrl/sunxi/pinctrl-sunxi.c | |||
@@ -617,13 +617,11 @@ static int sunxi_pinctrl_irq_set_type(struct irq_data *d, unsigned int type) | |||
617 | spin_lock_irqsave(&pctl->lock, flags); | 617 | spin_lock_irqsave(&pctl->lock, flags); |
618 | 618 | ||
619 | if (type & IRQ_TYPE_LEVEL_MASK) | 619 | if (type & IRQ_TYPE_LEVEL_MASK) |
620 | __irq_set_chip_handler_name_locked(d->irq, | 620 | irq_set_chip_handler_name_locked(d, &sunxi_pinctrl_level_irq_chip, |
621 | &sunxi_pinctrl_level_irq_chip, | 621 | handle_fasteoi_irq, NULL); |
622 | handle_fasteoi_irq, NULL); | ||
623 | else | 622 | else |
624 | __irq_set_chip_handler_name_locked(d->irq, | 623 | irq_set_chip_handler_name_locked(d, &sunxi_pinctrl_edge_irq_chip, |
625 | &sunxi_pinctrl_edge_irq_chip, | 624 | handle_edge_irq, NULL); |
626 | handle_edge_irq, NULL); | ||
627 | 625 | ||
628 | regval = readl(pctl->membase + reg); | 626 | regval = readl(pctl->membase + reg); |
629 | regval &= ~(IRQ_CFG_IRQ_MASK << index); | 627 | regval &= ~(IRQ_CFG_IRQ_MASK << index); |
@@ -742,7 +740,7 @@ static struct irq_domain_ops sunxi_pinctrl_irq_domain_ops = { | |||
742 | .xlate = sunxi_pinctrl_irq_of_xlate, | 740 | .xlate = sunxi_pinctrl_irq_of_xlate, |
743 | }; | 741 | }; |
744 | 742 | ||
745 | static void sunxi_pinctrl_irq_handler(unsigned __irq, struct irq_desc *desc) | 743 | static void sunxi_pinctrl_irq_handler(struct irq_desc *desc) |
746 | { | 744 | { |
747 | unsigned int irq = irq_desc_get_irq(desc); | 745 | unsigned int irq = irq_desc_get_irq(desc); |
748 | struct irq_chip *chip = irq_desc_get_chip(desc); | 746 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/platform/x86/asus-nb-wmi.c b/drivers/platform/x86/asus-nb-wmi.c index abdaed34c728..131fee2b093e 100644 --- a/drivers/platform/x86/asus-nb-wmi.c +++ b/drivers/platform/x86/asus-nb-wmi.c | |||
@@ -128,6 +128,24 @@ static const struct dmi_system_id asus_quirks[] = { | |||
128 | }, | 128 | }, |
129 | { | 129 | { |
130 | .callback = dmi_matched, | 130 | .callback = dmi_matched, |
131 | .ident = "ASUSTeK COMPUTER INC. X456UA", | ||
132 | .matches = { | ||
133 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
134 | DMI_MATCH(DMI_PRODUCT_NAME, "X456UA"), | ||
135 | }, | ||
136 | .driver_data = &quirk_asus_wapf4, | ||
137 | }, | ||
138 | { | ||
139 | .callback = dmi_matched, | ||
140 | .ident = "ASUSTeK COMPUTER INC. X456UF", | ||
141 | .matches = { | ||
142 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | ||
143 | DMI_MATCH(DMI_PRODUCT_NAME, "X456UF"), | ||
144 | }, | ||
145 | .driver_data = &quirk_asus_wapf4, | ||
146 | }, | ||
147 | { | ||
148 | .callback = dmi_matched, | ||
131 | .ident = "ASUSTeK COMPUTER INC. X501U", | 149 | .ident = "ASUSTeK COMPUTER INC. X501U", |
132 | .matches = { | 150 | .matches = { |
133 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), | 151 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c index 06697315a088..fb4dd7b3ee71 100644 --- a/drivers/platform/x86/hp-wmi.c +++ b/drivers/platform/x86/hp-wmi.c | |||
@@ -54,8 +54,9 @@ MODULE_ALIAS("wmi:5FB7F034-2C63-45e9-BE91-3D44E2C707E4"); | |||
54 | #define HPWMI_HARDWARE_QUERY 0x4 | 54 | #define HPWMI_HARDWARE_QUERY 0x4 |
55 | #define HPWMI_WIRELESS_QUERY 0x5 | 55 | #define HPWMI_WIRELESS_QUERY 0x5 |
56 | #define HPWMI_BIOS_QUERY 0x9 | 56 | #define HPWMI_BIOS_QUERY 0x9 |
57 | #define HPWMI_FEATURE_QUERY 0xb | ||
57 | #define HPWMI_HOTKEY_QUERY 0xc | 58 | #define HPWMI_HOTKEY_QUERY 0xc |
58 | #define HPWMI_FEATURE_QUERY 0xd | 59 | #define HPWMI_FEATURE2_QUERY 0xd |
59 | #define HPWMI_WIRELESS2_QUERY 0x1b | 60 | #define HPWMI_WIRELESS2_QUERY 0x1b |
60 | #define HPWMI_POSTCODEERROR_QUERY 0x2a | 61 | #define HPWMI_POSTCODEERROR_QUERY 0x2a |
61 | 62 | ||
@@ -295,25 +296,33 @@ static int hp_wmi_tablet_state(void) | |||
295 | return (state & 0x4) ? 1 : 0; | 296 | return (state & 0x4) ? 1 : 0; |
296 | } | 297 | } |
297 | 298 | ||
298 | static int __init hp_wmi_bios_2009_later(void) | 299 | static int __init hp_wmi_bios_2008_later(void) |
299 | { | 300 | { |
300 | int state = 0; | 301 | int state = 0; |
301 | int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, 0, &state, | 302 | int ret = hp_wmi_perform_query(HPWMI_FEATURE_QUERY, 0, &state, |
302 | sizeof(state), sizeof(state)); | 303 | sizeof(state), sizeof(state)); |
303 | if (ret) | 304 | if (!ret) |
304 | return ret; | 305 | return 1; |
305 | 306 | ||
306 | return (state & 0x10) ? 1 : 0; | 307 | return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; |
307 | } | 308 | } |
308 | 309 | ||
309 | static int hp_wmi_enable_hotkeys(void) | 310 | static int __init hp_wmi_bios_2009_later(void) |
310 | { | 311 | { |
311 | int ret; | 312 | int state = 0; |
312 | int query = 0x6e; | 313 | int ret = hp_wmi_perform_query(HPWMI_FEATURE2_QUERY, 0, &state, |
314 | sizeof(state), sizeof(state)); | ||
315 | if (!ret) | ||
316 | return 1; | ||
313 | 317 | ||
314 | ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &query, sizeof(query), | 318 | return (ret == HPWMI_RET_UNKNOWN_CMDTYPE) ? 0 : -ENXIO; |
315 | 0); | 319 | } |
316 | 320 | ||
321 | static int __init hp_wmi_enable_hotkeys(void) | ||
322 | { | ||
323 | int value = 0x6e; | ||
324 | int ret = hp_wmi_perform_query(HPWMI_BIOS_QUERY, 1, &value, | ||
325 | sizeof(value), 0); | ||
317 | if (ret) | 326 | if (ret) |
318 | return -EINVAL; | 327 | return -EINVAL; |
319 | return 0; | 328 | return 0; |
@@ -663,7 +672,7 @@ static int __init hp_wmi_input_setup(void) | |||
663 | hp_wmi_tablet_state()); | 672 | hp_wmi_tablet_state()); |
664 | input_sync(hp_wmi_input_dev); | 673 | input_sync(hp_wmi_input_dev); |
665 | 674 | ||
666 | if (hp_wmi_bios_2009_later() == 4) | 675 | if (!hp_wmi_bios_2009_later() && hp_wmi_bios_2008_later()) |
667 | hp_wmi_enable_hotkeys(); | 676 | hp_wmi_enable_hotkeys(); |
668 | 677 | ||
669 | status = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL); | 678 | status = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL); |
diff --git a/drivers/platform/x86/toshiba_acpi.c b/drivers/platform/x86/toshiba_acpi.c index 6740c513919c..f2372f400ddb 100644 --- a/drivers/platform/x86/toshiba_acpi.c +++ b/drivers/platform/x86/toshiba_acpi.c | |||
@@ -938,7 +938,7 @@ static int toshiba_usb_sleep_music_get(struct toshiba_acpi_dev *dev, u32 *state) | |||
938 | else if (result == TOS_NOT_SUPPORTED) | 938 | else if (result == TOS_NOT_SUPPORTED) |
939 | return -ENODEV; | 939 | return -ENODEV; |
940 | 940 | ||
941 | return result = TOS_SUCCESS ? 0 : -EIO; | 941 | return result == TOS_SUCCESS ? 0 : -EIO; |
942 | } | 942 | } |
943 | 943 | ||
944 | static int toshiba_usb_sleep_music_set(struct toshiba_acpi_dev *dev, u32 state) | 944 | static int toshiba_usb_sleep_music_set(struct toshiba_acpi_dev *dev, u32 state) |
@@ -2398,11 +2398,9 @@ static int toshiba_acpi_setup_keyboard(struct toshiba_acpi_dev *dev) | |||
2398 | if (error) | 2398 | if (error) |
2399 | return error; | 2399 | return error; |
2400 | 2400 | ||
2401 | error = toshiba_hotkey_event_type_get(dev, &events_type); | 2401 | if (toshiba_hotkey_event_type_get(dev, &events_type)) |
2402 | if (error) { | 2402 | pr_notice("Unable to query Hotkey Event Type\n"); |
2403 | pr_err("Unable to query Hotkey Event Type\n"); | 2403 | |
2404 | return error; | ||
2405 | } | ||
2406 | dev->hotkey_event_type = events_type; | 2404 | dev->hotkey_event_type = events_type; |
2407 | 2405 | ||
2408 | dev->hotkey_dev = input_allocate_device(); | 2406 | dev->hotkey_dev = input_allocate_device(); |
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c index aac47573f9ed..eb391a281833 100644 --- a/drivers/platform/x86/wmi.c +++ b/drivers/platform/x86/wmi.c | |||
@@ -194,34 +194,6 @@ static bool wmi_parse_guid(const u8 *src, u8 *dest) | |||
194 | return true; | 194 | return true; |
195 | } | 195 | } |
196 | 196 | ||
197 | /* | ||
198 | * Convert a raw GUID to the ACII string representation | ||
199 | */ | ||
200 | static int wmi_gtoa(const char *in, char *out) | ||
201 | { | ||
202 | int i; | ||
203 | |||
204 | for (i = 3; i >= 0; i--) | ||
205 | out += sprintf(out, "%02X", in[i] & 0xFF); | ||
206 | |||
207 | out += sprintf(out, "-"); | ||
208 | out += sprintf(out, "%02X", in[5] & 0xFF); | ||
209 | out += sprintf(out, "%02X", in[4] & 0xFF); | ||
210 | out += sprintf(out, "-"); | ||
211 | out += sprintf(out, "%02X", in[7] & 0xFF); | ||
212 | out += sprintf(out, "%02X", in[6] & 0xFF); | ||
213 | out += sprintf(out, "-"); | ||
214 | out += sprintf(out, "%02X", in[8] & 0xFF); | ||
215 | out += sprintf(out, "%02X", in[9] & 0xFF); | ||
216 | out += sprintf(out, "-"); | ||
217 | |||
218 | for (i = 10; i <= 15; i++) | ||
219 | out += sprintf(out, "%02X", in[i] & 0xFF); | ||
220 | |||
221 | *out = '\0'; | ||
222 | return 0; | ||
223 | } | ||
224 | |||
225 | static bool find_guid(const char *guid_string, struct wmi_block **out) | 197 | static bool find_guid(const char *guid_string, struct wmi_block **out) |
226 | { | 198 | { |
227 | char tmp[16], guid_input[16]; | 199 | char tmp[16], guid_input[16]; |
@@ -457,11 +429,7 @@ EXPORT_SYMBOL_GPL(wmi_set_block); | |||
457 | 429 | ||
458 | static void wmi_dump_wdg(const struct guid_block *g) | 430 | static void wmi_dump_wdg(const struct guid_block *g) |
459 | { | 431 | { |
460 | char guid_string[37]; | 432 | pr_info("%pUL:\n", g->guid); |
461 | |||
462 | wmi_gtoa(g->guid, guid_string); | ||
463 | |||
464 | pr_info("%s:\n", guid_string); | ||
465 | pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]); | 433 | pr_info("\tobject_id: %c%c\n", g->object_id[0], g->object_id[1]); |
466 | pr_info("\tnotify_id: %02X\n", g->notify_id); | 434 | pr_info("\tnotify_id: %02X\n", g->notify_id); |
467 | pr_info("\treserved: %02X\n", g->reserved); | 435 | pr_info("\treserved: %02X\n", g->reserved); |
@@ -661,7 +629,6 @@ EXPORT_SYMBOL_GPL(wmi_has_guid); | |||
661 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | 629 | static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, |
662 | char *buf) | 630 | char *buf) |
663 | { | 631 | { |
664 | char guid_string[37]; | ||
665 | struct wmi_block *wblock; | 632 | struct wmi_block *wblock; |
666 | 633 | ||
667 | wblock = dev_get_drvdata(dev); | 634 | wblock = dev_get_drvdata(dev); |
@@ -670,9 +637,7 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, | |||
670 | return strlen(buf); | 637 | return strlen(buf); |
671 | } | 638 | } |
672 | 639 | ||
673 | wmi_gtoa(wblock->gblock.guid, guid_string); | 640 | return sprintf(buf, "wmi:%pUL\n", wblock->gblock.guid); |
674 | |||
675 | return sprintf(buf, "wmi:%s\n", guid_string); | ||
676 | } | 641 | } |
677 | static DEVICE_ATTR_RO(modalias); | 642 | static DEVICE_ATTR_RO(modalias); |
678 | 643 | ||
@@ -695,7 +660,7 @@ static int wmi_dev_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
695 | if (!wblock) | 660 | if (!wblock) |
696 | return -ENOMEM; | 661 | return -ENOMEM; |
697 | 662 | ||
698 | wmi_gtoa(wblock->gblock.guid, guid_string); | 663 | sprintf(guid_string, "%pUL", wblock->gblock.guid); |
699 | 664 | ||
700 | strcpy(&env->buf[env->buflen - 1], "wmi:"); | 665 | strcpy(&env->buf[env->buflen - 1], "wmi:"); |
701 | memcpy(&env->buf[env->buflen - 1 + 4], guid_string, 36); | 666 | memcpy(&env->buf[env->buflen - 1 + 4], guid_string, 36); |
@@ -721,12 +686,9 @@ static struct class wmi_class = { | |||
721 | static int wmi_create_device(const struct guid_block *gblock, | 686 | static int wmi_create_device(const struct guid_block *gblock, |
722 | struct wmi_block *wblock, acpi_handle handle) | 687 | struct wmi_block *wblock, acpi_handle handle) |
723 | { | 688 | { |
724 | char guid_string[37]; | ||
725 | |||
726 | wblock->dev.class = &wmi_class; | 689 | wblock->dev.class = &wmi_class; |
727 | 690 | ||
728 | wmi_gtoa(gblock->guid, guid_string); | 691 | dev_set_name(&wblock->dev, "%pUL", gblock->guid); |
729 | dev_set_name(&wblock->dev, "%s", guid_string); | ||
730 | 692 | ||
731 | dev_set_drvdata(&wblock->dev, wblock); | 693 | dev_set_drvdata(&wblock->dev, wblock); |
732 | 694 | ||
@@ -877,7 +839,6 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event) | |||
877 | struct guid_block *block; | 839 | struct guid_block *block; |
878 | struct wmi_block *wblock; | 840 | struct wmi_block *wblock; |
879 | struct list_head *p; | 841 | struct list_head *p; |
880 | char guid_string[37]; | ||
881 | 842 | ||
882 | list_for_each(p, &wmi_block_list) { | 843 | list_for_each(p, &wmi_block_list) { |
883 | wblock = list_entry(p, struct wmi_block, list); | 844 | wblock = list_entry(p, struct wmi_block, list); |
@@ -888,8 +849,8 @@ static void acpi_wmi_notify(struct acpi_device *device, u32 event) | |||
888 | if (wblock->handler) | 849 | if (wblock->handler) |
889 | wblock->handler(event, wblock->handler_data); | 850 | wblock->handler(event, wblock->handler_data); |
890 | if (debug_event) { | 851 | if (debug_event) { |
891 | wmi_gtoa(wblock->gblock.guid, guid_string); | 852 | pr_info("DEBUG Event GUID: %pUL\n", |
892 | pr_info("DEBUG Event GUID: %s\n", guid_string); | 853 | wblock->gblock.guid); |
893 | } | 854 | } |
894 | 855 | ||
895 | acpi_bus_generate_netlink_event( | 856 | acpi_bus_generate_netlink_event( |
diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index f4f2c1f76c32..74f2d3ff1d7c 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c | |||
@@ -91,7 +91,7 @@ | |||
91 | #define TWL4030_MSTATEC_COMPLETE1 0x0b | 91 | #define TWL4030_MSTATEC_COMPLETE1 0x0b |
92 | #define TWL4030_MSTATEC_COMPLETE4 0x0e | 92 | #define TWL4030_MSTATEC_COMPLETE4 0x0e |
93 | 93 | ||
94 | #if IS_ENABLED(CONFIG_TWL4030_MADC) | 94 | #if IS_REACHABLE(CONFIG_TWL4030_MADC) |
95 | /* | 95 | /* |
96 | * If AC (Accessory Charger) voltage exceeds 4.5V (MADC 11) | 96 | * If AC (Accessory Charger) voltage exceeds 4.5V (MADC 11) |
97 | * then AC is available. | 97 | * then AC is available. |
@@ -1057,13 +1057,9 @@ static int twl4030_bci_probe(struct platform_device *pdev) | |||
1057 | 1057 | ||
1058 | phynode = of_find_compatible_node(bci->dev->of_node->parent, | 1058 | phynode = of_find_compatible_node(bci->dev->of_node->parent, |
1059 | NULL, "ti,twl4030-usb"); | 1059 | NULL, "ti,twl4030-usb"); |
1060 | if (phynode) { | 1060 | if (phynode) |
1061 | bci->transceiver = devm_usb_get_phy_by_node( | 1061 | bci->transceiver = devm_usb_get_phy_by_node( |
1062 | bci->dev, phynode, &bci->usb_nb); | 1062 | bci->dev, phynode, &bci->usb_nb); |
1063 | if (IS_ERR(bci->transceiver) && | ||
1064 | PTR_ERR(bci->transceiver) == -EPROBE_DEFER) | ||
1065 | return -EPROBE_DEFER; | ||
1066 | } | ||
1067 | } | 1063 | } |
1068 | 1064 | ||
1069 | /* Enable interrupts now. */ | 1065 | /* Enable interrupts now. */ |
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index f8d8fdb26b72..e9fae30fafda 100644 --- a/drivers/s390/virtio/virtio_ccw.c +++ b/drivers/s390/virtio/virtio_ccw.c | |||
@@ -400,12 +400,16 @@ static bool virtio_ccw_kvm_notify(struct virtqueue *vq) | |||
400 | static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, | 400 | static int virtio_ccw_read_vq_conf(struct virtio_ccw_device *vcdev, |
401 | struct ccw1 *ccw, int index) | 401 | struct ccw1 *ccw, int index) |
402 | { | 402 | { |
403 | int ret; | ||
404 | |||
403 | vcdev->config_block->index = index; | 405 | vcdev->config_block->index = index; |
404 | ccw->cmd_code = CCW_CMD_READ_VQ_CONF; | 406 | ccw->cmd_code = CCW_CMD_READ_VQ_CONF; |
405 | ccw->flags = 0; | 407 | ccw->flags = 0; |
406 | ccw->count = sizeof(struct vq_config_block); | 408 | ccw->count = sizeof(struct vq_config_block); |
407 | ccw->cda = (__u32)(unsigned long)(vcdev->config_block); | 409 | ccw->cda = (__u32)(unsigned long)(vcdev->config_block); |
408 | ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF); | 410 | ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF); |
411 | if (ret) | ||
412 | return ret; | ||
409 | return vcdev->config_block->num; | 413 | return vcdev->config_block->num; |
410 | } | 414 | } |
411 | 415 | ||
@@ -503,6 +507,10 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev, | |||
503 | goto out_err; | 507 | goto out_err; |
504 | } | 508 | } |
505 | info->num = virtio_ccw_read_vq_conf(vcdev, ccw, i); | 509 | info->num = virtio_ccw_read_vq_conf(vcdev, ccw, i); |
510 | if (info->num < 0) { | ||
511 | err = info->num; | ||
512 | goto out_err; | ||
513 | } | ||
506 | size = PAGE_ALIGN(vring_size(info->num, KVM_VIRTIO_CCW_RING_ALIGN)); | 514 | size = PAGE_ALIGN(vring_size(info->num, KVM_VIRTIO_CCW_RING_ALIGN)); |
507 | info->queue = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO); | 515 | info->queue = alloc_pages_exact(size, GFP_KERNEL | __GFP_ZERO); |
508 | if (info->queue == NULL) { | 516 | if (info->queue == NULL) { |
diff --git a/drivers/sh/intc/core.c b/drivers/sh/intc/core.c index 043419dcee92..8e72bcbd3d6d 100644 --- a/drivers/sh/intc/core.c +++ b/drivers/sh/intc/core.c | |||
@@ -65,7 +65,7 @@ void intc_set_prio_level(unsigned int irq, unsigned int level) | |||
65 | raw_spin_unlock_irqrestore(&intc_big_lock, flags); | 65 | raw_spin_unlock_irqrestore(&intc_big_lock, flags); |
66 | } | 66 | } |
67 | 67 | ||
68 | static void intc_redirect_irq(unsigned int irq, struct irq_desc *desc) | 68 | static void intc_redirect_irq(struct irq_desc *desc) |
69 | { | 69 | { |
70 | generic_handle_irq((unsigned int)irq_desc_get_handler_data(desc)); | 70 | generic_handle_irq((unsigned int)irq_desc_get_handler_data(desc)); |
71 | } | 71 | } |
diff --git a/drivers/sh/intc/internals.h b/drivers/sh/intc/internals.h index 7dff08e2a071..6ce7f0d26dcf 100644 --- a/drivers/sh/intc/internals.h +++ b/drivers/sh/intc/internals.h | |||
@@ -99,15 +99,7 @@ static inline struct intc_desc_int *get_intc_desc(unsigned int irq) | |||
99 | */ | 99 | */ |
100 | static inline void activate_irq(int irq) | 100 | static inline void activate_irq(int irq) |
101 | { | 101 | { |
102 | #ifdef CONFIG_ARM | 102 | irq_modify_status(irq, IRQ_NOREQUEST, IRQ_NOPROBE); |
103 | /* ARM requires an extra step to clear IRQ_NOREQUEST, which it | ||
104 | * sets on behalf of every irq_chip. Also sets IRQ_NOPROBE. | ||
105 | */ | ||
106 | set_irq_flags(irq, IRQF_VALID); | ||
107 | #else | ||
108 | /* same effect on other architectures */ | ||
109 | irq_set_noprobe(irq); | ||
110 | #endif | ||
111 | } | 103 | } |
112 | 104 | ||
113 | static inline int intc_handle_int_cmp(const void *a, const void *b) | 105 | static inline int intc_handle_int_cmp(const void *a, const void *b) |
diff --git a/drivers/sh/intc/virq.c b/drivers/sh/intc/virq.c index bafc51c6f0ba..e7899624aa0b 100644 --- a/drivers/sh/intc/virq.c +++ b/drivers/sh/intc/virq.c | |||
@@ -109,7 +109,7 @@ static int add_virq_to_pirq(unsigned int irq, unsigned int virq) | |||
109 | return 0; | 109 | return 0; |
110 | } | 110 | } |
111 | 111 | ||
112 | static void intc_virq_handler(unsigned int __irq, struct irq_desc *desc) | 112 | static void intc_virq_handler(struct irq_desc *desc) |
113 | { | 113 | { |
114 | unsigned int irq = irq_desc_get_irq(desc); | 114 | unsigned int irq = irq_desc_get_irq(desc); |
115 | struct irq_data *data = irq_desc_get_irq_data(desc); | 115 | struct irq_data *data = irq_desc_get_irq_data(desc); |
@@ -127,7 +127,7 @@ static void intc_virq_handler(unsigned int __irq, struct irq_desc *desc) | |||
127 | handle = (unsigned long)irq_desc_get_handler_data(vdesc); | 127 | handle = (unsigned long)irq_desc_get_handler_data(vdesc); |
128 | addr = INTC_REG(d, _INTC_ADDR_E(handle), 0); | 128 | addr = INTC_REG(d, _INTC_ADDR_E(handle), 0); |
129 | if (intc_reg_fns[_INTC_FN(handle)](addr, handle, 0)) | 129 | if (intc_reg_fns[_INTC_FN(handle)](addr, handle, 0)) |
130 | generic_handle_irq_desc(entry->irq, vdesc); | 130 | generic_handle_irq_desc(vdesc); |
131 | } | 131 | } |
132 | } | 132 | } |
133 | 133 | ||
diff --git a/drivers/soc/dove/pmu.c b/drivers/soc/dove/pmu.c index 6792aae9e2e5..052aecf29893 100644 --- a/drivers/soc/dove/pmu.c +++ b/drivers/soc/dove/pmu.c | |||
@@ -222,9 +222,9 @@ static void __pmu_domain_register(struct pmu_domain *domain, | |||
222 | } | 222 | } |
223 | 223 | ||
224 | /* PMU IRQ controller */ | 224 | /* PMU IRQ controller */ |
225 | static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc) | 225 | static void pmu_irq_handler(struct irq_desc *desc) |
226 | { | 226 | { |
227 | struct pmu_data *pmu = irq_get_handler_data(irq); | 227 | struct pmu_data *pmu = irq_desc_get_handler_data(desc); |
228 | struct irq_chip_generic *gc = pmu->irq_gc; | 228 | struct irq_chip_generic *gc = pmu->irq_gc; |
229 | struct irq_domain *domain = pmu->irq_domain; | 229 | struct irq_domain *domain = pmu->irq_domain; |
230 | void __iomem *base = gc->reg_base; | 230 | void __iomem *base = gc->reg_base; |
@@ -232,7 +232,7 @@ static void pmu_irq_handler(unsigned int irq, struct irq_desc *desc) | |||
232 | u32 done = ~0; | 232 | u32 done = ~0; |
233 | 233 | ||
234 | if (stat == 0) { | 234 | if (stat == 0) { |
235 | handle_bad_irq(irq, desc); | 235 | handle_bad_irq(desc); |
236 | return; | 236 | return; |
237 | } | 237 | } |
238 | 238 | ||
diff --git a/drivers/spmi/spmi-pmic-arb.c b/drivers/spmi/spmi-pmic-arb.c index bdfb3c84c3cb..4a3cf9ba152f 100644 --- a/drivers/spmi/spmi-pmic-arb.c +++ b/drivers/spmi/spmi-pmic-arb.c | |||
@@ -451,7 +451,7 @@ static void periph_interrupt(struct spmi_pmic_arb_dev *pa, u8 apid) | |||
451 | } | 451 | } |
452 | } | 452 | } |
453 | 453 | ||
454 | static void pmic_arb_chained_irq(unsigned int irq, struct irq_desc *desc) | 454 | static void pmic_arb_chained_irq(struct irq_desc *desc) |
455 | { | 455 | { |
456 | struct spmi_pmic_arb_dev *pa = irq_desc_get_handler_data(desc); | 456 | struct spmi_pmic_arb_dev *pa = irq_desc_get_handler_data(desc); |
457 | struct irq_chip *chip = irq_desc_get_chip(desc); | 457 | struct irq_chip *chip = irq_desc_get_chip(desc); |
diff --git a/drivers/staging/rdma/Kconfig b/drivers/staging/rdma/Kconfig index cf5fe9bb87a1..d7f62359d743 100644 --- a/drivers/staging/rdma/Kconfig +++ b/drivers/staging/rdma/Kconfig | |||
@@ -24,6 +24,8 @@ if STAGING_RDMA | |||
24 | 24 | ||
25 | source "drivers/staging/rdma/amso1100/Kconfig" | 25 | source "drivers/staging/rdma/amso1100/Kconfig" |
26 | 26 | ||
27 | source "drivers/staging/rdma/ehca/Kconfig" | ||
28 | |||
27 | source "drivers/staging/rdma/hfi1/Kconfig" | 29 | source "drivers/staging/rdma/hfi1/Kconfig" |
28 | 30 | ||
29 | source "drivers/staging/rdma/ipath/Kconfig" | 31 | source "drivers/staging/rdma/ipath/Kconfig" |
diff --git a/drivers/staging/rdma/Makefile b/drivers/staging/rdma/Makefile index cbd915ac7f20..139d78ef2c24 100644 --- a/drivers/staging/rdma/Makefile +++ b/drivers/staging/rdma/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | # Entries for RDMA_STAGING tree | 1 | # Entries for RDMA_STAGING tree |
2 | obj-$(CONFIG_INFINIBAND_AMSO1100) += amso1100/ | 2 | obj-$(CONFIG_INFINIBAND_AMSO1100) += amso1100/ |
3 | obj-$(CONFIG_INFINIBAND_EHCA) += ehca/ | ||
3 | obj-$(CONFIG_INFINIBAND_HFI1) += hfi1/ | 4 | obj-$(CONFIG_INFINIBAND_HFI1) += hfi1/ |
4 | obj-$(CONFIG_INFINIBAND_IPATH) += ipath/ | 5 | obj-$(CONFIG_INFINIBAND_IPATH) += ipath/ |
diff --git a/drivers/infiniband/hw/ehca/Kconfig b/drivers/staging/rdma/ehca/Kconfig index 59f807d8d58e..3fadd2ad6426 100644 --- a/drivers/infiniband/hw/ehca/Kconfig +++ b/drivers/staging/rdma/ehca/Kconfig | |||
@@ -2,7 +2,8 @@ config INFINIBAND_EHCA | |||
2 | tristate "eHCA support" | 2 | tristate "eHCA support" |
3 | depends on IBMEBUS | 3 | depends on IBMEBUS |
4 | ---help--- | 4 | ---help--- |
5 | This driver supports the IBM pSeries eHCA InfiniBand adapter. | 5 | This driver supports the deprecated IBM pSeries eHCA InfiniBand |
6 | adapter. | ||
6 | 7 | ||
7 | To compile the driver as a module, choose M here. The module | 8 | To compile the driver as a module, choose M here. The module |
8 | will be called ib_ehca. | 9 | will be called ib_ehca. |
diff --git a/drivers/infiniband/hw/ehca/Makefile b/drivers/staging/rdma/ehca/Makefile index 74d284e46a40..74d284e46a40 100644 --- a/drivers/infiniband/hw/ehca/Makefile +++ b/drivers/staging/rdma/ehca/Makefile | |||
diff --git a/drivers/staging/rdma/ehca/TODO b/drivers/staging/rdma/ehca/TODO new file mode 100644 index 000000000000..199a4a600142 --- /dev/null +++ b/drivers/staging/rdma/ehca/TODO | |||
@@ -0,0 +1,4 @@ | |||
1 | 9/2015 | ||
2 | |||
3 | The ehca driver has been deprecated and moved to drivers/staging/rdma. | ||
4 | It will be removed in the 4.6 merge window. | ||
diff --git a/drivers/infiniband/hw/ehca/ehca_av.c b/drivers/staging/rdma/ehca/ehca_av.c index 465926319f3d..465926319f3d 100644 --- a/drivers/infiniband/hw/ehca/ehca_av.c +++ b/drivers/staging/rdma/ehca/ehca_av.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/staging/rdma/ehca/ehca_classes.h index bd45e0f3923f..bd45e0f3923f 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes.h +++ b/drivers/staging/rdma/ehca/ehca_classes.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h b/drivers/staging/rdma/ehca/ehca_classes_pSeries.h index 689c35786dd2..689c35786dd2 100644 --- a/drivers/infiniband/hw/ehca/ehca_classes_pSeries.h +++ b/drivers/staging/rdma/ehca/ehca_classes_pSeries.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_cq.c b/drivers/staging/rdma/ehca/ehca_cq.c index 9b68b175069b..9b68b175069b 100644 --- a/drivers/infiniband/hw/ehca/ehca_cq.c +++ b/drivers/staging/rdma/ehca/ehca_cq.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_eq.c b/drivers/staging/rdma/ehca/ehca_eq.c index 90da6747d395..90da6747d395 100644 --- a/drivers/infiniband/hw/ehca/ehca_eq.c +++ b/drivers/staging/rdma/ehca/ehca_eq.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/staging/rdma/ehca/ehca_hca.c index e8b1bb65797a..e8b1bb65797a 100644 --- a/drivers/infiniband/hw/ehca/ehca_hca.c +++ b/drivers/staging/rdma/ehca/ehca_hca.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/staging/rdma/ehca/ehca_irq.c index 8615d7cf7e01..8615d7cf7e01 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.c +++ b/drivers/staging/rdma/ehca/ehca_irq.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.h b/drivers/staging/rdma/ehca/ehca_irq.h index 5370199f08c7..5370199f08c7 100644 --- a/drivers/infiniband/hw/ehca/ehca_irq.h +++ b/drivers/staging/rdma/ehca/ehca_irq.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_iverbs.h b/drivers/staging/rdma/ehca/ehca_iverbs.h index 80e6a3d5df3e..80e6a3d5df3e 100644 --- a/drivers/infiniband/hw/ehca/ehca_iverbs.h +++ b/drivers/staging/rdma/ehca/ehca_iverbs.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_main.c b/drivers/staging/rdma/ehca/ehca_main.c index 8246418cd4e0..8246418cd4e0 100644 --- a/drivers/infiniband/hw/ehca/ehca_main.c +++ b/drivers/staging/rdma/ehca/ehca_main.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_mcast.c b/drivers/staging/rdma/ehca/ehca_mcast.c index cec181532924..cec181532924 100644 --- a/drivers/infiniband/hw/ehca/ehca_mcast.c +++ b/drivers/staging/rdma/ehca/ehca_mcast.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.c b/drivers/staging/rdma/ehca/ehca_mrmw.c index f914b30999f8..f914b30999f8 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.c +++ b/drivers/staging/rdma/ehca/ehca_mrmw.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_mrmw.h b/drivers/staging/rdma/ehca/ehca_mrmw.h index 50d8b51306dd..50d8b51306dd 100644 --- a/drivers/infiniband/hw/ehca/ehca_mrmw.h +++ b/drivers/staging/rdma/ehca/ehca_mrmw.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_pd.c b/drivers/staging/rdma/ehca/ehca_pd.c index 351577a6670a..351577a6670a 100644 --- a/drivers/infiniband/hw/ehca/ehca_pd.c +++ b/drivers/staging/rdma/ehca/ehca_pd.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_qes.h b/drivers/staging/rdma/ehca/ehca_qes.h index 90c4efa67586..90c4efa67586 100644 --- a/drivers/infiniband/hw/ehca/ehca_qes.h +++ b/drivers/staging/rdma/ehca/ehca_qes.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/staging/rdma/ehca/ehca_qp.c index 2e89356c46fa..2e89356c46fa 100644 --- a/drivers/infiniband/hw/ehca/ehca_qp.c +++ b/drivers/staging/rdma/ehca/ehca_qp.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_reqs.c b/drivers/staging/rdma/ehca/ehca_reqs.c index 47f94984353d..47f94984353d 100644 --- a/drivers/infiniband/hw/ehca/ehca_reqs.c +++ b/drivers/staging/rdma/ehca/ehca_reqs.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_sqp.c b/drivers/staging/rdma/ehca/ehca_sqp.c index 376b031c2c7f..376b031c2c7f 100644 --- a/drivers/infiniband/hw/ehca/ehca_sqp.c +++ b/drivers/staging/rdma/ehca/ehca_sqp.c | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_tools.h b/drivers/staging/rdma/ehca/ehca_tools.h index d280b12aae64..d280b12aae64 100644 --- a/drivers/infiniband/hw/ehca/ehca_tools.h +++ b/drivers/staging/rdma/ehca/ehca_tools.h | |||
diff --git a/drivers/infiniband/hw/ehca/ehca_uverbs.c b/drivers/staging/rdma/ehca/ehca_uverbs.c index 1a1d5d99fcf9..1a1d5d99fcf9 100644 --- a/drivers/infiniband/hw/ehca/ehca_uverbs.c +++ b/drivers/staging/rdma/ehca/ehca_uverbs.c | |||
diff --git a/drivers/infiniband/hw/ehca/hcp_if.c b/drivers/staging/rdma/ehca/hcp_if.c index 89517ffb4389..89517ffb4389 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.c +++ b/drivers/staging/rdma/ehca/hcp_if.c | |||
diff --git a/drivers/infiniband/hw/ehca/hcp_if.h b/drivers/staging/rdma/ehca/hcp_if.h index a46e514c367b..a46e514c367b 100644 --- a/drivers/infiniband/hw/ehca/hcp_if.h +++ b/drivers/staging/rdma/ehca/hcp_if.h | |||
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.c b/drivers/staging/rdma/ehca/hcp_phyp.c index 077376ff3d28..077376ff3d28 100644 --- a/drivers/infiniband/hw/ehca/hcp_phyp.c +++ b/drivers/staging/rdma/ehca/hcp_phyp.c | |||
diff --git a/drivers/infiniband/hw/ehca/hcp_phyp.h b/drivers/staging/rdma/ehca/hcp_phyp.h index d1b029910249..d1b029910249 100644 --- a/drivers/infiniband/hw/ehca/hcp_phyp.h +++ b/drivers/staging/rdma/ehca/hcp_phyp.h | |||
diff --git a/drivers/infiniband/hw/ehca/hipz_fns.h b/drivers/staging/rdma/ehca/hipz_fns.h index 9dac93d02140..9dac93d02140 100644 --- a/drivers/infiniband/hw/ehca/hipz_fns.h +++ b/drivers/staging/rdma/ehca/hipz_fns.h | |||
diff --git a/drivers/infiniband/hw/ehca/hipz_fns_core.h b/drivers/staging/rdma/ehca/hipz_fns_core.h index 868735fd3187..868735fd3187 100644 --- a/drivers/infiniband/hw/ehca/hipz_fns_core.h +++ b/drivers/staging/rdma/ehca/hipz_fns_core.h | |||
diff --git a/drivers/infiniband/hw/ehca/hipz_hw.h b/drivers/staging/rdma/ehca/hipz_hw.h index bf996c7acc42..bf996c7acc42 100644 --- a/drivers/infiniband/hw/ehca/hipz_hw.h +++ b/drivers/staging/rdma/ehca/hipz_hw.h | |||
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.c b/drivers/staging/rdma/ehca/ipz_pt_fn.c index 7ffc748cb973..7ffc748cb973 100644 --- a/drivers/infiniband/hw/ehca/ipz_pt_fn.c +++ b/drivers/staging/rdma/ehca/ipz_pt_fn.c | |||
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.h b/drivers/staging/rdma/ehca/ipz_pt_fn.h index a801274ea337..a801274ea337 100644 --- a/drivers/infiniband/hw/ehca/ipz_pt_fn.h +++ b/drivers/staging/rdma/ehca/ipz_pt_fn.h | |||
diff --git a/drivers/staging/rdma/hfi1/chip.c b/drivers/staging/rdma/hfi1/chip.c index 654eafef1d30..aa58e597df06 100644 --- a/drivers/staging/rdma/hfi1/chip.c +++ b/drivers/staging/rdma/hfi1/chip.c | |||
@@ -2710,7 +2710,7 @@ int acquire_lcb_access(struct hfi1_devdata *dd, int sleep_ok) | |||
2710 | if (sleep_ok) { | 2710 | if (sleep_ok) { |
2711 | mutex_lock(&ppd->hls_lock); | 2711 | mutex_lock(&ppd->hls_lock); |
2712 | } else { | 2712 | } else { |
2713 | while (mutex_trylock(&ppd->hls_lock) == EBUSY) | 2713 | while (!mutex_trylock(&ppd->hls_lock)) |
2714 | udelay(1); | 2714 | udelay(1); |
2715 | } | 2715 | } |
2716 | 2716 | ||
@@ -2758,7 +2758,7 @@ int release_lcb_access(struct hfi1_devdata *dd, int sleep_ok) | |||
2758 | if (sleep_ok) { | 2758 | if (sleep_ok) { |
2759 | mutex_lock(&dd->pport->hls_lock); | 2759 | mutex_lock(&dd->pport->hls_lock); |
2760 | } else { | 2760 | } else { |
2761 | while (mutex_trylock(&dd->pport->hls_lock) == EBUSY) | 2761 | while (!mutex_trylock(&dd->pport->hls_lock)) |
2762 | udelay(1); | 2762 | udelay(1); |
2763 | } | 2763 | } |
2764 | 2764 | ||
diff --git a/drivers/staging/rdma/hfi1/device.c b/drivers/staging/rdma/hfi1/device.c index 07c87a87775f..bc26a5392712 100644 --- a/drivers/staging/rdma/hfi1/device.c +++ b/drivers/staging/rdma/hfi1/device.c | |||
@@ -57,11 +57,13 @@ | |||
57 | #include "device.h" | 57 | #include "device.h" |
58 | 58 | ||
59 | static struct class *class; | 59 | static struct class *class; |
60 | static struct class *user_class; | ||
60 | static dev_t hfi1_dev; | 61 | static dev_t hfi1_dev; |
61 | 62 | ||
62 | int hfi1_cdev_init(int minor, const char *name, | 63 | int hfi1_cdev_init(int minor, const char *name, |
63 | const struct file_operations *fops, | 64 | const struct file_operations *fops, |
64 | struct cdev *cdev, struct device **devp) | 65 | struct cdev *cdev, struct device **devp, |
66 | bool user_accessible) | ||
65 | { | 67 | { |
66 | const dev_t dev = MKDEV(MAJOR(hfi1_dev), minor); | 68 | const dev_t dev = MKDEV(MAJOR(hfi1_dev), minor); |
67 | struct device *device = NULL; | 69 | struct device *device = NULL; |
@@ -78,7 +80,11 @@ int hfi1_cdev_init(int minor, const char *name, | |||
78 | goto done; | 80 | goto done; |
79 | } | 81 | } |
80 | 82 | ||
81 | device = device_create(class, NULL, dev, NULL, "%s", name); | 83 | if (user_accessible) |
84 | device = device_create(user_class, NULL, dev, NULL, "%s", name); | ||
85 | else | ||
86 | device = device_create(class, NULL, dev, NULL, "%s", name); | ||
87 | |||
82 | if (!IS_ERR(device)) | 88 | if (!IS_ERR(device)) |
83 | goto done; | 89 | goto done; |
84 | ret = PTR_ERR(device); | 90 | ret = PTR_ERR(device); |
@@ -110,6 +116,26 @@ const char *class_name(void) | |||
110 | return hfi1_class_name; | 116 | return hfi1_class_name; |
111 | } | 117 | } |
112 | 118 | ||
119 | static char *hfi1_devnode(struct device *dev, umode_t *mode) | ||
120 | { | ||
121 | if (mode) | ||
122 | *mode = 0600; | ||
123 | return kasprintf(GFP_KERNEL, "%s", dev_name(dev)); | ||
124 | } | ||
125 | |||
126 | static const char *hfi1_class_name_user = "hfi1_user"; | ||
127 | const char *class_name_user(void) | ||
128 | { | ||
129 | return hfi1_class_name_user; | ||
130 | } | ||
131 | |||
132 | static char *hfi1_user_devnode(struct device *dev, umode_t *mode) | ||
133 | { | ||
134 | if (mode) | ||
135 | *mode = 0666; | ||
136 | return kasprintf(GFP_KERNEL, "%s", dev_name(dev)); | ||
137 | } | ||
138 | |||
113 | int __init dev_init(void) | 139 | int __init dev_init(void) |
114 | { | 140 | { |
115 | int ret; | 141 | int ret; |
@@ -125,7 +151,22 @@ int __init dev_init(void) | |||
125 | ret = PTR_ERR(class); | 151 | ret = PTR_ERR(class); |
126 | pr_err("Could not create device class (err %d)\n", -ret); | 152 | pr_err("Could not create device class (err %d)\n", -ret); |
127 | unregister_chrdev_region(hfi1_dev, HFI1_NMINORS); | 153 | unregister_chrdev_region(hfi1_dev, HFI1_NMINORS); |
154 | goto done; | ||
128 | } | 155 | } |
156 | class->devnode = hfi1_devnode; | ||
157 | |||
158 | user_class = class_create(THIS_MODULE, class_name_user()); | ||
159 | if (IS_ERR(user_class)) { | ||
160 | ret = PTR_ERR(user_class); | ||
161 | pr_err("Could not create device class for user accessible files (err %d)\n", | ||
162 | -ret); | ||
163 | class_destroy(class); | ||
164 | class = NULL; | ||
165 | user_class = NULL; | ||
166 | unregister_chrdev_region(hfi1_dev, HFI1_NMINORS); | ||
167 | goto done; | ||
168 | } | ||
169 | user_class->devnode = hfi1_user_devnode; | ||
129 | 170 | ||
130 | done: | 171 | done: |
131 | return ret; | 172 | return ret; |
@@ -133,10 +174,11 @@ done: | |||
133 | 174 | ||
134 | void dev_cleanup(void) | 175 | void dev_cleanup(void) |
135 | { | 176 | { |
136 | if (class) { | 177 | class_destroy(class); |
137 | class_destroy(class); | 178 | class = NULL; |
138 | class = NULL; | 179 | |
139 | } | 180 | class_destroy(user_class); |
181 | user_class = NULL; | ||
140 | 182 | ||
141 | unregister_chrdev_region(hfi1_dev, HFI1_NMINORS); | 183 | unregister_chrdev_region(hfi1_dev, HFI1_NMINORS); |
142 | } | 184 | } |
diff --git a/drivers/staging/rdma/hfi1/device.h b/drivers/staging/rdma/hfi1/device.h index 98caecd3d807..2850ff739d81 100644 --- a/drivers/staging/rdma/hfi1/device.h +++ b/drivers/staging/rdma/hfi1/device.h | |||
@@ -52,7 +52,8 @@ | |||
52 | 52 | ||
53 | int hfi1_cdev_init(int minor, const char *name, | 53 | int hfi1_cdev_init(int minor, const char *name, |
54 | const struct file_operations *fops, | 54 | const struct file_operations *fops, |
55 | struct cdev *cdev, struct device **devp); | 55 | struct cdev *cdev, struct device **devp, |
56 | bool user_accessible); | ||
56 | void hfi1_cdev_cleanup(struct cdev *cdev, struct device **devp); | 57 | void hfi1_cdev_cleanup(struct cdev *cdev, struct device **devp); |
57 | const char *class_name(void); | 58 | const char *class_name(void); |
58 | int __init dev_init(void); | 59 | int __init dev_init(void); |
diff --git a/drivers/staging/rdma/hfi1/diag.c b/drivers/staging/rdma/hfi1/diag.c index 6777d6b659cf..3e8d5ac4c626 100644 --- a/drivers/staging/rdma/hfi1/diag.c +++ b/drivers/staging/rdma/hfi1/diag.c | |||
@@ -292,7 +292,7 @@ int hfi1_diag_add(struct hfi1_devdata *dd) | |||
292 | if (atomic_inc_return(&diagpkt_count) == 1) { | 292 | if (atomic_inc_return(&diagpkt_count) == 1) { |
293 | ret = hfi1_cdev_init(HFI1_DIAGPKT_MINOR, name, | 293 | ret = hfi1_cdev_init(HFI1_DIAGPKT_MINOR, name, |
294 | &diagpkt_file_ops, &diagpkt_cdev, | 294 | &diagpkt_file_ops, &diagpkt_cdev, |
295 | &diagpkt_device); | 295 | &diagpkt_device, false); |
296 | } | 296 | } |
297 | 297 | ||
298 | return ret; | 298 | return ret; |
@@ -592,7 +592,8 @@ static int hfi1_snoop_add(struct hfi1_devdata *dd, const char *name) | |||
592 | 592 | ||
593 | ret = hfi1_cdev_init(HFI1_SNOOP_CAPTURE_BASE + dd->unit, name, | 593 | ret = hfi1_cdev_init(HFI1_SNOOP_CAPTURE_BASE + dd->unit, name, |
594 | &snoop_file_ops, | 594 | &snoop_file_ops, |
595 | &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev); | 595 | &dd->hfi1_snoop.cdev, &dd->hfi1_snoop.class_dev, |
596 | false); | ||
596 | 597 | ||
597 | if (ret) { | 598 | if (ret) { |
598 | dd_dev_err(dd, "Couldn't create %s device: %d", name, ret); | 599 | dd_dev_err(dd, "Couldn't create %s device: %d", name, ret); |
@@ -1012,11 +1013,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1012 | case HFI1_SNOOP_IOCSETLINKSTATE_EXTRA: | 1013 | case HFI1_SNOOP_IOCSETLINKSTATE_EXTRA: |
1013 | memset(&link_info, 0, sizeof(link_info)); | 1014 | memset(&link_info, 0, sizeof(link_info)); |
1014 | 1015 | ||
1015 | ret = copy_from_user(&link_info, | 1016 | if (copy_from_user(&link_info, |
1016 | (struct hfi1_link_info __user *)arg, | 1017 | (struct hfi1_link_info __user *)arg, |
1017 | sizeof(link_info)); | 1018 | sizeof(link_info))) |
1018 | if (ret) | 1019 | ret = -EFAULT; |
1019 | break; | ||
1020 | 1020 | ||
1021 | value = link_info.port_state; | 1021 | value = link_info.port_state; |
1022 | index = link_info.port_number; | 1022 | index = link_info.port_number; |
@@ -1080,9 +1080,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1080 | case HFI1_SNOOP_IOCGETLINKSTATE_EXTRA: | 1080 | case HFI1_SNOOP_IOCGETLINKSTATE_EXTRA: |
1081 | if (cmd == HFI1_SNOOP_IOCGETLINKSTATE_EXTRA) { | 1081 | if (cmd == HFI1_SNOOP_IOCGETLINKSTATE_EXTRA) { |
1082 | memset(&link_info, 0, sizeof(link_info)); | 1082 | memset(&link_info, 0, sizeof(link_info)); |
1083 | ret = copy_from_user(&link_info, | 1083 | if (copy_from_user(&link_info, |
1084 | (struct hfi1_link_info __user *)arg, | 1084 | (struct hfi1_link_info __user *)arg, |
1085 | sizeof(link_info)); | 1085 | sizeof(link_info))) |
1086 | ret = -EFAULT; | ||
1086 | index = link_info.port_number; | 1087 | index = link_info.port_number; |
1087 | } else { | 1088 | } else { |
1088 | ret = __get_user(index, (int __user *) arg); | 1089 | ret = __get_user(index, (int __user *) arg); |
@@ -1114,9 +1115,10 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1114 | ppd->link_speed_active; | 1115 | ppd->link_speed_active; |
1115 | link_info.link_width_active = | 1116 | link_info.link_width_active = |
1116 | ppd->link_width_active; | 1117 | ppd->link_width_active; |
1117 | ret = copy_to_user( | 1118 | if (copy_to_user( |
1118 | (struct hfi1_link_info __user *)arg, | 1119 | (struct hfi1_link_info __user *)arg, |
1119 | &link_info, sizeof(link_info)); | 1120 | &link_info, sizeof(link_info))) |
1121 | ret = -EFAULT; | ||
1120 | } else { | 1122 | } else { |
1121 | ret = __put_user(value, (int __user *)arg); | 1123 | ret = __put_user(value, (int __user *)arg); |
1122 | } | 1124 | } |
@@ -1142,10 +1144,9 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1142 | snoop_dbg("Setting filter"); | 1144 | snoop_dbg("Setting filter"); |
1143 | /* just copy command structure */ | 1145 | /* just copy command structure */ |
1144 | argp = (unsigned long *)arg; | 1146 | argp = (unsigned long *)arg; |
1145 | ret = copy_from_user(&filter_cmd, (void __user *)argp, | 1147 | if (copy_from_user(&filter_cmd, (void __user *)argp, |
1146 | sizeof(filter_cmd)); | 1148 | sizeof(filter_cmd))) { |
1147 | if (ret < 0) { | 1149 | ret = -EFAULT; |
1148 | pr_alert("Error copying filter command\n"); | ||
1149 | break; | 1150 | break; |
1150 | } | 1151 | } |
1151 | if (filter_cmd.opcode >= HFI1_MAX_FILTERS) { | 1152 | if (filter_cmd.opcode >= HFI1_MAX_FILTERS) { |
@@ -1167,12 +1168,11 @@ static long hfi1_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | |||
1167 | break; | 1168 | break; |
1168 | } | 1169 | } |
1169 | /* copy remaining data from userspace */ | 1170 | /* copy remaining data from userspace */ |
1170 | ret = copy_from_user((u8 *)filter_value, | 1171 | if (copy_from_user((u8 *)filter_value, |
1171 | (void __user *)filter_cmd.value_ptr, | 1172 | (void __user *)filter_cmd.value_ptr, |
1172 | filter_cmd.length); | 1173 | filter_cmd.length)) { |
1173 | if (ret < 0) { | ||
1174 | kfree(filter_value); | 1174 | kfree(filter_value); |
1175 | pr_alert("Error copying filter data\n"); | 1175 | ret = -EFAULT; |
1176 | break; | 1176 | break; |
1177 | } | 1177 | } |
1178 | /* Drain packets first */ | 1178 | /* Drain packets first */ |
diff --git a/drivers/staging/rdma/hfi1/file_ops.c b/drivers/staging/rdma/hfi1/file_ops.c index 469861750b76..72d38500d8ce 100644 --- a/drivers/staging/rdma/hfi1/file_ops.c +++ b/drivers/staging/rdma/hfi1/file_ops.c | |||
@@ -1181,6 +1181,7 @@ static int get_ctxt_info(struct file *fp, void __user *ubase, __u32 len) | |||
1181 | struct hfi1_filedata *fd = fp->private_data; | 1181 | struct hfi1_filedata *fd = fp->private_data; |
1182 | int ret = 0; | 1182 | int ret = 0; |
1183 | 1183 | ||
1184 | memset(&cinfo, 0, sizeof(cinfo)); | ||
1184 | ret = hfi1_get_base_kinfo(uctxt, &cinfo); | 1185 | ret = hfi1_get_base_kinfo(uctxt, &cinfo); |
1185 | if (ret < 0) | 1186 | if (ret < 0) |
1186 | goto done; | 1187 | goto done; |
@@ -2089,14 +2090,16 @@ static int user_add(struct hfi1_devdata *dd) | |||
2089 | 2090 | ||
2090 | if (atomic_inc_return(&user_count) == 1) { | 2091 | if (atomic_inc_return(&user_count) == 1) { |
2091 | ret = hfi1_cdev_init(0, class_name(), &hfi1_file_ops, | 2092 | ret = hfi1_cdev_init(0, class_name(), &hfi1_file_ops, |
2092 | &wildcard_cdev, &wildcard_device); | 2093 | &wildcard_cdev, &wildcard_device, |
2094 | true); | ||
2093 | if (ret) | 2095 | if (ret) |
2094 | goto done; | 2096 | goto done; |
2095 | } | 2097 | } |
2096 | 2098 | ||
2097 | snprintf(name, sizeof(name), "%s_%d", class_name(), dd->unit); | 2099 | snprintf(name, sizeof(name), "%s_%d", class_name(), dd->unit); |
2098 | ret = hfi1_cdev_init(dd->unit + 1, name, &hfi1_file_ops, | 2100 | ret = hfi1_cdev_init(dd->unit + 1, name, &hfi1_file_ops, |
2099 | &dd->user_cdev, &dd->user_device); | 2101 | &dd->user_cdev, &dd->user_device, |
2102 | true); | ||
2100 | if (ret) | 2103 | if (ret) |
2101 | goto done; | 2104 | goto done; |
2102 | 2105 | ||
@@ -2104,7 +2107,8 @@ static int user_add(struct hfi1_devdata *dd) | |||
2104 | snprintf(name, sizeof(name), | 2107 | snprintf(name, sizeof(name), |
2105 | "%s_ui%d", class_name(), dd->unit); | 2108 | "%s_ui%d", class_name(), dd->unit); |
2106 | ret = hfi1_cdev_init(dd->unit + UI_OFFSET, name, &ui_file_ops, | 2109 | ret = hfi1_cdev_init(dd->unit + UI_OFFSET, name, &ui_file_ops, |
2107 | &dd->ui_cdev, &dd->ui_device); | 2110 | &dd->ui_cdev, &dd->ui_device, |
2111 | false); | ||
2108 | if (ret) | 2112 | if (ret) |
2109 | goto done; | 2113 | goto done; |
2110 | } | 2114 | } |
diff --git a/drivers/staging/rdma/hfi1/mad.c b/drivers/staging/rdma/hfi1/mad.c index 37269eb90c34..b2c1b72d38ce 100644 --- a/drivers/staging/rdma/hfi1/mad.c +++ b/drivers/staging/rdma/hfi1/mad.c | |||
@@ -1717,9 +1717,9 @@ static int __subn_get_opa_psi(struct opa_smp *smp, u32 am, u8 *data, | |||
1717 | psi->port_states.portphysstate_portstate = | 1717 | psi->port_states.portphysstate_portstate = |
1718 | (hfi1_ibphys_portstate(ppd) << 4) | (lstate & 0xf); | 1718 | (hfi1_ibphys_portstate(ppd) << 4) | (lstate & 0xf); |
1719 | psi->link_width_downgrade_tx_active = | 1719 | psi->link_width_downgrade_tx_active = |
1720 | ppd->link_width_downgrade_tx_active; | 1720 | cpu_to_be16(ppd->link_width_downgrade_tx_active); |
1721 | psi->link_width_downgrade_rx_active = | 1721 | psi->link_width_downgrade_rx_active = |
1722 | ppd->link_width_downgrade_rx_active; | 1722 | cpu_to_be16(ppd->link_width_downgrade_rx_active); |
1723 | if (resp_len) | 1723 | if (resp_len) |
1724 | *resp_len += sizeof(struct opa_port_state_info); | 1724 | *resp_len += sizeof(struct opa_port_state_info); |
1725 | 1725 | ||
diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c index a8c903caecce..aecd1a74741c 100644 --- a/drivers/staging/rdma/hfi1/sdma.c +++ b/drivers/staging/rdma/hfi1/sdma.c | |||
@@ -737,7 +737,7 @@ u16 sdma_get_descq_cnt(void) | |||
737 | */ | 737 | */ |
738 | if (!is_power_of_2(count)) | 738 | if (!is_power_of_2(count)) |
739 | return SDMA_DESCQ_CNT; | 739 | return SDMA_DESCQ_CNT; |
740 | if (count < 64 && count > 32768) | 740 | if (count < 64 || count > 32768) |
741 | return SDMA_DESCQ_CNT; | 741 | return SDMA_DESCQ_CNT; |
742 | return count; | 742 | return count; |
743 | } | 743 | } |
@@ -1848,7 +1848,7 @@ static void dump_sdma_state(struct sdma_engine *sde) | |||
1848 | dd_dev_err(sde->dd, | 1848 | dd_dev_err(sde->dd, |
1849 | "\taidx: %u amode: %u alen: %u\n", | 1849 | "\taidx: %u amode: %u alen: %u\n", |
1850 | (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK) | 1850 | (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK) |
1851 | >> SDMA_DESC1_HEADER_INDEX_MASK), | 1851 | >> SDMA_DESC1_HEADER_INDEX_SHIFT), |
1852 | (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK) | 1852 | (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK) |
1853 | >> SDMA_DESC1_HEADER_MODE_SHIFT), | 1853 | >> SDMA_DESC1_HEADER_MODE_SHIFT), |
1854 | (u8)((desc[1] & SDMA_DESC1_HEADER_DWS_SMASK) | 1854 | (u8)((desc[1] & SDMA_DESC1_HEADER_DWS_SMASK) |
@@ -1926,7 +1926,7 @@ void sdma_seqfile_dump_sde(struct seq_file *s, struct sdma_engine *sde) | |||
1926 | if (desc[0] & SDMA_DESC0_FIRST_DESC_FLAG) | 1926 | if (desc[0] & SDMA_DESC0_FIRST_DESC_FLAG) |
1927 | seq_printf(s, "\t\tahgidx: %u ahgmode: %u\n", | 1927 | seq_printf(s, "\t\tahgidx: %u ahgmode: %u\n", |
1928 | (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK) | 1928 | (u8)((desc[1] & SDMA_DESC1_HEADER_INDEX_SMASK) |
1929 | >> SDMA_DESC1_HEADER_INDEX_MASK), | 1929 | >> SDMA_DESC1_HEADER_INDEX_SHIFT), |
1930 | (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK) | 1930 | (u8)((desc[1] & SDMA_DESC1_HEADER_MODE_SMASK) |
1931 | >> SDMA_DESC1_HEADER_MODE_SHIFT)); | 1931 | >> SDMA_DESC1_HEADER_MODE_SHIFT)); |
1932 | head = (head + 1) & sde->sdma_mask; | 1932 | head = (head + 1) & sde->sdma_mask; |
diff --git a/drivers/staging/rdma/hfi1/sdma.h b/drivers/staging/rdma/hfi1/sdma.h index 1e613fcd8f4c..496086903891 100644 --- a/drivers/staging/rdma/hfi1/sdma.h +++ b/drivers/staging/rdma/hfi1/sdma.h | |||
@@ -109,53 +109,53 @@ | |||
109 | /* | 109 | /* |
110 | * Bits defined in the send DMA descriptor. | 110 | * Bits defined in the send DMA descriptor. |
111 | */ | 111 | */ |
112 | #define SDMA_DESC0_FIRST_DESC_FLAG (1ULL<<63) | 112 | #define SDMA_DESC0_FIRST_DESC_FLAG (1ULL << 63) |
113 | #define SDMA_DESC0_LAST_DESC_FLAG (1ULL<<62) | 113 | #define SDMA_DESC0_LAST_DESC_FLAG (1ULL << 62) |
114 | #define SDMA_DESC0_BYTE_COUNT_SHIFT 48 | 114 | #define SDMA_DESC0_BYTE_COUNT_SHIFT 48 |
115 | #define SDMA_DESC0_BYTE_COUNT_WIDTH 14 | 115 | #define SDMA_DESC0_BYTE_COUNT_WIDTH 14 |
116 | #define SDMA_DESC0_BYTE_COUNT_MASK \ | 116 | #define SDMA_DESC0_BYTE_COUNT_MASK \ |
117 | ((1ULL<<SDMA_DESC0_BYTE_COUNT_WIDTH)-1ULL) | 117 | ((1ULL << SDMA_DESC0_BYTE_COUNT_WIDTH) - 1) |
118 | #define SDMA_DESC0_BYTE_COUNT_SMASK \ | 118 | #define SDMA_DESC0_BYTE_COUNT_SMASK \ |
119 | (SDMA_DESC0_BYTE_COUNT_MASK<<SDMA_DESC0_BYTE_COUNT_SHIFT) | 119 | (SDMA_DESC0_BYTE_COUNT_MASK << SDMA_DESC0_BYTE_COUNT_SHIFT) |
120 | #define SDMA_DESC0_PHY_ADDR_SHIFT 0 | 120 | #define SDMA_DESC0_PHY_ADDR_SHIFT 0 |
121 | #define SDMA_DESC0_PHY_ADDR_WIDTH 48 | 121 | #define SDMA_DESC0_PHY_ADDR_WIDTH 48 |
122 | #define SDMA_DESC0_PHY_ADDR_MASK \ | 122 | #define SDMA_DESC0_PHY_ADDR_MASK \ |
123 | ((1ULL<<SDMA_DESC0_PHY_ADDR_WIDTH)-1ULL) | 123 | ((1ULL << SDMA_DESC0_PHY_ADDR_WIDTH) - 1) |
124 | #define SDMA_DESC0_PHY_ADDR_SMASK \ | 124 | #define SDMA_DESC0_PHY_ADDR_SMASK \ |
125 | (SDMA_DESC0_PHY_ADDR_MASK<<SDMA_DESC0_PHY_ADDR_SHIFT) | 125 | (SDMA_DESC0_PHY_ADDR_MASK << SDMA_DESC0_PHY_ADDR_SHIFT) |
126 | 126 | ||
127 | #define SDMA_DESC1_HEADER_UPDATE1_SHIFT 32 | 127 | #define SDMA_DESC1_HEADER_UPDATE1_SHIFT 32 |
128 | #define SDMA_DESC1_HEADER_UPDATE1_WIDTH 32 | 128 | #define SDMA_DESC1_HEADER_UPDATE1_WIDTH 32 |
129 | #define SDMA_DESC1_HEADER_UPDATE1_MASK \ | 129 | #define SDMA_DESC1_HEADER_UPDATE1_MASK \ |
130 | ((1ULL<<SDMA_DESC1_HEADER_UPDATE1_WIDTH)-1ULL) | 130 | ((1ULL << SDMA_DESC1_HEADER_UPDATE1_WIDTH) - 1) |
131 | #define SDMA_DESC1_HEADER_UPDATE1_SMASK \ | 131 | #define SDMA_DESC1_HEADER_UPDATE1_SMASK \ |
132 | (SDMA_DESC1_HEADER_UPDATE1_MASK<<SDMA_DESC1_HEADER_UPDATE1_SHIFT) | 132 | (SDMA_DESC1_HEADER_UPDATE1_MASK << SDMA_DESC1_HEADER_UPDATE1_SHIFT) |
133 | #define SDMA_DESC1_HEADER_MODE_SHIFT 13 | 133 | #define SDMA_DESC1_HEADER_MODE_SHIFT 13 |
134 | #define SDMA_DESC1_HEADER_MODE_WIDTH 3 | 134 | #define SDMA_DESC1_HEADER_MODE_WIDTH 3 |
135 | #define SDMA_DESC1_HEADER_MODE_MASK \ | 135 | #define SDMA_DESC1_HEADER_MODE_MASK \ |
136 | ((1ULL<<SDMA_DESC1_HEADER_MODE_WIDTH)-1ULL) | 136 | ((1ULL << SDMA_DESC1_HEADER_MODE_WIDTH) - 1) |
137 | #define SDMA_DESC1_HEADER_MODE_SMASK \ | 137 | #define SDMA_DESC1_HEADER_MODE_SMASK \ |
138 | (SDMA_DESC1_HEADER_MODE_MASK<<SDMA_DESC1_HEADER_MODE_SHIFT) | 138 | (SDMA_DESC1_HEADER_MODE_MASK << SDMA_DESC1_HEADER_MODE_SHIFT) |
139 | #define SDMA_DESC1_HEADER_INDEX_SHIFT 8 | 139 | #define SDMA_DESC1_HEADER_INDEX_SHIFT 8 |
140 | #define SDMA_DESC1_HEADER_INDEX_WIDTH 5 | 140 | #define SDMA_DESC1_HEADER_INDEX_WIDTH 5 |
141 | #define SDMA_DESC1_HEADER_INDEX_MASK \ | 141 | #define SDMA_DESC1_HEADER_INDEX_MASK \ |
142 | ((1ULL<<SDMA_DESC1_HEADER_INDEX_WIDTH)-1ULL) | 142 | ((1ULL << SDMA_DESC1_HEADER_INDEX_WIDTH) - 1) |
143 | #define SDMA_DESC1_HEADER_INDEX_SMASK \ | 143 | #define SDMA_DESC1_HEADER_INDEX_SMASK \ |
144 | (SDMA_DESC1_HEADER_INDEX_MASK<<SDMA_DESC1_HEADER_INDEX_SHIFT) | 144 | (SDMA_DESC1_HEADER_INDEX_MASK << SDMA_DESC1_HEADER_INDEX_SHIFT) |
145 | #define SDMA_DESC1_HEADER_DWS_SHIFT 4 | 145 | #define SDMA_DESC1_HEADER_DWS_SHIFT 4 |
146 | #define SDMA_DESC1_HEADER_DWS_WIDTH 4 | 146 | #define SDMA_DESC1_HEADER_DWS_WIDTH 4 |
147 | #define SDMA_DESC1_HEADER_DWS_MASK \ | 147 | #define SDMA_DESC1_HEADER_DWS_MASK \ |
148 | ((1ULL<<SDMA_DESC1_HEADER_DWS_WIDTH)-1ULL) | 148 | ((1ULL << SDMA_DESC1_HEADER_DWS_WIDTH) - 1) |
149 | #define SDMA_DESC1_HEADER_DWS_SMASK \ | 149 | #define SDMA_DESC1_HEADER_DWS_SMASK \ |
150 | (SDMA_DESC1_HEADER_DWS_MASK<<SDMA_DESC1_HEADER_DWS_SHIFT) | 150 | (SDMA_DESC1_HEADER_DWS_MASK << SDMA_DESC1_HEADER_DWS_SHIFT) |
151 | #define SDMA_DESC1_GENERATION_SHIFT 2 | 151 | #define SDMA_DESC1_GENERATION_SHIFT 2 |
152 | #define SDMA_DESC1_GENERATION_WIDTH 2 | 152 | #define SDMA_DESC1_GENERATION_WIDTH 2 |
153 | #define SDMA_DESC1_GENERATION_MASK \ | 153 | #define SDMA_DESC1_GENERATION_MASK \ |
154 | ((1ULL<<SDMA_DESC1_GENERATION_WIDTH)-1ULL) | 154 | ((1ULL << SDMA_DESC1_GENERATION_WIDTH) - 1) |
155 | #define SDMA_DESC1_GENERATION_SMASK \ | 155 | #define SDMA_DESC1_GENERATION_SMASK \ |
156 | (SDMA_DESC1_GENERATION_MASK<<SDMA_DESC1_GENERATION_SHIFT) | 156 | (SDMA_DESC1_GENERATION_MASK << SDMA_DESC1_GENERATION_SHIFT) |
157 | #define SDMA_DESC1_INT_REQ_FLAG (1ULL<<1) | 157 | #define SDMA_DESC1_INT_REQ_FLAG (1ULL << 1) |
158 | #define SDMA_DESC1_HEAD_TO_HOST_FLAG (1ULL<<0) | 158 | #define SDMA_DESC1_HEAD_TO_HOST_FLAG (1ULL << 0) |
159 | 159 | ||
160 | enum sdma_states { | 160 | enum sdma_states { |
161 | sdma_state_s00_hw_down, | 161 | sdma_state_s00_hw_down, |
diff --git a/drivers/staging/rdma/hfi1/verbs.c b/drivers/staging/rdma/hfi1/verbs.c index 53ac21431542..41bb59eb001c 100644 --- a/drivers/staging/rdma/hfi1/verbs.c +++ b/drivers/staging/rdma/hfi1/verbs.c | |||
@@ -749,11 +749,13 @@ static inline struct verbs_txreq *get_txreq(struct hfi1_ibdev *dev, | |||
749 | struct verbs_txreq *tx; | 749 | struct verbs_txreq *tx; |
750 | 750 | ||
751 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); | 751 | tx = kmem_cache_alloc(dev->verbs_txreq_cache, GFP_ATOMIC); |
752 | if (!tx) | 752 | if (!tx) { |
753 | /* call slow path to get the lock */ | 753 | /* call slow path to get the lock */ |
754 | tx = __get_txreq(dev, qp); | 754 | tx = __get_txreq(dev, qp); |
755 | if (tx) | 755 | if (IS_ERR(tx)) |
756 | tx->qp = qp; | 756 | return tx; |
757 | } | ||
758 | tx->qp = qp; | ||
757 | return tx; | 759 | return tx; |
758 | } | 760 | } |
759 | 761 | ||
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 7d137a43cc86..9eda69e40678 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -61,8 +61,7 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;" | |||
61 | enum { | 61 | enum { |
62 | VHOST_NET_FEATURES = VHOST_FEATURES | | 62 | VHOST_NET_FEATURES = VHOST_FEATURES | |
63 | (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | | 63 | (1ULL << VHOST_NET_F_VIRTIO_NET_HDR) | |
64 | (1ULL << VIRTIO_NET_F_MRG_RXBUF) | | 64 | (1ULL << VIRTIO_NET_F_MRG_RXBUF) |
65 | (1ULL << VIRTIO_F_VERSION_1), | ||
66 | }; | 65 | }; |
67 | 66 | ||
68 | enum { | 67 | enum { |
diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index f114a9dbb48f..e25a23692822 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c | |||
@@ -166,9 +166,7 @@ enum { | |||
166 | /* Note: can't set VIRTIO_F_VERSION_1 yet, since that implies ANY_LAYOUT. */ | 166 | /* Note: can't set VIRTIO_F_VERSION_1 yet, since that implies ANY_LAYOUT. */ |
167 | enum { | 167 | enum { |
168 | VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL << VIRTIO_SCSI_F_HOTPLUG) | | 168 | VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL << VIRTIO_SCSI_F_HOTPLUG) | |
169 | (1ULL << VIRTIO_SCSI_F_T10_PI) | | 169 | (1ULL << VIRTIO_SCSI_F_T10_PI) |
170 | (1ULL << VIRTIO_F_ANY_LAYOUT) | | ||
171 | (1ULL << VIRTIO_F_VERSION_1) | ||
172 | }; | 170 | }; |
173 | 171 | ||
174 | #define VHOST_SCSI_MAX_TARGET 256 | 172 | #define VHOST_SCSI_MAX_TARGET 256 |
diff --git a/drivers/vhost/test.c b/drivers/vhost/test.c index d9c501eaa6c3..f2882ac98726 100644 --- a/drivers/vhost/test.c +++ b/drivers/vhost/test.c | |||
@@ -277,10 +277,13 @@ static long vhost_test_ioctl(struct file *f, unsigned int ioctl, | |||
277 | return -EFAULT; | 277 | return -EFAULT; |
278 | return 0; | 278 | return 0; |
279 | case VHOST_SET_FEATURES: | 279 | case VHOST_SET_FEATURES: |
280 | printk(KERN_ERR "1\n"); | ||
280 | if (copy_from_user(&features, featurep, sizeof features)) | 281 | if (copy_from_user(&features, featurep, sizeof features)) |
281 | return -EFAULT; | 282 | return -EFAULT; |
283 | printk(KERN_ERR "2\n"); | ||
282 | if (features & ~VHOST_FEATURES) | 284 | if (features & ~VHOST_FEATURES) |
283 | return -EOPNOTSUPP; | 285 | return -EOPNOTSUPP; |
286 | printk(KERN_ERR "3\n"); | ||
284 | return vhost_test_set_features(n, features); | 287 | return vhost_test_set_features(n, features); |
285 | case VHOST_RESET_OWNER: | 288 | case VHOST_RESET_OWNER: |
286 | return vhost_test_reset_owner(n); | 289 | return vhost_test_reset_owner(n); |
diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index ce6f6da4b09f..4772862b71a7 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h | |||
@@ -173,7 +173,9 @@ enum { | |||
173 | VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | | 173 | VHOST_FEATURES = (1ULL << VIRTIO_F_NOTIFY_ON_EMPTY) | |
174 | (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | | 174 | (1ULL << VIRTIO_RING_F_INDIRECT_DESC) | |
175 | (1ULL << VIRTIO_RING_F_EVENT_IDX) | | 175 | (1ULL << VIRTIO_RING_F_EVENT_IDX) | |
176 | (1ULL << VHOST_F_LOG_ALL), | 176 | (1ULL << VHOST_F_LOG_ALL) | |
177 | (1ULL << VIRTIO_F_ANY_LAYOUT) | | ||
178 | (1ULL << VIRTIO_F_VERSION_1) | ||
177 | }; | 179 | }; |
178 | 180 | ||
179 | static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) | 181 | static inline bool vhost_has_feature(struct vhost_virtqueue *vq, int bit) |
diff --git a/fs/block_dev.c b/fs/block_dev.c index 22ea424ee741..073bb57adab1 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
@@ -1242,6 +1242,13 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part) | |||
1242 | goto out_clear; | 1242 | goto out_clear; |
1243 | } | 1243 | } |
1244 | bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9); | 1244 | bd_set_size(bdev, (loff_t)bdev->bd_part->nr_sects << 9); |
1245 | /* | ||
1246 | * If the partition is not aligned on a page | ||
1247 | * boundary, we can't do dax I/O to it. | ||
1248 | */ | ||
1249 | if ((bdev->bd_part->start_sect % (PAGE_SIZE / 512)) || | ||
1250 | (bdev->bd_part->nr_sects % (PAGE_SIZE / 512))) | ||
1251 | bdev->bd_inode->i_flags &= ~S_DAX; | ||
1245 | } | 1252 | } |
1246 | } else { | 1253 | } else { |
1247 | if (bdev->bd_contains == bdev) { | 1254 | if (bdev->bd_contains == bdev) { |
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index 6a1119e87fbb..e739950ca084 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -325,8 +325,11 @@ cifs_show_address(struct seq_file *s, struct TCP_Server_Info *server) | |||
325 | static void | 325 | static void |
326 | cifs_show_security(struct seq_file *s, struct cifs_ses *ses) | 326 | cifs_show_security(struct seq_file *s, struct cifs_ses *ses) |
327 | { | 327 | { |
328 | if (ses->sectype == Unspecified) | 328 | if (ses->sectype == Unspecified) { |
329 | if (ses->user_name == NULL) | ||
330 | seq_puts(s, ",sec=none"); | ||
329 | return; | 331 | return; |
332 | } | ||
330 | 333 | ||
331 | seq_puts(s, ",sec="); | 334 | seq_puts(s, ",sec="); |
332 | 335 | ||
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c index c63f5227b681..28a77bf1d559 100644 --- a/fs/cifs/ioctl.c +++ b/fs/cifs/ioctl.c | |||
@@ -67,6 +67,12 @@ static long cifs_ioctl_clone(unsigned int xid, struct file *dst_file, | |||
67 | goto out_drop_write; | 67 | goto out_drop_write; |
68 | } | 68 | } |
69 | 69 | ||
70 | if (src_file.file->f_op->unlocked_ioctl != cifs_ioctl) { | ||
71 | rc = -EBADF; | ||
72 | cifs_dbg(VFS, "src file seems to be from a different filesystem type\n"); | ||
73 | goto out_fput; | ||
74 | } | ||
75 | |||
70 | if ((!src_file.file->private_data) || (!dst_file->private_data)) { | 76 | if ((!src_file.file->private_data) || (!dst_file->private_data)) { |
71 | rc = -EBADF; | 77 | rc = -EBADF; |
72 | cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n"); | 78 | cifs_dbg(VFS, "missing cifsFileInfo on copy range src file\n"); |
@@ -119,7 +119,8 @@ static ssize_t dax_io(struct inode *inode, struct iov_iter *iter, | |||
119 | size_t len; | 119 | size_t len; |
120 | if (pos == max) { | 120 | if (pos == max) { |
121 | unsigned blkbits = inode->i_blkbits; | 121 | unsigned blkbits = inode->i_blkbits; |
122 | sector_t block = pos >> blkbits; | 122 | long page = pos >> PAGE_SHIFT; |
123 | sector_t block = page << (PAGE_SHIFT - blkbits); | ||
123 | unsigned first = pos - (block << blkbits); | 124 | unsigned first = pos - (block << blkbits); |
124 | long size; | 125 | long size; |
125 | 126 | ||
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c index 587ac08eabb6..091a36444972 100644 --- a/fs/fs-writeback.c +++ b/fs/fs-writeback.c | |||
@@ -1481,6 +1481,21 @@ static long writeback_sb_inodes(struct super_block *sb, | |||
1481 | wbc_detach_inode(&wbc); | 1481 | wbc_detach_inode(&wbc); |
1482 | work->nr_pages -= write_chunk - wbc.nr_to_write; | 1482 | work->nr_pages -= write_chunk - wbc.nr_to_write; |
1483 | wrote += write_chunk - wbc.nr_to_write; | 1483 | wrote += write_chunk - wbc.nr_to_write; |
1484 | |||
1485 | if (need_resched()) { | ||
1486 | /* | ||
1487 | * We're trying to balance between building up a nice | ||
1488 | * long list of IOs to improve our merge rate, and | ||
1489 | * getting those IOs out quickly for anyone throttling | ||
1490 | * in balance_dirty_pages(). cond_resched() doesn't | ||
1491 | * unplug, so get our IOs out the door before we | ||
1492 | * give up the CPU. | ||
1493 | */ | ||
1494 | blk_flush_plug(current); | ||
1495 | cond_resched(); | ||
1496 | } | ||
1497 | |||
1498 | |||
1484 | spin_lock(&wb->list_lock); | 1499 | spin_lock(&wb->list_lock); |
1485 | spin_lock(&inode->i_lock); | 1500 | spin_lock(&inode->i_lock); |
1486 | if (!(inode->i_state & I_DIRTY_ALL)) | 1501 | if (!(inode->i_state & I_DIRTY_ALL)) |
@@ -1488,7 +1503,7 @@ static long writeback_sb_inodes(struct super_block *sb, | |||
1488 | requeue_inode(inode, wb, &wbc); | 1503 | requeue_inode(inode, wb, &wbc); |
1489 | inode_sync_complete(inode); | 1504 | inode_sync_complete(inode); |
1490 | spin_unlock(&inode->i_lock); | 1505 | spin_unlock(&inode->i_lock); |
1491 | cond_resched_lock(&wb->list_lock); | 1506 | |
1492 | /* | 1507 | /* |
1493 | * bail out to wb_writeback() often enough to check | 1508 | * bail out to wb_writeback() often enough to check |
1494 | * background threshold and other termination conditions. | 1509 | * background threshold and other termination conditions. |
diff --git a/fs/userfaultfd.c b/fs/userfaultfd.c index 634e676072cb..f9aeb40a7197 100644 --- a/fs/userfaultfd.c +++ b/fs/userfaultfd.c | |||
@@ -1287,8 +1287,10 @@ static struct file *userfaultfd_file_create(int flags) | |||
1287 | 1287 | ||
1288 | file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx, | 1288 | file = anon_inode_getfile("[userfaultfd]", &userfaultfd_fops, ctx, |
1289 | O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS)); | 1289 | O_RDWR | (flags & UFFD_SHARED_FCNTL_FLAGS)); |
1290 | if (IS_ERR(file)) | 1290 | if (IS_ERR(file)) { |
1291 | mmput(ctx->mm); | ||
1291 | kmem_cache_free(userfaultfd_ctx_cachep, ctx); | 1292 | kmem_cache_free(userfaultfd_ctx_cachep, ctx); |
1293 | } | ||
1292 | out: | 1294 | out: |
1293 | return file; | 1295 | return file; |
1294 | } | 1296 | } |
diff --git a/include/acpi/button.h b/include/acpi/button.h index 97eea0e4c016..1cad8b2d460c 100644 --- a/include/acpi/button.h +++ b/include/acpi/button.h | |||
@@ -3,7 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/notifier.h> | 4 | #include <linux/notifier.h> |
5 | 5 | ||
6 | #if defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) | 6 | #if IS_ENABLED(CONFIG_ACPI_BUTTON) |
7 | extern int acpi_lid_notifier_register(struct notifier_block *nb); | 7 | extern int acpi_lid_notifier_register(struct notifier_block *nb); |
8 | extern int acpi_lid_notifier_unregister(struct notifier_block *nb); | 8 | extern int acpi_lid_notifier_unregister(struct notifier_block *nb); |
9 | extern int acpi_lid_open(void); | 9 | extern int acpi_lid_open(void); |
@@ -20,6 +20,6 @@ static inline int acpi_lid_open(void) | |||
20 | { | 20 | { |
21 | return 1; | 21 | return 1; |
22 | } | 22 | } |
23 | #endif /* defined(CONFIG_ACPI_BUTTON) || defined(CONFIG_ACPI_BUTTON_MODULE) */ | 23 | #endif /* IS_ENABLED(CONFIG_ACPI_BUTTON) */ |
24 | 24 | ||
25 | #endif /* ACPI_BUTTON_H */ | 25 | #endif /* ACPI_BUTTON_H */ |
diff --git a/include/acpi/video.h b/include/acpi/video.h index e840b294c6f5..c62392d9b52a 100644 --- a/include/acpi/video.h +++ b/include/acpi/video.h | |||
@@ -24,7 +24,7 @@ enum acpi_backlight_type { | |||
24 | acpi_backlight_native, | 24 | acpi_backlight_native, |
25 | }; | 25 | }; |
26 | 26 | ||
27 | #if (defined CONFIG_ACPI_VIDEO || defined CONFIG_ACPI_VIDEO_MODULE) | 27 | #if IS_ENABLED(CONFIG_ACPI_VIDEO) |
28 | extern int acpi_video_register(void); | 28 | extern int acpi_video_register(void); |
29 | extern void acpi_video_unregister(void); | 29 | extern void acpi_video_unregister(void); |
30 | extern int acpi_video_get_edid(struct acpi_device *device, int type, | 30 | extern int acpi_video_get_edid(struct acpi_device *device, int type, |
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index f20f407ce45d..4b4b056a6eb0 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -73,7 +73,7 @@ | |||
73 | * Convert a physical address to a Page Frame Number and back | 73 | * Convert a physical address to a Page Frame Number and back |
74 | */ | 74 | */ |
75 | #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) | 75 | #define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) |
76 | #define __pfn_to_phys(pfn) ((pfn) << PAGE_SHIFT) | 76 | #define __pfn_to_phys(pfn) PFN_PHYS(pfn) |
77 | 77 | ||
78 | #define page_to_pfn __page_to_pfn | 78 | #define page_to_pfn __page_to_pfn |
79 | #define pfn_to_page __pfn_to_page | 79 | #define pfn_to_page __pfn_to_page |
diff --git a/include/asm-generic/qspinlock.h b/include/asm-generic/qspinlock.h index 83bfb87f5bf1..e2aadbc7151f 100644 --- a/include/asm-generic/qspinlock.h +++ b/include/asm-generic/qspinlock.h | |||
@@ -111,8 +111,8 @@ static inline void queued_spin_unlock_wait(struct qspinlock *lock) | |||
111 | cpu_relax(); | 111 | cpu_relax(); |
112 | } | 112 | } |
113 | 113 | ||
114 | #ifndef virt_queued_spin_lock | 114 | #ifndef virt_spin_lock |
115 | static __always_inline bool virt_queued_spin_lock(struct qspinlock *lock) | 115 | static __always_inline bool virt_spin_lock(struct qspinlock *lock) |
116 | { | 116 | { |
117 | return false; | 117 | return false; |
118 | } | 118 | } |
diff --git a/include/kvm/arm_vgic.h b/include/kvm/arm_vgic.h index d901f1a47be6..4e14dac282bb 100644 --- a/include/kvm/arm_vgic.h +++ b/include/kvm/arm_vgic.h | |||
@@ -35,11 +35,7 @@ | |||
35 | #define VGIC_V3_MAX_LRS 16 | 35 | #define VGIC_V3_MAX_LRS 16 |
36 | #define VGIC_MAX_IRQS 1024 | 36 | #define VGIC_MAX_IRQS 1024 |
37 | #define VGIC_V2_MAX_CPUS 8 | 37 | #define VGIC_V2_MAX_CPUS 8 |
38 | 38 | #define VGIC_V3_MAX_CPUS 255 | |
39 | /* Sanity checks... */ | ||
40 | #if (KVM_MAX_VCPUS > 255) | ||
41 | #error Too many KVM VCPUs, the VGIC only supports up to 255 VCPUs for now | ||
42 | #endif | ||
43 | 39 | ||
44 | #if (VGIC_NR_IRQS_LEGACY & 31) | 40 | #if (VGIC_NR_IRQS_LEGACY & 31) |
45 | #error "VGIC_NR_IRQS must be a multiple of 32" | 41 | #error "VGIC_NR_IRQS must be a multiple of 32" |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 38a5ff772a37..99da9ebc7377 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1368,6 +1368,26 @@ static inline bool bvec_gap_to_prev(struct request_queue *q, | |||
1368 | ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); | 1368 | ((bprv->bv_offset + bprv->bv_len) & queue_virt_boundary(q)); |
1369 | } | 1369 | } |
1370 | 1370 | ||
1371 | static inline bool bio_will_gap(struct request_queue *q, struct bio *prev, | ||
1372 | struct bio *next) | ||
1373 | { | ||
1374 | if (!bio_has_data(prev)) | ||
1375 | return false; | ||
1376 | |||
1377 | return bvec_gap_to_prev(q, &prev->bi_io_vec[prev->bi_vcnt - 1], | ||
1378 | next->bi_io_vec[0].bv_offset); | ||
1379 | } | ||
1380 | |||
1381 | static inline bool req_gap_back_merge(struct request *req, struct bio *bio) | ||
1382 | { | ||
1383 | return bio_will_gap(req->q, req->biotail, bio); | ||
1384 | } | ||
1385 | |||
1386 | static inline bool req_gap_front_merge(struct request *req, struct bio *bio) | ||
1387 | { | ||
1388 | return bio_will_gap(req->q, bio, req->bio); | ||
1389 | } | ||
1390 | |||
1371 | struct work_struct; | 1391 | struct work_struct; |
1372 | int kblockd_schedule_work(struct work_struct *work); | 1392 | int kblockd_schedule_work(struct work_struct *work); |
1373 | int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay); | 1393 | int kblockd_schedule_delayed_work(struct delayed_work *dwork, unsigned long delay); |
@@ -1494,6 +1514,26 @@ queue_max_integrity_segments(struct request_queue *q) | |||
1494 | return q->limits.max_integrity_segments; | 1514 | return q->limits.max_integrity_segments; |
1495 | } | 1515 | } |
1496 | 1516 | ||
1517 | static inline bool integrity_req_gap_back_merge(struct request *req, | ||
1518 | struct bio *next) | ||
1519 | { | ||
1520 | struct bio_integrity_payload *bip = bio_integrity(req->bio); | ||
1521 | struct bio_integrity_payload *bip_next = bio_integrity(next); | ||
1522 | |||
1523 | return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1], | ||
1524 | bip_next->bip_vec[0].bv_offset); | ||
1525 | } | ||
1526 | |||
1527 | static inline bool integrity_req_gap_front_merge(struct request *req, | ||
1528 | struct bio *bio) | ||
1529 | { | ||
1530 | struct bio_integrity_payload *bip = bio_integrity(bio); | ||
1531 | struct bio_integrity_payload *bip_next = bio_integrity(req->bio); | ||
1532 | |||
1533 | return bvec_gap_to_prev(req->q, &bip->bip_vec[bip->bip_vcnt - 1], | ||
1534 | bip_next->bip_vec[0].bv_offset); | ||
1535 | } | ||
1536 | |||
1497 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 1537 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
1498 | 1538 | ||
1499 | struct bio; | 1539 | struct bio; |
@@ -1560,6 +1600,16 @@ static inline bool blk_integrity_is_initialized(struct gendisk *g) | |||
1560 | { | 1600 | { |
1561 | return 0; | 1601 | return 0; |
1562 | } | 1602 | } |
1603 | static inline bool integrity_req_gap_back_merge(struct request *req, | ||
1604 | struct bio *next) | ||
1605 | { | ||
1606 | return false; | ||
1607 | } | ||
1608 | static inline bool integrity_req_gap_front_merge(struct request *req, | ||
1609 | struct bio *bio) | ||
1610 | { | ||
1611 | return false; | ||
1612 | } | ||
1563 | 1613 | ||
1564 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 1614 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
1565 | 1615 | ||
diff --git a/include/linux/ceph/ceph_features.h b/include/linux/ceph/ceph_features.h index 4763ad64e832..f89b31d45cc8 100644 --- a/include/linux/ceph/ceph_features.h +++ b/include/linux/ceph/ceph_features.h | |||
@@ -107,6 +107,7 @@ static inline u64 ceph_sanitize_features(u64 features) | |||
107 | CEPH_FEATURE_OSDMAP_ENC | \ | 107 | CEPH_FEATURE_OSDMAP_ENC | \ |
108 | CEPH_FEATURE_CRUSH_TUNABLES3 | \ | 108 | CEPH_FEATURE_CRUSH_TUNABLES3 | \ |
109 | CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ | 109 | CEPH_FEATURE_OSD_PRIMARY_AFFINITY | \ |
110 | CEPH_FEATURE_MSGR_KEEPALIVE2 | \ | ||
110 | CEPH_FEATURE_CRUSH_V4) | 111 | CEPH_FEATURE_CRUSH_V4) |
111 | 112 | ||
112 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ | 113 | #define CEPH_FEATURES_REQUIRED_DEFAULT \ |
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h index 7e1252e97a30..b2371d9b51fa 100644 --- a/include/linux/ceph/messenger.h +++ b/include/linux/ceph/messenger.h | |||
@@ -238,6 +238,8 @@ struct ceph_connection { | |||
238 | bool out_kvec_is_msg; /* kvec refers to out_msg */ | 238 | bool out_kvec_is_msg; /* kvec refers to out_msg */ |
239 | int out_more; /* there is more data after the kvecs */ | 239 | int out_more; /* there is more data after the kvecs */ |
240 | __le64 out_temp_ack; /* for writing an ack */ | 240 | __le64 out_temp_ack; /* for writing an ack */ |
241 | struct ceph_timespec out_temp_keepalive2; /* for writing keepalive2 | ||
242 | stamp */ | ||
241 | 243 | ||
242 | /* message in temps */ | 244 | /* message in temps */ |
243 | struct ceph_msg_header in_hdr; | 245 | struct ceph_msg_header in_hdr; |
@@ -248,7 +250,7 @@ struct ceph_connection { | |||
248 | int in_base_pos; /* bytes read */ | 250 | int in_base_pos; /* bytes read */ |
249 | __le64 in_temp_ack; /* for reading an ack */ | 251 | __le64 in_temp_ack; /* for reading an ack */ |
250 | 252 | ||
251 | struct timespec last_keepalive_ack; | 253 | struct timespec last_keepalive_ack; /* keepalive2 ack stamp */ |
252 | 254 | ||
253 | struct delayed_work work; /* send|recv work */ | 255 | struct delayed_work work; /* send|recv work */ |
254 | unsigned long delay; /* current delay interval */ | 256 | unsigned long delay; /* current delay interval */ |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 31ce435981fe..bdcf358dfce2 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -18,15 +18,6 @@ | |||
18 | struct clock_event_device; | 18 | struct clock_event_device; |
19 | struct module; | 19 | struct module; |
20 | 20 | ||
21 | /* Clock event mode commands for legacy ->set_mode(): OBSOLETE */ | ||
22 | enum clock_event_mode { | ||
23 | CLOCK_EVT_MODE_UNUSED, | ||
24 | CLOCK_EVT_MODE_SHUTDOWN, | ||
25 | CLOCK_EVT_MODE_PERIODIC, | ||
26 | CLOCK_EVT_MODE_ONESHOT, | ||
27 | CLOCK_EVT_MODE_RESUME, | ||
28 | }; | ||
29 | |||
30 | /* | 21 | /* |
31 | * Possible states of a clock event device. | 22 | * Possible states of a clock event device. |
32 | * | 23 | * |
@@ -86,16 +77,14 @@ enum clock_event_state { | |||
86 | * @min_delta_ns: minimum delta value in ns | 77 | * @min_delta_ns: minimum delta value in ns |
87 | * @mult: nanosecond to cycles multiplier | 78 | * @mult: nanosecond to cycles multiplier |
88 | * @shift: nanoseconds to cycles divisor (power of two) | 79 | * @shift: nanoseconds to cycles divisor (power of two) |
89 | * @mode: operating mode, relevant only to ->set_mode(), OBSOLETE | ||
90 | * @state_use_accessors:current state of the device, assigned by the core code | 80 | * @state_use_accessors:current state of the device, assigned by the core code |
91 | * @features: features | 81 | * @features: features |
92 | * @retries: number of forced programming retries | 82 | * @retries: number of forced programming retries |
93 | * @set_mode: legacy set mode function, only for modes <= CLOCK_EVT_MODE_RESUME. | 83 | * @set_state_periodic: switch state to periodic |
94 | * @set_state_periodic: switch state to periodic, if !set_mode | 84 | * @set_state_oneshot: switch state to oneshot |
95 | * @set_state_oneshot: switch state to oneshot, if !set_mode | 85 | * @set_state_oneshot_stopped: switch state to oneshot_stopped |
96 | * @set_state_oneshot_stopped: switch state to oneshot_stopped, if !set_mode | 86 | * @set_state_shutdown: switch state to shutdown |
97 | * @set_state_shutdown: switch state to shutdown, if !set_mode | 87 | * @tick_resume: resume clkevt device |
98 | * @tick_resume: resume clkevt device, if !set_mode | ||
99 | * @broadcast: function to broadcast events | 88 | * @broadcast: function to broadcast events |
100 | * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration | 89 | * @min_delta_ticks: minimum delta value in ticks stored for reconfiguration |
101 | * @max_delta_ticks: maximum delta value in ticks stored for reconfiguration | 90 | * @max_delta_ticks: maximum delta value in ticks stored for reconfiguration |
@@ -116,18 +105,10 @@ struct clock_event_device { | |||
116 | u64 min_delta_ns; | 105 | u64 min_delta_ns; |
117 | u32 mult; | 106 | u32 mult; |
118 | u32 shift; | 107 | u32 shift; |
119 | enum clock_event_mode mode; | ||
120 | enum clock_event_state state_use_accessors; | 108 | enum clock_event_state state_use_accessors; |
121 | unsigned int features; | 109 | unsigned int features; |
122 | unsigned long retries; | 110 | unsigned long retries; |
123 | 111 | ||
124 | /* | ||
125 | * State transition callback(s): Only one of the two groups should be | ||
126 | * defined: | ||
127 | * - set_mode(), only for modes <= CLOCK_EVT_MODE_RESUME. | ||
128 | * - set_state_{shutdown|periodic|oneshot|oneshot_stopped}(), tick_resume(). | ||
129 | */ | ||
130 | void (*set_mode)(enum clock_event_mode mode, struct clock_event_device *); | ||
131 | int (*set_state_periodic)(struct clock_event_device *); | 112 | int (*set_state_periodic)(struct clock_event_device *); |
132 | int (*set_state_oneshot)(struct clock_event_device *); | 113 | int (*set_state_oneshot)(struct clock_event_device *); |
133 | int (*set_state_oneshot_stopped)(struct clock_event_device *); | 114 | int (*set_state_oneshot_stopped)(struct clock_event_device *); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 430efcbea48e..dca22de98d94 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -127,9 +127,14 @@ struct cpufreq_policy { | |||
127 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ | 127 | #define CPUFREQ_SHARED_TYPE_ANY (3) /* Freq can be set from any dependent CPU*/ |
128 | 128 | ||
129 | #ifdef CONFIG_CPU_FREQ | 129 | #ifdef CONFIG_CPU_FREQ |
130 | struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu); | ||
130 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); | 131 | struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu); |
131 | void cpufreq_cpu_put(struct cpufreq_policy *policy); | 132 | void cpufreq_cpu_put(struct cpufreq_policy *policy); |
132 | #else | 133 | #else |
134 | static inline struct cpufreq_policy *cpufreq_cpu_get_raw(unsigned int cpu) | ||
135 | { | ||
136 | return NULL; | ||
137 | } | ||
133 | static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) | 138 | static inline struct cpufreq_policy *cpufreq_cpu_get(unsigned int cpu) |
134 | { | 139 | { |
135 | return NULL; | 140 | return NULL; |
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h index ce447f0f1bad..68030e22af35 100644 --- a/include/linux/devfreq.h +++ b/include/linux/devfreq.h | |||
@@ -65,7 +65,10 @@ struct devfreq_dev_status { | |||
65 | * The "flags" parameter's possible values are | 65 | * The "flags" parameter's possible values are |
66 | * explained above with "DEVFREQ_FLAG_*" macros. | 66 | * explained above with "DEVFREQ_FLAG_*" macros. |
67 | * @get_dev_status: The device should provide the current performance | 67 | * @get_dev_status: The device should provide the current performance |
68 | * status to devfreq, which is used by governors. | 68 | * status to devfreq. Governors are recommended not to |
69 | * use this directly. Instead, governors are recommended | ||
70 | * to use devfreq_update_stats() along with | ||
71 | * devfreq.last_status. | ||
69 | * @get_cur_freq: The device should provide the current frequency | 72 | * @get_cur_freq: The device should provide the current frequency |
70 | * at which it is operating. | 73 | * at which it is operating. |
71 | * @exit: An optional callback that is called when devfreq | 74 | * @exit: An optional callback that is called when devfreq |
@@ -161,6 +164,7 @@ struct devfreq { | |||
161 | struct delayed_work work; | 164 | struct delayed_work work; |
162 | 165 | ||
163 | unsigned long previous_freq; | 166 | unsigned long previous_freq; |
167 | struct devfreq_dev_status last_status; | ||
164 | 168 | ||
165 | void *data; /* private data for governors */ | 169 | void *data; /* private data for governors */ |
166 | 170 | ||
@@ -204,6 +208,19 @@ extern int devm_devfreq_register_opp_notifier(struct device *dev, | |||
204 | extern void devm_devfreq_unregister_opp_notifier(struct device *dev, | 208 | extern void devm_devfreq_unregister_opp_notifier(struct device *dev, |
205 | struct devfreq *devfreq); | 209 | struct devfreq *devfreq); |
206 | 210 | ||
211 | /** | ||
212 | * devfreq_update_stats() - update the last_status pointer in struct devfreq | ||
213 | * @df: the devfreq instance whose status needs updating | ||
214 | * | ||
215 | * Governors are recommended to use this function along with last_status, | ||
216 | * which allows other entities to reuse the last_status without affecting | ||
217 | * the values fetched later by governors. | ||
218 | */ | ||
219 | static inline int devfreq_update_stats(struct devfreq *df) | ||
220 | { | ||
221 | return df->profile->get_dev_status(df->dev.parent, &df->last_status); | ||
222 | } | ||
223 | |||
207 | #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) | 224 | #if IS_ENABLED(CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND) |
208 | /** | 225 | /** |
209 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq | 226 | * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq |
@@ -289,6 +306,11 @@ static inline void devm_devfreq_unregister_opp_notifier(struct device *dev, | |||
289 | struct devfreq *devfreq) | 306 | struct devfreq *devfreq) |
290 | { | 307 | { |
291 | } | 308 | } |
309 | |||
310 | static inline int devfreq_update_stats(struct devfreq *df) | ||
311 | { | ||
312 | return -EINVAL; | ||
313 | } | ||
292 | #endif /* CONFIG_PM_DEVFREQ */ | 314 | #endif /* CONFIG_PM_DEVFREQ */ |
293 | 315 | ||
294 | #endif /* __LINUX_DEVFREQ_H__ */ | 316 | #endif /* __LINUX_DEVFREQ_H__ */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 6f8b34066442..11bf09288ddb 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -110,8 +110,8 @@ enum { | |||
110 | /* | 110 | /* |
111 | * Return value for chip->irq_set_affinity() | 111 | * Return value for chip->irq_set_affinity() |
112 | * | 112 | * |
113 | * IRQ_SET_MASK_OK - OK, core updates irq_data.affinity | 113 | * IRQ_SET_MASK_OK - OK, core updates irq_common_data.affinity |
114 | * IRQ_SET_MASK_NOCPY - OK, chip did update irq_data.affinity | 114 | * IRQ_SET_MASK_NOCPY - OK, chip did update irq_common_data.affinity |
115 | * IRQ_SET_MASK_OK_DONE - Same as IRQ_SET_MASK_OK for core. Special code to | 115 | * IRQ_SET_MASK_OK_DONE - Same as IRQ_SET_MASK_OK for core. Special code to |
116 | * support stacked irqchips, which indicates skipping | 116 | * support stacked irqchips, which indicates skipping |
117 | * all descendent irqchips. | 117 | * all descendent irqchips. |
@@ -129,9 +129,19 @@ struct irq_domain; | |||
129 | * struct irq_common_data - per irq data shared by all irqchips | 129 | * struct irq_common_data - per irq data shared by all irqchips |
130 | * @state_use_accessors: status information for irq chip functions. | 130 | * @state_use_accessors: status information for irq chip functions. |
131 | * Use accessor functions to deal with it | 131 | * Use accessor functions to deal with it |
132 | * @node: node index useful for balancing | ||
133 | * @handler_data: per-IRQ data for the irq_chip methods | ||
134 | * @affinity: IRQ affinity on SMP | ||
135 | * @msi_desc: MSI descriptor | ||
132 | */ | 136 | */ |
133 | struct irq_common_data { | 137 | struct irq_common_data { |
134 | unsigned int state_use_accessors; | 138 | unsigned int state_use_accessors; |
139 | #ifdef CONFIG_NUMA | ||
140 | unsigned int node; | ||
141 | #endif | ||
142 | void *handler_data; | ||
143 | struct msi_desc *msi_desc; | ||
144 | cpumask_var_t affinity; | ||
135 | }; | 145 | }; |
136 | 146 | ||
137 | /** | 147 | /** |
@@ -139,38 +149,26 @@ struct irq_common_data { | |||
139 | * @mask: precomputed bitmask for accessing the chip registers | 149 | * @mask: precomputed bitmask for accessing the chip registers |
140 | * @irq: interrupt number | 150 | * @irq: interrupt number |
141 | * @hwirq: hardware interrupt number, local to the interrupt domain | 151 | * @hwirq: hardware interrupt number, local to the interrupt domain |
142 | * @node: node index useful for balancing | ||
143 | * @common: point to data shared by all irqchips | 152 | * @common: point to data shared by all irqchips |
144 | * @chip: low level interrupt hardware access | 153 | * @chip: low level interrupt hardware access |
145 | * @domain: Interrupt translation domain; responsible for mapping | 154 | * @domain: Interrupt translation domain; responsible for mapping |
146 | * between hwirq number and linux irq number. | 155 | * between hwirq number and linux irq number. |
147 | * @parent_data: pointer to parent struct irq_data to support hierarchy | 156 | * @parent_data: pointer to parent struct irq_data to support hierarchy |
148 | * irq_domain | 157 | * irq_domain |
149 | * @handler_data: per-IRQ data for the irq_chip methods | ||
150 | * @chip_data: platform-specific per-chip private data for the chip | 158 | * @chip_data: platform-specific per-chip private data for the chip |
151 | * methods, to allow shared chip implementations | 159 | * methods, to allow shared chip implementations |
152 | * @msi_desc: MSI descriptor | ||
153 | * @affinity: IRQ affinity on SMP | ||
154 | * | ||
155 | * The fields here need to overlay the ones in irq_desc until we | ||
156 | * cleaned up the direct references and switched everything over to | ||
157 | * irq_data. | ||
158 | */ | 160 | */ |
159 | struct irq_data { | 161 | struct irq_data { |
160 | u32 mask; | 162 | u32 mask; |
161 | unsigned int irq; | 163 | unsigned int irq; |
162 | unsigned long hwirq; | 164 | unsigned long hwirq; |
163 | unsigned int node; | ||
164 | struct irq_common_data *common; | 165 | struct irq_common_data *common; |
165 | struct irq_chip *chip; | 166 | struct irq_chip *chip; |
166 | struct irq_domain *domain; | 167 | struct irq_domain *domain; |
167 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | 168 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY |
168 | struct irq_data *parent_data; | 169 | struct irq_data *parent_data; |
169 | #endif | 170 | #endif |
170 | void *handler_data; | ||
171 | void *chip_data; | 171 | void *chip_data; |
172 | struct msi_desc *msi_desc; | ||
173 | cpumask_var_t affinity; | ||
174 | }; | 172 | }; |
175 | 173 | ||
176 | /* | 174 | /* |
@@ -190,6 +188,7 @@ struct irq_data { | |||
190 | * IRQD_IRQ_MASKED - Masked state of the interrupt | 188 | * IRQD_IRQ_MASKED - Masked state of the interrupt |
191 | * IRQD_IRQ_INPROGRESS - In progress state of the interrupt | 189 | * IRQD_IRQ_INPROGRESS - In progress state of the interrupt |
192 | * IRQD_WAKEUP_ARMED - Wakeup mode armed | 190 | * IRQD_WAKEUP_ARMED - Wakeup mode armed |
191 | * IRQD_FORWARDED_TO_VCPU - The interrupt is forwarded to a VCPU | ||
193 | */ | 192 | */ |
194 | enum { | 193 | enum { |
195 | IRQD_TRIGGER_MASK = 0xf, | 194 | IRQD_TRIGGER_MASK = 0xf, |
@@ -204,6 +203,7 @@ enum { | |||
204 | IRQD_IRQ_MASKED = (1 << 17), | 203 | IRQD_IRQ_MASKED = (1 << 17), |
205 | IRQD_IRQ_INPROGRESS = (1 << 18), | 204 | IRQD_IRQ_INPROGRESS = (1 << 18), |
206 | IRQD_WAKEUP_ARMED = (1 << 19), | 205 | IRQD_WAKEUP_ARMED = (1 << 19), |
206 | IRQD_FORWARDED_TO_VCPU = (1 << 20), | ||
207 | }; | 207 | }; |
208 | 208 | ||
209 | #define __irqd_to_state(d) ((d)->common->state_use_accessors) | 209 | #define __irqd_to_state(d) ((d)->common->state_use_accessors) |
@@ -282,6 +282,20 @@ static inline bool irqd_is_wakeup_armed(struct irq_data *d) | |||
282 | return __irqd_to_state(d) & IRQD_WAKEUP_ARMED; | 282 | return __irqd_to_state(d) & IRQD_WAKEUP_ARMED; |
283 | } | 283 | } |
284 | 284 | ||
285 | static inline bool irqd_is_forwarded_to_vcpu(struct irq_data *d) | ||
286 | { | ||
287 | return __irqd_to_state(d) & IRQD_FORWARDED_TO_VCPU; | ||
288 | } | ||
289 | |||
290 | static inline void irqd_set_forwarded_to_vcpu(struct irq_data *d) | ||
291 | { | ||
292 | __irqd_to_state(d) |= IRQD_FORWARDED_TO_VCPU; | ||
293 | } | ||
294 | |||
295 | static inline void irqd_clr_forwarded_to_vcpu(struct irq_data *d) | ||
296 | { | ||
297 | __irqd_to_state(d) &= ~IRQD_FORWARDED_TO_VCPU; | ||
298 | } | ||
285 | 299 | ||
286 | /* | 300 | /* |
287 | * Functions for chained handlers which can be enabled/disabled by the | 301 | * Functions for chained handlers which can be enabled/disabled by the |
@@ -461,14 +475,14 @@ static inline int irq_set_parent(int irq, int parent_irq) | |||
461 | * Built-in IRQ handlers for various IRQ types, | 475 | * Built-in IRQ handlers for various IRQ types, |
462 | * callable via desc->handle_irq() | 476 | * callable via desc->handle_irq() |
463 | */ | 477 | */ |
464 | extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); | 478 | extern void handle_level_irq(struct irq_desc *desc); |
465 | extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); | 479 | extern void handle_fasteoi_irq(struct irq_desc *desc); |
466 | extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc); | 480 | extern void handle_edge_irq(struct irq_desc *desc); |
467 | extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc); | 481 | extern void handle_edge_eoi_irq(struct irq_desc *desc); |
468 | extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); | 482 | extern void handle_simple_irq(struct irq_desc *desc); |
469 | extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); | 483 | extern void handle_percpu_irq(struct irq_desc *desc); |
470 | extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc); | 484 | extern void handle_percpu_devid_irq(struct irq_desc *desc); |
471 | extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); | 485 | extern void handle_bad_irq(struct irq_desc *desc); |
472 | extern void handle_nested_irq(unsigned int irq); | 486 | extern void handle_nested_irq(unsigned int irq); |
473 | 487 | ||
474 | extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); | 488 | extern int irq_chip_compose_msi_msg(struct irq_data *data, struct msi_msg *msg); |
@@ -627,23 +641,23 @@ static inline void *irq_data_get_irq_chip_data(struct irq_data *d) | |||
627 | static inline void *irq_get_handler_data(unsigned int irq) | 641 | static inline void *irq_get_handler_data(unsigned int irq) |
628 | { | 642 | { |
629 | struct irq_data *d = irq_get_irq_data(irq); | 643 | struct irq_data *d = irq_get_irq_data(irq); |
630 | return d ? d->handler_data : NULL; | 644 | return d ? d->common->handler_data : NULL; |
631 | } | 645 | } |
632 | 646 | ||
633 | static inline void *irq_data_get_irq_handler_data(struct irq_data *d) | 647 | static inline void *irq_data_get_irq_handler_data(struct irq_data *d) |
634 | { | 648 | { |
635 | return d->handler_data; | 649 | return d->common->handler_data; |
636 | } | 650 | } |
637 | 651 | ||
638 | static inline struct msi_desc *irq_get_msi_desc(unsigned int irq) | 652 | static inline struct msi_desc *irq_get_msi_desc(unsigned int irq) |
639 | { | 653 | { |
640 | struct irq_data *d = irq_get_irq_data(irq); | 654 | struct irq_data *d = irq_get_irq_data(irq); |
641 | return d ? d->msi_desc : NULL; | 655 | return d ? d->common->msi_desc : NULL; |
642 | } | 656 | } |
643 | 657 | ||
644 | static inline struct msi_desc *irq_data_get_msi_desc(struct irq_data *d) | 658 | static inline struct msi_desc *irq_data_get_msi_desc(struct irq_data *d) |
645 | { | 659 | { |
646 | return d->msi_desc; | 660 | return d->common->msi_desc; |
647 | } | 661 | } |
648 | 662 | ||
649 | static inline u32 irq_get_trigger_type(unsigned int irq) | 663 | static inline u32 irq_get_trigger_type(unsigned int irq) |
@@ -652,21 +666,30 @@ static inline u32 irq_get_trigger_type(unsigned int irq) | |||
652 | return d ? irqd_get_trigger_type(d) : 0; | 666 | return d ? irqd_get_trigger_type(d) : 0; |
653 | } | 667 | } |
654 | 668 | ||
655 | static inline int irq_data_get_node(struct irq_data *d) | 669 | static inline int irq_common_data_get_node(struct irq_common_data *d) |
656 | { | 670 | { |
671 | #ifdef CONFIG_NUMA | ||
657 | return d->node; | 672 | return d->node; |
673 | #else | ||
674 | return 0; | ||
675 | #endif | ||
676 | } | ||
677 | |||
678 | static inline int irq_data_get_node(struct irq_data *d) | ||
679 | { | ||
680 | return irq_common_data_get_node(d->common); | ||
658 | } | 681 | } |
659 | 682 | ||
660 | static inline struct cpumask *irq_get_affinity_mask(int irq) | 683 | static inline struct cpumask *irq_get_affinity_mask(int irq) |
661 | { | 684 | { |
662 | struct irq_data *d = irq_get_irq_data(irq); | 685 | struct irq_data *d = irq_get_irq_data(irq); |
663 | 686 | ||
664 | return d ? d->affinity : NULL; | 687 | return d ? d->common->affinity : NULL; |
665 | } | 688 | } |
666 | 689 | ||
667 | static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d) | 690 | static inline struct cpumask *irq_data_get_affinity_mask(struct irq_data *d) |
668 | { | 691 | { |
669 | return d->affinity; | 692 | return d->common->affinity; |
670 | } | 693 | } |
671 | 694 | ||
672 | unsigned int arch_dynirq_lower_bound(unsigned int from); | 695 | unsigned int arch_dynirq_lower_bound(unsigned int from); |
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h index 5acfa26602e1..a587a33363c7 100644 --- a/include/linux/irqdesc.h +++ b/include/linux/irqdesc.h | |||
@@ -98,11 +98,7 @@ extern struct irq_desc irq_desc[NR_IRQS]; | |||
98 | 98 | ||
99 | static inline struct irq_desc *irq_data_to_desc(struct irq_data *data) | 99 | static inline struct irq_desc *irq_data_to_desc(struct irq_data *data) |
100 | { | 100 | { |
101 | #ifdef CONFIG_IRQ_DOMAIN_HIERARCHY | 101 | return container_of(data->common, struct irq_desc, irq_common_data); |
102 | return irq_to_desc(data->irq); | ||
103 | #else | ||
104 | return container_of(data, struct irq_desc, irq_data); | ||
105 | #endif | ||
106 | } | 102 | } |
107 | 103 | ||
108 | static inline unsigned int irq_desc_get_irq(struct irq_desc *desc) | 104 | static inline unsigned int irq_desc_get_irq(struct irq_desc *desc) |
@@ -127,23 +123,21 @@ static inline void *irq_desc_get_chip_data(struct irq_desc *desc) | |||
127 | 123 | ||
128 | static inline void *irq_desc_get_handler_data(struct irq_desc *desc) | 124 | static inline void *irq_desc_get_handler_data(struct irq_desc *desc) |
129 | { | 125 | { |
130 | return desc->irq_data.handler_data; | 126 | return desc->irq_common_data.handler_data; |
131 | } | 127 | } |
132 | 128 | ||
133 | static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc) | 129 | static inline struct msi_desc *irq_desc_get_msi_desc(struct irq_desc *desc) |
134 | { | 130 | { |
135 | return desc->irq_data.msi_desc; | 131 | return desc->irq_common_data.msi_desc; |
136 | } | 132 | } |
137 | 133 | ||
138 | /* | 134 | /* |
139 | * Architectures call this to let the generic IRQ layer | 135 | * Architectures call this to let the generic IRQ layer |
140 | * handle an interrupt. If the descriptor is attached to an | 136 | * handle an interrupt. |
141 | * irqchip-style controller then we call the ->handle_irq() handler, | ||
142 | * and it calls __do_IRQ() if it's attached to an irqtype-style controller. | ||
143 | */ | 137 | */ |
144 | static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc) | 138 | static inline void generic_handle_irq_desc(struct irq_desc *desc) |
145 | { | 139 | { |
146 | desc->handle_irq(irq, desc); | 140 | desc->handle_irq(desc); |
147 | } | 141 | } |
148 | 142 | ||
149 | int generic_handle_irq(unsigned int irq); | 143 | int generic_handle_irq(unsigned int irq); |
@@ -176,29 +170,6 @@ static inline int irq_has_action(unsigned int irq) | |||
176 | return irq_desc_has_action(irq_to_desc(irq)); | 170 | return irq_desc_has_action(irq_to_desc(irq)); |
177 | } | 171 | } |
178 | 172 | ||
179 | /* caller has locked the irq_desc and both params are valid */ | ||
180 | static inline void __irq_set_handler_locked(unsigned int irq, | ||
181 | irq_flow_handler_t handler) | ||
182 | { | ||
183 | struct irq_desc *desc; | ||
184 | |||
185 | desc = irq_to_desc(irq); | ||
186 | desc->handle_irq = handler; | ||
187 | } | ||
188 | |||
189 | /* caller has locked the irq_desc and both params are valid */ | ||
190 | static inline void | ||
191 | __irq_set_chip_handler_name_locked(unsigned int irq, struct irq_chip *chip, | ||
192 | irq_flow_handler_t handler, const char *name) | ||
193 | { | ||
194 | struct irq_desc *desc; | ||
195 | |||
196 | desc = irq_to_desc(irq); | ||
197 | irq_desc_get_irq_data(desc)->chip = chip; | ||
198 | desc->handle_irq = handler; | ||
199 | desc->name = name; | ||
200 | } | ||
201 | |||
202 | /** | 173 | /** |
203 | * irq_set_handler_locked - Set irq handler from a locked region | 174 | * irq_set_handler_locked - Set irq handler from a locked region |
204 | * @data: Pointer to the irq_data structure which identifies the irq | 175 | * @data: Pointer to the irq_data structure which identifies the irq |
diff --git a/include/linux/irqhandler.h b/include/linux/irqhandler.h index 62d543004197..661bed0ed1f3 100644 --- a/include/linux/irqhandler.h +++ b/include/linux/irqhandler.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | struct irq_desc; | 9 | struct irq_desc; |
10 | struct irq_data; | 10 | struct irq_data; |
11 | typedef void (*irq_flow_handler_t)(unsigned int irq, struct irq_desc *desc); | 11 | typedef void (*irq_flow_handler_t)(struct irq_desc *desc); |
12 | typedef void (*irq_preflow_handler_t)(struct irq_data *data); | 12 | typedef void (*irq_preflow_handler_t)(struct irq_data *data); |
13 | 13 | ||
14 | #endif | 14 | #endif |
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h index 7f653e8f6690..f1094238ab2a 100644 --- a/include/linux/jump_label.h +++ b/include/linux/jump_label.h | |||
@@ -21,8 +21,8 @@ | |||
21 | * | 21 | * |
22 | * DEFINE_STATIC_KEY_TRUE(key); | 22 | * DEFINE_STATIC_KEY_TRUE(key); |
23 | * DEFINE_STATIC_KEY_FALSE(key); | 23 | * DEFINE_STATIC_KEY_FALSE(key); |
24 | * static_key_likely() | 24 | * static_branch_likely() |
25 | * statick_key_unlikely() | 25 | * static_branch_unlikely() |
26 | * | 26 | * |
27 | * Jump labels provide an interface to generate dynamic branches using | 27 | * Jump labels provide an interface to generate dynamic branches using |
28 | * self-modifying code. Assuming toolchain and architecture support, if we | 28 | * self-modifying code. Assuming toolchain and architecture support, if we |
@@ -45,12 +45,10 @@ | |||
45 | * statement, setting the key to true requires us to patch in a jump | 45 | * statement, setting the key to true requires us to patch in a jump |
46 | * to the out-of-line of true branch. | 46 | * to the out-of-line of true branch. |
47 | * | 47 | * |
48 | * In addtion to static_branch_{enable,disable}, we can also reference count | 48 | * In addition to static_branch_{enable,disable}, we can also reference count |
49 | * the key or branch direction via static_branch_{inc,dec}. Thus, | 49 | * the key or branch direction via static_branch_{inc,dec}. Thus, |
50 | * static_branch_inc() can be thought of as a 'make more true' and | 50 | * static_branch_inc() can be thought of as a 'make more true' and |
51 | * static_branch_dec() as a 'make more false'. The inc()/dec() | 51 | * static_branch_dec() as a 'make more false'. |
52 | * interface is meant to be used exclusively from the inc()/dec() for a given | ||
53 | * key. | ||
54 | * | 52 | * |
55 | * Since this relies on modifying code, the branch modifying functions | 53 | * Since this relies on modifying code, the branch modifying functions |
56 | * must be considered absolute slow paths (machine wide synchronization etc.). | 54 | * must be considered absolute slow paths (machine wide synchronization etc.). |
diff --git a/include/linux/regmap.h b/include/linux/regmap.h index 8fc0bfd8edc4..f6226976e158 100644 --- a/include/linux/regmap.h +++ b/include/linux/regmap.h | |||
@@ -791,6 +791,9 @@ struct regmap_irq { | |||
791 | unsigned int mask; | 791 | unsigned int mask; |
792 | }; | 792 | }; |
793 | 793 | ||
794 | #define REGMAP_IRQ_REG(_irq, _off, _mask) \ | ||
795 | [_irq] = { .reg_offset = (_off), .mask = (_mask) } | ||
796 | |||
794 | /** | 797 | /** |
795 | * Description of a generic regmap irq_chip. This is not intended to | 798 | * Description of a generic regmap irq_chip. This is not intended to |
796 | * handle every possible interrupt controller, but it should handle a | 799 | * handle every possible interrupt controller, but it should handle a |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 48d901f83f92..e312219ff823 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -147,11 +147,20 @@ static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) | |||
147 | cpumask_or(mask, mask, tick_nohz_full_mask); | 147 | cpumask_or(mask, mask, tick_nohz_full_mask); |
148 | } | 148 | } |
149 | 149 | ||
150 | static inline int housekeeping_any_cpu(void) | ||
151 | { | ||
152 | return cpumask_any_and(housekeeping_mask, cpu_online_mask); | ||
153 | } | ||
154 | |||
150 | extern void tick_nohz_full_kick(void); | 155 | extern void tick_nohz_full_kick(void); |
151 | extern void tick_nohz_full_kick_cpu(int cpu); | 156 | extern void tick_nohz_full_kick_cpu(int cpu); |
152 | extern void tick_nohz_full_kick_all(void); | 157 | extern void tick_nohz_full_kick_all(void); |
153 | extern void __tick_nohz_task_switch(void); | 158 | extern void __tick_nohz_task_switch(void); |
154 | #else | 159 | #else |
160 | static inline int housekeeping_any_cpu(void) | ||
161 | { | ||
162 | return smp_processor_id(); | ||
163 | } | ||
155 | static inline bool tick_nohz_full_enabled(void) { return false; } | 164 | static inline bool tick_nohz_full_enabled(void) { return false; } |
156 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } | 165 | static inline bool tick_nohz_full_cpu(int cpu) { return false; } |
157 | static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { } | 166 | static inline void tick_nohz_full_add_cpus_to(struct cpumask *mask) { } |
diff --git a/include/rdma/opa_port_info.h b/include/rdma/opa_port_info.h index 391dae1931c0..a0fa975cd1c1 100644 --- a/include/rdma/opa_port_info.h +++ b/include/rdma/opa_port_info.h | |||
@@ -294,8 +294,8 @@ struct opa_port_states { | |||
294 | 294 | ||
295 | struct opa_port_state_info { | 295 | struct opa_port_state_info { |
296 | struct opa_port_states port_states; | 296 | struct opa_port_states port_states; |
297 | u16 link_width_downgrade_tx_active; | 297 | __be16 link_width_downgrade_tx_active; |
298 | u16 link_width_downgrade_rx_active; | 298 | __be16 link_width_downgrade_rx_active; |
299 | }; | 299 | }; |
300 | 300 | ||
301 | struct opa_port_info { | 301 | struct opa_port_info { |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 6e40a9539763..e28169dd1c36 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
@@ -83,7 +83,7 @@ int irq_set_handler_data(unsigned int irq, void *data) | |||
83 | 83 | ||
84 | if (!desc) | 84 | if (!desc) |
85 | return -EINVAL; | 85 | return -EINVAL; |
86 | desc->irq_data.handler_data = data; | 86 | desc->irq_common_data.handler_data = data; |
87 | irq_put_desc_unlock(desc, flags); | 87 | irq_put_desc_unlock(desc, flags); |
88 | return 0; | 88 | return 0; |
89 | } | 89 | } |
@@ -105,7 +105,7 @@ int irq_set_msi_desc_off(unsigned int irq_base, unsigned int irq_offset, | |||
105 | 105 | ||
106 | if (!desc) | 106 | if (!desc) |
107 | return -EINVAL; | 107 | return -EINVAL; |
108 | desc->irq_data.msi_desc = entry; | 108 | desc->irq_common_data.msi_desc = entry; |
109 | if (entry && !irq_offset) | 109 | if (entry && !irq_offset) |
110 | entry->irq = irq_base; | 110 | entry->irq = irq_base; |
111 | irq_put_desc_unlock(desc, flags); | 111 | irq_put_desc_unlock(desc, flags); |
@@ -372,7 +372,6 @@ static bool irq_may_run(struct irq_desc *desc) | |||
372 | 372 | ||
373 | /** | 373 | /** |
374 | * handle_simple_irq - Simple and software-decoded IRQs. | 374 | * handle_simple_irq - Simple and software-decoded IRQs. |
375 | * @irq: the interrupt number | ||
376 | * @desc: the interrupt description structure for this irq | 375 | * @desc: the interrupt description structure for this irq |
377 | * | 376 | * |
378 | * Simple interrupts are either sent from a demultiplexing interrupt | 377 | * Simple interrupts are either sent from a demultiplexing interrupt |
@@ -382,8 +381,7 @@ static bool irq_may_run(struct irq_desc *desc) | |||
382 | * Note: The caller is expected to handle the ack, clear, mask and | 381 | * Note: The caller is expected to handle the ack, clear, mask and |
383 | * unmask issues if necessary. | 382 | * unmask issues if necessary. |
384 | */ | 383 | */ |
385 | void | 384 | void handle_simple_irq(struct irq_desc *desc) |
386 | handle_simple_irq(unsigned int irq, struct irq_desc *desc) | ||
387 | { | 385 | { |
388 | raw_spin_lock(&desc->lock); | 386 | raw_spin_lock(&desc->lock); |
389 | 387 | ||
@@ -425,7 +423,6 @@ static void cond_unmask_irq(struct irq_desc *desc) | |||
425 | 423 | ||
426 | /** | 424 | /** |
427 | * handle_level_irq - Level type irq handler | 425 | * handle_level_irq - Level type irq handler |
428 | * @irq: the interrupt number | ||
429 | * @desc: the interrupt description structure for this irq | 426 | * @desc: the interrupt description structure for this irq |
430 | * | 427 | * |
431 | * Level type interrupts are active as long as the hardware line has | 428 | * Level type interrupts are active as long as the hardware line has |
@@ -433,8 +430,7 @@ static void cond_unmask_irq(struct irq_desc *desc) | |||
433 | * it after the associated handler has acknowledged the device, so the | 430 | * it after the associated handler has acknowledged the device, so the |
434 | * interrupt line is back to inactive. | 431 | * interrupt line is back to inactive. |
435 | */ | 432 | */ |
436 | void | 433 | void handle_level_irq(struct irq_desc *desc) |
437 | handle_level_irq(unsigned int irq, struct irq_desc *desc) | ||
438 | { | 434 | { |
439 | raw_spin_lock(&desc->lock); | 435 | raw_spin_lock(&desc->lock); |
440 | mask_ack_irq(desc); | 436 | mask_ack_irq(desc); |
@@ -496,7 +492,6 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip) | |||
496 | 492 | ||
497 | /** | 493 | /** |
498 | * handle_fasteoi_irq - irq handler for transparent controllers | 494 | * handle_fasteoi_irq - irq handler for transparent controllers |
499 | * @irq: the interrupt number | ||
500 | * @desc: the interrupt description structure for this irq | 495 | * @desc: the interrupt description structure for this irq |
501 | * | 496 | * |
502 | * Only a single callback will be issued to the chip: an ->eoi() | 497 | * Only a single callback will be issued to the chip: an ->eoi() |
@@ -504,8 +499,7 @@ static void cond_unmask_eoi_irq(struct irq_desc *desc, struct irq_chip *chip) | |||
504 | * for modern forms of interrupt handlers, which handle the flow | 499 | * for modern forms of interrupt handlers, which handle the flow |
505 | * details in hardware, transparently. | 500 | * details in hardware, transparently. |
506 | */ | 501 | */ |
507 | void | 502 | void handle_fasteoi_irq(struct irq_desc *desc) |
508 | handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) | ||
509 | { | 503 | { |
510 | struct irq_chip *chip = desc->irq_data.chip; | 504 | struct irq_chip *chip = desc->irq_data.chip; |
511 | 505 | ||
@@ -546,7 +540,6 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq); | |||
546 | 540 | ||
547 | /** | 541 | /** |
548 | * handle_edge_irq - edge type IRQ handler | 542 | * handle_edge_irq - edge type IRQ handler |
549 | * @irq: the interrupt number | ||
550 | * @desc: the interrupt description structure for this irq | 543 | * @desc: the interrupt description structure for this irq |
551 | * | 544 | * |
552 | * Interrupt occures on the falling and/or rising edge of a hardware | 545 | * Interrupt occures on the falling and/or rising edge of a hardware |
@@ -560,8 +553,7 @@ EXPORT_SYMBOL_GPL(handle_fasteoi_irq); | |||
560 | * the handler was running. If all pending interrupts are handled, the | 553 | * the handler was running. If all pending interrupts are handled, the |
561 | * loop is left. | 554 | * loop is left. |
562 | */ | 555 | */ |
563 | void | 556 | void handle_edge_irq(struct irq_desc *desc) |
564 | handle_edge_irq(unsigned int irq, struct irq_desc *desc) | ||
565 | { | 557 | { |
566 | raw_spin_lock(&desc->lock); | 558 | raw_spin_lock(&desc->lock); |
567 | 559 | ||
@@ -618,13 +610,12 @@ EXPORT_SYMBOL(handle_edge_irq); | |||
618 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER | 610 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER |
619 | /** | 611 | /** |
620 | * handle_edge_eoi_irq - edge eoi type IRQ handler | 612 | * handle_edge_eoi_irq - edge eoi type IRQ handler |
621 | * @irq: the interrupt number | ||
622 | * @desc: the interrupt description structure for this irq | 613 | * @desc: the interrupt description structure for this irq |
623 | * | 614 | * |
624 | * Similar as the above handle_edge_irq, but using eoi and w/o the | 615 | * Similar as the above handle_edge_irq, but using eoi and w/o the |
625 | * mask/unmask logic. | 616 | * mask/unmask logic. |
626 | */ | 617 | */ |
627 | void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc) | 618 | void handle_edge_eoi_irq(struct irq_desc *desc) |
628 | { | 619 | { |
629 | struct irq_chip *chip = irq_desc_get_chip(desc); | 620 | struct irq_chip *chip = irq_desc_get_chip(desc); |
630 | 621 | ||
@@ -665,13 +656,11 @@ out_eoi: | |||
665 | 656 | ||
666 | /** | 657 | /** |
667 | * handle_percpu_irq - Per CPU local irq handler | 658 | * handle_percpu_irq - Per CPU local irq handler |
668 | * @irq: the interrupt number | ||
669 | * @desc: the interrupt description structure for this irq | 659 | * @desc: the interrupt description structure for this irq |
670 | * | 660 | * |
671 | * Per CPU interrupts on SMP machines without locking requirements | 661 | * Per CPU interrupts on SMP machines without locking requirements |
672 | */ | 662 | */ |
673 | void | 663 | void handle_percpu_irq(struct irq_desc *desc) |
674 | handle_percpu_irq(unsigned int irq, struct irq_desc *desc) | ||
675 | { | 664 | { |
676 | struct irq_chip *chip = irq_desc_get_chip(desc); | 665 | struct irq_chip *chip = irq_desc_get_chip(desc); |
677 | 666 | ||
@@ -688,7 +677,6 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc) | |||
688 | 677 | ||
689 | /** | 678 | /** |
690 | * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids | 679 | * handle_percpu_devid_irq - Per CPU local irq handler with per cpu dev ids |
691 | * @irq: the interrupt number | ||
692 | * @desc: the interrupt description structure for this irq | 680 | * @desc: the interrupt description structure for this irq |
693 | * | 681 | * |
694 | * Per CPU interrupts on SMP machines without locking requirements. Same as | 682 | * Per CPU interrupts on SMP machines without locking requirements. Same as |
@@ -698,11 +686,12 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc) | |||
698 | * contain the real device id for the cpu on which this handler is | 686 | * contain the real device id for the cpu on which this handler is |
699 | * called | 687 | * called |
700 | */ | 688 | */ |
701 | void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc) | 689 | void handle_percpu_devid_irq(struct irq_desc *desc) |
702 | { | 690 | { |
703 | struct irq_chip *chip = irq_desc_get_chip(desc); | 691 | struct irq_chip *chip = irq_desc_get_chip(desc); |
704 | struct irqaction *action = desc->action; | 692 | struct irqaction *action = desc->action; |
705 | void *dev_id = raw_cpu_ptr(action->percpu_dev_id); | 693 | void *dev_id = raw_cpu_ptr(action->percpu_dev_id); |
694 | unsigned int irq = irq_desc_get_irq(desc); | ||
706 | irqreturn_t res; | 695 | irqreturn_t res; |
707 | 696 | ||
708 | kstat_incr_irqs_this_cpu(desc); | 697 | kstat_incr_irqs_this_cpu(desc); |
@@ -796,7 +785,7 @@ irq_set_chained_handler_and_data(unsigned int irq, irq_flow_handler_t handle, | |||
796 | return; | 785 | return; |
797 | 786 | ||
798 | __irq_do_set_handler(desc, handle, 1, NULL); | 787 | __irq_do_set_handler(desc, handle, 1, NULL); |
799 | desc->irq_data.handler_data = data; | 788 | desc->irq_common_data.handler_data = data; |
800 | 789 | ||
801 | irq_put_desc_busunlock(desc, flags); | 790 | irq_put_desc_busunlock(desc, flags); |
802 | } | 791 | } |
diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c index b6eeea8a80c5..de41a68fc038 100644 --- a/kernel/irq/handle.c +++ b/kernel/irq/handle.c | |||
@@ -27,8 +27,10 @@ | |||
27 | * | 27 | * |
28 | * Handles spurious and unhandled IRQ's. It also prints a debugmessage. | 28 | * Handles spurious and unhandled IRQ's. It also prints a debugmessage. |
29 | */ | 29 | */ |
30 | void handle_bad_irq(unsigned int irq, struct irq_desc *desc) | 30 | void handle_bad_irq(struct irq_desc *desc) |
31 | { | 31 | { |
32 | unsigned int irq = irq_desc_get_irq(desc); | ||
33 | |||
32 | print_irq_desc(irq, desc); | 34 | print_irq_desc(irq, desc); |
33 | kstat_incr_irqs_this_cpu(desc); | 35 | kstat_incr_irqs_this_cpu(desc); |
34 | ack_bad_irq(irq); | 36 | ack_bad_irq(irq); |
diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h index eee4b385cffb..5ef0c2dbe930 100644 --- a/kernel/irq/internals.h +++ b/kernel/irq/internals.h | |||
@@ -194,7 +194,7 @@ static inline void kstat_incr_irqs_this_cpu(struct irq_desc *desc) | |||
194 | 194 | ||
195 | static inline int irq_desc_get_node(struct irq_desc *desc) | 195 | static inline int irq_desc_get_node(struct irq_desc *desc) |
196 | { | 196 | { |
197 | return irq_data_get_node(&desc->irq_data); | 197 | return irq_common_data_get_node(&desc->irq_common_data); |
198 | } | 198 | } |
199 | 199 | ||
200 | #ifdef CONFIG_PM_SLEEP | 200 | #ifdef CONFIG_PM_SLEEP |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index 0a2a4b697bcb..239e2ae2c947 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
@@ -38,12 +38,13 @@ static void __init init_irq_default_affinity(void) | |||
38 | #ifdef CONFIG_SMP | 38 | #ifdef CONFIG_SMP |
39 | static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node) | 39 | static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node) |
40 | { | 40 | { |
41 | if (!zalloc_cpumask_var_node(&desc->irq_data.affinity, gfp, node)) | 41 | if (!zalloc_cpumask_var_node(&desc->irq_common_data.affinity, |
42 | gfp, node)) | ||
42 | return -ENOMEM; | 43 | return -ENOMEM; |
43 | 44 | ||
44 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 45 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
45 | if (!zalloc_cpumask_var_node(&desc->pending_mask, gfp, node)) { | 46 | if (!zalloc_cpumask_var_node(&desc->pending_mask, gfp, node)) { |
46 | free_cpumask_var(desc->irq_data.affinity); | 47 | free_cpumask_var(desc->irq_common_data.affinity); |
47 | return -ENOMEM; | 48 | return -ENOMEM; |
48 | } | 49 | } |
49 | #endif | 50 | #endif |
@@ -52,11 +53,13 @@ static int alloc_masks(struct irq_desc *desc, gfp_t gfp, int node) | |||
52 | 53 | ||
53 | static void desc_smp_init(struct irq_desc *desc, int node) | 54 | static void desc_smp_init(struct irq_desc *desc, int node) |
54 | { | 55 | { |
55 | desc->irq_data.node = node; | 56 | cpumask_copy(desc->irq_common_data.affinity, irq_default_affinity); |
56 | cpumask_copy(desc->irq_data.affinity, irq_default_affinity); | ||
57 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 57 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
58 | cpumask_clear(desc->pending_mask); | 58 | cpumask_clear(desc->pending_mask); |
59 | #endif | 59 | #endif |
60 | #ifdef CONFIG_NUMA | ||
61 | desc->irq_common_data.node = node; | ||
62 | #endif | ||
60 | } | 63 | } |
61 | 64 | ||
62 | #else | 65 | #else |
@@ -70,12 +73,13 @@ static void desc_set_defaults(unsigned int irq, struct irq_desc *desc, int node, | |||
70 | { | 73 | { |
71 | int cpu; | 74 | int cpu; |
72 | 75 | ||
76 | desc->irq_common_data.handler_data = NULL; | ||
77 | desc->irq_common_data.msi_desc = NULL; | ||
78 | |||
73 | desc->irq_data.common = &desc->irq_common_data; | 79 | desc->irq_data.common = &desc->irq_common_data; |
74 | desc->irq_data.irq = irq; | 80 | desc->irq_data.irq = irq; |
75 | desc->irq_data.chip = &no_irq_chip; | 81 | desc->irq_data.chip = &no_irq_chip; |
76 | desc->irq_data.chip_data = NULL; | 82 | desc->irq_data.chip_data = NULL; |
77 | desc->irq_data.handler_data = NULL; | ||
78 | desc->irq_data.msi_desc = NULL; | ||
79 | irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS); | 83 | irq_settings_clr_and_set(desc, ~0, _IRQ_DEFAULT_INIT_FLAGS); |
80 | irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED); | 84 | irqd_set(&desc->irq_data, IRQD_IRQ_DISABLED); |
81 | desc->handle_irq = handle_bad_irq; | 85 | desc->handle_irq = handle_bad_irq; |
@@ -121,7 +125,7 @@ static void free_masks(struct irq_desc *desc) | |||
121 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 125 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
122 | free_cpumask_var(desc->pending_mask); | 126 | free_cpumask_var(desc->pending_mask); |
123 | #endif | 127 | #endif |
124 | free_cpumask_var(desc->irq_data.affinity); | 128 | free_cpumask_var(desc->irq_common_data.affinity); |
125 | } | 129 | } |
126 | #else | 130 | #else |
127 | static inline void free_masks(struct irq_desc *desc) { } | 131 | static inline void free_masks(struct irq_desc *desc) { } |
@@ -343,7 +347,7 @@ int generic_handle_irq(unsigned int irq) | |||
343 | 347 | ||
344 | if (!desc) | 348 | if (!desc) |
345 | return -EINVAL; | 349 | return -EINVAL; |
346 | generic_handle_irq_desc(irq, desc); | 350 | generic_handle_irq_desc(desc); |
347 | return 0; | 351 | return 0; |
348 | } | 352 | } |
349 | EXPORT_SYMBOL_GPL(generic_handle_irq); | 353 | EXPORT_SYMBOL_GPL(generic_handle_irq); |
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c index 79baaf8a7813..dc9d27c0c158 100644 --- a/kernel/irq/irqdomain.c +++ b/kernel/irq/irqdomain.c | |||
@@ -844,7 +844,6 @@ static struct irq_data *irq_domain_insert_irq_data(struct irq_domain *domain, | |||
844 | child->parent_data = irq_data; | 844 | child->parent_data = irq_data; |
845 | irq_data->irq = child->irq; | 845 | irq_data->irq = child->irq; |
846 | irq_data->common = child->common; | 846 | irq_data->common = child->common; |
847 | irq_data->node = child->node; | ||
848 | irq_data->domain = domain; | 847 | irq_data->domain = domain; |
849 | } | 848 | } |
850 | 849 | ||
diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c index ad1b064f94fe..f9a59f6cabd2 100644 --- a/kernel/irq/manage.c +++ b/kernel/irq/manage.c | |||
@@ -192,7 +192,7 @@ int irq_do_set_affinity(struct irq_data *data, const struct cpumask *mask, | |||
192 | switch (ret) { | 192 | switch (ret) { |
193 | case IRQ_SET_MASK_OK: | 193 | case IRQ_SET_MASK_OK: |
194 | case IRQ_SET_MASK_OK_DONE: | 194 | case IRQ_SET_MASK_OK_DONE: |
195 | cpumask_copy(data->affinity, mask); | 195 | cpumask_copy(desc->irq_common_data.affinity, mask); |
196 | case IRQ_SET_MASK_OK_NOCOPY: | 196 | case IRQ_SET_MASK_OK_NOCOPY: |
197 | irq_set_thread_affinity(desc); | 197 | irq_set_thread_affinity(desc); |
198 | ret = 0; | 198 | ret = 0; |
@@ -304,7 +304,7 @@ static void irq_affinity_notify(struct work_struct *work) | |||
304 | if (irq_move_pending(&desc->irq_data)) | 304 | if (irq_move_pending(&desc->irq_data)) |
305 | irq_get_pending(cpumask, desc); | 305 | irq_get_pending(cpumask, desc); |
306 | else | 306 | else |
307 | cpumask_copy(cpumask, desc->irq_data.affinity); | 307 | cpumask_copy(cpumask, desc->irq_common_data.affinity); |
308 | raw_spin_unlock_irqrestore(&desc->lock, flags); | 308 | raw_spin_unlock_irqrestore(&desc->lock, flags); |
309 | 309 | ||
310 | notify->notify(notify, cpumask); | 310 | notify->notify(notify, cpumask); |
@@ -375,9 +375,9 @@ static int setup_affinity(struct irq_desc *desc, struct cpumask *mask) | |||
375 | * one of the targets is online. | 375 | * one of the targets is online. |
376 | */ | 376 | */ |
377 | if (irqd_has_set(&desc->irq_data, IRQD_AFFINITY_SET)) { | 377 | if (irqd_has_set(&desc->irq_data, IRQD_AFFINITY_SET)) { |
378 | if (cpumask_intersects(desc->irq_data.affinity, | 378 | if (cpumask_intersects(desc->irq_common_data.affinity, |
379 | cpu_online_mask)) | 379 | cpu_online_mask)) |
380 | set = desc->irq_data.affinity; | 380 | set = desc->irq_common_data.affinity; |
381 | else | 381 | else |
382 | irqd_clear(&desc->irq_data, IRQD_AFFINITY_SET); | 382 | irqd_clear(&desc->irq_data, IRQD_AFFINITY_SET); |
383 | } | 383 | } |
@@ -829,8 +829,8 @@ irq_thread_check_affinity(struct irq_desc *desc, struct irqaction *action) | |||
829 | * This code is triggered unconditionally. Check the affinity | 829 | * This code is triggered unconditionally. Check the affinity |
830 | * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. | 830 | * mask pointer. For CPU_MASK_OFFSTACK=n this is optimized out. |
831 | */ | 831 | */ |
832 | if (desc->irq_data.affinity) | 832 | if (desc->irq_common_data.affinity) |
833 | cpumask_copy(mask, desc->irq_data.affinity); | 833 | cpumask_copy(mask, desc->irq_common_data.affinity); |
834 | else | 834 | else |
835 | valid = false; | 835 | valid = false; |
836 | raw_spin_unlock_irq(&desc->lock); | 836 | raw_spin_unlock_irq(&desc->lock); |
diff --git a/kernel/irq/proc.c b/kernel/irq/proc.c index 0e97c142ce40..e3a8c9577ba6 100644 --- a/kernel/irq/proc.c +++ b/kernel/irq/proc.c | |||
@@ -39,7 +39,7 @@ static struct proc_dir_entry *root_irq_dir; | |||
39 | static int show_irq_affinity(int type, struct seq_file *m, void *v) | 39 | static int show_irq_affinity(int type, struct seq_file *m, void *v) |
40 | { | 40 | { |
41 | struct irq_desc *desc = irq_to_desc((long)m->private); | 41 | struct irq_desc *desc = irq_to_desc((long)m->private); |
42 | const struct cpumask *mask = desc->irq_data.affinity; | 42 | const struct cpumask *mask = desc->irq_common_data.affinity; |
43 | 43 | ||
44 | #ifdef CONFIG_GENERIC_PENDING_IRQ | 44 | #ifdef CONFIG_GENERIC_PENDING_IRQ |
45 | if (irqd_is_setaffinity_pending(&desc->irq_data)) | 45 | if (irqd_is_setaffinity_pending(&desc->irq_data)) |
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c index dd95f44f99b2..b86886beee4f 100644 --- a/kernel/irq/resend.c +++ b/kernel/irq/resend.c | |||
@@ -38,7 +38,7 @@ static void resend_irqs(unsigned long arg) | |||
38 | clear_bit(irq, irqs_resend); | 38 | clear_bit(irq, irqs_resend); |
39 | desc = irq_to_desc(irq); | 39 | desc = irq_to_desc(irq); |
40 | local_irq_disable(); | 40 | local_irq_disable(); |
41 | desc->handle_irq(irq, desc); | 41 | desc->handle_irq(desc); |
42 | local_irq_enable(); | 42 | local_irq_enable(); |
43 | } | 43 | } |
44 | } | 44 | } |
diff --git a/kernel/locking/qspinlock.c b/kernel/locking/qspinlock.c index 337c8818541d..87e9ce6a63c5 100644 --- a/kernel/locking/qspinlock.c +++ b/kernel/locking/qspinlock.c | |||
@@ -289,7 +289,7 @@ void queued_spin_lock_slowpath(struct qspinlock *lock, u32 val) | |||
289 | if (pv_enabled()) | 289 | if (pv_enabled()) |
290 | goto queue; | 290 | goto queue; |
291 | 291 | ||
292 | if (virt_queued_spin_lock(lock)) | 292 | if (virt_spin_lock(lock)) |
293 | return; | 293 | return; |
294 | 294 | ||
295 | /* | 295 | /* |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 3595403921bd..2f9c92884817 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
@@ -621,18 +621,21 @@ int get_nohz_timer_target(void) | |||
621 | int i, cpu = smp_processor_id(); | 621 | int i, cpu = smp_processor_id(); |
622 | struct sched_domain *sd; | 622 | struct sched_domain *sd; |
623 | 623 | ||
624 | if (!idle_cpu(cpu)) | 624 | if (!idle_cpu(cpu) && is_housekeeping_cpu(cpu)) |
625 | return cpu; | 625 | return cpu; |
626 | 626 | ||
627 | rcu_read_lock(); | 627 | rcu_read_lock(); |
628 | for_each_domain(cpu, sd) { | 628 | for_each_domain(cpu, sd) { |
629 | for_each_cpu(i, sched_domain_span(sd)) { | 629 | for_each_cpu(i, sched_domain_span(sd)) { |
630 | if (!idle_cpu(i)) { | 630 | if (!idle_cpu(i) && is_housekeeping_cpu(cpu)) { |
631 | cpu = i; | 631 | cpu = i; |
632 | goto unlock; | 632 | goto unlock; |
633 | } | 633 | } |
634 | } | 634 | } |
635 | } | 635 | } |
636 | |||
637 | if (!is_housekeeping_cpu(cpu)) | ||
638 | cpu = housekeeping_any_cpu(); | ||
636 | unlock: | 639 | unlock: |
637 | rcu_read_unlock(); | 640 | rcu_read_unlock(); |
638 | return cpu; | 641 | return cpu; |
@@ -2666,13 +2669,20 @@ unsigned long nr_running(void) | |||
2666 | 2669 | ||
2667 | /* | 2670 | /* |
2668 | * Check if only the current task is running on the cpu. | 2671 | * Check if only the current task is running on the cpu. |
2672 | * | ||
2673 | * Caution: this function does not check that the caller has disabled | ||
2674 | * preemption, thus the result might have a time-of-check-to-time-of-use | ||
2675 | * race. The caller is responsible to use it correctly, for example: | ||
2676 | * | ||
2677 | * - from a non-preemptable section (of course) | ||
2678 | * | ||
2679 | * - from a thread that is bound to a single CPU | ||
2680 | * | ||
2681 | * - in a loop with very short iterations (e.g. a polling loop) | ||
2669 | */ | 2682 | */ |
2670 | bool single_task_running(void) | 2683 | bool single_task_running(void) |
2671 | { | 2684 | { |
2672 | if (cpu_rq(smp_processor_id())->nr_running == 1) | 2685 | return raw_rq()->nr_running == 1; |
2673 | return true; | ||
2674 | else | ||
2675 | return false; | ||
2676 | } | 2686 | } |
2677 | EXPORT_SYMBOL(single_task_running); | 2687 | EXPORT_SYMBOL(single_task_running); |
2678 | 2688 | ||
@@ -5178,24 +5188,47 @@ static void migrate_tasks(struct rq *dead_rq) | |||
5178 | break; | 5188 | break; |
5179 | 5189 | ||
5180 | /* | 5190 | /* |
5181 | * Ensure rq->lock covers the entire task selection | 5191 | * pick_next_task assumes pinned rq->lock. |
5182 | * until the migration. | ||
5183 | */ | 5192 | */ |
5184 | lockdep_pin_lock(&rq->lock); | 5193 | lockdep_pin_lock(&rq->lock); |
5185 | next = pick_next_task(rq, &fake_task); | 5194 | next = pick_next_task(rq, &fake_task); |
5186 | BUG_ON(!next); | 5195 | BUG_ON(!next); |
5187 | next->sched_class->put_prev_task(rq, next); | 5196 | next->sched_class->put_prev_task(rq, next); |
5188 | 5197 | ||
5198 | /* | ||
5199 | * Rules for changing task_struct::cpus_allowed are holding | ||
5200 | * both pi_lock and rq->lock, such that holding either | ||
5201 | * stabilizes the mask. | ||
5202 | * | ||
5203 | * Drop rq->lock is not quite as disastrous as it usually is | ||
5204 | * because !cpu_active at this point, which means load-balance | ||
5205 | * will not interfere. Also, stop-machine. | ||
5206 | */ | ||
5207 | lockdep_unpin_lock(&rq->lock); | ||
5208 | raw_spin_unlock(&rq->lock); | ||
5209 | raw_spin_lock(&next->pi_lock); | ||
5210 | raw_spin_lock(&rq->lock); | ||
5211 | |||
5212 | /* | ||
5213 | * Since we're inside stop-machine, _nothing_ should have | ||
5214 | * changed the task, WARN if weird stuff happened, because in | ||
5215 | * that case the above rq->lock drop is a fail too. | ||
5216 | */ | ||
5217 | if (WARN_ON(task_rq(next) != rq || !task_on_rq_queued(next))) { | ||
5218 | raw_spin_unlock(&next->pi_lock); | ||
5219 | continue; | ||
5220 | } | ||
5221 | |||
5189 | /* Find suitable destination for @next, with force if needed. */ | 5222 | /* Find suitable destination for @next, with force if needed. */ |
5190 | dest_cpu = select_fallback_rq(dead_rq->cpu, next); | 5223 | dest_cpu = select_fallback_rq(dead_rq->cpu, next); |
5191 | 5224 | ||
5192 | lockdep_unpin_lock(&rq->lock); | ||
5193 | rq = __migrate_task(rq, next, dest_cpu); | 5225 | rq = __migrate_task(rq, next, dest_cpu); |
5194 | if (rq != dead_rq) { | 5226 | if (rq != dead_rq) { |
5195 | raw_spin_unlock(&rq->lock); | 5227 | raw_spin_unlock(&rq->lock); |
5196 | rq = dead_rq; | 5228 | rq = dead_rq; |
5197 | raw_spin_lock(&rq->lock); | 5229 | raw_spin_lock(&rq->lock); |
5198 | } | 5230 | } |
5231 | raw_spin_unlock(&next->pi_lock); | ||
5199 | } | 5232 | } |
5200 | 5233 | ||
5201 | rq->stop = stop; | 5234 | rq->stop = stop; |
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 50eb107f1198..a9b76a40319e 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c | |||
@@ -97,20 +97,6 @@ EXPORT_SYMBOL_GPL(clockevent_delta2ns); | |||
97 | static int __clockevents_switch_state(struct clock_event_device *dev, | 97 | static int __clockevents_switch_state(struct clock_event_device *dev, |
98 | enum clock_event_state state) | 98 | enum clock_event_state state) |
99 | { | 99 | { |
100 | /* Transition with legacy set_mode() callback */ | ||
101 | if (dev->set_mode) { | ||
102 | /* Legacy callback doesn't support new modes */ | ||
103 | if (state > CLOCK_EVT_STATE_ONESHOT) | ||
104 | return -ENOSYS; | ||
105 | /* | ||
106 | * 'clock_event_state' and 'clock_event_mode' have 1-to-1 | ||
107 | * mapping until *_ONESHOT, and so a simple cast will work. | ||
108 | */ | ||
109 | dev->set_mode((enum clock_event_mode)state, dev); | ||
110 | dev->mode = (enum clock_event_mode)state; | ||
111 | return 0; | ||
112 | } | ||
113 | |||
114 | if (dev->features & CLOCK_EVT_FEAT_DUMMY) | 100 | if (dev->features & CLOCK_EVT_FEAT_DUMMY) |
115 | return 0; | 101 | return 0; |
116 | 102 | ||
@@ -204,12 +190,8 @@ int clockevents_tick_resume(struct clock_event_device *dev) | |||
204 | { | 190 | { |
205 | int ret = 0; | 191 | int ret = 0; |
206 | 192 | ||
207 | if (dev->set_mode) { | 193 | if (dev->tick_resume) |
208 | dev->set_mode(CLOCK_EVT_MODE_RESUME, dev); | ||
209 | dev->mode = CLOCK_EVT_MODE_RESUME; | ||
210 | } else if (dev->tick_resume) { | ||
211 | ret = dev->tick_resume(dev); | 194 | ret = dev->tick_resume(dev); |
212 | } | ||
213 | 195 | ||
214 | return ret; | 196 | return ret; |
215 | } | 197 | } |
@@ -460,26 +442,6 @@ int clockevents_unbind_device(struct clock_event_device *ced, int cpu) | |||
460 | } | 442 | } |
461 | EXPORT_SYMBOL_GPL(clockevents_unbind_device); | 443 | EXPORT_SYMBOL_GPL(clockevents_unbind_device); |
462 | 444 | ||
463 | /* Sanity check of state transition callbacks */ | ||
464 | static int clockevents_sanity_check(struct clock_event_device *dev) | ||
465 | { | ||
466 | /* Legacy set_mode() callback */ | ||
467 | if (dev->set_mode) { | ||
468 | /* We shouldn't be supporting new modes now */ | ||
469 | WARN_ON(dev->set_state_periodic || dev->set_state_oneshot || | ||
470 | dev->set_state_shutdown || dev->tick_resume || | ||
471 | dev->set_state_oneshot_stopped); | ||
472 | |||
473 | BUG_ON(dev->mode != CLOCK_EVT_MODE_UNUSED); | ||
474 | return 0; | ||
475 | } | ||
476 | |||
477 | if (dev->features & CLOCK_EVT_FEAT_DUMMY) | ||
478 | return 0; | ||
479 | |||
480 | return 0; | ||
481 | } | ||
482 | |||
483 | /** | 445 | /** |
484 | * clockevents_register_device - register a clock event device | 446 | * clockevents_register_device - register a clock event device |
485 | * @dev: device to register | 447 | * @dev: device to register |
@@ -488,8 +450,6 @@ void clockevents_register_device(struct clock_event_device *dev) | |||
488 | { | 450 | { |
489 | unsigned long flags; | 451 | unsigned long flags; |
490 | 452 | ||
491 | BUG_ON(clockevents_sanity_check(dev)); | ||
492 | |||
493 | /* Initialize state to DETACHED */ | 453 | /* Initialize state to DETACHED */ |
494 | clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); | 454 | clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); |
495 | 455 | ||
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index d11c55b6ab7d..4fcd99e12aa0 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -398,7 +398,6 @@ void tick_shutdown(unsigned int cpu) | |||
398 | * the set mode function! | 398 | * the set mode function! |
399 | */ | 399 | */ |
400 | clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); | 400 | clockevent_set_state(dev, CLOCK_EVT_STATE_DETACHED); |
401 | dev->mode = CLOCK_EVT_MODE_UNUSED; | ||
402 | clockevents_exchange_device(dev, NULL); | 401 | clockevents_exchange_device(dev, NULL); |
403 | dev->event_handler = clockevents_handle_noop; | 402 | dev->event_handler = clockevents_handle_noop; |
404 | td->evtdev = NULL; | 403 | td->evtdev = NULL; |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index 3319e16f31e5..7c7ec4515983 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -290,16 +290,17 @@ static int __init tick_nohz_full_setup(char *str) | |||
290 | __setup("nohz_full=", tick_nohz_full_setup); | 290 | __setup("nohz_full=", tick_nohz_full_setup); |
291 | 291 | ||
292 | static int tick_nohz_cpu_down_callback(struct notifier_block *nfb, | 292 | static int tick_nohz_cpu_down_callback(struct notifier_block *nfb, |
293 | unsigned long action, | 293 | unsigned long action, |
294 | void *hcpu) | 294 | void *hcpu) |
295 | { | 295 | { |
296 | unsigned int cpu = (unsigned long)hcpu; | 296 | unsigned int cpu = (unsigned long)hcpu; |
297 | 297 | ||
298 | switch (action & ~CPU_TASKS_FROZEN) { | 298 | switch (action & ~CPU_TASKS_FROZEN) { |
299 | case CPU_DOWN_PREPARE: | 299 | case CPU_DOWN_PREPARE: |
300 | /* | 300 | /* |
301 | * If we handle the timekeeping duty for full dynticks CPUs, | 301 | * The boot CPU handles housekeeping duty (unbound timers, |
302 | * we can't safely shutdown that CPU. | 302 | * workqueues, timekeeping, ...) on behalf of full dynticks |
303 | * CPUs. It must remain online when nohz full is enabled. | ||
303 | */ | 304 | */ |
304 | if (tick_nohz_full_running && tick_do_timer_cpu == cpu) | 305 | if (tick_nohz_full_running && tick_do_timer_cpu == cpu) |
305 | return NOTIFY_BAD; | 306 | return NOTIFY_BAD; |
@@ -370,6 +371,12 @@ void __init tick_nohz_init(void) | |||
370 | cpu_notifier(tick_nohz_cpu_down_callback, 0); | 371 | cpu_notifier(tick_nohz_cpu_down_callback, 0); |
371 | pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n", | 372 | pr_info("NO_HZ: Full dynticks CPUs: %*pbl.\n", |
372 | cpumask_pr_args(tick_nohz_full_mask)); | 373 | cpumask_pr_args(tick_nohz_full_mask)); |
374 | |||
375 | /* | ||
376 | * We need at least one CPU to handle housekeeping work such | ||
377 | * as timekeeping, unbound timers, workqueues, ... | ||
378 | */ | ||
379 | WARN_ON_ONCE(cpumask_empty(housekeeping_mask)); | ||
373 | } | 380 | } |
374 | #endif | 381 | #endif |
375 | 382 | ||
diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c index f6ee2e6b6f5d..3739ac6aa473 100644 --- a/kernel/time/timekeeping.c +++ b/kernel/time/timekeeping.c | |||
@@ -1614,7 +1614,7 @@ static __always_inline void timekeeping_freqadjust(struct timekeeper *tk, | |||
1614 | negative = (tick_error < 0); | 1614 | negative = (tick_error < 0); |
1615 | 1615 | ||
1616 | /* Sort out the magnitude of the correction */ | 1616 | /* Sort out the magnitude of the correction */ |
1617 | tick_error = abs(tick_error); | 1617 | tick_error = abs64(tick_error); |
1618 | for (adj = 0; tick_error > interval; adj++) | 1618 | for (adj = 0; tick_error > interval; adj++) |
1619 | tick_error >>= 1; | 1619 | tick_error >>= 1; |
1620 | 1620 | ||
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c index 129c96033e46..f75e35b60149 100644 --- a/kernel/time/timer_list.c +++ b/kernel/time/timer_list.c | |||
@@ -225,7 +225,7 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) | |||
225 | (unsigned long long) dev->min_delta_ns); | 225 | (unsigned long long) dev->min_delta_ns); |
226 | SEQ_printf(m, " mult: %u\n", dev->mult); | 226 | SEQ_printf(m, " mult: %u\n", dev->mult); |
227 | SEQ_printf(m, " shift: %u\n", dev->shift); | 227 | SEQ_printf(m, " shift: %u\n", dev->shift); |
228 | SEQ_printf(m, " mode: %d\n", dev->mode); | 228 | SEQ_printf(m, " mode: %d\n", clockevent_get_state(dev)); |
229 | SEQ_printf(m, " next_event: %Ld nsecs\n", | 229 | SEQ_printf(m, " next_event: %Ld nsecs\n", |
230 | (unsigned long long) ktime_to_ns(dev->next_event)); | 230 | (unsigned long long) ktime_to_ns(dev->next_event)); |
231 | 231 | ||
@@ -233,40 +233,34 @@ print_tickdevice(struct seq_file *m, struct tick_device *td, int cpu) | |||
233 | print_name_offset(m, dev->set_next_event); | 233 | print_name_offset(m, dev->set_next_event); |
234 | SEQ_printf(m, "\n"); | 234 | SEQ_printf(m, "\n"); |
235 | 235 | ||
236 | if (dev->set_mode) { | 236 | if (dev->set_state_shutdown) { |
237 | SEQ_printf(m, " set_mode: "); | 237 | SEQ_printf(m, " shutdown: "); |
238 | print_name_offset(m, dev->set_mode); | 238 | print_name_offset(m, dev->set_state_shutdown); |
239 | SEQ_printf(m, "\n"); | 239 | SEQ_printf(m, "\n"); |
240 | } else { | 240 | } |
241 | if (dev->set_state_shutdown) { | ||
242 | SEQ_printf(m, " shutdown: "); | ||
243 | print_name_offset(m, dev->set_state_shutdown); | ||
244 | SEQ_printf(m, "\n"); | ||
245 | } | ||
246 | 241 | ||
247 | if (dev->set_state_periodic) { | 242 | if (dev->set_state_periodic) { |
248 | SEQ_printf(m, " periodic: "); | 243 | SEQ_printf(m, " periodic: "); |
249 | print_name_offset(m, dev->set_state_periodic); | 244 | print_name_offset(m, dev->set_state_periodic); |
250 | SEQ_printf(m, "\n"); | 245 | SEQ_printf(m, "\n"); |
251 | } | 246 | } |
252 | 247 | ||
253 | if (dev->set_state_oneshot) { | 248 | if (dev->set_state_oneshot) { |
254 | SEQ_printf(m, " oneshot: "); | 249 | SEQ_printf(m, " oneshot: "); |
255 | print_name_offset(m, dev->set_state_oneshot); | 250 | print_name_offset(m, dev->set_state_oneshot); |
256 | SEQ_printf(m, "\n"); | 251 | SEQ_printf(m, "\n"); |
257 | } | 252 | } |
258 | 253 | ||
259 | if (dev->set_state_oneshot_stopped) { | 254 | if (dev->set_state_oneshot_stopped) { |
260 | SEQ_printf(m, " oneshot stopped: "); | 255 | SEQ_printf(m, " oneshot stopped: "); |
261 | print_name_offset(m, dev->set_state_oneshot_stopped); | 256 | print_name_offset(m, dev->set_state_oneshot_stopped); |
262 | SEQ_printf(m, "\n"); | 257 | SEQ_printf(m, "\n"); |
263 | } | 258 | } |
264 | 259 | ||
265 | if (dev->tick_resume) { | 260 | if (dev->tick_resume) { |
266 | SEQ_printf(m, " resume: "); | 261 | SEQ_printf(m, " resume: "); |
267 | print_name_offset(m, dev->tick_resume); | 262 | print_name_offset(m, dev->tick_resume); |
268 | SEQ_printf(m, "\n"); | 263 | SEQ_printf(m, "\n"); |
269 | } | ||
270 | } | 264 | } |
271 | 265 | ||
272 | SEQ_printf(m, " event_handler: "); | 266 | SEQ_printf(m, " event_handler: "); |
diff --git a/lib/string_helpers.c b/lib/string_helpers.c index 54036ce2e2dd..5939f63d90cd 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c | |||
@@ -59,7 +59,11 @@ void string_get_size(u64 size, u64 blk_size, const enum string_size_units units, | |||
59 | } | 59 | } |
60 | 60 | ||
61 | exp = divisor[units] / (u32)blk_size; | 61 | exp = divisor[units] / (u32)blk_size; |
62 | if (size >= exp) { | 62 | /* |
63 | * size must be strictly greater than exp here to ensure that remainder | ||
64 | * is greater than divisor[units] coming out of the if below. | ||
65 | */ | ||
66 | if (size > exp) { | ||
63 | remainder = do_div(size, divisor[units]); | 67 | remainder = do_div(size, divisor[units]); |
64 | remainder *= blk_size; | 68 | remainder *= blk_size; |
65 | i++; | 69 | i++; |
diff --git a/mm/kasan/kasan.c b/mm/kasan/kasan.c index 7b28e9cdf1c7..8da211411b57 100644 --- a/mm/kasan/kasan.c +++ b/mm/kasan/kasan.c | |||
@@ -135,12 +135,11 @@ static __always_inline bool memory_is_poisoned_16(unsigned long addr) | |||
135 | 135 | ||
136 | if (unlikely(*shadow_addr)) { | 136 | if (unlikely(*shadow_addr)) { |
137 | u16 shadow_first_bytes = *(u16 *)shadow_addr; | 137 | u16 shadow_first_bytes = *(u16 *)shadow_addr; |
138 | s8 last_byte = (addr + 15) & KASAN_SHADOW_MASK; | ||
139 | 138 | ||
140 | if (unlikely(shadow_first_bytes)) | 139 | if (unlikely(shadow_first_bytes)) |
141 | return true; | 140 | return true; |
142 | 141 | ||
143 | if (likely(!last_byte)) | 142 | if (likely(IS_ALIGNED(addr, 8))) |
144 | return false; | 143 | return false; |
145 | 144 | ||
146 | return memory_is_poisoned_1(addr + 15); | 145 | return memory_is_poisoned_1(addr + 15); |
@@ -612,8 +612,6 @@ static unsigned long count_vma_pages_range(struct mm_struct *mm, | |||
612 | void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, | 612 | void __vma_link_rb(struct mm_struct *mm, struct vm_area_struct *vma, |
613 | struct rb_node **rb_link, struct rb_node *rb_parent) | 613 | struct rb_node **rb_link, struct rb_node *rb_parent) |
614 | { | 614 | { |
615 | WARN_ONCE(vma->vm_file && !vma->vm_ops, "missing vma->vm_ops"); | ||
616 | |||
617 | /* Update tracking information for the gap following the new vma. */ | 615 | /* Update tracking information for the gap following the new vma. */ |
618 | if (vma->vm_next) | 616 | if (vma->vm_next) |
619 | vma_gap_update(vma->vm_next); | 617 | vma_gap_update(vma->vm_next); |
@@ -1638,12 +1636,6 @@ unsigned long mmap_region(struct file *file, unsigned long addr, | |||
1638 | */ | 1636 | */ |
1639 | WARN_ON_ONCE(addr != vma->vm_start); | 1637 | WARN_ON_ONCE(addr != vma->vm_start); |
1640 | 1638 | ||
1641 | /* All file mapping must have ->vm_ops set */ | ||
1642 | if (!vma->vm_ops) { | ||
1643 | static const struct vm_operations_struct dummy_ops = {}; | ||
1644 | vma->vm_ops = &dummy_ops; | ||
1645 | } | ||
1646 | |||
1647 | addr = vma->vm_start; | 1639 | addr = vma->vm_start; |
1648 | vm_flags = vma->vm_flags; | 1640 | vm_flags = vma->vm_flags; |
1649 | } else if (vm_flags & VM_SHARED) { | 1641 | } else if (vm_flags & VM_SHARED) { |
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index 525f454f7531..b9b0e3b5da49 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -1353,11 +1353,12 @@ static void prepare_write_keepalive(struct ceph_connection *con) | |||
1353 | dout("prepare_write_keepalive %p\n", con); | 1353 | dout("prepare_write_keepalive %p\n", con); |
1354 | con_out_kvec_reset(con); | 1354 | con_out_kvec_reset(con); |
1355 | if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) { | 1355 | if (con->peer_features & CEPH_FEATURE_MSGR_KEEPALIVE2) { |
1356 | struct timespec ts = CURRENT_TIME; | 1356 | struct timespec now = CURRENT_TIME; |
1357 | struct ceph_timespec ceph_ts; | 1357 | |
1358 | ceph_encode_timespec(&ceph_ts, &ts); | ||
1359 | con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2); | 1358 | con_out_kvec_add(con, sizeof(tag_keepalive2), &tag_keepalive2); |
1360 | con_out_kvec_add(con, sizeof(ceph_ts), &ceph_ts); | 1359 | ceph_encode_timespec(&con->out_temp_keepalive2, &now); |
1360 | con_out_kvec_add(con, sizeof(con->out_temp_keepalive2), | ||
1361 | &con->out_temp_keepalive2); | ||
1361 | } else { | 1362 | } else { |
1362 | con_out_kvec_add(con, sizeof(tag_keepalive), &tag_keepalive); | 1363 | con_out_kvec_add(con, sizeof(tag_keepalive), &tag_keepalive); |
1363 | } | 1364 | } |
diff --git a/scripts/extract-cert.c b/scripts/extract-cert.c index 10d23ca9f617..6ce5945a0b89 100644 --- a/scripts/extract-cert.c +++ b/scripts/extract-cert.c | |||
@@ -1,15 +1,15 @@ | |||
1 | /* Extract X.509 certificate in DER form from PKCS#11 or PEM. | 1 | /* Extract X.509 certificate in DER form from PKCS#11 or PEM. |
2 | * | 2 | * |
3 | * Copyright © 2014 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright © 2014-2015 Red Hat, Inc. All Rights Reserved. |
4 | * Copyright © 2015 Intel Corporation. | 4 | * Copyright © 2015 Intel Corporation. |
5 | * | 5 | * |
6 | * Authors: David Howells <dhowells@redhat.com> | 6 | * Authors: David Howells <dhowells@redhat.com> |
7 | * David Woodhouse <dwmw2@infradead.org> | 7 | * David Woodhouse <dwmw2@infradead.org> |
8 | * | 8 | * |
9 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
10 | * modify it under the terms of the GNU General Public Licence | 10 | * modify it under the terms of the GNU Lesser General Public License |
11 | * as published by the Free Software Foundation; either version | 11 | * as published by the Free Software Foundation; either version 2.1 |
12 | * 2 of the Licence, or (at your option) any later version. | 12 | * of the licence, or (at your option) any later version. |
13 | */ | 13 | */ |
14 | #define _GNU_SOURCE | 14 | #define _GNU_SOURCE |
15 | #include <stdio.h> | 15 | #include <stdio.h> |
diff --git a/scripts/sign-file.c b/scripts/sign-file.c index 058bba3103e2..c3899ca4811c 100755 --- a/scripts/sign-file.c +++ b/scripts/sign-file.c | |||
@@ -1,12 +1,15 @@ | |||
1 | /* Sign a module file using the given key. | 1 | /* Sign a module file using the given key. |
2 | * | 2 | * |
3 | * Copyright (C) 2014 Red Hat, Inc. All Rights Reserved. | 3 | * Copyright © 2014-2015 Red Hat, Inc. All Rights Reserved. |
4 | * Written by David Howells (dhowells@redhat.com) | 4 | * Copyright © 2015 Intel Corporation. |
5 | * | ||
6 | * Authors: David Howells <dhowells@redhat.com> | ||
7 | * David Woodhouse <dwmw2@infradead.org> | ||
5 | * | 8 | * |
6 | * This program is free software; you can redistribute it and/or | 9 | * This program is free software; you can redistribute it and/or |
7 | * modify it under the terms of the GNU General Public Licence | 10 | * modify it under the terms of the GNU Lesser General Public License |
8 | * as published by the Free Software Foundation; either version | 11 | * as published by the Free Software Foundation; either version 2.1 |
9 | * 2 of the Licence, or (at your option) any later version. | 12 | * of the licence, or (at your option) any later version. |
10 | */ | 13 | */ |
11 | #define _GNU_SOURCE | 14 | #define _GNU_SOURCE |
12 | #include <stdio.h> | 15 | #include <stdio.h> |
diff --git a/security/device_cgroup.c b/security/device_cgroup.c index 73455089feef..03c1652c9a1f 100644 --- a/security/device_cgroup.c +++ b/security/device_cgroup.c | |||
@@ -401,7 +401,7 @@ static bool verify_new_ex(struct dev_cgroup *dev_cgroup, | |||
401 | bool match = false; | 401 | bool match = false; |
402 | 402 | ||
403 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && | 403 | RCU_LOCKDEP_WARN(!rcu_read_lock_held() && |
404 | lockdep_is_held(&devcgroup_mutex), | 404 | !lockdep_is_held(&devcgroup_mutex), |
405 | "device_cgroup:verify_new_ex called without proper synchronization"); | 405 | "device_cgroup:verify_new_ex called without proper synchronization"); |
406 | 406 | ||
407 | if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) { | 407 | if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) { |
diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c index eb51325e8ad9..284a76e04628 100644 --- a/tools/perf/builtin-script.c +++ b/tools/perf/builtin-script.c | |||
@@ -768,8 +768,8 @@ static int process_exit_event(struct perf_tool *tool, | |||
768 | if (!evsel->attr.sample_id_all) { | 768 | if (!evsel->attr.sample_id_all) { |
769 | sample->cpu = 0; | 769 | sample->cpu = 0; |
770 | sample->time = 0; | 770 | sample->time = 0; |
771 | sample->tid = event->comm.tid; | 771 | sample->tid = event->fork.tid; |
772 | sample->pid = event->comm.pid; | 772 | sample->pid = event->fork.pid; |
773 | } | 773 | } |
774 | print_sample_start(sample, thread, evsel); | 774 | print_sample_start(sample, thread, evsel); |
775 | perf_event__fprintf(event, stdout); | 775 | perf_event__fprintf(event, stdout); |
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 1aa21c90731b..5b83f56a3b6f 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c | |||
@@ -34,6 +34,8 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
34 | .disabled = 1, | 34 | .disabled = 1, |
35 | .freq = 1, | 35 | .freq = 1, |
36 | }; | 36 | }; |
37 | struct cpu_map *cpus; | ||
38 | struct thread_map *threads; | ||
37 | 39 | ||
38 | attr.sample_freq = 500; | 40 | attr.sample_freq = 500; |
39 | 41 | ||
@@ -50,14 +52,19 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) | |||
50 | } | 52 | } |
51 | perf_evlist__add(evlist, evsel); | 53 | perf_evlist__add(evlist, evsel); |
52 | 54 | ||
53 | evlist->cpus = cpu_map__dummy_new(); | 55 | cpus = cpu_map__dummy_new(); |
54 | evlist->threads = thread_map__new_by_tid(getpid()); | 56 | threads = thread_map__new_by_tid(getpid()); |
55 | if (!evlist->cpus || !evlist->threads) { | 57 | if (!cpus || !threads) { |
56 | err = -ENOMEM; | 58 | err = -ENOMEM; |
57 | pr_debug("Not enough memory to create thread/cpu maps\n"); | 59 | pr_debug("Not enough memory to create thread/cpu maps\n"); |
58 | goto out_delete_evlist; | 60 | goto out_free_maps; |
59 | } | 61 | } |
60 | 62 | ||
63 | perf_evlist__set_maps(evlist, cpus, threads); | ||
64 | |||
65 | cpus = NULL; | ||
66 | threads = NULL; | ||
67 | |||
61 | if (perf_evlist__open(evlist)) { | 68 | if (perf_evlist__open(evlist)) { |
62 | const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate"; | 69 | const char *knob = "/proc/sys/kernel/perf_event_max_sample_rate"; |
63 | 70 | ||
@@ -107,6 +114,9 @@ next_event: | |||
107 | err = -1; | 114 | err = -1; |
108 | } | 115 | } |
109 | 116 | ||
117 | out_free_maps: | ||
118 | cpu_map__put(cpus); | ||
119 | thread_map__put(threads); | ||
110 | out_delete_evlist: | 120 | out_delete_evlist: |
111 | perf_evlist__delete(evlist); | 121 | perf_evlist__delete(evlist); |
112 | return err; | 122 | return err; |
diff --git a/tools/perf/tests/task-exit.c b/tools/perf/tests/task-exit.c index 3a8fedef83bc..add16385f13e 100644 --- a/tools/perf/tests/task-exit.c +++ b/tools/perf/tests/task-exit.c | |||
@@ -43,6 +43,8 @@ int test__task_exit(void) | |||
43 | }; | 43 | }; |
44 | const char *argv[] = { "true", NULL }; | 44 | const char *argv[] = { "true", NULL }; |
45 | char sbuf[STRERR_BUFSIZE]; | 45 | char sbuf[STRERR_BUFSIZE]; |
46 | struct cpu_map *cpus; | ||
47 | struct thread_map *threads; | ||
46 | 48 | ||
47 | signal(SIGCHLD, sig_handler); | 49 | signal(SIGCHLD, sig_handler); |
48 | 50 | ||
@@ -58,14 +60,19 @@ int test__task_exit(void) | |||
58 | * perf_evlist__prepare_workload we'll fill in the only thread | 60 | * perf_evlist__prepare_workload we'll fill in the only thread |
59 | * we're monitoring, the one forked there. | 61 | * we're monitoring, the one forked there. |
60 | */ | 62 | */ |
61 | evlist->cpus = cpu_map__dummy_new(); | 63 | cpus = cpu_map__dummy_new(); |
62 | evlist->threads = thread_map__new_by_tid(-1); | 64 | threads = thread_map__new_by_tid(-1); |
63 | if (!evlist->cpus || !evlist->threads) { | 65 | if (!cpus || !threads) { |
64 | err = -ENOMEM; | 66 | err = -ENOMEM; |
65 | pr_debug("Not enough memory to create thread/cpu maps\n"); | 67 | pr_debug("Not enough memory to create thread/cpu maps\n"); |
66 | goto out_delete_evlist; | 68 | goto out_free_maps; |
67 | } | 69 | } |
68 | 70 | ||
71 | perf_evlist__set_maps(evlist, cpus, threads); | ||
72 | |||
73 | cpus = NULL; | ||
74 | threads = NULL; | ||
75 | |||
69 | err = perf_evlist__prepare_workload(evlist, &target, argv, false, | 76 | err = perf_evlist__prepare_workload(evlist, &target, argv, false, |
70 | workload_exec_failed_signal); | 77 | workload_exec_failed_signal); |
71 | if (err < 0) { | 78 | if (err < 0) { |
@@ -114,6 +121,9 @@ retry: | |||
114 | err = -1; | 121 | err = -1; |
115 | } | 122 | } |
116 | 123 | ||
124 | out_free_maps: | ||
125 | cpu_map__put(cpus); | ||
126 | thread_map__put(threads); | ||
117 | out_delete_evlist: | 127 | out_delete_evlist: |
118 | perf_evlist__delete(evlist); | 128 | perf_evlist__delete(evlist); |
119 | return err; | 129 | return err; |
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index cf86f2d3a5e7..c04c60d4863c 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -1968,7 +1968,8 @@ skip_annotation: | |||
1968 | &options[nr_options], dso); | 1968 | &options[nr_options], dso); |
1969 | nr_options += add_map_opt(browser, &actions[nr_options], | 1969 | nr_options += add_map_opt(browser, &actions[nr_options], |
1970 | &options[nr_options], | 1970 | &options[nr_options], |
1971 | browser->selection->map); | 1971 | browser->selection ? |
1972 | browser->selection->map : NULL); | ||
1972 | 1973 | ||
1973 | /* perf script support */ | 1974 | /* perf script support */ |
1974 | if (browser->he_selection) { | 1975 | if (browser->he_selection) { |
@@ -1976,6 +1977,15 @@ skip_annotation: | |||
1976 | &actions[nr_options], | 1977 | &actions[nr_options], |
1977 | &options[nr_options], | 1978 | &options[nr_options], |
1978 | thread, NULL); | 1979 | thread, NULL); |
1980 | /* | ||
1981 | * Note that browser->selection != NULL | ||
1982 | * when browser->he_selection is not NULL, | ||
1983 | * so we don't need to check browser->selection | ||
1984 | * before fetching browser->selection->sym like what | ||
1985 | * we do before fetching browser->selection->map. | ||
1986 | * | ||
1987 | * See hist_browser__show_entry. | ||
1988 | */ | ||
1979 | nr_options += add_script_opt(browser, | 1989 | nr_options += add_script_opt(browser, |
1980 | &actions[nr_options], | 1990 | &actions[nr_options], |
1981 | &options[nr_options], | 1991 | &options[nr_options], |
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c index d51a5200c8af..c8fc8a258f42 100644 --- a/tools/perf/util/evlist.c +++ b/tools/perf/util/evlist.c | |||
@@ -124,6 +124,33 @@ void perf_evlist__delete(struct perf_evlist *evlist) | |||
124 | free(evlist); | 124 | free(evlist); |
125 | } | 125 | } |
126 | 126 | ||
127 | static void __perf_evlist__propagate_maps(struct perf_evlist *evlist, | ||
128 | struct perf_evsel *evsel) | ||
129 | { | ||
130 | /* | ||
131 | * We already have cpus for evsel (via PMU sysfs) so | ||
132 | * keep it, if there's no target cpu list defined. | ||
133 | */ | ||
134 | if (!evsel->own_cpus || evlist->has_user_cpus) { | ||
135 | cpu_map__put(evsel->cpus); | ||
136 | evsel->cpus = cpu_map__get(evlist->cpus); | ||
137 | } else if (evsel->cpus != evsel->own_cpus) { | ||
138 | cpu_map__put(evsel->cpus); | ||
139 | evsel->cpus = cpu_map__get(evsel->own_cpus); | ||
140 | } | ||
141 | |||
142 | thread_map__put(evsel->threads); | ||
143 | evsel->threads = thread_map__get(evlist->threads); | ||
144 | } | ||
145 | |||
146 | static void perf_evlist__propagate_maps(struct perf_evlist *evlist) | ||
147 | { | ||
148 | struct perf_evsel *evsel; | ||
149 | |||
150 | evlist__for_each(evlist, evsel) | ||
151 | __perf_evlist__propagate_maps(evlist, evsel); | ||
152 | } | ||
153 | |||
127 | void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) | 154 | void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) |
128 | { | 155 | { |
129 | entry->evlist = evlist; | 156 | entry->evlist = evlist; |
@@ -133,18 +160,19 @@ void perf_evlist__add(struct perf_evlist *evlist, struct perf_evsel *entry) | |||
133 | 160 | ||
134 | if (!evlist->nr_entries++) | 161 | if (!evlist->nr_entries++) |
135 | perf_evlist__set_id_pos(evlist); | 162 | perf_evlist__set_id_pos(evlist); |
163 | |||
164 | __perf_evlist__propagate_maps(evlist, entry); | ||
136 | } | 165 | } |
137 | 166 | ||
138 | void perf_evlist__splice_list_tail(struct perf_evlist *evlist, | 167 | void perf_evlist__splice_list_tail(struct perf_evlist *evlist, |
139 | struct list_head *list, | 168 | struct list_head *list) |
140 | int nr_entries) | ||
141 | { | 169 | { |
142 | bool set_id_pos = !evlist->nr_entries; | 170 | struct perf_evsel *evsel, *temp; |
143 | 171 | ||
144 | list_splice_tail(list, &evlist->entries); | 172 | __evlist__for_each_safe(list, temp, evsel) { |
145 | evlist->nr_entries += nr_entries; | 173 | list_del_init(&evsel->node); |
146 | if (set_id_pos) | 174 | perf_evlist__add(evlist, evsel); |
147 | perf_evlist__set_id_pos(evlist); | 175 | } |
148 | } | 176 | } |
149 | 177 | ||
150 | void __perf_evlist__set_leader(struct list_head *list) | 178 | void __perf_evlist__set_leader(struct list_head *list) |
@@ -210,7 +238,7 @@ static int perf_evlist__add_attrs(struct perf_evlist *evlist, | |||
210 | list_add_tail(&evsel->node, &head); | 238 | list_add_tail(&evsel->node, &head); |
211 | } | 239 | } |
212 | 240 | ||
213 | perf_evlist__splice_list_tail(evlist, &head, nr_attrs); | 241 | perf_evlist__splice_list_tail(evlist, &head); |
214 | 242 | ||
215 | return 0; | 243 | return 0; |
216 | 244 | ||
@@ -1103,71 +1131,56 @@ int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, | |||
1103 | return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false); | 1131 | return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false); |
1104 | } | 1132 | } |
1105 | 1133 | ||
1106 | static int perf_evlist__propagate_maps(struct perf_evlist *evlist, | ||
1107 | bool has_user_cpus) | ||
1108 | { | ||
1109 | struct perf_evsel *evsel; | ||
1110 | |||
1111 | evlist__for_each(evlist, evsel) { | ||
1112 | /* | ||
1113 | * We already have cpus for evsel (via PMU sysfs) so | ||
1114 | * keep it, if there's no target cpu list defined. | ||
1115 | */ | ||
1116 | if (evsel->cpus && has_user_cpus) | ||
1117 | cpu_map__put(evsel->cpus); | ||
1118 | |||
1119 | if (!evsel->cpus || has_user_cpus) | ||
1120 | evsel->cpus = cpu_map__get(evlist->cpus); | ||
1121 | |||
1122 | evsel->threads = thread_map__get(evlist->threads); | ||
1123 | |||
1124 | if ((evlist->cpus && !evsel->cpus) || | ||
1125 | (evlist->threads && !evsel->threads)) | ||
1126 | return -ENOMEM; | ||
1127 | } | ||
1128 | |||
1129 | return 0; | ||
1130 | } | ||
1131 | |||
1132 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) | 1134 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target) |
1133 | { | 1135 | { |
1134 | evlist->threads = thread_map__new_str(target->pid, target->tid, | 1136 | struct cpu_map *cpus; |
1135 | target->uid); | 1137 | struct thread_map *threads; |
1138 | |||
1139 | threads = thread_map__new_str(target->pid, target->tid, target->uid); | ||
1136 | 1140 | ||
1137 | if (evlist->threads == NULL) | 1141 | if (!threads) |
1138 | return -1; | 1142 | return -1; |
1139 | 1143 | ||
1140 | if (target__uses_dummy_map(target)) | 1144 | if (target__uses_dummy_map(target)) |
1141 | evlist->cpus = cpu_map__dummy_new(); | 1145 | cpus = cpu_map__dummy_new(); |
1142 | else | 1146 | else |
1143 | evlist->cpus = cpu_map__new(target->cpu_list); | 1147 | cpus = cpu_map__new(target->cpu_list); |
1144 | 1148 | ||
1145 | if (evlist->cpus == NULL) | 1149 | if (!cpus) |
1146 | goto out_delete_threads; | 1150 | goto out_delete_threads; |
1147 | 1151 | ||
1148 | return perf_evlist__propagate_maps(evlist, !!target->cpu_list); | 1152 | evlist->has_user_cpus = !!target->cpu_list; |
1153 | |||
1154 | perf_evlist__set_maps(evlist, cpus, threads); | ||
1155 | |||
1156 | return 0; | ||
1149 | 1157 | ||
1150 | out_delete_threads: | 1158 | out_delete_threads: |
1151 | thread_map__put(evlist->threads); | 1159 | thread_map__put(threads); |
1152 | evlist->threads = NULL; | ||
1153 | return -1; | 1160 | return -1; |
1154 | } | 1161 | } |
1155 | 1162 | ||
1156 | int perf_evlist__set_maps(struct perf_evlist *evlist, | 1163 | void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, |
1157 | struct cpu_map *cpus, | 1164 | struct thread_map *threads) |
1158 | struct thread_map *threads) | ||
1159 | { | 1165 | { |
1160 | if (evlist->cpus) | 1166 | /* |
1167 | * Allow for the possibility that one or another of the maps isn't being | ||
1168 | * changed i.e. don't put it. Note we are assuming the maps that are | ||
1169 | * being applied are brand new and evlist is taking ownership of the | ||
1170 | * original reference count of 1. If that is not the case it is up to | ||
1171 | * the caller to increase the reference count. | ||
1172 | */ | ||
1173 | if (cpus != evlist->cpus) { | ||
1161 | cpu_map__put(evlist->cpus); | 1174 | cpu_map__put(evlist->cpus); |
1175 | evlist->cpus = cpus; | ||
1176 | } | ||
1162 | 1177 | ||
1163 | evlist->cpus = cpus; | 1178 | if (threads != evlist->threads) { |
1164 | |||
1165 | if (evlist->threads) | ||
1166 | thread_map__put(evlist->threads); | 1179 | thread_map__put(evlist->threads); |
1180 | evlist->threads = threads; | ||
1181 | } | ||
1167 | 1182 | ||
1168 | evlist->threads = threads; | 1183 | perf_evlist__propagate_maps(evlist); |
1169 | |||
1170 | return perf_evlist__propagate_maps(evlist, false); | ||
1171 | } | 1184 | } |
1172 | 1185 | ||
1173 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel) | 1186 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel) |
@@ -1387,6 +1400,8 @@ void perf_evlist__close(struct perf_evlist *evlist) | |||
1387 | 1400 | ||
1388 | static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist) | 1401 | static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist) |
1389 | { | 1402 | { |
1403 | struct cpu_map *cpus; | ||
1404 | struct thread_map *threads; | ||
1390 | int err = -ENOMEM; | 1405 | int err = -ENOMEM; |
1391 | 1406 | ||
1392 | /* | 1407 | /* |
@@ -1398,20 +1413,19 @@ static int perf_evlist__create_syswide_maps(struct perf_evlist *evlist) | |||
1398 | * error, and we may not want to do that fallback to a | 1413 | * error, and we may not want to do that fallback to a |
1399 | * default cpu identity map :-\ | 1414 | * default cpu identity map :-\ |
1400 | */ | 1415 | */ |
1401 | evlist->cpus = cpu_map__new(NULL); | 1416 | cpus = cpu_map__new(NULL); |
1402 | if (evlist->cpus == NULL) | 1417 | if (!cpus) |
1403 | goto out; | 1418 | goto out; |
1404 | 1419 | ||
1405 | evlist->threads = thread_map__new_dummy(); | 1420 | threads = thread_map__new_dummy(); |
1406 | if (evlist->threads == NULL) | 1421 | if (!threads) |
1407 | goto out_free_cpus; | 1422 | goto out_put; |
1408 | 1423 | ||
1409 | err = 0; | 1424 | perf_evlist__set_maps(evlist, cpus, threads); |
1410 | out: | 1425 | out: |
1411 | return err; | 1426 | return err; |
1412 | out_free_cpus: | 1427 | out_put: |
1413 | cpu_map__put(evlist->cpus); | 1428 | cpu_map__put(cpus); |
1414 | evlist->cpus = NULL; | ||
1415 | goto out; | 1429 | goto out; |
1416 | } | 1430 | } |
1417 | 1431 | ||
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h index b39a6198f4ac..115d8b53c601 100644 --- a/tools/perf/util/evlist.h +++ b/tools/perf/util/evlist.h | |||
@@ -42,6 +42,7 @@ struct perf_evlist { | |||
42 | int nr_mmaps; | 42 | int nr_mmaps; |
43 | bool overwrite; | 43 | bool overwrite; |
44 | bool enabled; | 44 | bool enabled; |
45 | bool has_user_cpus; | ||
45 | size_t mmap_len; | 46 | size_t mmap_len; |
46 | int id_pos; | 47 | int id_pos; |
47 | int is_pos; | 48 | int is_pos; |
@@ -155,9 +156,8 @@ int perf_evlist__enable_event_idx(struct perf_evlist *evlist, | |||
155 | void perf_evlist__set_selected(struct perf_evlist *evlist, | 156 | void perf_evlist__set_selected(struct perf_evlist *evlist, |
156 | struct perf_evsel *evsel); | 157 | struct perf_evsel *evsel); |
157 | 158 | ||
158 | int perf_evlist__set_maps(struct perf_evlist *evlist, | 159 | void perf_evlist__set_maps(struct perf_evlist *evlist, struct cpu_map *cpus, |
159 | struct cpu_map *cpus, | 160 | struct thread_map *threads); |
160 | struct thread_map *threads); | ||
161 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target); | 161 | int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target); |
162 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel); | 162 | int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel); |
163 | 163 | ||
@@ -179,8 +179,7 @@ bool perf_evlist__valid_sample_id_all(struct perf_evlist *evlist); | |||
179 | bool perf_evlist__valid_read_format(struct perf_evlist *evlist); | 179 | bool perf_evlist__valid_read_format(struct perf_evlist *evlist); |
180 | 180 | ||
181 | void perf_evlist__splice_list_tail(struct perf_evlist *evlist, | 181 | void perf_evlist__splice_list_tail(struct perf_evlist *evlist, |
182 | struct list_head *list, | 182 | struct list_head *list); |
183 | int nr_entries); | ||
184 | 183 | ||
185 | static inline struct perf_evsel *perf_evlist__first(struct perf_evlist *evlist) | 184 | static inline struct perf_evsel *perf_evlist__first(struct perf_evlist *evlist) |
186 | { | 185 | { |
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index c53f79123b37..5410483d5219 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c | |||
@@ -1033,6 +1033,7 @@ void perf_evsel__exit(struct perf_evsel *evsel) | |||
1033 | perf_evsel__free_config_terms(evsel); | 1033 | perf_evsel__free_config_terms(evsel); |
1034 | close_cgroup(evsel->cgrp); | 1034 | close_cgroup(evsel->cgrp); |
1035 | cpu_map__put(evsel->cpus); | 1035 | cpu_map__put(evsel->cpus); |
1036 | cpu_map__put(evsel->own_cpus); | ||
1036 | thread_map__put(evsel->threads); | 1037 | thread_map__put(evsel->threads); |
1037 | zfree(&evsel->group_name); | 1038 | zfree(&evsel->group_name); |
1038 | zfree(&evsel->name); | 1039 | zfree(&evsel->name); |
diff --git a/tools/perf/util/evsel.h b/tools/perf/util/evsel.h index 298e6bbca200..ef8925f7211a 100644 --- a/tools/perf/util/evsel.h +++ b/tools/perf/util/evsel.h | |||
@@ -98,6 +98,7 @@ struct perf_evsel { | |||
98 | struct cgroup_sel *cgrp; | 98 | struct cgroup_sel *cgrp; |
99 | void *handler; | 99 | void *handler; |
100 | struct cpu_map *cpus; | 100 | struct cpu_map *cpus; |
101 | struct cpu_map *own_cpus; | ||
101 | struct thread_map *threads; | 102 | struct thread_map *threads; |
102 | unsigned int sample_size; | 103 | unsigned int sample_size; |
103 | int id_pos; | 104 | int id_pos; |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 41814547da15..fce6634aebe2 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
@@ -1438,7 +1438,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused, | |||
1438 | if (ph->needs_swap) | 1438 | if (ph->needs_swap) |
1439 | nr = bswap_32(nr); | 1439 | nr = bswap_32(nr); |
1440 | 1440 | ||
1441 | ph->env.nr_cpus_online = nr; | 1441 | ph->env.nr_cpus_avail = nr; |
1442 | 1442 | ||
1443 | ret = readn(fd, &nr, sizeof(nr)); | 1443 | ret = readn(fd, &nr, sizeof(nr)); |
1444 | if (ret != sizeof(nr)) | 1444 | if (ret != sizeof(nr)) |
@@ -1447,7 +1447,7 @@ static int process_nrcpus(struct perf_file_section *section __maybe_unused, | |||
1447 | if (ph->needs_swap) | 1447 | if (ph->needs_swap) |
1448 | nr = bswap_32(nr); | 1448 | nr = bswap_32(nr); |
1449 | 1449 | ||
1450 | ph->env.nr_cpus_avail = nr; | 1450 | ph->env.nr_cpus_online = nr; |
1451 | return 0; | 1451 | return 0; |
1452 | } | 1452 | } |
1453 | 1453 | ||
diff --git a/tools/perf/util/intel-bts.c b/tools/perf/util/intel-bts.c index ea768625ab5b..eb0e7f8bf515 100644 --- a/tools/perf/util/intel-bts.c +++ b/tools/perf/util/intel-bts.c | |||
@@ -623,7 +623,7 @@ static int intel_bts_process_event(struct perf_session *session, | |||
623 | if (err) | 623 | if (err) |
624 | return err; | 624 | return err; |
625 | if (event->header.type == PERF_RECORD_EXIT) { | 625 | if (event->header.type == PERF_RECORD_EXIT) { |
626 | err = intel_bts_process_tid_exit(bts, event->comm.tid); | 626 | err = intel_bts_process_tid_exit(bts, event->fork.tid); |
627 | if (err) | 627 | if (err) |
628 | return err; | 628 | return err; |
629 | } | 629 | } |
diff --git a/tools/perf/util/intel-pt.c b/tools/perf/util/intel-pt.c index bb41c20e6005..535d86f8e4d1 100644 --- a/tools/perf/util/intel-pt.c +++ b/tools/perf/util/intel-pt.c | |||
@@ -1494,7 +1494,7 @@ static int intel_pt_process_event(struct perf_session *session, | |||
1494 | if (pt->timeless_decoding) { | 1494 | if (pt->timeless_decoding) { |
1495 | if (event->header.type == PERF_RECORD_EXIT) { | 1495 | if (event->header.type == PERF_RECORD_EXIT) { |
1496 | err = intel_pt_process_timeless_queues(pt, | 1496 | err = intel_pt_process_timeless_queues(pt, |
1497 | event->comm.tid, | 1497 | event->fork.tid, |
1498 | sample->time); | 1498 | sample->time); |
1499 | } | 1499 | } |
1500 | } else if (timestamp) { | 1500 | } else if (timestamp) { |
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c index d826e6f515db..21ed6ee63da9 100644 --- a/tools/perf/util/parse-events.c +++ b/tools/perf/util/parse-events.c | |||
@@ -287,8 +287,8 @@ __add_event(struct list_head *list, int *idx, | |||
287 | if (!evsel) | 287 | if (!evsel) |
288 | return NULL; | 288 | return NULL; |
289 | 289 | ||
290 | if (cpus) | 290 | evsel->cpus = cpu_map__get(cpus); |
291 | evsel->cpus = cpu_map__get(cpus); | 291 | evsel->own_cpus = cpu_map__get(cpus); |
292 | 292 | ||
293 | if (name) | 293 | if (name) |
294 | evsel->name = strdup(name); | 294 | evsel->name = strdup(name); |
@@ -1140,10 +1140,9 @@ int parse_events(struct perf_evlist *evlist, const char *str, | |||
1140 | ret = parse_events__scanner(str, &data, PE_START_EVENTS); | 1140 | ret = parse_events__scanner(str, &data, PE_START_EVENTS); |
1141 | perf_pmu__parse_cleanup(); | 1141 | perf_pmu__parse_cleanup(); |
1142 | if (!ret) { | 1142 | if (!ret) { |
1143 | int entries = data.idx - evlist->nr_entries; | ||
1144 | struct perf_evsel *last; | 1143 | struct perf_evsel *last; |
1145 | 1144 | ||
1146 | perf_evlist__splice_list_tail(evlist, &data.list, entries); | 1145 | perf_evlist__splice_list_tail(evlist, &data.list); |
1147 | evlist->nr_groups += data.nr_groups; | 1146 | evlist->nr_groups += data.nr_groups; |
1148 | last = perf_evlist__last(evlist); | 1147 | last = perf_evlist__last(evlist); |
1149 | last->cmdline_group_boundary = true; | 1148 | last->cmdline_group_boundary = true; |
diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y index 591905a02b92..9cd70819c795 100644 --- a/tools/perf/util/parse-events.y +++ b/tools/perf/util/parse-events.y | |||
@@ -255,7 +255,7 @@ PE_PMU_EVENT_PRE '-' PE_PMU_EVENT_SUF sep_dc | |||
255 | list_add_tail(&term->list, head); | 255 | list_add_tail(&term->list, head); |
256 | 256 | ||
257 | ALLOC_LIST(list); | 257 | ALLOC_LIST(list); |
258 | ABORT_ON(parse_events_add_pmu(list, &data->idx, "cpu", head)); | 258 | ABORT_ON(parse_events_add_pmu(data, list, "cpu", head)); |
259 | parse_events__free_terms(head); | 259 | parse_events__free_terms(head); |
260 | $$ = list; | 260 | $$ = list; |
261 | } | 261 | } |
diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile index 89b05e2222c9..cfe121353eec 100644 --- a/tools/testing/selftests/Makefile +++ b/tools/testing/selftests/Makefile | |||
@@ -16,12 +16,12 @@ TARGETS += powerpc | |||
16 | TARGETS += ptrace | 16 | TARGETS += ptrace |
17 | TARGETS += seccomp | 17 | TARGETS += seccomp |
18 | TARGETS += size | 18 | TARGETS += size |
19 | TARGETS += static_keys | ||
19 | TARGETS += sysctl | 20 | TARGETS += sysctl |
20 | ifneq (1, $(quicktest)) | 21 | ifneq (1, $(quicktest)) |
21 | TARGETS += timers | 22 | TARGETS += timers |
22 | endif | 23 | endif |
23 | TARGETS += user | 24 | TARGETS += user |
24 | TARGETS += jumplabel | ||
25 | TARGETS += vm | 25 | TARGETS += vm |
26 | TARGETS += x86 | 26 | TARGETS += x86 |
27 | TARGETS += zram | 27 | TARGETS += zram |
diff --git a/tools/testing/selftests/exec/Makefile b/tools/testing/selftests/exec/Makefile index 6b76bfdc847e..4e400eb83657 100644 --- a/tools/testing/selftests/exec/Makefile +++ b/tools/testing/selftests/exec/Makefile | |||
@@ -1,6 +1,6 @@ | |||
1 | CFLAGS = -Wall | 1 | CFLAGS = -Wall |
2 | BINARIES = execveat | 2 | BINARIES = execveat |
3 | DEPS = execveat.symlink execveat.denatured script | 3 | DEPS = execveat.symlink execveat.denatured script subdir |
4 | all: $(BINARIES) $(DEPS) | 4 | all: $(BINARIES) $(DEPS) |
5 | 5 | ||
6 | subdir: | 6 | subdir: |
@@ -22,7 +22,5 @@ TEST_FILES := $(DEPS) | |||
22 | 22 | ||
23 | include ../lib.mk | 23 | include ../lib.mk |
24 | 24 | ||
25 | override EMIT_TESTS := echo "mkdir -p subdir; (./execveat && echo \"selftests: execveat [PASS]\") || echo \"selftests: execveat [FAIL]\"" | ||
26 | |||
27 | clean: | 25 | clean: |
28 | rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* | 26 | rm -rf $(BINARIES) $(DEPS) subdir.moved execveat.moved xxxxx* |
diff --git a/tools/testing/selftests/ftrace/Makefile b/tools/testing/selftests/ftrace/Makefile index 0acbeca47225..4e6ed13e7f66 100644 --- a/tools/testing/selftests/ftrace/Makefile +++ b/tools/testing/selftests/ftrace/Makefile | |||
@@ -1,7 +1,7 @@ | |||
1 | all: | 1 | all: |
2 | 2 | ||
3 | TEST_PROGS := ftracetest | 3 | TEST_PROGS := ftracetest |
4 | TEST_DIRS := test.d/ | 4 | TEST_DIRS := test.d |
5 | 5 | ||
6 | include ../lib.mk | 6 | include ../lib.mk |
7 | 7 | ||
diff --git a/tools/testing/selftests/lib.mk b/tools/testing/selftests/lib.mk index 97f1c6742066..50a93f5f13d6 100644 --- a/tools/testing/selftests/lib.mk +++ b/tools/testing/selftests/lib.mk | |||
@@ -12,13 +12,10 @@ run_tests: all | |||
12 | $(RUN_TESTS) | 12 | $(RUN_TESTS) |
13 | 13 | ||
14 | define INSTALL_RULE | 14 | define INSTALL_RULE |
15 | @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ | 15 | @if [ "X$(TEST_PROGS)$(TEST_PROGS_EXTENDED)$(TEST_FILES)" != "X" ]; then \ |
16 | mkdir -p $(INSTALL_PATH); \ | 16 | mkdir -p ${INSTALL_PATH}; \ |
17 | for TEST_DIR in $(TEST_DIRS); do \ | 17 | echo "rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/"; \ |
18 | cp -r $$TEST_DIR $(INSTALL_PATH); \ | 18 | rsync -a $(TEST_DIRS) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES) $(INSTALL_PATH)/; \ |
19 | done; \ | ||
20 | echo "install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)"; \ | ||
21 | install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES); \ | ||
22 | fi | 19 | fi |
23 | endef | 20 | endef |
24 | 21 | ||
diff --git a/tools/testing/selftests/mqueue/Makefile b/tools/testing/selftests/mqueue/Makefile index 0e3b41eb85cd..eebac29acbd9 100644 --- a/tools/testing/selftests/mqueue/Makefile +++ b/tools/testing/selftests/mqueue/Makefile | |||
@@ -1,8 +1,8 @@ | |||
1 | CFLAGS = -O2 | 1 | CFLAGS += -O2 |
2 | LDLIBS = -lrt -lpthread -lpopt | ||
3 | TEST_PROGS := mq_open_tests mq_perf_tests | ||
2 | 4 | ||
3 | all: | 5 | all: $(TEST_PROGS) |
4 | $(CC) $(CFLAGS) mq_open_tests.c -o mq_open_tests -lrt | ||
5 | $(CC) $(CFLAGS) -o mq_perf_tests mq_perf_tests.c -lrt -lpthread -lpopt | ||
6 | 6 | ||
7 | include ../lib.mk | 7 | include ../lib.mk |
8 | 8 | ||
@@ -11,8 +11,6 @@ override define RUN_TESTS | |||
11 | @./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]" | 11 | @./mq_perf_tests || echo "selftests: mq_perf_tests [FAIL]" |
12 | endef | 12 | endef |
13 | 13 | ||
14 | TEST_PROGS := mq_open_tests mq_perf_tests | ||
15 | |||
16 | override define EMIT_TESTS | 14 | override define EMIT_TESTS |
17 | echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\"" | 15 | echo "./mq_open_tests /test1 || echo \"selftests: mq_open_tests [FAIL]\"" |
18 | echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\"" | 16 | echo "./mq_perf_tests || echo \"selftests: mq_perf_tests [FAIL]\"" |
diff --git a/tools/testing/selftests/seccomp/seccomp_bpf.c b/tools/testing/selftests/seccomp/seccomp_bpf.c index a004b4cce99e..770f47adf295 100644 --- a/tools/testing/selftests/seccomp/seccomp_bpf.c +++ b/tools/testing/selftests/seccomp/seccomp_bpf.c | |||
@@ -1210,6 +1210,10 @@ TEST_F(TRACE_poke, getpid_runs_normally) | |||
1210 | # define ARCH_REGS struct pt_regs | 1210 | # define ARCH_REGS struct pt_regs |
1211 | # define SYSCALL_NUM gpr[0] | 1211 | # define SYSCALL_NUM gpr[0] |
1212 | # define SYSCALL_RET gpr[3] | 1212 | # define SYSCALL_RET gpr[3] |
1213 | #elif defined(__s390__) | ||
1214 | # define ARCH_REGS s390_regs | ||
1215 | # define SYSCALL_NUM gprs[2] | ||
1216 | # define SYSCALL_RET gprs[2] | ||
1213 | #else | 1217 | #else |
1214 | # error "Do not know how to find your architecture's registers and syscalls" | 1218 | # error "Do not know how to find your architecture's registers and syscalls" |
1215 | #endif | 1219 | #endif |
@@ -1243,7 +1247,8 @@ void change_syscall(struct __test_metadata *_metadata, | |||
1243 | ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov); | 1247 | ret = ptrace(PTRACE_GETREGSET, tracee, NT_PRSTATUS, &iov); |
1244 | EXPECT_EQ(0, ret); | 1248 | EXPECT_EQ(0, ret); |
1245 | 1249 | ||
1246 | #if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || defined(__powerpc__) | 1250 | #if defined(__x86_64__) || defined(__i386__) || defined(__aarch64__) || \ |
1251 | defined(__powerpc__) || defined(__s390__) | ||
1247 | { | 1252 | { |
1248 | regs.SYSCALL_NUM = syscall; | 1253 | regs.SYSCALL_NUM = syscall; |
1249 | } | 1254 | } |
@@ -1281,17 +1286,21 @@ void tracer_syscall(struct __test_metadata *_metadata, pid_t tracee, | |||
1281 | ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); | 1286 | ret = ptrace(PTRACE_GETEVENTMSG, tracee, NULL, &msg); |
1282 | EXPECT_EQ(0, ret); | 1287 | EXPECT_EQ(0, ret); |
1283 | 1288 | ||
1289 | /* Validate and take action on expected syscalls. */ | ||
1284 | switch (msg) { | 1290 | switch (msg) { |
1285 | case 0x1002: | 1291 | case 0x1002: |
1286 | /* change getpid to getppid. */ | 1292 | /* change getpid to getppid. */ |
1293 | EXPECT_EQ(__NR_getpid, get_syscall(_metadata, tracee)); | ||
1287 | change_syscall(_metadata, tracee, __NR_getppid); | 1294 | change_syscall(_metadata, tracee, __NR_getppid); |
1288 | break; | 1295 | break; |
1289 | case 0x1003: | 1296 | case 0x1003: |
1290 | /* skip gettid. */ | 1297 | /* skip gettid. */ |
1298 | EXPECT_EQ(__NR_gettid, get_syscall(_metadata, tracee)); | ||
1291 | change_syscall(_metadata, tracee, -1); | 1299 | change_syscall(_metadata, tracee, -1); |
1292 | break; | 1300 | break; |
1293 | case 0x1004: | 1301 | case 0x1004: |
1294 | /* do nothing (allow getppid) */ | 1302 | /* do nothing (allow getppid) */ |
1303 | EXPECT_EQ(__NR_getppid, get_syscall(_metadata, tracee)); | ||
1295 | break; | 1304 | break; |
1296 | default: | 1305 | default: |
1297 | EXPECT_EQ(0, msg) { | 1306 | EXPECT_EQ(0, msg) { |
@@ -1409,6 +1418,8 @@ TEST_F(TRACE_syscall, syscall_dropped) | |||
1409 | # define __NR_seccomp 277 | 1418 | # define __NR_seccomp 277 |
1410 | # elif defined(__powerpc__) | 1419 | # elif defined(__powerpc__) |
1411 | # define __NR_seccomp 358 | 1420 | # define __NR_seccomp 358 |
1421 | # elif defined(__s390__) | ||
1422 | # define __NR_seccomp 348 | ||
1412 | # else | 1423 | # else |
1413 | # warning "seccomp syscall number unknown for this architecture" | 1424 | # warning "seccomp syscall number unknown for this architecture" |
1414 | # define __NR_seccomp 0xffff | 1425 | # define __NR_seccomp 0xffff |
@@ -1453,6 +1464,9 @@ TEST(seccomp_syscall) | |||
1453 | 1464 | ||
1454 | /* Reject insane operation. */ | 1465 | /* Reject insane operation. */ |
1455 | ret = seccomp(-1, 0, &prog); | 1466 | ret = seccomp(-1, 0, &prog); |
1467 | ASSERT_NE(ENOSYS, errno) { | ||
1468 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1469 | } | ||
1456 | EXPECT_EQ(EINVAL, errno) { | 1470 | EXPECT_EQ(EINVAL, errno) { |
1457 | TH_LOG("Did not reject crazy op value!"); | 1471 | TH_LOG("Did not reject crazy op value!"); |
1458 | } | 1472 | } |
@@ -1501,6 +1515,9 @@ TEST(seccomp_syscall_mode_lock) | |||
1501 | } | 1515 | } |
1502 | 1516 | ||
1503 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); | 1517 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); |
1518 | ASSERT_NE(ENOSYS, errno) { | ||
1519 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1520 | } | ||
1504 | EXPECT_EQ(0, ret) { | 1521 | EXPECT_EQ(0, ret) { |
1505 | TH_LOG("Could not install filter!"); | 1522 | TH_LOG("Could not install filter!"); |
1506 | } | 1523 | } |
@@ -1535,6 +1552,9 @@ TEST(TSYNC_first) | |||
1535 | 1552 | ||
1536 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1553 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, |
1537 | &prog); | 1554 | &prog); |
1555 | ASSERT_NE(ENOSYS, errno) { | ||
1556 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1557 | } | ||
1538 | EXPECT_EQ(0, ret) { | 1558 | EXPECT_EQ(0, ret) { |
1539 | TH_LOG("Could not install initial filter with TSYNC!"); | 1559 | TH_LOG("Could not install initial filter with TSYNC!"); |
1540 | } | 1560 | } |
@@ -1694,6 +1714,9 @@ TEST_F(TSYNC, siblings_fail_prctl) | |||
1694 | 1714 | ||
1695 | /* Check prctl failure detection by requesting sib 0 diverge. */ | 1715 | /* Check prctl failure detection by requesting sib 0 diverge. */ |
1696 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); | 1716 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &prog); |
1717 | ASSERT_NE(ENOSYS, errno) { | ||
1718 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1719 | } | ||
1697 | ASSERT_EQ(0, ret) { | 1720 | ASSERT_EQ(0, ret) { |
1698 | TH_LOG("setting filter failed"); | 1721 | TH_LOG("setting filter failed"); |
1699 | } | 1722 | } |
@@ -1731,6 +1754,9 @@ TEST_F(TSYNC, two_siblings_with_ancestor) | |||
1731 | } | 1754 | } |
1732 | 1755 | ||
1733 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); | 1756 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); |
1757 | ASSERT_NE(ENOSYS, errno) { | ||
1758 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1759 | } | ||
1734 | ASSERT_EQ(0, ret) { | 1760 | ASSERT_EQ(0, ret) { |
1735 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); | 1761 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); |
1736 | } | 1762 | } |
@@ -1805,6 +1831,9 @@ TEST_F(TSYNC, two_siblings_with_no_filter) | |||
1805 | 1831 | ||
1806 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, | 1832 | ret = seccomp(SECCOMP_SET_MODE_FILTER, SECCOMP_FLAG_FILTER_TSYNC, |
1807 | &self->apply_prog); | 1833 | &self->apply_prog); |
1834 | ASSERT_NE(ENOSYS, errno) { | ||
1835 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1836 | } | ||
1808 | ASSERT_EQ(0, ret) { | 1837 | ASSERT_EQ(0, ret) { |
1809 | TH_LOG("Could install filter on all threads!"); | 1838 | TH_LOG("Could install filter on all threads!"); |
1810 | } | 1839 | } |
@@ -1833,6 +1862,9 @@ TEST_F(TSYNC, two_siblings_with_one_divergence) | |||
1833 | } | 1862 | } |
1834 | 1863 | ||
1835 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); | 1864 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); |
1865 | ASSERT_NE(ENOSYS, errno) { | ||
1866 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1867 | } | ||
1836 | ASSERT_EQ(0, ret) { | 1868 | ASSERT_EQ(0, ret) { |
1837 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); | 1869 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); |
1838 | } | 1870 | } |
@@ -1890,6 +1922,9 @@ TEST_F(TSYNC, two_siblings_not_under_filter) | |||
1890 | } | 1922 | } |
1891 | 1923 | ||
1892 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); | 1924 | ret = seccomp(SECCOMP_SET_MODE_FILTER, 0, &self->root_prog); |
1925 | ASSERT_NE(ENOSYS, errno) { | ||
1926 | TH_LOG("Kernel does not support seccomp syscall!"); | ||
1927 | } | ||
1893 | ASSERT_EQ(0, ret) { | 1928 | ASSERT_EQ(0, ret) { |
1894 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); | 1929 | TH_LOG("Kernel does not support SECCOMP_SET_MODE_FILTER!"); |
1895 | } | 1930 | } |
diff --git a/tools/testing/selftests/seccomp/test_harness.h b/tools/testing/selftests/seccomp/test_harness.h index 977a6afc4489..fb2841601f2f 100644 --- a/tools/testing/selftests/seccomp/test_harness.h +++ b/tools/testing/selftests/seccomp/test_harness.h | |||
@@ -370,11 +370,8 @@ | |||
370 | __typeof__(_expected) __exp = (_expected); \ | 370 | __typeof__(_expected) __exp = (_expected); \ |
371 | __typeof__(_seen) __seen = (_seen); \ | 371 | __typeof__(_seen) __seen = (_seen); \ |
372 | if (!(__exp _t __seen)) { \ | 372 | if (!(__exp _t __seen)) { \ |
373 | unsigned long long __exp_print = 0; \ | 373 | unsigned long long __exp_print = (unsigned long long)__exp; \ |
374 | unsigned long long __seen_print = 0; \ | 374 | unsigned long long __seen_print = (unsigned long long)__seen; \ |
375 | /* Avoid casting complaints the scariest way we can. */ \ | ||
376 | memcpy(&__exp_print, &__exp, sizeof(__exp)); \ | ||
377 | memcpy(&__seen_print, &__seen, sizeof(__seen)); \ | ||
378 | __TH_LOG("Expected %s (%llu) %s %s (%llu)", \ | 375 | __TH_LOG("Expected %s (%llu) %s %s (%llu)", \ |
379 | #_expected, __exp_print, #_t, \ | 376 | #_expected, __exp_print, #_t, \ |
380 | #_seen, __seen_print); \ | 377 | #_seen, __seen_print); \ |
diff --git a/tools/testing/selftests/x86/entry_from_vm86.c b/tools/testing/selftests/x86/entry_from_vm86.c index 9a43a59a9bb4..421c607a8856 100644 --- a/tools/testing/selftests/x86/entry_from_vm86.c +++ b/tools/testing/selftests/x86/entry_from_vm86.c | |||
@@ -116,8 +116,9 @@ static bool do_test(struct vm86plus_struct *v86, unsigned long eip, | |||
116 | v86->regs.eip = eip; | 116 | v86->regs.eip = eip; |
117 | ret = vm86(VM86_ENTER, v86); | 117 | ret = vm86(VM86_ENTER, v86); |
118 | 118 | ||
119 | if (ret == -1 && errno == ENOSYS) { | 119 | if (ret == -1 && (errno == ENOSYS || errno == EPERM)) { |
120 | printf("[SKIP]\tvm86 not supported\n"); | 120 | printf("[SKIP]\tvm86 %s\n", |
121 | errno == ENOSYS ? "not supported" : "not allowed"); | ||
121 | return false; | 122 | return false; |
122 | } | 123 | } |
123 | 124 | ||
diff --git a/tools/testing/selftests/zram/zram.sh b/tools/testing/selftests/zram/zram.sh index 20de9a761269..683a292e3290 100755 --- a/tools/testing/selftests/zram/zram.sh +++ b/tools/testing/selftests/zram/zram.sh | |||
@@ -1,15 +1,7 @@ | |||
1 | #!/bin/bash | 1 | #!/bin/bash |
2 | TCID="zram.sh" | 2 | TCID="zram.sh" |
3 | 3 | ||
4 | check_prereqs() | 4 | . ./zram_lib.sh |
5 | { | ||
6 | local msg="skip all tests:" | ||
7 | |||
8 | if [ $UID != 0 ]; then | ||
9 | echo $msg must be run as root >&2 | ||
10 | exit 0 | ||
11 | fi | ||
12 | } | ||
13 | 5 | ||
14 | run_zram () { | 6 | run_zram () { |
15 | echo "--------------------" | 7 | echo "--------------------" |
diff --git a/tools/testing/selftests/zram/zram_lib.sh b/tools/testing/selftests/zram/zram_lib.sh index 424e68ed1487..f6a9c73e7a44 100755 --- a/tools/testing/selftests/zram/zram_lib.sh +++ b/tools/testing/selftests/zram/zram_lib.sh | |||
@@ -23,8 +23,9 @@ trap INT | |||
23 | check_prereqs() | 23 | check_prereqs() |
24 | { | 24 | { |
25 | local msg="skip all tests:" | 25 | local msg="skip all tests:" |
26 | local uid=$(id -u) | ||
26 | 27 | ||
27 | if [ $UID != 0 ]; then | 28 | if [ $uid -ne 0 ]; then |
28 | echo $msg must be run as root >&2 | 29 | echo $msg must be run as root >&2 |
29 | exit 0 | 30 | exit 0 |
30 | fi | 31 | fi |
diff --git a/tools/virtio/Makefile b/tools/virtio/Makefile index 505ad51b3b51..39c89a5ea990 100644 --- a/tools/virtio/Makefile +++ b/tools/virtio/Makefile | |||
@@ -6,7 +6,7 @@ vringh_test: vringh_test.o vringh.o virtio_ring.o | |||
6 | CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE | 6 | CFLAGS += -g -O2 -Werror -Wall -I. -I../include/ -I ../../usr/include/ -Wno-pointer-sign -fno-strict-overflow -fno-strict-aliasing -fno-common -MMD -U_FORTIFY_SOURCE |
7 | vpath %.c ../../drivers/virtio ../../drivers/vhost | 7 | vpath %.c ../../drivers/virtio ../../drivers/vhost |
8 | mod: | 8 | mod: |
9 | ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test | 9 | ${MAKE} -C `pwd`/../.. M=`pwd`/vhost_test V=${V} |
10 | .PHONY: all test mod clean | 10 | .PHONY: all test mod clean |
11 | clean: | 11 | clean: |
12 | ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \ | 12 | ${RM} *.o vringh_test virtio_test vhost_test/*.o vhost_test/.*.cmd \ |
diff --git a/tools/virtio/asm/barrier.h b/tools/virtio/asm/barrier.h index aff61e13306c..26b7926bda88 100644 --- a/tools/virtio/asm/barrier.h +++ b/tools/virtio/asm/barrier.h | |||
@@ -3,6 +3,8 @@ | |||
3 | #define mb() __sync_synchronize() | 3 | #define mb() __sync_synchronize() |
4 | 4 | ||
5 | #define smp_mb() mb() | 5 | #define smp_mb() mb() |
6 | # define dma_rmb() barrier() | ||
7 | # define dma_wmb() barrier() | ||
6 | # define smp_rmb() barrier() | 8 | # define smp_rmb() barrier() |
7 | # define smp_wmb() barrier() | 9 | # define smp_wmb() barrier() |
8 | /* Weak barriers should be used. If not - it's a bug */ | 10 | /* Weak barriers should be used. If not - it's a bug */ |
diff --git a/tools/virtio/linux/export.h b/tools/virtio/linux/export.h new file mode 100644 index 000000000000..416875e29254 --- /dev/null +++ b/tools/virtio/linux/export.h | |||
@@ -0,0 +1,3 @@ | |||
1 | #define EXPORT_SYMBOL_GPL(sym) extern typeof(sym) sym | ||
2 | #define EXPORT_SYMBOL(sym) extern typeof(sym) sym | ||
3 | |||
diff --git a/tools/virtio/linux/kernel.h b/tools/virtio/linux/kernel.h index 1e8ce6979c1e..0a3da64638ce 100644 --- a/tools/virtio/linux/kernel.h +++ b/tools/virtio/linux/kernel.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | typedef unsigned long long dma_addr_t; | 23 | typedef unsigned long long dma_addr_t; |
24 | typedef size_t __kernel_size_t; | 24 | typedef size_t __kernel_size_t; |
25 | typedef unsigned int __wsum; | ||
25 | 26 | ||
26 | struct page { | 27 | struct page { |
27 | unsigned long long dummy; | 28 | unsigned long long dummy; |
@@ -47,6 +48,13 @@ static inline void *kmalloc(size_t s, gfp_t gfp) | |||
47 | return __kmalloc_fake; | 48 | return __kmalloc_fake; |
48 | return malloc(s); | 49 | return malloc(s); |
49 | } | 50 | } |
51 | static inline void *kzalloc(size_t s, gfp_t gfp) | ||
52 | { | ||
53 | void *p = kmalloc(s, gfp); | ||
54 | |||
55 | memset(p, 0, s); | ||
56 | return p; | ||
57 | } | ||
50 | 58 | ||
51 | static inline void kfree(void *p) | 59 | static inline void kfree(void *p) |
52 | { | 60 | { |
diff --git a/virt/kvm/arm/arch_timer.c b/virt/kvm/arm/arch_timer.c index 76e38d231e99..48c6e1ac6827 100644 --- a/virt/kvm/arm/arch_timer.c +++ b/virt/kvm/arm/arch_timer.c | |||
@@ -200,6 +200,14 @@ int kvm_timer_vcpu_reset(struct kvm_vcpu *vcpu, | |||
200 | timer->irq = irq; | 200 | timer->irq = irq; |
201 | 201 | ||
202 | /* | 202 | /* |
203 | * The bits in CNTV_CTL are architecturally reset to UNKNOWN for ARMv8 | ||
204 | * and to 0 for ARMv7. We provide an implementation that always | ||
205 | * resets the timer to be disabled and unmasked and is compliant with | ||
206 | * the ARMv7 architecture. | ||
207 | */ | ||
208 | timer->cntv_ctl = 0; | ||
209 | |||
210 | /* | ||
203 | * Tell the VGIC that the virtual interrupt is tied to a | 211 | * Tell the VGIC that the virtual interrupt is tied to a |
204 | * physical interrupt. We do that once per VCPU. | 212 | * physical interrupt. We do that once per VCPU. |
205 | */ | 213 | */ |
diff --git a/virt/kvm/arm/vgic-v3.c b/virt/kvm/arm/vgic-v3.c index afbf925b00f4..7dd5d62f10a1 100644 --- a/virt/kvm/arm/vgic-v3.c +++ b/virt/kvm/arm/vgic-v3.c | |||
@@ -288,7 +288,7 @@ int vgic_v3_probe(struct device_node *vgic_node, | |||
288 | 288 | ||
289 | vgic->vctrl_base = NULL; | 289 | vgic->vctrl_base = NULL; |
290 | vgic->type = VGIC_V3; | 290 | vgic->type = VGIC_V3; |
291 | vgic->max_gic_vcpus = KVM_MAX_VCPUS; | 291 | vgic->max_gic_vcpus = VGIC_V3_MAX_CPUS; |
292 | 292 | ||
293 | kvm_info("%s@%llx IRQ%d\n", vgic_node->name, | 293 | kvm_info("%s@%llx IRQ%d\n", vgic_node->name, |
294 | vcpu_res.start, vgic->maint_irq); | 294 | vcpu_res.start, vgic->maint_irq); |
diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c index 9eb489a2c94c..6bd1c9bf7ae7 100644 --- a/virt/kvm/arm/vgic.c +++ b/virt/kvm/arm/vgic.c | |||
@@ -1144,26 +1144,11 @@ static void vgic_queue_irq_to_lr(struct kvm_vcpu *vcpu, int irq, | |||
1144 | struct irq_phys_map *map; | 1144 | struct irq_phys_map *map; |
1145 | map = vgic_irq_map_search(vcpu, irq); | 1145 | map = vgic_irq_map_search(vcpu, irq); |
1146 | 1146 | ||
1147 | /* | ||
1148 | * If we have a mapping, and the virtual interrupt is | ||
1149 | * being injected, then we must set the state to | ||
1150 | * active in the physical world. Otherwise the | ||
1151 | * physical interrupt will fire and the guest will | ||
1152 | * exit before processing the virtual interrupt. | ||
1153 | */ | ||
1154 | if (map) { | 1147 | if (map) { |
1155 | int ret; | ||
1156 | |||
1157 | BUG_ON(!map->active); | ||
1158 | vlr.hwirq = map->phys_irq; | 1148 | vlr.hwirq = map->phys_irq; |
1159 | vlr.state |= LR_HW; | 1149 | vlr.state |= LR_HW; |
1160 | vlr.state &= ~LR_EOI_INT; | 1150 | vlr.state &= ~LR_EOI_INT; |
1161 | 1151 | ||
1162 | ret = irq_set_irqchip_state(map->irq, | ||
1163 | IRQCHIP_STATE_ACTIVE, | ||
1164 | true); | ||
1165 | WARN_ON(ret); | ||
1166 | |||
1167 | /* | 1152 | /* |
1168 | * Make sure we're not going to sample this | 1153 | * Make sure we're not going to sample this |
1169 | * again, as a HW-backed interrupt cannot be | 1154 | * again, as a HW-backed interrupt cannot be |
@@ -1255,7 +1240,7 @@ static void __kvm_vgic_flush_hwstate(struct kvm_vcpu *vcpu) | |||
1255 | struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; | 1240 | struct vgic_cpu *vgic_cpu = &vcpu->arch.vgic_cpu; |
1256 | struct vgic_dist *dist = &vcpu->kvm->arch.vgic; | 1241 | struct vgic_dist *dist = &vcpu->kvm->arch.vgic; |
1257 | unsigned long *pa_percpu, *pa_shared; | 1242 | unsigned long *pa_percpu, *pa_shared; |
1258 | int i, vcpu_id; | 1243 | int i, vcpu_id, lr, ret; |
1259 | int overflow = 0; | 1244 | int overflow = 0; |
1260 | int nr_shared = vgic_nr_shared_irqs(dist); | 1245 | int nr_shared = vgic_nr_shared_irqs(dist); |
1261 | 1246 | ||
@@ -1310,6 +1295,31 @@ epilog: | |||
1310 | */ | 1295 | */ |
1311 | clear_bit(vcpu_id, dist->irq_pending_on_cpu); | 1296 | clear_bit(vcpu_id, dist->irq_pending_on_cpu); |
1312 | } | 1297 | } |
1298 | |||
1299 | for (lr = 0; lr < vgic->nr_lr; lr++) { | ||
1300 | struct vgic_lr vlr; | ||
1301 | |||
1302 | if (!test_bit(lr, vgic_cpu->lr_used)) | ||
1303 | continue; | ||
1304 | |||
1305 | vlr = vgic_get_lr(vcpu, lr); | ||
1306 | |||
1307 | /* | ||
1308 | * If we have a mapping, and the virtual interrupt is | ||
1309 | * presented to the guest (as pending or active), then we must | ||
1310 | * set the state to active in the physical world. See | ||
1311 | * Documentation/virtual/kvm/arm/vgic-mapped-irqs.txt. | ||
1312 | */ | ||
1313 | if (vlr.state & LR_HW) { | ||
1314 | struct irq_phys_map *map; | ||
1315 | map = vgic_irq_map_search(vcpu, vlr.irq); | ||
1316 | |||
1317 | ret = irq_set_irqchip_state(map->irq, | ||
1318 | IRQCHIP_STATE_ACTIVE, | ||
1319 | true); | ||
1320 | WARN_ON(ret); | ||
1321 | } | ||
1322 | } | ||
1313 | } | 1323 | } |
1314 | 1324 | ||
1315 | static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) | 1325 | static bool vgic_process_maintenance(struct kvm_vcpu *vcpu) |
diff --git a/virt/kvm/coalesced_mmio.h b/virt/kvm/coalesced_mmio.h index 5cbf190d238c..6bca74ca5331 100644 --- a/virt/kvm/coalesced_mmio.h +++ b/virt/kvm/coalesced_mmio.h | |||
@@ -24,9 +24,9 @@ struct kvm_coalesced_mmio_dev { | |||
24 | int kvm_coalesced_mmio_init(struct kvm *kvm); | 24 | int kvm_coalesced_mmio_init(struct kvm *kvm); |
25 | void kvm_coalesced_mmio_free(struct kvm *kvm); | 25 | void kvm_coalesced_mmio_free(struct kvm *kvm); |
26 | int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm, | 26 | int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm, |
27 | struct kvm_coalesced_mmio_zone *zone); | 27 | struct kvm_coalesced_mmio_zone *zone); |
28 | int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm, | 28 | int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm, |
29 | struct kvm_coalesced_mmio_zone *zone); | 29 | struct kvm_coalesced_mmio_zone *zone); |
30 | 30 | ||
31 | #else | 31 | #else |
32 | 32 | ||
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index 9ff4193dfa49..79db45336e3a 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c | |||
@@ -771,40 +771,14 @@ static enum kvm_bus ioeventfd_bus_from_flags(__u32 flags) | |||
771 | return KVM_MMIO_BUS; | 771 | return KVM_MMIO_BUS; |
772 | } | 772 | } |
773 | 773 | ||
774 | static int | 774 | static int kvm_assign_ioeventfd_idx(struct kvm *kvm, |
775 | kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 775 | enum kvm_bus bus_idx, |
776 | struct kvm_ioeventfd *args) | ||
776 | { | 777 | { |
777 | enum kvm_bus bus_idx; | ||
778 | struct _ioeventfd *p; | ||
779 | struct eventfd_ctx *eventfd; | ||
780 | int ret; | ||
781 | |||
782 | bus_idx = ioeventfd_bus_from_flags(args->flags); | ||
783 | /* must be natural-word sized, or 0 to ignore length */ | ||
784 | switch (args->len) { | ||
785 | case 0: | ||
786 | case 1: | ||
787 | case 2: | ||
788 | case 4: | ||
789 | case 8: | ||
790 | break; | ||
791 | default: | ||
792 | return -EINVAL; | ||
793 | } | ||
794 | |||
795 | /* check for range overflow */ | ||
796 | if (args->addr + args->len < args->addr) | ||
797 | return -EINVAL; | ||
798 | 778 | ||
799 | /* check for extra flags that we don't understand */ | 779 | struct eventfd_ctx *eventfd; |
800 | if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK) | 780 | struct _ioeventfd *p; |
801 | return -EINVAL; | 781 | int ret; |
802 | |||
803 | /* ioeventfd with no length can't be combined with DATAMATCH */ | ||
804 | if (!args->len && | ||
805 | args->flags & (KVM_IOEVENTFD_FLAG_PIO | | ||
806 | KVM_IOEVENTFD_FLAG_DATAMATCH)) | ||
807 | return -EINVAL; | ||
808 | 782 | ||
809 | eventfd = eventfd_ctx_fdget(args->fd); | 783 | eventfd = eventfd_ctx_fdget(args->fd); |
810 | if (IS_ERR(eventfd)) | 784 | if (IS_ERR(eventfd)) |
@@ -843,16 +817,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
843 | if (ret < 0) | 817 | if (ret < 0) |
844 | goto unlock_fail; | 818 | goto unlock_fail; |
845 | 819 | ||
846 | /* When length is ignored, MMIO is also put on a separate bus, for | ||
847 | * faster lookups. | ||
848 | */ | ||
849 | if (!args->len && !(args->flags & KVM_IOEVENTFD_FLAG_PIO)) { | ||
850 | ret = kvm_io_bus_register_dev(kvm, KVM_FAST_MMIO_BUS, | ||
851 | p->addr, 0, &p->dev); | ||
852 | if (ret < 0) | ||
853 | goto register_fail; | ||
854 | } | ||
855 | |||
856 | kvm->buses[bus_idx]->ioeventfd_count++; | 820 | kvm->buses[bus_idx]->ioeventfd_count++; |
857 | list_add_tail(&p->list, &kvm->ioeventfds); | 821 | list_add_tail(&p->list, &kvm->ioeventfds); |
858 | 822 | ||
@@ -860,8 +824,6 @@ kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
860 | 824 | ||
861 | return 0; | 825 | return 0; |
862 | 826 | ||
863 | register_fail: | ||
864 | kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev); | ||
865 | unlock_fail: | 827 | unlock_fail: |
866 | mutex_unlock(&kvm->slots_lock); | 828 | mutex_unlock(&kvm->slots_lock); |
867 | 829 | ||
@@ -873,14 +835,13 @@ fail: | |||
873 | } | 835 | } |
874 | 836 | ||
875 | static int | 837 | static int |
876 | kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 838 | kvm_deassign_ioeventfd_idx(struct kvm *kvm, enum kvm_bus bus_idx, |
839 | struct kvm_ioeventfd *args) | ||
877 | { | 840 | { |
878 | enum kvm_bus bus_idx; | ||
879 | struct _ioeventfd *p, *tmp; | 841 | struct _ioeventfd *p, *tmp; |
880 | struct eventfd_ctx *eventfd; | 842 | struct eventfd_ctx *eventfd; |
881 | int ret = -ENOENT; | 843 | int ret = -ENOENT; |
882 | 844 | ||
883 | bus_idx = ioeventfd_bus_from_flags(args->flags); | ||
884 | eventfd = eventfd_ctx_fdget(args->fd); | 845 | eventfd = eventfd_ctx_fdget(args->fd); |
885 | if (IS_ERR(eventfd)) | 846 | if (IS_ERR(eventfd)) |
886 | return PTR_ERR(eventfd); | 847 | return PTR_ERR(eventfd); |
@@ -901,10 +862,6 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
901 | continue; | 862 | continue; |
902 | 863 | ||
903 | kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev); | 864 | kvm_io_bus_unregister_dev(kvm, bus_idx, &p->dev); |
904 | if (!p->length) { | ||
905 | kvm_io_bus_unregister_dev(kvm, KVM_FAST_MMIO_BUS, | ||
906 | &p->dev); | ||
907 | } | ||
908 | kvm->buses[bus_idx]->ioeventfd_count--; | 865 | kvm->buses[bus_idx]->ioeventfd_count--; |
909 | ioeventfd_release(p); | 866 | ioeventfd_release(p); |
910 | ret = 0; | 867 | ret = 0; |
@@ -918,6 +875,71 @@ kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | |||
918 | return ret; | 875 | return ret; |
919 | } | 876 | } |
920 | 877 | ||
878 | static int kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | ||
879 | { | ||
880 | enum kvm_bus bus_idx = ioeventfd_bus_from_flags(args->flags); | ||
881 | int ret = kvm_deassign_ioeventfd_idx(kvm, bus_idx, args); | ||
882 | |||
883 | if (!args->len && bus_idx == KVM_MMIO_BUS) | ||
884 | kvm_deassign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args); | ||
885 | |||
886 | return ret; | ||
887 | } | ||
888 | |||
889 | static int | ||
890 | kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | ||
891 | { | ||
892 | enum kvm_bus bus_idx; | ||
893 | int ret; | ||
894 | |||
895 | bus_idx = ioeventfd_bus_from_flags(args->flags); | ||
896 | /* must be natural-word sized, or 0 to ignore length */ | ||
897 | switch (args->len) { | ||
898 | case 0: | ||
899 | case 1: | ||
900 | case 2: | ||
901 | case 4: | ||
902 | case 8: | ||
903 | break; | ||
904 | default: | ||
905 | return -EINVAL; | ||
906 | } | ||
907 | |||
908 | /* check for range overflow */ | ||
909 | if (args->addr + args->len < args->addr) | ||
910 | return -EINVAL; | ||
911 | |||
912 | /* check for extra flags that we don't understand */ | ||
913 | if (args->flags & ~KVM_IOEVENTFD_VALID_FLAG_MASK) | ||
914 | return -EINVAL; | ||
915 | |||
916 | /* ioeventfd with no length can't be combined with DATAMATCH */ | ||
917 | if (!args->len && | ||
918 | args->flags & (KVM_IOEVENTFD_FLAG_PIO | | ||
919 | KVM_IOEVENTFD_FLAG_DATAMATCH)) | ||
920 | return -EINVAL; | ||
921 | |||
922 | ret = kvm_assign_ioeventfd_idx(kvm, bus_idx, args); | ||
923 | if (ret) | ||
924 | goto fail; | ||
925 | |||
926 | /* When length is ignored, MMIO is also put on a separate bus, for | ||
927 | * faster lookups. | ||
928 | */ | ||
929 | if (!args->len && bus_idx == KVM_MMIO_BUS) { | ||
930 | ret = kvm_assign_ioeventfd_idx(kvm, KVM_FAST_MMIO_BUS, args); | ||
931 | if (ret < 0) | ||
932 | goto fast_fail; | ||
933 | } | ||
934 | |||
935 | return 0; | ||
936 | |||
937 | fast_fail: | ||
938 | kvm_deassign_ioeventfd_idx(kvm, bus_idx, args); | ||
939 | fail: | ||
940 | return ret; | ||
941 | } | ||
942 | |||
921 | int | 943 | int |
922 | kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) | 944 | kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args) |
923 | { | 945 | { |
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index a25a73147f71..04146a2e1d81 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c | |||
@@ -2004,6 +2004,7 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu) | |||
2004 | if (vcpu->halt_poll_ns) { | 2004 | if (vcpu->halt_poll_ns) { |
2005 | ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns); | 2005 | ktime_t stop = ktime_add_ns(ktime_get(), vcpu->halt_poll_ns); |
2006 | 2006 | ||
2007 | ++vcpu->stat.halt_attempted_poll; | ||
2007 | do { | 2008 | do { |
2008 | /* | 2009 | /* |
2009 | * This sets KVM_REQ_UNHALT if an interrupt | 2010 | * This sets KVM_REQ_UNHALT if an interrupt |
@@ -2043,7 +2044,8 @@ out: | |||
2043 | else if (vcpu->halt_poll_ns < halt_poll_ns && | 2044 | else if (vcpu->halt_poll_ns < halt_poll_ns && |
2044 | block_ns < halt_poll_ns) | 2045 | block_ns < halt_poll_ns) |
2045 | grow_halt_poll_ns(vcpu); | 2046 | grow_halt_poll_ns(vcpu); |
2046 | } | 2047 | } else |
2048 | vcpu->halt_poll_ns = 0; | ||
2047 | 2049 | ||
2048 | trace_kvm_vcpu_wakeup(block_ns, waited); | 2050 | trace_kvm_vcpu_wakeup(block_ns, waited); |
2049 | } | 2051 | } |
@@ -3156,10 +3158,25 @@ static void kvm_io_bus_destroy(struct kvm_io_bus *bus) | |||
3156 | static inline int kvm_io_bus_cmp(const struct kvm_io_range *r1, | 3158 | static inline int kvm_io_bus_cmp(const struct kvm_io_range *r1, |
3157 | const struct kvm_io_range *r2) | 3159 | const struct kvm_io_range *r2) |
3158 | { | 3160 | { |
3159 | if (r1->addr < r2->addr) | 3161 | gpa_t addr1 = r1->addr; |
3162 | gpa_t addr2 = r2->addr; | ||
3163 | |||
3164 | if (addr1 < addr2) | ||
3160 | return -1; | 3165 | return -1; |
3161 | if (r1->addr + r1->len > r2->addr + r2->len) | 3166 | |
3167 | /* If r2->len == 0, match the exact address. If r2->len != 0, | ||
3168 | * accept any overlapping write. Any order is acceptable for | ||
3169 | * overlapping ranges, because kvm_io_bus_get_first_dev ensures | ||
3170 | * we process all of them. | ||
3171 | */ | ||
3172 | if (r2->len) { | ||
3173 | addr1 += r1->len; | ||
3174 | addr2 += r2->len; | ||
3175 | } | ||
3176 | |||
3177 | if (addr1 > addr2) | ||
3162 | return 1; | 3178 | return 1; |
3179 | |||
3163 | return 0; | 3180 | return 0; |
3164 | } | 3181 | } |
3165 | 3182 | ||