diff options
365 files changed, 2352 insertions, 4211 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index c3b1430cf603..0bc8b0b2e103 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -316,3 +316,11 @@ Why: The option/code is | |||
316 | Who: Johannes Berg <johannes@sipsolutions.net> | 316 | Who: Johannes Berg <johannes@sipsolutions.net> |
317 | 317 | ||
318 | --------------------------- | 318 | --------------------------- |
319 | |||
320 | What: i8xx_tco watchdog driver | ||
321 | When: in 2.6.22 | ||
322 | Why: the i8xx_tco watchdog driver has been replaced by the iTCO_wdt | ||
323 | watchdog driver. | ||
324 | Who: Wim Van Sebroeck <wim@iguana.be> | ||
325 | |||
326 | --------------------------- | ||
diff --git a/Documentation/gpio.txt b/Documentation/gpio.txt index 576ce463cf44..989f1130f4f3 100644 --- a/Documentation/gpio.txt +++ b/Documentation/gpio.txt | |||
@@ -105,12 +105,15 @@ setting up a platform_device using the GPIO, is mark its direction: | |||
105 | 105 | ||
106 | /* set as input or output, returning 0 or negative errno */ | 106 | /* set as input or output, returning 0 or negative errno */ |
107 | int gpio_direction_input(unsigned gpio); | 107 | int gpio_direction_input(unsigned gpio); |
108 | int gpio_direction_output(unsigned gpio); | 108 | int gpio_direction_output(unsigned gpio, int value); |
109 | 109 | ||
110 | The return value is zero for success, else a negative errno. It should | 110 | The return value is zero for success, else a negative errno. It should |
111 | be checked, since the get/set calls don't have error returns and since | 111 | be checked, since the get/set calls don't have error returns and since |
112 | misconfiguration is possible. (These calls could sleep.) | 112 | misconfiguration is possible. (These calls could sleep.) |
113 | 113 | ||
114 | For output GPIOs, the value provided becomes the initial output value. | ||
115 | This helps avoid signal glitching during system startup. | ||
116 | |||
114 | Setting the direction can fail if the GPIO number is invalid, or when | 117 | Setting the direction can fail if the GPIO number is invalid, or when |
115 | that particular GPIO can't be used in that mode. It's generally a bad | 118 | that particular GPIO can't be used in that mode. It's generally a bad |
116 | idea to rely on boot firmware to have set the direction correctly, since | 119 | idea to rely on boot firmware to have set the direction correctly, since |
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt index db398a6441c1..73e9a174b642 100644 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ b/Documentation/sound/alsa/ALSA-Configuration.txt | |||
@@ -866,6 +866,7 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
866 | basic 3-jack (default) | 866 | basic 3-jack (default) |
867 | hp HP nx6320 | 867 | hp HP nx6320 |
868 | thinkpad Lenovo Thinkpad T60/X60/Z60 | 868 | thinkpad Lenovo Thinkpad T60/X60/Z60 |
869 | toshiba Toshiba U205 | ||
869 | 870 | ||
870 | AD1986A | 871 | AD1986A |
871 | 6stack 6-jack, separate surrounds (default) | 872 | 6stack 6-jack, separate surrounds (default) |
@@ -906,7 +907,8 @@ Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | |||
906 | 5stack D945 5stack + SPDIF | 907 | 5stack D945 5stack + SPDIF |
907 | macmini Intel Mac Mini | 908 | macmini Intel Mac Mini |
908 | macbook Intel Mac Book | 909 | macbook Intel Mac Book |
909 | macbook-pro Intel Mac Book Pro | 910 | macbook-pro-v1 Intel Mac Book Pro 1st generation |
911 | macbook-pro Intel Mac Book Pro 2nd generation | ||
910 | 912 | ||
911 | STAC9202/9250/9251 | 913 | STAC9202/9250/9251 |
912 | ref Reference board, base config | 914 | ref Reference board, base config |
diff --git a/MAINTAINERS b/MAINTAINERS index f3a79d4ef7fd..dd6978b1e8fb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3102,6 +3102,9 @@ TPM DEVICE DRIVER | |||
3102 | P: Kylene Hall | 3102 | P: Kylene Hall |
3103 | M: kjhall@us.ibm.com | 3103 | M: kjhall@us.ibm.com |
3104 | W: http://tpmdd.sourceforge.net | 3104 | W: http://tpmdd.sourceforge.net |
3105 | P: Marcel Selhorst | ||
3106 | M: tpm@selhorst.net | ||
3107 | W: http://www.prosec.rub.de/tpm/ | ||
3105 | L: tpmdd-devel@lists.sourceforge.net | 3108 | L: tpmdd-devel@lists.sourceforge.net |
3106 | S: Maintained | 3109 | S: Maintained |
3107 | 3110 | ||
@@ -1,8 +1,8 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 21 | 3 | SUBLEVEL = 21 |
4 | EXTRAVERSION = -rc3 | 4 | EXTRAVERSION = -rc4 |
5 | NAME = Homicidal Dwarf Hamster | 5 | NAME = Nocturnal Monster Puppy |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
8 | # To see a list of typical targets execute "make help" | 8 | # To see a list of typical targets execute "make help" |
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 5e34ca6d38b6..3e073467caca 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
@@ -28,6 +28,7 @@ config SHARP_PARAM | |||
28 | 28 | ||
29 | config SHARPSL_PM | 29 | config SHARPSL_PM |
30 | bool | 30 | bool |
31 | select APM_EMULATION | ||
31 | 32 | ||
32 | config SHARP_SCOOP | 33 | config SHARP_SCOOP |
33 | bool | 34 | bool |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 03e37af315d7..0453dcc757b4 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -839,8 +839,11 @@ static int __init topology_init(void) | |||
839 | { | 839 | { |
840 | int cpu; | 840 | int cpu; |
841 | 841 | ||
842 | for_each_possible_cpu(cpu) | 842 | for_each_possible_cpu(cpu) { |
843 | register_cpu(&per_cpu(cpu_data, cpu).cpu, cpu); | 843 | struct cpuinfo_arm *cpuinfo = &per_cpu(cpu_data, cpu); |
844 | cpuinfo->cpu.hotpluggable = 1; | ||
845 | register_cpu(&cpuinfo->cpu, cpu); | ||
846 | } | ||
844 | 847 | ||
845 | return 0; | 848 | return 0; |
846 | } | 849 | } |
diff --git a/arch/arm/mach-at91/gpio.c b/arch/arm/mach-at91/gpio.c index 44211a0af19a..ba4a1bb3ee40 100644 --- a/arch/arm/mach-at91/gpio.c +++ b/arch/arm/mach-at91/gpio.c | |||
@@ -215,13 +215,14 @@ int gpio_direction_input(unsigned pin) | |||
215 | } | 215 | } |
216 | EXPORT_SYMBOL(gpio_direction_input); | 216 | EXPORT_SYMBOL(gpio_direction_input); |
217 | 217 | ||
218 | int gpio_direction_output(unsigned pin) | 218 | int gpio_direction_output(unsigned pin, int value) |
219 | { | 219 | { |
220 | void __iomem *pio = pin_to_controller(pin); | 220 | void __iomem *pio = pin_to_controller(pin); |
221 | unsigned mask = pin_to_mask(pin); | 221 | unsigned mask = pin_to_mask(pin); |
222 | 222 | ||
223 | if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) | 223 | if (!pio || !(__raw_readl(pio + PIO_PSR) & mask)) |
224 | return -EINVAL; | 224 | return -EINVAL; |
225 | __raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR)); | ||
225 | __raw_writel(mask, pio + PIO_OER); | 226 | __raw_writel(mask, pio + PIO_OER); |
226 | return 0; | 227 | return 0; |
227 | } | 228 | } |
diff --git a/arch/arm/mach-imx/cpufreq.c b/arch/arm/mach-imx/cpufreq.c index 4f66e90db74f..7e70e0b0b989 100644 --- a/arch/arm/mach-imx/cpufreq.c +++ b/arch/arm/mach-imx/cpufreq.c | |||
@@ -50,6 +50,7 @@ | |||
50 | #define CR_920T_ASYNC_MODE 0xC0000000 | 50 | #define CR_920T_ASYNC_MODE 0xC0000000 |
51 | 51 | ||
52 | static u32 mpctl0_at_boot; | 52 | static u32 mpctl0_at_boot; |
53 | static u32 bclk_div_at_boot; | ||
53 | 54 | ||
54 | static void imx_set_async_mode(void) | 55 | static void imx_set_async_mode(void) |
55 | { | 56 | { |
@@ -82,13 +83,13 @@ static void imx_set_mpctl0(u32 mpctl0) | |||
82 | * imx_compute_mpctl - compute new PLL parameters | 83 | * imx_compute_mpctl - compute new PLL parameters |
83 | * @new_mpctl: pointer to location assigned by new PLL control register value | 84 | * @new_mpctl: pointer to location assigned by new PLL control register value |
84 | * @cur_mpctl: current PLL control register parameters | 85 | * @cur_mpctl: current PLL control register parameters |
86 | * @f_ref: reference source frequency Hz | ||
85 | * @freq: required frequency in Hz | 87 | * @freq: required frequency in Hz |
86 | * @relation: is one of %CPUFREQ_RELATION_L (supremum) | 88 | * @relation: is one of %CPUFREQ_RELATION_L (supremum) |
87 | * and %CPUFREQ_RELATION_H (infimum) | 89 | * and %CPUFREQ_RELATION_H (infimum) |
88 | */ | 90 | */ |
89 | long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, unsigned long freq, int relation) | 91 | long imx_compute_mpctl(u32 *new_mpctl, u32 cur_mpctl, u32 f_ref, unsigned long freq, int relation) |
90 | { | 92 | { |
91 | u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512); | ||
92 | u32 mfi; | 93 | u32 mfi; |
93 | u32 mfn; | 94 | u32 mfn; |
94 | u32 mfd; | 95 | u32 mfd; |
@@ -182,7 +183,7 @@ static int imx_set_target(struct cpufreq_policy *policy, | |||
182 | unsigned long flags; | 183 | unsigned long flags; |
183 | long freq; | 184 | long freq; |
184 | long sysclk; | 185 | long sysclk; |
185 | unsigned int bclk_div = 1; | 186 | unsigned int bclk_div = bclk_div_at_boot; |
186 | 187 | ||
187 | /* | 188 | /* |
188 | * Some governors do not respects CPU and policy lower limits | 189 | * Some governors do not respects CPU and policy lower limits |
@@ -202,8 +203,8 @@ static int imx_set_target(struct cpufreq_policy *policy, | |||
202 | 203 | ||
203 | sysclk = imx_get_system_clk(); | 204 | sysclk = imx_get_system_clk(); |
204 | 205 | ||
205 | if (freq > sysclk + 1000000) { | 206 | if (freq > sysclk / bclk_div_at_boot + 1000000) { |
206 | freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, freq, relation); | 207 | freq = imx_compute_mpctl(&mpctl0, mpctl0_at_boot, CLK32 * 512, freq, relation); |
207 | if (freq < 0) { | 208 | if (freq < 0) { |
208 | printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq); | 209 | printk(KERN_WARNING "imx: target frequency %ld Hz cannot be set\n", freq); |
209 | return -EINVAL; | 210 | return -EINVAL; |
@@ -217,6 +218,8 @@ static int imx_set_target(struct cpufreq_policy *policy, | |||
217 | 218 | ||
218 | if(bclk_div > 16) | 219 | if(bclk_div > 16) |
219 | bclk_div = 16; | 220 | bclk_div = 16; |
221 | if(bclk_div < bclk_div_at_boot) | ||
222 | bclk_div = bclk_div_at_boot; | ||
220 | } | 223 | } |
221 | freq = (sysclk + bclk_div / 2) / bclk_div; | 224 | freq = (sysclk + bclk_div / 2) / bclk_div; |
222 | } | 225 | } |
@@ -285,7 +288,7 @@ static struct cpufreq_driver imx_driver = { | |||
285 | 288 | ||
286 | static int __init imx_cpufreq_init(void) | 289 | static int __init imx_cpufreq_init(void) |
287 | { | 290 | { |
288 | 291 | bclk_div_at_boot = __mfld2val(CSCR_BCLK_DIV, CSCR) + 1; | |
289 | mpctl0_at_boot = 0; | 292 | mpctl0_at_boot = 0; |
290 | 293 | ||
291 | if((CSCR & CSCR_MPEN) && | 294 | if((CSCR & CSCR_MPEN) && |
diff --git a/arch/arm/mach-imx/generic.c b/arch/arm/mach-imx/generic.c index b5aa49d00ca3..7a7fa51ec62c 100644 --- a/arch/arm/mach-imx/generic.c +++ b/arch/arm/mach-imx/generic.c | |||
@@ -102,7 +102,7 @@ EXPORT_SYMBOL(imx_gpio_mode); | |||
102 | * f = 2 * f_ref * -------------------- | 102 | * f = 2 * f_ref * -------------------- |
103 | * pd + 1 | 103 | * pd + 1 |
104 | */ | 104 | */ |
105 | static unsigned int imx_decode_pll(unsigned int pll) | 105 | static unsigned int imx_decode_pll(unsigned int pll, u32 f_ref) |
106 | { | 106 | { |
107 | unsigned long long ll; | 107 | unsigned long long ll; |
108 | unsigned long quot; | 108 | unsigned long quot; |
@@ -111,7 +111,6 @@ static unsigned int imx_decode_pll(unsigned int pll) | |||
111 | u32 mfn = pll & 0x3ff; | 111 | u32 mfn = pll & 0x3ff; |
112 | u32 mfd = (pll >> 16) & 0x3ff; | 112 | u32 mfd = (pll >> 16) & 0x3ff; |
113 | u32 pd = (pll >> 26) & 0xf; | 113 | u32 pd = (pll >> 26) & 0xf; |
114 | u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512); | ||
115 | 114 | ||
116 | mfi = mfi <= 5 ? 5 : mfi; | 115 | mfi = mfi <= 5 ? 5 : mfi; |
117 | 116 | ||
@@ -124,13 +123,15 @@ static unsigned int imx_decode_pll(unsigned int pll) | |||
124 | 123 | ||
125 | unsigned int imx_get_system_clk(void) | 124 | unsigned int imx_get_system_clk(void) |
126 | { | 125 | { |
127 | return imx_decode_pll(SPCTL0); | 126 | u32 f_ref = (CSCR & CSCR_SYSTEM_SEL) ? 16000000 : (CLK32 * 512); |
127 | |||
128 | return imx_decode_pll(SPCTL0, f_ref); | ||
128 | } | 129 | } |
129 | EXPORT_SYMBOL(imx_get_system_clk); | 130 | EXPORT_SYMBOL(imx_get_system_clk); |
130 | 131 | ||
131 | unsigned int imx_get_mcu_clk(void) | 132 | unsigned int imx_get_mcu_clk(void) |
132 | { | 133 | { |
133 | return imx_decode_pll(MPCTL0); | 134 | return imx_decode_pll(MPCTL0, CLK32 * 512); |
134 | } | 135 | } |
135 | EXPORT_SYMBOL(imx_get_mcu_clk); | 136 | EXPORT_SYMBOL(imx_get_mcu_clk); |
136 | 137 | ||
diff --git a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c index a193dd931512..760c9d0db7c3 100644 --- a/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c +++ b/arch/arm/mach-ns9xxx/mach-cc9p9360dev.c | |||
@@ -32,7 +32,7 @@ static void __init mach_cc9p9360dev_init_machine(void) | |||
32 | board_a9m9750dev_init_machine(); | 32 | board_a9m9750dev_init_machine(); |
33 | } | 33 | } |
34 | 34 | ||
35 | MACHINE_START(CC9P9360DEV, "Connect Core 9P 9360 on an A9M9750 Devboard") | 35 | MACHINE_START(CC9P9360DEV, "Digi ConnectCore 9P 9360 on an A9M9750 Devboard") |
36 | .map_io = mach_cc9p9360dev_map_io, | 36 | .map_io = mach_cc9p9360dev_map_io, |
37 | .init_irq = mach_cc9p9360dev_init_irq, | 37 | .init_irq = mach_cc9p9360dev_init_irq, |
38 | .init_machine = mach_cc9p9360dev_init_machine, | 38 | .init_machine = mach_cc9p9360dev_init_machine, |
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c index 6e113078f7ab..ad519390dd58 100644 --- a/arch/arm/mach-omap1/board-h2.c +++ b/arch/arm/mach-omap1/board-h2.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/mtd/nand.h> | 27 | #include <linux/mtd/nand.h> |
28 | #include <linux/mtd/partitions.h> | 28 | #include <linux/mtd/partitions.h> |
29 | #include <linux/input.h> | 29 | #include <linux/input.h> |
30 | #include <linux/workqueue.h> | ||
30 | 31 | ||
31 | #include <asm/hardware.h> | 32 | #include <asm/hardware.h> |
32 | #include <asm/mach-types.h> | 33 | #include <asm/mach-types.h> |
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 0de201c3d50b..5170481afeab 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -27,6 +27,7 @@ | |||
27 | 27 | ||
28 | #include <asm/arch/clock.h> | 28 | #include <asm/arch/clock.h> |
29 | #include <asm/arch/sram.h> | 29 | #include <asm/arch/sram.h> |
30 | #include <asm/div64.h> | ||
30 | 31 | ||
31 | #include "prcm-regs.h" | 32 | #include "prcm-regs.h" |
32 | #include "memory.h" | 33 | #include "memory.h" |
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 8816f5a33a28..162978fd5359 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -1013,7 +1013,8 @@ static struct clk dss2_fck = { /* Alt clk used in power management */ | |||
1013 | .name = "dss2_fck", | 1013 | .name = "dss2_fck", |
1014 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ | 1014 | .parent = &sys_ck, /* fixed at sys_ck or 48MHz */ |
1015 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | | 1015 | .flags = CLOCK_IN_OMAP242X | CLOCK_IN_OMAP243X | |
1016 | RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED, | 1016 | RATE_CKCTL | CM_CORE_SEL1 | RATE_FIXED | |
1017 | DELAYED_APP, | ||
1017 | .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, | 1018 | .enable_reg = (void __iomem *)&CM_FCLKEN1_CORE, |
1018 | .enable_bit = 1, | 1019 | .enable_bit = 1, |
1019 | .src_offset = 13, | 1020 | .src_offset = 13, |
diff --git a/arch/arm/mach-pxa/tosa.c b/arch/arm/mach-pxa/tosa.c index 7915a5a22865..72738771fb57 100644 --- a/arch/arm/mach-pxa/tosa.c +++ b/arch/arm/mach-pxa/tosa.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <asm/hardware.h> | 28 | #include <asm/hardware.h> |
29 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
30 | #include <asm/system.h> | 30 | #include <asm/system.h> |
31 | #include <asm/arch/pxa-regs.h> | ||
31 | #include <asm/arch/irda.h> | 32 | #include <asm/arch/irda.h> |
32 | #include <asm/arch/mmc.h> | 33 | #include <asm/arch/mmc.h> |
33 | #include <asm/arch/udc.h> | 34 | #include <asm/arch/udc.h> |
@@ -35,8 +36,6 @@ | |||
35 | #include <asm/mach/arch.h> | 36 | #include <asm/mach/arch.h> |
36 | #include <asm/mach/map.h> | 37 | #include <asm/mach/map.h> |
37 | #include <asm/mach/irq.h> | 38 | #include <asm/mach/irq.h> |
38 | |||
39 | #include <asm/arch/pxa-regs.h> | ||
40 | #include <asm/arch/tosa.h> | 39 | #include <asm/arch/tosa.h> |
41 | 40 | ||
42 | #include <asm/hardware/scoop.h> | 41 | #include <asm/hardware/scoop.h> |
diff --git a/arch/arm/mach-sa1100/generic.c b/arch/arm/mach-sa1100/generic.c index 192a5a26cf2b..9e13c8358ea7 100644 --- a/arch/arm/mach-sa1100/generic.c +++ b/arch/arm/mach-sa1100/generic.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <asm/mach/map.h> | 27 | #include <asm/mach/map.h> |
28 | #include <asm/mach/flash.h> | 28 | #include <asm/mach/flash.h> |
29 | #include <asm/irq.h> | 29 | #include <asm/irq.h> |
30 | #include <asm/gpio.h> | ||
30 | 31 | ||
31 | #include "generic.h" | 32 | #include "generic.h" |
32 | 33 | ||
@@ -153,7 +154,7 @@ int gpio_direction_input(unsigned gpio) | |||
153 | 154 | ||
154 | EXPORT_SYMBOL(gpio_direction_input); | 155 | EXPORT_SYMBOL(gpio_direction_input); |
155 | 156 | ||
156 | int gpio_direction_output(unsigned gpio) | 157 | int gpio_direction_output(unsigned gpio, int value) |
157 | { | 158 | { |
158 | unsigned long flags; | 159 | unsigned long flags; |
159 | 160 | ||
@@ -161,6 +162,7 @@ int gpio_direction_output(unsigned gpio) | |||
161 | return -EINVAL; | 162 | return -EINVAL; |
162 | 163 | ||
163 | local_irq_save(flags); | 164 | local_irq_save(flags); |
165 | gpio_set_value(gpio, value); | ||
164 | GPDR |= GPIO_GPIO(gpio); | 166 | GPDR |= GPIO_GPIO(gpio); |
165 | local_irq_restore(flags); | 167 | local_irq_restore(flags); |
166 | return 0; | 168 | return 0; |
diff --git a/arch/avr32/mach-at32ap/pio.c b/arch/avr32/mach-at32ap/pio.c index 9ba5654cde11..1eb99b814f5b 100644 --- a/arch/avr32/mach-at32ap/pio.c +++ b/arch/avr32/mach-at32ap/pio.c | |||
@@ -214,7 +214,7 @@ int gpio_direction_input(unsigned int gpio) | |||
214 | } | 214 | } |
215 | EXPORT_SYMBOL(gpio_direction_input); | 215 | EXPORT_SYMBOL(gpio_direction_input); |
216 | 216 | ||
217 | int gpio_direction_output(unsigned int gpio) | 217 | int gpio_direction_output(unsigned int gpio, int value) |
218 | { | 218 | { |
219 | struct pio_device *pio; | 219 | struct pio_device *pio; |
220 | unsigned int pin; | 220 | unsigned int pin; |
@@ -223,6 +223,8 @@ int gpio_direction_output(unsigned int gpio) | |||
223 | if (!pio) | 223 | if (!pio) |
224 | return -ENODEV; | 224 | return -ENODEV; |
225 | 225 | ||
226 | gpio_set_value(gpio, value); | ||
227 | |||
226 | pin = gpio & 0x1f; | 228 | pin = gpio & 0x1f; |
227 | pio_writel(pio, OER, 1 << pin); | 229 | pio_writel(pio, OER, 1 << pin); |
228 | 230 | ||
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 27e8453274e6..53d62373a524 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -220,7 +220,7 @@ config PARAVIRT | |||
220 | 220 | ||
221 | config VMI | 221 | config VMI |
222 | bool "VMI Paravirt-ops support" | 222 | bool "VMI Paravirt-ops support" |
223 | depends on PARAVIRT | 223 | depends on PARAVIRT && !COMPAT_VDSO |
224 | help | 224 | help |
225 | VMI provides a paravirtualized interface to the VMware ESX server | 225 | VMI provides a paravirtualized interface to the VMware ESX server |
226 | (it could be used by other hypervisors in theory too, but is not | 226 | (it could be used by other hypervisors in theory too, but is not |
diff --git a/arch/i386/defconfig b/arch/i386/defconfig index 5ae1e0bc8fd7..f4efd66e1ee5 100644 --- a/arch/i386/defconfig +++ b/arch/i386/defconfig | |||
@@ -1,10 +1,13 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.20-git8 | 3 | # Linux kernel version: 2.6.21-rc3 |
4 | # Tue Feb 13 11:25:18 2007 | 4 | # Wed Mar 7 15:29:47 2007 |
5 | # | 5 | # |
6 | CONFIG_X86_32=y | 6 | CONFIG_X86_32=y |
7 | CONFIG_GENERIC_TIME=y | 7 | CONFIG_GENERIC_TIME=y |
8 | CONFIG_CLOCKSOURCE_WATCHDOG=y | ||
9 | CONFIG_GENERIC_CLOCKEVENTS=y | ||
10 | CONFIG_GENERIC_CLOCKEVENTS_BROADCAST=y | ||
8 | CONFIG_LOCKDEP_SUPPORT=y | 11 | CONFIG_LOCKDEP_SUPPORT=y |
9 | CONFIG_STACKTRACE_SUPPORT=y | 12 | CONFIG_STACKTRACE_SUPPORT=y |
10 | CONFIG_SEMAPHORE_SLEEPERS=y | 13 | CONFIG_SEMAPHORE_SLEEPERS=y |
@@ -34,6 +37,7 @@ CONFIG_LOCALVERSION_AUTO=y | |||
34 | CONFIG_SWAP=y | 37 | CONFIG_SWAP=y |
35 | CONFIG_SYSVIPC=y | 38 | CONFIG_SYSVIPC=y |
36 | # CONFIG_IPC_NS is not set | 39 | # CONFIG_IPC_NS is not set |
40 | CONFIG_SYSVIPC_SYSCTL=y | ||
37 | CONFIG_POSIX_MQUEUE=y | 41 | CONFIG_POSIX_MQUEUE=y |
38 | # CONFIG_BSD_PROCESS_ACCT is not set | 42 | # CONFIG_BSD_PROCESS_ACCT is not set |
39 | # CONFIG_TASKSTATS is not set | 43 | # CONFIG_TASKSTATS is not set |
@@ -44,6 +48,7 @@ CONFIG_IKCONFIG_PROC=y | |||
44 | # CONFIG_CPUSETS is not set | 48 | # CONFIG_CPUSETS is not set |
45 | CONFIG_SYSFS_DEPRECATED=y | 49 | CONFIG_SYSFS_DEPRECATED=y |
46 | # CONFIG_RELAY is not set | 50 | # CONFIG_RELAY is not set |
51 | CONFIG_BLK_DEV_INITRD=y | ||
47 | CONFIG_INITRAMFS_SOURCE="" | 52 | CONFIG_INITRAMFS_SOURCE="" |
48 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 53 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
49 | CONFIG_SYSCTL=y | 54 | CONFIG_SYSCTL=y |
@@ -103,6 +108,9 @@ CONFIG_DEFAULT_IOSCHED="anticipatory" | |||
103 | # | 108 | # |
104 | # Processor type and features | 109 | # Processor type and features |
105 | # | 110 | # |
111 | # CONFIG_TICK_ONESHOT is not set | ||
112 | # CONFIG_NO_HZ is not set | ||
113 | # CONFIG_HIGH_RES_TIMERS is not set | ||
106 | CONFIG_SMP=y | 114 | CONFIG_SMP=y |
107 | # CONFIG_X86_PC is not set | 115 | # CONFIG_X86_PC is not set |
108 | # CONFIG_X86_ELAN is not set | 116 | # CONFIG_X86_ELAN is not set |
@@ -235,10 +243,8 @@ CONFIG_ACPI_PROCFS=y | |||
235 | CONFIG_ACPI_AC=y | 243 | CONFIG_ACPI_AC=y |
236 | CONFIG_ACPI_BATTERY=y | 244 | CONFIG_ACPI_BATTERY=y |
237 | CONFIG_ACPI_BUTTON=y | 245 | CONFIG_ACPI_BUTTON=y |
238 | # CONFIG_ACPI_HOTKEY is not set | ||
239 | CONFIG_ACPI_FAN=y | 246 | CONFIG_ACPI_FAN=y |
240 | # CONFIG_ACPI_DOCK is not set | 247 | # CONFIG_ACPI_DOCK is not set |
241 | # CONFIG_ACPI_BAY is not set | ||
242 | CONFIG_ACPI_PROCESSOR=y | 248 | CONFIG_ACPI_PROCESSOR=y |
243 | CONFIG_ACPI_THERMAL=y | 249 | CONFIG_ACPI_THERMAL=y |
244 | # CONFIG_ACPI_ASUS is not set | 250 | # CONFIG_ACPI_ASUS is not set |
@@ -289,6 +295,7 @@ CONFIG_X86_POWERNOW_K8_ACPI=y | |||
289 | # CONFIG_X86_CPUFREQ_NFORCE2 is not set | 295 | # CONFIG_X86_CPUFREQ_NFORCE2 is not set |
290 | # CONFIG_X86_LONGRUN is not set | 296 | # CONFIG_X86_LONGRUN is not set |
291 | # CONFIG_X86_LONGHAUL is not set | 297 | # CONFIG_X86_LONGHAUL is not set |
298 | # CONFIG_X86_E_POWERSAVER is not set | ||
292 | 299 | ||
293 | # | 300 | # |
294 | # shared options | 301 | # shared options |
@@ -368,7 +375,7 @@ CONFIG_IP_PNP_DHCP=y | |||
368 | # CONFIG_INET_ESP is not set | 375 | # CONFIG_INET_ESP is not set |
369 | # CONFIG_INET_IPCOMP is not set | 376 | # CONFIG_INET_IPCOMP is not set |
370 | # CONFIG_INET_XFRM_TUNNEL is not set | 377 | # CONFIG_INET_XFRM_TUNNEL is not set |
371 | # CONFIG_INET_TUNNEL is not set | 378 | CONFIG_INET_TUNNEL=y |
372 | CONFIG_INET_XFRM_MODE_TRANSPORT=y | 379 | CONFIG_INET_XFRM_MODE_TRANSPORT=y |
373 | CONFIG_INET_XFRM_MODE_TUNNEL=y | 380 | CONFIG_INET_XFRM_MODE_TUNNEL=y |
374 | # CONFIG_INET_XFRM_MODE_BEET is not set | 381 | # CONFIG_INET_XFRM_MODE_BEET is not set |
@@ -470,7 +477,13 @@ CONFIG_FW_LOADER=y | |||
470 | # | 477 | # |
471 | # Plug and Play support | 478 | # Plug and Play support |
472 | # | 479 | # |
473 | # CONFIG_PNP is not set | 480 | CONFIG_PNP=y |
481 | # CONFIG_PNP_DEBUG is not set | ||
482 | |||
483 | # | ||
484 | # Protocols | ||
485 | # | ||
486 | CONFIG_PNPACPI=y | ||
474 | 487 | ||
475 | # | 488 | # |
476 | # Block devices | 489 | # Block devices |
@@ -490,7 +503,6 @@ CONFIG_BLK_DEV_RAM=y | |||
490 | CONFIG_BLK_DEV_RAM_COUNT=16 | 503 | CONFIG_BLK_DEV_RAM_COUNT=16 |
491 | CONFIG_BLK_DEV_RAM_SIZE=4096 | 504 | CONFIG_BLK_DEV_RAM_SIZE=4096 |
492 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | 505 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 |
493 | CONFIG_BLK_DEV_INITRD=y | ||
494 | # CONFIG_CDROM_PKTCDVD is not set | 506 | # CONFIG_CDROM_PKTCDVD is not set |
495 | # CONFIG_ATA_OVER_ETH is not set | 507 | # CONFIG_ATA_OVER_ETH is not set |
496 | 508 | ||
@@ -500,6 +512,7 @@ CONFIG_BLK_DEV_INITRD=y | |||
500 | # CONFIG_IBM_ASM is not set | 512 | # CONFIG_IBM_ASM is not set |
501 | # CONFIG_SGI_IOC4 is not set | 513 | # CONFIG_SGI_IOC4 is not set |
502 | # CONFIG_TIFM_CORE is not set | 514 | # CONFIG_TIFM_CORE is not set |
515 | # CONFIG_SONY_LAPTOP is not set | ||
503 | 516 | ||
504 | # | 517 | # |
505 | # ATA/ATAPI/MFM/RLL support | 518 | # ATA/ATAPI/MFM/RLL support |
@@ -526,6 +539,7 @@ CONFIG_BLK_DEV_IDEACPI=y | |||
526 | # | 539 | # |
527 | CONFIG_IDE_GENERIC=y | 540 | CONFIG_IDE_GENERIC=y |
528 | # CONFIG_BLK_DEV_CMD640 is not set | 541 | # CONFIG_BLK_DEV_CMD640 is not set |
542 | # CONFIG_BLK_DEV_IDEPNP is not set | ||
529 | CONFIG_BLK_DEV_IDEPCI=y | 543 | CONFIG_BLK_DEV_IDEPCI=y |
530 | # CONFIG_IDEPCI_SHARE_IRQ is not set | 544 | # CONFIG_IDEPCI_SHARE_IRQ is not set |
531 | # CONFIG_BLK_DEV_OFFBOARD is not set | 545 | # CONFIG_BLK_DEV_OFFBOARD is not set |
@@ -679,6 +693,7 @@ CONFIG_SATA_VIA=y | |||
679 | # CONFIG_SATA_VITESSE is not set | 693 | # CONFIG_SATA_VITESSE is not set |
680 | # CONFIG_SATA_INIC162X is not set | 694 | # CONFIG_SATA_INIC162X is not set |
681 | CONFIG_SATA_INTEL_COMBINED=y | 695 | CONFIG_SATA_INTEL_COMBINED=y |
696 | CONFIG_SATA_ACPI=y | ||
682 | # CONFIG_PATA_ALI is not set | 697 | # CONFIG_PATA_ALI is not set |
683 | # CONFIG_PATA_AMD is not set | 698 | # CONFIG_PATA_AMD is not set |
684 | # CONFIG_PATA_ARTOP is not set | 699 | # CONFIG_PATA_ARTOP is not set |
@@ -786,6 +801,7 @@ CONFIG_NETDEVICES=y | |||
786 | # CONFIG_BONDING is not set | 801 | # CONFIG_BONDING is not set |
787 | # CONFIG_EQUALIZER is not set | 802 | # CONFIG_EQUALIZER is not set |
788 | # CONFIG_TUN is not set | 803 | # CONFIG_TUN is not set |
804 | # CONFIG_NET_SB1000 is not set | ||
789 | 805 | ||
790 | # | 806 | # |
791 | # ARCnet devices | 807 | # ARCnet devices |
@@ -979,6 +995,7 @@ CONFIG_HW_CONSOLE=y | |||
979 | CONFIG_SERIAL_8250=y | 995 | CONFIG_SERIAL_8250=y |
980 | CONFIG_SERIAL_8250_CONSOLE=y | 996 | CONFIG_SERIAL_8250_CONSOLE=y |
981 | CONFIG_SERIAL_8250_PCI=y | 997 | CONFIG_SERIAL_8250_PCI=y |
998 | CONFIG_SERIAL_8250_PNP=y | ||
982 | CONFIG_SERIAL_8250_NR_UARTS=4 | 999 | CONFIG_SERIAL_8250_NR_UARTS=4 |
983 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | 1000 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 |
984 | # CONFIG_SERIAL_8250_EXTENDED is not set | 1001 | # CONFIG_SERIAL_8250_EXTENDED is not set |
@@ -1065,6 +1082,11 @@ CONFIG_HANGCHECK_TIMER=y | |||
1065 | # CONFIG_HWMON_VID is not set | 1082 | # CONFIG_HWMON_VID is not set |
1066 | 1083 | ||
1067 | # | 1084 | # |
1085 | # Multifunction device drivers | ||
1086 | # | ||
1087 | # CONFIG_MFD_SM501 is not set | ||
1088 | |||
1089 | # | ||
1068 | # Multimedia devices | 1090 | # Multimedia devices |
1069 | # | 1091 | # |
1070 | # CONFIG_VIDEO_DEV is not set | 1092 | # CONFIG_VIDEO_DEV is not set |
@@ -1078,7 +1100,7 @@ CONFIG_HANGCHECK_TIMER=y | |||
1078 | # | 1100 | # |
1079 | # Graphics support | 1101 | # Graphics support |
1080 | # | 1102 | # |
1081 | CONFIG_FIRMWARE_EDID=y | 1103 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
1082 | # CONFIG_FB is not set | 1104 | # CONFIG_FB is not set |
1083 | 1105 | ||
1084 | # | 1106 | # |
@@ -1089,7 +1111,6 @@ CONFIG_VGACON_SOFT_SCROLLBACK=y | |||
1089 | CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128 | 1111 | CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=128 |
1090 | CONFIG_VIDEO_SELECT=y | 1112 | CONFIG_VIDEO_SELECT=y |
1091 | CONFIG_DUMMY_CONSOLE=y | 1113 | CONFIG_DUMMY_CONSOLE=y |
1092 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
1093 | 1114 | ||
1094 | # | 1115 | # |
1095 | # Sound | 1116 | # Sound |
@@ -1238,6 +1259,7 @@ CONFIG_USB_MON=y | |||
1238 | # CONFIG_USB_RIO500 is not set | 1259 | # CONFIG_USB_RIO500 is not set |
1239 | # CONFIG_USB_LEGOTOWER is not set | 1260 | # CONFIG_USB_LEGOTOWER is not set |
1240 | # CONFIG_USB_LCD is not set | 1261 | # CONFIG_USB_LCD is not set |
1262 | # CONFIG_USB_BERRY_CHARGE is not set | ||
1241 | # CONFIG_USB_LED is not set | 1263 | # CONFIG_USB_LED is not set |
1242 | # CONFIG_USB_CYPRESS_CY7C63 is not set | 1264 | # CONFIG_USB_CYPRESS_CY7C63 is not set |
1243 | # CONFIG_USB_CYTHERM is not set | 1265 | # CONFIG_USB_CYTHERM is not set |
@@ -1248,6 +1270,7 @@ CONFIG_USB_MON=y | |||
1248 | # CONFIG_USB_SISUSBVGA is not set | 1270 | # CONFIG_USB_SISUSBVGA is not set |
1249 | # CONFIG_USB_LD is not set | 1271 | # CONFIG_USB_LD is not set |
1250 | # CONFIG_USB_TRANCEVIBRATOR is not set | 1272 | # CONFIG_USB_TRANCEVIBRATOR is not set |
1273 | # CONFIG_USB_IOWARRIOR is not set | ||
1251 | # CONFIG_USB_TEST is not set | 1274 | # CONFIG_USB_TEST is not set |
1252 | 1275 | ||
1253 | # | 1276 | # |
@@ -1506,6 +1529,7 @@ CONFIG_DEBUG_KERNEL=y | |||
1506 | CONFIG_LOG_BUF_SHIFT=18 | 1529 | CONFIG_LOG_BUF_SHIFT=18 |
1507 | CONFIG_DETECT_SOFTLOCKUP=y | 1530 | CONFIG_DETECT_SOFTLOCKUP=y |
1508 | # CONFIG_SCHEDSTATS is not set | 1531 | # CONFIG_SCHEDSTATS is not set |
1532 | # CONFIG_TIMER_STATS is not set | ||
1509 | # CONFIG_DEBUG_SLAB is not set | 1533 | # CONFIG_DEBUG_SLAB is not set |
1510 | # CONFIG_DEBUG_RT_MUTEXES is not set | 1534 | # CONFIG_DEBUG_RT_MUTEXES is not set |
1511 | # CONFIG_RT_MUTEX_TESTER is not set | 1535 | # CONFIG_RT_MUTEX_TESTER is not set |
@@ -1525,6 +1549,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1525 | # CONFIG_FORCED_INLINING is not set | 1549 | # CONFIG_FORCED_INLINING is not set |
1526 | # CONFIG_RCU_TORTURE_TEST is not set | 1550 | # CONFIG_RCU_TORTURE_TEST is not set |
1527 | # CONFIG_LKDTM is not set | 1551 | # CONFIG_LKDTM is not set |
1552 | # CONFIG_FAULT_INJECTION is not set | ||
1528 | CONFIG_EARLY_PRINTK=y | 1553 | CONFIG_EARLY_PRINTK=y |
1529 | CONFIG_DEBUG_STACKOVERFLOW=y | 1554 | CONFIG_DEBUG_STACKOVERFLOW=y |
1530 | # CONFIG_DEBUG_STACK_USAGE is not set | 1555 | # CONFIG_DEBUG_STACK_USAGE is not set |
diff --git a/arch/i386/kernel/apic.c b/arch/i386/kernel/apic.c index 2383bcf18c5d..5cff7970911e 100644 --- a/arch/i386/kernel/apic.c +++ b/arch/i386/kernel/apic.c | |||
@@ -338,6 +338,7 @@ void __init setup_boot_APIC_clock(void) | |||
338 | void (*real_handler)(struct clock_event_device *dev); | 338 | void (*real_handler)(struct clock_event_device *dev); |
339 | unsigned long deltaj; | 339 | unsigned long deltaj; |
340 | long delta, deltapm; | 340 | long delta, deltapm; |
341 | int pm_referenced = 0; | ||
341 | 342 | ||
342 | apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n" | 343 | apic_printk(APIC_VERBOSE, "Using local APIC timer interrupts.\n" |
343 | "calibrating APIC timer ...\n"); | 344 | "calibrating APIC timer ...\n"); |
@@ -357,7 +358,8 @@ void __init setup_boot_APIC_clock(void) | |||
357 | /* Let the interrupts run */ | 358 | /* Let the interrupts run */ |
358 | local_irq_enable(); | 359 | local_irq_enable(); |
359 | 360 | ||
360 | while(lapic_cal_loops <= LAPIC_CAL_LOOPS); | 361 | while (lapic_cal_loops <= LAPIC_CAL_LOOPS) |
362 | cpu_relax(); | ||
361 | 363 | ||
362 | local_irq_disable(); | 364 | local_irq_disable(); |
363 | 365 | ||
@@ -394,6 +396,7 @@ void __init setup_boot_APIC_clock(void) | |||
394 | "%lu (%ld)\n", (unsigned long) res, delta); | 396 | "%lu (%ld)\n", (unsigned long) res, delta); |
395 | delta = (long) res; | 397 | delta = (long) res; |
396 | } | 398 | } |
399 | pm_referenced = 1; | ||
397 | } | 400 | } |
398 | 401 | ||
399 | /* Calculate the scaled math multiplication factor */ | 402 | /* Calculate the scaled math multiplication factor */ |
@@ -423,68 +426,41 @@ void __init setup_boot_APIC_clock(void) | |||
423 | calibration_result / (1000000 / HZ), | 426 | calibration_result / (1000000 / HZ), |
424 | calibration_result % (1000000 / HZ)); | 427 | calibration_result % (1000000 / HZ)); |
425 | 428 | ||
426 | |||
427 | apic_printk(APIC_VERBOSE, "... verify APIC timer\n"); | ||
428 | |||
429 | /* | ||
430 | * Setup the apic timer manually | ||
431 | */ | ||
432 | local_apic_timer_verify_ok = 1; | 429 | local_apic_timer_verify_ok = 1; |
433 | levt->event_handler = lapic_cal_handler; | ||
434 | lapic_timer_setup(CLOCK_EVT_MODE_PERIODIC, levt); | ||
435 | lapic_cal_loops = -1; | ||
436 | 430 | ||
437 | /* Let the interrupts run */ | 431 | /* We trust the pm timer based calibration */ |
438 | local_irq_enable(); | 432 | if (!pm_referenced) { |
433 | apic_printk(APIC_VERBOSE, "... verify APIC timer\n"); | ||
439 | 434 | ||
440 | while(lapic_cal_loops <= LAPIC_CAL_LOOPS); | 435 | /* |
436 | * Setup the apic timer manually | ||
437 | */ | ||
438 | levt->event_handler = lapic_cal_handler; | ||
439 | lapic_timer_setup(CLOCK_EVT_MODE_PERIODIC, levt); | ||
440 | lapic_cal_loops = -1; | ||
441 | 441 | ||
442 | local_irq_disable(); | 442 | /* Let the interrupts run */ |
443 | local_irq_enable(); | ||
443 | 444 | ||
444 | /* Stop the lapic timer */ | 445 | while(lapic_cal_loops <= LAPIC_CAL_LOOPS) |
445 | lapic_timer_setup(CLOCK_EVT_MODE_SHUTDOWN, levt); | 446 | cpu_relax(); |
446 | 447 | ||
447 | local_irq_enable(); | 448 | local_irq_disable(); |
448 | 449 | ||
449 | /* Jiffies delta */ | 450 | /* Stop the lapic timer */ |
450 | deltaj = lapic_cal_j2 - lapic_cal_j1; | 451 | lapic_timer_setup(CLOCK_EVT_MODE_SHUTDOWN, levt); |
451 | apic_printk(APIC_VERBOSE, "... jiffies delta = %lu\n", deltaj); | ||
452 | 452 | ||
453 | /* Check, if the PM timer is available */ | 453 | local_irq_enable(); |
454 | deltapm = lapic_cal_pm2 - lapic_cal_pm1; | ||
455 | apic_printk(APIC_VERBOSE, "... PM timer delta = %ld\n", deltapm); | ||
456 | 454 | ||
457 | local_apic_timer_verify_ok = 0; | 455 | /* Jiffies delta */ |
456 | deltaj = lapic_cal_j2 - lapic_cal_j1; | ||
457 | apic_printk(APIC_VERBOSE, "... jiffies delta = %lu\n", deltaj); | ||
458 | 458 | ||
459 | if (deltapm) { | ||
460 | if (deltapm > (pm_100ms - pm_thresh) && | ||
461 | deltapm < (pm_100ms + pm_thresh)) { | ||
462 | apic_printk(APIC_VERBOSE, "... PM timer result ok\n"); | ||
463 | /* Check, if the jiffies result is consistent */ | ||
464 | if (deltaj < LAPIC_CAL_LOOPS-2 || | ||
465 | deltaj > LAPIC_CAL_LOOPS+2) { | ||
466 | /* | ||
467 | * Not sure, what we can do about this one. | ||
468 | * When high resultion timers are active | ||
469 | * and the lapic timer does not stop in C3 | ||
470 | * we are fine. Otherwise more trouble might | ||
471 | * be waiting. -- tglx | ||
472 | */ | ||
473 | printk(KERN_WARNING "Global event device %s " | ||
474 | "has wrong frequency " | ||
475 | "(%lu ticks instead of %d)\n", | ||
476 | global_clock_event->name, deltaj, | ||
477 | LAPIC_CAL_LOOPS); | ||
478 | } | ||
479 | local_apic_timer_verify_ok = 1; | ||
480 | } | ||
481 | } else { | ||
482 | /* Check, if the jiffies result is consistent */ | 459 | /* Check, if the jiffies result is consistent */ |
483 | if (deltaj >= LAPIC_CAL_LOOPS-2 && | 460 | if (deltaj >= LAPIC_CAL_LOOPS-2 && deltaj <= LAPIC_CAL_LOOPS+2) |
484 | deltaj <= LAPIC_CAL_LOOPS+2) { | ||
485 | apic_printk(APIC_VERBOSE, "... jiffies result ok\n"); | 461 | apic_printk(APIC_VERBOSE, "... jiffies result ok\n"); |
486 | local_apic_timer_verify_ok = 1; | 462 | else |
487 | } | 463 | local_apic_timer_verify_ok = 0; |
488 | } | 464 | } |
489 | 465 | ||
490 | if (!local_apic_timer_verify_ok) { | 466 | if (!local_apic_timer_verify_ok) { |
diff --git a/arch/i386/kernel/i386_ksyms.c b/arch/i386/kernel/i386_ksyms.c index e3d4b73bfdb0..4afe26e86260 100644 --- a/arch/i386/kernel/i386_ksyms.c +++ b/arch/i386/kernel/i386_ksyms.c | |||
@@ -28,3 +28,5 @@ EXPORT_SYMBOL(__read_lock_failed); | |||
28 | #endif | 28 | #endif |
29 | 29 | ||
30 | EXPORT_SYMBOL(csum_partial); | 30 | EXPORT_SYMBOL(csum_partial); |
31 | |||
32 | EXPORT_SYMBOL(_proxy_pda); | ||
diff --git a/arch/i386/kernel/nmi.c b/arch/i386/kernel/nmi.c index 821df34d2b3a..14702427b104 100644 --- a/arch/i386/kernel/nmi.c +++ b/arch/i386/kernel/nmi.c | |||
@@ -245,14 +245,6 @@ static int __init check_nmi_watchdog(void) | |||
245 | unsigned int *prev_nmi_count; | 245 | unsigned int *prev_nmi_count; |
246 | int cpu; | 246 | int cpu; |
247 | 247 | ||
248 | /* Enable NMI watchdog for newer systems. | ||
249 | Probably safe on most older systems too, but let's be careful. | ||
250 | IBM ThinkPads use INT10 inside SMM and that allows early NMI inside SMM | ||
251 | which hangs the system. Disable watchdog for all thinkpads */ | ||
252 | if (nmi_watchdog == NMI_DEFAULT && dmi_get_year(DMI_BIOS_DATE) >= 2004 && | ||
253 | !dmi_name_in_vendors("ThinkPad")) | ||
254 | nmi_watchdog = NMI_LOCAL_APIC; | ||
255 | |||
256 | if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT)) | 248 | if ((nmi_watchdog == NMI_NONE) || (nmi_watchdog == NMI_DEFAULT)) |
257 | return 0; | 249 | return 0; |
258 | 250 | ||
diff --git a/arch/i386/kernel/tsc.c b/arch/i386/kernel/tsc.c index 602660df455c..0e65f7ab63a2 100644 --- a/arch/i386/kernel/tsc.c +++ b/arch/i386/kernel/tsc.c | |||
@@ -105,7 +105,7 @@ unsigned long long sched_clock(void) | |||
105 | /* | 105 | /* |
106 | * Fall back to jiffies if there's no TSC available: | 106 | * Fall back to jiffies if there's no TSC available: |
107 | */ | 107 | */ |
108 | if (unlikely(tsc_disable)) | 108 | if (tsc_unstable || unlikely(tsc_disable)) |
109 | /* No locking but a rare wrong value is not a big deal: */ | 109 | /* No locking but a rare wrong value is not a big deal: */ |
110 | return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ); | 110 | return (jiffies_64 - INITIAL_JIFFIES) * (1000000000 / HZ); |
111 | 111 | ||
diff --git a/arch/i386/kernel/vmi.c b/arch/i386/kernel/vmi.c index fbf45fa08320..fb07a1aad225 100644 --- a/arch/i386/kernel/vmi.c +++ b/arch/i386/kernel/vmi.c | |||
@@ -23,7 +23,6 @@ | |||
23 | */ | 23 | */ |
24 | 24 | ||
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/license.h> | ||
27 | #include <linux/cpu.h> | 26 | #include <linux/cpu.h> |
28 | #include <linux/bootmem.h> | 27 | #include <linux/bootmem.h> |
29 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
@@ -48,7 +47,6 @@ typedef u64 __attribute__((regparm(2))) (VROMLONGFUNC)(int); | |||
48 | (((VROMLONGFUNC *)(rom->func)) (arg)) | 47 | (((VROMLONGFUNC *)(rom->func)) (arg)) |
49 | 48 | ||
50 | static struct vrom_header *vmi_rom; | 49 | static struct vrom_header *vmi_rom; |
51 | static int license_gplok; | ||
52 | static int disable_pge; | 50 | static int disable_pge; |
53 | static int disable_pse; | 51 | static int disable_pse; |
54 | static int disable_sep; | 52 | static int disable_sep; |
@@ -629,13 +627,14 @@ static inline int __init check_vmi_rom(struct vrom_header *rom) | |||
629 | rom->api_version_maj, rom->api_version_min, | 627 | rom->api_version_maj, rom->api_version_min, |
630 | pci->rom_version_maj, pci->rom_version_min); | 628 | pci->rom_version_maj, pci->rom_version_min); |
631 | 629 | ||
632 | license_gplok = license_is_gpl_compatible(license); | 630 | /* Don't allow BSD/MIT here for now because we don't want to end up |
633 | if (!license_gplok) { | 631 | with any binary only shim layers */ |
634 | printk(KERN_WARNING "VMI: ROM license '%s' taints kernel... " | 632 | if (strcmp(license, "GPL") && strcmp(license, "GPL v2")) { |
635 | "inlining disabled\n", | 633 | printk(KERN_WARNING "VMI: Non GPL license `%s' found for ROM. Not used.\n", |
636 | license); | 634 | license); |
637 | add_taint(TAINT_PROPRIETARY_MODULE); | 635 | return 0; |
638 | } | 636 | } |
637 | |||
639 | return 1; | 638 | return 1; |
640 | } | 639 | } |
641 | 640 | ||
diff --git a/arch/ia64/sn/kernel/io_init.c b/arch/ia64/sn/kernel/io_init.c index 600be3ebae05..6b10e5d28488 100644 --- a/arch/ia64/sn/kernel/io_init.c +++ b/arch/ia64/sn/kernel/io_init.c | |||
@@ -247,10 +247,18 @@ sn_io_slot_fixup(struct pci_dev *dev) | |||
247 | addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET; | 247 | addr = ((addr << 4) >> 4) | __IA64_UNCACHED_OFFSET; |
248 | dev->resource[idx].start = addr; | 248 | dev->resource[idx].start = addr; |
249 | dev->resource[idx].end = addr + size; | 249 | dev->resource[idx].end = addr + size; |
250 | |||
251 | /* | ||
252 | * if it's already in the device structure, remove it before | ||
253 | * inserting | ||
254 | */ | ||
255 | if (dev->resource[idx].parent && dev->resource[idx].parent->child) | ||
256 | release_resource(&dev->resource[idx]); | ||
257 | |||
250 | if (dev->resource[idx].flags & IORESOURCE_IO) | 258 | if (dev->resource[idx].flags & IORESOURCE_IO) |
251 | dev->resource[idx].parent = &ioport_resource; | 259 | insert_resource(&ioport_resource, &dev->resource[idx]); |
252 | else | 260 | else |
253 | dev->resource[idx].parent = &iomem_resource; | 261 | insert_resource(&iomem_resource, &dev->resource[idx]); |
254 | /* If ROM, mark as shadowed in PROM */ | 262 | /* If ROM, mark as shadowed in PROM */ |
255 | if (idx == PCI_ROM_RESOURCE) | 263 | if (idx == PCI_ROM_RESOURCE) |
256 | dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY; | 264 | dev->resource[idx].flags |= IORESOURCE_ROM_BIOS_COPY; |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index a1cd84f9b3bc..656f0ca52782 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -250,7 +250,7 @@ config LASAT | |||
250 | select R5000_CPU_SCACHE | 250 | select R5000_CPU_SCACHE |
251 | select SYS_HAS_CPU_R5000 | 251 | select SYS_HAS_CPU_R5000 |
252 | select SYS_SUPPORTS_32BIT_KERNEL | 252 | select SYS_SUPPORTS_32BIT_KERNEL |
253 | select SYS_SUPPORTS_64BIT_KERNEL if EXPERIMENTAL | 253 | select SYS_SUPPORTS_64BIT_KERNEL if BROKEN |
254 | select SYS_SUPPORTS_LITTLE_ENDIAN | 254 | select SYS_SUPPORTS_LITTLE_ENDIAN |
255 | select GENERIC_HARDIRQS_NO__DO_IRQ | 255 | select GENERIC_HARDIRQS_NO__DO_IRQ |
256 | 256 | ||
@@ -470,11 +470,6 @@ config MIPS_XXS1500 | |||
470 | select SOC_AU1500 | 470 | select SOC_AU1500 |
471 | select SYS_SUPPORTS_LITTLE_ENDIAN | 471 | select SYS_SUPPORTS_LITTLE_ENDIAN |
472 | 472 | ||
473 | config PNX8550_V2PCI | ||
474 | bool "Philips PNX8550 based Viper2-PCI board" | ||
475 | select PNX8550 | ||
476 | select SYS_SUPPORTS_LITTLE_ENDIAN | ||
477 | |||
478 | config PNX8550_JBS | 473 | config PNX8550_JBS |
479 | bool "Philips PNX8550 based JBS board" | 474 | bool "Philips PNX8550 based JBS board" |
480 | select PNX8550 | 475 | select PNX8550 |
@@ -547,6 +542,8 @@ config QEMU | |||
547 | select SYS_SUPPORTS_LITTLE_ENDIAN | 542 | select SYS_SUPPORTS_LITTLE_ENDIAN |
548 | select ARCH_SPARSEMEM_ENABLE | 543 | select ARCH_SPARSEMEM_ENABLE |
549 | select GENERIC_HARDIRQS_NO__DO_IRQ | 544 | select GENERIC_HARDIRQS_NO__DO_IRQ |
545 | select NR_CPUS_DEFAULT_1 | ||
546 | select SYS_SUPPORTS_SMP | ||
550 | help | 547 | help |
551 | Qemu is a software emulator which among other architectures also | 548 | Qemu is a software emulator which among other architectures also |
552 | can simulate a MIPS32 4Kc system. This patch adds support for the | 549 | can simulate a MIPS32 4Kc system. This patch adds support for the |
@@ -1564,6 +1561,7 @@ config MIPS_MT_SMP | |||
1564 | select CPU_MIPSR2_IRQ_VI | 1561 | select CPU_MIPSR2_IRQ_VI |
1565 | select CPU_MIPSR2_SRS | 1562 | select CPU_MIPSR2_SRS |
1566 | select MIPS_MT | 1563 | select MIPS_MT |
1564 | select NR_CPUS_DEFAULT_2 | ||
1567 | select SMP | 1565 | select SMP |
1568 | select SYS_SUPPORTS_SMP | 1566 | select SYS_SUPPORTS_SMP |
1569 | help | 1567 | help |
@@ -1578,7 +1576,6 @@ config MIPS_MT_SMTC | |||
1578 | select CPU_MIPSR2_IRQ_VI | 1576 | select CPU_MIPSR2_IRQ_VI |
1579 | select CPU_MIPSR2_SRS | 1577 | select CPU_MIPSR2_SRS |
1580 | select MIPS_MT | 1578 | select MIPS_MT |
1581 | select NR_CPUS_DEFAULT_2 | ||
1582 | select NR_CPUS_DEFAULT_8 | 1579 | select NR_CPUS_DEFAULT_8 |
1583 | select SMP | 1580 | select SMP |
1584 | select SYS_SUPPORTS_SMP | 1581 | select SYS_SUPPORTS_SMP |
@@ -1810,6 +1807,9 @@ config SMP | |||
1810 | config SYS_SUPPORTS_SMP | 1807 | config SYS_SUPPORTS_SMP |
1811 | bool | 1808 | bool |
1812 | 1809 | ||
1810 | config NR_CPUS_DEFAULT_1 | ||
1811 | bool | ||
1812 | |||
1813 | config NR_CPUS_DEFAULT_2 | 1813 | config NR_CPUS_DEFAULT_2 |
1814 | bool | 1814 | bool |
1815 | 1815 | ||
@@ -1830,8 +1830,9 @@ config NR_CPUS_DEFAULT_64 | |||
1830 | 1830 | ||
1831 | config NR_CPUS | 1831 | config NR_CPUS |
1832 | int "Maximum number of CPUs (2-64)" | 1832 | int "Maximum number of CPUs (2-64)" |
1833 | range 2 64 | 1833 | range 1 64 if NR_CPUS_DEFAULT_1 |
1834 | depends on SMP | 1834 | depends on SMP |
1835 | default "1" if NR_CPUS_DEFAULT_1 | ||
1835 | default "2" if NR_CPUS_DEFAULT_2 | 1836 | default "2" if NR_CPUS_DEFAULT_2 |
1836 | default "4" if NR_CPUS_DEFAULT_4 | 1837 | default "4" if NR_CPUS_DEFAULT_4 |
1837 | default "8" if NR_CPUS_DEFAULT_8 | 1838 | default "8" if NR_CPUS_DEFAULT_8 |
@@ -1842,10 +1843,13 @@ config NR_CPUS | |||
1842 | This allows you to specify the maximum number of CPUs which this | 1843 | This allows you to specify the maximum number of CPUs which this |
1843 | kernel will support. The maximum supported value is 32 for 32-bit | 1844 | kernel will support. The maximum supported value is 32 for 32-bit |
1844 | kernel and 64 for 64-bit kernels; the minimum value which makes | 1845 | kernel and 64 for 64-bit kernels; the minimum value which makes |
1845 | sense is 2. | 1846 | sense is 1 for Qemu (useful only for kernel debugging purposes) |
1847 | and 2 for all others. | ||
1846 | 1848 | ||
1847 | This is purely to save memory - each supported CPU adds | 1849 | This is purely to save memory - each supported CPU adds |
1848 | approximately eight kilobytes to the kernel image. | 1850 | approximately eight kilobytes to the kernel image. For best |
1851 | performance should round up your number of processors to the next | ||
1852 | power of two. | ||
1849 | 1853 | ||
1850 | # | 1854 | # |
1851 | # Timer Interrupt Frequency Configuration | 1855 | # Timer Interrupt Frequency Configuration |
diff --git a/arch/mips/configs/atlas_defconfig b/arch/mips/configs/atlas_defconfig index 458894933a4c..39e251300c64 100644 --- a/arch/mips/configs/atlas_defconfig +++ b/arch/mips/configs/atlas_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_ATLAS=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/bigsur_defconfig b/arch/mips/configs/bigsur_defconfig index aa05e294ea62..4713a13211ce 100644 --- a/arch/mips/configs/bigsur_defconfig +++ b/arch/mips/configs/bigsur_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/capcella_defconfig b/arch/mips/configs/capcella_defconfig index b2594fa556f3..5e7ae56b1f3c 100644 --- a/arch/mips/configs/capcella_defconfig +++ b/arch/mips/configs/capcella_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/cobalt_defconfig b/arch/mips/configs/cobalt_defconfig index 9090a7aba6c1..ba593b510b76 100644 --- a/arch/mips/configs/cobalt_defconfig +++ b/arch/mips/configs/cobalt_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_COBALT=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/db1000_defconfig b/arch/mips/configs/db1000_defconfig index 4cb8cf4255a2..0db6a8b37301 100644 --- a/arch/mips/configs/db1000_defconfig +++ b/arch/mips/configs/db1000_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1000=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/db1100_defconfig b/arch/mips/configs/db1100_defconfig index d86dedf27fc4..162add97c5ef 100644 --- a/arch/mips/configs/db1100_defconfig +++ b/arch/mips/configs/db1100_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1100=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/db1200_defconfig b/arch/mips/configs/db1200_defconfig index c24b6008345e..82801ec43e6a 100644 --- a/arch/mips/configs/db1200_defconfig +++ b/arch/mips/configs/db1200_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1200=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/db1500_defconfig b/arch/mips/configs/db1500_defconfig index baad2c5223ba..545f23094e13 100644 --- a/arch/mips/configs/db1500_defconfig +++ b/arch/mips/configs/db1500_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1500=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/db1550_defconfig b/arch/mips/configs/db1550_defconfig index c29fdab0423a..5bd3b4328e57 100644 --- a/arch/mips/configs/db1550_defconfig +++ b/arch/mips/configs/db1550_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_DB1550=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ddb5477_defconfig b/arch/mips/configs/ddb5477_defconfig index f4b316d2cd70..5b502a2013fb 100644 --- a/arch/mips/configs/ddb5477_defconfig +++ b/arch/mips/configs/ddb5477_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | CONFIG_DDB5477=y | 44 | CONFIG_DDB5477=y |
diff --git a/arch/mips/configs/decstation_defconfig b/arch/mips/configs/decstation_defconfig index 9c38e5c77761..4bbdab078ff1 100644 --- a/arch/mips/configs/decstation_defconfig +++ b/arch/mips/configs/decstation_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MACH_DECSTATION=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/e55_defconfig b/arch/mips/configs/e55_defconfig index 922af379aa41..b5714a6a5398 100644 --- a/arch/mips/configs/e55_defconfig +++ b/arch/mips/configs/e55_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/emma2rh_defconfig b/arch/mips/configs/emma2rh_defconfig index c0db8f14713d..3044579f171a 100644 --- a/arch/mips/configs/emma2rh_defconfig +++ b/arch/mips/configs/emma2rh_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ev64120_defconfig b/arch/mips/configs/ev64120_defconfig index ce088b36291d..c10e4e063226 100644 --- a/arch/mips/configs/ev64120_defconfig +++ b/arch/mips/configs/ev64120_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_EV64120=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/excite_defconfig b/arch/mips/configs/excite_defconfig index 82f204d080b7..460d7a26a8ba 100644 --- a/arch/mips/configs/excite_defconfig +++ b/arch/mips/configs/excite_defconfig | |||
@@ -40,7 +40,6 @@ CONFIG_BASLER_EXCITE=y | |||
40 | # CONFIG_MOMENCO_OCELOT_C is not set | 40 | # CONFIG_MOMENCO_OCELOT_C is not set |
41 | # CONFIG_MOMENCO_OCELOT_G is not set | 41 | # CONFIG_MOMENCO_OCELOT_G is not set |
42 | # CONFIG_MIPS_XXS1500 is not set | 42 | # CONFIG_MIPS_XXS1500 is not set |
43 | # CONFIG_PNX8550_V2PCI is not set | ||
44 | # CONFIG_PNX8550_JBS is not set | 43 | # CONFIG_PNX8550_JBS is not set |
45 | # CONFIG_PNX8550_STB810 is not set | 44 | # CONFIG_PNX8550_STB810 is not set |
46 | # CONFIG_DDB5477 is not set | 45 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ip22_defconfig b/arch/mips/configs/ip22_defconfig index cb81f13bd45a..7ec618f3c8b9 100644 --- a/arch/mips/configs/ip22_defconfig +++ b/arch/mips/configs/ip22_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ip27_defconfig b/arch/mips/configs/ip27_defconfig index 46f6ac4083b9..9ddc3eff4793 100644 --- a/arch/mips/configs/ip27_defconfig +++ b/arch/mips/configs/ip27_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ip32_defconfig b/arch/mips/configs/ip32_defconfig index d9e5000d5329..8fc18809d5ff 100644 --- a/arch/mips/configs/ip32_defconfig +++ b/arch/mips/configs/ip32_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/jaguar-atx_defconfig b/arch/mips/configs/jaguar-atx_defconfig index 57ef0c45a62b..083104daa2ca 100644 --- a/arch/mips/configs/jaguar-atx_defconfig +++ b/arch/mips/configs/jaguar-atx_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_JAGUAR_ATX=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/jazz_defconfig b/arch/mips/configs/jazz_defconfig index 21d979f8326c..9331cb0a19b1 100644 --- a/arch/mips/configs/jazz_defconfig +++ b/arch/mips/configs/jazz_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MACH_JAZZ=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/jmr3927_defconfig b/arch/mips/configs/jmr3927_defconfig index 98b9fbc042f4..21a094752dab 100644 --- a/arch/mips/configs/jmr3927_defconfig +++ b/arch/mips/configs/jmr3927_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/lasat200_defconfig b/arch/mips/configs/lasat200_defconfig index b3f767ff1c5a..fd4272c1458a 100644 --- a/arch/mips/configs/lasat200_defconfig +++ b/arch/mips/configs/lasat200_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_LASAT=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/malta_defconfig b/arch/mips/configs/malta_defconfig index a5f379d626d6..1f64d7632a03 100644 --- a/arch/mips/configs/malta_defconfig +++ b/arch/mips/configs/malta_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_MALTA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/mipssim_defconfig b/arch/mips/configs/mipssim_defconfig index 5ff53e184912..a2db5c201216 100644 --- a/arch/mips/configs/mipssim_defconfig +++ b/arch/mips/configs/mipssim_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_SIM=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/mpc30x_defconfig b/arch/mips/configs/mpc30x_defconfig index 750e6445c613..ad5c0bf87b2b 100644 --- a/arch/mips/configs/mpc30x_defconfig +++ b/arch/mips/configs/mpc30x_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ocelot_3_defconfig b/arch/mips/configs/ocelot_3_defconfig index 2febd0a7fba2..28547313ce13 100644 --- a/arch/mips/configs/ocelot_3_defconfig +++ b/arch/mips/configs/ocelot_3_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_OCELOT_3=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ocelot_c_defconfig b/arch/mips/configs/ocelot_c_defconfig index b8f457300bbf..82ff6fc0cd41 100644 --- a/arch/mips/configs/ocelot_c_defconfig +++ b/arch/mips/configs/ocelot_c_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | CONFIG_MOMENCO_OCELOT_C=y | 39 | CONFIG_MOMENCO_OCELOT_C=y |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ocelot_defconfig b/arch/mips/configs/ocelot_defconfig index 8ade072271cd..15a027e00eec 100644 --- a/arch/mips/configs/ocelot_defconfig +++ b/arch/mips/configs/ocelot_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MOMENCO_OCELOT=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/ocelot_g_defconfig b/arch/mips/configs/ocelot_g_defconfig index d20a2216c11d..7078e6b3ea11 100644 --- a/arch/mips/configs/ocelot_g_defconfig +++ b/arch/mips/configs/ocelot_g_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | CONFIG_MOMENCO_OCELOT_G=y | 40 | CONFIG_MOMENCO_OCELOT_G=y |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pb1100_defconfig b/arch/mips/configs/pb1100_defconfig index 33fcc8133bc0..69678d99ae61 100644 --- a/arch/mips/configs/pb1100_defconfig +++ b/arch/mips/configs/pb1100_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1100=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pb1500_defconfig b/arch/mips/configs/pb1500_defconfig index e07c55dc8dc1..070672799dac 100644 --- a/arch/mips/configs/pb1500_defconfig +++ b/arch/mips/configs/pb1500_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1500=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pb1550_defconfig b/arch/mips/configs/pb1550_defconfig index df210dd22476..354e49b7a5f1 100644 --- a/arch/mips/configs/pb1550_defconfig +++ b/arch/mips/configs/pb1550_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_PB1550=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pnx8550-jbs_defconfig b/arch/mips/configs/pnx8550-jbs_defconfig index 106a1641c0b5..fae16c5ec521 100644 --- a/arch/mips/configs/pnx8550-jbs_defconfig +++ b/arch/mips/configs/pnx8550-jbs_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | CONFIG_PNX8550_JBS=y | 42 | CONFIG_PNX8550_JBS=y |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pnx8550-stb810_defconfig b/arch/mips/configs/pnx8550-stb810_defconfig index 8caa2cd1aa7c..cd821e52181d 100644 --- a/arch/mips/configs/pnx8550-stb810_defconfig +++ b/arch/mips/configs/pnx8550-stb810_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | CONFIG_PNX8550_STB810=y | 43 | CONFIG_PNX8550_STB810=y |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/pnx8550-v2pci_defconfig b/arch/mips/configs/pnx8550-v2pci_defconfig index 43f1becec2a4..3d6c2d743502 100644 --- a/arch/mips/configs/pnx8550-v2pci_defconfig +++ b/arch/mips/configs/pnx8550-v2pci_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | CONFIG_PNX8550_V2PCI=y | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/qemu_defconfig b/arch/mips/configs/qemu_defconfig index f68396d19f9a..8e8d03157954 100644 --- a/arch/mips/configs/qemu_defconfig +++ b/arch/mips/configs/qemu_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/rbhma4500_defconfig b/arch/mips/configs/rbhma4500_defconfig index a6a824fcc874..29e0df9f4be0 100644 --- a/arch/mips/configs/rbhma4500_defconfig +++ b/arch/mips/configs/rbhma4500_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/rm200_defconfig b/arch/mips/configs/rm200_defconfig index bee3702d501d..5593cde9f74c 100644 --- a/arch/mips/configs/rm200_defconfig +++ b/arch/mips/configs/rm200_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/sb1250-swarm_defconfig b/arch/mips/configs/sb1250-swarm_defconfig index 3c891ed10141..6c4f09a381e2 100644 --- a/arch/mips/configs/sb1250-swarm_defconfig +++ b/arch/mips/configs/sb1250-swarm_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/sead_defconfig b/arch/mips/configs/sead_defconfig index e31d964a053b..988b9cdef01f 100644 --- a/arch/mips/configs/sead_defconfig +++ b/arch/mips/configs/sead_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_MIPS_SEAD=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/tb0226_defconfig b/arch/mips/configs/tb0226_defconfig index 5771c1aee76a..b5be8b74d896 100644 --- a/arch/mips/configs/tb0226_defconfig +++ b/arch/mips/configs/tb0226_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/tb0229_defconfig b/arch/mips/configs/tb0229_defconfig index a8eb4b182d34..1756d2bdf6b8 100644 --- a/arch/mips/configs/tb0229_defconfig +++ b/arch/mips/configs/tb0229_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/tb0287_defconfig b/arch/mips/configs/tb0287_defconfig index c58afa2eac6b..8bb6be4342b6 100644 --- a/arch/mips/configs/tb0287_defconfig +++ b/arch/mips/configs/tb0287_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/workpad_defconfig b/arch/mips/configs/workpad_defconfig index 2abbd6827720..8f019ffcc71b 100644 --- a/arch/mips/configs/workpad_defconfig +++ b/arch/mips/configs/workpad_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/wrppmc_defconfig b/arch/mips/configs/wrppmc_defconfig index 44b6b7c1fdb6..52b48c0715d3 100644 --- a/arch/mips/configs/wrppmc_defconfig +++ b/arch/mips/configs/wrppmc_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_WR_PPMC=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/configs/yosemite_defconfig b/arch/mips/configs/yosemite_defconfig index f24e1c6fc484..6824606309e5 100644 --- a/arch/mips/configs/yosemite_defconfig +++ b/arch/mips/configs/yosemite_defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/ddb5xxx/ddb5477/irq.c b/arch/mips/ddb5xxx/ddb5477/irq.c index 2b23234a5b95..faa4a506bf82 100644 --- a/arch/mips/ddb5xxx/ddb5477/irq.c +++ b/arch/mips/ddb5xxx/ddb5477/irq.c | |||
@@ -194,7 +194,7 @@ static void vrc5477_irq_dispatch(void) | |||
194 | 194 | ||
195 | asmlinkage void plat_irq_dispatch(void) | 195 | asmlinkage void plat_irq_dispatch(void) |
196 | { | 196 | { |
197 | unsigned int pending = read_c0_cause() & read_c0_status(); | 197 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; |
198 | 198 | ||
199 | if (pending & STATUSF_IP7) | 199 | if (pending & STATUSF_IP7) |
200 | do_IRQ(CPU_IRQ_BASE + 7); | 200 | do_IRQ(CPU_IRQ_BASE + 7); |
diff --git a/arch/mips/defconfig b/arch/mips/defconfig index 8cb8f5919194..41211f8b7738 100644 --- a/arch/mips/defconfig +++ b/arch/mips/defconfig | |||
@@ -39,7 +39,6 @@ CONFIG_ZONE_DMA=y | |||
39 | # CONFIG_MOMENCO_OCELOT_C is not set | 39 | # CONFIG_MOMENCO_OCELOT_C is not set |
40 | # CONFIG_MOMENCO_OCELOT_G is not set | 40 | # CONFIG_MOMENCO_OCELOT_G is not set |
41 | # CONFIG_MIPS_XXS1500 is not set | 41 | # CONFIG_MIPS_XXS1500 is not set |
42 | # CONFIG_PNX8550_V2PCI is not set | ||
43 | # CONFIG_PNX8550_JBS is not set | 42 | # CONFIG_PNX8550_JBS is not set |
44 | # CONFIG_PNX8550_STB810 is not set | 43 | # CONFIG_PNX8550_STB810 is not set |
45 | # CONFIG_DDB5477 is not set | 44 | # CONFIG_DDB5477 is not set |
diff --git a/arch/mips/emma2rh/markeins/irq.c b/arch/mips/emma2rh/markeins/irq.c index e26630026375..6bcf6a06367a 100644 --- a/arch/mips/emma2rh/markeins/irq.c +++ b/arch/mips/emma2rh/markeins/irq.c | |||
@@ -115,7 +115,7 @@ void __init arch_init_irq(void) | |||
115 | 115 | ||
116 | asmlinkage void plat_irq_dispatch(void) | 116 | asmlinkage void plat_irq_dispatch(void) |
117 | { | 117 | { |
118 | unsigned int pending = read_c0_status() & read_c0_cause(); | 118 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
119 | 119 | ||
120 | if (pending & STATUSF_IP7) | 120 | if (pending & STATUSF_IP7) |
121 | do_IRQ(CPU_IRQ_BASE + 7); | 121 | do_IRQ(CPU_IRQ_BASE + 7); |
diff --git a/arch/mips/gt64120/ev64120/irq.c b/arch/mips/gt64120/ev64120/irq.c index 04572b9c9642..64e4c80b6139 100644 --- a/arch/mips/gt64120/ev64120/irq.c +++ b/arch/mips/gt64120/ev64120/irq.c | |||
@@ -48,7 +48,7 @@ | |||
48 | 48 | ||
49 | asmlinkage void plat_irq_dispatch(void) | 49 | asmlinkage void plat_irq_dispatch(void) |
50 | { | 50 | { |
51 | unsigned int pending = read_c0_status() & read_c0_cause(); | 51 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
52 | 52 | ||
53 | if (pending & STATUSF_IP4) /* int2 hardware line (timer) */ | 53 | if (pending & STATUSF_IP4) /* int2 hardware line (timer) */ |
54 | do_IRQ(4); | 54 | do_IRQ(4); |
diff --git a/arch/mips/gt64120/wrppmc/irq.c b/arch/mips/gt64120/wrppmc/irq.c index d3d96591780e..06177bf5b1d6 100644 --- a/arch/mips/gt64120/wrppmc/irq.c +++ b/arch/mips/gt64120/wrppmc/irq.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | asmlinkage void plat_irq_dispatch(void) | 33 | asmlinkage void plat_irq_dispatch(void) |
34 | { | 34 | { |
35 | unsigned int pending = read_c0_status() & read_c0_cause(); | 35 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
36 | 36 | ||
37 | if (pending & STATUSF_IP7) | 37 | if (pending & STATUSF_IP7) |
38 | do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */ | 38 | do_IRQ(WRPPMC_MIPS_TIMER_IRQ); /* CPU Compare/Count internal timer */ |
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index 295892e4ce53..015cf4bb51dd 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c | |||
@@ -122,7 +122,7 @@ static void ll_local_dev(void) | |||
122 | 122 | ||
123 | asmlinkage void plat_irq_dispatch(void) | 123 | asmlinkage void plat_irq_dispatch(void) |
124 | { | 124 | { |
125 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; | 125 | unsigned int pending = read_c0_cause() & read_c0_status(); |
126 | 126 | ||
127 | if (pending & IE_IRQ5) | 127 | if (pending & IE_IRQ5) |
128 | write_c0_compare(0); | 128 | write_c0_compare(0); |
diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S index aacd4a005c5f..83843a229be7 100644 --- a/arch/mips/kernel/genex.S +++ b/arch/mips/kernel/genex.S | |||
@@ -181,13 +181,13 @@ NESTED(except_vec_vi, 0, sp) | |||
181 | * during service by SMTC kernel, we also want to | 181 | * during service by SMTC kernel, we also want to |
182 | * pass the IM value to be cleared. | 182 | * pass the IM value to be cleared. |
183 | */ | 183 | */ |
184 | EXPORT(except_vec_vi_mori) | 184 | FEXPORT(except_vec_vi_mori) |
185 | ori a0, $0, 0 | 185 | ori a0, $0, 0 |
186 | #endif /* CONFIG_MIPS_MT_SMTC */ | 186 | #endif /* CONFIG_MIPS_MT_SMTC */ |
187 | EXPORT(except_vec_vi_lui) | 187 | FEXPORT(except_vec_vi_lui) |
188 | lui v0, 0 /* Patched */ | 188 | lui v0, 0 /* Patched */ |
189 | j except_vec_vi_handler | 189 | j except_vec_vi_handler |
190 | EXPORT(except_vec_vi_ori) | 190 | FEXPORT(except_vec_vi_ori) |
191 | ori v0, 0 /* Patched */ | 191 | ori v0, 0 /* Patched */ |
192 | .set pop | 192 | .set pop |
193 | END(except_vec_vi) | 193 | END(except_vec_vi) |
@@ -220,7 +220,17 @@ NESTED(except_vec_vi_handler, 0, sp) | |||
220 | _ehb | 220 | _ehb |
221 | #endif /* CONFIG_MIPS_MT_SMTC */ | 221 | #endif /* CONFIG_MIPS_MT_SMTC */ |
222 | CLI | 222 | CLI |
223 | #ifdef CONFIG_TRACE_IRQFLAGS | ||
224 | move s0, v0 | ||
225 | #ifdef CONFIG_MIPS_MT_SMTC | ||
226 | move s1, a0 | ||
227 | #endif | ||
223 | TRACE_IRQS_OFF | 228 | TRACE_IRQS_OFF |
229 | #ifdef CONFIG_MIPS_MT_SMTC | ||
230 | move a0, s1 | ||
231 | #endif | ||
232 | move v0, s0 | ||
233 | #endif | ||
224 | 234 | ||
225 | LONG_L s0, TI_REGS($28) | 235 | LONG_L s0, TI_REGS($28) |
226 | LONG_S sp, TI_REGS($28) | 236 | LONG_S sp, TI_REGS($28) |
diff --git a/arch/mips/kernel/kspd.c b/arch/mips/kernel/kspd.c index 5929f883e46b..29eadd404fa5 100644 --- a/arch/mips/kernel/kspd.c +++ b/arch/mips/kernel/kspd.c | |||
@@ -70,6 +70,7 @@ static int sp_stopping = 0; | |||
70 | #define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7) | 70 | #define MTSP_SYSCALL_GETTIME (MTSP_SYSCALL_BASE + 7) |
71 | #define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8) | 71 | #define MTSP_SYSCALL_PIPEFREQ (MTSP_SYSCALL_BASE + 8) |
72 | #define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9) | 72 | #define MTSP_SYSCALL_GETTOD (MTSP_SYSCALL_BASE + 9) |
73 | #define MTSP_SYSCALL_IOCTL (MTSP_SYSCALL_BASE + 10) | ||
73 | 74 | ||
74 | #define MTSP_O_RDONLY 0x0000 | 75 | #define MTSP_O_RDONLY 0x0000 |
75 | #define MTSP_O_WRONLY 0x0001 | 76 | #define MTSP_O_WRONLY 0x0001 |
@@ -110,7 +111,8 @@ struct apsp_table syscall_command_table[] = { | |||
110 | { MTSP_SYSCALL_CLOSE, __NR_close }, | 111 | { MTSP_SYSCALL_CLOSE, __NR_close }, |
111 | { MTSP_SYSCALL_READ, __NR_read }, | 112 | { MTSP_SYSCALL_READ, __NR_read }, |
112 | { MTSP_SYSCALL_WRITE, __NR_write }, | 113 | { MTSP_SYSCALL_WRITE, __NR_write }, |
113 | { MTSP_SYSCALL_LSEEK32, __NR_lseek } | 114 | { MTSP_SYSCALL_LSEEK32, __NR_lseek }, |
115 | { MTSP_SYSCALL_IOCTL, __NR_ioctl } | ||
114 | }; | 116 | }; |
115 | 117 | ||
116 | static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3) | 118 | static int sp_syscall(int num, int arg0, int arg1, int arg2, int arg3) |
@@ -189,6 +191,8 @@ void sp_work_handle_request(void) | |||
189 | struct mtsp_syscall_generic generic; | 191 | struct mtsp_syscall_generic generic; |
190 | struct mtsp_syscall_ret ret; | 192 | struct mtsp_syscall_ret ret; |
191 | struct kspd_notifications *n; | 193 | struct kspd_notifications *n; |
194 | unsigned long written; | ||
195 | mm_segment_t old_fs; | ||
192 | struct timeval tv; | 196 | struct timeval tv; |
193 | struct timezone tz; | 197 | struct timezone tz; |
194 | int cmd; | 198 | int cmd; |
@@ -199,7 +203,11 @@ void sp_work_handle_request(void) | |||
199 | 203 | ||
200 | ret.retval = -1; | 204 | ret.retval = -1; |
201 | 205 | ||
202 | if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall), 0)) { | 206 | old_fs = get_fs(); |
207 | set_fs(KERNEL_DS); | ||
208 | |||
209 | if (!rtlx_read(RTLX_CHANNEL_SYSIO, &sc, sizeof(struct mtsp_syscall))) { | ||
210 | set_fs(old_fs); | ||
203 | printk(KERN_ERR "Expected request but nothing to read\n"); | 211 | printk(KERN_ERR "Expected request but nothing to read\n"); |
204 | return; | 212 | return; |
205 | } | 213 | } |
@@ -207,7 +215,8 @@ void sp_work_handle_request(void) | |||
207 | size = sc.size; | 215 | size = sc.size; |
208 | 216 | ||
209 | if (size) { | 217 | if (size) { |
210 | if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size, 0)) { | 218 | if (!rtlx_read(RTLX_CHANNEL_SYSIO, &generic, size)) { |
219 | set_fs(old_fs); | ||
211 | printk(KERN_ERR "Expected request but nothing to read\n"); | 220 | printk(KERN_ERR "Expected request but nothing to read\n"); |
212 | return; | 221 | return; |
213 | } | 222 | } |
@@ -280,8 +289,11 @@ void sp_work_handle_request(void) | |||
280 | if (vpe_getuid(SP_VPE)) | 289 | if (vpe_getuid(SP_VPE)) |
281 | sp_setfsuidgid( 0, 0); | 290 | sp_setfsuidgid( 0, 0); |
282 | 291 | ||
283 | if ((rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(struct mtsp_syscall_ret), 0)) | 292 | old_fs = get_fs(); |
284 | < sizeof(struct mtsp_syscall_ret)) | 293 | set_fs(KERNEL_DS); |
294 | written = rtlx_write(RTLX_CHANNEL_SYSIO, &ret, sizeof(ret)); | ||
295 | set_fs(old_fs); | ||
296 | if (written < sizeof(ret)) | ||
285 | printk("KSPD: sp_work_handle_request failed to send to SP\n"); | 297 | printk("KSPD: sp_work_handle_request failed to send to SP\n"); |
286 | } | 298 | } |
287 | 299 | ||
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index 1df544c1f966..37849edd0645 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -311,6 +311,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | |||
311 | return ret; | 311 | return ret; |
312 | } | 312 | } |
313 | 313 | ||
314 | #ifdef CONFIG_SYSVIPC | ||
315 | |||
314 | asmlinkage long | 316 | asmlinkage long |
315 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 317 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) |
316 | { | 318 | { |
@@ -368,6 +370,16 @@ sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
368 | return err; | 370 | return err; |
369 | } | 371 | } |
370 | 372 | ||
373 | #else | ||
374 | |||
375 | asmlinkage long | ||
376 | sys32_ipc (u32 call, int first, int second, int third, u32 ptr, u32 fifth) | ||
377 | { | ||
378 | return -ENOSYS; | ||
379 | } | ||
380 | |||
381 | #endif /* CONFIG_SYSVIPC */ | ||
382 | |||
371 | #ifdef CONFIG_MIPS32_N32 | 383 | #ifdef CONFIG_MIPS32_N32 |
372 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | 384 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) |
373 | { | 385 | { |
diff --git a/arch/mips/kernel/r2300_switch.S b/arch/mips/kernel/r2300_switch.S index 656bde2e11b1..28c2e2e6af73 100644 --- a/arch/mips/kernel/r2300_switch.S +++ b/arch/mips/kernel/r2300_switch.S | |||
@@ -49,8 +49,7 @@ LEAF(resume) | |||
49 | #ifndef CONFIG_CPU_HAS_LLSC | 49 | #ifndef CONFIG_CPU_HAS_LLSC |
50 | sw zero, ll_bit | 50 | sw zero, ll_bit |
51 | #endif | 51 | #endif |
52 | mfc0 t1, CP0_STATUS | 52 | mfc0 t2, CP0_STATUS |
53 | sw t1, THREAD_STATUS(a0) | ||
54 | cpu_save_nonscratch a0 | 53 | cpu_save_nonscratch a0 |
55 | sw ra, THREAD_REG31(a0) | 54 | sw ra, THREAD_REG31(a0) |
56 | 55 | ||
@@ -60,8 +59,8 @@ LEAF(resume) | |||
60 | lw t3, TASK_THREAD_INFO(a0) | 59 | lw t3, TASK_THREAD_INFO(a0) |
61 | lw t0, TI_FLAGS(t3) | 60 | lw t0, TI_FLAGS(t3) |
62 | li t1, _TIF_USEDFPU | 61 | li t1, _TIF_USEDFPU |
63 | and t2, t0, t1 | 62 | and t1, t0 |
64 | beqz t2, 1f | 63 | beqz t1, 1f |
65 | nor t1, zero, t1 | 64 | nor t1, zero, t1 |
66 | 65 | ||
67 | and t0, t0, t1 | 66 | and t0, t0, t1 |
@@ -74,10 +73,13 @@ LEAF(resume) | |||
74 | li t1, ~ST0_CU1 | 73 | li t1, ~ST0_CU1 |
75 | and t0, t0, t1 | 74 | and t0, t0, t1 |
76 | sw t0, ST_OFF(t3) | 75 | sw t0, ST_OFF(t3) |
76 | /* clear thread_struct CU1 bit */ | ||
77 | and t2, t1 | ||
77 | 78 | ||
78 | fpu_save_single a0, t0 # clobbers t0 | 79 | fpu_save_single a0, t0 # clobbers t0 |
79 | 80 | ||
80 | 1: | 81 | 1: |
82 | sw t2, THREAD_STATUS(a0) | ||
81 | /* | 83 | /* |
82 | * The order of restoring the registers takes care of the race | 84 | * The order of restoring the registers takes care of the race |
83 | * updating $28, $29 and kernelsp without disabling ints. | 85 | * updating $28, $29 and kernelsp without disabling ints. |
diff --git a/arch/mips/kernel/r4k_fpu.S b/arch/mips/kernel/r4k_fpu.S index 59c1577ecbb3..dbd42adc52ed 100644 --- a/arch/mips/kernel/r4k_fpu.S +++ b/arch/mips/kernel/r4k_fpu.S | |||
@@ -114,14 +114,6 @@ LEAF(_save_fp_context32) | |||
114 | */ | 114 | */ |
115 | LEAF(_restore_fp_context) | 115 | LEAF(_restore_fp_context) |
116 | EX lw t0, SC_FPC_CSR(a0) | 116 | EX lw t0, SC_FPC_CSR(a0) |
117 | |||
118 | /* Fail if the CSR has exceptions pending */ | ||
119 | srl t1, t0, 5 | ||
120 | and t1, t0 | ||
121 | andi t1, 0x1f << 7 | ||
122 | bnez t1, fault | ||
123 | nop | ||
124 | |||
125 | #ifdef CONFIG_64BIT | 117 | #ifdef CONFIG_64BIT |
126 | EX ldc1 $f1, SC_FPREGS+8(a0) | 118 | EX ldc1 $f1, SC_FPREGS+8(a0) |
127 | EX ldc1 $f3, SC_FPREGS+24(a0) | 119 | EX ldc1 $f3, SC_FPREGS+24(a0) |
@@ -165,14 +157,6 @@ LEAF(_restore_fp_context) | |||
165 | LEAF(_restore_fp_context32) | 157 | LEAF(_restore_fp_context32) |
166 | /* Restore an o32 sigcontext. */ | 158 | /* Restore an o32 sigcontext. */ |
167 | EX lw t0, SC32_FPC_CSR(a0) | 159 | EX lw t0, SC32_FPC_CSR(a0) |
168 | |||
169 | /* Fail if the CSR has exceptions pending */ | ||
170 | srl t1, t0, 5 | ||
171 | and t1, t0 | ||
172 | andi t1, 0x1f << 7 | ||
173 | bnez t1, fault | ||
174 | nop | ||
175 | |||
176 | EX ldc1 $f0, SC32_FPREGS+0(a0) | 160 | EX ldc1 $f0, SC32_FPREGS+0(a0) |
177 | EX ldc1 $f2, SC32_FPREGS+16(a0) | 161 | EX ldc1 $f2, SC32_FPREGS+16(a0) |
178 | EX ldc1 $f4, SC32_FPREGS+32(a0) | 162 | EX ldc1 $f4, SC32_FPREGS+32(a0) |
diff --git a/arch/mips/kernel/r4k_switch.S b/arch/mips/kernel/r4k_switch.S index cc566cf12246..c7698fd9955c 100644 --- a/arch/mips/kernel/r4k_switch.S +++ b/arch/mips/kernel/r4k_switch.S | |||
@@ -48,8 +48,7 @@ | |||
48 | #ifndef CONFIG_CPU_HAS_LLSC | 48 | #ifndef CONFIG_CPU_HAS_LLSC |
49 | sw zero, ll_bit | 49 | sw zero, ll_bit |
50 | #endif | 50 | #endif |
51 | mfc0 t1, CP0_STATUS | 51 | mfc0 t2, CP0_STATUS |
52 | LONG_S t1, THREAD_STATUS(a0) | ||
53 | cpu_save_nonscratch a0 | 52 | cpu_save_nonscratch a0 |
54 | LONG_S ra, THREAD_REG31(a0) | 53 | LONG_S ra, THREAD_REG31(a0) |
55 | 54 | ||
@@ -59,8 +58,8 @@ | |||
59 | PTR_L t3, TASK_THREAD_INFO(a0) | 58 | PTR_L t3, TASK_THREAD_INFO(a0) |
60 | LONG_L t0, TI_FLAGS(t3) | 59 | LONG_L t0, TI_FLAGS(t3) |
61 | li t1, _TIF_USEDFPU | 60 | li t1, _TIF_USEDFPU |
62 | and t2, t0, t1 | 61 | and t1, t0 |
63 | beqz t2, 1f | 62 | beqz t1, 1f |
64 | nor t1, zero, t1 | 63 | nor t1, zero, t1 |
65 | 64 | ||
66 | and t0, t0, t1 | 65 | and t0, t0, t1 |
@@ -73,10 +72,13 @@ | |||
73 | li t1, ~ST0_CU1 | 72 | li t1, ~ST0_CU1 |
74 | and t0, t0, t1 | 73 | and t0, t0, t1 |
75 | LONG_S t0, ST_OFF(t3) | 74 | LONG_S t0, ST_OFF(t3) |
75 | /* clear thread_struct CU1 bit */ | ||
76 | and t2, t1 | ||
76 | 77 | ||
77 | fpu_save_double a0 t0 t1 # c0_status passed in t0 | 78 | fpu_save_double a0 t0 t1 # c0_status passed in t0 |
78 | # clobbers t1 | 79 | # clobbers t1 |
79 | 1: | 80 | 1: |
81 | LONG_S t2, THREAD_STATUS(a0) | ||
80 | 82 | ||
81 | /* | 83 | /* |
82 | * The order of restoring the registers takes care of the race | 84 | * The order of restoring the registers takes care of the race |
diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index e14ae09eda2b..e6e3047151a6 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c | |||
@@ -54,6 +54,7 @@ static struct chan_waitqueues { | |||
54 | wait_queue_head_t rt_queue; | 54 | wait_queue_head_t rt_queue; |
55 | wait_queue_head_t lx_queue; | 55 | wait_queue_head_t lx_queue; |
56 | atomic_t in_open; | 56 | atomic_t in_open; |
57 | struct mutex mutex; | ||
57 | } channel_wqs[RTLX_CHANNELS]; | 58 | } channel_wqs[RTLX_CHANNELS]; |
58 | 59 | ||
59 | static struct irqaction irq; | 60 | static struct irqaction irq; |
@@ -146,7 +147,7 @@ static void stopping(int vpe) | |||
146 | 147 | ||
147 | int rtlx_open(int index, int can_sleep) | 148 | int rtlx_open(int index, int can_sleep) |
148 | { | 149 | { |
149 | volatile struct rtlx_info **p; | 150 | struct rtlx_info **p; |
150 | struct rtlx_channel *chan; | 151 | struct rtlx_channel *chan; |
151 | enum rtlx_state state; | 152 | enum rtlx_state state; |
152 | int ret = 0; | 153 | int ret = 0; |
@@ -179,13 +180,24 @@ int rtlx_open(int index, int can_sleep) | |||
179 | } | 180 | } |
180 | } | 181 | } |
181 | 182 | ||
183 | smp_rmb(); | ||
182 | if (*p == NULL) { | 184 | if (*p == NULL) { |
183 | if (can_sleep) { | 185 | if (can_sleep) { |
184 | __wait_event_interruptible(channel_wqs[index].lx_queue, | 186 | DEFINE_WAIT(wait); |
185 | *p != NULL, | 187 | |
186 | ret); | 188 | for (;;) { |
187 | if (ret) | 189 | prepare_to_wait(&channel_wqs[index].lx_queue, &wait, TASK_INTERRUPTIBLE); |
190 | smp_rmb(); | ||
191 | if (*p != NULL) | ||
192 | break; | ||
193 | if (!signal_pending(current)) { | ||
194 | schedule(); | ||
195 | continue; | ||
196 | } | ||
197 | ret = -ERESTARTSYS; | ||
188 | goto out_fail; | 198 | goto out_fail; |
199 | } | ||
200 | finish_wait(&channel_wqs[index].lx_queue, &wait); | ||
189 | } else { | 201 | } else { |
190 | printk(" *vpe_get_shared is NULL. " | 202 | printk(" *vpe_get_shared is NULL. " |
191 | "Has an SP program been loaded?\n"); | 203 | "Has an SP program been loaded?\n"); |
@@ -277,56 +289,52 @@ unsigned int rtlx_write_poll(int index) | |||
277 | return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size); | 289 | return write_spacefree(chan->rt_read, chan->rt_write, chan->buffer_size); |
278 | } | 290 | } |
279 | 291 | ||
280 | static inline void copy_to(void *dst, void *src, size_t count, int user) | 292 | ssize_t rtlx_read(int index, void __user *buff, size_t count, int user) |
281 | { | ||
282 | if (user) | ||
283 | copy_to_user(dst, src, count); | ||
284 | else | ||
285 | memcpy(dst, src, count); | ||
286 | } | ||
287 | |||
288 | static inline void copy_from(void *dst, void *src, size_t count, int user) | ||
289 | { | 293 | { |
290 | if (user) | 294 | size_t lx_write, fl = 0L; |
291 | copy_from_user(dst, src, count); | ||
292 | else | ||
293 | memcpy(dst, src, count); | ||
294 | } | ||
295 | |||
296 | ssize_t rtlx_read(int index, void *buff, size_t count, int user) | ||
297 | { | ||
298 | size_t fl = 0L; | ||
299 | struct rtlx_channel *lx; | 295 | struct rtlx_channel *lx; |
296 | unsigned long failed; | ||
300 | 297 | ||
301 | if (rtlx == NULL) | 298 | if (rtlx == NULL) |
302 | return -ENOSYS; | 299 | return -ENOSYS; |
303 | 300 | ||
304 | lx = &rtlx->channel[index]; | 301 | lx = &rtlx->channel[index]; |
305 | 302 | ||
303 | mutex_lock(&channel_wqs[index].mutex); | ||
304 | smp_rmb(); | ||
305 | lx_write = lx->lx_write; | ||
306 | |||
306 | /* find out how much in total */ | 307 | /* find out how much in total */ |
307 | count = min(count, | 308 | count = min(count, |
308 | (size_t)(lx->lx_write + lx->buffer_size - lx->lx_read) | 309 | (size_t)(lx_write + lx->buffer_size - lx->lx_read) |
309 | % lx->buffer_size); | 310 | % lx->buffer_size); |
310 | 311 | ||
311 | /* then how much from the read pointer onwards */ | 312 | /* then how much from the read pointer onwards */ |
312 | fl = min( count, (size_t)lx->buffer_size - lx->lx_read); | 313 | fl = min(count, (size_t)lx->buffer_size - lx->lx_read); |
313 | 314 | ||
314 | copy_to(buff, &lx->lx_buffer[lx->lx_read], fl, user); | 315 | failed = copy_to_user(buff, lx->lx_buffer + lx->lx_read, fl); |
316 | if (failed) | ||
317 | goto out; | ||
315 | 318 | ||
316 | /* and if there is anything left at the beginning of the buffer */ | 319 | /* and if there is anything left at the beginning of the buffer */ |
317 | if ( count - fl ) | 320 | if (count - fl) |
318 | copy_to (buff + fl, lx->lx_buffer, count - fl, user); | 321 | failed = copy_to_user(buff + fl, lx->lx_buffer, count - fl); |
319 | 322 | ||
320 | /* update the index */ | 323 | out: |
321 | lx->lx_read += count; | 324 | count -= failed; |
322 | lx->lx_read %= lx->buffer_size; | 325 | |
326 | smp_wmb(); | ||
327 | lx->lx_read = (lx->lx_read + count) % lx->buffer_size; | ||
328 | smp_wmb(); | ||
329 | mutex_unlock(&channel_wqs[index].mutex); | ||
323 | 330 | ||
324 | return count; | 331 | return count; |
325 | } | 332 | } |
326 | 333 | ||
327 | ssize_t rtlx_write(int index, void *buffer, size_t count, int user) | 334 | ssize_t rtlx_write(int index, const void __user *buffer, size_t count, int user) |
328 | { | 335 | { |
329 | struct rtlx_channel *rt; | 336 | struct rtlx_channel *rt; |
337 | size_t rt_read; | ||
330 | size_t fl; | 338 | size_t fl; |
331 | 339 | ||
332 | if (rtlx == NULL) | 340 | if (rtlx == NULL) |
@@ -334,24 +342,35 @@ ssize_t rtlx_write(int index, void *buffer, size_t count, int user) | |||
334 | 342 | ||
335 | rt = &rtlx->channel[index]; | 343 | rt = &rtlx->channel[index]; |
336 | 344 | ||
345 | mutex_lock(&channel_wqs[index].mutex); | ||
346 | smp_rmb(); | ||
347 | rt_read = rt->rt_read; | ||
348 | |||
337 | /* total number of bytes to copy */ | 349 | /* total number of bytes to copy */ |
338 | count = min(count, | 350 | count = min(count, |
339 | (size_t)write_spacefree(rt->rt_read, rt->rt_write, | 351 | (size_t)write_spacefree(rt_read, rt->rt_write, rt->buffer_size)); |
340 | rt->buffer_size)); | ||
341 | 352 | ||
342 | /* first bit from write pointer to the end of the buffer, or count */ | 353 | /* first bit from write pointer to the end of the buffer, or count */ |
343 | fl = min(count, (size_t) rt->buffer_size - rt->rt_write); | 354 | fl = min(count, (size_t) rt->buffer_size - rt->rt_write); |
344 | 355 | ||
345 | copy_from (&rt->rt_buffer[rt->rt_write], buffer, fl, user); | 356 | failed = copy_from_user(rt->rt_buffer + rt->rt_write, buffer, fl); |
357 | if (failed) | ||
358 | goto out; | ||
346 | 359 | ||
347 | /* if there's any left copy to the beginning of the buffer */ | 360 | /* if there's any left copy to the beginning of the buffer */ |
348 | if( count - fl ) | 361 | if (count - fl) { |
349 | copy_from (rt->rt_buffer, buffer + fl, count - fl, user); | 362 | failed = copy_from_user(rt->rt_buffer, buffer + fl, count - fl); |
363 | } | ||
364 | |||
365 | out: | ||
366 | count -= cailed; | ||
350 | 367 | ||
351 | rt->rt_write += count; | 368 | smp_wmb(); |
352 | rt->rt_write %= rt->buffer_size; | 369 | rt->rt_write = (rt->rt_write + count) % rt->buffer_size; |
370 | smp_wmb(); | ||
371 | mutex_unlock(&channel_wqs[index].mutex); | ||
353 | 372 | ||
354 | return(count); | 373 | return count; |
355 | } | 374 | } |
356 | 375 | ||
357 | 376 | ||
@@ -403,7 +422,7 @@ static ssize_t file_read(struct file *file, char __user * buffer, size_t count, | |||
403 | return 0; // -EAGAIN makes cat whinge | 422 | return 0; // -EAGAIN makes cat whinge |
404 | } | 423 | } |
405 | 424 | ||
406 | return rtlx_read(minor, buffer, count, 1); | 425 | return rtlx_read(minor, buffer, count); |
407 | } | 426 | } |
408 | 427 | ||
409 | static ssize_t file_write(struct file *file, const char __user * buffer, | 428 | static ssize_t file_write(struct file *file, const char __user * buffer, |
@@ -429,7 +448,7 @@ static ssize_t file_write(struct file *file, const char __user * buffer, | |||
429 | return ret; | 448 | return ret; |
430 | } | 449 | } |
431 | 450 | ||
432 | return rtlx_write(minor, (void *)buffer, count, 1); | 451 | return rtlx_write(minor, buffer, count); |
433 | } | 452 | } |
434 | 453 | ||
435 | static const struct file_operations rtlx_fops = { | 454 | static const struct file_operations rtlx_fops = { |
@@ -468,6 +487,7 @@ static int rtlx_module_init(void) | |||
468 | init_waitqueue_head(&channel_wqs[i].rt_queue); | 487 | init_waitqueue_head(&channel_wqs[i].rt_queue); |
469 | init_waitqueue_head(&channel_wqs[i].lx_queue); | 488 | init_waitqueue_head(&channel_wqs[i].lx_queue); |
470 | atomic_set(&channel_wqs[i].in_open, 0); | 489 | atomic_set(&channel_wqs[i].in_open, 0); |
490 | mutex_init(&channel_wqs[i].mutex); | ||
471 | 491 | ||
472 | dev = device_create(mt_class, NULL, MKDEV(major, i), | 492 | dev = device_create(mt_class, NULL, MKDEV(major, i), |
473 | "%s%d", module_name, i); | 493 | "%s%d", module_name, i); |
diff --git a/arch/mips/kernel/signal-common.h b/arch/mips/kernel/signal-common.h index fdbdbdc65b54..297dfcb97524 100644 --- a/arch/mips/kernel/signal-common.h +++ b/arch/mips/kernel/signal-common.h | |||
@@ -31,4 +31,7 @@ extern void __user *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs, | |||
31 | */ | 31 | */ |
32 | extern int install_sigtramp(unsigned int __user *tramp, unsigned int syscall); | 32 | extern int install_sigtramp(unsigned int __user *tramp, unsigned int syscall); |
33 | 33 | ||
34 | /* Check and clear pending FPU exceptions in saved CSR */ | ||
35 | extern int fpcsr_pending(unsigned int __user *fpcsr); | ||
36 | |||
34 | #endif /* __SIGNAL_COMMON_H */ | 37 | #endif /* __SIGNAL_COMMON_H */ |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index f091786187a6..8c3c5a5789b0 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -82,6 +82,7 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
82 | { | 82 | { |
83 | int err = 0; | 83 | int err = 0; |
84 | int i; | 84 | int i; |
85 | unsigned int used_math; | ||
85 | 86 | ||
86 | err |= __put_user(regs->cp0_epc, &sc->sc_pc); | 87 | err |= __put_user(regs->cp0_epc, &sc->sc_pc); |
87 | 88 | ||
@@ -104,26 +105,53 @@ int setup_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
104 | err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); | 105 | err |= __put_user(rddsp(DSP_MASK), &sc->sc_dsp); |
105 | } | 106 | } |
106 | 107 | ||
107 | err |= __put_user(!!used_math(), &sc->sc_used_math); | 108 | used_math = !!used_math(); |
109 | err |= __put_user(used_math, &sc->sc_used_math); | ||
108 | 110 | ||
109 | if (used_math()) { | 111 | if (used_math) { |
110 | /* | 112 | /* |
111 | * Save FPU state to signal context. Signal handler | 113 | * Save FPU state to signal context. Signal handler |
112 | * will "inherit" current FPU state. | 114 | * will "inherit" current FPU state. |
113 | */ | 115 | */ |
114 | preempt_disable(); | 116 | own_fpu(1); |
115 | 117 | enable_fp_in_kernel(); | |
116 | if (!is_fpu_owner()) { | ||
117 | own_fpu(); | ||
118 | restore_fp(current); | ||
119 | } | ||
120 | err |= save_fp_context(sc); | 118 | err |= save_fp_context(sc); |
121 | 119 | disable_fp_in_kernel(); | |
122 | preempt_enable(); | ||
123 | } | 120 | } |
124 | return err; | 121 | return err; |
125 | } | 122 | } |
126 | 123 | ||
124 | int fpcsr_pending(unsigned int __user *fpcsr) | ||
125 | { | ||
126 | int err, sig = 0; | ||
127 | unsigned int csr, enabled; | ||
128 | |||
129 | err = __get_user(csr, fpcsr); | ||
130 | enabled = FPU_CSR_UNI_X | ((csr & FPU_CSR_ALL_E) << 5); | ||
131 | /* | ||
132 | * If the signal handler set some FPU exceptions, clear it and | ||
133 | * send SIGFPE. | ||
134 | */ | ||
135 | if (csr & enabled) { | ||
136 | csr &= ~enabled; | ||
137 | err |= __put_user(csr, fpcsr); | ||
138 | sig = SIGFPE; | ||
139 | } | ||
140 | return err ?: sig; | ||
141 | } | ||
142 | |||
143 | static int | ||
144 | check_and_restore_fp_context(struct sigcontext __user *sc) | ||
145 | { | ||
146 | int err, sig; | ||
147 | |||
148 | err = sig = fpcsr_pending(&sc->sc_fpc_csr); | ||
149 | if (err > 0) | ||
150 | err = 0; | ||
151 | err |= restore_fp_context(sc); | ||
152 | return err ?: sig; | ||
153 | } | ||
154 | |||
127 | int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | 155 | int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) |
128 | { | 156 | { |
129 | unsigned int used_math; | 157 | unsigned int used_math; |
@@ -157,19 +185,18 @@ int restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc) | |||
157 | err |= __get_user(used_math, &sc->sc_used_math); | 185 | err |= __get_user(used_math, &sc->sc_used_math); |
158 | conditional_used_math(used_math); | 186 | conditional_used_math(used_math); |
159 | 187 | ||
160 | preempt_disable(); | 188 | if (used_math) { |
161 | |||
162 | if (used_math()) { | ||
163 | /* restore fpu context if we have used it before */ | 189 | /* restore fpu context if we have used it before */ |
164 | own_fpu(); | 190 | own_fpu(0); |
165 | err |= restore_fp_context(sc); | 191 | enable_fp_in_kernel(); |
192 | if (!err) | ||
193 | err = check_and_restore_fp_context(sc); | ||
194 | disable_fp_in_kernel(); | ||
166 | } else { | 195 | } else { |
167 | /* signal handler may have used FPU. Give it up. */ | 196 | /* signal handler may have used FPU. Give it up. */ |
168 | lose_fpu(); | 197 | lose_fpu(0); |
169 | } | 198 | } |
170 | 199 | ||
171 | preempt_enable(); | ||
172 | |||
173 | return err; | 200 | return err; |
174 | } | 201 | } |
175 | 202 | ||
@@ -332,6 +359,7 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
332 | { | 359 | { |
333 | struct sigframe __user *frame; | 360 | struct sigframe __user *frame; |
334 | sigset_t blocked; | 361 | sigset_t blocked; |
362 | int sig; | ||
335 | 363 | ||
336 | frame = (struct sigframe __user *) regs.regs[29]; | 364 | frame = (struct sigframe __user *) regs.regs[29]; |
337 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 365 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
@@ -345,8 +373,11 @@ asmlinkage void sys_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
345 | recalc_sigpending(); | 373 | recalc_sigpending(); |
346 | spin_unlock_irq(¤t->sighand->siglock); | 374 | spin_unlock_irq(¤t->sighand->siglock); |
347 | 375 | ||
348 | if (restore_sigcontext(®s, &frame->sf_sc)) | 376 | sig = restore_sigcontext(®s, &frame->sf_sc); |
377 | if (sig < 0) | ||
349 | goto badframe; | 378 | goto badframe; |
379 | else if (sig) | ||
380 | force_sig(sig, current); | ||
350 | 381 | ||
351 | /* | 382 | /* |
352 | * Don't let your children do this ... | 383 | * Don't let your children do this ... |
@@ -368,6 +399,7 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
368 | struct rt_sigframe __user *frame; | 399 | struct rt_sigframe __user *frame; |
369 | sigset_t set; | 400 | sigset_t set; |
370 | stack_t st; | 401 | stack_t st; |
402 | int sig; | ||
371 | 403 | ||
372 | frame = (struct rt_sigframe __user *) regs.regs[29]; | 404 | frame = (struct rt_sigframe __user *) regs.regs[29]; |
373 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 405 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
@@ -381,8 +413,11 @@ asmlinkage void sys_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
381 | recalc_sigpending(); | 413 | recalc_sigpending(); |
382 | spin_unlock_irq(¤t->sighand->siglock); | 414 | spin_unlock_irq(¤t->sighand->siglock); |
383 | 415 | ||
384 | if (restore_sigcontext(®s, &frame->rs_uc.uc_mcontext)) | 416 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); |
417 | if (sig < 0) | ||
385 | goto badframe; | 418 | goto badframe; |
419 | else if (sig) | ||
420 | force_sig(sig, current); | ||
386 | 421 | ||
387 | if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st))) | 422 | if (__copy_from_user(&st, &frame->rs_uc.uc_stack, sizeof(st))) |
388 | goto badframe; | 423 | goto badframe; |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 19bbef001959..151fd2f0893a 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -181,6 +181,7 @@ static int setup_sigcontext32(struct pt_regs *regs, | |||
181 | { | 181 | { |
182 | int err = 0; | 182 | int err = 0; |
183 | int i; | 183 | int i; |
184 | u32 used_math; | ||
184 | 185 | ||
185 | err |= __put_user(regs->cp0_epc, &sc->sc_pc); | 186 | err |= __put_user(regs->cp0_epc, &sc->sc_pc); |
186 | 187 | ||
@@ -200,26 +201,34 @@ static int setup_sigcontext32(struct pt_regs *regs, | |||
200 | err |= __put_user(mflo3(), &sc->sc_lo3); | 201 | err |= __put_user(mflo3(), &sc->sc_lo3); |
201 | } | 202 | } |
202 | 203 | ||
203 | err |= __put_user(!!used_math(), &sc->sc_used_math); | 204 | used_math = !!used_math(); |
205 | err |= __put_user(used_math, &sc->sc_used_math); | ||
204 | 206 | ||
205 | if (used_math()) { | 207 | if (used_math) { |
206 | /* | 208 | /* |
207 | * Save FPU state to signal context. Signal handler | 209 | * Save FPU state to signal context. Signal handler |
208 | * will "inherit" current FPU state. | 210 | * will "inherit" current FPU state. |
209 | */ | 211 | */ |
210 | preempt_disable(); | 212 | own_fpu(1); |
211 | 213 | enable_fp_in_kernel(); | |
212 | if (!is_fpu_owner()) { | ||
213 | own_fpu(); | ||
214 | restore_fp(current); | ||
215 | } | ||
216 | err |= save_fp_context32(sc); | 214 | err |= save_fp_context32(sc); |
217 | 215 | disable_fp_in_kernel(); | |
218 | preempt_enable(); | ||
219 | } | 216 | } |
220 | return err; | 217 | return err; |
221 | } | 218 | } |
222 | 219 | ||
220 | static int | ||
221 | check_and_restore_fp_context32(struct sigcontext32 __user *sc) | ||
222 | { | ||
223 | int err, sig; | ||
224 | |||
225 | err = sig = fpcsr_pending(&sc->sc_fpc_csr); | ||
226 | if (err > 0) | ||
227 | err = 0; | ||
228 | err |= restore_fp_context32(sc); | ||
229 | return err ?: sig; | ||
230 | } | ||
231 | |||
223 | static int restore_sigcontext32(struct pt_regs *regs, | 232 | static int restore_sigcontext32(struct pt_regs *regs, |
224 | struct sigcontext32 __user *sc) | 233 | struct sigcontext32 __user *sc) |
225 | { | 234 | { |
@@ -250,19 +259,18 @@ static int restore_sigcontext32(struct pt_regs *regs, | |||
250 | err |= __get_user(used_math, &sc->sc_used_math); | 259 | err |= __get_user(used_math, &sc->sc_used_math); |
251 | conditional_used_math(used_math); | 260 | conditional_used_math(used_math); |
252 | 261 | ||
253 | preempt_disable(); | 262 | if (used_math) { |
254 | |||
255 | if (used_math()) { | ||
256 | /* restore fpu context if we have used it before */ | 263 | /* restore fpu context if we have used it before */ |
257 | own_fpu(); | 264 | own_fpu(0); |
258 | err |= restore_fp_context32(sc); | 265 | enable_fp_in_kernel(); |
266 | if (!err) | ||
267 | err = check_and_restore_fp_context32(sc); | ||
268 | disable_fp_in_kernel(); | ||
259 | } else { | 269 | } else { |
260 | /* signal handler may have used FPU. Give it up. */ | 270 | /* signal handler may have used FPU. Give it up. */ |
261 | lose_fpu(); | 271 | lose_fpu(0); |
262 | } | 272 | } |
263 | 273 | ||
264 | preempt_enable(); | ||
265 | |||
266 | return err; | 274 | return err; |
267 | } | 275 | } |
268 | 276 | ||
@@ -508,6 +516,7 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
508 | { | 516 | { |
509 | struct sigframe32 __user *frame; | 517 | struct sigframe32 __user *frame; |
510 | sigset_t blocked; | 518 | sigset_t blocked; |
519 | int sig; | ||
511 | 520 | ||
512 | frame = (struct sigframe32 __user *) regs.regs[29]; | 521 | frame = (struct sigframe32 __user *) regs.regs[29]; |
513 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 522 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
@@ -521,8 +530,11 @@ asmlinkage void sys32_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
521 | recalc_sigpending(); | 530 | recalc_sigpending(); |
522 | spin_unlock_irq(¤t->sighand->siglock); | 531 | spin_unlock_irq(¤t->sighand->siglock); |
523 | 532 | ||
524 | if (restore_sigcontext32(®s, &frame->sf_sc)) | 533 | sig = restore_sigcontext32(®s, &frame->sf_sc); |
534 | if (sig < 0) | ||
525 | goto badframe; | 535 | goto badframe; |
536 | else if (sig) | ||
537 | force_sig(sig, current); | ||
526 | 538 | ||
527 | /* | 539 | /* |
528 | * Don't let your children do this ... | 540 | * Don't let your children do this ... |
@@ -545,6 +557,7 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
545 | sigset_t set; | 557 | sigset_t set; |
546 | stack_t st; | 558 | stack_t st; |
547 | s32 sp; | 559 | s32 sp; |
560 | int sig; | ||
548 | 561 | ||
549 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; | 562 | frame = (struct rt_sigframe32 __user *) regs.regs[29]; |
550 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 563 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
@@ -558,8 +571,11 @@ asmlinkage void sys32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
558 | recalc_sigpending(); | 571 | recalc_sigpending(); |
559 | spin_unlock_irq(¤t->sighand->siglock); | 572 | spin_unlock_irq(¤t->sighand->siglock); |
560 | 573 | ||
561 | if (restore_sigcontext32(®s, &frame->rs_uc.uc_mcontext)) | 574 | sig = restore_sigcontext32(®s, &frame->rs_uc.uc_mcontext); |
575 | if (sig < 0) | ||
562 | goto badframe; | 576 | goto badframe; |
577 | else if (sig) | ||
578 | force_sig(sig, current); | ||
563 | 579 | ||
564 | /* The ucontext contains a stack32_t, so we must convert! */ | 580 | /* The ucontext contains a stack32_t, so we must convert! */ |
565 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) | 581 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) |
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c index ecf1f7ecaad9..a9202fa95987 100644 --- a/arch/mips/kernel/signal_n32.c +++ b/arch/mips/kernel/signal_n32.c | |||
@@ -127,6 +127,7 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
127 | sigset_t set; | 127 | sigset_t set; |
128 | stack_t st; | 128 | stack_t st; |
129 | s32 sp; | 129 | s32 sp; |
130 | int sig; | ||
130 | 131 | ||
131 | frame = (struct rt_sigframe_n32 __user *) regs.regs[29]; | 132 | frame = (struct rt_sigframe_n32 __user *) regs.regs[29]; |
132 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) | 133 | if (!access_ok(VERIFY_READ, frame, sizeof(*frame))) |
@@ -140,8 +141,11 @@ asmlinkage void sysn32_rt_sigreturn(nabi_no_regargs struct pt_regs regs) | |||
140 | recalc_sigpending(); | 141 | recalc_sigpending(); |
141 | spin_unlock_irq(¤t->sighand->siglock); | 142 | spin_unlock_irq(¤t->sighand->siglock); |
142 | 143 | ||
143 | if (restore_sigcontext(®s, &frame->rs_uc.uc_mcontext)) | 144 | sig = restore_sigcontext(®s, &frame->rs_uc.uc_mcontext); |
145 | if (sig < 0) | ||
144 | goto badframe; | 146 | goto badframe; |
147 | else if (sig) | ||
148 | force_sig(sig, current); | ||
145 | 149 | ||
146 | /* The ucontext contains a stack32_t, so we must convert! */ | 150 | /* The ucontext contains a stack32_t, so we must convert! */ |
147 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) | 151 | if (__get_user(sp, &frame->rs_uc.uc_stack.ss_sp)) |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 18f56a9dbcfa..7d76a85422b2 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -610,16 +610,6 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) | |||
610 | if (fcr31 & FPU_CSR_UNI_X) { | 610 | if (fcr31 & FPU_CSR_UNI_X) { |
611 | int sig; | 611 | int sig; |
612 | 612 | ||
613 | preempt_disable(); | ||
614 | |||
615 | #ifdef CONFIG_PREEMPT | ||
616 | if (!is_fpu_owner()) { | ||
617 | /* We might lose fpu before disabling preempt... */ | ||
618 | own_fpu(); | ||
619 | BUG_ON(!used_math()); | ||
620 | restore_fp(current); | ||
621 | } | ||
622 | #endif | ||
623 | /* | 613 | /* |
624 | * Unimplemented operation exception. If we've got the full | 614 | * Unimplemented operation exception. If we've got the full |
625 | * software emulator on-board, let's use it... | 615 | * software emulator on-board, let's use it... |
@@ -630,18 +620,12 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) | |||
630 | * register operands before invoking the emulator, which seems | 620 | * register operands before invoking the emulator, which seems |
631 | * a bit extreme for what should be an infrequent event. | 621 | * a bit extreme for what should be an infrequent event. |
632 | */ | 622 | */ |
633 | save_fp(current); | ||
634 | /* Ensure 'resume' not overwrite saved fp context again. */ | 623 | /* Ensure 'resume' not overwrite saved fp context again. */ |
635 | lose_fpu(); | 624 | lose_fpu(1); |
636 | |||
637 | preempt_enable(); | ||
638 | 625 | ||
639 | /* Run the emulator */ | 626 | /* Run the emulator */ |
640 | sig = fpu_emulator_cop1Handler (regs, ¤t->thread.fpu, 1); | 627 | sig = fpu_emulator_cop1Handler (regs, ¤t->thread.fpu, 1); |
641 | 628 | ||
642 | preempt_disable(); | ||
643 | |||
644 | own_fpu(); /* Using the FPU again. */ | ||
645 | /* | 629 | /* |
646 | * We can't allow the emulated instruction to leave any of | 630 | * We can't allow the emulated instruction to leave any of |
647 | * the cause bit set in $fcr31. | 631 | * the cause bit set in $fcr31. |
@@ -649,9 +633,7 @@ asmlinkage void do_fpe(struct pt_regs *regs, unsigned long fcr31) | |||
649 | current->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X; | 633 | current->thread.fpu.fcr31 &= ~FPU_CSR_ALL_X; |
650 | 634 | ||
651 | /* Restore the hardware register state */ | 635 | /* Restore the hardware register state */ |
652 | restore_fp(current); | 636 | own_fpu(1); /* Using the FPU again. */ |
653 | |||
654 | preempt_enable(); | ||
655 | 637 | ||
656 | /* If something went wrong, signal */ | 638 | /* If something went wrong, signal */ |
657 | if (sig) | 639 | if (sig) |
@@ -775,12 +757,11 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
775 | { | 757 | { |
776 | unsigned int cpid; | 758 | unsigned int cpid; |
777 | 759 | ||
778 | die_if_kernel("do_cpu invoked from kernel context!", regs); | ||
779 | |||
780 | cpid = (regs->cp0_cause >> CAUSEB_CE) & 3; | 760 | cpid = (regs->cp0_cause >> CAUSEB_CE) & 3; |
781 | 761 | ||
782 | switch (cpid) { | 762 | switch (cpid) { |
783 | case 0: | 763 | case 0: |
764 | die_if_kernel("do_cpu invoked from kernel context!", regs); | ||
784 | if (!cpu_has_llsc) | 765 | if (!cpu_has_llsc) |
785 | if (!simulate_llsc(regs)) | 766 | if (!simulate_llsc(regs)) |
786 | return; | 767 | return; |
@@ -791,21 +772,30 @@ asmlinkage void do_cpu(struct pt_regs *regs) | |||
791 | break; | 772 | break; |
792 | 773 | ||
793 | case 1: | 774 | case 1: |
794 | preempt_disable(); | 775 | if (!test_thread_flag(TIF_ALLOW_FP_IN_KERNEL)) |
795 | 776 | die_if_kernel("do_cpu invoked from kernel context!", | |
796 | own_fpu(); | 777 | regs); |
797 | if (used_math()) { /* Using the FPU again. */ | 778 | if (used_math()) /* Using the FPU again. */ |
798 | restore_fp(current); | 779 | own_fpu(1); |
799 | } else { /* First time FPU user. */ | 780 | else { /* First time FPU user. */ |
800 | init_fpu(); | 781 | init_fpu(); |
801 | set_used_math(); | 782 | set_used_math(); |
802 | } | 783 | } |
803 | 784 | ||
804 | if (cpu_has_fpu) { | 785 | if (raw_cpu_has_fpu) { |
805 | preempt_enable(); | 786 | if (test_thread_flag(TIF_ALLOW_FP_IN_KERNEL)) { |
787 | local_irq_disable(); | ||
788 | if (cpu_has_fpu) | ||
789 | regs->cp0_status |= ST0_CU1; | ||
790 | /* | ||
791 | * We must return without enabling | ||
792 | * interrupts to ensure keep FPU | ||
793 | * ownership until resume. | ||
794 | */ | ||
795 | return; | ||
796 | } | ||
806 | } else { | 797 | } else { |
807 | int sig; | 798 | int sig; |
808 | preempt_enable(); | ||
809 | sig = fpu_emulator_cop1Handler(regs, | 799 | sig = fpu_emulator_cop1Handler(regs, |
810 | ¤t->thread.fpu, 0); | 800 | ¤t->thread.fpu, 0); |
811 | if (sig) | 801 | if (sig) |
@@ -1259,26 +1249,26 @@ static inline void mips_srs_init(void) | |||
1259 | /* | 1249 | /* |
1260 | * This is used by native signal handling | 1250 | * This is used by native signal handling |
1261 | */ | 1251 | */ |
1262 | asmlinkage int (*save_fp_context)(struct sigcontext *sc); | 1252 | asmlinkage int (*save_fp_context)(struct sigcontext __user *sc); |
1263 | asmlinkage int (*restore_fp_context)(struct sigcontext *sc); | 1253 | asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc); |
1264 | 1254 | ||
1265 | extern asmlinkage int _save_fp_context(struct sigcontext *sc); | 1255 | extern asmlinkage int _save_fp_context(struct sigcontext __user *sc); |
1266 | extern asmlinkage int _restore_fp_context(struct sigcontext *sc); | 1256 | extern asmlinkage int _restore_fp_context(struct sigcontext __user *sc); |
1267 | 1257 | ||
1268 | extern asmlinkage int fpu_emulator_save_context(struct sigcontext *sc); | 1258 | extern asmlinkage int fpu_emulator_save_context(struct sigcontext __user *sc); |
1269 | extern asmlinkage int fpu_emulator_restore_context(struct sigcontext *sc); | 1259 | extern asmlinkage int fpu_emulator_restore_context(struct sigcontext __user *sc); |
1270 | 1260 | ||
1271 | #ifdef CONFIG_SMP | 1261 | #ifdef CONFIG_SMP |
1272 | static int smp_save_fp_context(struct sigcontext *sc) | 1262 | static int smp_save_fp_context(struct sigcontext __user *sc) |
1273 | { | 1263 | { |
1274 | return cpu_has_fpu | 1264 | return raw_cpu_has_fpu |
1275 | ? _save_fp_context(sc) | 1265 | ? _save_fp_context(sc) |
1276 | : fpu_emulator_save_context(sc); | 1266 | : fpu_emulator_save_context(sc); |
1277 | } | 1267 | } |
1278 | 1268 | ||
1279 | static int smp_restore_fp_context(struct sigcontext *sc) | 1269 | static int smp_restore_fp_context(struct sigcontext __user *sc) |
1280 | { | 1270 | { |
1281 | return cpu_has_fpu | 1271 | return raw_cpu_has_fpu |
1282 | ? _restore_fp_context(sc) | 1272 | ? _restore_fp_context(sc) |
1283 | : fpu_emulator_restore_context(sc); | 1273 | : fpu_emulator_restore_context(sc); |
1284 | } | 1274 | } |
@@ -1306,14 +1296,14 @@ static inline void signal_init(void) | |||
1306 | /* | 1296 | /* |
1307 | * This is used by 32-bit signal stuff on the 64-bit kernel | 1297 | * This is used by 32-bit signal stuff on the 64-bit kernel |
1308 | */ | 1298 | */ |
1309 | asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc); | 1299 | asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc); |
1310 | asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc); | 1300 | asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc); |
1311 | 1301 | ||
1312 | extern asmlinkage int _save_fp_context32(struct sigcontext32 *sc); | 1302 | extern asmlinkage int _save_fp_context32(struct sigcontext32 __user *sc); |
1313 | extern asmlinkage int _restore_fp_context32(struct sigcontext32 *sc); | 1303 | extern asmlinkage int _restore_fp_context32(struct sigcontext32 __user *sc); |
1314 | 1304 | ||
1315 | extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 *sc); | 1305 | extern asmlinkage int fpu_emulator_save_context32(struct sigcontext32 __user *sc); |
1316 | extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 *sc); | 1306 | extern asmlinkage int fpu_emulator_restore_context32(struct sigcontext32 __user *sc); |
1317 | 1307 | ||
1318 | static inline void signal32_init(void) | 1308 | static inline void signal32_init(void) |
1319 | { | 1309 | { |
diff --git a/arch/mips/math-emu/kernel_linkage.c b/arch/mips/math-emu/kernel_linkage.c index 5b3390f64917..ed49ef01ac53 100644 --- a/arch/mips/math-emu/kernel_linkage.c +++ b/arch/mips/math-emu/kernel_linkage.c | |||
@@ -51,7 +51,7 @@ void fpu_emulator_init_fpu(void) | |||
51 | * with appropriate macros from uaccess.h | 51 | * with appropriate macros from uaccess.h |
52 | */ | 52 | */ |
53 | 53 | ||
54 | int fpu_emulator_save_context(struct sigcontext *sc) | 54 | int fpu_emulator_save_context(struct sigcontext __user *sc) |
55 | { | 55 | { |
56 | int i; | 56 | int i; |
57 | int err = 0; | 57 | int err = 0; |
@@ -65,7 +65,7 @@ int fpu_emulator_save_context(struct sigcontext *sc) | |||
65 | return err; | 65 | return err; |
66 | } | 66 | } |
67 | 67 | ||
68 | int fpu_emulator_restore_context(struct sigcontext *sc) | 68 | int fpu_emulator_restore_context(struct sigcontext __user *sc) |
69 | { | 69 | { |
70 | int i; | 70 | int i; |
71 | int err = 0; | 71 | int err = 0; |
@@ -84,7 +84,7 @@ int fpu_emulator_restore_context(struct sigcontext *sc) | |||
84 | * This is the o32 version | 84 | * This is the o32 version |
85 | */ | 85 | */ |
86 | 86 | ||
87 | int fpu_emulator_save_context32(struct sigcontext32 *sc) | 87 | int fpu_emulator_save_context32(struct sigcontext32 __user *sc) |
88 | { | 88 | { |
89 | int i; | 89 | int i; |
90 | int err = 0; | 90 | int err = 0; |
@@ -98,7 +98,7 @@ int fpu_emulator_save_context32(struct sigcontext32 *sc) | |||
98 | return err; | 98 | return err; |
99 | } | 99 | } |
100 | 100 | ||
101 | int fpu_emulator_restore_context32(struct sigcontext32 *sc) | 101 | int fpu_emulator_restore_context32(struct sigcontext32 __user *sc) |
102 | { | 102 | { |
103 | int i; | 103 | int i; |
104 | int err = 0; | 104 | int err = 0; |
diff --git a/arch/mips/mips-boards/generic/init.c b/arch/mips/mips-boards/generic/init.c index 1acdf091c258..88e9c2a7a2f9 100644 --- a/arch/mips/mips-boards/generic/init.c +++ b/arch/mips/mips-boards/generic/init.c | |||
@@ -145,7 +145,7 @@ static void __init console_config(void) | |||
145 | char parity = '\0', bits = '\0', flow = '\0'; | 145 | char parity = '\0', bits = '\0', flow = '\0'; |
146 | char *s; | 146 | char *s; |
147 | 147 | ||
148 | if ((strstr(prom_getcmdline(), "console=ttyS")) == NULL) { | 148 | if ((strstr(prom_getcmdline(), "console=")) == NULL) { |
149 | s = prom_getenv("modetty0"); | 149 | s = prom_getenv("modetty0"); |
150 | if (s) { | 150 | if (s) { |
151 | while (*s >= '0' && *s <= '9') | 151 | while (*s >= '0' && *s <= '9') |
diff --git a/arch/mips/momentum/ocelot_c/irq.c b/arch/mips/momentum/ocelot_c/irq.c index 40472f7944d7..844d566c9de3 100644 --- a/arch/mips/momentum/ocelot_c/irq.c +++ b/arch/mips/momentum/ocelot_c/irq.c | |||
@@ -64,7 +64,7 @@ extern void ll_cpci_irq(void); | |||
64 | 64 | ||
65 | asmlinkage void plat_irq_dispatch(void) | 65 | asmlinkage void plat_irq_dispatch(void) |
66 | { | 66 | { |
67 | unsigned int pending = read_c0_cause() & read_c0_status(); | 67 | unsigned int pending = read_c0_cause() & read_c0_status() & ST0_IM; |
68 | 68 | ||
69 | if (pending & STATUSF_IP0) | 69 | if (pending & STATUSF_IP0) |
70 | do_IRQ(0); | 70 | do_IRQ(0); |
diff --git a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c index 9d08608aaa51..69a8bcfe72b2 100644 --- a/arch/mips/oprofile/op_model_mipsxx.c +++ b/arch/mips/oprofile/op_model_mipsxx.c | |||
@@ -74,13 +74,13 @@ static inline void w_c0_ ## r ## n(unsigned int value) \ | |||
74 | 74 | ||
75 | __define_perf_accessors(perfcntr, 0, 2) | 75 | __define_perf_accessors(perfcntr, 0, 2) |
76 | __define_perf_accessors(perfcntr, 1, 3) | 76 | __define_perf_accessors(perfcntr, 1, 3) |
77 | __define_perf_accessors(perfcntr, 2, 2) | 77 | __define_perf_accessors(perfcntr, 2, 0) |
78 | __define_perf_accessors(perfcntr, 3, 2) | 78 | __define_perf_accessors(perfcntr, 3, 1) |
79 | 79 | ||
80 | __define_perf_accessors(perfctrl, 0, 2) | 80 | __define_perf_accessors(perfctrl, 0, 2) |
81 | __define_perf_accessors(perfctrl, 1, 3) | 81 | __define_perf_accessors(perfctrl, 1, 3) |
82 | __define_perf_accessors(perfctrl, 2, 2) | 82 | __define_perf_accessors(perfctrl, 2, 0) |
83 | __define_perf_accessors(perfctrl, 3, 2) | 83 | __define_perf_accessors(perfctrl, 3, 1) |
84 | 84 | ||
85 | struct op_mips_model op_model_mipsxx_ops; | 85 | struct op_mips_model op_model_mipsxx_ops; |
86 | 86 | ||
@@ -97,7 +97,6 @@ static void mipsxx_reg_setup(struct op_counter_config *ctr) | |||
97 | int i; | 97 | int i; |
98 | 98 | ||
99 | /* Compute the performance counter control word. */ | 99 | /* Compute the performance counter control word. */ |
100 | /* For now count kernel and user mode */ | ||
101 | for (i = 0; i < counters; i++) { | 100 | for (i = 0; i < counters; i++) { |
102 | reg.control[i] = 0; | 101 | reg.control[i] = 0; |
103 | reg.counter[i] = 0; | 102 | reg.counter[i] = 0; |
@@ -234,9 +233,6 @@ static inline int n_counters(void) | |||
234 | counters = __n_counters(); | 233 | counters = __n_counters(); |
235 | } | 234 | } |
236 | 235 | ||
237 | #ifdef CONFIG_MIPS_MT_SMP | ||
238 | counters >> 1; | ||
239 | #endif | ||
240 | return counters; | 236 | return counters; |
241 | } | 237 | } |
242 | 238 | ||
@@ -270,6 +266,10 @@ static int __init mipsxx_init(void) | |||
270 | 266 | ||
271 | reset_counters(counters); | 267 | reset_counters(counters); |
272 | 268 | ||
269 | #ifdef CONFIG_MIPS_MT_SMP | ||
270 | counters >>= 1; | ||
271 | #endif | ||
272 | |||
273 | op_model_mipsxx_ops.num_counters = counters; | 273 | op_model_mipsxx_ops.num_counters = counters; |
274 | switch (current_cpu_data.cputype) { | 274 | switch (current_cpu_data.cputype) { |
275 | case CPU_20KC: | 275 | case CPU_20KC: |
@@ -326,7 +326,11 @@ static int __init mipsxx_init(void) | |||
326 | 326 | ||
327 | static void mipsxx_exit(void) | 327 | static void mipsxx_exit(void) |
328 | { | 328 | { |
329 | reset_counters(op_model_mipsxx_ops.num_counters); | 329 | int counters = op_model_mipsxx_ops.num_counters; |
330 | #ifdef CONFIG_MIPS_MT_SMP | ||
331 | counters <<= 1; | ||
332 | #endif | ||
333 | reset_counters(counters); | ||
330 | 334 | ||
331 | perf_irq = null_perf_irq; | 335 | perf_irq = null_perf_irq; |
332 | } | 336 | } |
diff --git a/arch/mips/philips/pnx8550/common/int.c b/arch/mips/philips/pnx8550/common/int.c index d48665ebd33c..aad03429a5e3 100644 --- a/arch/mips/philips/pnx8550/common/int.c +++ b/arch/mips/philips/pnx8550/common/int.c | |||
@@ -83,16 +83,15 @@ static void timer_irqdispatch(int irq) | |||
83 | 83 | ||
84 | asmlinkage void plat_irq_dispatch(void) | 84 | asmlinkage void plat_irq_dispatch(void) |
85 | { | 85 | { |
86 | unsigned int pending = read_c0_status() & read_c0_cause(); | 86 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
87 | 87 | ||
88 | if (pending & STATUSF_IP2) | 88 | if (pending & STATUSF_IP2) |
89 | hw0_irqdispatch(2); | 89 | hw0_irqdispatch(2); |
90 | else if (pending & STATUSF_IP7) { | 90 | else if (pending & STATUSF_IP7) { |
91 | if (read_c0_config7() & 0x01c0) | 91 | if (read_c0_config7() & 0x01c0) |
92 | timer_irqdispatch(7); | 92 | timer_irqdispatch(7); |
93 | } | 93 | } else |
94 | 94 | spurious_interrupt(); | |
95 | spurious_interrupt(); | ||
96 | } | 95 | } |
97 | 96 | ||
98 | static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) | 97 | static inline void modify_cp0_intmask(unsigned clr_mask, unsigned set_mask) |
@@ -204,19 +203,7 @@ void __init arch_init_irq(void) | |||
204 | * Note, PCI INTA is active low on the bus, but inverted | 203 | * Note, PCI INTA is active low on the bus, but inverted |
205 | * in the GIC, so to us it's active high. | 204 | * in the GIC, so to us it's active high. |
206 | */ | 205 | */ |
207 | #ifdef CONFIG_PNX8550_V2PCI | 206 | PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000; |
208 | if (gic_int_line == (PNX8550_INT_GPIO0 - PNX8550_INT_GIC_MIN)) { | ||
209 | /* PCI INT through gpio 8, which is setup in | ||
210 | * pnx8550_setup.c and routed to GPIO | ||
211 | * Interrupt Level 0 (GPIO Connection 58). | ||
212 | * Set it active low. */ | ||
213 | |||
214 | PNX8550_GIC_REQ(gic_int_line) = 0x1E020000; | ||
215 | } else | ||
216 | #endif | ||
217 | { | ||
218 | PNX8550_GIC_REQ(i - PNX8550_INT_GIC_MIN) = 0x1E000000; | ||
219 | } | ||
220 | 207 | ||
221 | /* mask/priority is still 0 so we will not get any | 208 | /* mask/priority is still 0 so we will not get any |
222 | * interrupts until it is unmasked */ | 209 | * interrupts until it is unmasked */ |
diff --git a/arch/mips/qemu/q-smp.c b/arch/mips/qemu/q-smp.c index 5a12354cd576..786bbfa214d1 100644 --- a/arch/mips/qemu/q-smp.c +++ b/arch/mips/qemu/q-smp.c | |||
@@ -46,3 +46,10 @@ void __init prom_prepare_cpus(unsigned int max_cpus) | |||
46 | void prom_boot_secondary(int cpu, struct task_struct *idle) | 46 | void prom_boot_secondary(int cpu, struct task_struct *idle) |
47 | { | 47 | { |
48 | } | 48 | } |
49 | |||
50 | void __init plat_smp_setup(void) | ||
51 | { | ||
52 | } | ||
53 | void __init plat_prepare_cpus(unsigned int max_cpus) | ||
54 | { | ||
55 | } | ||
diff --git a/arch/mips/sgi-ip22/ip22-int.c b/arch/mips/sgi-ip22/ip22-int.c index b454924aeb56..18348321795d 100644 --- a/arch/mips/sgi-ip22/ip22-int.c +++ b/arch/mips/sgi-ip22/ip22-int.c | |||
@@ -237,7 +237,7 @@ extern void indy_8254timer_irq(void); | |||
237 | 237 | ||
238 | asmlinkage void plat_irq_dispatch(void) | 238 | asmlinkage void plat_irq_dispatch(void) |
239 | { | 239 | { |
240 | unsigned int pending = read_c0_cause(); | 240 | unsigned int pending = read_c0_status() & read_c0_cause(); |
241 | 241 | ||
242 | /* | 242 | /* |
243 | * First we check for r4k counter/timer IRQ. | 243 | * First we check for r4k counter/timer IRQ. |
diff --git a/arch/mips/sgi-ip32/ip32-irq.c b/arch/mips/sgi-ip32/ip32-irq.c index 8c450d9e8696..fb9da9acf53f 100644 --- a/arch/mips/sgi-ip32/ip32-irq.c +++ b/arch/mips/sgi-ip32/ip32-irq.c | |||
@@ -454,7 +454,7 @@ static void ip32_irq5(void) | |||
454 | 454 | ||
455 | asmlinkage void plat_irq_dispatch(void) | 455 | asmlinkage void plat_irq_dispatch(void) |
456 | { | 456 | { |
457 | unsigned int pending = read_c0_cause(); | 457 | unsigned int pending = read_c0_status() & read_c0_cause(); |
458 | 458 | ||
459 | if (likely(pending & IE_IRQ0)) | 459 | if (likely(pending & IE_IRQ0)) |
460 | ip32_irq0(); | 460 | ip32_irq0(); |
diff --git a/arch/mips/sibyte/sb1250/irq.c b/arch/mips/sibyte/sb1250/irq.c index 148239446e6e..0e6a13c0bd0e 100644 --- a/arch/mips/sibyte/sb1250/irq.c +++ b/arch/mips/sibyte/sb1250/irq.c | |||
@@ -421,7 +421,7 @@ asmlinkage void plat_irq_dispatch(void) | |||
421 | * blasting the high 32 bits. | 421 | * blasting the high 32 bits. |
422 | */ | 422 | */ |
423 | 423 | ||
424 | pending = read_c0_cause() & read_c0_status(); | 424 | pending = read_c0_cause() & read_c0_status() & ST0_IM; |
425 | 425 | ||
426 | #ifdef CONFIG_SIBYTE_SB1250_PROF | 426 | #ifdef CONFIG_SIBYTE_SB1250_PROF |
427 | if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ | 427 | if (pending & CAUSEF_IP7) /* Cpu performance counter interrupt */ |
diff --git a/arch/mips/sni/pcimt.c b/arch/mips/sni/pcimt.c index 39e5b4abc555..8e8593b64f6a 100644 --- a/arch/mips/sni/pcimt.c +++ b/arch/mips/sni/pcimt.c | |||
@@ -333,7 +333,7 @@ static void pcimt_hwint3(void) | |||
333 | 333 | ||
334 | static void sni_pcimt_hwint(void) | 334 | static void sni_pcimt_hwint(void) |
335 | { | 335 | { |
336 | u32 pending = (read_c0_cause() & read_c0_status()); | 336 | u32 pending = read_c0_cause() & read_c0_status(); |
337 | 337 | ||
338 | if (pending & C_IRQ5) | 338 | if (pending & C_IRQ5) |
339 | do_IRQ (MIPS_CPU_IRQ_BASE + 7); | 339 | do_IRQ (MIPS_CPU_IRQ_BASE + 7); |
diff --git a/arch/mips/sni/pcit.c b/arch/mips/sni/pcit.c index 8d6b3d5b13a1..1dfc3f00bbd3 100644 --- a/arch/mips/sni/pcit.c +++ b/arch/mips/sni/pcit.c | |||
@@ -271,7 +271,7 @@ static void pcit_hwint0(void) | |||
271 | 271 | ||
272 | static void sni_pcit_hwint(void) | 272 | static void sni_pcit_hwint(void) |
273 | { | 273 | { |
274 | u32 pending = (read_c0_cause() & read_c0_status()); | 274 | u32 pending = read_c0_cause() & read_c0_status(); |
275 | 275 | ||
276 | if (pending & C_IRQ1) | 276 | if (pending & C_IRQ1) |
277 | pcit_hwint1(); | 277 | pcit_hwint1(); |
@@ -285,7 +285,7 @@ static void sni_pcit_hwint(void) | |||
285 | 285 | ||
286 | static void sni_pcit_hwint_cplus(void) | 286 | static void sni_pcit_hwint_cplus(void) |
287 | { | 287 | { |
288 | u32 pending = (read_c0_cause() & read_c0_status()); | 288 | u32 pending = read_c0_cause() & read_c0_status(); |
289 | 289 | ||
290 | if (pending & C_IRQ0) | 290 | if (pending & C_IRQ0) |
291 | pcit_hwint0(); | 291 | pcit_hwint0(); |
diff --git a/arch/mips/tx4927/common/tx4927_irq.c b/arch/mips/tx4927/common/tx4927_irq.c index e7f3e5b84dcf..3d25d010f3d5 100644 --- a/arch/mips/tx4927/common/tx4927_irq.c +++ b/arch/mips/tx4927/common/tx4927_irq.c | |||
@@ -416,7 +416,7 @@ static int tx4927_irq_nested(void) | |||
416 | 416 | ||
417 | asmlinkage void plat_irq_dispatch(void) | 417 | asmlinkage void plat_irq_dispatch(void) |
418 | { | 418 | { |
419 | unsigned int pending = read_c0_status() & read_c0_cause(); | 419 | unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; |
420 | 420 | ||
421 | if (pending & STATUSF_IP7) /* cpu timer */ | 421 | if (pending & STATUSF_IP7) /* cpu timer */ |
422 | do_IRQ(TX4927_IRQ_CPU_TIMER); | 422 | do_IRQ(TX4927_IRQ_CPU_TIMER); |
diff --git a/arch/powerpc/configs/cell_defconfig b/arch/powerpc/configs/cell_defconfig index 24367319ce24..cf7e316ad4f6 100644 --- a/arch/powerpc/configs/cell_defconfig +++ b/arch/powerpc/configs/cell_defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.20-rc5 | 3 | # Linux kernel version: 2.6.21-rc3 |
4 | # Mon Jan 22 22:12:56 2007 | 4 | # Fri Mar 9 23:34:53 2007 |
5 | # | 5 | # |
6 | CONFIG_PPC64=y | 6 | CONFIG_PPC64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
@@ -61,6 +61,7 @@ CONFIG_LOCALVERSION_AUTO=y | |||
61 | CONFIG_SWAP=y | 61 | CONFIG_SWAP=y |
62 | CONFIG_SYSVIPC=y | 62 | CONFIG_SYSVIPC=y |
63 | # CONFIG_IPC_NS is not set | 63 | # CONFIG_IPC_NS is not set |
64 | CONFIG_SYSVIPC_SYSCTL=y | ||
64 | # CONFIG_POSIX_MQUEUE is not set | 65 | # CONFIG_POSIX_MQUEUE is not set |
65 | # CONFIG_BSD_PROCESS_ACCT is not set | 66 | # CONFIG_BSD_PROCESS_ACCT is not set |
66 | # CONFIG_TASKSTATS is not set | 67 | # CONFIG_TASKSTATS is not set |
@@ -71,6 +72,7 @@ CONFIG_IKCONFIG_PROC=y | |||
71 | CONFIG_CPUSETS=y | 72 | CONFIG_CPUSETS=y |
72 | CONFIG_SYSFS_DEPRECATED=y | 73 | CONFIG_SYSFS_DEPRECATED=y |
73 | # CONFIG_RELAY is not set | 74 | # CONFIG_RELAY is not set |
75 | CONFIG_BLK_DEV_INITRD=y | ||
74 | CONFIG_INITRAMFS_SOURCE="" | 76 | CONFIG_INITRAMFS_SOURCE="" |
75 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 77 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
76 | CONFIG_SYSCTL=y | 78 | CONFIG_SYSCTL=y |
@@ -133,6 +135,7 @@ CONFIG_PPC_MULTIPLATFORM=y | |||
133 | # CONFIG_PPC_PSERIES is not set | 135 | # CONFIG_PPC_PSERIES is not set |
134 | # CONFIG_PPC_ISERIES is not set | 136 | # CONFIG_PPC_ISERIES is not set |
135 | # CONFIG_PPC_MPC52xx is not set | 137 | # CONFIG_PPC_MPC52xx is not set |
138 | # CONFIG_PPC_MPC5200 is not set | ||
136 | # CONFIG_PPC_PMAC is not set | 139 | # CONFIG_PPC_PMAC is not set |
137 | # CONFIG_PPC_MAPLE is not set | 140 | # CONFIG_PPC_MAPLE is not set |
138 | # CONFIG_PPC_PASEMI is not set | 141 | # CONFIG_PPC_PASEMI is not set |
@@ -140,8 +143,10 @@ CONFIG_PPC_CELL=y | |||
140 | CONFIG_PPC_CELL_NATIVE=y | 143 | CONFIG_PPC_CELL_NATIVE=y |
141 | CONFIG_PPC_IBM_CELL_BLADE=y | 144 | CONFIG_PPC_IBM_CELL_BLADE=y |
142 | CONFIG_PPC_PS3=y | 145 | CONFIG_PPC_PS3=y |
146 | CONFIG_PPC_CELLEB=y | ||
143 | CONFIG_PPC_NATIVE=y | 147 | CONFIG_PPC_NATIVE=y |
144 | CONFIG_UDBG_RTAS_CONSOLE=y | 148 | CONFIG_UDBG_RTAS_CONSOLE=y |
149 | CONFIG_PPC_UDBG_BEAT=y | ||
145 | # CONFIG_U3_DART is not set | 150 | # CONFIG_U3_DART is not set |
146 | CONFIG_PPC_RTAS=y | 151 | CONFIG_PPC_RTAS=y |
147 | # CONFIG_RTAS_ERROR_LOGGING is not set | 152 | # CONFIG_RTAS_ERROR_LOGGING is not set |
@@ -181,10 +186,13 @@ CONFIG_CBE_CPUFREQ=m | |||
181 | # | 186 | # |
182 | # PS3 Platform Options | 187 | # PS3 Platform Options |
183 | # | 188 | # |
189 | # CONFIG_PS3_ADVANCED is not set | ||
184 | CONFIG_PS3_HTAB_SIZE=20 | 190 | CONFIG_PS3_HTAB_SIZE=20 |
185 | # CONFIG_PS3_DYNAMIC_DMA is not set | 191 | # CONFIG_PS3_DYNAMIC_DMA is not set |
186 | CONFIG_PS3_USE_LPAR_ADDR=y | 192 | CONFIG_PS3_USE_LPAR_ADDR=y |
187 | CONFIG_PS3_VUART=y | 193 | CONFIG_PS3_VUART=y |
194 | CONFIG_PS3_PS3AV=y | ||
195 | CONFIG_PS3_SYS_MANAGER=y | ||
188 | 196 | ||
189 | # | 197 | # |
190 | # Kernel options | 198 | # Kernel options |
@@ -226,6 +234,7 @@ CONFIG_MEMORY_HOTPLUG_SPARSE=y | |||
226 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 234 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
227 | CONFIG_MIGRATION=y | 235 | CONFIG_MIGRATION=y |
228 | CONFIG_RESOURCES_64BIT=y | 236 | CONFIG_RESOURCES_64BIT=y |
237 | CONFIG_ZONE_DMA_FLAG=1 | ||
229 | CONFIG_ARCH_MEMORY_PROBE=y | 238 | CONFIG_ARCH_MEMORY_PROBE=y |
230 | CONFIG_NODES_SPAN_OTHER_NODES=y | 239 | CONFIG_NODES_SPAN_OTHER_NODES=y |
231 | CONFIG_PPC_64K_PAGES=y | 240 | CONFIG_PPC_64K_PAGES=y |
@@ -239,6 +248,7 @@ CONFIG_ISA_DMA_API=y | |||
239 | # | 248 | # |
240 | # Bus options | 249 | # Bus options |
241 | # | 250 | # |
251 | CONFIG_ZONE_DMA=y | ||
242 | CONFIG_GENERIC_ISA_DMA=y | 252 | CONFIG_GENERIC_ISA_DMA=y |
243 | # CONFIG_MPIC_WEIRD is not set | 253 | # CONFIG_MPIC_WEIRD is not set |
244 | # CONFIG_PPC_I8259 is not set | 254 | # CONFIG_PPC_I8259 is not set |
@@ -274,6 +284,7 @@ CONFIG_UNIX=y | |||
274 | CONFIG_XFRM=y | 284 | CONFIG_XFRM=y |
275 | # CONFIG_XFRM_USER is not set | 285 | # CONFIG_XFRM_USER is not set |
276 | # CONFIG_XFRM_SUB_POLICY is not set | 286 | # CONFIG_XFRM_SUB_POLICY is not set |
287 | # CONFIG_XFRM_MIGRATE is not set | ||
277 | # CONFIG_NET_KEY is not set | 288 | # CONFIG_NET_KEY is not set |
278 | CONFIG_INET=y | 289 | CONFIG_INET=y |
279 | CONFIG_IP_MULTICAST=y | 290 | CONFIG_IP_MULTICAST=y |
@@ -340,6 +351,7 @@ CONFIG_NETFILTER_XT_TARGET_DSCP=m | |||
340 | CONFIG_NETFILTER_XT_TARGET_MARK=m | 351 | CONFIG_NETFILTER_XT_TARGET_MARK=m |
341 | CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m | 352 | CONFIG_NETFILTER_XT_TARGET_NFQUEUE=m |
342 | CONFIG_NETFILTER_XT_TARGET_NFLOG=m | 353 | CONFIG_NETFILTER_XT_TARGET_NFLOG=m |
354 | CONFIG_NETFILTER_XT_TARGET_TCPMSS=m | ||
343 | CONFIG_NETFILTER_XT_MATCH_COMMENT=m | 355 | CONFIG_NETFILTER_XT_MATCH_COMMENT=m |
344 | CONFIG_NETFILTER_XT_MATCH_DCCP=m | 356 | CONFIG_NETFILTER_XT_MATCH_DCCP=m |
345 | CONFIG_NETFILTER_XT_MATCH_DSCP=m | 357 | CONFIG_NETFILTER_XT_MATCH_DSCP=m |
@@ -376,7 +388,6 @@ CONFIG_IP_NF_FILTER=m | |||
376 | CONFIG_IP_NF_TARGET_REJECT=m | 388 | CONFIG_IP_NF_TARGET_REJECT=m |
377 | CONFIG_IP_NF_TARGET_LOG=m | 389 | CONFIG_IP_NF_TARGET_LOG=m |
378 | CONFIG_IP_NF_TARGET_ULOG=m | 390 | CONFIG_IP_NF_TARGET_ULOG=m |
379 | CONFIG_IP_NF_TARGET_TCPMSS=m | ||
380 | CONFIG_IP_NF_MANGLE=m | 391 | CONFIG_IP_NF_MANGLE=m |
381 | CONFIG_IP_NF_TARGET_TOS=m | 392 | CONFIG_IP_NF_TARGET_TOS=m |
382 | CONFIG_IP_NF_TARGET_ECN=m | 393 | CONFIG_IP_NF_TARGET_ECN=m |
@@ -444,6 +455,7 @@ CONFIG_STANDALONE=y | |||
444 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 455 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
445 | CONFIG_FW_LOADER=y | 456 | CONFIG_FW_LOADER=y |
446 | # CONFIG_DEBUG_DRIVER is not set | 457 | # CONFIG_DEBUG_DRIVER is not set |
458 | # CONFIG_DEBUG_DEVRES is not set | ||
447 | # CONFIG_SYS_HYPERVISOR is not set | 459 | # CONFIG_SYS_HYPERVISOR is not set |
448 | 460 | ||
449 | # | 461 | # |
@@ -464,6 +476,7 @@ CONFIG_FW_LOADER=y | |||
464 | # | 476 | # |
465 | # Plug and Play support | 477 | # Plug and Play support |
466 | # | 478 | # |
479 | # CONFIG_PNPACPI is not set | ||
467 | 480 | ||
468 | # | 481 | # |
469 | # Block devices | 482 | # Block devices |
@@ -483,7 +496,6 @@ CONFIG_BLK_DEV_RAM=y | |||
483 | CONFIG_BLK_DEV_RAM_COUNT=16 | 496 | CONFIG_BLK_DEV_RAM_COUNT=16 |
484 | CONFIG_BLK_DEV_RAM_SIZE=131072 | 497 | CONFIG_BLK_DEV_RAM_SIZE=131072 |
485 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | 498 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 |
486 | CONFIG_BLK_DEV_INITRD=y | ||
487 | # CONFIG_CDROM_PKTCDVD is not set | 499 | # CONFIG_CDROM_PKTCDVD is not set |
488 | # CONFIG_ATA_OVER_ETH is not set | 500 | # CONFIG_ATA_OVER_ETH is not set |
489 | 501 | ||
@@ -537,6 +549,7 @@ CONFIG_BLK_DEV_AEC62XX=y | |||
537 | # CONFIG_BLK_DEV_JMICRON is not set | 549 | # CONFIG_BLK_DEV_JMICRON is not set |
538 | # CONFIG_BLK_DEV_SC1200 is not set | 550 | # CONFIG_BLK_DEV_SC1200 is not set |
539 | # CONFIG_BLK_DEV_PIIX is not set | 551 | # CONFIG_BLK_DEV_PIIX is not set |
552 | # CONFIG_BLK_DEV_IT8213 is not set | ||
540 | # CONFIG_BLK_DEV_IT821X is not set | 553 | # CONFIG_BLK_DEV_IT821X is not set |
541 | # CONFIG_BLK_DEV_NS87415 is not set | 554 | # CONFIG_BLK_DEV_NS87415 is not set |
542 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set | 555 | # CONFIG_BLK_DEV_PDC202XX_OLD is not set |
@@ -547,6 +560,8 @@ CONFIG_BLK_DEV_SIIMAGE=y | |||
547 | # CONFIG_BLK_DEV_SLC90E66 is not set | 560 | # CONFIG_BLK_DEV_SLC90E66 is not set |
548 | # CONFIG_BLK_DEV_TRM290 is not set | 561 | # CONFIG_BLK_DEV_TRM290 is not set |
549 | # CONFIG_BLK_DEV_VIA82CXXX is not set | 562 | # CONFIG_BLK_DEV_VIA82CXXX is not set |
563 | # CONFIG_BLK_DEV_TC86C001 is not set | ||
564 | CONFIG_BLK_DEV_IDE_CELLEB=y | ||
550 | # CONFIG_IDE_ARM is not set | 565 | # CONFIG_IDE_ARM is not set |
551 | CONFIG_BLK_DEV_IDEDMA=y | 566 | CONFIG_BLK_DEV_IDEDMA=y |
552 | # CONFIG_IDEDMA_IVB is not set | 567 | # CONFIG_IDEDMA_IVB is not set |
@@ -557,7 +572,7 @@ CONFIG_IDEDMA_AUTO=y | |||
557 | # SCSI device support | 572 | # SCSI device support |
558 | # | 573 | # |
559 | # CONFIG_RAID_ATTRS is not set | 574 | # CONFIG_RAID_ATTRS is not set |
560 | CONFIG_SCSI=m | 575 | CONFIG_SCSI=y |
561 | # CONFIG_SCSI_TGT is not set | 576 | # CONFIG_SCSI_TGT is not set |
562 | # CONFIG_SCSI_NETLINK is not set | 577 | # CONFIG_SCSI_NETLINK is not set |
563 | CONFIG_SCSI_PROC_FS=y | 578 | CONFIG_SCSI_PROC_FS=y |
@@ -565,12 +580,12 @@ CONFIG_SCSI_PROC_FS=y | |||
565 | # | 580 | # |
566 | # SCSI support type (disk, tape, CD-ROM) | 581 | # SCSI support type (disk, tape, CD-ROM) |
567 | # | 582 | # |
568 | CONFIG_BLK_DEV_SD=m | 583 | CONFIG_BLK_DEV_SD=y |
569 | # CONFIG_CHR_DEV_ST is not set | 584 | # CONFIG_CHR_DEV_ST is not set |
570 | # CONFIG_CHR_DEV_OSST is not set | 585 | # CONFIG_CHR_DEV_OSST is not set |
571 | CONFIG_BLK_DEV_SR=m | 586 | CONFIG_BLK_DEV_SR=m |
572 | # CONFIG_BLK_DEV_SR_VENDOR is not set | 587 | # CONFIG_BLK_DEV_SR_VENDOR is not set |
573 | CONFIG_CHR_DEV_SG=m | 588 | CONFIG_CHR_DEV_SG=y |
574 | # CONFIG_CHR_DEV_SCH is not set | 589 | # CONFIG_CHR_DEV_SCH is not set |
575 | 590 | ||
576 | # | 591 | # |
@@ -587,7 +602,7 @@ CONFIG_CHR_DEV_SG=m | |||
587 | # CONFIG_SCSI_SPI_ATTRS is not set | 602 | # CONFIG_SCSI_SPI_ATTRS is not set |
588 | # CONFIG_SCSI_FC_ATTRS is not set | 603 | # CONFIG_SCSI_FC_ATTRS is not set |
589 | # CONFIG_SCSI_ISCSI_ATTRS is not set | 604 | # CONFIG_SCSI_ISCSI_ATTRS is not set |
590 | # CONFIG_SCSI_SAS_ATTRS is not set | 605 | CONFIG_SCSI_SAS_ATTRS=y |
591 | # CONFIG_SCSI_SAS_LIBSAS is not set | 606 | # CONFIG_SCSI_SAS_LIBSAS is not set |
592 | 607 | ||
593 | # | 608 | # |
@@ -617,6 +632,7 @@ CONFIG_CHR_DEV_SG=m | |||
617 | # CONFIG_SCSI_INIA100 is not set | 632 | # CONFIG_SCSI_INIA100 is not set |
618 | # CONFIG_SCSI_STEX is not set | 633 | # CONFIG_SCSI_STEX is not set |
619 | # CONFIG_SCSI_SYM53C8XX_2 is not set | 634 | # CONFIG_SCSI_SYM53C8XX_2 is not set |
635 | # CONFIG_SCSI_IPR is not set | ||
620 | # CONFIG_SCSI_QLOGIC_1280 is not set | 636 | # CONFIG_SCSI_QLOGIC_1280 is not set |
621 | # CONFIG_SCSI_QLA_FC is not set | 637 | # CONFIG_SCSI_QLA_FC is not set |
622 | # CONFIG_SCSI_QLA_ISCSI is not set | 638 | # CONFIG_SCSI_QLA_ISCSI is not set |
@@ -629,7 +645,60 @@ CONFIG_CHR_DEV_SG=m | |||
629 | # | 645 | # |
630 | # Serial ATA (prod) and Parallel ATA (experimental) drivers | 646 | # Serial ATA (prod) and Parallel ATA (experimental) drivers |
631 | # | 647 | # |
632 | # CONFIG_ATA is not set | 648 | CONFIG_ATA=y |
649 | # CONFIG_ATA_NONSTANDARD is not set | ||
650 | # CONFIG_SATA_AHCI is not set | ||
651 | # CONFIG_SATA_SVW is not set | ||
652 | # CONFIG_ATA_PIIX is not set | ||
653 | # CONFIG_SATA_MV is not set | ||
654 | # CONFIG_SATA_NV is not set | ||
655 | # CONFIG_PDC_ADMA is not set | ||
656 | # CONFIG_SATA_QSTOR is not set | ||
657 | CONFIG_SATA_PROMISE=y | ||
658 | # CONFIG_SATA_SX4 is not set | ||
659 | # CONFIG_SATA_SIL is not set | ||
660 | # CONFIG_SATA_SIL24 is not set | ||
661 | # CONFIG_SATA_SIS is not set | ||
662 | # CONFIG_SATA_ULI is not set | ||
663 | # CONFIG_SATA_VIA is not set | ||
664 | # CONFIG_SATA_VITESSE is not set | ||
665 | # CONFIG_SATA_INIC162X is not set | ||
666 | # CONFIG_PATA_ALI is not set | ||
667 | # CONFIG_PATA_AMD is not set | ||
668 | # CONFIG_PATA_ARTOP is not set | ||
669 | # CONFIG_PATA_ATIIXP is not set | ||
670 | # CONFIG_PATA_CMD64X is not set | ||
671 | # CONFIG_PATA_CS5520 is not set | ||
672 | # CONFIG_PATA_CS5530 is not set | ||
673 | # CONFIG_PATA_CYPRESS is not set | ||
674 | # CONFIG_PATA_EFAR is not set | ||
675 | # CONFIG_ATA_GENERIC is not set | ||
676 | # CONFIG_PATA_HPT366 is not set | ||
677 | # CONFIG_PATA_HPT37X is not set | ||
678 | # CONFIG_PATA_HPT3X2N is not set | ||
679 | # CONFIG_PATA_HPT3X3 is not set | ||
680 | # CONFIG_PATA_IT821X is not set | ||
681 | # CONFIG_PATA_IT8213 is not set | ||
682 | # CONFIG_PATA_JMICRON is not set | ||
683 | # CONFIG_PATA_TRIFLEX is not set | ||
684 | # CONFIG_PATA_MARVELL is not set | ||
685 | # CONFIG_PATA_MPIIX is not set | ||
686 | # CONFIG_PATA_OLDPIIX is not set | ||
687 | # CONFIG_PATA_NETCELL is not set | ||
688 | # CONFIG_PATA_NS87410 is not set | ||
689 | # CONFIG_PATA_OPTI is not set | ||
690 | # CONFIG_PATA_OPTIDMA is not set | ||
691 | # CONFIG_PATA_PDC_OLD is not set | ||
692 | # CONFIG_PATA_RADISYS is not set | ||
693 | # CONFIG_PATA_RZ1000 is not set | ||
694 | # CONFIG_PATA_SC1200 is not set | ||
695 | # CONFIG_PATA_SERVERWORKS is not set | ||
696 | CONFIG_PATA_PDC2027X=m | ||
697 | # CONFIG_PATA_SIL680 is not set | ||
698 | # CONFIG_PATA_SIS is not set | ||
699 | # CONFIG_PATA_VIA is not set | ||
700 | # CONFIG_PATA_WINBOND is not set | ||
701 | # CONFIG_PATA_SCC is not set | ||
633 | 702 | ||
634 | # | 703 | # |
635 | # Multi-device support (RAID and LVM) | 704 | # Multi-device support (RAID and LVM) |
@@ -655,10 +724,12 @@ CONFIG_DM_MULTIPATH=m | |||
655 | # | 724 | # |
656 | # Fusion MPT device support | 725 | # Fusion MPT device support |
657 | # | 726 | # |
658 | # CONFIG_FUSION is not set | 727 | CONFIG_FUSION=y |
659 | # CONFIG_FUSION_SPI is not set | 728 | # CONFIG_FUSION_SPI is not set |
660 | # CONFIG_FUSION_FC is not set | 729 | # CONFIG_FUSION_FC is not set |
661 | # CONFIG_FUSION_SAS is not set | 730 | CONFIG_FUSION_SAS=y |
731 | CONFIG_FUSION_MAX_SGE=128 | ||
732 | # CONFIG_FUSION_CTL is not set | ||
662 | 733 | ||
663 | # | 734 | # |
664 | # IEEE 1394 (FireWire) support | 735 | # IEEE 1394 (FireWire) support |
@@ -732,15 +803,18 @@ CONFIG_TIGON3=y | |||
732 | # CONFIG_BNX2 is not set | 803 | # CONFIG_BNX2 is not set |
733 | CONFIG_SPIDER_NET=y | 804 | CONFIG_SPIDER_NET=y |
734 | # CONFIG_QLA3XXX is not set | 805 | # CONFIG_QLA3XXX is not set |
806 | # CONFIG_ATL1 is not set | ||
735 | 807 | ||
736 | # | 808 | # |
737 | # Ethernet (10000 Mbit) | 809 | # Ethernet (10000 Mbit) |
738 | # | 810 | # |
739 | # CONFIG_CHELSIO_T1 is not set | 811 | # CONFIG_CHELSIO_T1 is not set |
812 | # CONFIG_CHELSIO_T3 is not set | ||
740 | # CONFIG_IXGB is not set | 813 | # CONFIG_IXGB is not set |
741 | # CONFIG_S2IO is not set | 814 | # CONFIG_S2IO is not set |
742 | # CONFIG_MYRI10GE is not set | 815 | # CONFIG_MYRI10GE is not set |
743 | # CONFIG_NETXEN_NIC is not set | 816 | # CONFIG_NETXEN_NIC is not set |
817 | # CONFIG_PASEMI_MAC is not set | ||
744 | 818 | ||
745 | # | 819 | # |
746 | # Token Ring devices | 820 | # Token Ring devices |
@@ -853,16 +927,27 @@ CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | |||
853 | # | 927 | # |
854 | CONFIG_SERIAL_CORE=y | 928 | CONFIG_SERIAL_CORE=y |
855 | CONFIG_SERIAL_CORE_CONSOLE=y | 929 | CONFIG_SERIAL_CORE_CONSOLE=y |
930 | CONFIG_SERIAL_TXX9=y | ||
931 | CONFIG_HAS_TXX9_SERIAL=y | ||
932 | CONFIG_SERIAL_TXX9_NR_UARTS=2 | ||
933 | CONFIG_SERIAL_TXX9_CONSOLE=y | ||
856 | # CONFIG_SERIAL_JSM is not set | 934 | # CONFIG_SERIAL_JSM is not set |
935 | CONFIG_SERIAL_OF_PLATFORM=y | ||
857 | CONFIG_UNIX98_PTYS=y | 936 | CONFIG_UNIX98_PTYS=y |
858 | # CONFIG_LEGACY_PTYS is not set | 937 | # CONFIG_LEGACY_PTYS is not set |
859 | CONFIG_HVC_DRIVER=y | 938 | CONFIG_HVC_DRIVER=y |
860 | CONFIG_HVC_RTAS=y | 939 | CONFIG_HVC_RTAS=y |
940 | # CONFIG_HVC_BEAT is not set | ||
861 | 941 | ||
862 | # | 942 | # |
863 | # IPMI | 943 | # IPMI |
864 | # | 944 | # |
865 | # CONFIG_IPMI_HANDLER is not set | 945 | CONFIG_IPMI_HANDLER=m |
946 | # CONFIG_IPMI_PANIC_EVENT is not set | ||
947 | CONFIG_IPMI_DEVICE_INTERFACE=m | ||
948 | CONFIG_IPMI_SI=m | ||
949 | CONFIG_IPMI_WATCHDOG=m | ||
950 | CONFIG_IPMI_POWEROFF=m | ||
866 | 951 | ||
867 | # | 952 | # |
868 | # Watchdog Cards | 953 | # Watchdog Cards |
@@ -874,7 +959,7 @@ CONFIG_WATCHDOG=y | |||
874 | # Watchdog Device Drivers | 959 | # Watchdog Device Drivers |
875 | # | 960 | # |
876 | # CONFIG_SOFT_WATCHDOG is not set | 961 | # CONFIG_SOFT_WATCHDOG is not set |
877 | CONFIG_WATCHDOG_RTAS=y | 962 | # CONFIG_WATCHDOG_RTAS is not set |
878 | 963 | ||
879 | # | 964 | # |
880 | # PCI-based Watchdog Cards | 965 | # PCI-based Watchdog Cards |
@@ -929,6 +1014,7 @@ CONFIG_I2C_ALGOBIT=y | |||
929 | # CONFIG_I2C_NFORCE2 is not set | 1014 | # CONFIG_I2C_NFORCE2 is not set |
930 | # CONFIG_I2C_OCORES is not set | 1015 | # CONFIG_I2C_OCORES is not set |
931 | # CONFIG_I2C_PARPORT_LIGHT is not set | 1016 | # CONFIG_I2C_PARPORT_LIGHT is not set |
1017 | # CONFIG_I2C_PASEMI is not set | ||
932 | # CONFIG_I2C_PROSAVAGE is not set | 1018 | # CONFIG_I2C_PROSAVAGE is not set |
933 | # CONFIG_I2C_SAVAGE4 is not set | 1019 | # CONFIG_I2C_SAVAGE4 is not set |
934 | # CONFIG_I2C_SIS5595 is not set | 1020 | # CONFIG_I2C_SIS5595 is not set |
@@ -973,6 +1059,11 @@ CONFIG_I2C_ALGOBIT=y | |||
973 | # CONFIG_HWMON_VID is not set | 1059 | # CONFIG_HWMON_VID is not set |
974 | 1060 | ||
975 | # | 1061 | # |
1062 | # Multifunction device drivers | ||
1063 | # | ||
1064 | # CONFIG_MFD_SM501 is not set | ||
1065 | |||
1066 | # | ||
976 | # Multimedia devices | 1067 | # Multimedia devices |
977 | # | 1068 | # |
978 | # CONFIG_VIDEO_DEV is not set | 1069 | # CONFIG_VIDEO_DEV is not set |
@@ -986,7 +1077,7 @@ CONFIG_I2C_ALGOBIT=y | |||
986 | # | 1077 | # |
987 | # Graphics support | 1078 | # Graphics support |
988 | # | 1079 | # |
989 | CONFIG_FIRMWARE_EDID=y | 1080 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
990 | # CONFIG_FB is not set | 1081 | # CONFIG_FB is not set |
991 | # CONFIG_FB_IBM_GXT4500 is not set | 1082 | # CONFIG_FB_IBM_GXT4500 is not set |
992 | 1083 | ||
@@ -995,7 +1086,6 @@ CONFIG_FIRMWARE_EDID=y | |||
995 | # | 1086 | # |
996 | # CONFIG_VGA_CONSOLE is not set | 1087 | # CONFIG_VGA_CONSOLE is not set |
997 | CONFIG_DUMMY_CONSOLE=y | 1088 | CONFIG_DUMMY_CONSOLE=y |
998 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
999 | 1089 | ||
1000 | # | 1090 | # |
1001 | # Sound | 1091 | # Sound |
@@ -1006,6 +1096,7 @@ CONFIG_DUMMY_CONSOLE=y | |||
1006 | # HID Devices | 1096 | # HID Devices |
1007 | # | 1097 | # |
1008 | CONFIG_HID=m | 1098 | CONFIG_HID=m |
1099 | # CONFIG_HID_DEBUG is not set | ||
1009 | 1100 | ||
1010 | # | 1101 | # |
1011 | # USB support | 1102 | # USB support |
@@ -1020,9 +1111,7 @@ CONFIG_USB=m | |||
1020 | # Miscellaneous USB options | 1111 | # Miscellaneous USB options |
1021 | # | 1112 | # |
1022 | CONFIG_USB_DEVICEFS=y | 1113 | CONFIG_USB_DEVICEFS=y |
1023 | # CONFIG_USB_BANDWIDTH is not set | ||
1024 | # CONFIG_USB_DYNAMIC_MINORS is not set | 1114 | # CONFIG_USB_DYNAMIC_MINORS is not set |
1025 | # CONFIG_USB_MULTITHREAD_PROBE is not set | ||
1026 | # CONFIG_USB_OTG is not set | 1115 | # CONFIG_USB_OTG is not set |
1027 | 1116 | ||
1028 | # | 1117 | # |
@@ -1032,9 +1121,15 @@ CONFIG_USB_EHCI_HCD=m | |||
1032 | # CONFIG_USB_EHCI_SPLIT_ISO is not set | 1121 | # CONFIG_USB_EHCI_SPLIT_ISO is not set |
1033 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set | 1122 | # CONFIG_USB_EHCI_ROOT_HUB_TT is not set |
1034 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set | 1123 | # CONFIG_USB_EHCI_TT_NEWSCHED is not set |
1124 | CONFIG_USB_EHCI_BIG_ENDIAN_MMIO=y | ||
1035 | # CONFIG_USB_ISP116X_HCD is not set | 1125 | # CONFIG_USB_ISP116X_HCD is not set |
1036 | CONFIG_USB_OHCI_HCD=m | 1126 | CONFIG_USB_OHCI_HCD=m |
1037 | # CONFIG_USB_OHCI_BIG_ENDIAN is not set | 1127 | CONFIG_USB_OHCI_HCD_PPC_OF=y |
1128 | CONFIG_USB_OHCI_HCD_PPC_OF_BE=y | ||
1129 | # CONFIG_USB_OHCI_HCD_PPC_OF_LE is not set | ||
1130 | CONFIG_USB_OHCI_HCD_PCI=y | ||
1131 | CONFIG_USB_OHCI_BIG_ENDIAN_DESC=y | ||
1132 | CONFIG_USB_OHCI_BIG_ENDIAN_MMIO=y | ||
1038 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y | 1133 | CONFIG_USB_OHCI_LITTLE_ENDIAN=y |
1039 | # CONFIG_USB_UHCI_HCD is not set | 1134 | # CONFIG_USB_UHCI_HCD is not set |
1040 | # CONFIG_USB_SL811_HCD is not set | 1135 | # CONFIG_USB_SL811_HCD is not set |
@@ -1088,6 +1183,7 @@ CONFIG_USB_STORAGE=m | |||
1088 | # CONFIG_USB_ATI_REMOTE2 is not set | 1183 | # CONFIG_USB_ATI_REMOTE2 is not set |
1089 | # CONFIG_USB_KEYSPAN_REMOTE is not set | 1184 | # CONFIG_USB_KEYSPAN_REMOTE is not set |
1090 | # CONFIG_USB_APPLETOUCH is not set | 1185 | # CONFIG_USB_APPLETOUCH is not set |
1186 | # CONFIG_USB_GTCO is not set | ||
1091 | 1187 | ||
1092 | # | 1188 | # |
1093 | # USB Imaging devices | 1189 | # USB Imaging devices |
@@ -1125,6 +1221,7 @@ CONFIG_USB_MON=y | |||
1125 | # CONFIG_USB_RIO500 is not set | 1221 | # CONFIG_USB_RIO500 is not set |
1126 | # CONFIG_USB_LEGOTOWER is not set | 1222 | # CONFIG_USB_LEGOTOWER is not set |
1127 | # CONFIG_USB_LCD is not set | 1223 | # CONFIG_USB_LCD is not set |
1224 | # CONFIG_USB_BERRY_CHARGE is not set | ||
1128 | # CONFIG_USB_LED is not set | 1225 | # CONFIG_USB_LED is not set |
1129 | # CONFIG_USB_CYPRESS_CY7C63 is not set | 1226 | # CONFIG_USB_CYPRESS_CY7C63 is not set |
1130 | # CONFIG_USB_CYTHERM is not set | 1227 | # CONFIG_USB_CYTHERM is not set |
@@ -1135,6 +1232,7 @@ CONFIG_USB_MON=y | |||
1135 | # CONFIG_USB_SISUSBVGA is not set | 1232 | # CONFIG_USB_SISUSBVGA is not set |
1136 | # CONFIG_USB_LD is not set | 1233 | # CONFIG_USB_LD is not set |
1137 | # CONFIG_USB_TRANCEVIBRATOR is not set | 1234 | # CONFIG_USB_TRANCEVIBRATOR is not set |
1235 | # CONFIG_USB_IOWARRIOR is not set | ||
1138 | # CONFIG_USB_TEST is not set | 1236 | # CONFIG_USB_TEST is not set |
1139 | 1237 | ||
1140 | # | 1238 | # |
@@ -1175,6 +1273,7 @@ CONFIG_INFINIBAND_MTHCA=m | |||
1175 | CONFIG_INFINIBAND_MTHCA_DEBUG=y | 1273 | CONFIG_INFINIBAND_MTHCA_DEBUG=y |
1176 | # CONFIG_INFINIBAND_AMSO1100 is not set | 1274 | # CONFIG_INFINIBAND_AMSO1100 is not set |
1177 | CONFIG_INFINIBAND_IPOIB=m | 1275 | CONFIG_INFINIBAND_IPOIB=m |
1276 | # CONFIG_INFINIBAND_IPOIB_CM is not set | ||
1178 | CONFIG_INFINIBAND_IPOIB_DEBUG=y | 1277 | CONFIG_INFINIBAND_IPOIB_DEBUG=y |
1179 | CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y | 1278 | CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y |
1180 | # CONFIG_INFINIBAND_SRP is not set | 1279 | # CONFIG_INFINIBAND_SRP is not set |
@@ -1203,6 +1302,10 @@ CONFIG_INFINIBAND_IPOIB_DEBUG_DATA=y | |||
1203 | # | 1302 | # |
1204 | 1303 | ||
1205 | # | 1304 | # |
1305 | # Auxiliary Display support | ||
1306 | # | ||
1307 | |||
1308 | # | ||
1206 | # Virtualization | 1309 | # Virtualization |
1207 | # | 1310 | # |
1208 | 1311 | ||
@@ -1395,7 +1498,8 @@ CONFIG_TEXTSEARCH_KMP=m | |||
1395 | CONFIG_TEXTSEARCH_BM=m | 1498 | CONFIG_TEXTSEARCH_BM=m |
1396 | CONFIG_TEXTSEARCH_FSM=m | 1499 | CONFIG_TEXTSEARCH_FSM=m |
1397 | CONFIG_PLIST=y | 1500 | CONFIG_PLIST=y |
1398 | CONFIG_IOMAP_COPY=y | 1501 | CONFIG_HAS_IOMEM=y |
1502 | CONFIG_HAS_IOPORT=y | ||
1399 | 1503 | ||
1400 | # | 1504 | # |
1401 | # Instrumentation Support | 1505 | # Instrumentation Support |
@@ -1414,15 +1518,16 @@ CONFIG_MAGIC_SYSRQ=y | |||
1414 | CONFIG_DEBUG_FS=y | 1518 | CONFIG_DEBUG_FS=y |
1415 | # CONFIG_HEADERS_CHECK is not set | 1519 | # CONFIG_HEADERS_CHECK is not set |
1416 | CONFIG_DEBUG_KERNEL=y | 1520 | CONFIG_DEBUG_KERNEL=y |
1521 | # CONFIG_DEBUG_SHIRQ is not set | ||
1417 | CONFIG_LOG_BUF_SHIFT=15 | 1522 | CONFIG_LOG_BUF_SHIFT=15 |
1418 | CONFIG_DETECT_SOFTLOCKUP=y | 1523 | # CONFIG_DETECT_SOFTLOCKUP is not set |
1419 | # CONFIG_SCHEDSTATS is not set | 1524 | # CONFIG_SCHEDSTATS is not set |
1525 | # CONFIG_TIMER_STATS is not set | ||
1420 | # CONFIG_DEBUG_SLAB is not set | 1526 | # CONFIG_DEBUG_SLAB is not set |
1421 | # CONFIG_DEBUG_RT_MUTEXES is not set | 1527 | # CONFIG_DEBUG_RT_MUTEXES is not set |
1422 | # CONFIG_RT_MUTEX_TESTER is not set | 1528 | # CONFIG_RT_MUTEX_TESTER is not set |
1423 | # CONFIG_DEBUG_SPINLOCK is not set | 1529 | # CONFIG_DEBUG_SPINLOCK is not set |
1424 | CONFIG_DEBUG_MUTEXES=y | 1530 | CONFIG_DEBUG_MUTEXES=y |
1425 | # CONFIG_DEBUG_RWSEMS is not set | ||
1426 | CONFIG_DEBUG_SPINLOCK_SLEEP=y | 1531 | CONFIG_DEBUG_SPINLOCK_SLEEP=y |
1427 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set | 1532 | # CONFIG_DEBUG_LOCKING_API_SELFTESTS is not set |
1428 | # CONFIG_DEBUG_KOBJECT is not set | 1533 | # CONFIG_DEBUG_KOBJECT is not set |
@@ -1432,6 +1537,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1432 | # CONFIG_DEBUG_LIST is not set | 1537 | # CONFIG_DEBUG_LIST is not set |
1433 | # CONFIG_FORCED_INLINING is not set | 1538 | # CONFIG_FORCED_INLINING is not set |
1434 | # CONFIG_RCU_TORTURE_TEST is not set | 1539 | # CONFIG_RCU_TORTURE_TEST is not set |
1540 | # CONFIG_FAULT_INJECTION is not set | ||
1435 | # CONFIG_DEBUG_STACKOVERFLOW is not set | 1541 | # CONFIG_DEBUG_STACKOVERFLOW is not set |
1436 | # CONFIG_DEBUG_STACK_USAGE is not set | 1542 | # CONFIG_DEBUG_STACK_USAGE is not set |
1437 | CONFIG_DEBUGGER=y | 1543 | CONFIG_DEBUGGER=y |
@@ -1469,8 +1575,10 @@ CONFIG_CRYPTO_SHA1=m | |||
1469 | # CONFIG_CRYPTO_GF128MUL is not set | 1575 | # CONFIG_CRYPTO_GF128MUL is not set |
1470 | CONFIG_CRYPTO_ECB=m | 1576 | CONFIG_CRYPTO_ECB=m |
1471 | CONFIG_CRYPTO_CBC=m | 1577 | CONFIG_CRYPTO_CBC=m |
1578 | CONFIG_CRYPTO_PCBC=m | ||
1472 | # CONFIG_CRYPTO_LRW is not set | 1579 | # CONFIG_CRYPTO_LRW is not set |
1473 | CONFIG_CRYPTO_DES=m | 1580 | CONFIG_CRYPTO_DES=m |
1581 | # CONFIG_CRYPTO_FCRYPT is not set | ||
1474 | # CONFIG_CRYPTO_BLOWFISH is not set | 1582 | # CONFIG_CRYPTO_BLOWFISH is not set |
1475 | # CONFIG_CRYPTO_TWOFISH is not set | 1583 | # CONFIG_CRYPTO_TWOFISH is not set |
1476 | # CONFIG_CRYPTO_SERPENT is not set | 1584 | # CONFIG_CRYPTO_SERPENT is not set |
@@ -1484,6 +1592,7 @@ CONFIG_CRYPTO_DES=m | |||
1484 | CONFIG_CRYPTO_DEFLATE=m | 1592 | CONFIG_CRYPTO_DEFLATE=m |
1485 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 1593 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
1486 | # CONFIG_CRYPTO_CRC32C is not set | 1594 | # CONFIG_CRYPTO_CRC32C is not set |
1595 | # CONFIG_CRYPTO_CAMELLIA is not set | ||
1487 | # CONFIG_CRYPTO_TEST is not set | 1596 | # CONFIG_CRYPTO_TEST is not set |
1488 | 1597 | ||
1489 | # | 1598 | # |
diff --git a/arch/powerpc/kernel/udbg_16550.c b/arch/powerpc/kernel/udbg_16550.c index e738f93b42fe..a963f657222b 100644 --- a/arch/powerpc/kernel/udbg_16550.c +++ b/arch/powerpc/kernel/udbg_16550.c | |||
@@ -184,7 +184,7 @@ void udbg_pas_real_putc(char c) | |||
184 | 184 | ||
185 | void udbg_init_pas_realmode(void) | 185 | void udbg_init_pas_realmode(void) |
186 | { | 186 | { |
187 | udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8; | 187 | udbg_comport = (volatile struct NS16550 __iomem *)0xfcff03f8UL; |
188 | 188 | ||
189 | udbg_putc = udbg_pas_real_putc; | 189 | udbg_putc = udbg_pas_real_putc; |
190 | udbg_getc = NULL; | 190 | udbg_getc = NULL; |
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c index c0d2a694fa30..3c7fe2c65b5a 100644 --- a/arch/powerpc/mm/hash_utils_64.c +++ b/arch/powerpc/mm/hash_utils_64.c | |||
@@ -685,6 +685,9 @@ int hash_page(unsigned long ea, unsigned long access, unsigned long trap) | |||
685 | "non-cacheable mapping\n"); | 685 | "non-cacheable mapping\n"); |
686 | psize = mmu_vmalloc_psize = MMU_PAGE_4K; | 686 | psize = mmu_vmalloc_psize = MMU_PAGE_4K; |
687 | } | 687 | } |
688 | #ifdef CONFIG_SPE_BASE | ||
689 | spu_flush_all_slbs(mm); | ||
690 | #endif | ||
688 | } | 691 | } |
689 | if (user_region) { | 692 | if (user_region) { |
690 | if (psize != get_paca()->context.user_psize) { | 693 | if (psize != get_paca()->context.user_psize) { |
@@ -759,6 +762,9 @@ void hash_preload(struct mm_struct *mm, unsigned long ea, | |||
759 | mmu_psize_defs[MMU_PAGE_4K].sllp; | 762 | mmu_psize_defs[MMU_PAGE_4K].sllp; |
760 | get_paca()->context = mm->context; | 763 | get_paca()->context = mm->context; |
761 | slb_flush_and_rebolt(); | 764 | slb_flush_and_rebolt(); |
765 | #ifdef CONFIG_SPE_BASE | ||
766 | spu_flush_all_slbs(mm); | ||
767 | #endif | ||
762 | } | 768 | } |
763 | } | 769 | } |
764 | if (mm->context.user_psize == MMU_PAGE_64K) | 770 | if (mm->context.user_psize == MMU_PAGE_64K) |
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 8c77c791f87e..f6ffaaa7a5bf 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <asm/machdep.h> | 24 | #include <asm/machdep.h> |
25 | #include <asm/cputable.h> | 25 | #include <asm/cputable.h> |
26 | #include <asm/tlb.h> | 26 | #include <asm/tlb.h> |
27 | #include <asm/spu.h> | ||
27 | 28 | ||
28 | #include <linux/sysctl.h> | 29 | #include <linux/sysctl.h> |
29 | 30 | ||
@@ -513,6 +514,9 @@ int prepare_hugepage_range(unsigned long addr, unsigned long len, pgoff_t pgoff) | |||
513 | if ((addr + len) > 0x100000000UL) | 514 | if ((addr + len) > 0x100000000UL) |
514 | err = open_high_hpage_areas(current->mm, | 515 | err = open_high_hpage_areas(current->mm, |
515 | HTLB_AREA_MASK(addr, len)); | 516 | HTLB_AREA_MASK(addr, len)); |
517 | #ifdef CONFIG_SPE_BASE | ||
518 | spu_flush_all_slbs(current->mm); | ||
519 | #endif | ||
516 | if (err) { | 520 | if (err) { |
517 | printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)" | 521 | printk(KERN_DEBUG "prepare_hugepage_range(%lx, %lx)" |
518 | " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n", | 522 | " failed (lowmask: 0x%04hx, highmask: 0x%04hx)\n", |
diff --git a/arch/powerpc/platforms/cell/spu_base.c b/arch/powerpc/platforms/cell/spu_base.c index c43999a10deb..eba7a2641dce 100644 --- a/arch/powerpc/platforms/cell/spu_base.c +++ b/arch/powerpc/platforms/cell/spu_base.c | |||
@@ -38,8 +38,61 @@ | |||
38 | const struct spu_management_ops *spu_management_ops; | 38 | const struct spu_management_ops *spu_management_ops; |
39 | const struct spu_priv1_ops *spu_priv1_ops; | 39 | const struct spu_priv1_ops *spu_priv1_ops; |
40 | 40 | ||
41 | static struct list_head spu_list[MAX_NUMNODES]; | ||
42 | static LIST_HEAD(spu_full_list); | ||
43 | static DEFINE_MUTEX(spu_mutex); | ||
44 | static spinlock_t spu_list_lock = SPIN_LOCK_UNLOCKED; | ||
45 | |||
41 | EXPORT_SYMBOL_GPL(spu_priv1_ops); | 46 | EXPORT_SYMBOL_GPL(spu_priv1_ops); |
42 | 47 | ||
48 | void spu_invalidate_slbs(struct spu *spu) | ||
49 | { | ||
50 | struct spu_priv2 __iomem *priv2 = spu->priv2; | ||
51 | |||
52 | if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) | ||
53 | out_be64(&priv2->slb_invalidate_all_W, 0UL); | ||
54 | } | ||
55 | EXPORT_SYMBOL_GPL(spu_invalidate_slbs); | ||
56 | |||
57 | /* This is called by the MM core when a segment size is changed, to | ||
58 | * request a flush of all the SPEs using a given mm | ||
59 | */ | ||
60 | void spu_flush_all_slbs(struct mm_struct *mm) | ||
61 | { | ||
62 | struct spu *spu; | ||
63 | unsigned long flags; | ||
64 | |||
65 | spin_lock_irqsave(&spu_list_lock, flags); | ||
66 | list_for_each_entry(spu, &spu_full_list, full_list) { | ||
67 | if (spu->mm == mm) | ||
68 | spu_invalidate_slbs(spu); | ||
69 | } | ||
70 | spin_unlock_irqrestore(&spu_list_lock, flags); | ||
71 | } | ||
72 | |||
73 | /* The hack below stinks... try to do something better one of | ||
74 | * these days... Does it even work properly with NR_CPUS == 1 ? | ||
75 | */ | ||
76 | static inline void mm_needs_global_tlbie(struct mm_struct *mm) | ||
77 | { | ||
78 | int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; | ||
79 | |||
80 | /* Global TLBIE broadcast required with SPEs. */ | ||
81 | __cpus_setall(&mm->cpu_vm_mask, nr); | ||
82 | } | ||
83 | |||
84 | void spu_associate_mm(struct spu *spu, struct mm_struct *mm) | ||
85 | { | ||
86 | unsigned long flags; | ||
87 | |||
88 | spin_lock_irqsave(&spu_list_lock, flags); | ||
89 | spu->mm = mm; | ||
90 | spin_unlock_irqrestore(&spu_list_lock, flags); | ||
91 | if (mm) | ||
92 | mm_needs_global_tlbie(mm); | ||
93 | } | ||
94 | EXPORT_SYMBOL_GPL(spu_associate_mm); | ||
95 | |||
43 | static int __spu_trap_invalid_dma(struct spu *spu) | 96 | static int __spu_trap_invalid_dma(struct spu *spu) |
44 | { | 97 | { |
45 | pr_debug("%s\n", __FUNCTION__); | 98 | pr_debug("%s\n", __FUNCTION__); |
@@ -74,6 +127,7 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea) | |||
74 | struct spu_priv2 __iomem *priv2 = spu->priv2; | 127 | struct spu_priv2 __iomem *priv2 = spu->priv2; |
75 | struct mm_struct *mm = spu->mm; | 128 | struct mm_struct *mm = spu->mm; |
76 | u64 esid, vsid, llp; | 129 | u64 esid, vsid, llp; |
130 | int psize; | ||
77 | 131 | ||
78 | pr_debug("%s\n", __FUNCTION__); | 132 | pr_debug("%s\n", __FUNCTION__); |
79 | 133 | ||
@@ -90,22 +144,25 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea) | |||
90 | case USER_REGION_ID: | 144 | case USER_REGION_ID: |
91 | #ifdef CONFIG_HUGETLB_PAGE | 145 | #ifdef CONFIG_HUGETLB_PAGE |
92 | if (in_hugepage_area(mm->context, ea)) | 146 | if (in_hugepage_area(mm->context, ea)) |
93 | llp = mmu_psize_defs[mmu_huge_psize].sllp; | 147 | psize = mmu_huge_psize; |
94 | else | 148 | else |
95 | #endif | 149 | #endif |
96 | llp = mmu_psize_defs[mmu_virtual_psize].sllp; | 150 | psize = mm->context.user_psize; |
97 | vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | | 151 | vsid = (get_vsid(mm->context.id, ea) << SLB_VSID_SHIFT) | |
98 | SLB_VSID_USER | llp; | 152 | SLB_VSID_USER; |
99 | break; | 153 | break; |
100 | case VMALLOC_REGION_ID: | 154 | case VMALLOC_REGION_ID: |
101 | llp = mmu_psize_defs[mmu_virtual_psize].sllp; | 155 | if (ea < VMALLOC_END) |
156 | psize = mmu_vmalloc_psize; | ||
157 | else | ||
158 | psize = mmu_io_psize; | ||
102 | vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | | 159 | vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | |
103 | SLB_VSID_KERNEL | llp; | 160 | SLB_VSID_KERNEL; |
104 | break; | 161 | break; |
105 | case KERNEL_REGION_ID: | 162 | case KERNEL_REGION_ID: |
106 | llp = mmu_psize_defs[mmu_linear_psize].sllp; | 163 | psize = mmu_linear_psize; |
107 | vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | | 164 | vsid = (get_kernel_vsid(ea) << SLB_VSID_SHIFT) | |
108 | SLB_VSID_KERNEL | llp; | 165 | SLB_VSID_KERNEL; |
109 | break; | 166 | break; |
110 | default: | 167 | default: |
111 | /* Future: support kernel segments so that drivers | 168 | /* Future: support kernel segments so that drivers |
@@ -114,9 +171,10 @@ static int __spu_trap_data_seg(struct spu *spu, unsigned long ea) | |||
114 | pr_debug("invalid region access at %016lx\n", ea); | 171 | pr_debug("invalid region access at %016lx\n", ea); |
115 | return 1; | 172 | return 1; |
116 | } | 173 | } |
174 | llp = mmu_psize_defs[psize].sllp; | ||
117 | 175 | ||
118 | out_be64(&priv2->slb_index_W, spu->slb_replace); | 176 | out_be64(&priv2->slb_index_W, spu->slb_replace); |
119 | out_be64(&priv2->slb_vsid_RW, vsid); | 177 | out_be64(&priv2->slb_vsid_RW, vsid | llp); |
120 | out_be64(&priv2->slb_esid_RW, esid); | 178 | out_be64(&priv2->slb_esid_RW, esid); |
121 | 179 | ||
122 | spu->slb_replace++; | 180 | spu->slb_replace++; |
@@ -330,10 +388,6 @@ static void spu_free_irqs(struct spu *spu) | |||
330 | free_irq(spu->irqs[2], spu); | 388 | free_irq(spu->irqs[2], spu); |
331 | } | 389 | } |
332 | 390 | ||
333 | static struct list_head spu_list[MAX_NUMNODES]; | ||
334 | static LIST_HEAD(spu_full_list); | ||
335 | static DEFINE_MUTEX(spu_mutex); | ||
336 | |||
337 | static void spu_init_channels(struct spu *spu) | 391 | static void spu_init_channels(struct spu *spu) |
338 | { | 392 | { |
339 | static const struct { | 393 | static const struct { |
@@ -593,6 +647,7 @@ static int __init create_spu(void *data) | |||
593 | struct spu *spu; | 647 | struct spu *spu; |
594 | int ret; | 648 | int ret; |
595 | static int number; | 649 | static int number; |
650 | unsigned long flags; | ||
596 | 651 | ||
597 | ret = -ENOMEM; | 652 | ret = -ENOMEM; |
598 | spu = kzalloc(sizeof (*spu), GFP_KERNEL); | 653 | spu = kzalloc(sizeof (*spu), GFP_KERNEL); |
@@ -620,8 +675,10 @@ static int __init create_spu(void *data) | |||
620 | goto out_free_irqs; | 675 | goto out_free_irqs; |
621 | 676 | ||
622 | mutex_lock(&spu_mutex); | 677 | mutex_lock(&spu_mutex); |
678 | spin_lock_irqsave(&spu_list_lock, flags); | ||
623 | list_add(&spu->list, &spu_list[spu->node]); | 679 | list_add(&spu->list, &spu_list[spu->node]); |
624 | list_add(&spu->full_list, &spu_full_list); | 680 | list_add(&spu->full_list, &spu_full_list); |
681 | spin_unlock_irqrestore(&spu_list_lock, flags); | ||
625 | mutex_unlock(&spu_mutex); | 682 | mutex_unlock(&spu_mutex); |
626 | 683 | ||
627 | goto out; | 684 | goto out; |
diff --git a/arch/powerpc/platforms/cell/spufs/file.c b/arch/powerpc/platforms/cell/spufs/file.c index b00653d69c01..505266a568d4 100644 --- a/arch/powerpc/platforms/cell/spufs/file.c +++ b/arch/powerpc/platforms/cell/spufs/file.c | |||
@@ -63,8 +63,8 @@ static ssize_t | |||
63 | spufs_mem_read(struct file *file, char __user *buffer, | 63 | spufs_mem_read(struct file *file, char __user *buffer, |
64 | size_t size, loff_t *pos) | 64 | size_t size, loff_t *pos) |
65 | { | 65 | { |
66 | int ret; | ||
67 | struct spu_context *ctx = file->private_data; | 66 | struct spu_context *ctx = file->private_data; |
67 | ssize_t ret; | ||
68 | 68 | ||
69 | spu_acquire(ctx); | 69 | spu_acquire(ctx); |
70 | ret = __spufs_mem_read(ctx, buffer, size, pos); | 70 | ret = __spufs_mem_read(ctx, buffer, size, pos); |
@@ -74,25 +74,29 @@ spufs_mem_read(struct file *file, char __user *buffer, | |||
74 | 74 | ||
75 | static ssize_t | 75 | static ssize_t |
76 | spufs_mem_write(struct file *file, const char __user *buffer, | 76 | spufs_mem_write(struct file *file, const char __user *buffer, |
77 | size_t size, loff_t *pos) | 77 | size_t size, loff_t *ppos) |
78 | { | 78 | { |
79 | struct spu_context *ctx = file->private_data; | 79 | struct spu_context *ctx = file->private_data; |
80 | char *local_store; | 80 | char *local_store; |
81 | loff_t pos = *ppos; | ||
81 | int ret; | 82 | int ret; |
82 | 83 | ||
83 | size = min_t(ssize_t, LS_SIZE - *pos, size); | 84 | if (pos < 0) |
84 | if (size <= 0) | 85 | return -EINVAL; |
86 | if (pos > LS_SIZE) | ||
85 | return -EFBIG; | 87 | return -EFBIG; |
86 | *pos += size; | 88 | if (size > LS_SIZE - pos) |
89 | size = LS_SIZE - pos; | ||
87 | 90 | ||
88 | spu_acquire(ctx); | 91 | spu_acquire(ctx); |
89 | |||
90 | local_store = ctx->ops->get_ls(ctx); | 92 | local_store = ctx->ops->get_ls(ctx); |
91 | ret = copy_from_user(local_store + *pos - size, | 93 | ret = copy_from_user(local_store + pos, buffer, size); |
92 | buffer, size) ? -EFAULT : size; | ||
93 | |||
94 | spu_release(ctx); | 94 | spu_release(ctx); |
95 | return ret; | 95 | |
96 | if (ret) | ||
97 | return -EFAULT; | ||
98 | *ppos = pos + size; | ||
99 | return size; | ||
96 | } | 100 | } |
97 | 101 | ||
98 | static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma, | 102 | static unsigned long spufs_mem_mmap_nopfn(struct vm_area_struct *vma, |
diff --git a/arch/powerpc/platforms/cell/spufs/run.c b/arch/powerpc/platforms/cell/spufs/run.c index 353a8fa07ab8..f95a611ca362 100644 --- a/arch/powerpc/platforms/cell/spufs/run.c +++ b/arch/powerpc/platforms/cell/spufs/run.c | |||
@@ -143,7 +143,7 @@ static inline int spu_run_init(struct spu_context *ctx, u32 * npc) | |||
143 | int ret; | 143 | int ret; |
144 | unsigned long runcntl = SPU_RUNCNTL_RUNNABLE; | 144 | unsigned long runcntl = SPU_RUNCNTL_RUNNABLE; |
145 | 145 | ||
146 | ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); | 146 | ret = spu_acquire_runnable(ctx, 0); |
147 | if (ret) | 147 | if (ret) |
148 | return ret; | 148 | return ret; |
149 | 149 | ||
@@ -155,7 +155,7 @@ static inline int spu_run_init(struct spu_context *ctx, u32 * npc) | |||
155 | spu_release(ctx); | 155 | spu_release(ctx); |
156 | ret = spu_setup_isolated(ctx); | 156 | ret = spu_setup_isolated(ctx); |
157 | if (!ret) | 157 | if (!ret) |
158 | ret = spu_acquire_runnable(ctx, SPU_ACTIVATE_NOWAKE); | 158 | ret = spu_acquire_runnable(ctx, 0); |
159 | } | 159 | } |
160 | 160 | ||
161 | /* if userspace has set the runcntrl register (eg, to issue an | 161 | /* if userspace has set the runcntrl register (eg, to issue an |
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 2f25e68b4bac..39823cec0844 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -127,14 +127,6 @@ static void spu_remove_from_active_list(struct spu *spu) | |||
127 | mutex_unlock(&spu_prio->active_mutex[node]); | 127 | mutex_unlock(&spu_prio->active_mutex[node]); |
128 | } | 128 | } |
129 | 129 | ||
130 | static inline void mm_needs_global_tlbie(struct mm_struct *mm) | ||
131 | { | ||
132 | int nr = (NR_CPUS > 1) ? NR_CPUS : NR_CPUS + 1; | ||
133 | |||
134 | /* Global TLBIE broadcast required with SPEs. */ | ||
135 | __cpus_setall(&mm->cpu_vm_mask, nr); | ||
136 | } | ||
137 | |||
138 | static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); | 130 | static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); |
139 | 131 | ||
140 | static void spu_switch_notify(struct spu *spu, struct spu_context *ctx) | 132 | static void spu_switch_notify(struct spu *spu, struct spu_context *ctx) |
@@ -167,8 +159,7 @@ static void spu_bind_context(struct spu *spu, struct spu_context *ctx) | |||
167 | ctx->spu = spu; | 159 | ctx->spu = spu; |
168 | ctx->ops = &spu_hw_ops; | 160 | ctx->ops = &spu_hw_ops; |
169 | spu->pid = current->pid; | 161 | spu->pid = current->pid; |
170 | spu->mm = ctx->owner; | 162 | spu_associate_mm(spu, ctx->owner); |
171 | mm_needs_global_tlbie(spu->mm); | ||
172 | spu->ibox_callback = spufs_ibox_callback; | 163 | spu->ibox_callback = spufs_ibox_callback; |
173 | spu->wbox_callback = spufs_wbox_callback; | 164 | spu->wbox_callback = spufs_wbox_callback; |
174 | spu->stop_callback = spufs_stop_callback; | 165 | spu->stop_callback = spufs_stop_callback; |
@@ -205,7 +196,7 @@ static void spu_unbind_context(struct spu *spu, struct spu_context *ctx) | |||
205 | spu->stop_callback = NULL; | 196 | spu->stop_callback = NULL; |
206 | spu->mfc_callback = NULL; | 197 | spu->mfc_callback = NULL; |
207 | spu->dma_callback = NULL; | 198 | spu->dma_callback = NULL; |
208 | spu->mm = NULL; | 199 | spu_associate_mm(spu, NULL); |
209 | spu->pid = 0; | 200 | spu->pid = 0; |
210 | ctx->ops = &spu_backing_ops; | 201 | ctx->ops = &spu_backing_ops; |
211 | ctx->spu = NULL; | 202 | ctx->spu = NULL; |
@@ -263,7 +254,6 @@ static void spu_prio_wait(struct spu_context *ctx) | |||
263 | { | 254 | { |
264 | DEFINE_WAIT(wait); | 255 | DEFINE_WAIT(wait); |
265 | 256 | ||
266 | set_bit(SPU_SCHED_WAKE, &ctx->sched_flags); | ||
267 | prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE); | 257 | prepare_to_wait_exclusive(&ctx->stop_wq, &wait, TASK_INTERRUPTIBLE); |
268 | if (!signal_pending(current)) { | 258 | if (!signal_pending(current)) { |
269 | mutex_unlock(&ctx->state_mutex); | 259 | mutex_unlock(&ctx->state_mutex); |
@@ -272,7 +262,6 @@ static void spu_prio_wait(struct spu_context *ctx) | |||
272 | } | 262 | } |
273 | __set_current_state(TASK_RUNNING); | 263 | __set_current_state(TASK_RUNNING); |
274 | remove_wait_queue(&ctx->stop_wq, &wait); | 264 | remove_wait_queue(&ctx->stop_wq, &wait); |
275 | clear_bit(SPU_SCHED_WAKE, &ctx->sched_flags); | ||
276 | } | 265 | } |
277 | 266 | ||
278 | /** | 267 | /** |
@@ -292,7 +281,7 @@ static void spu_reschedule(struct spu *spu) | |||
292 | best = sched_find_first_bit(spu_prio->bitmap); | 281 | best = sched_find_first_bit(spu_prio->bitmap); |
293 | if (best < MAX_PRIO) { | 282 | if (best < MAX_PRIO) { |
294 | struct spu_context *ctx = spu_grab_context(best); | 283 | struct spu_context *ctx = spu_grab_context(best); |
295 | if (ctx && test_bit(SPU_SCHED_WAKE, &ctx->sched_flags)) | 284 | if (ctx) |
296 | wake_up(&ctx->stop_wq); | 285 | wake_up(&ctx->stop_wq); |
297 | } | 286 | } |
298 | spin_unlock(&spu_prio->runq_lock); | 287 | spin_unlock(&spu_prio->runq_lock); |
@@ -414,8 +403,7 @@ int spu_activate(struct spu_context *ctx, unsigned long flags) | |||
414 | } | 403 | } |
415 | 404 | ||
416 | spu_add_to_rq(ctx); | 405 | spu_add_to_rq(ctx); |
417 | if (!(flags & SPU_ACTIVATE_NOWAKE)) | 406 | spu_prio_wait(ctx); |
418 | spu_prio_wait(ctx); | ||
419 | spu_del_from_rq(ctx); | 407 | spu_del_from_rq(ctx); |
420 | } while (!signal_pending(current)); | 408 | } while (!signal_pending(current)); |
421 | 409 | ||
diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 0c437891dfd5..5c4e47d69d79 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h | |||
@@ -41,7 +41,7 @@ struct spu_gang; | |||
41 | 41 | ||
42 | /* ctx->sched_flags */ | 42 | /* ctx->sched_flags */ |
43 | enum { | 43 | enum { |
44 | SPU_SCHED_WAKE = 0, | 44 | SPU_SCHED_WAKE = 0, /* currently unused */ |
45 | }; | 45 | }; |
46 | 46 | ||
47 | struct spu_context { | 47 | struct spu_context { |
@@ -191,9 +191,7 @@ void spu_forget(struct spu_context *ctx); | |||
191 | int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); | 191 | int spu_acquire_runnable(struct spu_context *ctx, unsigned long flags); |
192 | void spu_acquire_saved(struct spu_context *ctx); | 192 | void spu_acquire_saved(struct spu_context *ctx); |
193 | int spu_acquire_exclusive(struct spu_context *ctx); | 193 | int spu_acquire_exclusive(struct spu_context *ctx); |
194 | enum { | 194 | |
195 | SPU_ACTIVATE_NOWAKE = 1, | ||
196 | }; | ||
197 | int spu_activate(struct spu_context *ctx, unsigned long flags); | 195 | int spu_activate(struct spu_context *ctx, unsigned long flags); |
198 | void spu_deactivate(struct spu_context *ctx); | 196 | void spu_deactivate(struct spu_context *ctx); |
199 | void spu_yield(struct spu_context *ctx); | 197 | void spu_yield(struct spu_context *ctx); |
diff --git a/arch/powerpc/platforms/cell/spufs/switch.c b/arch/powerpc/platforms/cell/spufs/switch.c index c08981ff7fc6..fd91c73de34e 100644 --- a/arch/powerpc/platforms/cell/spufs/switch.c +++ b/arch/powerpc/platforms/cell/spufs/switch.c | |||
@@ -468,26 +468,6 @@ static inline void wait_purge_complete(struct spu_state *csa, struct spu *spu) | |||
468 | MFC_CNTL_PURGE_DMA_COMPLETE); | 468 | MFC_CNTL_PURGE_DMA_COMPLETE); |
469 | } | 469 | } |
470 | 470 | ||
471 | static inline void save_mfc_slbs(struct spu_state *csa, struct spu *spu) | ||
472 | { | ||
473 | struct spu_priv2 __iomem *priv2 = spu->priv2; | ||
474 | int i; | ||
475 | |||
476 | /* Save, Step 29: | ||
477 | * If MFC_SR1[R]='1', save SLBs in CSA. | ||
478 | */ | ||
479 | if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) { | ||
480 | csa->priv2.slb_index_W = in_be64(&priv2->slb_index_W); | ||
481 | for (i = 0; i < 8; i++) { | ||
482 | out_be64(&priv2->slb_index_W, i); | ||
483 | eieio(); | ||
484 | csa->slb_esid_RW[i] = in_be64(&priv2->slb_esid_RW); | ||
485 | csa->slb_vsid_RW[i] = in_be64(&priv2->slb_vsid_RW); | ||
486 | eieio(); | ||
487 | } | ||
488 | } | ||
489 | } | ||
490 | |||
491 | static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu) | 471 | static inline void setup_mfc_sr1(struct spu_state *csa, struct spu *spu) |
492 | { | 472 | { |
493 | /* Save, Step 30: | 473 | /* Save, Step 30: |
@@ -708,20 +688,6 @@ static inline void resume_mfc_queue(struct spu_state *csa, struct spu *spu) | |||
708 | out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE); | 688 | out_be64(&priv2->mfc_control_RW, MFC_CNTL_RESUME_DMA_QUEUE); |
709 | } | 689 | } |
710 | 690 | ||
711 | static inline void invalidate_slbs(struct spu_state *csa, struct spu *spu) | ||
712 | { | ||
713 | struct spu_priv2 __iomem *priv2 = spu->priv2; | ||
714 | |||
715 | /* Save, Step 45: | ||
716 | * Restore, Step 19: | ||
717 | * If MFC_SR1[R]=1, write 0 to SLB_Invalidate_All. | ||
718 | */ | ||
719 | if (spu_mfc_sr1_get(spu) & MFC_STATE1_RELOCATE_MASK) { | ||
720 | out_be64(&priv2->slb_invalidate_all_W, 0UL); | ||
721 | eieio(); | ||
722 | } | ||
723 | } | ||
724 | |||
725 | static inline void get_kernel_slb(u64 ea, u64 slb[2]) | 691 | static inline void get_kernel_slb(u64 ea, u64 slb[2]) |
726 | { | 692 | { |
727 | u64 llp; | 693 | u64 llp; |
@@ -765,7 +731,7 @@ static inline void setup_mfc_slbs(struct spu_state *csa, struct spu *spu) | |||
765 | * MFC_SR1[R]=1 (in other words, assume that | 731 | * MFC_SR1[R]=1 (in other words, assume that |
766 | * translation is desired by OS environment). | 732 | * translation is desired by OS environment). |
767 | */ | 733 | */ |
768 | invalidate_slbs(csa, spu); | 734 | spu_invalidate_slbs(spu); |
769 | get_kernel_slb((unsigned long)&spu_save_code[0], code_slb); | 735 | get_kernel_slb((unsigned long)&spu_save_code[0], code_slb); |
770 | get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb); | 736 | get_kernel_slb((unsigned long)csa->lscsa, lscsa_slb); |
771 | load_mfc_slb(spu, code_slb, 0); | 737 | load_mfc_slb(spu, code_slb, 0); |
@@ -1718,27 +1684,6 @@ static inline void check_ppuint_mb_stat(struct spu_state *csa, struct spu *spu) | |||
1718 | } | 1684 | } |
1719 | } | 1685 | } |
1720 | 1686 | ||
1721 | static inline void restore_mfc_slbs(struct spu_state *csa, struct spu *spu) | ||
1722 | { | ||
1723 | struct spu_priv2 __iomem *priv2 = spu->priv2; | ||
1724 | int i; | ||
1725 | |||
1726 | /* Restore, Step 68: | ||
1727 | * If MFC_SR1[R]='1', restore SLBs from CSA. | ||
1728 | */ | ||
1729 | if (csa->priv1.mfc_sr1_RW & MFC_STATE1_RELOCATE_MASK) { | ||
1730 | for (i = 0; i < 8; i++) { | ||
1731 | out_be64(&priv2->slb_index_W, i); | ||
1732 | eieio(); | ||
1733 | out_be64(&priv2->slb_esid_RW, csa->slb_esid_RW[i]); | ||
1734 | out_be64(&priv2->slb_vsid_RW, csa->slb_vsid_RW[i]); | ||
1735 | eieio(); | ||
1736 | } | ||
1737 | out_be64(&priv2->slb_index_W, csa->priv2.slb_index_W); | ||
1738 | eieio(); | ||
1739 | } | ||
1740 | } | ||
1741 | |||
1742 | static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu) | 1687 | static inline void restore_mfc_sr1(struct spu_state *csa, struct spu *spu) |
1743 | { | 1688 | { |
1744 | /* Restore, Step 69: | 1689 | /* Restore, Step 69: |
@@ -1875,7 +1820,6 @@ static void save_csa(struct spu_state *prev, struct spu *spu) | |||
1875 | set_mfc_tclass_id(prev, spu); /* Step 26. */ | 1820 | set_mfc_tclass_id(prev, spu); /* Step 26. */ |
1876 | purge_mfc_queue(prev, spu); /* Step 27. */ | 1821 | purge_mfc_queue(prev, spu); /* Step 27. */ |
1877 | wait_purge_complete(prev, spu); /* Step 28. */ | 1822 | wait_purge_complete(prev, spu); /* Step 28. */ |
1878 | save_mfc_slbs(prev, spu); /* Step 29. */ | ||
1879 | setup_mfc_sr1(prev, spu); /* Step 30. */ | 1823 | setup_mfc_sr1(prev, spu); /* Step 30. */ |
1880 | save_spu_npc(prev, spu); /* Step 31. */ | 1824 | save_spu_npc(prev, spu); /* Step 31. */ |
1881 | save_spu_privcntl(prev, spu); /* Step 32. */ | 1825 | save_spu_privcntl(prev, spu); /* Step 32. */ |
@@ -1987,7 +1931,7 @@ static void harvest(struct spu_state *prev, struct spu *spu) | |||
1987 | reset_spu_privcntl(prev, spu); /* Step 16. */ | 1931 | reset_spu_privcntl(prev, spu); /* Step 16. */ |
1988 | reset_spu_lslr(prev, spu); /* Step 17. */ | 1932 | reset_spu_lslr(prev, spu); /* Step 17. */ |
1989 | setup_mfc_sr1(prev, spu); /* Step 18. */ | 1933 | setup_mfc_sr1(prev, spu); /* Step 18. */ |
1990 | invalidate_slbs(prev, spu); /* Step 19. */ | 1934 | spu_invalidate_slbs(spu); /* Step 19. */ |
1991 | reset_ch_part1(prev, spu); /* Step 20. */ | 1935 | reset_ch_part1(prev, spu); /* Step 20. */ |
1992 | reset_ch_part2(prev, spu); /* Step 21. */ | 1936 | reset_ch_part2(prev, spu); /* Step 21. */ |
1993 | enable_interrupts(prev, spu); /* Step 22. */ | 1937 | enable_interrupts(prev, spu); /* Step 22. */ |
@@ -2055,7 +1999,7 @@ static void restore_csa(struct spu_state *next, struct spu *spu) | |||
2055 | restore_spu_mb(next, spu); /* Step 65. */ | 1999 | restore_spu_mb(next, spu); /* Step 65. */ |
2056 | check_ppu_mb_stat(next, spu); /* Step 66. */ | 2000 | check_ppu_mb_stat(next, spu); /* Step 66. */ |
2057 | check_ppuint_mb_stat(next, spu); /* Step 67. */ | 2001 | check_ppuint_mb_stat(next, spu); /* Step 67. */ |
2058 | restore_mfc_slbs(next, spu); /* Step 68. */ | 2002 | spu_invalidate_slbs(spu); /* Modified Step 68. */ |
2059 | restore_mfc_sr1(next, spu); /* Step 69. */ | 2003 | restore_mfc_sr1(next, spu); /* Step 69. */ |
2060 | restore_other_spu_access(next, spu); /* Step 70. */ | 2004 | restore_other_spu_access(next, spu); /* Step 70. */ |
2061 | restore_spu_runcntl(next, spu); /* Step 71. */ | 2005 | restore_spu_runcntl(next, spu); /* Step 71. */ |
diff --git a/arch/powerpc/platforms/pasemi/iommu.c b/arch/powerpc/platforms/pasemi/iommu.c index 459a53b7d24d..71dbf1a56e13 100644 --- a/arch/powerpc/platforms/pasemi/iommu.c +++ b/arch/powerpc/platforms/pasemi/iommu.c | |||
@@ -77,7 +77,7 @@ | |||
77 | #define IOBMAP_L2E_V 0x80000000 | 77 | #define IOBMAP_L2E_V 0x80000000 |
78 | #define IOBMAP_L2E_V_CACHED 0xc0000000 | 78 | #define IOBMAP_L2E_V_CACHED 0xc0000000 |
79 | 79 | ||
80 | static u32 *iob; | 80 | static u32 __iomem *iob; |
81 | static u32 iob_l1_emptyval; | 81 | static u32 iob_l1_emptyval; |
82 | static u32 iob_l2_emptyval; | 82 | static u32 iob_l2_emptyval; |
83 | static u32 *iob_l2_base; | 83 | static u32 *iob_l2_base; |
diff --git a/arch/powerpc/platforms/ps3/mm.c b/arch/powerpc/platforms/ps3/mm.c index 42354de3f557..2014d2b44449 100644 --- a/arch/powerpc/platforms/ps3/mm.c +++ b/arch/powerpc/platforms/ps3/mm.c | |||
@@ -294,7 +294,7 @@ static int __init ps3_mm_add_memory(void) | |||
294 | unsigned long nr_pages; | 294 | unsigned long nr_pages; |
295 | 295 | ||
296 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | 296 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) |
297 | return 0; | 297 | return -ENODEV; |
298 | 298 | ||
299 | BUG_ON(!mem_init_done); | 299 | BUG_ON(!mem_init_done); |
300 | 300 | ||
diff --git a/arch/powerpc/platforms/ps3/system-bus.c b/arch/powerpc/platforms/ps3/system-bus.c index a9f7e4a39a2a..3c48cce98a5c 100644 --- a/arch/powerpc/platforms/ps3/system-bus.c +++ b/arch/powerpc/platforms/ps3/system-bus.c | |||
@@ -172,7 +172,7 @@ int __init ps3_system_bus_init(void) | |||
172 | int result; | 172 | int result; |
173 | 173 | ||
174 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | 174 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) |
175 | return 0; | 175 | return -ENODEV; |
176 | 176 | ||
177 | result = bus_register(&ps3_system_bus_type); | 177 | result = bus_register(&ps3_system_bus_type); |
178 | BUG_ON(result); | 178 | BUG_ON(result); |
diff --git a/arch/s390/appldata/appldata_mem.c b/arch/s390/appldata/appldata_mem.c index 4ca615788702..697eb30a68a3 100644 --- a/arch/s390/appldata/appldata_mem.c +++ b/arch/s390/appldata/appldata_mem.c | |||
@@ -117,7 +117,10 @@ static void appldata_get_mem_data(void *data) | |||
117 | mem_data->pgpgout = ev[PGPGOUT] >> 1; | 117 | mem_data->pgpgout = ev[PGPGOUT] >> 1; |
118 | mem_data->pswpin = ev[PSWPIN]; | 118 | mem_data->pswpin = ev[PSWPIN]; |
119 | mem_data->pswpout = ev[PSWPOUT]; | 119 | mem_data->pswpout = ev[PSWPOUT]; |
120 | mem_data->pgalloc = ev[PGALLOC_NORMAL] + ev[PGALLOC_DMA]; | 120 | mem_data->pgalloc = ev[PGALLOC_NORMAL]; |
121 | #ifdef CONFIG_ZONE_DMA | ||
122 | mem_data->pgalloc += ev[PGALLOC_DMA]; | ||
123 | #endif | ||
121 | mem_data->pgfault = ev[PGFAULT]; | 124 | mem_data->pgfault = ev[PGFAULT]; |
122 | mem_data->pgmajfault = ev[PGMAJFAULT]; | 125 | mem_data->pgmajfault = ev[PGMAJFAULT]; |
123 | 126 | ||
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 97901296894e..32a69a18a796 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1665,3 +1665,20 @@ sys_getcpu_wrapper: | |||
1665 | llgtr %r3,%r3 # unsigned * | 1665 | llgtr %r3,%r3 # unsigned * |
1666 | llgtr %r4,%r4 # struct getcpu_cache * | 1666 | llgtr %r4,%r4 # struct getcpu_cache * |
1667 | jg sys_getcpu | 1667 | jg sys_getcpu |
1668 | |||
1669 | .globl compat_sys_epoll_pwait_wrapper | ||
1670 | compat_sys_epoll_pwait_wrapper: | ||
1671 | lgfr %r2,%r2 # int | ||
1672 | llgtr %r3,%r3 # struct compat_epoll_event * | ||
1673 | lgfr %r4,%r4 # int | ||
1674 | lgfr %r5,%r5 # int | ||
1675 | llgtr %r6,%r6 # compat_sigset_t * | ||
1676 | llgf %r0,164(%r15) # compat_size_t | ||
1677 | stg %r0,160(%r15) | ||
1678 | jg compat_sys_epoll_pwait | ||
1679 | |||
1680 | .globl compat_sys_utimes_wrapper | ||
1681 | compat_sys_utimes_wrapper: | ||
1682 | llgtr %r2,%r2 # char * | ||
1683 | llgtr %r3,%r3 # struct compat_timeval * | ||
1684 | jg compat_sys_utimes | ||
diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c index eca3fe595ff4..dca6eaf82c80 100644 --- a/arch/s390/kernel/debug.c +++ b/arch/s390/kernel/debug.c | |||
@@ -268,7 +268,7 @@ debug_info_alloc(char *name, int pages_per_area, int nr_areas, int buf_size, | |||
268 | rc->level = level; | 268 | rc->level = level; |
269 | rc->buf_size = buf_size; | 269 | rc->buf_size = buf_size; |
270 | rc->entry_size = sizeof(debug_entry_t) + buf_size; | 270 | rc->entry_size = sizeof(debug_entry_t) + buf_size; |
271 | strlcpy(rc->name, name, sizeof(rc->name)-1); | 271 | strlcpy(rc->name, name, sizeof(rc->name)); |
272 | memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *)); | 272 | memset(rc->views, 0, DEBUG_MAX_VIEWS * sizeof(struct debug_view *)); |
273 | memset(rc->debugfs_entries, 0 ,DEBUG_MAX_VIEWS * | 273 | memset(rc->debugfs_entries, 0 ,DEBUG_MAX_VIEWS * |
274 | sizeof(struct dentry*)); | 274 | sizeof(struct dentry*)); |
diff --git a/arch/s390/kernel/early.c b/arch/s390/kernel/early.c index afca1c6f4d21..5e47936573f2 100644 --- a/arch/s390/kernel/early.c +++ b/arch/s390/kernel/early.c | |||
@@ -141,9 +141,9 @@ static noinline __init void detect_machine_type(void) | |||
141 | machine_flags |= 4; | 141 | machine_flags |= 4; |
142 | } | 142 | } |
143 | 143 | ||
144 | #ifdef CONFIG_64BIT | ||
144 | static noinline __init int memory_fast_detect(void) | 145 | static noinline __init int memory_fast_detect(void) |
145 | { | 146 | { |
146 | |||
147 | unsigned long val0 = 0; | 147 | unsigned long val0 = 0; |
148 | unsigned long val1 = 0xc; | 148 | unsigned long val1 = 0xc; |
149 | int ret = -ENOSYS; | 149 | int ret = -ENOSYS; |
@@ -161,9 +161,15 @@ static noinline __init int memory_fast_detect(void) | |||
161 | if (ret || val0 != val1) | 161 | if (ret || val0 != val1) |
162 | return -ENOSYS; | 162 | return -ENOSYS; |
163 | 163 | ||
164 | memory_chunk[0].size = val0; | 164 | memory_chunk[0].size = val0 + 1; |
165 | return 0; | 165 | return 0; |
166 | } | 166 | } |
167 | #else | ||
168 | static inline int memory_fast_detect(void) | ||
169 | { | ||
170 | return -ENOSYS; | ||
171 | } | ||
172 | #endif | ||
167 | 173 | ||
168 | #define ADDR2G (1UL << 31) | 174 | #define ADDR2G (1UL << 31) |
169 | 175 | ||
diff --git a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c index d125a4ead08d..f731185bf2bd 100644 --- a/arch/s390/kernel/ipl.c +++ b/arch/s390/kernel/ipl.c | |||
@@ -839,7 +839,7 @@ static int __init reipl_ccw_init(void) | |||
839 | } | 839 | } |
840 | reipl_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN; | 840 | reipl_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN; |
841 | reipl_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION; | 841 | reipl_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION; |
842 | reipl_block_ccw->hdr.blk0_len = sizeof(reipl_block_ccw->ipl_info.ccw); | 842 | reipl_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN; |
843 | reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW; | 843 | reipl_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW; |
844 | /* check if read scp info worked and set loadparm */ | 844 | /* check if read scp info worked and set loadparm */ |
845 | if (SCCB_VALID) | 845 | if (SCCB_VALID) |
@@ -880,8 +880,7 @@ static int __init reipl_fcp_init(void) | |||
880 | } else { | 880 | } else { |
881 | reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; | 881 | reipl_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; |
882 | reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; | 882 | reipl_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; |
883 | reipl_block_fcp->hdr.blk0_len = | 883 | reipl_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN; |
884 | sizeof(reipl_block_fcp->ipl_info.fcp); | ||
885 | reipl_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP; | 884 | reipl_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP; |
886 | reipl_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_IPL; | 885 | reipl_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_IPL; |
887 | } | 886 | } |
@@ -930,7 +929,7 @@ static int __init dump_ccw_init(void) | |||
930 | } | 929 | } |
931 | dump_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN; | 930 | dump_block_ccw->hdr.len = IPL_PARM_BLK_CCW_LEN; |
932 | dump_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION; | 931 | dump_block_ccw->hdr.version = IPL_PARM_BLOCK_VERSION; |
933 | dump_block_ccw->hdr.blk0_len = sizeof(reipl_block_ccw->ipl_info.ccw); | 932 | dump_block_ccw->hdr.blk0_len = IPL_PARM_BLK0_CCW_LEN; |
934 | dump_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW; | 933 | dump_block_ccw->hdr.pbt = DIAG308_IPL_TYPE_CCW; |
935 | dump_capabilities |= IPL_TYPE_CCW; | 934 | dump_capabilities |= IPL_TYPE_CCW; |
936 | return 0; | 935 | return 0; |
@@ -954,7 +953,7 @@ static int __init dump_fcp_init(void) | |||
954 | } | 953 | } |
955 | dump_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; | 954 | dump_block_fcp->hdr.len = IPL_PARM_BLK_FCP_LEN; |
956 | dump_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; | 955 | dump_block_fcp->hdr.version = IPL_PARM_BLOCK_VERSION; |
957 | dump_block_fcp->hdr.blk0_len = sizeof(dump_block_fcp->ipl_info.fcp); | 956 | dump_block_fcp->hdr.blk0_len = IPL_PARM_BLK0_FCP_LEN; |
958 | dump_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP; | 957 | dump_block_fcp->hdr.pbt = DIAG308_IPL_TYPE_FCP; |
959 | dump_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_DUMP; | 958 | dump_block_fcp->ipl_info.fcp.opt = DIAG308_IPL_OPT_DUMP; |
960 | dump_capabilities |= IPL_TYPE_FCP; | 959 | dump_capabilities |= IPL_TYPE_FCP; |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index a52c44455bf0..c774f1069e10 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -320,4 +320,5 @@ SYSCALL(sys_tee,sys_tee,sys_tee_wrapper) | |||
320 | SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper) | 320 | SYSCALL(sys_vmsplice,sys_vmsplice,compat_sys_vmsplice_wrapper) |
321 | NI_SYSCALL /* 310 sys_move_pages */ | 321 | NI_SYSCALL /* 310 sys_move_pages */ |
322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) | 322 | SYSCALL(sys_getcpu,sys_getcpu,sys_getcpu_wrapper) |
323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,sys_ni_syscall) | 323 | SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) |
324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) | ||
diff --git a/arch/sh/drivers/pci/pci-auto.c b/arch/sh/drivers/pci/pci-auto.c index ecf16344f94a..224e007736fb 100644 --- a/arch/sh/drivers/pci/pci-auto.c +++ b/arch/sh/drivers/pci/pci-auto.c | |||
@@ -214,6 +214,12 @@ retry: | |||
214 | continue; | 214 | continue; |
215 | } | 215 | } |
216 | 216 | ||
217 | if (bar_value < *lower_limit || (bar_value + bar_size) >= *upper_limit) { | ||
218 | DBG(" unavailable -- skipping, value %x size %x\n", | ||
219 | bar_value, bar_size); | ||
220 | continue; | ||
221 | } | ||
222 | |||
217 | #ifdef CONFIG_PCI_AUTO_UPDATE_RESOURCES | 223 | #ifdef CONFIG_PCI_AUTO_UPDATE_RESOURCES |
218 | /* Write it out and update our limit */ | 224 | /* Write it out and update our limit */ |
219 | early_write_config_dword(hose, top_bus, current_bus, pci_devfn, | 225 | early_write_config_dword(hose, top_bus, current_bus, pci_devfn, |
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c index 4b339a640b13..726acfcb9b77 100644 --- a/arch/sh/kernel/cpu/init.c +++ b/arch/sh/kernel/cpu/init.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * CPU init code | 4 | * CPU init code |
5 | * | 5 | * |
6 | * Copyright (C) 2002 - 2006 Paul Mundt | 6 | * Copyright (C) 2002 - 2007 Paul Mundt |
7 | * Copyright (C) 2003 Richard Curnow | 7 | * Copyright (C) 2003 Richard Curnow |
8 | * | 8 | * |
9 | * This file is subject to the terms and conditions of the GNU General Public | 9 | * This file is subject to the terms and conditions of the GNU General Public |
@@ -48,8 +48,19 @@ static void __init cache_init(void) | |||
48 | { | 48 | { |
49 | unsigned long ccr, flags; | 49 | unsigned long ccr, flags; |
50 | 50 | ||
51 | if (current_cpu_data.type == CPU_SH_NONE) | 51 | /* First setup the rest of the I-cache info */ |
52 | panic("Unknown CPU"); | 52 | current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr - |
53 | current_cpu_data.icache.linesz; | ||
54 | |||
55 | current_cpu_data.icache.way_size = current_cpu_data.icache.sets * | ||
56 | current_cpu_data.icache.linesz; | ||
57 | |||
58 | /* And the D-cache too */ | ||
59 | current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr - | ||
60 | current_cpu_data.dcache.linesz; | ||
61 | |||
62 | current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets * | ||
63 | current_cpu_data.dcache.linesz; | ||
53 | 64 | ||
54 | jump_to_P2(); | 65 | jump_to_P2(); |
55 | ccr = ctrl_inl(CCR); | 66 | ccr = ctrl_inl(CCR); |
@@ -200,6 +211,9 @@ asmlinkage void __init sh_cpu_init(void) | |||
200 | /* First, probe the CPU */ | 211 | /* First, probe the CPU */ |
201 | detect_cpu_and_cache_system(); | 212 | detect_cpu_and_cache_system(); |
202 | 213 | ||
214 | if (current_cpu_data.type == CPU_SH_NONE) | ||
215 | panic("Unknown CPU"); | ||
216 | |||
203 | /* Init the cache */ | 217 | /* Init the cache */ |
204 | cache_init(); | 218 | cache_init(); |
205 | 219 | ||
diff --git a/arch/sh/kernel/cpu/sh2/entry.S b/arch/sh/kernel/cpu/sh2/entry.S index 7f7d292f36ec..c16dc8fec489 100644 --- a/arch/sh/kernel/cpu/sh2/entry.S +++ b/arch/sh/kernel/cpu/sh2/entry.S | |||
@@ -165,6 +165,7 @@ ENTRY(exception_handler) | |||
165 | 165 | ||
166 | interrupt_entry: | 166 | interrupt_entry: |
167 | mov r9,r4 | 167 | mov r9,r4 |
168 | mov r15,r5 | ||
168 | mov.l 6f,r9 | 169 | mov.l 6f,r9 |
169 | mov.l 7f,r8 | 170 | mov.l 7f,r8 |
170 | jmp @r8 | 171 | jmp @r8 |
diff --git a/arch/sh/kernel/cpu/sh3/entry.S b/arch/sh/kernel/cpu/sh3/entry.S index c19205b0f2c0..f3e827f29a46 100644 --- a/arch/sh/kernel/cpu/sh3/entry.S +++ b/arch/sh/kernel/cpu/sh3/entry.S | |||
@@ -514,13 +514,16 @@ skip_save: | |||
514 | 514 | ||
515 | interrupt_exception: | 515 | interrupt_exception: |
516 | mov.l 1f, r9 | 516 | mov.l 1f, r9 |
517 | mov.l 2f, r4 | ||
518 | mov.l @r4, r4 | ||
517 | jmp @r9 | 519 | jmp @r9 |
518 | nop | 520 | mov r15, r5 |
519 | rts | 521 | rts |
520 | nop | 522 | nop |
521 | 523 | ||
522 | .align 2 | 524 | .align 2 |
523 | 1: .long do_IRQ | 525 | 1: .long do_IRQ |
526 | 2: .long INTEVT | ||
524 | 527 | ||
525 | .align 2 | 528 | .align 2 |
526 | ENTRY(exception_none) | 529 | ENTRY(exception_none) |
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 9d28c88d2f9d..58950de2696d 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
@@ -195,13 +195,6 @@ int __init detect_cpu_and_cache_system(void) | |||
195 | 195 | ||
196 | } | 196 | } |
197 | 197 | ||
198 | /* Setup the rest of the I-cache info */ | ||
199 | current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr - | ||
200 | current_cpu_data.icache.linesz; | ||
201 | |||
202 | current_cpu_data.icache.way_size = current_cpu_data.icache.sets * | ||
203 | current_cpu_data.icache.linesz; | ||
204 | |||
205 | /* And the rest of the D-cache */ | 198 | /* And the rest of the D-cache */ |
206 | if (current_cpu_data.dcache.ways > 1) { | 199 | if (current_cpu_data.dcache.ways > 1) { |
207 | size = sizes[(cvr >> 16) & 0xf]; | 200 | size = sizes[(cvr >> 16) & 0xf]; |
@@ -209,12 +202,6 @@ int __init detect_cpu_and_cache_system(void) | |||
209 | current_cpu_data.dcache.sets = (size >> 6); | 202 | current_cpu_data.dcache.sets = (size >> 6); |
210 | } | 203 | } |
211 | 204 | ||
212 | current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr - | ||
213 | current_cpu_data.dcache.linesz; | ||
214 | |||
215 | current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets * | ||
216 | current_cpu_data.dcache.linesz; | ||
217 | |||
218 | /* | 205 | /* |
219 | * Setup the L2 cache desc | 206 | * Setup the L2 cache desc |
220 | * | 207 | * |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 67be2b6e8cd1..9bdd8a00cd4a 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
@@ -11,7 +11,6 @@ | |||
11 | #include <linux/module.h> | 11 | #include <linux/module.h> |
12 | #include <linux/kernel_stat.h> | 12 | #include <linux/kernel_stat.h> |
13 | #include <linux/seq_file.h> | 13 | #include <linux/seq_file.h> |
14 | #include <linux/io.h> | ||
15 | #include <linux/irq.h> | 14 | #include <linux/irq.h> |
16 | #include <asm/processor.h> | 15 | #include <asm/processor.h> |
17 | #include <asm/uaccess.h> | 16 | #include <asm/uaccess.h> |
@@ -82,13 +81,9 @@ static union irq_ctx *hardirq_ctx[NR_CPUS] __read_mostly; | |||
82 | static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; | 81 | static union irq_ctx *softirq_ctx[NR_CPUS] __read_mostly; |
83 | #endif | 82 | #endif |
84 | 83 | ||
85 | asmlinkage int do_IRQ(unsigned long r4, unsigned long r5, | 84 | asmlinkage int do_IRQ(unsigned int irq, struct pt_regs *regs) |
86 | unsigned long r6, unsigned long r7, | ||
87 | struct pt_regs __regs) | ||
88 | { | 85 | { |
89 | struct pt_regs *regs = RELOC_HIDE(&__regs, 0); | ||
90 | struct pt_regs *old_regs = set_irq_regs(regs); | 86 | struct pt_regs *old_regs = set_irq_regs(regs); |
91 | int irq; | ||
92 | #ifdef CONFIG_4KSTACKS | 87 | #ifdef CONFIG_4KSTACKS |
93 | union irq_ctx *curctx, *irqctx; | 88 | union irq_ctx *curctx, *irqctx; |
94 | #endif | 89 | #endif |
@@ -111,13 +106,7 @@ asmlinkage int do_IRQ(unsigned long r4, unsigned long r5, | |||
111 | } | 106 | } |
112 | #endif | 107 | #endif |
113 | 108 | ||
114 | #ifdef CONFIG_CPU_HAS_INTEVT | 109 | irq = irq_demux(evt2irq(irq)); |
115 | irq = evt2irq(ctrl_inl(INTEVT)); | ||
116 | #else | ||
117 | irq = r4; | ||
118 | #endif | ||
119 | |||
120 | irq = irq_demux(irq); | ||
121 | 110 | ||
122 | #ifdef CONFIG_4KSTACKS | 111 | #ifdef CONFIG_4KSTACKS |
123 | curctx = (union irq_ctx *)current_thread_info(); | 112 | curctx = (union irq_ctx *)current_thread_info(); |
diff --git a/arch/sparc/kernel/process.c b/arch/sparc/kernel/process.c index 113bd48a89bd..fc874e63a499 100644 --- a/arch/sparc/kernel/process.c +++ b/arch/sparc/kernel/process.c | |||
@@ -348,7 +348,7 @@ void exit_thread(void) | |||
348 | #ifndef CONFIG_SMP | 348 | #ifndef CONFIG_SMP |
349 | if(last_task_used_math == current) { | 349 | if(last_task_used_math == current) { |
350 | #else | 350 | #else |
351 | if(current_thread_info()->flags & _TIF_USEDFPU) { | 351 | if (test_thread_flag(TIF_USEDFPU)) { |
352 | #endif | 352 | #endif |
353 | /* Keep process from leaving FPU in a bogon state. */ | 353 | /* Keep process from leaving FPU in a bogon state. */ |
354 | put_psr(get_psr() | PSR_EF); | 354 | put_psr(get_psr() | PSR_EF); |
@@ -357,7 +357,7 @@ void exit_thread(void) | |||
357 | #ifndef CONFIG_SMP | 357 | #ifndef CONFIG_SMP |
358 | last_task_used_math = NULL; | 358 | last_task_used_math = NULL; |
359 | #else | 359 | #else |
360 | current_thread_info()->flags &= ~_TIF_USEDFPU; | 360 | clear_thread_flag(TIF_USEDFPU); |
361 | #endif | 361 | #endif |
362 | } | 362 | } |
363 | } | 363 | } |
@@ -371,7 +371,7 @@ void flush_thread(void) | |||
371 | #ifndef CONFIG_SMP | 371 | #ifndef CONFIG_SMP |
372 | if(last_task_used_math == current) { | 372 | if(last_task_used_math == current) { |
373 | #else | 373 | #else |
374 | if(current_thread_info()->flags & _TIF_USEDFPU) { | 374 | if (test_thread_flag(TIF_USEDFPU)) { |
375 | #endif | 375 | #endif |
376 | /* Clean the fpu. */ | 376 | /* Clean the fpu. */ |
377 | put_psr(get_psr() | PSR_EF); | 377 | put_psr(get_psr() | PSR_EF); |
@@ -380,7 +380,7 @@ void flush_thread(void) | |||
380 | #ifndef CONFIG_SMP | 380 | #ifndef CONFIG_SMP |
381 | last_task_used_math = NULL; | 381 | last_task_used_math = NULL; |
382 | #else | 382 | #else |
383 | current_thread_info()->flags &= ~_TIF_USEDFPU; | 383 | clear_thread_flag(TIF_USEDFPU); |
384 | #endif | 384 | #endif |
385 | } | 385 | } |
386 | 386 | ||
@@ -466,13 +466,13 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long sp, | |||
466 | #ifndef CONFIG_SMP | 466 | #ifndef CONFIG_SMP |
467 | if(last_task_used_math == current) { | 467 | if(last_task_used_math == current) { |
468 | #else | 468 | #else |
469 | if(current_thread_info()->flags & _TIF_USEDFPU) { | 469 | if (test_thread_flag(TIF_USEDFPU)) { |
470 | #endif | 470 | #endif |
471 | put_psr(get_psr() | PSR_EF); | 471 | put_psr(get_psr() | PSR_EF); |
472 | fpsave(&p->thread.float_regs[0], &p->thread.fsr, | 472 | fpsave(&p->thread.float_regs[0], &p->thread.fsr, |
473 | &p->thread.fpqueue[0], &p->thread.fpqdepth); | 473 | &p->thread.fpqueue[0], &p->thread.fpqdepth); |
474 | #ifdef CONFIG_SMP | 474 | #ifdef CONFIG_SMP |
475 | current_thread_info()->flags &= ~_TIF_USEDFPU; | 475 | clear_thread_flag(TIF_USEDFPU); |
476 | #endif | 476 | #endif |
477 | } | 477 | } |
478 | 478 | ||
@@ -609,13 +609,13 @@ int dump_fpu (struct pt_regs * regs, elf_fpregset_t * fpregs) | |||
609 | return 1; | 609 | return 1; |
610 | } | 610 | } |
611 | #ifdef CONFIG_SMP | 611 | #ifdef CONFIG_SMP |
612 | if (current_thread_info()->flags & _TIF_USEDFPU) { | 612 | if (test_thread_flag(TIF_USEDFPU)) { |
613 | put_psr(get_psr() | PSR_EF); | 613 | put_psr(get_psr() | PSR_EF); |
614 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, | 614 | fpsave(¤t->thread.float_regs[0], ¤t->thread.fsr, |
615 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); | 615 | ¤t->thread.fpqueue[0], ¤t->thread.fpqdepth); |
616 | if (regs != NULL) { | 616 | if (regs != NULL) { |
617 | regs->psr &= ~(PSR_EF); | 617 | regs->psr &= ~(PSR_EF); |
618 | current_thread_info()->flags &= ~(_TIF_USEDFPU); | 618 | clear_thread_flag(TIF_USEDFPU); |
619 | } | 619 | } |
620 | } | 620 | } |
621 | #else | 621 | #else |
diff --git a/arch/sparc/kernel/systbls.S b/arch/sparc/kernel/systbls.S index ea75ca569052..3a69778c8366 100644 --- a/arch/sparc/kernel/systbls.S +++ b/arch/sparc/kernel/systbls.S | |||
@@ -78,7 +78,8 @@ sys_call_table: | |||
78 | /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 | 78 | /*285*/ .long sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 |
79 | /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 79 | /*290*/ .long sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
80 | /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare | 80 | /*295*/ .long sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare |
81 | /*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages | 81 | /*300*/ .long sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy |
82 | /*305*/ .long sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait | ||
82 | 83 | ||
83 | #ifdef CONFIG_SUNOS_EMUL | 84 | #ifdef CONFIG_SUNOS_EMUL |
84 | /* Now the SunOS syscall table. */ | 85 | /* Now the SunOS syscall table. */ |
@@ -192,5 +193,8 @@ sunos_sys_table: | |||
192 | .long sunos_nosys, sunos_nosys, sunos_nosys | 193 | .long sunos_nosys, sunos_nosys, sunos_nosys |
193 | .long sunos_nosys | 194 | .long sunos_nosys |
194 | /*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys | 195 | /*300*/ .long sunos_nosys, sunos_nosys, sunos_nosys |
196 | .long sunos_nosys, sunos_nosys, sunos_nosys | ||
197 | .long sunos_nosys, sunos_nosys, sunos_nosys | ||
198 | .long sunos_nosys | ||
195 | 199 | ||
196 | #endif | 200 | #endif |
diff --git a/arch/sparc/kernel/traps.c b/arch/sparc/kernel/traps.c index 6a70d215fd04..527687afc1c4 100644 --- a/arch/sparc/kernel/traps.c +++ b/arch/sparc/kernel/traps.c | |||
@@ -259,7 +259,7 @@ void do_fpd_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, | |||
259 | } else { | 259 | } else { |
260 | fpload(¤t->thread.float_regs[0], ¤t->thread.fsr); | 260 | fpload(¤t->thread.float_regs[0], ¤t->thread.fsr); |
261 | } | 261 | } |
262 | current_thread_info()->flags |= _TIF_USEDFPU; | 262 | set_thread_flag(TIF_USEDFPU); |
263 | #endif | 263 | #endif |
264 | } | 264 | } |
265 | 265 | ||
@@ -290,7 +290,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, | |||
290 | #ifndef CONFIG_SMP | 290 | #ifndef CONFIG_SMP |
291 | if(!fpt) { | 291 | if(!fpt) { |
292 | #else | 292 | #else |
293 | if(!(task_thread_info(fpt)->flags & _TIF_USEDFPU)) { | 293 | if (!test_tsk_thread_flag(fpt, TIF_USEDFPU)) { |
294 | #endif | 294 | #endif |
295 | fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth); | 295 | fpsave(&fake_regs[0], &fake_fsr, &fake_queue[0], &fake_depth); |
296 | regs->psr &= ~PSR_EF; | 296 | regs->psr &= ~PSR_EF; |
@@ -333,7 +333,7 @@ void do_fpe_trap(struct pt_regs *regs, unsigned long pc, unsigned long npc, | |||
333 | /* nope, better SIGFPE the offending process... */ | 333 | /* nope, better SIGFPE the offending process... */ |
334 | 334 | ||
335 | #ifdef CONFIG_SMP | 335 | #ifdef CONFIG_SMP |
336 | task_thread_info(fpt)->flags &= ~_TIF_USEDFPU; | 336 | clear_tsk_thread_flag(fpt, TIF_USEDFPU); |
337 | #endif | 337 | #endif |
338 | if(psr & PSR_PS) { | 338 | if(psr & PSR_PS) { |
339 | /* The first fsr store/load we tried trapped, | 339 | /* The first fsr store/load we tried trapped, |
diff --git a/arch/sparc/mm/init.c b/arch/sparc/mm/init.c index c85ddf312747..a532922e2e35 100644 --- a/arch/sparc/mm/init.c +++ b/arch/sparc/mm/init.c | |||
@@ -75,7 +75,7 @@ void show_mem(void) | |||
75 | printk("Free swap: %6ldkB\n", | 75 | printk("Free swap: %6ldkB\n", |
76 | nr_swap_pages << (PAGE_SHIFT-10)); | 76 | nr_swap_pages << (PAGE_SHIFT-10)); |
77 | printk("%ld pages of RAM\n", totalram_pages); | 77 | printk("%ld pages of RAM\n", totalram_pages); |
78 | printk("%d free pages\n", nr_free_pages()); | 78 | printk("%ld free pages\n", nr_free_pages()); |
79 | #if 0 /* undefined pgtable_cache_size, pgd_cache_size */ | 79 | #if 0 /* undefined pgtable_cache_size, pgd_cache_size */ |
80 | printk("%ld pages in page table cache\n",pgtable_cache_size); | 80 | printk("%ld pages in page table cache\n",pgtable_cache_size); |
81 | #ifndef CONFIG_SMP | 81 | #ifndef CONFIG_SMP |
diff --git a/arch/sparc64/Kconfig b/arch/sparc64/Kconfig index f75a686ba644..1a6348b565fb 100644 --- a/arch/sparc64/Kconfig +++ b/arch/sparc64/Kconfig | |||
@@ -136,18 +136,6 @@ config SMP | |||
136 | 136 | ||
137 | If you don't know what to do here, say N. | 137 | If you don't know what to do here, say N. |
138 | 138 | ||
139 | config PREEMPT | ||
140 | bool "Preemptible Kernel" | ||
141 | help | ||
142 | This option reduces the latency of the kernel when reacting to | ||
143 | real-time or interactive events by allowing a low priority process to | ||
144 | be preempted even if it is in kernel mode executing a system call. | ||
145 | This allows applications to run more reliably even when the system is | ||
146 | under load. | ||
147 | |||
148 | Say Y here if you are building a kernel for a desktop, embedded | ||
149 | or real-time system. Say N if you are unsure. | ||
150 | |||
151 | config NR_CPUS | 139 | config NR_CPUS |
152 | int "Maximum number of CPUs (2-64)" | 140 | int "Maximum number of CPUs (2-64)" |
153 | range 2 64 | 141 | range 2 64 |
@@ -399,6 +387,8 @@ config SCHED_SMT | |||
399 | when dealing with UltraSPARC cpus at a cost of slightly increased | 387 | when dealing with UltraSPARC cpus at a cost of slightly increased |
400 | overhead in some places. If unsure say N here. | 388 | overhead in some places. If unsure say N here. |
401 | 389 | ||
390 | source "kernel/Kconfig.preempt" | ||
391 | |||
402 | config CMDLINE_BOOL | 392 | config CMDLINE_BOOL |
403 | bool "Default bootloader kernel arguments" | 393 | bool "Default bootloader kernel arguments" |
404 | 394 | ||
diff --git a/arch/sparc64/defconfig b/arch/sparc64/defconfig index 860b8b60526c..120c9c33b7a6 100644 --- a/arch/sparc64/defconfig +++ b/arch/sparc64/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.21-rc2 | 3 | # Linux kernel version: 2.6.21-rc4 |
4 | # Wed Feb 28 09:50:51 2007 | 4 | # Sat Mar 17 14:18:44 2007 |
5 | # | 5 | # |
6 | CONFIG_SPARC=y | 6 | CONFIG_SPARC=y |
7 | CONFIG_SPARC64=y | 7 | CONFIG_SPARC64=y |
@@ -50,6 +50,7 @@ CONFIG_POSIX_MQUEUE=y | |||
50 | # CONFIG_IKCONFIG is not set | 50 | # CONFIG_IKCONFIG is not set |
51 | CONFIG_SYSFS_DEPRECATED=y | 51 | CONFIG_SYSFS_DEPRECATED=y |
52 | CONFIG_RELAY=y | 52 | CONFIG_RELAY=y |
53 | # CONFIG_BLK_DEV_INITRD is not set | ||
53 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 54 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
54 | CONFIG_SYSCTL=y | 55 | CONFIG_SYSCTL=y |
55 | # CONFIG_EMBEDDED is not set | 56 | # CONFIG_EMBEDDED is not set |
@@ -108,7 +109,6 @@ CONFIG_GENERIC_HARDIRQS=y | |||
108 | # General machine setup | 109 | # General machine setup |
109 | # | 110 | # |
110 | # CONFIG_SMP is not set | 111 | # CONFIG_SMP is not set |
111 | # CONFIG_PREEMPT is not set | ||
112 | CONFIG_CPU_FREQ=y | 112 | CONFIG_CPU_FREQ=y |
113 | CONFIG_CPU_FREQ_TABLE=m | 113 | CONFIG_CPU_FREQ_TABLE=m |
114 | # CONFIG_CPU_FREQ_DEBUG is not set | 114 | # CONFIG_CPU_FREQ_DEBUG is not set |
@@ -165,6 +165,9 @@ CONFIG_BINFMT_ELF32=y | |||
165 | CONFIG_BINFMT_ELF=y | 165 | CONFIG_BINFMT_ELF=y |
166 | CONFIG_BINFMT_MISC=m | 166 | CONFIG_BINFMT_MISC=m |
167 | CONFIG_SOLARIS_EMUL=y | 167 | CONFIG_SOLARIS_EMUL=y |
168 | # CONFIG_PREEMPT_NONE is not set | ||
169 | CONFIG_PREEMPT_VOLUNTARY=y | ||
170 | # CONFIG_PREEMPT is not set | ||
168 | # CONFIG_CMDLINE_BOOL is not set | 171 | # CONFIG_CMDLINE_BOOL is not set |
169 | 172 | ||
170 | # | 173 | # |
@@ -340,7 +343,6 @@ CONFIG_BLK_DEV_NBD=m | |||
340 | # CONFIG_BLK_DEV_SX8 is not set | 343 | # CONFIG_BLK_DEV_SX8 is not set |
341 | # CONFIG_BLK_DEV_UB is not set | 344 | # CONFIG_BLK_DEV_UB is not set |
342 | # CONFIG_BLK_DEV_RAM is not set | 345 | # CONFIG_BLK_DEV_RAM is not set |
343 | # CONFIG_BLK_DEV_INITRD is not set | ||
344 | CONFIG_CDROM_PKTCDVD=m | 346 | CONFIG_CDROM_PKTCDVD=m |
345 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 | 347 | CONFIG_CDROM_PKTCDVD_BUFFERS=8 |
346 | CONFIG_CDROM_PKTCDVD_WCACHE=y | 348 | CONFIG_CDROM_PKTCDVD_WCACHE=y |
diff --git a/arch/sparc64/kernel/ktlb.S b/arch/sparc64/kernel/ktlb.S index e492db845ea3..d4024ac0d619 100644 --- a/arch/sparc64/kernel/ktlb.S +++ b/arch/sparc64/kernel/ktlb.S | |||
@@ -138,9 +138,15 @@ kvmap_dtlb_4v: | |||
138 | brgez,pn %g4, kvmap_dtlb_nonlinear | 138 | brgez,pn %g4, kvmap_dtlb_nonlinear |
139 | nop | 139 | nop |
140 | 140 | ||
141 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
142 | /* Index through the base page size TSB even for linear | ||
143 | * mappings when using page allocation debugging. | ||
144 | */ | ||
145 | KERN_TSB_LOOKUP_TL1(%g4, %g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) | ||
146 | #else | ||
141 | /* Correct TAG_TARGET is already in %g6, check 4mb TSB. */ | 147 | /* Correct TAG_TARGET is already in %g6, check 4mb TSB. */ |
142 | KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) | 148 | KERN_TSB4M_LOOKUP_TL1(%g6, %g5, %g1, %g2, %g3, kvmap_dtlb_load) |
143 | 149 | #endif | |
144 | /* TSB entry address left in %g1, lookup linear PTE. | 150 | /* TSB entry address left in %g1, lookup linear PTE. |
145 | * Must preserve %g1 and %g6 (TAG). | 151 | * Must preserve %g1 and %g6 (TAG). |
146 | */ | 152 | */ |
diff --git a/arch/sparc64/kernel/process.c b/arch/sparc64/kernel/process.c index 7d75cd4eb297..b291060c25a6 100644 --- a/arch/sparc64/kernel/process.c +++ b/arch/sparc64/kernel/process.c | |||
@@ -413,8 +413,13 @@ void flush_thread(void) | |||
413 | struct thread_info *t = current_thread_info(); | 413 | struct thread_info *t = current_thread_info(); |
414 | struct mm_struct *mm; | 414 | struct mm_struct *mm; |
415 | 415 | ||
416 | if (t->flags & _TIF_ABI_PENDING) | 416 | if (test_ti_thread_flag(t, TIF_ABI_PENDING)) { |
417 | t->flags ^= (_TIF_ABI_PENDING | _TIF_32BIT); | 417 | clear_ti_thread_flag(t, TIF_ABI_PENDING); |
418 | if (test_ti_thread_flag(t, TIF_32BIT)) | ||
419 | clear_ti_thread_flag(t, TIF_32BIT); | ||
420 | else | ||
421 | set_ti_thread_flag(t, TIF_32BIT); | ||
422 | } | ||
418 | 423 | ||
419 | mm = t->task->mm; | 424 | mm = t->task->mm; |
420 | if (mm) | 425 | if (mm) |
diff --git a/arch/sparc64/kernel/systbls.S b/arch/sparc64/kernel/systbls.S index 948b7d2d5874..aaeb5e06735c 100644 --- a/arch/sparc64/kernel/systbls.S +++ b/arch/sparc64/kernel/systbls.S | |||
@@ -79,7 +79,8 @@ sys_call_table32: | |||
79 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 | 79 | .word sys_mkdirat, sys_mknodat, sys_fchownat, compat_sys_futimesat, compat_sys_fstatat64 |
80 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 80 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
81 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare | 81 | .word sys_fchmodat, sys_faccessat, compat_sys_pselect6, compat_sys_ppoll, sys_unshare |
82 | /*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages | 82 | /*300*/ .word compat_sys_set_robust_list, compat_sys_get_robust_list, compat_sys_migrate_pages, compat_sys_mbind, compat_sys_get_mempolicy |
83 | .word compat_sys_set_mempolicy, compat_sys_kexec_load, compat_sys_move_pages, sys_getcpu, compat_sys_epoll_pwait | ||
83 | 84 | ||
84 | #endif /* CONFIG_COMPAT */ | 85 | #endif /* CONFIG_COMPAT */ |
85 | 86 | ||
@@ -149,7 +150,8 @@ sys_call_table: | |||
149 | .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 | 150 | .word sys_mkdirat, sys_mknodat, sys_fchownat, sys_futimesat, sys_fstatat64 |
150 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat | 151 | /*290*/ .word sys_unlinkat, sys_renameat, sys_linkat, sys_symlinkat, sys_readlinkat |
151 | .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare | 152 | .word sys_fchmodat, sys_faccessat, sys_pselect6, sys_ppoll, sys_unshare |
152 | /*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages | 153 | /*300*/ .word sys_set_robust_list, sys_get_robust_list, sys_migrate_pages, sys_mbind, sys_get_mempolicy |
154 | .word sys_set_mempolicy, sys_kexec_load, sys_move_pages, sys_getcpu, sys_epoll_pwait | ||
153 | 155 | ||
154 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ | 156 | #if defined(CONFIG_SUNOS_EMUL) || defined(CONFIG_SOLARIS_EMUL) || \ |
155 | defined(CONFIG_SOLARIS_EMUL_MODULE) | 157 | defined(CONFIG_SOLARIS_EMUL_MODULE) |
@@ -264,5 +266,8 @@ sunos_sys_table: | |||
264 | .word sunos_nosys, sunos_nosys, sunos_nosys | 266 | .word sunos_nosys, sunos_nosys, sunos_nosys |
265 | .word sunos_nosys | 267 | .word sunos_nosys |
266 | /*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys | 268 | /*300*/ .word sunos_nosys, sunos_nosys, sunos_nosys |
269 | .word sunos_nosys, sunos_nosys, sunos_nosys | ||
270 | .word sunos_nosys, sunos_nosys, sunos_nosys | ||
271 | .word sunos_nosys | ||
267 | 272 | ||
268 | #endif | 273 | #endif |
diff --git a/arch/sparc64/kernel/tsb.S b/arch/sparc64/kernel/tsb.S index eedf94fa5664..10adb2fb8ffe 100644 --- a/arch/sparc64/kernel/tsb.S +++ b/arch/sparc64/kernel/tsb.S | |||
@@ -546,6 +546,7 @@ NGtsb_init: | |||
546 | subcc %o1, 0x100, %o1 | 546 | subcc %o1, 0x100, %o1 |
547 | bne,pt %xcc, 1b | 547 | bne,pt %xcc, 1b |
548 | add %o0, 0x100, %o0 | 548 | add %o0, 0x100, %o0 |
549 | membar #Sync | ||
549 | retl | 550 | retl |
550 | wr %g2, 0x0, %asi | 551 | wr %g2, 0x0, %asi |
551 | .size NGtsb_init, .-NGtsb_init | 552 | .size NGtsb_init, .-NGtsb_init |
diff --git a/arch/sparc64/lib/NGbzero.S b/arch/sparc64/lib/NGbzero.S index e86baece5cc8..f10e4529ee37 100644 --- a/arch/sparc64/lib/NGbzero.S +++ b/arch/sparc64/lib/NGbzero.S | |||
@@ -88,6 +88,7 @@ NGbzero_loop: | |||
88 | bne,pt %xcc, NGbzero_loop | 88 | bne,pt %xcc, NGbzero_loop |
89 | add %o0, 64, %o0 | 89 | add %o0, 64, %o0 |
90 | 90 | ||
91 | membar #Sync | ||
91 | wr %o4, 0x0, %asi | 92 | wr %o4, 0x0, %asi |
92 | brz,pn %o1, NGbzero_done | 93 | brz,pn %o1, NGbzero_done |
93 | NGbzero_medium: | 94 | NGbzero_medium: |
diff --git a/arch/sparc64/lib/NGmemcpy.S b/arch/sparc64/lib/NGmemcpy.S index 8e522b3dc095..66063a9a66b8 100644 --- a/arch/sparc64/lib/NGmemcpy.S +++ b/arch/sparc64/lib/NGmemcpy.S | |||
@@ -247,6 +247,8 @@ FUNC_NAME: /* %o0=dst, %o1=src, %o2=len */ | |||
247 | /* fall through */ | 247 | /* fall through */ |
248 | 248 | ||
249 | 60: | 249 | 60: |
250 | membar #Sync | ||
251 | |||
250 | /* %o2 contains any final bytes still needed to be copied | 252 | /* %o2 contains any final bytes still needed to be copied |
251 | * over. If anything is left, we copy it one byte at a time. | 253 | * over. If anything is left, we copy it one byte at a time. |
252 | */ | 254 | */ |
diff --git a/arch/sparc64/lib/NGpage.S b/arch/sparc64/lib/NGpage.S index 7d7c3bb8dcbf..8ce3a0c9c537 100644 --- a/arch/sparc64/lib/NGpage.S +++ b/arch/sparc64/lib/NGpage.S | |||
@@ -41,6 +41,7 @@ NGcopy_user_page: /* %o0=dest, %o1=src, %o2=vaddr */ | |||
41 | subcc %g7, 64, %g7 | 41 | subcc %g7, 64, %g7 |
42 | bne,pt %xcc, 1b | 42 | bne,pt %xcc, 1b |
43 | add %o0, 32, %o0 | 43 | add %o0, 32, %o0 |
44 | membar #Sync | ||
44 | retl | 45 | retl |
45 | nop | 46 | nop |
46 | 47 | ||
@@ -63,6 +64,7 @@ NGclear_user_page: /* %o0=dest, %o1=vaddr */ | |||
63 | subcc %g7, 64, %g7 | 64 | subcc %g7, 64, %g7 |
64 | bne,pt %xcc, 1b | 65 | bne,pt %xcc, 1b |
65 | add %o0, 32, %o0 | 66 | add %o0, 32, %o0 |
67 | membar #Sync | ||
66 | retl | 68 | retl |
67 | nop | 69 | nop |
68 | 70 | ||
diff --git a/arch/sparc64/mm/hugetlbpage.c b/arch/sparc64/mm/hugetlbpage.c index 33fd0b265e70..00677b5e1d7d 100644 --- a/arch/sparc64/mm/hugetlbpage.c +++ b/arch/sparc64/mm/hugetlbpage.c | |||
@@ -248,6 +248,7 @@ void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | |||
248 | if (!pte_present(*ptep) && pte_present(entry)) | 248 | if (!pte_present(*ptep) && pte_present(entry)) |
249 | mm->context.huge_pte_count++; | 249 | mm->context.huge_pte_count++; |
250 | 250 | ||
251 | addr &= HPAGE_MASK; | ||
251 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { | 252 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { |
252 | set_pte_at(mm, addr, ptep, entry); | 253 | set_pte_at(mm, addr, ptep, entry); |
253 | ptep++; | 254 | ptep++; |
@@ -266,6 +267,8 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | |||
266 | if (pte_present(entry)) | 267 | if (pte_present(entry)) |
267 | mm->context.huge_pte_count--; | 268 | mm->context.huge_pte_count--; |
268 | 269 | ||
270 | addr &= HPAGE_MASK; | ||
271 | |||
269 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { | 272 | for (i = 0; i < (1 << HUGETLB_PAGE_ORDER); i++) { |
270 | pte_clear(mm, addr, ptep); | 273 | pte_clear(mm, addr, ptep); |
271 | addr += PAGE_SIZE; | 274 | addr += PAGE_SIZE; |
diff --git a/arch/sparc64/mm/init.c b/arch/sparc64/mm/init.c index b1a1ee0cc6bd..f146071a4b2a 100644 --- a/arch/sparc64/mm/init.c +++ b/arch/sparc64/mm/init.c | |||
@@ -59,8 +59,10 @@ unsigned long kern_linear_pte_xor[2] __read_mostly; | |||
59 | */ | 59 | */ |
60 | unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; | 60 | unsigned long kpte_linear_bitmap[KPTE_BITMAP_BYTES / sizeof(unsigned long)]; |
61 | 61 | ||
62 | #ifndef CONFIG_DEBUG_PAGEALLOC | ||
62 | /* A special kernel TSB for 4MB and 256MB linear mappings. */ | 63 | /* A special kernel TSB for 4MB and 256MB linear mappings. */ |
63 | struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]; | 64 | struct tsb swapper_4m_tsb[KERNEL_TSB4M_NENTRIES]; |
65 | #endif | ||
64 | 66 | ||
65 | #define MAX_BANKS 32 | 67 | #define MAX_BANKS 32 |
66 | 68 | ||
@@ -1301,7 +1303,12 @@ static void __init tsb_phys_patch(void) | |||
1301 | } | 1303 | } |
1302 | 1304 | ||
1303 | /* Don't mark as init, we give this to the Hypervisor. */ | 1305 | /* Don't mark as init, we give this to the Hypervisor. */ |
1304 | static struct hv_tsb_descr ktsb_descr[2]; | 1306 | #ifndef CONFIG_DEBUG_PAGEALLOC |
1307 | #define NUM_KTSB_DESCR 2 | ||
1308 | #else | ||
1309 | #define NUM_KTSB_DESCR 1 | ||
1310 | #endif | ||
1311 | static struct hv_tsb_descr ktsb_descr[NUM_KTSB_DESCR]; | ||
1305 | extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES]; | 1312 | extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES]; |
1306 | 1313 | ||
1307 | static void __init sun4v_ktsb_init(void) | 1314 | static void __init sun4v_ktsb_init(void) |
@@ -1340,6 +1347,7 @@ static void __init sun4v_ktsb_init(void) | |||
1340 | ktsb_descr[0].tsb_base = ktsb_pa; | 1347 | ktsb_descr[0].tsb_base = ktsb_pa; |
1341 | ktsb_descr[0].resv = 0; | 1348 | ktsb_descr[0].resv = 0; |
1342 | 1349 | ||
1350 | #ifndef CONFIG_DEBUG_PAGEALLOC | ||
1343 | /* Second KTSB for 4MB/256MB mappings. */ | 1351 | /* Second KTSB for 4MB/256MB mappings. */ |
1344 | ktsb_pa = (kern_base + | 1352 | ktsb_pa = (kern_base + |
1345 | ((unsigned long)&swapper_4m_tsb[0] - KERNBASE)); | 1353 | ((unsigned long)&swapper_4m_tsb[0] - KERNBASE)); |
@@ -1352,6 +1360,7 @@ static void __init sun4v_ktsb_init(void) | |||
1352 | ktsb_descr[1].ctx_idx = 0; | 1360 | ktsb_descr[1].ctx_idx = 0; |
1353 | ktsb_descr[1].tsb_base = ktsb_pa; | 1361 | ktsb_descr[1].tsb_base = ktsb_pa; |
1354 | ktsb_descr[1].resv = 0; | 1362 | ktsb_descr[1].resv = 0; |
1363 | #endif | ||
1355 | } | 1364 | } |
1356 | 1365 | ||
1357 | void __cpuinit sun4v_ktsb_register(void) | 1366 | void __cpuinit sun4v_ktsb_register(void) |
@@ -1364,7 +1373,7 @@ void __cpuinit sun4v_ktsb_register(void) | |||
1364 | pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE); | 1373 | pa = kern_base + ((unsigned long)&ktsb_descr[0] - KERNBASE); |
1365 | 1374 | ||
1366 | func = HV_FAST_MMU_TSB_CTX0; | 1375 | func = HV_FAST_MMU_TSB_CTX0; |
1367 | arg0 = 2; | 1376 | arg0 = NUM_KTSB_DESCR; |
1368 | arg1 = pa; | 1377 | arg1 = pa; |
1369 | __asm__ __volatile__("ta %6" | 1378 | __asm__ __volatile__("ta %6" |
1370 | : "=&r" (func), "=&r" (arg0), "=&r" (arg1) | 1379 | : "=&r" (func), "=&r" (arg0), "=&r" (arg1) |
@@ -1393,7 +1402,9 @@ void __init paging_init(void) | |||
1393 | 1402 | ||
1394 | /* Invalidate both kernel TSBs. */ | 1403 | /* Invalidate both kernel TSBs. */ |
1395 | memset(swapper_tsb, 0x40, sizeof(swapper_tsb)); | 1404 | memset(swapper_tsb, 0x40, sizeof(swapper_tsb)); |
1405 | #ifndef CONFIG_DEBUG_PAGEALLOC | ||
1396 | memset(swapper_4m_tsb, 0x40, sizeof(swapper_4m_tsb)); | 1406 | memset(swapper_4m_tsb, 0x40, sizeof(swapper_4m_tsb)); |
1407 | #endif | ||
1397 | 1408 | ||
1398 | if (tlb_type == hypervisor) | 1409 | if (tlb_type == hypervisor) |
1399 | sun4v_pgprot_init(); | 1410 | sun4v_pgprot_init(); |
@@ -1725,8 +1736,13 @@ static void __init sun4u_pgprot_init(void) | |||
1725 | pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4U | __DIRTY_BITS_4U | | 1736 | pg_iobits = (_PAGE_VALID | _PAGE_PRESENT_4U | __DIRTY_BITS_4U | |
1726 | __ACCESS_BITS_4U | _PAGE_E_4U); | 1737 | __ACCESS_BITS_4U | _PAGE_E_4U); |
1727 | 1738 | ||
1739 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1740 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4U) ^ | ||
1741 | 0xfffff80000000000; | ||
1742 | #else | ||
1728 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^ | 1743 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4U) ^ |
1729 | 0xfffff80000000000; | 1744 | 0xfffff80000000000; |
1745 | #endif | ||
1730 | kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U | | 1746 | kern_linear_pte_xor[0] |= (_PAGE_CP_4U | _PAGE_CV_4U | |
1731 | _PAGE_P_4U | _PAGE_W_4U); | 1747 | _PAGE_P_4U | _PAGE_W_4U); |
1732 | 1748 | ||
@@ -1769,13 +1785,23 @@ static void __init sun4v_pgprot_init(void) | |||
1769 | _PAGE_E = _PAGE_E_4V; | 1785 | _PAGE_E = _PAGE_E_4V; |
1770 | _PAGE_CACHE = _PAGE_CACHE_4V; | 1786 | _PAGE_CACHE = _PAGE_CACHE_4V; |
1771 | 1787 | ||
1788 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1789 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ | ||
1790 | 0xfffff80000000000; | ||
1791 | #else | ||
1772 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^ | 1792 | kern_linear_pte_xor[0] = (_PAGE_VALID | _PAGE_SZ4MB_4V) ^ |
1773 | 0xfffff80000000000; | 1793 | 0xfffff80000000000; |
1794 | #endif | ||
1774 | kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V | | 1795 | kern_linear_pte_xor[0] |= (_PAGE_CP_4V | _PAGE_CV_4V | |
1775 | _PAGE_P_4V | _PAGE_W_4V); | 1796 | _PAGE_P_4V | _PAGE_W_4V); |
1776 | 1797 | ||
1798 | #ifdef CONFIG_DEBUG_PAGEALLOC | ||
1799 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZBITS_4V) ^ | ||
1800 | 0xfffff80000000000; | ||
1801 | #else | ||
1777 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^ | 1802 | kern_linear_pte_xor[1] = (_PAGE_VALID | _PAGE_SZ256MB_4V) ^ |
1778 | 0xfffff80000000000; | 1803 | 0xfffff80000000000; |
1804 | #endif | ||
1779 | kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V | | 1805 | kern_linear_pte_xor[1] |= (_PAGE_CP_4V | _PAGE_CV_4V | |
1780 | _PAGE_P_4V | _PAGE_W_4V); | 1806 | _PAGE_P_4V | _PAGE_W_4V); |
1781 | 1807 | ||
diff --git a/arch/um/Kconfig b/arch/um/Kconfig index b3a21ba77cd2..354cc6b70530 100644 --- a/arch/um/Kconfig +++ b/arch/um/Kconfig | |||
@@ -44,7 +44,7 @@ config LOCKDEP_SUPPORT | |||
44 | 44 | ||
45 | config STACKTRACE_SUPPORT | 45 | config STACKTRACE_SUPPORT |
46 | bool | 46 | bool |
47 | default y | 47 | default n |
48 | 48 | ||
49 | config GENERIC_CALIBRATE_DELAY | 49 | config GENERIC_CALIBRATE_DELAY |
50 | bool | 50 | bool |
diff --git a/arch/um/scripts/Makefile.rules b/arch/um/scripts/Makefile.rules index 813077fb1e5b..a9a4b85ca516 100644 --- a/arch/um/scripts/Makefile.rules +++ b/arch/um/scripts/Makefile.rules | |||
@@ -10,7 +10,7 @@ USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file)) | |||
10 | $(USER_OBJS:.o=.%): \ | 10 | $(USER_OBJS:.o=.%): \ |
11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) | 11 | c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(basetarget).o) |
12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | 12 | $(USER_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ |
13 | -Dunix -D__unix__ -D__$(SUBARCH)__ | 13 | -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF) |
14 | 14 | ||
15 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of | 15 | # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of |
16 | # using it directly. | 16 | # using it directly. |
@@ -19,7 +19,7 @@ UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file)) | |||
19 | $(UNPROFILE_OBJS:.o=.%): \ | 19 | $(UNPROFILE_OBJS:.o=.%): \ |
20 | c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) | 20 | c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o) |
21 | $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ | 21 | $(UNPROFILE_OBJS) : CHECKFLAGS := -D__linux__ -Dlinux -D__STDC__ \ |
22 | -Dunix -D__unix__ -D__$(SUBARCH)__ | 22 | -Dunix -D__unix__ -D__$(SUBARCH)__ $(CF) |
23 | 23 | ||
24 | # The stubs and unmap.o can't try to call mcount or update basic block data | 24 | # The stubs and unmap.o can't try to call mcount or update basic block data |
25 | define unprofile | 25 | define unprofile |
diff --git a/arch/x86_64/defconfig b/arch/x86_64/defconfig index 293a4a4c609e..7a1e251e333d 100644 --- a/arch/x86_64/defconfig +++ b/arch/x86_64/defconfig | |||
@@ -1,11 +1,13 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.20-git8 | 3 | # Linux kernel version: 2.6.21-rc3 |
4 | # Tue Feb 13 11:25:16 2007 | 4 | # Wed Mar 7 15:29:47 2007 |
5 | # | 5 | # |
6 | CONFIG_X86_64=y | 6 | CONFIG_X86_64=y |
7 | CONFIG_64BIT=y | 7 | CONFIG_64BIT=y |
8 | CONFIG_X86=y | 8 | CONFIG_X86=y |
9 | CONFIG_GENERIC_TIME=y | ||
10 | CONFIG_GENERIC_TIME_VSYSCALL=y | ||
9 | CONFIG_ZONE_DMA32=y | 11 | CONFIG_ZONE_DMA32=y |
10 | CONFIG_LOCKDEP_SUPPORT=y | 12 | CONFIG_LOCKDEP_SUPPORT=y |
11 | CONFIG_STACKTRACE_SUPPORT=y | 13 | CONFIG_STACKTRACE_SUPPORT=y |
@@ -43,6 +45,7 @@ CONFIG_LOCALVERSION_AUTO=y | |||
43 | CONFIG_SWAP=y | 45 | CONFIG_SWAP=y |
44 | CONFIG_SYSVIPC=y | 46 | CONFIG_SYSVIPC=y |
45 | # CONFIG_IPC_NS is not set | 47 | # CONFIG_IPC_NS is not set |
48 | CONFIG_SYSVIPC_SYSCTL=y | ||
46 | CONFIG_POSIX_MQUEUE=y | 49 | CONFIG_POSIX_MQUEUE=y |
47 | # CONFIG_BSD_PROCESS_ACCT is not set | 50 | # CONFIG_BSD_PROCESS_ACCT is not set |
48 | # CONFIG_TASKSTATS is not set | 51 | # CONFIG_TASKSTATS is not set |
@@ -53,6 +56,7 @@ CONFIG_IKCONFIG_PROC=y | |||
53 | # CONFIG_CPUSETS is not set | 56 | # CONFIG_CPUSETS is not set |
54 | CONFIG_SYSFS_DEPRECATED=y | 57 | CONFIG_SYSFS_DEPRECATED=y |
55 | # CONFIG_RELAY is not set | 58 | # CONFIG_RELAY is not set |
59 | CONFIG_BLK_DEV_INITRD=y | ||
56 | CONFIG_INITRAMFS_SOURCE="" | 60 | CONFIG_INITRAMFS_SOURCE="" |
57 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y | 61 | CONFIG_CC_OPTIMIZE_FOR_SIZE=y |
58 | CONFIG_SYSCTL=y | 62 | CONFIG_SYSCTL=y |
@@ -114,11 +118,11 @@ CONFIG_X86_PC=y | |||
114 | # CONFIG_X86_VSMP is not set | 118 | # CONFIG_X86_VSMP is not set |
115 | # CONFIG_MK8 is not set | 119 | # CONFIG_MK8 is not set |
116 | # CONFIG_MPSC is not set | 120 | # CONFIG_MPSC is not set |
117 | CONFIG_MCORE2=y | 121 | # CONFIG_MCORE2 is not set |
118 | # CONFIG_GENERIC_CPU is not set | 122 | CONFIG_GENERIC_CPU=y |
119 | CONFIG_X86_L1_CACHE_BYTES=64 | 123 | CONFIG_X86_L1_CACHE_BYTES=128 |
120 | CONFIG_X86_L1_CACHE_SHIFT=6 | 124 | CONFIG_X86_L1_CACHE_SHIFT=7 |
121 | CONFIG_X86_INTERNODE_CACHE_BYTES=64 | 125 | CONFIG_X86_INTERNODE_CACHE_BYTES=128 |
122 | CONFIG_X86_TSC=y | 126 | CONFIG_X86_TSC=y |
123 | CONFIG_X86_GOOD_APIC=y | 127 | CONFIG_X86_GOOD_APIC=y |
124 | # CONFIG_MICROCODE is not set | 128 | # CONFIG_MICROCODE is not set |
@@ -207,10 +211,8 @@ CONFIG_ACPI_PROCFS=y | |||
207 | CONFIG_ACPI_AC=y | 211 | CONFIG_ACPI_AC=y |
208 | CONFIG_ACPI_BATTERY=y | 212 | CONFIG_ACPI_BATTERY=y |
209 | CONFIG_ACPI_BUTTON=y | 213 | CONFIG_ACPI_BUTTON=y |
210 | # CONFIG_ACPI_HOTKEY is not set | ||
211 | CONFIG_ACPI_FAN=y | 214 | CONFIG_ACPI_FAN=y |
212 | # CONFIG_ACPI_DOCK is not set | 215 | # CONFIG_ACPI_DOCK is not set |
213 | # CONFIG_ACPI_BAY is not set | ||
214 | CONFIG_ACPI_PROCESSOR=y | 216 | CONFIG_ACPI_PROCESSOR=y |
215 | CONFIG_ACPI_HOTPLUG_CPU=y | 217 | CONFIG_ACPI_HOTPLUG_CPU=y |
216 | CONFIG_ACPI_THERMAL=y | 218 | CONFIG_ACPI_THERMAL=y |
@@ -319,7 +321,7 @@ CONFIG_IP_PNP_DHCP=y | |||
319 | # CONFIG_INET_ESP is not set | 321 | # CONFIG_INET_ESP is not set |
320 | # CONFIG_INET_IPCOMP is not set | 322 | # CONFIG_INET_IPCOMP is not set |
321 | # CONFIG_INET_XFRM_TUNNEL is not set | 323 | # CONFIG_INET_XFRM_TUNNEL is not set |
322 | # CONFIG_INET_TUNNEL is not set | 324 | CONFIG_INET_TUNNEL=y |
323 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set | 325 | # CONFIG_INET_XFRM_MODE_TRANSPORT is not set |
324 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set | 326 | # CONFIG_INET_XFRM_MODE_TUNNEL is not set |
325 | # CONFIG_INET_XFRM_MODE_BEET is not set | 327 | # CONFIG_INET_XFRM_MODE_BEET is not set |
@@ -421,7 +423,13 @@ CONFIG_FW_LOADER=y | |||
421 | # | 423 | # |
422 | # Plug and Play support | 424 | # Plug and Play support |
423 | # | 425 | # |
424 | # CONFIG_PNP is not set | 426 | CONFIG_PNP=y |
427 | # CONFIG_PNP_DEBUG is not set | ||
428 | |||
429 | # | ||
430 | # Protocols | ||
431 | # | ||
432 | CONFIG_PNPACPI=y | ||
425 | 433 | ||
426 | # | 434 | # |
427 | # Block devices | 435 | # Block devices |
@@ -441,7 +449,6 @@ CONFIG_BLK_DEV_RAM=y | |||
441 | CONFIG_BLK_DEV_RAM_COUNT=16 | 449 | CONFIG_BLK_DEV_RAM_COUNT=16 |
442 | CONFIG_BLK_DEV_RAM_SIZE=4096 | 450 | CONFIG_BLK_DEV_RAM_SIZE=4096 |
443 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 | 451 | CONFIG_BLK_DEV_RAM_BLOCKSIZE=1024 |
444 | CONFIG_BLK_DEV_INITRD=y | ||
445 | # CONFIG_CDROM_PKTCDVD is not set | 452 | # CONFIG_CDROM_PKTCDVD is not set |
446 | # CONFIG_ATA_OVER_ETH is not set | 453 | # CONFIG_ATA_OVER_ETH is not set |
447 | 454 | ||
@@ -451,6 +458,7 @@ CONFIG_BLK_DEV_INITRD=y | |||
451 | # CONFIG_IBM_ASM is not set | 458 | # CONFIG_IBM_ASM is not set |
452 | # CONFIG_SGI_IOC4 is not set | 459 | # CONFIG_SGI_IOC4 is not set |
453 | # CONFIG_TIFM_CORE is not set | 460 | # CONFIG_TIFM_CORE is not set |
461 | # CONFIG_SONY_LAPTOP is not set | ||
454 | 462 | ||
455 | # | 463 | # |
456 | # ATA/ATAPI/MFM/RLL support | 464 | # ATA/ATAPI/MFM/RLL support |
@@ -477,6 +485,7 @@ CONFIG_BLK_DEV_IDEACPI=y | |||
477 | # | 485 | # |
478 | CONFIG_IDE_GENERIC=y | 486 | CONFIG_IDE_GENERIC=y |
479 | # CONFIG_BLK_DEV_CMD640 is not set | 487 | # CONFIG_BLK_DEV_CMD640 is not set |
488 | # CONFIG_BLK_DEV_IDEPNP is not set | ||
480 | CONFIG_BLK_DEV_IDEPCI=y | 489 | CONFIG_BLK_DEV_IDEPCI=y |
481 | # CONFIG_IDEPCI_SHARE_IRQ is not set | 490 | # CONFIG_IDEPCI_SHARE_IRQ is not set |
482 | # CONFIG_BLK_DEV_OFFBOARD is not set | 491 | # CONFIG_BLK_DEV_OFFBOARD is not set |
@@ -623,6 +632,7 @@ CONFIG_SATA_VIA=y | |||
623 | # CONFIG_SATA_VITESSE is not set | 632 | # CONFIG_SATA_VITESSE is not set |
624 | # CONFIG_SATA_INIC162X is not set | 633 | # CONFIG_SATA_INIC162X is not set |
625 | CONFIG_SATA_INTEL_COMBINED=y | 634 | CONFIG_SATA_INTEL_COMBINED=y |
635 | CONFIG_SATA_ACPI=y | ||
626 | # CONFIG_PATA_ALI is not set | 636 | # CONFIG_PATA_ALI is not set |
627 | # CONFIG_PATA_AMD is not set | 637 | # CONFIG_PATA_AMD is not set |
628 | # CONFIG_PATA_ARTOP is not set | 638 | # CONFIG_PATA_ARTOP is not set |
@@ -726,6 +736,7 @@ CONFIG_NETDEVICES=y | |||
726 | # CONFIG_BONDING is not set | 736 | # CONFIG_BONDING is not set |
727 | # CONFIG_EQUALIZER is not set | 737 | # CONFIG_EQUALIZER is not set |
728 | CONFIG_TUN=y | 738 | CONFIG_TUN=y |
739 | # CONFIG_NET_SB1000 is not set | ||
729 | 740 | ||
730 | # | 741 | # |
731 | # ARCnet devices | 742 | # ARCnet devices |
@@ -920,6 +931,7 @@ CONFIG_HW_CONSOLE=y | |||
920 | CONFIG_SERIAL_8250=y | 931 | CONFIG_SERIAL_8250=y |
921 | CONFIG_SERIAL_8250_CONSOLE=y | 932 | CONFIG_SERIAL_8250_CONSOLE=y |
922 | CONFIG_SERIAL_8250_PCI=y | 933 | CONFIG_SERIAL_8250_PCI=y |
934 | CONFIG_SERIAL_8250_PNP=y | ||
923 | CONFIG_SERIAL_8250_NR_UARTS=4 | 935 | CONFIG_SERIAL_8250_NR_UARTS=4 |
924 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 | 936 | CONFIG_SERIAL_8250_RUNTIME_UARTS=4 |
925 | # CONFIG_SERIAL_8250_EXTENDED is not set | 937 | # CONFIG_SERIAL_8250_EXTENDED is not set |
@@ -1001,6 +1013,7 @@ CONFIG_I2C_ISA=m | |||
1001 | # CONFIG_I2C_NFORCE2 is not set | 1013 | # CONFIG_I2C_NFORCE2 is not set |
1002 | # CONFIG_I2C_OCORES is not set | 1014 | # CONFIG_I2C_OCORES is not set |
1003 | # CONFIG_I2C_PARPORT_LIGHT is not set | 1015 | # CONFIG_I2C_PARPORT_LIGHT is not set |
1016 | # CONFIG_I2C_PASEMI is not set | ||
1004 | # CONFIG_I2C_PROSAVAGE is not set | 1017 | # CONFIG_I2C_PROSAVAGE is not set |
1005 | # CONFIG_I2C_SAVAGE4 is not set | 1018 | # CONFIG_I2C_SAVAGE4 is not set |
1006 | # CONFIG_I2C_SIS5595 is not set | 1019 | # CONFIG_I2C_SIS5595 is not set |
@@ -1047,6 +1060,7 @@ CONFIG_HWMON=y | |||
1047 | # CONFIG_SENSORS_ADM1021 is not set | 1060 | # CONFIG_SENSORS_ADM1021 is not set |
1048 | # CONFIG_SENSORS_ADM1025 is not set | 1061 | # CONFIG_SENSORS_ADM1025 is not set |
1049 | # CONFIG_SENSORS_ADM1026 is not set | 1062 | # CONFIG_SENSORS_ADM1026 is not set |
1063 | # CONFIG_SENSORS_ADM1029 is not set | ||
1050 | # CONFIG_SENSORS_ADM1031 is not set | 1064 | # CONFIG_SENSORS_ADM1031 is not set |
1051 | # CONFIG_SENSORS_ADM9240 is not set | 1065 | # CONFIG_SENSORS_ADM9240 is not set |
1052 | # CONFIG_SENSORS_K8TEMP is not set | 1066 | # CONFIG_SENSORS_K8TEMP is not set |
@@ -1090,6 +1104,11 @@ CONFIG_SENSORS_SMSC47B397=m | |||
1090 | # CONFIG_HWMON_DEBUG_CHIP is not set | 1104 | # CONFIG_HWMON_DEBUG_CHIP is not set |
1091 | 1105 | ||
1092 | # | 1106 | # |
1107 | # Multifunction device drivers | ||
1108 | # | ||
1109 | # CONFIG_MFD_SM501 is not set | ||
1110 | |||
1111 | # | ||
1093 | # Multimedia devices | 1112 | # Multimedia devices |
1094 | # | 1113 | # |
1095 | # CONFIG_VIDEO_DEV is not set | 1114 | # CONFIG_VIDEO_DEV is not set |
@@ -1103,7 +1122,7 @@ CONFIG_SENSORS_SMSC47B397=m | |||
1103 | # | 1122 | # |
1104 | # Graphics support | 1123 | # Graphics support |
1105 | # | 1124 | # |
1106 | # CONFIG_FIRMWARE_EDID is not set | 1125 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set |
1107 | # CONFIG_FB is not set | 1126 | # CONFIG_FB is not set |
1108 | 1127 | ||
1109 | # | 1128 | # |
@@ -1114,7 +1133,6 @@ CONFIG_VGACON_SOFT_SCROLLBACK=y | |||
1114 | CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256 | 1133 | CONFIG_VGACON_SOFT_SCROLLBACK_SIZE=256 |
1115 | CONFIG_VIDEO_SELECT=y | 1134 | CONFIG_VIDEO_SELECT=y |
1116 | CONFIG_DUMMY_CONSOLE=y | 1135 | CONFIG_DUMMY_CONSOLE=y |
1117 | # CONFIG_BACKLIGHT_LCD_SUPPORT is not set | ||
1118 | 1136 | ||
1119 | # | 1137 | # |
1120 | # Sound | 1138 | # Sound |
@@ -1130,9 +1148,8 @@ CONFIG_SOUND=y | |||
1130 | # Open Sound System | 1148 | # Open Sound System |
1131 | # | 1149 | # |
1132 | CONFIG_SOUND_PRIME=y | 1150 | CONFIG_SOUND_PRIME=y |
1133 | CONFIG_OBSOLETE_OSS=y | 1151 | # CONFIG_OBSOLETE_OSS is not set |
1134 | # CONFIG_SOUND_BT878 is not set | 1152 | # CONFIG_SOUND_BT878 is not set |
1135 | # CONFIG_SOUND_ES1371 is not set | ||
1136 | CONFIG_SOUND_ICH=y | 1153 | CONFIG_SOUND_ICH=y |
1137 | # CONFIG_SOUND_TRIDENT is not set | 1154 | # CONFIG_SOUND_TRIDENT is not set |
1138 | # CONFIG_SOUND_MSNDCLAS is not set | 1155 | # CONFIG_SOUND_MSNDCLAS is not set |
@@ -1263,6 +1280,7 @@ CONFIG_USB_MON=y | |||
1263 | # CONFIG_USB_RIO500 is not set | 1280 | # CONFIG_USB_RIO500 is not set |
1264 | # CONFIG_USB_LEGOTOWER is not set | 1281 | # CONFIG_USB_LEGOTOWER is not set |
1265 | # CONFIG_USB_LCD is not set | 1282 | # CONFIG_USB_LCD is not set |
1283 | # CONFIG_USB_BERRY_CHARGE is not set | ||
1266 | # CONFIG_USB_LED is not set | 1284 | # CONFIG_USB_LED is not set |
1267 | # CONFIG_USB_CYPRESS_CY7C63 is not set | 1285 | # CONFIG_USB_CYPRESS_CY7C63 is not set |
1268 | # CONFIG_USB_CYTHERM is not set | 1286 | # CONFIG_USB_CYTHERM is not set |
@@ -1273,6 +1291,7 @@ CONFIG_USB_MON=y | |||
1273 | # CONFIG_USB_SISUSBVGA is not set | 1291 | # CONFIG_USB_SISUSBVGA is not set |
1274 | # CONFIG_USB_LD is not set | 1292 | # CONFIG_USB_LD is not set |
1275 | # CONFIG_USB_TRANCEVIBRATOR is not set | 1293 | # CONFIG_USB_TRANCEVIBRATOR is not set |
1294 | # CONFIG_USB_IOWARRIOR is not set | ||
1276 | # CONFIG_USB_TEST is not set | 1295 | # CONFIG_USB_TEST is not set |
1277 | 1296 | ||
1278 | # | 1297 | # |
@@ -1538,6 +1557,7 @@ CONFIG_DEBUG_KERNEL=y | |||
1538 | CONFIG_LOG_BUF_SHIFT=18 | 1557 | CONFIG_LOG_BUF_SHIFT=18 |
1539 | CONFIG_DETECT_SOFTLOCKUP=y | 1558 | CONFIG_DETECT_SOFTLOCKUP=y |
1540 | # CONFIG_SCHEDSTATS is not set | 1559 | # CONFIG_SCHEDSTATS is not set |
1560 | # CONFIG_TIMER_STATS is not set | ||
1541 | # CONFIG_DEBUG_SLAB is not set | 1561 | # CONFIG_DEBUG_SLAB is not set |
1542 | # CONFIG_DEBUG_RT_MUTEXES is not set | 1562 | # CONFIG_DEBUG_RT_MUTEXES is not set |
1543 | # CONFIG_RT_MUTEX_TESTER is not set | 1563 | # CONFIG_RT_MUTEX_TESTER is not set |
@@ -1556,6 +1576,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
1556 | # CONFIG_FORCED_INLINING is not set | 1576 | # CONFIG_FORCED_INLINING is not set |
1557 | # CONFIG_RCU_TORTURE_TEST is not set | 1577 | # CONFIG_RCU_TORTURE_TEST is not set |
1558 | # CONFIG_LKDTM is not set | 1578 | # CONFIG_LKDTM is not set |
1579 | # CONFIG_FAULT_INJECTION is not set | ||
1559 | # CONFIG_DEBUG_RODATA is not set | 1580 | # CONFIG_DEBUG_RODATA is not set |
1560 | # CONFIG_IOMMU_DEBUG is not set | 1581 | # CONFIG_IOMMU_DEBUG is not set |
1561 | CONFIG_DEBUG_STACKOVERFLOW=y | 1582 | CONFIG_DEBUG_STACKOVERFLOW=y |
diff --git a/arch/x86_64/ia32/ia32entry.S b/arch/x86_64/ia32/ia32entry.S index eda7a0d4dc15..796df6992f62 100644 --- a/arch/x86_64/ia32/ia32entry.S +++ b/arch/x86_64/ia32/ia32entry.S | |||
@@ -560,7 +560,7 @@ ia32_sys_call_table: | |||
560 | .quad sys_sched_yield | 560 | .quad sys_sched_yield |
561 | .quad sys_sched_get_priority_max | 561 | .quad sys_sched_get_priority_max |
562 | .quad sys_sched_get_priority_min /* 160 */ | 562 | .quad sys_sched_get_priority_min /* 160 */ |
563 | .quad sys_sched_rr_get_interval | 563 | .quad sys32_sched_rr_get_interval |
564 | .quad compat_sys_nanosleep | 564 | .quad compat_sys_nanosleep |
565 | .quad sys_mremap | 565 | .quad sys_mremap |
566 | .quad sys_setresuid16 | 566 | .quad sys_setresuid16 |
diff --git a/arch/x86_64/kernel/cpufreq/Kconfig b/arch/x86_64/kernel/cpufreq/Kconfig index ced15d06f0f3..40acb67fb882 100644 --- a/arch/x86_64/kernel/cpufreq/Kconfig +++ b/arch/x86_64/kernel/cpufreq/Kconfig | |||
@@ -75,6 +75,7 @@ config X86_ACPI_CPUFREQ_PROC_INTF | |||
75 | config X86_P4_CLOCKMOD | 75 | config X86_P4_CLOCKMOD |
76 | tristate "Intel Pentium 4 clock modulation" | 76 | tristate "Intel Pentium 4 clock modulation" |
77 | depends on EMBEDDED | 77 | depends on EMBEDDED |
78 | select CPU_FREQ_TABLE | ||
78 | help | 79 | help |
79 | This adds the clock modulation driver for Intel Pentium 4 / XEON | 80 | This adds the clock modulation driver for Intel Pentium 4 / XEON |
80 | processors. When enabled it will lower CPU temperature by skipping | 81 | processors. When enabled it will lower CPU temperature by skipping |
diff --git a/arch/x86_64/kernel/e820.c b/arch/x86_64/kernel/e820.c index 4651fd22b213..a490fabfcf47 100644 --- a/arch/x86_64/kernel/e820.c +++ b/arch/x86_64/kernel/e820.c | |||
@@ -662,7 +662,7 @@ static int __init parse_memmap_opt(char *p) | |||
662 | } | 662 | } |
663 | early_param("memmap", parse_memmap_opt); | 663 | early_param("memmap", parse_memmap_opt); |
664 | 664 | ||
665 | void finish_e820_parsing(void) | 665 | void __init finish_e820_parsing(void) |
666 | { | 666 | { |
667 | if (userdef) { | 667 | if (userdef) { |
668 | printk(KERN_INFO "user-defined physical RAM map:\n"); | 668 | printk(KERN_INFO "user-defined physical RAM map:\n"); |
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c index dec587b293bf..148c6bcf5bb4 100644 --- a/arch/x86_64/kernel/early-quirks.c +++ b/arch/x86_64/kernel/early-quirks.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/proto.h> | 16 | #include <asm/proto.h> |
17 | #include <asm/dma.h> | 17 | #include <asm/dma.h> |
18 | 18 | ||
19 | static void via_bugs(void) | 19 | static void __init via_bugs(void) |
20 | { | 20 | { |
21 | #ifdef CONFIG_IOMMU | 21 | #ifdef CONFIG_IOMMU |
22 | if ((end_pfn > MAX_DMA32_PFN || force_iommu) && | 22 | if ((end_pfn > MAX_DMA32_PFN || force_iommu) && |
@@ -36,7 +36,7 @@ static int __init nvidia_hpet_check(struct acpi_table_header *header) | |||
36 | } | 36 | } |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | static void nvidia_bugs(void) | 39 | static void __init nvidia_bugs(void) |
40 | { | 40 | { |
41 | #ifdef CONFIG_ACPI | 41 | #ifdef CONFIG_ACPI |
42 | /* | 42 | /* |
@@ -62,7 +62,7 @@ static void nvidia_bugs(void) | |||
62 | 62 | ||
63 | } | 63 | } |
64 | 64 | ||
65 | static void ati_bugs(void) | 65 | static void __init ati_bugs(void) |
66 | { | 66 | { |
67 | if (timer_over_8254 == 1) { | 67 | if (timer_over_8254 == 1) { |
68 | timer_over_8254 = 0; | 68 | timer_over_8254 = 0; |
@@ -88,7 +88,7 @@ struct chipset { | |||
88 | void (*f)(void); | 88 | void (*f)(void); |
89 | }; | 89 | }; |
90 | 90 | ||
91 | static struct chipset early_qrk[] = { | 91 | static struct __initdata chipset early_qrk[] = { |
92 | { PCI_VENDOR_ID_NVIDIA, nvidia_bugs }, | 92 | { PCI_VENDOR_ID_NVIDIA, nvidia_bugs }, |
93 | { PCI_VENDOR_ID_VIA, via_bugs }, | 93 | { PCI_VENDOR_ID_VIA, via_bugs }, |
94 | { PCI_VENDOR_ID_ATI, ati_bugs }, | 94 | { PCI_VENDOR_ID_ATI, ati_bugs }, |
diff --git a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c index 50dd8bef850e..455aa0b932f0 100644 --- a/arch/x86_64/kernel/mpparse.c +++ b/arch/x86_64/kernel/mpparse.c | |||
@@ -60,9 +60,9 @@ unsigned long mp_lapic_addr = 0; | |||
60 | /* Processor that is doing the boot up */ | 60 | /* Processor that is doing the boot up */ |
61 | unsigned int boot_cpu_id = -1U; | 61 | unsigned int boot_cpu_id = -1U; |
62 | /* Internal processor count */ | 62 | /* Internal processor count */ |
63 | unsigned int num_processors __initdata = 0; | 63 | unsigned int num_processors __cpuinitdata = 0; |
64 | 64 | ||
65 | unsigned disabled_cpus __initdata; | 65 | unsigned disabled_cpus __cpuinitdata; |
66 | 66 | ||
67 | /* Bitmask of physically existing CPUs */ | 67 | /* Bitmask of physically existing CPUs */ |
68 | physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; | 68 | physid_mask_t phys_cpu_present_map = PHYSID_MASK_NONE; |
diff --git a/arch/x86_64/kernel/nmi.c b/arch/x86_64/kernel/nmi.c index 486f4c61a948..82d9d85d5270 100644 --- a/arch/x86_64/kernel/nmi.c +++ b/arch/x86_64/kernel/nmi.c | |||
@@ -187,10 +187,7 @@ void nmi_watchdog_default(void) | |||
187 | { | 187 | { |
188 | if (nmi_watchdog != NMI_DEFAULT) | 188 | if (nmi_watchdog != NMI_DEFAULT) |
189 | return; | 189 | return; |
190 | if (nmi_known_cpu()) | 190 | nmi_watchdog = NMI_NONE; |
191 | nmi_watchdog = NMI_LOCAL_APIC; | ||
192 | else | ||
193 | nmi_watchdog = NMI_IO_APIC; | ||
194 | } | 191 | } |
195 | 192 | ||
196 | static int endflag __initdata = 0; | 193 | static int endflag __initdata = 0; |
diff --git a/arch/x86_64/kernel/pci-gart.c b/arch/x86_64/kernel/pci-gart.c index 030eb3753358..2bac8c60ad61 100644 --- a/arch/x86_64/kernel/pci-gart.c +++ b/arch/x86_64/kernel/pci-gart.c | |||
@@ -675,7 +675,7 @@ void __init gart_iommu_init(void) | |||
675 | dma_ops = &gart_dma_ops; | 675 | dma_ops = &gart_dma_ops; |
676 | } | 676 | } |
677 | 677 | ||
678 | void gart_parse_options(char *p) | 678 | void __init gart_parse_options(char *p) |
679 | { | 679 | { |
680 | int arg; | 680 | int arg; |
681 | 681 | ||
diff --git a/arch/x86_64/kernel/process.c b/arch/x86_64/kernel/process.c index cbbc6adc1a92..d8d5ccc245c8 100644 --- a/arch/x86_64/kernel/process.c +++ b/arch/x86_64/kernel/process.c | |||
@@ -382,14 +382,17 @@ void exit_thread(void) | |||
382 | void flush_thread(void) | 382 | void flush_thread(void) |
383 | { | 383 | { |
384 | struct task_struct *tsk = current; | 384 | struct task_struct *tsk = current; |
385 | struct thread_info *t = current_thread_info(); | ||
386 | 385 | ||
387 | if (t->flags & _TIF_ABI_PENDING) { | 386 | if (test_tsk_thread_flag(tsk, TIF_ABI_PENDING)) { |
388 | t->flags ^= (_TIF_ABI_PENDING | _TIF_IA32); | 387 | clear_tsk_thread_flag(tsk, TIF_ABI_PENDING); |
389 | if (t->flags & _TIF_IA32) | 388 | if (test_tsk_thread_flag(tsk, TIF_IA32)) { |
389 | clear_tsk_thread_flag(tsk, TIF_IA32); | ||
390 | } else { | ||
391 | set_tsk_thread_flag(tsk, TIF_IA32); | ||
390 | current_thread_info()->status |= TS_COMPAT; | 392 | current_thread_info()->status |= TS_COMPAT; |
393 | } | ||
391 | } | 394 | } |
392 | t->flags &= ~_TIF_DEBUG; | 395 | clear_tsk_thread_flag(tsk, TIF_DEBUG); |
393 | 396 | ||
394 | tsk->thread.debugreg0 = 0; | 397 | tsk->thread.debugreg0 = 0; |
395 | tsk->thread.debugreg1 = 0; | 398 | tsk->thread.debugreg1 = 0; |
diff --git a/arch/x86_64/kernel/vsyscall.c b/arch/x86_64/kernel/vsyscall.c index 180ff919eaf9..b43c698cf7d3 100644 --- a/arch/x86_64/kernel/vsyscall.c +++ b/arch/x86_64/kernel/vsyscall.c | |||
@@ -112,7 +112,7 @@ static __always_inline void do_vgettimeofday(struct timeval * tv) | |||
112 | 112 | ||
113 | vread = __vsyscall_gtod_data.clock.vread; | 113 | vread = __vsyscall_gtod_data.clock.vread; |
114 | if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) { | 114 | if (unlikely(!__vsyscall_gtod_data.sysctl_enabled || !vread)) { |
115 | gettimeofday(tv,0); | 115 | gettimeofday(tv,NULL); |
116 | return; | 116 | return; |
117 | } | 117 | } |
118 | now = vread(); | 118 | now = vread(); |
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c index 0dffae69f4ad..77c25b307635 100644 --- a/arch/x86_64/kernel/x8664_ksyms.c +++ b/arch/x86_64/kernel/x8664_ksyms.c | |||
@@ -59,3 +59,4 @@ EXPORT_SYMBOL(empty_zero_page); | |||
59 | EXPORT_SYMBOL(init_level4_pgt); | 59 | EXPORT_SYMBOL(init_level4_pgt); |
60 | EXPORT_SYMBOL(load_gs_index); | 60 | EXPORT_SYMBOL(load_gs_index); |
61 | 61 | ||
62 | EXPORT_SYMBOL(_proxy_pda); | ||
diff --git a/drivers/acpi/events/evmisc.c b/drivers/acpi/events/evmisc.c index 8dcade63b04b..3a799b9b5df5 100644 --- a/drivers/acpi/events/evmisc.c +++ b/drivers/acpi/events/evmisc.c | |||
@@ -549,7 +549,7 @@ acpi_status acpi_ev_release_global_lock(void) | |||
549 | acpi_gbl_global_lock_acquired = FALSE; | 549 | acpi_gbl_global_lock_acquired = FALSE; |
550 | 550 | ||
551 | /* Release the local GL mutex */ | 551 | /* Release the local GL mutex */ |
552 | acpi_ev_global_lock_thread_id = 0; | 552 | acpi_ev_global_lock_thread_id = NULL; |
553 | acpi_ev_global_lock_acquired = 0; | 553 | acpi_ev_global_lock_acquired = 0; |
554 | acpi_os_release_mutex(acpi_gbl_global_lock_mutex); | 554 | acpi_os_release_mutex(acpi_gbl_global_lock_mutex); |
555 | return_ACPI_STATUS(status); | 555 | return_ACPI_STATUS(status); |
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig index d16b5b0c8b76..7bdbe5a914d0 100644 --- a/drivers/ata/Kconfig +++ b/drivers/ata/Kconfig | |||
@@ -564,7 +564,7 @@ config PATA_IXP4XX_CF | |||
564 | 564 | ||
565 | config PATA_SCC | 565 | config PATA_SCC |
566 | tristate "Toshiba's Cell Reference Set IDE support" | 566 | tristate "Toshiba's Cell Reference Set IDE support" |
567 | depends on PCI && PPC_IBM_CELL_BLADE | 567 | depends on PCI && PPC_CELLEB |
568 | help | 568 | help |
569 | This option enables support for the built-in IDE controller on | 569 | This option enables support for the built-in IDE controller on |
570 | Toshiba Cell Reference Board. | 570 | Toshiba Cell Reference Board. |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 3c1f8830ac8b..bf327d473ce9 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -826,7 +826,7 @@ static u64 ata_id_n_sectors(const u16 *id) | |||
826 | /** | 826 | /** |
827 | * ata_id_to_dma_mode - Identify DMA mode from id block | 827 | * ata_id_to_dma_mode - Identify DMA mode from id block |
828 | * @dev: device to identify | 828 | * @dev: device to identify |
829 | * @mode: mode to assume if we cannot tell | 829 | * @unknown: mode to assume if we cannot tell |
830 | * | 830 | * |
831 | * Set up the timing values for the device based upon the identify | 831 | * Set up the timing values for the device based upon the identify |
832 | * reported values for the DMA mode. This function is used by drivers | 832 | * reported values for the DMA mode. This function is used by drivers |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 7349c3dbf774..361953a50203 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -1625,8 +1625,14 @@ static int ata_eh_reset(struct ata_port *ap, int classify, | |||
1625 | rc = prereset(ap); | 1625 | rc = prereset(ap); |
1626 | if (rc) { | 1626 | if (rc) { |
1627 | if (rc == -ENOENT) { | 1627 | if (rc == -ENOENT) { |
1628 | ata_port_printk(ap, KERN_DEBUG, "port disabled. ignoring.\n"); | 1628 | ata_port_printk(ap, KERN_DEBUG, |
1629 | "port disabled. ignoring.\n"); | ||
1629 | ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; | 1630 | ap->eh_context.i.action &= ~ATA_EH_RESET_MASK; |
1631 | |||
1632 | for (i = 0; i < ATA_MAX_DEVICES; i++) | ||
1633 | classes[i] = ATA_DEV_NONE; | ||
1634 | |||
1635 | rc = 0; | ||
1630 | } else | 1636 | } else |
1631 | ata_port_printk(ap, KERN_ERR, | 1637 | ata_port_printk(ap, KERN_ERR, |
1632 | "prereset failed (errno=%d)\n", rc); | 1638 | "prereset failed (errno=%d)\n", rc); |
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c index 7ef834250a43..55cc293e7487 100644 --- a/drivers/ata/pata_cs5520.c +++ b/drivers/ata/pata_cs5520.c | |||
@@ -208,7 +208,7 @@ static struct ata_port_operations cs5520_port_ops = { | |||
208 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) | 208 | static int __devinit cs5520_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
209 | { | 209 | { |
210 | u8 pcicfg; | 210 | u8 pcicfg; |
211 | void *iomap[5]; | 211 | void __iomem *iomap[5]; |
212 | static struct ata_probe_ent probe[2]; | 212 | static struct ata_probe_ent probe[2]; |
213 | int ports = 0; | 213 | int ports = 0; |
214 | 214 | ||
diff --git a/drivers/ata/pata_ixp4xx_cf.c b/drivers/ata/pata_ixp4xx_cf.c index 9a0523b5c947..c6f0e1927551 100644 --- a/drivers/ata/pata_ixp4xx_cf.c +++ b/drivers/ata/pata_ixp4xx_cf.c | |||
@@ -193,7 +193,7 @@ static __devinit int ixp4xx_pata_probe(struct platform_device *pdev) | |||
193 | 193 | ||
194 | irq = platform_get_irq(pdev, 0); | 194 | irq = platform_get_irq(pdev, 0); |
195 | if (irq) | 195 | if (irq) |
196 | set_irq_type(irq, IRQT_HIGH); | 196 | set_irq_type(irq, IRQT_RISING); |
197 | 197 | ||
198 | /* Setup expansion bus chip selects */ | 198 | /* Setup expansion bus chip selects */ |
199 | *data->cs0_cfg = data->cs0_bits; | 199 | *data->cs0_cfg = data->cs0_bits; |
@@ -232,7 +232,6 @@ static __devexit int ixp4xx_pata_remove(struct platform_device *dev) | |||
232 | struct ata_host *host = platform_get_drvdata(dev); | 232 | struct ata_host *host = platform_get_drvdata(dev); |
233 | 233 | ||
234 | ata_host_detach(host); | 234 | ata_host_detach(host); |
235 | platform_set_drvdata(dev, NULL); | ||
236 | 235 | ||
237 | return 0; | 236 | return 0; |
238 | } | 237 | } |
diff --git a/drivers/ata/pata_mpc52xx.c b/drivers/ata/pata_mpc52xx.c index f5d88729ca79..882c36eaf293 100644 --- a/drivers/ata/pata_mpc52xx.c +++ b/drivers/ata/pata_mpc52xx.c | |||
@@ -329,7 +329,7 @@ mpc52xx_ata_init_one(struct device *dev, struct mpc52xx_ata_priv *priv) | |||
329 | ae->dev = dev; | 329 | ae->dev = dev; |
330 | ae->irq = priv->ata_irq; | 330 | ae->irq = priv->ata_irq; |
331 | 331 | ||
332 | aio->cmd_addr = 0; /* Don't have a classic reg block */ | 332 | aio->cmd_addr = NULL; /* Don't have a classic reg block */ |
333 | aio->altstatus_addr = &priv->ata_regs->tf_control; | 333 | aio->altstatus_addr = &priv->ata_regs->tf_control; |
334 | aio->ctl_addr = &priv->ata_regs->tf_control; | 334 | aio->ctl_addr = &priv->ata_regs->tf_control; |
335 | aio->data_addr = &priv->ata_regs->tf_data; | 335 | aio->data_addr = &priv->ata_regs->tf_data; |
diff --git a/drivers/ata/sata_inic162x.c b/drivers/ata/sata_inic162x.c index 3193a603d1a1..1e21688bfcf2 100644 --- a/drivers/ata/sata_inic162x.c +++ b/drivers/ata/sata_inic162x.c | |||
@@ -672,10 +672,6 @@ static int inic_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
672 | if (rc) | 672 | if (rc) |
673 | return rc; | 673 | return rc; |
674 | 674 | ||
675 | rc = pci_request_regions(pdev, DRV_NAME); | ||
676 | if (rc) | ||
677 | return rc; | ||
678 | |||
679 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); | 675 | rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME); |
680 | if (rc) | 676 | if (rc) |
681 | return rc; | 677 | return rc; |
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c index 75d961599651..5614df8c1ce2 100644 --- a/drivers/ata/sata_sil24.c +++ b/drivers/ata/sata_sil24.c | |||
@@ -346,6 +346,7 @@ static const struct pci_device_id sil24_pci_tbl[] = { | |||
346 | { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 }, | 346 | { PCI_VDEVICE(CMD, 0x3124), BID_SIL3124 }, |
347 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, | 347 | { PCI_VDEVICE(INTEL, 0x3124), BID_SIL3124 }, |
348 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, | 348 | { PCI_VDEVICE(CMD, 0x3132), BID_SIL3132 }, |
349 | { PCI_VDEVICE(CMD, 0x0242), BID_SIL3132 }, | ||
349 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, | 350 | { PCI_VDEVICE(CMD, 0x3131), BID_SIL3131 }, |
350 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, | 351 | { PCI_VDEVICE(CMD, 0x3531), BID_SIL3131 }, |
351 | 352 | ||
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c index 1879e0cd56aa..a787f0d4a5ba 100644 --- a/drivers/ata/sata_sis.c +++ b/drivers/ata/sata_sis.c | |||
@@ -354,7 +354,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
354 | return -ENOMEM; | 354 | return -ENOMEM; |
355 | 355 | ||
356 | if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { | 356 | if (!(probe_ent->port_flags & SIS_FLAG_CFGSCR)) { |
357 | void *mmio; | 357 | void __iomem *mmio; |
358 | 358 | ||
359 | mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0); | 359 | mmio = pcim_iomap(pdev, SIS_SCR_PCI_BAR, 0); |
360 | if (!mmio) | 360 | if (!mmio) |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 0d7091e2077f..2ad2527cf5b3 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -1177,7 +1177,7 @@ static void __devinit eprom_get_esi(struct atm_dev *dev) | |||
1177 | /*--------------------------------- entries ---------------------------------*/ | 1177 | /*--------------------------------- entries ---------------------------------*/ |
1178 | 1178 | ||
1179 | 1179 | ||
1180 | static int __init zatm_init(struct atm_dev *dev) | 1180 | static int __devinit zatm_init(struct atm_dev *dev) |
1181 | { | 1181 | { |
1182 | struct zatm_dev *zatm_dev; | 1182 | struct zatm_dev *zatm_dev; |
1183 | struct pci_dev *pci_dev; | 1183 | struct pci_dev *pci_dev; |
@@ -1256,7 +1256,7 @@ static int __init zatm_init(struct atm_dev *dev) | |||
1256 | } | 1256 | } |
1257 | 1257 | ||
1258 | 1258 | ||
1259 | static int __init zatm_start(struct atm_dev *dev) | 1259 | static int __devinit zatm_start(struct atm_dev *dev) |
1260 | { | 1260 | { |
1261 | struct zatm_dev *zatm_dev = ZATM_DEV(dev); | 1261 | struct zatm_dev *zatm_dev = ZATM_DEV(dev); |
1262 | struct pci_dev *pdev = zatm_dev->pci_dev; | 1262 | struct pci_dev *pdev = zatm_dev->pci_dev; |
diff --git a/drivers/base/core.c b/drivers/base/core.c index f191afe62b4d..ad0f4a2f25c4 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -407,6 +407,35 @@ void device_remove_bin_file(struct device *dev, struct bin_attribute *attr) | |||
407 | } | 407 | } |
408 | EXPORT_SYMBOL_GPL(device_remove_bin_file); | 408 | EXPORT_SYMBOL_GPL(device_remove_bin_file); |
409 | 409 | ||
410 | /** | ||
411 | * device_schedule_callback - helper to schedule a callback for a device | ||
412 | * @dev: device. | ||
413 | * @func: callback function to invoke later. | ||
414 | * | ||
415 | * Attribute methods must not unregister themselves or their parent device | ||
416 | * (which would amount to the same thing). Attempts to do so will deadlock, | ||
417 | * since unregistration is mutually exclusive with driver callbacks. | ||
418 | * | ||
419 | * Instead methods can call this routine, which will attempt to allocate | ||
420 | * and schedule a workqueue request to call back @func with @dev as its | ||
421 | * argument in the workqueue's process context. @dev will be pinned until | ||
422 | * @func returns. | ||
423 | * | ||
424 | * Returns 0 if the request was submitted, -ENOMEM if storage could not | ||
425 | * be allocated. | ||
426 | * | ||
427 | * NOTE: This routine won't work if CONFIG_SYSFS isn't set! It uses an | ||
428 | * underlying sysfs routine (since it is intended for use by attribute | ||
429 | * methods), and if sysfs isn't available you'll get nothing but -ENOSYS. | ||
430 | */ | ||
431 | int device_schedule_callback(struct device *dev, | ||
432 | void (*func)(struct device *)) | ||
433 | { | ||
434 | return sysfs_schedule_callback(&dev->kobj, | ||
435 | (void (*)(void *)) func, dev); | ||
436 | } | ||
437 | EXPORT_SYMBOL_GPL(device_schedule_callback); | ||
438 | |||
410 | static void klist_children_get(struct klist_node *n) | 439 | static void klist_children_get(struct klist_node *n) |
411 | { | 440 | { |
412 | struct device *dev = container_of(n, struct device, knode_parent); | 441 | struct device *dev = container_of(n, struct device, knode_parent); |
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 0c716ee905d7..072e18e6d76d 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1439,7 +1439,7 @@ static int rebuild_lun_table(ctlr_info_t *h, struct gendisk *del_disk) | |||
1439 | 1439 | ||
1440 | if (return_code == IO_OK) { | 1440 | if (return_code == IO_OK) { |
1441 | listlength = | 1441 | listlength = |
1442 | be32_to_cpu(*(__u32 *) ld_buff->LUNListLength); | 1442 | be32_to_cpu(*(__be32 *) ld_buff->LUNListLength); |
1443 | } else { /* reading number of logical volumes failed */ | 1443 | } else { /* reading number of logical volumes failed */ |
1444 | printk(KERN_WARNING "cciss: report logical volume" | 1444 | printk(KERN_WARNING "cciss: report logical volume" |
1445 | " command failed\n"); | 1445 | " command failed\n"); |
@@ -1961,8 +1961,8 @@ cciss_read_capacity(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1961 | ctlr, buf, sizeof(ReadCapdata_struct), | 1961 | ctlr, buf, sizeof(ReadCapdata_struct), |
1962 | 1, logvol, 0, NULL, TYPE_CMD); | 1962 | 1, logvol, 0, NULL, TYPE_CMD); |
1963 | if (return_code == IO_OK) { | 1963 | if (return_code == IO_OK) { |
1964 | *total_size = be32_to_cpu(*(__u32 *) buf->total_size); | 1964 | *total_size = be32_to_cpu(*(__be32 *) buf->total_size); |
1965 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 1965 | *block_size = be32_to_cpu(*(__be32 *) buf->block_size); |
1966 | } else { /* read capacity command failed */ | 1966 | } else { /* read capacity command failed */ |
1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 1967 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
1968 | *total_size = 0; | 1968 | *total_size = 0; |
@@ -1997,8 +1997,8 @@ cciss_read_capacity_16(int ctlr, int logvol, int withirq, sector_t *total_size, | |||
1997 | 1, logvol, 0, NULL, TYPE_CMD); | 1997 | 1, logvol, 0, NULL, TYPE_CMD); |
1998 | } | 1998 | } |
1999 | if (return_code == IO_OK) { | 1999 | if (return_code == IO_OK) { |
2000 | *total_size = be64_to_cpu(*(__u64 *) buf->total_size); | 2000 | *total_size = be64_to_cpu(*(__be64 *) buf->total_size); |
2001 | *block_size = be32_to_cpu(*(__u32 *) buf->block_size); | 2001 | *block_size = be32_to_cpu(*(__be32 *) buf->block_size); |
2002 | } else { /* read capacity command failed */ | 2002 | } else { /* read capacity command failed */ |
2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); | 2003 | printk(KERN_WARNING "cciss: read capacity failed\n"); |
2004 | *total_size = 0; | 2004 | *total_size = 0; |
diff --git a/drivers/block/paride/pd.c b/drivers/block/paride/pd.c index 99e2c8ce1cc4..31e01488eb51 100644 --- a/drivers/block/paride/pd.c +++ b/drivers/block/paride/pd.c | |||
@@ -663,11 +663,11 @@ static enum action pd_identify(struct pd_unit *disk) | |||
663 | return Fail; | 663 | return Fail; |
664 | pi_read_block(disk->pi, pd_scratch, 512); | 664 | pi_read_block(disk->pi, pd_scratch, 512); |
665 | disk->can_lba = pd_scratch[99] & 2; | 665 | disk->can_lba = pd_scratch[99] & 2; |
666 | disk->sectors = le16_to_cpu(*(u16 *) (pd_scratch + 12)); | 666 | disk->sectors = le16_to_cpu(*(__le16 *) (pd_scratch + 12)); |
667 | disk->heads = le16_to_cpu(*(u16 *) (pd_scratch + 6)); | 667 | disk->heads = le16_to_cpu(*(__le16 *) (pd_scratch + 6)); |
668 | disk->cylinders = le16_to_cpu(*(u16 *) (pd_scratch + 2)); | 668 | disk->cylinders = le16_to_cpu(*(__le16 *) (pd_scratch + 2)); |
669 | if (disk->can_lba) | 669 | if (disk->can_lba) |
670 | disk->capacity = le32_to_cpu(*(u32 *) (pd_scratch + 120)); | 670 | disk->capacity = le32_to_cpu(*(__le32 *) (pd_scratch + 120)); |
671 | else | 671 | else |
672 | disk->capacity = disk->sectors * disk->heads * disk->cylinders; | 672 | disk->capacity = disk->sectors * disk->heads * disk->cylinders; |
673 | 673 | ||
diff --git a/drivers/char/lcd.c b/drivers/char/lcd.c index 5f4fdcf7c96e..1f0962616ee5 100644 --- a/drivers/char/lcd.c +++ b/drivers/char/lcd.c | |||
@@ -11,9 +11,6 @@ | |||
11 | * March 2001: Ported from 2.0.34 by Liam Davies | 11 | * March 2001: Ported from 2.0.34 by Liam Davies |
12 | * | 12 | * |
13 | */ | 13 | */ |
14 | |||
15 | #define RTC_IO_EXTENT 0x10 /*Only really two ports, but... */ | ||
16 | |||
17 | #include <linux/types.h> | 14 | #include <linux/types.h> |
18 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
19 | #include <linux/miscdevice.h> | 16 | #include <linux/miscdevice.h> |
@@ -32,8 +29,6 @@ | |||
32 | 29 | ||
33 | #include "lcd.h" | 30 | #include "lcd.h" |
34 | 31 | ||
35 | static DEFINE_SPINLOCK(lcd_lock); | ||
36 | |||
37 | static int lcd_ioctl(struct inode *inode, struct file *file, | 32 | static int lcd_ioctl(struct inode *inode, struct file *file, |
38 | unsigned int cmd, unsigned long arg); | 33 | unsigned int cmd, unsigned long arg); |
39 | 34 | ||
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e45326856680..7a32df594907 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -1376,6 +1376,8 @@ static void do_tty_hangup(struct work_struct *work) | |||
1376 | read_unlock(&tasklist_lock); | 1376 | read_unlock(&tasklist_lock); |
1377 | 1377 | ||
1378 | tty->flags = 0; | 1378 | tty->flags = 0; |
1379 | put_pid(tty->session); | ||
1380 | put_pid(tty->pgrp); | ||
1379 | tty->session = NULL; | 1381 | tty->session = NULL; |
1380 | tty->pgrp = NULL; | 1382 | tty->pgrp = NULL; |
1381 | tty->ctrl_status = 0; | 1383 | tty->ctrl_status = 0; |
@@ -3841,6 +3843,9 @@ static struct pid *__proc_set_tty(struct task_struct *tsk, struct tty_struct *tt | |||
3841 | { | 3843 | { |
3842 | struct pid *old_pgrp; | 3844 | struct pid *old_pgrp; |
3843 | if (tty) { | 3845 | if (tty) { |
3846 | /* We should not have a session or pgrp to here but.... */ | ||
3847 | put_pid(tty->session); | ||
3848 | put_pid(tty->pgrp); | ||
3844 | tty->session = get_pid(task_session(tsk)); | 3849 | tty->session = get_pid(task_session(tsk)); |
3845 | tty->pgrp = get_pid(task_pgrp(tsk)); | 3850 | tty->pgrp = get_pid(task_pgrp(tsk)); |
3846 | } | 3851 | } |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index c3f8e383933b..1bbb45b937fd 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -724,6 +724,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ | |||
724 | return -ENOMEM; | 724 | return -ENOMEM; |
725 | memset(vc, 0, sizeof(*vc)); | 725 | memset(vc, 0, sizeof(*vc)); |
726 | vc_cons[currcons].d = vc; | 726 | vc_cons[currcons].d = vc; |
727 | INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); | ||
727 | visual_init(vc, currcons, 1); | 728 | visual_init(vc, currcons, 1); |
728 | if (!*vc->vc_uni_pagedir_loc) | 729 | if (!*vc->vc_uni_pagedir_loc) |
729 | con_set_default_unimap(vc); | 730 | con_set_default_unimap(vc); |
@@ -2185,10 +2186,28 @@ static void console_callback(struct work_struct *ignored) | |||
2185 | release_console_sem(); | 2186 | release_console_sem(); |
2186 | } | 2187 | } |
2187 | 2188 | ||
2188 | void set_console(int nr) | 2189 | int set_console(int nr) |
2189 | { | 2190 | { |
2191 | struct vc_data *vc = vc_cons[fg_console].d; | ||
2192 | |||
2193 | if (!vc_cons_allocated(nr) || vt_dont_switch || | ||
2194 | (vc->vt_mode.mode == VT_AUTO && vc->vc_mode == KD_GRAPHICS)) { | ||
2195 | |||
2196 | /* | ||
2197 | * Console switch will fail in console_callback() or | ||
2198 | * change_console() so there is no point scheduling | ||
2199 | * the callback | ||
2200 | * | ||
2201 | * Existing set_console() users don't check the return | ||
2202 | * value so this shouldn't break anything | ||
2203 | */ | ||
2204 | return -EINVAL; | ||
2205 | } | ||
2206 | |||
2190 | want_console = nr; | 2207 | want_console = nr; |
2191 | schedule_console_callback(); | 2208 | schedule_console_callback(); |
2209 | |||
2210 | return 0; | ||
2192 | } | 2211 | } |
2193 | 2212 | ||
2194 | struct tty_driver *console_driver; | 2213 | struct tty_driver *console_driver; |
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c index 3a5d301e783b..1fa2da8f4fbe 100644 --- a/drivers/char/vt_ioctl.c +++ b/drivers/char/vt_ioctl.c | |||
@@ -34,7 +34,7 @@ | |||
34 | #include <linux/kbd_diacr.h> | 34 | #include <linux/kbd_diacr.h> |
35 | #include <linux/selection.h> | 35 | #include <linux/selection.h> |
36 | 36 | ||
37 | static char vt_dont_switch; | 37 | char vt_dont_switch; |
38 | extern struct tty_driver *console_driver; | 38 | extern struct tty_driver *console_driver; |
39 | 39 | ||
40 | #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) | 40 | #define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) |
diff --git a/drivers/char/watchdog/Kconfig b/drivers/char/watchdog/Kconfig index ea09d0c974ea..e812aa129e28 100644 --- a/drivers/char/watchdog/Kconfig +++ b/drivers/char/watchdog/Kconfig | |||
@@ -301,6 +301,7 @@ config I6300ESB_WDT | |||
301 | config I8XX_TCO | 301 | config I8XX_TCO |
302 | tristate "Intel i8xx TCO Timer/Watchdog" | 302 | tristate "Intel i8xx TCO Timer/Watchdog" |
303 | depends on WATCHDOG && (X86 || IA64) && PCI | 303 | depends on WATCHDOG && (X86 || IA64) && PCI |
304 | default n | ||
304 | ---help--- | 305 | ---help--- |
305 | Hardware driver for the TCO timer built into the Intel 82801 | 306 | Hardware driver for the TCO timer built into the Intel 82801 |
306 | I/O Controller Hub family. The TCO (Total Cost of Ownership) | 307 | I/O Controller Hub family. The TCO (Total Cost of Ownership) |
diff --git a/drivers/char/watchdog/machzwd.c b/drivers/char/watchdog/machzwd.c index 4a328ba0d262..76c7fa37fa6c 100644 --- a/drivers/char/watchdog/machzwd.c +++ b/drivers/char/watchdog/machzwd.c | |||
@@ -314,21 +314,21 @@ static int zf_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | |||
314 | { | 314 | { |
315 | void __user *argp = (void __user *)arg; | 315 | void __user *argp = (void __user *)arg; |
316 | int __user *p = argp; | 316 | int __user *p = argp; |
317 | switch(cmd){ | 317 | switch (cmd) { |
318 | case WDIOC_GETSUPPORT: | 318 | case WDIOC_GETSUPPORT: |
319 | if (copy_to_user(argp, &zf_info, sizeof(zf_info))) | 319 | if (copy_to_user(argp, &zf_info, sizeof(zf_info))) |
320 | return -EFAULT; | 320 | return -EFAULT; |
321 | break; | 321 | break; |
322 | 322 | ||
323 | case WDIOC_GETSTATUS: | 323 | case WDIOC_GETSTATUS: |
324 | return put_user(0, p); | 324 | return put_user(0, p); |
325 | 325 | ||
326 | case WDIOC_KEEPALIVE: | 326 | case WDIOC_KEEPALIVE: |
327 | zf_ping(0); | 327 | zf_ping(0); |
328 | break; | 328 | break; |
329 | 329 | ||
330 | default: | 330 | default: |
331 | return -ENOTTY; | 331 | return -ENOTTY; |
332 | } | 332 | } |
333 | 333 | ||
334 | return 0; | 334 | return 0; |
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 15278044295c..322ee2984e3d 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -176,6 +176,7 @@ void dma_chan_cleanup(struct kref *kref) | |||
176 | chan->client = NULL; | 176 | chan->client = NULL; |
177 | kref_put(&chan->device->refcount, dma_async_device_cleanup); | 177 | kref_put(&chan->device->refcount, dma_async_device_cleanup); |
178 | } | 178 | } |
179 | EXPORT_SYMBOL(dma_chan_cleanup); | ||
179 | 180 | ||
180 | static void dma_chan_free_rcu(struct rcu_head *rcu) | 181 | static void dma_chan_free_rcu(struct rcu_head *rcu) |
181 | { | 182 | { |
@@ -261,6 +262,7 @@ struct dma_client *dma_async_client_register(dma_event_callback event_callback) | |||
261 | 262 | ||
262 | return client; | 263 | return client; |
263 | } | 264 | } |
265 | EXPORT_SYMBOL(dma_async_client_register); | ||
264 | 266 | ||
265 | /** | 267 | /** |
266 | * dma_async_client_unregister - unregister a client and free the &dma_client | 268 | * dma_async_client_unregister - unregister a client and free the &dma_client |
@@ -287,6 +289,7 @@ void dma_async_client_unregister(struct dma_client *client) | |||
287 | kfree(client); | 289 | kfree(client); |
288 | dma_chans_rebalance(); | 290 | dma_chans_rebalance(); |
289 | } | 291 | } |
292 | EXPORT_SYMBOL(dma_async_client_unregister); | ||
290 | 293 | ||
291 | /** | 294 | /** |
292 | * dma_async_client_chan_request - request DMA channels | 295 | * dma_async_client_chan_request - request DMA channels |
@@ -304,6 +307,7 @@ void dma_async_client_chan_request(struct dma_client *client, | |||
304 | client->chans_desired = number; | 307 | client->chans_desired = number; |
305 | dma_chans_rebalance(); | 308 | dma_chans_rebalance(); |
306 | } | 309 | } |
310 | EXPORT_SYMBOL(dma_async_client_chan_request); | ||
307 | 311 | ||
308 | /** | 312 | /** |
309 | * dma_async_device_register - registers DMA devices found | 313 | * dma_async_device_register - registers DMA devices found |
@@ -346,6 +350,7 @@ int dma_async_device_register(struct dma_device *device) | |||
346 | 350 | ||
347 | return 0; | 351 | return 0; |
348 | } | 352 | } |
353 | EXPORT_SYMBOL(dma_async_device_register); | ||
349 | 354 | ||
350 | /** | 355 | /** |
351 | * dma_async_device_cleanup - function called when all references are released | 356 | * dma_async_device_cleanup - function called when all references are released |
@@ -390,23 +395,12 @@ void dma_async_device_unregister(struct dma_device *device) | |||
390 | kref_put(&device->refcount, dma_async_device_cleanup); | 395 | kref_put(&device->refcount, dma_async_device_cleanup); |
391 | wait_for_completion(&device->done); | 396 | wait_for_completion(&device->done); |
392 | } | 397 | } |
398 | EXPORT_SYMBOL(dma_async_device_unregister); | ||
393 | 399 | ||
394 | static int __init dma_bus_init(void) | 400 | static int __init dma_bus_init(void) |
395 | { | 401 | { |
396 | mutex_init(&dma_list_mutex); | 402 | mutex_init(&dma_list_mutex); |
397 | return class_register(&dma_devclass); | 403 | return class_register(&dma_devclass); |
398 | } | 404 | } |
399 | |||
400 | subsys_initcall(dma_bus_init); | 405 | subsys_initcall(dma_bus_init); |
401 | 406 | ||
402 | EXPORT_SYMBOL(dma_async_client_register); | ||
403 | EXPORT_SYMBOL(dma_async_client_unregister); | ||
404 | EXPORT_SYMBOL(dma_async_client_chan_request); | ||
405 | EXPORT_SYMBOL(dma_async_memcpy_buf_to_buf); | ||
406 | EXPORT_SYMBOL(dma_async_memcpy_buf_to_pg); | ||
407 | EXPORT_SYMBOL(dma_async_memcpy_pg_to_pg); | ||
408 | EXPORT_SYMBOL(dma_async_memcpy_complete); | ||
409 | EXPORT_SYMBOL(dma_async_memcpy_issue_pending); | ||
410 | EXPORT_SYMBOL(dma_async_device_register); | ||
411 | EXPORT_SYMBOL(dma_async_device_unregister); | ||
412 | EXPORT_SYMBOL(dma_chan_cleanup); | ||
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c index f4ee1afe488f..67f3347afcf3 100644 --- a/drivers/hid/hid-core.c +++ b/drivers/hid/hid-core.c | |||
@@ -26,6 +26,7 @@ | |||
26 | #include <asm/byteorder.h> | 26 | #include <asm/byteorder.h> |
27 | #include <linux/input.h> | 27 | #include <linux/input.h> |
28 | #include <linux/wait.h> | 28 | #include <linux/wait.h> |
29 | #include <linux/vmalloc.h> | ||
29 | 30 | ||
30 | #include <linux/hid.h> | 31 | #include <linux/hid.h> |
31 | #include <linux/hiddev.h> | 32 | #include <linux/hiddev.h> |
@@ -654,12 +655,13 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
654 | memcpy(device->rdesc, start, size); | 655 | memcpy(device->rdesc, start, size); |
655 | device->rsize = size; | 656 | device->rsize = size; |
656 | 657 | ||
657 | if (!(parser = kzalloc(sizeof(struct hid_parser), GFP_KERNEL))) { | 658 | if (!(parser = vmalloc(sizeof(struct hid_parser)))) { |
658 | kfree(device->rdesc); | 659 | kfree(device->rdesc); |
659 | kfree(device->collection); | 660 | kfree(device->collection); |
660 | kfree(device); | 661 | kfree(device); |
661 | return NULL; | 662 | return NULL; |
662 | } | 663 | } |
664 | memset(parser, 0, sizeof(struct hid_parser)); | ||
663 | parser->device = device; | 665 | parser->device = device; |
664 | 666 | ||
665 | end = start + size; | 667 | end = start + size; |
@@ -668,7 +670,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
668 | if (item.format != HID_ITEM_FORMAT_SHORT) { | 670 | if (item.format != HID_ITEM_FORMAT_SHORT) { |
669 | dbg("unexpected long global item"); | 671 | dbg("unexpected long global item"); |
670 | hid_free_device(device); | 672 | hid_free_device(device); |
671 | kfree(parser); | 673 | vfree(parser); |
672 | return NULL; | 674 | return NULL; |
673 | } | 675 | } |
674 | 676 | ||
@@ -676,7 +678,7 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
676 | dbg("item %u %u %u %u parsing failed\n", | 678 | dbg("item %u %u %u %u parsing failed\n", |
677 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); | 679 | item.format, (unsigned)item.size, (unsigned)item.type, (unsigned)item.tag); |
678 | hid_free_device(device); | 680 | hid_free_device(device); |
679 | kfree(parser); | 681 | vfree(parser); |
680 | return NULL; | 682 | return NULL; |
681 | } | 683 | } |
682 | 684 | ||
@@ -684,23 +686,23 @@ struct hid_device *hid_parse_report(__u8 *start, unsigned size) | |||
684 | if (parser->collection_stack_ptr) { | 686 | if (parser->collection_stack_ptr) { |
685 | dbg("unbalanced collection at end of report description"); | 687 | dbg("unbalanced collection at end of report description"); |
686 | hid_free_device(device); | 688 | hid_free_device(device); |
687 | kfree(parser); | 689 | vfree(parser); |
688 | return NULL; | 690 | return NULL; |
689 | } | 691 | } |
690 | if (parser->local.delimiter_depth) { | 692 | if (parser->local.delimiter_depth) { |
691 | dbg("unbalanced delimiter at end of report description"); | 693 | dbg("unbalanced delimiter at end of report description"); |
692 | hid_free_device(device); | 694 | hid_free_device(device); |
693 | kfree(parser); | 695 | vfree(parser); |
694 | return NULL; | 696 | return NULL; |
695 | } | 697 | } |
696 | kfree(parser); | 698 | vfree(parser); |
697 | return device; | 699 | return device; |
698 | } | 700 | } |
699 | } | 701 | } |
700 | 702 | ||
701 | dbg("item fetching failed at offset %d\n", (int)(end - start)); | 703 | dbg("item fetching failed at offset %d\n", (int)(end - start)); |
702 | hid_free_device(device); | 704 | hid_free_device(device); |
703 | kfree(parser); | 705 | vfree(parser); |
704 | return NULL; | 706 | return NULL; |
705 | } | 707 | } |
706 | EXPORT_SYMBOL_GPL(hid_parse_report); | 708 | EXPORT_SYMBOL_GPL(hid_parse_report); |
@@ -753,8 +755,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | |||
753 | 755 | ||
754 | report += offset >> 3; /* adjust byte index */ | 756 | report += offset >> 3; /* adjust byte index */ |
755 | offset &= 7; /* now only need bit offset into one byte */ | 757 | offset &= 7; /* now only need bit offset into one byte */ |
756 | x = get_unaligned((u64 *) report); | 758 | x = le64_to_cpu(get_unaligned((__le64 *) report)); |
757 | x = le64_to_cpu(x); | ||
758 | x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ | 759 | x = (x >> offset) & ((1ULL << n) - 1); /* extract bit field */ |
759 | return (u32) x; | 760 | return (u32) x; |
760 | } | 761 | } |
@@ -769,7 +770,7 @@ static __inline__ __u32 extract(__u8 *report, unsigned offset, unsigned n) | |||
769 | */ | 770 | */ |
770 | static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) | 771 | static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u32 value) |
771 | { | 772 | { |
772 | u64 x; | 773 | __le64 x; |
773 | u64 m = (1ULL << n) - 1; | 774 | u64 m = (1ULL << n) - 1; |
774 | 775 | ||
775 | WARN_ON(n > 32); | 776 | WARN_ON(n > 32); |
@@ -780,10 +781,10 @@ static __inline__ void implement(__u8 *report, unsigned offset, unsigned n, __u3 | |||
780 | report += offset >> 3; | 781 | report += offset >> 3; |
781 | offset &= 7; | 782 | offset &= 7; |
782 | 783 | ||
783 | x = get_unaligned((u64 *)report); | 784 | x = get_unaligned((__le64 *)report); |
784 | x &= cpu_to_le64(~(m << offset)); | 785 | x &= cpu_to_le64(~(m << offset)); |
785 | x |= cpu_to_le64(((u64) value) << offset); | 786 | x |= cpu_to_le64(((u64) value) << offset); |
786 | put_unaligned(x, (u64 *) report); | 787 | put_unaligned(x, (__le64 *) report); |
787 | } | 788 | } |
788 | 789 | ||
789 | /* | 790 | /* |
@@ -873,10 +874,6 @@ static void hid_output_field(struct hid_field *field, __u8 *data) | |||
873 | unsigned size = field->report_size; | 874 | unsigned size = field->report_size; |
874 | unsigned n; | 875 | unsigned n; |
875 | 876 | ||
876 | /* make sure the unused bits in the last byte are zeros */ | ||
877 | if (count > 0 && size > 0) | ||
878 | data[(offset+count*size-1)/8] = 0; | ||
879 | |||
880 | for (n = 0; n < count; n++) { | 877 | for (n = 0; n < count; n++) { |
881 | if (field->logical_minimum < 0) /* signed values */ | 878 | if (field->logical_minimum < 0) /* signed values */ |
882 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); | 879 | implement(data, offset + n * size, size, s32ton(field->value[n], size)); |
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index c3d4856fb618..6d105a1d41b1 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -527,6 +527,7 @@ config SENSORS_W83792D | |||
527 | config SENSORS_W83793 | 527 | config SENSORS_W83793 |
528 | tristate "Winbond W83793" | 528 | tristate "Winbond W83793" |
529 | depends on HWMON && I2C && EXPERIMENTAL | 529 | depends on HWMON && I2C && EXPERIMENTAL |
530 | select HWMON_VID | ||
530 | help | 531 | help |
531 | If you say yes here you get support for the Winbond W83793 | 532 | If you say yes here you get support for the Winbond W83793 |
532 | hardware monitoring chip. | 533 | hardware monitoring chip. |
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig index 5d134bb75ba1..8f1fd017679b 100644 --- a/drivers/ide/Kconfig +++ b/drivers/ide/Kconfig | |||
@@ -434,24 +434,8 @@ config BLK_DEV_IDEDMA_FORCED | |||
434 | 434 | ||
435 | Generally say N here. | 435 | Generally say N here. |
436 | 436 | ||
437 | config IDEDMA_PCI_AUTO | ||
438 | bool "Use PCI DMA by default when available" | ||
439 | ---help--- | ||
440 | Prior to kernel version 2.1.112, Linux used to automatically use | ||
441 | DMA for IDE drives and chipsets which support it. Due to concerns | ||
442 | about a couple of cases where buggy hardware may have caused damage, | ||
443 | the default is now to NOT use DMA automatically. To revert to the | ||
444 | previous behaviour, say Y to this question. | ||
445 | |||
446 | If you suspect your hardware is at all flakey, say N here. | ||
447 | Do NOT email the IDE kernel people regarding this issue! | ||
448 | |||
449 | It is normally safe to answer Y to this question unless your | ||
450 | motherboard uses a VIA VP2 chipset, in which case you should say N. | ||
451 | |||
452 | config IDEDMA_ONLYDISK | 437 | config IDEDMA_ONLYDISK |
453 | bool "Enable DMA only for disks " | 438 | bool "Enable DMA only for disks " |
454 | depends on IDEDMA_PCI_AUTO | ||
455 | help | 439 | help |
456 | This is used if you know your ATAPI Devices are going to fail DMA | 440 | This is used if you know your ATAPI Devices are going to fail DMA |
457 | Transfers. | 441 | Transfers. |
@@ -769,6 +753,14 @@ config BLK_DEV_TC86C001 | |||
769 | help | 753 | help |
770 | This driver adds support for Toshiba TC86C001 GOKU-S chip. | 754 | This driver adds support for Toshiba TC86C001 GOKU-S chip. |
771 | 755 | ||
756 | config BLK_DEV_CELLEB | ||
757 | tristate "Toshiba's Cell Reference Set IDE support" | ||
758 | depends on PPC_CELLEB | ||
759 | help | ||
760 | This driver provides support for the built-in IDE controller on | ||
761 | Toshiba Cell Reference Board. | ||
762 | If unsure, say Y. | ||
763 | |||
772 | endif | 764 | endif |
773 | 765 | ||
774 | config BLK_DEV_IDE_PMAC | 766 | config BLK_DEV_IDE_PMAC |
@@ -800,14 +792,6 @@ config BLK_DEV_IDEDMA_PMAC | |||
800 | to transfer data to and from memory. Saying Y is safe and improves | 792 | to transfer data to and from memory. Saying Y is safe and improves |
801 | performance. | 793 | performance. |
802 | 794 | ||
803 | config BLK_DEV_IDE_CELLEB | ||
804 | bool "Toshiba's Cell Reference Set IDE support" | ||
805 | depends on PPC_CELLEB | ||
806 | help | ||
807 | This driver provides support for the built-in IDE controller on | ||
808 | Toshiba Cell Reference Board. | ||
809 | If unsure, say Y. | ||
810 | |||
811 | config BLK_DEV_IDE_SWARM | 795 | config BLK_DEV_IDE_SWARM |
812 | tristate "IDE for Sibyte evaluation boards" | 796 | tristate "IDE for Sibyte evaluation boards" |
813 | depends on SIBYTE_SB1xxx_SOC | 797 | depends on SIBYTE_SB1xxx_SOC |
@@ -851,19 +835,6 @@ config BLK_DEV_IDEDMA_ICS | |||
851 | Say Y here if you want to add DMA (Direct Memory Access) support to | 835 | Say Y here if you want to add DMA (Direct Memory Access) support to |
852 | the ICS IDE driver. | 836 | the ICS IDE driver. |
853 | 837 | ||
854 | config IDEDMA_ICS_AUTO | ||
855 | bool "Use ICS DMA by default" | ||
856 | depends on BLK_DEV_IDEDMA_ICS | ||
857 | help | ||
858 | Prior to kernel version 2.1.112, Linux used to automatically use | ||
859 | DMA for IDE drives and chipsets which support it. Due to concerns | ||
860 | about a couple of cases where buggy hardware may have caused damage, | ||
861 | the default is now to NOT use DMA automatically. To revert to the | ||
862 | previous behaviour, say Y to this question. | ||
863 | |||
864 | If you suspect your hardware is at all flakey, say N here. | ||
865 | Do NOT email the IDE kernel people regarding this issue! | ||
866 | |||
867 | config BLK_DEV_IDE_RAPIDE | 838 | config BLK_DEV_IDE_RAPIDE |
868 | tristate "RapIDE interface support" | 839 | tristate "RapIDE interface support" |
869 | depends on ARM && ARCH_ACORN | 840 | depends on ARM && ARCH_ACORN |
@@ -1086,9 +1057,6 @@ config IDEDMA_IVB | |||
1086 | 1057 | ||
1087 | It is normally safe to answer Y; however, the default is N. | 1058 | It is normally safe to answer Y; however, the default is N. |
1088 | 1059 | ||
1089 | config IDEDMA_AUTO | ||
1090 | def_bool IDEDMA_PCI_AUTO || IDEDMA_ICS_AUTO | ||
1091 | |||
1092 | endif | 1060 | endif |
1093 | 1061 | ||
1094 | config BLK_DEV_HD_ONLY | 1062 | config BLK_DEV_HD_ONLY |
diff --git a/drivers/ide/Makefile b/drivers/ide/Makefile index 28feedfbd21d..d9f029e8ff74 100644 --- a/drivers/ide/Makefile +++ b/drivers/ide/Makefile | |||
@@ -37,7 +37,6 @@ ide-core-$(CONFIG_BLK_DEV_Q40IDE) += legacy/q40ide.o | |||
37 | # built-in only drivers from ppc/ | 37 | # built-in only drivers from ppc/ |
38 | ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o | 38 | ide-core-$(CONFIG_BLK_DEV_MPC8xx_IDE) += ppc/mpc8xx.o |
39 | ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o | 39 | ide-core-$(CONFIG_BLK_DEV_IDE_PMAC) += ppc/pmac.o |
40 | ide-core-$(CONFIG_BLK_DEV_IDE_CELLEB) += ppc/scc_pata.o | ||
41 | 40 | ||
42 | # built-in only drivers from h8300/ | 41 | # built-in only drivers from h8300/ |
43 | ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o | 42 | ide-core-$(CONFIG_H8300) += h8300/ide-h8300.o |
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index 40e5c66b81ce..e2953fc1fafb 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -196,11 +196,6 @@ static void icside_maskproc(ide_drive_t *drive, int mask) | |||
196 | } | 196 | } |
197 | 197 | ||
198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS | 198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS |
199 | |||
200 | #ifndef CONFIG_IDEDMA_ICS_AUTO | ||
201 | #warning CONFIG_IDEDMA_ICS_AUTO=n support is obsolete, and will be removed soon. | ||
202 | #endif | ||
203 | |||
204 | /* | 199 | /* |
205 | * SG-DMA support. | 200 | * SG-DMA support. |
206 | * | 201 | * |
@@ -474,12 +469,6 @@ static int icside_dma_lostirq(ide_drive_t *drive) | |||
474 | 469 | ||
475 | static void icside_dma_init(ide_hwif_t *hwif) | 470 | static void icside_dma_init(ide_hwif_t *hwif) |
476 | { | 471 | { |
477 | int autodma = 0; | ||
478 | |||
479 | #ifdef CONFIG_IDEDMA_ICS_AUTO | ||
480 | autodma = 1; | ||
481 | #endif | ||
482 | |||
483 | printk(" %s: SG-DMA", hwif->name); | 472 | printk(" %s: SG-DMA", hwif->name); |
484 | 473 | ||
485 | hwif->atapi_dma = 1; | 474 | hwif->atapi_dma = 1; |
@@ -489,7 +478,7 @@ static void icside_dma_init(ide_hwif_t *hwif) | |||
489 | hwif->dmatable_cpu = NULL; | 478 | hwif->dmatable_cpu = NULL; |
490 | hwif->dmatable_dma = 0; | 479 | hwif->dmatable_dma = 0; |
491 | hwif->speedproc = icside_set_speed; | 480 | hwif->speedproc = icside_set_speed; |
492 | hwif->autodma = autodma; | 481 | hwif->autodma = 1; |
493 | 482 | ||
494 | hwif->ide_dma_check = icside_dma_check; | 483 | hwif->ide_dma_check = icside_dma_check; |
495 | hwif->dma_host_off = icside_dma_host_off; | 484 | hwif->dma_host_off = icside_dma_host_off; |
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c index 08e7cd043bcc..fd213088b06b 100644 --- a/drivers/ide/ide-dma.c +++ b/drivers/ide/ide-dma.c | |||
@@ -767,7 +767,7 @@ int ide_set_dma(ide_drive_t *drive) | |||
767 | switch(rc) { | 767 | switch(rc) { |
768 | case -1: /* DMA needs to be disabled */ | 768 | case -1: /* DMA needs to be disabled */ |
769 | hwif->dma_off_quietly(drive); | 769 | hwif->dma_off_quietly(drive); |
770 | return 0; | 770 | return -1; |
771 | case 0: /* DMA needs to be enabled */ | 771 | case 0: /* DMA needs to be enabled */ |
772 | return hwif->ide_dma_on(drive); | 772 | return hwif->ide_dma_on(drive); |
773 | case 1: /* DMA setting cannot be changed */ | 773 | case 1: /* DMA setting cannot be changed */ |
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index dfbd74458522..695610f0e3e4 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c | |||
@@ -177,11 +177,7 @@ DECLARE_MUTEX(ide_cfg_sem); | |||
177 | static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ | 177 | static int ide_scan_direction; /* THIS was formerly 2.2.x pci=reverse */ |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | #ifdef CONFIG_IDEDMA_AUTO | ||
181 | int noautodma = 0; | 180 | int noautodma = 0; |
182 | #else | ||
183 | int noautodma = 1; | ||
184 | #endif | ||
185 | 181 | ||
186 | EXPORT_SYMBOL(noautodma); | 182 | EXPORT_SYMBOL(noautodma); |
187 | 183 | ||
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index b2dc028dc8ca..d54d9fe92a7d 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -639,6 +639,7 @@ static int au_ide_probe(struct device *dev) | |||
639 | _auide_hwif *ahwif = &auide_hwif; | 639 | _auide_hwif *ahwif = &auide_hwif; |
640 | ide_hwif_t *hwif; | 640 | ide_hwif_t *hwif; |
641 | struct resource *res; | 641 | struct resource *res; |
642 | hw_regs_t *hw; | ||
642 | int ret = 0; | 643 | int ret = 0; |
643 | 644 | ||
644 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) | 645 | #if defined(CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA) |
@@ -681,7 +682,7 @@ static int au_ide_probe(struct device *dev) | |||
681 | /* FIXME: This might possibly break PCMCIA IDE devices */ | 682 | /* FIXME: This might possibly break PCMCIA IDE devices */ |
682 | 683 | ||
683 | hwif = &ide_hwifs[pdev->id]; | 684 | hwif = &ide_hwifs[pdev->id]; |
684 | hw_regs_t *hw = &hwif->hw; | 685 | hw = &hwif->hw; |
685 | hwif->irq = hw->irq = ahwif->irq; | 686 | hwif->irq = hw->irq = ahwif->irq; |
686 | hwif->chipset = ide_au1xxx; | 687 | hwif->chipset = ide_au1xxx; |
687 | 688 | ||
diff --git a/drivers/ide/pci/Makefile b/drivers/ide/pci/Makefile index 6591ff4753cb..95d1ea8f1f14 100644 --- a/drivers/ide/pci/Makefile +++ b/drivers/ide/pci/Makefile | |||
@@ -3,6 +3,7 @@ obj-$(CONFIG_BLK_DEV_AEC62XX) += aec62xx.o | |||
3 | obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o | 3 | obj-$(CONFIG_BLK_DEV_ALI15X3) += alim15x3.o |
4 | obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o | 4 | obj-$(CONFIG_BLK_DEV_AMD74XX) += amd74xx.o |
5 | obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o | 5 | obj-$(CONFIG_BLK_DEV_ATIIXP) += atiixp.o |
6 | obj-$(CONFIG_BLK_DEV_CELLEB) += scc_pata.o | ||
6 | obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o | 7 | obj-$(CONFIG_BLK_DEV_CMD64X) += cmd64x.o |
7 | obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o | 8 | obj-$(CONFIG_BLK_DEV_CS5520) += cs5520.o |
8 | obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o | 9 | obj-$(CONFIG_BLK_DEV_CS5530) += cs5530.o |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index b0d4825c56a9..561197f7b5bb 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 | 1 | /* $Id: cmd64x.c,v 1.21 2000/01/30 23:23:16 |
2 | * | 2 | * |
3 | * linux/drivers/ide/pci/cmd64x.c Version 1.41 Feb 3, 2007 | 3 | * linux/drivers/ide/pci/cmd64x.c Version 1.42 Feb 8, 2007 |
4 | * | 4 | * |
5 | * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. | 5 | * cmd64x.c: Enable interrupts at initialization time on Ultra/PCI machines. |
6 | * Note, this driver is not used at all on other systems because | 6 | * Note, this driver is not used at all on other systems because |
@@ -189,6 +189,11 @@ static int cmd64x_get_info (char *buffer, char **addr, off_t offset, int count) | |||
189 | 189 | ||
190 | #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ | 190 | #endif /* defined(DISPLAY_CMD64X_TIMINGS) && defined(CONFIG_PROC_FS) */ |
191 | 191 | ||
192 | static u8 quantize_timing(int timing, int quant) | ||
193 | { | ||
194 | return (timing + quant - 1) / quant; | ||
195 | } | ||
196 | |||
192 | /* | 197 | /* |
193 | * This routine writes the prepared setup/active/recovery counts | 198 | * This routine writes the prepared setup/active/recovery counts |
194 | * for a drive into the cmd646 chipset registers to active them. | 199 | * for a drive into the cmd646 chipset registers to active them. |
@@ -268,47 +273,37 @@ static void program_drive_counts (ide_drive_t *drive, int setup_count, int activ | |||
268 | */ | 273 | */ |
269 | static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) | 274 | static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted) |
270 | { | 275 | { |
271 | int setup_time, active_time, recovery_time; | 276 | int setup_time, active_time, cycle_time; |
272 | int clock_time, pio_mode, cycle_time; | 277 | u8 cycle_count, setup_count, active_count, recovery_count; |
273 | u8 recovery_count2, cycle_count; | 278 | u8 pio_mode; |
274 | int setup_count, active_count, recovery_count; | 279 | int clock_time = 1000 / system_bus_clock(); |
275 | int bus_speed = system_bus_clock(); | 280 | ide_pio_data_t pio; |
276 | ide_pio_data_t d; | ||
277 | 281 | ||
278 | pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &d); | 282 | pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio); |
279 | cycle_time = d.cycle_time; | 283 | cycle_time = pio.cycle_time; |
280 | 284 | ||
281 | /* | ||
282 | * I copied all this complicated stuff from cmd640.c and made a few | ||
283 | * minor changes. For now I am just going to pray that it is correct. | ||
284 | */ | ||
285 | setup_time = ide_pio_timings[pio_mode].setup_time; | 285 | setup_time = ide_pio_timings[pio_mode].setup_time; |
286 | active_time = ide_pio_timings[pio_mode].active_time; | 286 | active_time = ide_pio_timings[pio_mode].active_time; |
287 | recovery_time = cycle_time - (setup_time + active_time); | ||
288 | clock_time = 1000 / bus_speed; | ||
289 | cycle_count = (cycle_time + clock_time - 1) / clock_time; | ||
290 | |||
291 | setup_count = (setup_time + clock_time - 1) / clock_time; | ||
292 | 287 | ||
293 | active_count = (active_time + clock_time - 1) / clock_time; | 288 | setup_count = quantize_timing( setup_time, clock_time); |
289 | cycle_count = quantize_timing( cycle_time, clock_time); | ||
290 | active_count = quantize_timing(active_time, clock_time); | ||
294 | 291 | ||
295 | recovery_count = (recovery_time + clock_time - 1) / clock_time; | 292 | recovery_count = cycle_count - active_count; |
296 | recovery_count2 = cycle_count - (setup_count + active_count); | 293 | /* program_drive_counts() takes care of zero recovery cycles */ |
297 | if (recovery_count2 > recovery_count) | ||
298 | recovery_count = recovery_count2; | ||
299 | if (recovery_count > 16) { | 294 | if (recovery_count > 16) { |
300 | active_count += recovery_count - 16; | 295 | active_count += recovery_count - 16; |
301 | recovery_count = 16; | 296 | recovery_count = 16; |
302 | } | 297 | } |
303 | if (active_count > 16) | 298 | if (active_count > 16) |
304 | active_count = 16; /* maximum allowed by cmd646 */ | 299 | active_count = 16; /* maximum allowed by cmd64x */ |
305 | 300 | ||
306 | program_drive_counts (drive, setup_count, active_count, recovery_count); | 301 | program_drive_counts (drive, setup_count, active_count, recovery_count); |
307 | 302 | ||
308 | cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " | 303 | cmdprintk("%s: PIO mode wanted %d, selected %d (%dns)%s, " |
309 | "clocks=%d/%d/%d\n", | 304 | "clocks=%d/%d/%d\n", |
310 | drive->name, mode_wanted, pio_mode, cycle_time, | 305 | drive->name, mode_wanted, pio_mode, cycle_time, |
311 | d.overridden ? " (overriding vendor mode)" : "", | 306 | pio.overridden ? " (overriding vendor mode)" : "", |
312 | setup_count, active_count, recovery_count); | 307 | setup_count, active_count, recovery_count); |
313 | 308 | ||
314 | return pio_mode; | 309 | return pio_mode; |
diff --git a/drivers/ide/pci/jmicron.c b/drivers/ide/pci/jmicron.c index 53f25500c22b..be4fc96c29e0 100644 --- a/drivers/ide/pci/jmicron.c +++ b/drivers/ide/pci/jmicron.c | |||
@@ -240,12 +240,31 @@ static int __devinit jmicron_init_one(struct pci_dev *dev, const struct pci_devi | |||
240 | return 0; | 240 | return 0; |
241 | } | 241 | } |
242 | 242 | ||
243 | /* If libata is configured, jmicron PCI quirk will configure it such | ||
244 | * that the SATA ports are in AHCI function while the PATA ports are | ||
245 | * in a separate IDE function. In such cases, match device class and | ||
246 | * attach only to IDE. If libata isn't configured, keep the old | ||
247 | * behavior for backward compatibility. | ||
248 | */ | ||
249 | #if defined(CONFIG_ATA) || defined(CONFIG_ATA_MODULE) | ||
250 | #define JMB_CLASS PCI_CLASS_STORAGE_IDE << 8 | ||
251 | #define JMB_CLASS_MASK 0xffff00 | ||
252 | #else | ||
253 | #define JMB_CLASS 0 | ||
254 | #define JMB_CLASS_MASK 0 | ||
255 | #endif | ||
256 | |||
243 | static struct pci_device_id jmicron_pci_tbl[] = { | 257 | static struct pci_device_id jmicron_pci_tbl[] = { |
244 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 258 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB361, |
245 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1}, | 259 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 0}, |
246 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 2}, | 260 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB363, |
247 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 3}, | 261 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 1}, |
248 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 4}, | 262 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB365, |
263 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 2}, | ||
264 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB366, | ||
265 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 3}, | ||
266 | { PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB368, | ||
267 | PCI_ANY_ID, PCI_ANY_ID, JMB_CLASS, JMB_CLASS_MASK, 4}, | ||
249 | { 0, }, | 268 | { 0, }, |
250 | }; | 269 | }; |
251 | 270 | ||
diff --git a/drivers/ide/ppc/scc_pata.c b/drivers/ide/pci/scc_pata.c index f84bf791f72e..f84bf791f72e 100644 --- a/drivers/ide/ppc/scc_pata.c +++ b/drivers/ide/pci/scc_pata.c | |||
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index a52c80fe7d3e..118fb3205ca8 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -505,11 +505,6 @@ static void ide_hwif_setup_dma(struct pci_dev *dev, ide_pci_device_t *d, ide_hwi | |||
505 | } | 505 | } |
506 | } | 506 | } |
507 | } | 507 | } |
508 | |||
509 | #ifndef CONFIG_IDEDMA_PCI_AUTO | ||
510 | #warning CONFIG_IDEDMA_PCI_AUTO=n support is obsolete, and will be removed soon. | ||
511 | #endif | ||
512 | |||
513 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ | 508 | #endif /* CONFIG_BLK_DEV_IDEDMA_PCI*/ |
514 | 509 | ||
515 | /** | 510 | /** |
diff --git a/drivers/infiniband/hw/ipath/ipath_dma.c b/drivers/infiniband/hw/ipath/ipath_dma.c index f6f949040825..f87f003e3ef8 100644 --- a/drivers/infiniband/hw/ipath/ipath_dma.c +++ b/drivers/infiniband/hw/ipath/ipath_dma.c | |||
@@ -167,7 +167,7 @@ static void *ipath_dma_alloc_coherent(struct ib_device *dev, size_t size, | |||
167 | } | 167 | } |
168 | 168 | ||
169 | static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, | 169 | static void ipath_dma_free_coherent(struct ib_device *dev, size_t size, |
170 | void *cpu_addr, dma_addr_t dma_handle) | 170 | void *cpu_addr, u64 dma_handle) |
171 | { | 171 | { |
172 | free_pages((unsigned long) cpu_addr, get_order(size)); | 172 | free_pages((unsigned long) cpu_addr, get_order(size)); |
173 | } | 173 | } |
diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c index a163bca38973..dc7a8c78cbf9 100644 --- a/drivers/kvm/kvm_main.c +++ b/drivers/kvm/kvm_main.c | |||
@@ -2464,7 +2464,7 @@ int kvm_init_arch(struct kvm_arch_ops *ops, struct module *module) | |||
2464 | 2464 | ||
2465 | r = kvm_arch_ops->hardware_setup(); | 2465 | r = kvm_arch_ops->hardware_setup(); |
2466 | if (r < 0) | 2466 | if (r < 0) |
2467 | return r; | 2467 | goto out; |
2468 | 2468 | ||
2469 | on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); | 2469 | on_each_cpu(kvm_arch_ops->hardware_enable, NULL, 0, 1); |
2470 | r = register_cpu_notifier(&kvm_cpu_notifier); | 2470 | r = register_cpu_notifier(&kvm_cpu_notifier); |
@@ -2500,6 +2500,8 @@ out_free_2: | |||
2500 | out_free_1: | 2500 | out_free_1: |
2501 | on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); | 2501 | on_each_cpu(kvm_arch_ops->hardware_disable, NULL, 0, 1); |
2502 | kvm_arch_ops->hardware_unsetup(); | 2502 | kvm_arch_ops->hardware_unsetup(); |
2503 | out: | ||
2504 | kvm_arch_ops = NULL; | ||
2503 | return r; | 2505 | return r; |
2504 | } | 2506 | } |
2505 | 2507 | ||
diff --git a/drivers/kvm/mmu.c b/drivers/kvm/mmu.c index a1a93368f314..e85b4c7c36f7 100644 --- a/drivers/kvm/mmu.c +++ b/drivers/kvm/mmu.c | |||
@@ -131,7 +131,7 @@ static int dbg = 1; | |||
131 | (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) | 131 | (((address) >> PT32_LEVEL_SHIFT(level)) & ((1 << PT32_LEVEL_BITS) - 1)) |
132 | 132 | ||
133 | 133 | ||
134 | #define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & PAGE_MASK) | 134 | #define PT64_BASE_ADDR_MASK (((1ULL << 52) - 1) & ~(u64)(PAGE_SIZE-1)) |
135 | #define PT64_DIR_BASE_ADDR_MASK \ | 135 | #define PT64_DIR_BASE_ADDR_MASK \ |
136 | (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) | 136 | (PT64_BASE_ADDR_MASK & ~((1ULL << (PAGE_SHIFT + PT64_LEVEL_BITS)) - 1)) |
137 | 137 | ||
@@ -406,8 +406,8 @@ static void rmap_write_protect(struct kvm_vcpu *vcpu, u64 gfn) | |||
406 | spte = desc->shadow_ptes[0]; | 406 | spte = desc->shadow_ptes[0]; |
407 | } | 407 | } |
408 | BUG_ON(!spte); | 408 | BUG_ON(!spte); |
409 | BUG_ON((*spte & PT64_BASE_ADDR_MASK) != | 409 | BUG_ON((*spte & PT64_BASE_ADDR_MASK) >> PAGE_SHIFT |
410 | page_to_pfn(page) << PAGE_SHIFT); | 410 | != page_to_pfn(page)); |
411 | BUG_ON(!(*spte & PT_PRESENT_MASK)); | 411 | BUG_ON(!(*spte & PT_PRESENT_MASK)); |
412 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); | 412 | BUG_ON(!(*spte & PT_WRITABLE_MASK)); |
413 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); | 413 | rmap_printk("rmap_write_protect: spte %p %llx\n", spte, *spte); |
@@ -1093,22 +1093,40 @@ out: | |||
1093 | return r; | 1093 | return r; |
1094 | } | 1094 | } |
1095 | 1095 | ||
1096 | static void mmu_pre_write_zap_pte(struct kvm_vcpu *vcpu, | ||
1097 | struct kvm_mmu_page *page, | ||
1098 | u64 *spte) | ||
1099 | { | ||
1100 | u64 pte; | ||
1101 | struct kvm_mmu_page *child; | ||
1102 | |||
1103 | pte = *spte; | ||
1104 | if (is_present_pte(pte)) { | ||
1105 | if (page->role.level == PT_PAGE_TABLE_LEVEL) | ||
1106 | rmap_remove(vcpu, spte); | ||
1107 | else { | ||
1108 | child = page_header(pte & PT64_BASE_ADDR_MASK); | ||
1109 | mmu_page_remove_parent_pte(vcpu, child, spte); | ||
1110 | } | ||
1111 | } | ||
1112 | *spte = 0; | ||
1113 | } | ||
1114 | |||
1096 | void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | 1115 | void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) |
1097 | { | 1116 | { |
1098 | gfn_t gfn = gpa >> PAGE_SHIFT; | 1117 | gfn_t gfn = gpa >> PAGE_SHIFT; |
1099 | struct kvm_mmu_page *page; | 1118 | struct kvm_mmu_page *page; |
1100 | struct kvm_mmu_page *child; | ||
1101 | struct hlist_node *node, *n; | 1119 | struct hlist_node *node, *n; |
1102 | struct hlist_head *bucket; | 1120 | struct hlist_head *bucket; |
1103 | unsigned index; | 1121 | unsigned index; |
1104 | u64 *spte; | 1122 | u64 *spte; |
1105 | u64 pte; | ||
1106 | unsigned offset = offset_in_page(gpa); | 1123 | unsigned offset = offset_in_page(gpa); |
1107 | unsigned pte_size; | 1124 | unsigned pte_size; |
1108 | unsigned page_offset; | 1125 | unsigned page_offset; |
1109 | unsigned misaligned; | 1126 | unsigned misaligned; |
1110 | int level; | 1127 | int level; |
1111 | int flooded = 0; | 1128 | int flooded = 0; |
1129 | int npte; | ||
1112 | 1130 | ||
1113 | pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); | 1131 | pgprintk("%s: gpa %llx bytes %d\n", __FUNCTION__, gpa, bytes); |
1114 | if (gfn == vcpu->last_pt_write_gfn) { | 1132 | if (gfn == vcpu->last_pt_write_gfn) { |
@@ -1144,22 +1162,26 @@ void kvm_mmu_pre_write(struct kvm_vcpu *vcpu, gpa_t gpa, int bytes) | |||
1144 | } | 1162 | } |
1145 | page_offset = offset; | 1163 | page_offset = offset; |
1146 | level = page->role.level; | 1164 | level = page->role.level; |
1165 | npte = 1; | ||
1147 | if (page->role.glevels == PT32_ROOT_LEVEL) { | 1166 | if (page->role.glevels == PT32_ROOT_LEVEL) { |
1148 | page_offset <<= 1; /* 32->64 */ | 1167 | page_offset <<= 1; /* 32->64 */ |
1168 | /* | ||
1169 | * A 32-bit pde maps 4MB while the shadow pdes map | ||
1170 | * only 2MB. So we need to double the offset again | ||
1171 | * and zap two pdes instead of one. | ||
1172 | */ | ||
1173 | if (level == PT32_ROOT_LEVEL) { | ||
1174 | page_offset <<= 1; | ||
1175 | npte = 2; | ||
1176 | } | ||
1149 | page_offset &= ~PAGE_MASK; | 1177 | page_offset &= ~PAGE_MASK; |
1150 | } | 1178 | } |
1151 | spte = __va(page->page_hpa); | 1179 | spte = __va(page->page_hpa); |
1152 | spte += page_offset / sizeof(*spte); | 1180 | spte += page_offset / sizeof(*spte); |
1153 | pte = *spte; | 1181 | while (npte--) { |
1154 | if (is_present_pte(pte)) { | 1182 | mmu_pre_write_zap_pte(vcpu, page, spte); |
1155 | if (level == PT_PAGE_TABLE_LEVEL) | 1183 | ++spte; |
1156 | rmap_remove(vcpu, spte); | ||
1157 | else { | ||
1158 | child = page_header(pte & PT64_BASE_ADDR_MASK); | ||
1159 | mmu_page_remove_parent_pte(vcpu, child, spte); | ||
1160 | } | ||
1161 | } | 1184 | } |
1162 | *spte = 0; | ||
1163 | } | 1185 | } |
1164 | } | 1186 | } |
1165 | 1187 | ||
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index c07178e61122..bfa0ce42ea92 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -371,10 +371,10 @@ static int vmx_get_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata) | |||
371 | data = vmcs_read32(GUEST_SYSENTER_CS); | 371 | data = vmcs_read32(GUEST_SYSENTER_CS); |
372 | break; | 372 | break; |
373 | case MSR_IA32_SYSENTER_EIP: | 373 | case MSR_IA32_SYSENTER_EIP: |
374 | data = vmcs_read32(GUEST_SYSENTER_EIP); | 374 | data = vmcs_readl(GUEST_SYSENTER_EIP); |
375 | break; | 375 | break; |
376 | case MSR_IA32_SYSENTER_ESP: | 376 | case MSR_IA32_SYSENTER_ESP: |
377 | data = vmcs_read32(GUEST_SYSENTER_ESP); | 377 | data = vmcs_readl(GUEST_SYSENTER_ESP); |
378 | break; | 378 | break; |
379 | default: | 379 | default: |
380 | msr = find_msr_entry(vcpu, msr_index); | 380 | msr = find_msr_entry(vcpu, msr_index); |
@@ -412,10 +412,10 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data) | |||
412 | vmcs_write32(GUEST_SYSENTER_CS, data); | 412 | vmcs_write32(GUEST_SYSENTER_CS, data); |
413 | break; | 413 | break; |
414 | case MSR_IA32_SYSENTER_EIP: | 414 | case MSR_IA32_SYSENTER_EIP: |
415 | vmcs_write32(GUEST_SYSENTER_EIP, data); | 415 | vmcs_writel(GUEST_SYSENTER_EIP, data); |
416 | break; | 416 | break; |
417 | case MSR_IA32_SYSENTER_ESP: | 417 | case MSR_IA32_SYSENTER_ESP: |
418 | vmcs_write32(GUEST_SYSENTER_ESP, data); | 418 | vmcs_writel(GUEST_SYSENTER_ESP, data); |
419 | break; | 419 | break; |
420 | case MSR_IA32_TIME_STAMP_COUNTER: | 420 | case MSR_IA32_TIME_STAMP_COUNTER: |
421 | guest_write_tsc(data); | 421 | guest_write_tsc(data); |
diff --git a/drivers/md/linear.c b/drivers/md/linear.c index c625ddb8833d..d5ecd2d53046 100644 --- a/drivers/md/linear.c +++ b/drivers/md/linear.c | |||
@@ -188,7 +188,7 @@ static linear_conf_t *linear_conf(mddev_t *mddev, int raid_disks) | |||
188 | for (i=0; i < cnt-1 ; i++) { | 188 | for (i=0; i < cnt-1 ; i++) { |
189 | sector_t sz = 0; | 189 | sector_t sz = 0; |
190 | int j; | 190 | int j; |
191 | for (j=i; i<cnt-1 && sz < min_spacing ; j++) | 191 | for (j = i; j < cnt - 1 && sz < min_spacing; j++) |
192 | sz += conf->disks[j].size; | 192 | sz += conf->disks[j].size; |
193 | if (sz >= min_spacing && sz < conf->hash_spacing) | 193 | if (sz >= min_spacing && sz < conf->hash_spacing) |
194 | conf->hash_spacing = sz; | 194 | conf->hash_spacing = sz; |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 1ff5138e4bb6..9916cf32494d 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c | |||
@@ -1248,10 +1248,10 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) | |||
1248 | ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/ | 1248 | ret |= pvr2_write_register(hdw, 0xaa18, 0x00840000); /*unknown*/ |
1249 | LOCK_TAKE(hdw->ctl_lock); do { | 1249 | LOCK_TAKE(hdw->ctl_lock); do { |
1250 | hdw->cmd_buffer[0] = FX2CMD_FWPOST1; | 1250 | hdw->cmd_buffer[0] = FX2CMD_FWPOST1; |
1251 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,0,0); | 1251 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,1,NULL,0); |
1252 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; | 1252 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; |
1253 | hdw->cmd_buffer[1] = 0; | 1253 | hdw->cmd_buffer[1] = 0; |
1254 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); | 1254 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0); |
1255 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 1255 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
1256 | 1256 | ||
1257 | if (ret) { | 1257 | if (ret) { |
@@ -1320,7 +1320,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) | |||
1320 | LOCK_TAKE(hdw->ctl_lock); do { | 1320 | LOCK_TAKE(hdw->ctl_lock); do { |
1321 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; | 1321 | hdw->cmd_buffer[0] = FX2CMD_MEMSEL; |
1322 | hdw->cmd_buffer[1] = 0; | 1322 | hdw->cmd_buffer[1] = 0; |
1323 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,0,0); | 1323 | ret |= pvr2_send_request(hdw,hdw->cmd_buffer,2,NULL,0); |
1324 | } while (0); LOCK_GIVE(hdw->ctl_lock); | 1324 | } while (0); LOCK_GIVE(hdw->ctl_lock); |
1325 | 1325 | ||
1326 | if (ret) { | 1326 | if (ret) { |
diff --git a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c index 5313d342666e..25d3830b482a 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-v4l2.c +++ b/drivers/media/video/pvrusb2/pvrusb2-v4l2.c | |||
@@ -808,11 +808,11 @@ static void pvr2_v4l2_destroy_no_lock(struct pvr2_v4l2 *vp) | |||
808 | { | 808 | { |
809 | if (vp->dev_video) { | 809 | if (vp->dev_video) { |
810 | pvr2_v4l2_dev_destroy(vp->dev_video); | 810 | pvr2_v4l2_dev_destroy(vp->dev_video); |
811 | vp->dev_video = 0; | 811 | vp->dev_video = NULL; |
812 | } | 812 | } |
813 | if (vp->dev_radio) { | 813 | if (vp->dev_radio) { |
814 | pvr2_v4l2_dev_destroy(vp->dev_radio); | 814 | pvr2_v4l2_dev_destroy(vp->dev_radio); |
815 | vp->dev_radio = 0; | 815 | vp->dev_radio = NULL; |
816 | } | 816 | } |
817 | 817 | ||
818 | pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); | 818 | pvr2_trace(PVR2_TRACE_STRUCT,"Destroying pvr2_v4l2 id=%p",vp); |
@@ -1138,7 +1138,7 @@ static void pvr2_v4l2_dev_init(struct pvr2_v4l2_dev *dip, | |||
1138 | { | 1138 | { |
1139 | int mindevnum; | 1139 | int mindevnum; |
1140 | int unit_number; | 1140 | int unit_number; |
1141 | int *nr_ptr = 0; | 1141 | int *nr_ptr = NULL; |
1142 | dip->v4lp = vp; | 1142 | dip->v4lp = vp; |
1143 | 1143 | ||
1144 | 1144 | ||
diff --git a/drivers/mmc/imxmmc.c b/drivers/mmc/imxmmc.c index b060d4bfba29..0de5c9e94e74 100644 --- a/drivers/mmc/imxmmc.c +++ b/drivers/mmc/imxmmc.c | |||
@@ -569,10 +569,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
569 | 569 | ||
570 | if(host->dma_dir == DMA_FROM_DEVICE) { | 570 | if(host->dma_dir == DMA_FROM_DEVICE) { |
571 | imxmci_busy_wait_for_status(host, &stat, | 571 | imxmci_busy_wait_for_status(host, &stat, |
572 | STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE, | 572 | STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE | |
573 | STATUS_TIME_OUT_READ, | ||
573 | 50, "imxmci_cpu_driven_data read"); | 574 | 50, "imxmci_cpu_driven_data read"); |
574 | 575 | ||
575 | while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && | 576 | while((stat & (STATUS_APPL_BUFF_FF | STATUS_DATA_TRANS_DONE)) && |
577 | !(stat & STATUS_TIME_OUT_READ) && | ||
576 | (host->data_cnt < 512)) { | 578 | (host->data_cnt < 512)) { |
577 | 579 | ||
578 | udelay(20); /* required for clocks < 8MHz*/ | 580 | udelay(20); /* required for clocks < 8MHz*/ |
@@ -602,6 +604,12 @@ static int imxmci_cpu_driven_data(struct imxmci_host *host, unsigned int *pstat) | |||
602 | if(host->dma_size & 0x1ff) | 604 | if(host->dma_size & 0x1ff) |
603 | stat &= ~STATUS_CRC_READ_ERR; | 605 | stat &= ~STATUS_CRC_READ_ERR; |
604 | 606 | ||
607 | if(stat & STATUS_TIME_OUT_READ) { | ||
608 | dev_dbg(mmc_dev(host->mmc), "imxmci_cpu_driven_data read timeout STATUS = 0x%x\n", | ||
609 | stat); | ||
610 | trans_done = -1; | ||
611 | } | ||
612 | |||
605 | } else { | 613 | } else { |
606 | imxmci_busy_wait_for_status(host, &stat, | 614 | imxmci_busy_wait_for_status(host, &stat, |
607 | STATUS_APPL_BUFF_FE, | 615 | STATUS_APPL_BUFF_FE, |
@@ -709,6 +717,9 @@ static void imxmci_tasklet_fnc(unsigned long data) | |||
709 | */ | 717 | */ |
710 | stat |= host->status_reg; | 718 | stat |= host->status_reg; |
711 | 719 | ||
720 | if(test_bit(IMXMCI_PEND_CPU_DATA_b, &host->pending_events)) | ||
721 | stat &= ~STATUS_CRC_READ_ERR; | ||
722 | |||
712 | if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { | 723 | if(test_bit(IMXMCI_PEND_WAIT_RESP_b, &host->pending_events)) { |
713 | imxmci_busy_wait_for_status(host, &stat, | 724 | imxmci_busy_wait_for_status(host, &stat, |
714 | STATUS_END_CMD_RESP | STATUS_ERR_MASK, | 725 | STATUS_END_CMD_RESP | STATUS_ERR_MASK, |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 88d4f70035bb..dee3638ad744 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -1328,7 +1328,7 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb, | |||
1328 | 1328 | ||
1329 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { | 1329 | if (likely(skb->ip_summed == CHECKSUM_PARTIAL)) { |
1330 | cso = skb->h.raw - skb->data; | 1330 | cso = skb->h.raw - skb->data; |
1331 | css = (skb->h.raw + skb->csum) - skb->data; | 1331 | css = (skb->h.raw + skb->csum_offset) - skb->data; |
1332 | if (unlikely(cso & 0x1)) { | 1332 | if (unlikely(cso & 0x1)) { |
1333 | printk(KERN_DEBUG "%s: payload offset != even number\n", | 1333 | printk(KERN_DEBUG "%s: payload offset != even number\n", |
1334 | atl1_driver_name); | 1334 | atl1_driver_name); |
@@ -1562,7 +1562,7 @@ static int atl1_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
1562 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ | 1562 | /* mss will be nonzero if we're doing segment offload (TSO/GSO) */ |
1563 | mss = skb_shinfo(skb)->gso_size; | 1563 | mss = skb_shinfo(skb)->gso_size; |
1564 | if (mss) { | 1564 | if (mss) { |
1565 | if (skb->protocol == ntohs(ETH_P_IP)) { | 1565 | if (skb->protocol == htons(ETH_P_IP)) { |
1566 | proto_hdr_len = ((skb->h.raw - skb->data) + | 1566 | proto_hdr_len = ((skb->h.raw - skb->data) + |
1567 | (skb->h.th->doff << 2)); | 1567 | (skb->h.th->doff << 2)); |
1568 | if (unlikely(proto_hdr_len > len)) { | 1568 | if (unlikely(proto_hdr_len > len)) { |
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c index c6172a77a6d7..349b96a3ec4c 100644 --- a/drivers/net/natsemi.c +++ b/drivers/net/natsemi.c | |||
@@ -1712,7 +1712,7 @@ static void init_registers(struct net_device *dev) | |||
1712 | 1712 | ||
1713 | /* Enable interrupts by setting the interrupt mask. */ | 1713 | /* Enable interrupts by setting the interrupt mask. */ |
1714 | writel(DEFAULT_INTR, ioaddr + IntrMask); | 1714 | writel(DEFAULT_INTR, ioaddr + IntrMask); |
1715 | writel(1, ioaddr + IntrEnable); | 1715 | natsemi_irq_enable(dev); |
1716 | 1716 | ||
1717 | writel(RxOn | TxOn, ioaddr + ChipCmd); | 1717 | writel(RxOn | TxOn, ioaddr + ChipCmd); |
1718 | writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */ | 1718 | writel(StatsClear, ioaddr + StatsCtrl); /* Clear Stats */ |
@@ -2119,28 +2119,35 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
2119 | struct netdev_private *np = netdev_priv(dev); | 2119 | struct netdev_private *np = netdev_priv(dev); |
2120 | void __iomem * ioaddr = ns_ioaddr(dev); | 2120 | void __iomem * ioaddr = ns_ioaddr(dev); |
2121 | 2121 | ||
2122 | if (np->hands_off) | 2122 | /* Reading IntrStatus automatically acknowledges so don't do |
2123 | * that while interrupts are disabled, (for example, while a | ||
2124 | * poll is scheduled). */ | ||
2125 | if (np->hands_off || !readl(ioaddr + IntrEnable)) | ||
2123 | return IRQ_NONE; | 2126 | return IRQ_NONE; |
2124 | 2127 | ||
2125 | /* Reading automatically acknowledges. */ | ||
2126 | np->intr_status = readl(ioaddr + IntrStatus); | 2128 | np->intr_status = readl(ioaddr + IntrStatus); |
2127 | 2129 | ||
2130 | if (!np->intr_status) | ||
2131 | return IRQ_NONE; | ||
2132 | |||
2128 | if (netif_msg_intr(np)) | 2133 | if (netif_msg_intr(np)) |
2129 | printk(KERN_DEBUG | 2134 | printk(KERN_DEBUG |
2130 | "%s: Interrupt, status %#08x, mask %#08x.\n", | 2135 | "%s: Interrupt, status %#08x, mask %#08x.\n", |
2131 | dev->name, np->intr_status, | 2136 | dev->name, np->intr_status, |
2132 | readl(ioaddr + IntrMask)); | 2137 | readl(ioaddr + IntrMask)); |
2133 | 2138 | ||
2134 | if (!np->intr_status) | ||
2135 | return IRQ_NONE; | ||
2136 | |||
2137 | prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]); | 2139 | prefetch(&np->rx_skbuff[np->cur_rx % RX_RING_SIZE]); |
2138 | 2140 | ||
2139 | if (netif_rx_schedule_prep(dev)) { | 2141 | if (netif_rx_schedule_prep(dev)) { |
2140 | /* Disable interrupts and register for poll */ | 2142 | /* Disable interrupts and register for poll */ |
2141 | natsemi_irq_disable(dev); | 2143 | natsemi_irq_disable(dev); |
2142 | __netif_rx_schedule(dev); | 2144 | __netif_rx_schedule(dev); |
2143 | } | 2145 | } else |
2146 | printk(KERN_WARNING | ||
2147 | "%s: Ignoring interrupt, status %#08x, mask %#08x.\n", | ||
2148 | dev->name, np->intr_status, | ||
2149 | readl(ioaddr + IntrMask)); | ||
2150 | |||
2144 | return IRQ_HANDLED; | 2151 | return IRQ_HANDLED; |
2145 | } | 2152 | } |
2146 | 2153 | ||
@@ -2156,6 +2163,20 @@ static int natsemi_poll(struct net_device *dev, int *budget) | |||
2156 | int work_done = 0; | 2163 | int work_done = 0; |
2157 | 2164 | ||
2158 | do { | 2165 | do { |
2166 | if (netif_msg_intr(np)) | ||
2167 | printk(KERN_DEBUG | ||
2168 | "%s: Poll, status %#08x, mask %#08x.\n", | ||
2169 | dev->name, np->intr_status, | ||
2170 | readl(ioaddr + IntrMask)); | ||
2171 | |||
2172 | /* netdev_rx() may read IntrStatus again if the RX state | ||
2173 | * machine falls over so do it first. */ | ||
2174 | if (np->intr_status & | ||
2175 | (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | | ||
2176 | IntrRxErr | IntrRxOverrun)) { | ||
2177 | netdev_rx(dev, &work_done, work_to_do); | ||
2178 | } | ||
2179 | |||
2159 | if (np->intr_status & | 2180 | if (np->intr_status & |
2160 | (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) { | 2181 | (IntrTxDone | IntrTxIntr | IntrTxIdle | IntrTxErr)) { |
2161 | spin_lock(&np->lock); | 2182 | spin_lock(&np->lock); |
@@ -2167,12 +2188,6 @@ static int natsemi_poll(struct net_device *dev, int *budget) | |||
2167 | if (np->intr_status & IntrAbnormalSummary) | 2188 | if (np->intr_status & IntrAbnormalSummary) |
2168 | netdev_error(dev, np->intr_status); | 2189 | netdev_error(dev, np->intr_status); |
2169 | 2190 | ||
2170 | if (np->intr_status & | ||
2171 | (IntrRxDone | IntrRxIntr | RxStatusFIFOOver | | ||
2172 | IntrRxErr | IntrRxOverrun)) { | ||
2173 | netdev_rx(dev, &work_done, work_to_do); | ||
2174 | } | ||
2175 | |||
2176 | *budget -= work_done; | 2191 | *budget -= work_done; |
2177 | dev->quota -= work_done; | 2192 | dev->quota -= work_done; |
2178 | 2193 | ||
@@ -2399,19 +2414,8 @@ static struct net_device_stats *get_stats(struct net_device *dev) | |||
2399 | #ifdef CONFIG_NET_POLL_CONTROLLER | 2414 | #ifdef CONFIG_NET_POLL_CONTROLLER |
2400 | static void natsemi_poll_controller(struct net_device *dev) | 2415 | static void natsemi_poll_controller(struct net_device *dev) |
2401 | { | 2416 | { |
2402 | struct netdev_private *np = netdev_priv(dev); | ||
2403 | |||
2404 | disable_irq(dev->irq); | 2417 | disable_irq(dev->irq); |
2405 | 2418 | intr_handler(dev->irq, dev); | |
2406 | /* | ||
2407 | * A real interrupt might have already reached us at this point | ||
2408 | * but NAPI might still haven't called us back. As the interrupt | ||
2409 | * status register is cleared by reading, we should prevent an | ||
2410 | * interrupt loss in this case... | ||
2411 | */ | ||
2412 | if (!np->intr_status) | ||
2413 | intr_handler(dev->irq, dev); | ||
2414 | |||
2415 | enable_irq(dev->irq); | 2419 | enable_irq(dev->irq); |
2416 | } | 2420 | } |
2417 | #endif | 2421 | #endif |
@@ -3071,7 +3075,7 @@ static void enable_wol_mode(struct net_device *dev, int enable_intr) | |||
3071 | * Could be used to send a netlink message. | 3075 | * Could be used to send a netlink message. |
3072 | */ | 3076 | */ |
3073 | writel(WOLPkt | LinkChange, ioaddr + IntrMask); | 3077 | writel(WOLPkt | LinkChange, ioaddr + IntrMask); |
3074 | writel(1, ioaddr + IntrEnable); | 3078 | natsemi_irq_enable(dev); |
3075 | } | 3079 | } |
3076 | } | 3080 | } |
3077 | 3081 | ||
@@ -3202,7 +3206,7 @@ static int natsemi_suspend (struct pci_dev *pdev, pm_message_t state) | |||
3202 | disable_irq(dev->irq); | 3206 | disable_irq(dev->irq); |
3203 | spin_lock_irq(&np->lock); | 3207 | spin_lock_irq(&np->lock); |
3204 | 3208 | ||
3205 | writel(0, ioaddr + IntrEnable); | 3209 | natsemi_irq_disable(dev); |
3206 | np->hands_off = 1; | 3210 | np->hands_off = 1; |
3207 | natsemi_stop_rxtx(dev); | 3211 | natsemi_stop_rxtx(dev); |
3208 | netif_stop_queue(dev); | 3212 | netif_stop_queue(dev); |
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h index 81742e4e5610..dd8ce35332fe 100644 --- a/drivers/net/netxen/netxen_nic.h +++ b/drivers/net/netxen/netxen_nic.h | |||
@@ -232,6 +232,7 @@ enum { | |||
232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 | 232 | #define MPORT_SINGLE_FUNCTION_MODE 0x1111 |
233 | 233 | ||
234 | extern unsigned long long netxen_dma_mask; | 234 | extern unsigned long long netxen_dma_mask; |
235 | extern unsigned long last_schedule_time; | ||
235 | 236 | ||
236 | /* | 237 | /* |
237 | * NetXen host-peg signal message structure | 238 | * NetXen host-peg signal message structure |
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c index 986ef98db229..ee1b5a24cbe7 100644 --- a/drivers/net/netxen/netxen_nic_ethtool.c +++ b/drivers/net/netxen/netxen_nic_ethtool.c | |||
@@ -462,6 +462,7 @@ netxen_nic_set_eeprom(struct net_device *dev, struct ethtool_eeprom *eeprom, | |||
462 | } | 462 | } |
463 | printk(KERN_INFO "%s: flash unlocked. \n", | 463 | printk(KERN_INFO "%s: flash unlocked. \n", |
464 | netxen_nic_driver_name); | 464 | netxen_nic_driver_name); |
465 | last_schedule_time = jiffies; | ||
465 | ret = netxen_flash_erase_secondary(adapter); | 466 | ret = netxen_flash_erase_secondary(adapter); |
466 | if (ret != FLASH_SUCCESS) { | 467 | if (ret != FLASH_SUCCESS) { |
467 | printk(KERN_ERR "%s: Flash erase failed.\n", | 468 | printk(KERN_ERR "%s: Flash erase failed.\n", |
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c index 1be55702557d..6537574a9cda 100644 --- a/drivers/net/netxen/netxen_nic_hw.c +++ b/drivers/net/netxen/netxen_nic_hw.c | |||
@@ -822,7 +822,10 @@ int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu) | |||
822 | { | 822 | { |
823 | struct netxen_adapter *adapter = port->adapter; | 823 | struct netxen_adapter *adapter = port->adapter; |
824 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; | 824 | new_mtu += NETXEN_NIU_HDRSIZE + NETXEN_NIU_TLRSIZE; |
825 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); | 825 | if (port->portnum == 0) |
826 | netxen_nic_write_w0(adapter, NETXEN_NIU_XGE_MAX_FRAME_SIZE, new_mtu); | ||
827 | else if (port->portnum == 1) | ||
828 | netxen_nic_write_w0(adapter, NETXEN_NIU_XG1_MAX_FRAME_SIZE, new_mtu); | ||
826 | return 0; | 829 | return 0; |
827 | } | 830 | } |
828 | 831 | ||
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 586d32b676af..229aa1c4fb79 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -42,6 +42,8 @@ struct crb_addr_pair { | |||
42 | u32 data; | 42 | u32 data; |
43 | }; | 43 | }; |
44 | 44 | ||
45 | unsigned long last_schedule_time; | ||
46 | |||
45 | #define NETXEN_MAX_CRB_XFORM 60 | 47 | #define NETXEN_MAX_CRB_XFORM 60 |
46 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; | 48 | static unsigned int crb_addr_xform[NETXEN_MAX_CRB_XFORM]; |
47 | #define NETXEN_ADDR_ERROR (0xffffffff) | 49 | #define NETXEN_ADDR_ERROR (0xffffffff) |
@@ -404,9 +406,14 @@ static inline int do_rom_fast_write(struct netxen_adapter *adapter, int addr, | |||
404 | static inline int | 406 | static inline int |
405 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | 407 | do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) |
406 | { | 408 | { |
409 | if (jiffies > (last_schedule_time + (8 * HZ))) { | ||
410 | last_schedule_time = jiffies; | ||
411 | schedule(); | ||
412 | } | ||
413 | |||
407 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); | 414 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ADDRESS, addr); |
408 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); | 415 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 3); |
409 | udelay(70); /* prevent bursting on CRB */ | 416 | udelay(100); /* prevent bursting on CRB */ |
410 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
411 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); | 418 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_INSTR_OPCODE, 0xb); |
412 | if (netxen_wait_rom_done(adapter)) { | 419 | if (netxen_wait_rom_done(adapter)) { |
@@ -415,7 +422,7 @@ do_rom_fast_read(struct netxen_adapter *adapter, int addr, int *valp) | |||
415 | } | 422 | } |
416 | /* reset abyte_cnt and dummy_byte_cnt */ | 423 | /* reset abyte_cnt and dummy_byte_cnt */ |
417 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); | 424 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_ABYTE_CNT, 0); |
418 | udelay(70); /* prevent bursting on CRB */ | 425 | udelay(100); /* prevent bursting on CRB */ |
419 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); | 426 | netxen_nic_reg_write(adapter, NETXEN_ROMUSB_ROM_DUMMY_BYTE_CNT, 0); |
420 | 427 | ||
421 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); | 428 | *valp = netxen_nic_reg_read(adapter, NETXEN_ROMUSB_ROM_RDATA); |
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index a956a51d284f..1060154ae750 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c | |||
@@ -138,7 +138,7 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
138 | 138 | ||
139 | ======================================================================*/ | 139 | ======================================================================*/ |
140 | 140 | ||
141 | static int ibmtr_attach(struct pcmcia_device *link) | 141 | static int __devinit ibmtr_attach(struct pcmcia_device *link) |
142 | { | 142 | { |
143 | ibmtr_dev_t *info; | 143 | ibmtr_dev_t *info; |
144 | struct net_device *dev; | 144 | struct net_device *dev; |
@@ -217,7 +217,7 @@ static void ibmtr_detach(struct pcmcia_device *link) | |||
217 | #define CS_CHECK(fn, ret) \ | 217 | #define CS_CHECK(fn, ret) \ |
218 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 218 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
219 | 219 | ||
220 | static int ibmtr_config(struct pcmcia_device *link) | 220 | static int __devinit ibmtr_config(struct pcmcia_device *link) |
221 | { | 221 | { |
222 | ibmtr_dev_t *info = link->priv; | 222 | ibmtr_dev_t *info = link->priv; |
223 | struct net_device *dev = info->dev; | 223 | struct net_device *dev = info->dev; |
diff --git a/drivers/net/skge.c b/drivers/net/skge.c index eea75a401b0c..8fecf1b817f7 100644 --- a/drivers/net/skge.c +++ b/drivers/net/skge.c | |||
@@ -3275,24 +3275,30 @@ static int skge_set_mac_address(struct net_device *dev, void *p) | |||
3275 | struct skge_hw *hw = skge->hw; | 3275 | struct skge_hw *hw = skge->hw; |
3276 | unsigned port = skge->port; | 3276 | unsigned port = skge->port; |
3277 | const struct sockaddr *addr = p; | 3277 | const struct sockaddr *addr = p; |
3278 | u16 ctrl; | ||
3278 | 3279 | ||
3279 | if (!is_valid_ether_addr(addr->sa_data)) | 3280 | if (!is_valid_ether_addr(addr->sa_data)) |
3280 | return -EADDRNOTAVAIL; | 3281 | return -EADDRNOTAVAIL; |
3281 | 3282 | ||
3282 | mutex_lock(&hw->phy_mutex); | ||
3283 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); | 3283 | memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); |
3284 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, | ||
3285 | dev->dev_addr, ETH_ALEN); | ||
3286 | memcpy_toio(hw->regs + B2_MAC_2 + port*8, | ||
3287 | dev->dev_addr, ETH_ALEN); | ||
3288 | 3284 | ||
3289 | if (hw->chip_id == CHIP_ID_GENESIS) | 3285 | /* disable Rx */ |
3290 | xm_outaddr(hw, port, XM_SA, dev->dev_addr); | 3286 | ctrl = gma_read16(hw, port, GM_GP_CTRL); |
3291 | else { | 3287 | gma_write16(hw, port, GM_GP_CTRL, ctrl & ~GM_GPCR_RX_ENA); |
3292 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | 3288 | |
3293 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | 3289 | memcpy_toio(hw->regs + B2_MAC_1 + port*8, dev->dev_addr, ETH_ALEN); |
3290 | memcpy_toio(hw->regs + B2_MAC_2 + port*8, dev->dev_addr, ETH_ALEN); | ||
3291 | |||
3292 | if (netif_running(dev)) { | ||
3293 | if (hw->chip_id == CHIP_ID_GENESIS) | ||
3294 | xm_outaddr(hw, port, XM_SA, dev->dev_addr); | ||
3295 | else { | ||
3296 | gma_set_addr(hw, port, GM_SRC_ADDR_1L, dev->dev_addr); | ||
3297 | gma_set_addr(hw, port, GM_SRC_ADDR_2L, dev->dev_addr); | ||
3298 | } | ||
3294 | } | 3299 | } |
3295 | mutex_unlock(&hw->phy_mutex); | 3300 | |
3301 | gma_write16(hw, port, GM_GP_CTRL, ctrl); | ||
3296 | 3302 | ||
3297 | return 0; | 3303 | return 0; |
3298 | } | 3304 | } |
diff --git a/drivers/net/tokenring/ibmtr.c b/drivers/net/tokenring/ibmtr.c index 36202e94ee91..01d55315ee8c 100644 --- a/drivers/net/tokenring/ibmtr.c +++ b/drivers/net/tokenring/ibmtr.c | |||
@@ -346,7 +346,7 @@ static void ibmtr_cleanup_card(struct net_device *dev) | |||
346 | * which references it. | 346 | * which references it. |
347 | ****************************************************************************/ | 347 | ****************************************************************************/ |
348 | 348 | ||
349 | static int __init ibmtr_probe(struct net_device *dev) | 349 | static int __devinit ibmtr_probe(struct net_device *dev) |
350 | { | 350 | { |
351 | int i; | 351 | int i; |
352 | int base_addr = dev->base_addr; | 352 | int base_addr = dev->base_addr; |
@@ -366,7 +366,7 @@ static int __init ibmtr_probe(struct net_device *dev) | |||
366 | return -ENODEV; | 366 | return -ENODEV; |
367 | } | 367 | } |
368 | 368 | ||
369 | int __init ibmtr_probe_card(struct net_device *dev) | 369 | int __devinit ibmtr_probe_card(struct net_device *dev) |
370 | { | 370 | { |
371 | int err = ibmtr_probe(dev); | 371 | int err = ibmtr_probe(dev); |
372 | if (!err) { | 372 | if (!err) { |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 24a29c99ba94..9aeac76184f3 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -190,13 +190,13 @@ | |||
190 | 190 | ||
191 | /* Structure/enum declaration ------------------------------- */ | 191 | /* Structure/enum declaration ------------------------------- */ |
192 | struct tx_desc { | 192 | struct tx_desc { |
193 | u32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ | 193 | __le32 tdes0, tdes1, tdes2, tdes3; /* Data for the card */ |
194 | char *tx_buf_ptr; /* Data for us */ | 194 | char *tx_buf_ptr; /* Data for us */ |
195 | struct tx_desc *next_tx_desc; | 195 | struct tx_desc *next_tx_desc; |
196 | } __attribute__(( aligned(32) )); | 196 | } __attribute__(( aligned(32) )); |
197 | 197 | ||
198 | struct rx_desc { | 198 | struct rx_desc { |
199 | u32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ | 199 | __le32 rdes0, rdes1, rdes2, rdes3; /* Data for the card */ |
200 | struct sk_buff *rx_skb_ptr; /* Data for us */ | 200 | struct sk_buff *rx_skb_ptr; /* Data for us */ |
201 | struct rx_desc *next_rx_desc; | 201 | struct rx_desc *next_rx_desc; |
202 | } __attribute__(( aligned(32) )); | 202 | } __attribute__(( aligned(32) )); |
@@ -458,7 +458,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
458 | 458 | ||
459 | /* read 64 word srom data */ | 459 | /* read 64 word srom data */ |
460 | for (i = 0; i < 64; i++) | 460 | for (i = 0; i < 64; i++) |
461 | ((u16 *) db->srom)[i] = | 461 | ((__le16 *) db->srom)[i] = |
462 | cpu_to_le16(read_srom_word(db->ioaddr, i)); | 462 | cpu_to_le16(read_srom_word(db->ioaddr, i)); |
463 | 463 | ||
464 | /* Set Node address */ | 464 | /* Set Node address */ |
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 01869b1782e4..ad33e0159514 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -100,6 +100,7 @@ static void msi_set_mask_bit(unsigned int irq, int flag) | |||
100 | BUG(); | 100 | BUG(); |
101 | break; | 101 | break; |
102 | } | 102 | } |
103 | entry->msi_attrib.masked = !!flag; | ||
103 | } | 104 | } |
104 | 105 | ||
105 | void read_msi_msg(unsigned int irq, struct msi_msg *msg) | 106 | void read_msi_msg(unsigned int irq, struct msi_msg *msg) |
@@ -179,6 +180,7 @@ void write_msi_msg(unsigned int irq, struct msi_msg *msg) | |||
179 | default: | 180 | default: |
180 | BUG(); | 181 | BUG(); |
181 | } | 182 | } |
183 | entry->msg = *msg; | ||
182 | } | 184 | } |
183 | 185 | ||
184 | void mask_msi_irq(unsigned int irq) | 186 | void mask_msi_irq(unsigned int irq) |
@@ -225,164 +227,60 @@ static struct msi_desc* alloc_msi_entry(void) | |||
225 | } | 227 | } |
226 | 228 | ||
227 | #ifdef CONFIG_PM | 229 | #ifdef CONFIG_PM |
228 | static int __pci_save_msi_state(struct pci_dev *dev) | ||
229 | { | ||
230 | int pos, i = 0; | ||
231 | u16 control; | ||
232 | struct pci_cap_saved_state *save_state; | ||
233 | u32 *cap; | ||
234 | |||
235 | if (!dev->msi_enabled) | ||
236 | return 0; | ||
237 | |||
238 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); | ||
239 | if (pos <= 0) | ||
240 | return 0; | ||
241 | |||
242 | save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u32) * 5, | ||
243 | GFP_KERNEL); | ||
244 | if (!save_state) { | ||
245 | printk(KERN_ERR "Out of memory in pci_save_msi_state\n"); | ||
246 | return -ENOMEM; | ||
247 | } | ||
248 | cap = &save_state->data[0]; | ||
249 | |||
250 | pci_read_config_dword(dev, pos, &cap[i++]); | ||
251 | control = cap[0] >> 16; | ||
252 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, &cap[i++]); | ||
253 | if (control & PCI_MSI_FLAGS_64BIT) { | ||
254 | pci_read_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, &cap[i++]); | ||
255 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_64, &cap[i++]); | ||
256 | } else | ||
257 | pci_read_config_dword(dev, pos + PCI_MSI_DATA_32, &cap[i++]); | ||
258 | if (control & PCI_MSI_FLAGS_MASKBIT) | ||
259 | pci_read_config_dword(dev, pos + PCI_MSI_MASK_BIT, &cap[i++]); | ||
260 | save_state->cap_nr = PCI_CAP_ID_MSI; | ||
261 | pci_add_saved_cap(dev, save_state); | ||
262 | return 0; | ||
263 | } | ||
264 | |||
265 | static void __pci_restore_msi_state(struct pci_dev *dev) | 230 | static void __pci_restore_msi_state(struct pci_dev *dev) |
266 | { | 231 | { |
267 | int i = 0, pos; | 232 | int pos; |
268 | u16 control; | 233 | u16 control; |
269 | struct pci_cap_saved_state *save_state; | 234 | struct msi_desc *entry; |
270 | u32 *cap; | ||
271 | 235 | ||
272 | if (!dev->msi_enabled) | 236 | if (!dev->msi_enabled) |
273 | return; | 237 | return; |
274 | 238 | ||
275 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSI); | 239 | entry = get_irq_msi(dev->irq); |
276 | pos = pci_find_capability(dev, PCI_CAP_ID_MSI); | 240 | pos = entry->msi_attrib.pos; |
277 | if (!save_state || pos <= 0) | ||
278 | return; | ||
279 | cap = &save_state->data[0]; | ||
280 | 241 | ||
281 | pci_intx(dev, 0); /* disable intx */ | 242 | pci_intx(dev, 0); /* disable intx */ |
282 | control = cap[i++] >> 16; | ||
283 | msi_set_enable(dev, 0); | 243 | msi_set_enable(dev, 0); |
284 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_LO, cap[i++]); | 244 | write_msi_msg(dev->irq, &entry->msg); |
285 | if (control & PCI_MSI_FLAGS_64BIT) { | 245 | if (entry->msi_attrib.maskbit) |
286 | pci_write_config_dword(dev, pos + PCI_MSI_ADDRESS_HI, cap[i++]); | 246 | msi_set_mask_bit(dev->irq, entry->msi_attrib.masked); |
287 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_64, cap[i++]); | 247 | |
288 | } else | 248 | pci_read_config_word(dev, pos + PCI_MSI_FLAGS, &control); |
289 | pci_write_config_dword(dev, pos + PCI_MSI_DATA_32, cap[i++]); | 249 | control &= ~(PCI_MSI_FLAGS_QSIZE | PCI_MSI_FLAGS_ENABLE); |
290 | if (control & PCI_MSI_FLAGS_MASKBIT) | 250 | if (entry->msi_attrib.maskbit || !entry->msi_attrib.masked) |
291 | pci_write_config_dword(dev, pos + PCI_MSI_MASK_BIT, cap[i++]); | 251 | control |= PCI_MSI_FLAGS_ENABLE; |
292 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); | 252 | pci_write_config_word(dev, pos + PCI_MSI_FLAGS, control); |
293 | pci_remove_saved_cap(save_state); | ||
294 | kfree(save_state); | ||
295 | } | ||
296 | |||
297 | static int __pci_save_msix_state(struct pci_dev *dev) | ||
298 | { | ||
299 | int pos; | ||
300 | int irq, head, tail = 0; | ||
301 | u16 control; | ||
302 | struct pci_cap_saved_state *save_state; | ||
303 | |||
304 | if (!dev->msix_enabled) | ||
305 | return 0; | ||
306 | |||
307 | pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); | ||
308 | if (pos <= 0) | ||
309 | return 0; | ||
310 | |||
311 | /* save the capability */ | ||
312 | pci_read_config_word(dev, msi_control_reg(pos), &control); | ||
313 | save_state = kzalloc(sizeof(struct pci_cap_saved_state) + sizeof(u16), | ||
314 | GFP_KERNEL); | ||
315 | if (!save_state) { | ||
316 | printk(KERN_ERR "Out of memory in pci_save_msix_state\n"); | ||
317 | return -ENOMEM; | ||
318 | } | ||
319 | *((u16 *)&save_state->data[0]) = control; | ||
320 | |||
321 | /* save the table */ | ||
322 | irq = head = dev->first_msi_irq; | ||
323 | while (head != tail) { | ||
324 | struct msi_desc *entry; | ||
325 | |||
326 | entry = get_irq_msi(irq); | ||
327 | read_msi_msg(irq, &entry->msg_save); | ||
328 | |||
329 | tail = entry->link.tail; | ||
330 | irq = tail; | ||
331 | } | ||
332 | |||
333 | save_state->cap_nr = PCI_CAP_ID_MSIX; | ||
334 | pci_add_saved_cap(dev, save_state); | ||
335 | return 0; | ||
336 | } | ||
337 | |||
338 | int pci_save_msi_state(struct pci_dev *dev) | ||
339 | { | ||
340 | int rc; | ||
341 | |||
342 | rc = __pci_save_msi_state(dev); | ||
343 | if (rc) | ||
344 | return rc; | ||
345 | |||
346 | rc = __pci_save_msix_state(dev); | ||
347 | |||
348 | return rc; | ||
349 | } | 253 | } |
350 | 254 | ||
351 | static void __pci_restore_msix_state(struct pci_dev *dev) | 255 | static void __pci_restore_msix_state(struct pci_dev *dev) |
352 | { | 256 | { |
353 | u16 save; | ||
354 | int pos; | 257 | int pos; |
355 | int irq, head, tail = 0; | 258 | int irq, head, tail = 0; |
356 | struct msi_desc *entry; | 259 | struct msi_desc *entry; |
357 | struct pci_cap_saved_state *save_state; | 260 | u16 control; |
358 | 261 | ||
359 | if (!dev->msix_enabled) | 262 | if (!dev->msix_enabled) |
360 | return; | 263 | return; |
361 | 264 | ||
362 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_MSIX); | ||
363 | if (!save_state) | ||
364 | return; | ||
365 | save = *((u16 *)&save_state->data[0]); | ||
366 | pci_remove_saved_cap(save_state); | ||
367 | kfree(save_state); | ||
368 | |||
369 | pos = pci_find_capability(dev, PCI_CAP_ID_MSIX); | ||
370 | if (pos <= 0) | ||
371 | return; | ||
372 | |||
373 | /* route the table */ | 265 | /* route the table */ |
374 | pci_intx(dev, 0); /* disable intx */ | 266 | pci_intx(dev, 0); /* disable intx */ |
375 | msix_set_enable(dev, 0); | 267 | msix_set_enable(dev, 0); |
376 | irq = head = dev->first_msi_irq; | 268 | irq = head = dev->first_msi_irq; |
269 | entry = get_irq_msi(irq); | ||
270 | pos = entry->msi_attrib.pos; | ||
377 | while (head != tail) { | 271 | while (head != tail) { |
378 | entry = get_irq_msi(irq); | 272 | entry = get_irq_msi(irq); |
379 | write_msi_msg(irq, &entry->msg_save); | 273 | write_msi_msg(irq, &entry->msg); |
274 | msi_set_mask_bit(irq, entry->msi_attrib.masked); | ||
380 | 275 | ||
381 | tail = entry->link.tail; | 276 | tail = entry->link.tail; |
382 | irq = tail; | 277 | irq = tail; |
383 | } | 278 | } |
384 | 279 | ||
385 | pci_write_config_word(dev, msi_control_reg(pos), save); | 280 | pci_read_config_word(dev, pos + PCI_MSIX_FLAGS, &control); |
281 | control &= ~PCI_MSIX_FLAGS_MASKALL; | ||
282 | control |= PCI_MSIX_FLAGS_ENABLE; | ||
283 | pci_write_config_word(dev, pos + PCI_MSIX_FLAGS, control); | ||
386 | } | 284 | } |
387 | 285 | ||
388 | void pci_restore_msi_state(struct pci_dev *dev) | 286 | void pci_restore_msi_state(struct pci_dev *dev) |
@@ -420,6 +318,7 @@ static int msi_capability_init(struct pci_dev *dev) | |||
420 | entry->msi_attrib.is_64 = is_64bit_address(control); | 318 | entry->msi_attrib.is_64 = is_64bit_address(control); |
421 | entry->msi_attrib.entry_nr = 0; | 319 | entry->msi_attrib.entry_nr = 0; |
422 | entry->msi_attrib.maskbit = is_mask_bit_support(control); | 320 | entry->msi_attrib.maskbit = is_mask_bit_support(control); |
321 | entry->msi_attrib.masked = 1; | ||
423 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ | 322 | entry->msi_attrib.default_irq = dev->irq; /* Save IOAPIC IRQ */ |
424 | entry->msi_attrib.pos = pos; | 323 | entry->msi_attrib.pos = pos; |
425 | if (is_mask_bit_support(control)) { | 324 | if (is_mask_bit_support(control)) { |
@@ -507,6 +406,7 @@ static int msix_capability_init(struct pci_dev *dev, | |||
507 | entry->msi_attrib.is_64 = 1; | 406 | entry->msi_attrib.is_64 = 1; |
508 | entry->msi_attrib.entry_nr = j; | 407 | entry->msi_attrib.entry_nr = j; |
509 | entry->msi_attrib.maskbit = 1; | 408 | entry->msi_attrib.maskbit = 1; |
409 | entry->msi_attrib.masked = 1; | ||
510 | entry->msi_attrib.default_irq = dev->irq; | 410 | entry->msi_attrib.default_irq = dev->irq; |
511 | entry->msi_attrib.pos = pos; | 411 | entry->msi_attrib.pos = pos; |
512 | entry->dev = dev; | 412 | entry->dev = dev; |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index a32db0628157..d3eab057b2d3 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -551,7 +551,9 @@ static int pci_save_pcie_state(struct pci_dev *dev) | |||
551 | if (pos <= 0) | 551 | if (pos <= 0) |
552 | return 0; | 552 | return 0; |
553 | 553 | ||
554 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); | 554 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); |
555 | if (!save_state) | ||
556 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16) * 4, GFP_KERNEL); | ||
555 | if (!save_state) { | 557 | if (!save_state) { |
556 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); | 558 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); |
557 | return -ENOMEM; | 559 | return -ENOMEM; |
@@ -582,8 +584,6 @@ static void pci_restore_pcie_state(struct pci_dev *dev) | |||
582 | pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); | 584 | pci_write_config_word(dev, pos + PCI_EXP_LNKCTL, cap[i++]); |
583 | pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); | 585 | pci_write_config_word(dev, pos + PCI_EXP_SLTCTL, cap[i++]); |
584 | pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); | 586 | pci_write_config_word(dev, pos + PCI_EXP_RTCTL, cap[i++]); |
585 | pci_remove_saved_cap(save_state); | ||
586 | kfree(save_state); | ||
587 | } | 587 | } |
588 | 588 | ||
589 | 589 | ||
@@ -597,7 +597,9 @@ static int pci_save_pcix_state(struct pci_dev *dev) | |||
597 | if (pos <= 0) | 597 | if (pos <= 0) |
598 | return 0; | 598 | return 0; |
599 | 599 | ||
600 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); | 600 | save_state = pci_find_saved_cap(dev, PCI_CAP_ID_EXP); |
601 | if (!save_state) | ||
602 | save_state = kzalloc(sizeof(*save_state) + sizeof(u16), GFP_KERNEL); | ||
601 | if (!save_state) { | 603 | if (!save_state) { |
602 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); | 604 | dev_err(&dev->dev, "Out of memory in pci_save_pcie_state\n"); |
603 | return -ENOMEM; | 605 | return -ENOMEM; |
@@ -622,8 +624,6 @@ static void pci_restore_pcix_state(struct pci_dev *dev) | |||
622 | cap = (u16 *)&save_state->data[0]; | 624 | cap = (u16 *)&save_state->data[0]; |
623 | 625 | ||
624 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); | 626 | pci_write_config_word(dev, pos + PCI_X_CMD, cap[i++]); |
625 | pci_remove_saved_cap(save_state); | ||
626 | kfree(save_state); | ||
627 | } | 627 | } |
628 | 628 | ||
629 | 629 | ||
@@ -638,8 +638,6 @@ pci_save_state(struct pci_dev *dev) | |||
638 | /* XXX: 100% dword access ok here? */ | 638 | /* XXX: 100% dword access ok here? */ |
639 | for (i = 0; i < 16; i++) | 639 | for (i = 0; i < 16; i++) |
640 | pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); | 640 | pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]); |
641 | if ((i = pci_save_msi_state(dev)) != 0) | ||
642 | return i; | ||
643 | if ((i = pci_save_pcie_state(dev)) != 0) | 641 | if ((i = pci_save_pcie_state(dev)) != 0) |
644 | return i; | 642 | return i; |
645 | if ((i = pci_save_pcix_state(dev)) != 0) | 643 | if ((i = pci_save_pcix_state(dev)) != 0) |
diff --git a/drivers/pci/pci.h b/drivers/pci/pci.h index ae7a975995a5..62ea04c8af64 100644 --- a/drivers/pci/pci.h +++ b/drivers/pci/pci.h | |||
@@ -52,10 +52,8 @@ static inline void pci_no_msi(void) { } | |||
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) | 54 | #if defined(CONFIG_PCI_MSI) && defined(CONFIG_PM) |
55 | int pci_save_msi_state(struct pci_dev *dev); | ||
56 | void pci_restore_msi_state(struct pci_dev *dev); | 55 | void pci_restore_msi_state(struct pci_dev *dev); |
57 | #else | 56 | #else |
58 | static inline int pci_save_msi_state(struct pci_dev *dev) { return 0; } | ||
59 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} | 57 | static inline void pci_restore_msi_state(struct pci_dev *dev) {} |
60 | #endif | 58 | #endif |
61 | 59 | ||
diff --git a/drivers/pnp/manager.c b/drivers/pnp/manager.c index 5026b345cb30..57e6ab1004d0 100644 --- a/drivers/pnp/manager.c +++ b/drivers/pnp/manager.c | |||
@@ -451,7 +451,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
451 | return -EINVAL; | 451 | return -EINVAL; |
452 | 452 | ||
453 | if(!pnp_can_configure(dev)) { | 453 | if(!pnp_can_configure(dev)) { |
454 | pnp_info("Device %s does not support resource configuration.", dev->dev.bus_id); | 454 | pnp_dbg("Device %s does not support resource configuration.", dev->dev.bus_id); |
455 | return -ENODEV; | 455 | return -ENODEV; |
456 | } | 456 | } |
457 | 457 | ||
@@ -482,7 +482,7 @@ int pnp_auto_config_dev(struct pnp_dev *dev) | |||
482 | int pnp_start_dev(struct pnp_dev *dev) | 482 | int pnp_start_dev(struct pnp_dev *dev) |
483 | { | 483 | { |
484 | if (!pnp_can_write(dev)) { | 484 | if (!pnp_can_write(dev)) { |
485 | pnp_info("Device %s does not support activation.", dev->dev.bus_id); | 485 | pnp_dbg("Device %s does not support activation.", dev->dev.bus_id); |
486 | return -EINVAL; | 486 | return -EINVAL; |
487 | } | 487 | } |
488 | 488 | ||
@@ -506,7 +506,7 @@ int pnp_start_dev(struct pnp_dev *dev) | |||
506 | int pnp_stop_dev(struct pnp_dev *dev) | 506 | int pnp_stop_dev(struct pnp_dev *dev) |
507 | { | 507 | { |
508 | if (!pnp_can_disable(dev)) { | 508 | if (!pnp_can_disable(dev)) { |
509 | pnp_info("Device %s does not support disabling.", dev->dev.bus_id); | 509 | pnp_dbg("Device %s does not support disabling.", dev->dev.bus_id); |
510 | return -EINVAL; | 510 | return -EINVAL; |
511 | } | 511 | } |
512 | if (dev->protocol->disable(dev)<0) { | 512 | if (dev->protocol->disable(dev)<0) { |
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c index 1926b4d3e1f4..d21e04ccb021 100644 --- a/drivers/ps3/ps3av.c +++ b/drivers/ps3/ps3av.c | |||
@@ -24,6 +24,8 @@ | |||
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
26 | #include <linux/ioctl.h> | 26 | #include <linux/ioctl.h> |
27 | |||
28 | #include <asm/firmware.h> | ||
27 | #include <asm/lv1call.h> | 29 | #include <asm/lv1call.h> |
28 | #include <asm/ps3av.h> | 30 | #include <asm/ps3av.h> |
29 | #include <asm/ps3.h> | 31 | #include <asm/ps3.h> |
@@ -947,7 +949,12 @@ static struct ps3_vuart_port_driver ps3av_driver = { | |||
947 | 949 | ||
948 | static int ps3av_module_init(void) | 950 | static int ps3av_module_init(void) |
949 | { | 951 | { |
950 | int error = ps3_vuart_port_driver_register(&ps3av_driver); | 952 | int error; |
953 | |||
954 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
955 | return -ENODEV; | ||
956 | |||
957 | error = ps3_vuart_port_driver_register(&ps3av_driver); | ||
951 | if (error) { | 958 | if (error) { |
952 | printk(KERN_ERR | 959 | printk(KERN_ERR |
953 | "%s: ps3_vuart_port_driver_register failed %d\n", | 960 | "%s: ps3_vuart_port_driver_register failed %d\n", |
diff --git a/drivers/ps3/ps3av_cmd.c b/drivers/ps3/ps3av_cmd.c index 21c97c80aa2e..bc70e81f8cb0 100644 --- a/drivers/ps3/ps3av_cmd.c +++ b/drivers/ps3/ps3av_cmd.c | |||
@@ -485,12 +485,12 @@ static u8 ps3av_cnv_mclk(u32 fs) | |||
485 | 485 | ||
486 | static const u32 ps3av_ns_table[][5] = { | 486 | static const u32 ps3av_ns_table[][5] = { |
487 | /* D1, D2, D3, D4, D5 */ | 487 | /* D1, D2, D3, D4, D5 */ |
488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] { 6272, 6272, 17836, 17836, 8918 }, | 488 | [PS3AV_CMD_AUDIO_FS_44K-BASE] = { 6272, 6272, 17836, 17836, 8918 }, |
489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] { 6144, 6144, 11648, 11648, 5824 }, | 489 | [PS3AV_CMD_AUDIO_FS_48K-BASE] = { 6144, 6144, 11648, 11648, 5824 }, |
490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] { 12544, 12544, 35672, 35672, 17836 }, | 490 | [PS3AV_CMD_AUDIO_FS_88K-BASE] = { 12544, 12544, 35672, 35672, 17836 }, |
491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] { 12288, 12288, 23296, 23296, 11648 }, | 491 | [PS3AV_CMD_AUDIO_FS_96K-BASE] = { 12288, 12288, 23296, 23296, 11648 }, |
492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] { 25088, 25088, 71344, 71344, 35672 }, | 492 | [PS3AV_CMD_AUDIO_FS_176K-BASE] = { 25088, 25088, 71344, 71344, 35672 }, |
493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] { 24576, 24576, 46592, 46592, 23296 } | 493 | [PS3AV_CMD_AUDIO_FS_192K-BASE] = { 24576, 24576, 46592, 46592, 23296 } |
494 | }; | 494 | }; |
495 | 495 | ||
496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | 496 | static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) |
@@ -543,9 +543,10 @@ static void ps3av_cnv_ns(u8 *ns, u32 fs, u32 video_vid) | |||
543 | 543 | ||
544 | #undef BASE | 544 | #undef BASE |
545 | 545 | ||
546 | static u8 ps3av_cnv_enable(u32 source, u8 *enable) | 546 | static u8 ps3av_cnv_enable(u32 source, const u8 *enable) |
547 | { | 547 | { |
548 | u8 *p, ret = 0; | 548 | const u8 *p; |
549 | u8 ret = 0; | ||
549 | 550 | ||
550 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { | 551 | if (source == PS3AV_CMD_AUDIO_SOURCE_SPDIF) { |
551 | ret = 0x03; | 552 | ret = 0x03; |
@@ -559,9 +560,10 @@ static u8 ps3av_cnv_enable(u32 source, u8 *enable) | |||
559 | return ret; | 560 | return ret; |
560 | } | 561 | } |
561 | 562 | ||
562 | static u8 ps3av_cnv_fifomap(u8 *map) | 563 | static u8 ps3av_cnv_fifomap(const u8 *map) |
563 | { | 564 | { |
564 | u8 *p, ret = 0; | 565 | const u8 *p; |
566 | u8 ret = 0; | ||
565 | 567 | ||
566 | p = map; | 568 | p = map; |
567 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); | 569 | ret = p[0] + (p[1] << 2) + (p[2] << 4) + (p[3] << 6); |
@@ -615,7 +617,7 @@ static void ps3av_cnv_info(struct ps3av_audio_info_frame *info, | |||
615 | info->pb5.lsv = mode->audio_downmix_level; | 617 | info->pb5.lsv = mode->audio_downmix_level; |
616 | } | 618 | } |
617 | 619 | ||
618 | static void ps3av_cnv_chstat(u8 *chstat, u8 *cs_info) | 620 | static void ps3av_cnv_chstat(u8 *chstat, const u8 *cs_info) |
619 | { | 621 | { |
620 | memcpy(chstat, cs_info, 5); | 622 | memcpy(chstat, cs_info, 5); |
621 | } | 623 | } |
diff --git a/drivers/ps3/sys-manager.c b/drivers/ps3/sys-manager.c index 0fc30be8b81e..3aa2b0dcc369 100644 --- a/drivers/ps3/sys-manager.c +++ b/drivers/ps3/sys-manager.c | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <linux/reboot.h> | 24 | #include <linux/reboot.h> |
25 | |||
26 | #include <asm/firmware.h> | ||
25 | #include <asm/ps3.h> | 27 | #include <asm/ps3.h> |
28 | |||
26 | #include "vuart.h" | 29 | #include "vuart.h" |
27 | 30 | ||
28 | MODULE_AUTHOR("Sony Corporation"); | 31 | MODULE_AUTHOR("Sony Corporation"); |
@@ -598,6 +601,9 @@ static struct ps3_vuart_port_driver ps3_sys_manager = { | |||
598 | 601 | ||
599 | static int __init ps3_sys_manager_init(void) | 602 | static int __init ps3_sys_manager_init(void) |
600 | { | 603 | { |
604 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | ||
605 | return -ENODEV; | ||
606 | |||
601 | return ps3_vuart_port_driver_register(&ps3_sys_manager); | 607 | return ps3_vuart_port_driver_register(&ps3_sys_manager); |
602 | } | 608 | } |
603 | 609 | ||
diff --git a/drivers/ps3/vuart.c b/drivers/ps3/vuart.c index 746298107d6f..6c12744eeb9d 100644 --- a/drivers/ps3/vuart.c +++ b/drivers/ps3/vuart.c | |||
@@ -952,7 +952,7 @@ fail_alloc_irq: | |||
952 | kfree(dev->priv); | 952 | kfree(dev->priv); |
953 | dev->priv = NULL; | 953 | dev->priv = NULL; |
954 | fail_alloc: | 954 | fail_alloc: |
955 | vuart_bus_priv.devices[port_number] = 0; | 955 | vuart_bus_priv.devices[port_number] = NULL; |
956 | fail_match: | 956 | fail_match: |
957 | up(&vuart_bus_priv.probe_mutex); | 957 | up(&vuart_bus_priv.probe_mutex); |
958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); | 958 | dev_dbg(&dev->core, "%s:%d failed\n", __func__, __LINE__); |
@@ -978,7 +978,7 @@ static int ps3_vuart_remove(struct device *_dev) | |||
978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, | 978 | dev_dbg(&dev->core, "%s:%d: %s no remove method\n", __func__, |
979 | __LINE__, dev->core.bus_id); | 979 | __LINE__, dev->core.bus_id); |
980 | 980 | ||
981 | vuart_bus_priv.devices[dev->priv->port_number] = 0; | 981 | vuart_bus_priv.devices[dev->priv->port_number] = NULL; |
982 | 982 | ||
983 | if (--vuart_bus_priv.use_count == 0) { | 983 | if (--vuart_bus_priv.use_count == 0) { |
984 | BUG(); | 984 | BUG(); |
@@ -1031,7 +1031,7 @@ int __init ps3_vuart_bus_init(void) | |||
1031 | pr_debug("%s:%d:\n", __func__, __LINE__); | 1031 | pr_debug("%s:%d:\n", __func__, __LINE__); |
1032 | 1032 | ||
1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) | 1033 | if (!firmware_has_feature(FW_FEATURE_PS3_LV1)) |
1034 | return 0; | 1034 | return -ENODEV; |
1035 | 1035 | ||
1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); | 1036 | init_MUTEX(&vuart_bus_priv.probe_mutex); |
1037 | result = bus_register(&ps3_vuart_bus); | 1037 | result = bus_register(&ps3_vuart_bus); |
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index d48e3ca4752c..5aeb68e732b0 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -71,19 +71,31 @@ __ccwgroup_remove_symlinks(struct ccwgroup_device *gdev) | |||
71 | * Provide an 'ungroup' attribute so the user can remove group devices no | 71 | * Provide an 'ungroup' attribute so the user can remove group devices no |
72 | * longer needed or accidentially created. Saves memory :) | 72 | * longer needed or accidentially created. Saves memory :) |
73 | */ | 73 | */ |
74 | static void ccwgroup_ungroup_callback(struct device *dev) | ||
75 | { | ||
76 | struct ccwgroup_device *gdev = to_ccwgroupdev(dev); | ||
77 | |||
78 | __ccwgroup_remove_symlinks(gdev); | ||
79 | device_unregister(dev); | ||
80 | } | ||
81 | |||
74 | static ssize_t | 82 | static ssize_t |
75 | ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) | 83 | ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) |
76 | { | 84 | { |
77 | struct ccwgroup_device *gdev; | 85 | struct ccwgroup_device *gdev; |
86 | int rc; | ||
78 | 87 | ||
79 | gdev = to_ccwgroupdev(dev); | 88 | gdev = to_ccwgroupdev(dev); |
80 | 89 | ||
81 | if (gdev->state != CCWGROUP_OFFLINE) | 90 | if (gdev->state != CCWGROUP_OFFLINE) |
82 | return -EINVAL; | 91 | return -EINVAL; |
83 | 92 | ||
84 | __ccwgroup_remove_symlinks(gdev); | 93 | /* Note that we cannot unregister the device from one of its |
85 | device_unregister(dev); | 94 | * attribute methods, so we have to use this roundabout approach. |
86 | 95 | */ | |
96 | rc = device_schedule_callback(dev, ccwgroup_ungroup_callback); | ||
97 | if (rc) | ||
98 | count = rc; | ||
87 | return count; | 99 | return count; |
88 | } | 100 | } |
89 | 101 | ||
diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index 5b1e3ff26c0b..05fac0733f3d 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c | |||
@@ -210,9 +210,11 @@ again: | |||
210 | goto again; | 210 | goto again; |
211 | } | 211 | } |
212 | if (rc < 0) { | 212 | if (rc < 0) { |
213 | QDIO_DBF_TEXT3(1,trace,"sqberr"); | 213 | QDIO_DBF_TEXT3(1,trace,"sqberr"); |
214 | sprintf(dbf_text,"%2x,%2x,%d,%d",tmp_cnt,*cnt,ccq,q_no); | 214 | sprintf(dbf_text,"%2x,%2x",tmp_cnt,*cnt); |
215 | QDIO_DBF_TEXT3(1,trace,dbf_text); | 215 | QDIO_DBF_TEXT3(1,trace,dbf_text); |
216 | sprintf(dbf_text,"%d,%d",ccq,q_no); | ||
217 | QDIO_DBF_TEXT3(1,trace,dbf_text); | ||
216 | q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION| | 218 | q->handler(q->cdev,QDIO_STATUS_ACTIVATE_CHECK_CONDITION| |
217 | QDIO_STATUS_LOOK_FOR_ERROR, | 219 | QDIO_STATUS_LOOK_FOR_ERROR, |
218 | 0, 0, 0, -1, -1, q->int_parm); | 220 | 0, 0, 0, -1, -1, q->int_parm); |
@@ -1250,7 +1252,6 @@ qdio_is_inbound_q_done(struct qdio_q *q) | |||
1250 | if (!no_used) { | 1252 | if (!no_used) { |
1251 | QDIO_DBF_TEXT4(0,trace,"inqisdnA"); | 1253 | QDIO_DBF_TEXT4(0,trace,"inqisdnA"); |
1252 | QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); | 1254 | QDIO_DBF_HEX4(0,trace,&q,sizeof(void*)); |
1253 | QDIO_DBF_TEXT4(0,trace,dbf_text); | ||
1254 | return 1; | 1255 | return 1; |
1255 | } | 1256 | } |
1256 | if (irq->is_qebsm) { | 1257 | if (irq->is_qebsm) { |
@@ -3371,10 +3372,15 @@ qdio_do_qdio_fill_input(struct qdio_q *q, unsigned int qidx, | |||
3371 | unsigned int count, struct qdio_buffer *buffers) | 3372 | unsigned int count, struct qdio_buffer *buffers) |
3372 | { | 3373 | { |
3373 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; | 3374 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; |
3375 | int tmp = 0; | ||
3376 | |||
3374 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); | 3377 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); |
3375 | if (irq->is_qebsm) { | 3378 | if (irq->is_qebsm) { |
3376 | while (count) | 3379 | while (count) { |
3377 | set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count); | 3380 | tmp = set_slsb(q, &qidx, SLSB_CU_INPUT_EMPTY, &count); |
3381 | if (!tmp) | ||
3382 | return; | ||
3383 | } | ||
3378 | return; | 3384 | return; |
3379 | } | 3385 | } |
3380 | for (;;) { | 3386 | for (;;) { |
@@ -3390,11 +3396,15 @@ qdio_do_qdio_fill_output(struct qdio_q *q, unsigned int qidx, | |||
3390 | unsigned int count, struct qdio_buffer *buffers) | 3396 | unsigned int count, struct qdio_buffer *buffers) |
3391 | { | 3397 | { |
3392 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; | 3398 | struct qdio_irq *irq = (struct qdio_irq *) q->irq_ptr; |
3399 | int tmp = 0; | ||
3393 | 3400 | ||
3394 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); | 3401 | qidx &= (QDIO_MAX_BUFFERS_PER_Q - 1); |
3395 | if (irq->is_qebsm) { | 3402 | if (irq->is_qebsm) { |
3396 | while (count) | 3403 | while (count) { |
3397 | set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count); | 3404 | tmp = set_slsb(q, &qidx, SLSB_CU_OUTPUT_PRIMED, &count); |
3405 | if (!tmp) | ||
3406 | return; | ||
3407 | } | ||
3398 | return; | 3408 | return; |
3399 | } | 3409 | } |
3400 | 3410 | ||
diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index c7d1355237b6..181b51772b1b 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c | |||
@@ -65,6 +65,8 @@ module_param_named(poll_thread, ap_thread_flag, int, 0000); | |||
65 | MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on)."); | 65 | MODULE_PARM_DESC(poll_thread, "Turn on/off poll thread, default is 1 (on)."); |
66 | 66 | ||
67 | static struct device *ap_root_device = NULL; | 67 | static struct device *ap_root_device = NULL; |
68 | static DEFINE_SPINLOCK(ap_device_lock); | ||
69 | static LIST_HEAD(ap_device_list); | ||
68 | 70 | ||
69 | /** | 71 | /** |
70 | * Workqueue & timer for bus rescan. | 72 | * Workqueue & timer for bus rescan. |
@@ -457,6 +459,9 @@ static int ap_device_probe(struct device *dev) | |||
457 | int rc; | 459 | int rc; |
458 | 460 | ||
459 | ap_dev->drv = ap_drv; | 461 | ap_dev->drv = ap_drv; |
462 | spin_lock_bh(&ap_device_lock); | ||
463 | list_add(&ap_dev->list, &ap_device_list); | ||
464 | spin_unlock_bh(&ap_device_lock); | ||
460 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; | 465 | rc = ap_drv->probe ? ap_drv->probe(ap_dev) : -ENODEV; |
461 | return rc; | 466 | return rc; |
462 | } | 467 | } |
@@ -497,6 +502,9 @@ static int ap_device_remove(struct device *dev) | |||
497 | ap_flush_queue(ap_dev); | 502 | ap_flush_queue(ap_dev); |
498 | if (ap_drv->remove) | 503 | if (ap_drv->remove) |
499 | ap_drv->remove(ap_dev); | 504 | ap_drv->remove(ap_dev); |
505 | spin_lock_bh(&ap_device_lock); | ||
506 | list_del_init(&ap_dev->list); | ||
507 | spin_unlock_bh(&ap_device_lock); | ||
500 | return 0; | 508 | return 0; |
501 | } | 509 | } |
502 | 510 | ||
@@ -772,6 +780,7 @@ static void ap_scan_bus(struct work_struct *unused) | |||
772 | spin_lock_init(&ap_dev->lock); | 780 | spin_lock_init(&ap_dev->lock); |
773 | INIT_LIST_HEAD(&ap_dev->pendingq); | 781 | INIT_LIST_HEAD(&ap_dev->pendingq); |
774 | INIT_LIST_HEAD(&ap_dev->requestq); | 782 | INIT_LIST_HEAD(&ap_dev->requestq); |
783 | INIT_LIST_HEAD(&ap_dev->list); | ||
775 | if (device_type == 0) | 784 | if (device_type == 0) |
776 | ap_probe_device_type(ap_dev); | 785 | ap_probe_device_type(ap_dev); |
777 | else | 786 | else |
@@ -1033,14 +1042,13 @@ static void ap_poll_timeout(unsigned long unused) | |||
1033 | * polling until bit 2^0 of the control flags is not set. If bit 2^1 | 1042 | * polling until bit 2^0 of the control flags is not set. If bit 2^1 |
1034 | * of the control flags has been set arm the poll timer. | 1043 | * of the control flags has been set arm the poll timer. |
1035 | */ | 1044 | */ |
1036 | static int __ap_poll_all(struct device *dev, void *data) | 1045 | static int __ap_poll_all(struct ap_device *ap_dev, unsigned long *flags) |
1037 | { | 1046 | { |
1038 | struct ap_device *ap_dev = to_ap_dev(dev); | ||
1039 | int rc; | 1047 | int rc; |
1040 | 1048 | ||
1041 | spin_lock(&ap_dev->lock); | 1049 | spin_lock(&ap_dev->lock); |
1042 | if (!ap_dev->unregistered) { | 1050 | if (!ap_dev->unregistered) { |
1043 | rc = ap_poll_queue(to_ap_dev(dev), (unsigned long *) data); | 1051 | rc = ap_poll_queue(ap_dev, flags); |
1044 | if (rc) | 1052 | if (rc) |
1045 | ap_dev->unregistered = 1; | 1053 | ap_dev->unregistered = 1; |
1046 | } else | 1054 | } else |
@@ -1054,10 +1062,15 @@ static int __ap_poll_all(struct device *dev, void *data) | |||
1054 | static void ap_poll_all(unsigned long dummy) | 1062 | static void ap_poll_all(unsigned long dummy) |
1055 | { | 1063 | { |
1056 | unsigned long flags; | 1064 | unsigned long flags; |
1065 | struct ap_device *ap_dev; | ||
1057 | 1066 | ||
1058 | do { | 1067 | do { |
1059 | flags = 0; | 1068 | flags = 0; |
1060 | bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); | 1069 | spin_lock(&ap_device_lock); |
1070 | list_for_each_entry(ap_dev, &ap_device_list, list) { | ||
1071 | __ap_poll_all(ap_dev, &flags); | ||
1072 | } | ||
1073 | spin_unlock(&ap_device_lock); | ||
1061 | } while (flags & 1); | 1074 | } while (flags & 1); |
1062 | if (flags & 2) | 1075 | if (flags & 2) |
1063 | ap_schedule_poll_timer(); | 1076 | ap_schedule_poll_timer(); |
@@ -1075,6 +1088,7 @@ static int ap_poll_thread(void *data) | |||
1075 | DECLARE_WAITQUEUE(wait, current); | 1088 | DECLARE_WAITQUEUE(wait, current); |
1076 | unsigned long flags; | 1089 | unsigned long flags; |
1077 | int requests; | 1090 | int requests; |
1091 | struct ap_device *ap_dev; | ||
1078 | 1092 | ||
1079 | set_user_nice(current, 19); | 1093 | set_user_nice(current, 19); |
1080 | while (1) { | 1094 | while (1) { |
@@ -1092,10 +1106,12 @@ static int ap_poll_thread(void *data) | |||
1092 | set_current_state(TASK_RUNNING); | 1106 | set_current_state(TASK_RUNNING); |
1093 | remove_wait_queue(&ap_poll_wait, &wait); | 1107 | remove_wait_queue(&ap_poll_wait, &wait); |
1094 | 1108 | ||
1095 | local_bh_disable(); | ||
1096 | flags = 0; | 1109 | flags = 0; |
1097 | bus_for_each_dev(&ap_bus_type, NULL, &flags, __ap_poll_all); | 1110 | spin_lock_bh(&ap_device_lock); |
1098 | local_bh_enable(); | 1111 | list_for_each_entry(ap_dev, &ap_device_list, list) { |
1112 | __ap_poll_all(ap_dev, &flags); | ||
1113 | } | ||
1114 | spin_unlock_bh(&ap_device_lock); | ||
1099 | } | 1115 | } |
1100 | set_current_state(TASK_RUNNING); | 1116 | set_current_state(TASK_RUNNING); |
1101 | remove_wait_queue(&ap_poll_wait, &wait); | 1117 | remove_wait_queue(&ap_poll_wait, &wait); |
diff --git a/drivers/s390/crypto/ap_bus.h b/drivers/s390/crypto/ap_bus.h index 83b69c01cd6e..008559ea742b 100644 --- a/drivers/s390/crypto/ap_bus.h +++ b/drivers/s390/crypto/ap_bus.h | |||
@@ -106,6 +106,7 @@ struct ap_device { | |||
106 | struct device device; | 106 | struct device device; |
107 | struct ap_driver *drv; /* Pointer to AP device driver. */ | 107 | struct ap_driver *drv; /* Pointer to AP device driver. */ |
108 | spinlock_t lock; /* Per device lock. */ | 108 | spinlock_t lock; /* Per device lock. */ |
109 | struct list_head list; /* private list of all AP devices. */ | ||
109 | 110 | ||
110 | ap_qid_t qid; /* AP queue id. */ | 111 | ap_qid_t qid; /* AP queue id. */ |
111 | int queue_depth; /* AP queue depth.*/ | 112 | int queue_depth; /* AP queue depth.*/ |
diff --git a/drivers/s390/crypto/zcrypt_api.c b/drivers/s390/crypto/zcrypt_api.c index 99761391f340..e3625a47a596 100644 --- a/drivers/s390/crypto/zcrypt_api.c +++ b/drivers/s390/crypto/zcrypt_api.c | |||
@@ -298,14 +298,14 @@ static long zcrypt_rsa_modexpo(struct ica_rsa_modexpo *mex) | |||
298 | get_device(&zdev->ap_dev->device); | 298 | get_device(&zdev->ap_dev->device); |
299 | zdev->request_count++; | 299 | zdev->request_count++; |
300 | __zcrypt_decrease_preference(zdev); | 300 | __zcrypt_decrease_preference(zdev); |
301 | spin_unlock_bh(&zcrypt_device_lock); | ||
302 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 301 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
302 | spin_unlock_bh(&zcrypt_device_lock); | ||
303 | rc = zdev->ops->rsa_modexpo(zdev, mex); | 303 | rc = zdev->ops->rsa_modexpo(zdev, mex); |
304 | spin_lock_bh(&zcrypt_device_lock); | ||
304 | module_put(zdev->ap_dev->drv->driver.owner); | 305 | module_put(zdev->ap_dev->drv->driver.owner); |
305 | } | 306 | } |
306 | else | 307 | else |
307 | rc = -EAGAIN; | 308 | rc = -EAGAIN; |
308 | spin_lock_bh(&zcrypt_device_lock); | ||
309 | zdev->request_count--; | 309 | zdev->request_count--; |
310 | __zcrypt_increase_preference(zdev); | 310 | __zcrypt_increase_preference(zdev); |
311 | put_device(&zdev->ap_dev->device); | 311 | put_device(&zdev->ap_dev->device); |
@@ -373,14 +373,14 @@ static long zcrypt_rsa_crt(struct ica_rsa_modexpo_crt *crt) | |||
373 | get_device(&zdev->ap_dev->device); | 373 | get_device(&zdev->ap_dev->device); |
374 | zdev->request_count++; | 374 | zdev->request_count++; |
375 | __zcrypt_decrease_preference(zdev); | 375 | __zcrypt_decrease_preference(zdev); |
376 | spin_unlock_bh(&zcrypt_device_lock); | ||
377 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 376 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
377 | spin_unlock_bh(&zcrypt_device_lock); | ||
378 | rc = zdev->ops->rsa_modexpo_crt(zdev, crt); | 378 | rc = zdev->ops->rsa_modexpo_crt(zdev, crt); |
379 | spin_lock_bh(&zcrypt_device_lock); | ||
379 | module_put(zdev->ap_dev->drv->driver.owner); | 380 | module_put(zdev->ap_dev->drv->driver.owner); |
380 | } | 381 | } |
381 | else | 382 | else |
382 | rc = -EAGAIN; | 383 | rc = -EAGAIN; |
383 | spin_lock_bh(&zcrypt_device_lock); | ||
384 | zdev->request_count--; | 384 | zdev->request_count--; |
385 | __zcrypt_increase_preference(zdev); | 385 | __zcrypt_increase_preference(zdev); |
386 | put_device(&zdev->ap_dev->device); | 386 | put_device(&zdev->ap_dev->device); |
@@ -408,14 +408,14 @@ static long zcrypt_send_cprb(struct ica_xcRB *xcRB) | |||
408 | get_device(&zdev->ap_dev->device); | 408 | get_device(&zdev->ap_dev->device); |
409 | zdev->request_count++; | 409 | zdev->request_count++; |
410 | __zcrypt_decrease_preference(zdev); | 410 | __zcrypt_decrease_preference(zdev); |
411 | spin_unlock_bh(&zcrypt_device_lock); | ||
412 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { | 411 | if (try_module_get(zdev->ap_dev->drv->driver.owner)) { |
412 | spin_unlock_bh(&zcrypt_device_lock); | ||
413 | rc = zdev->ops->send_cprb(zdev, xcRB); | 413 | rc = zdev->ops->send_cprb(zdev, xcRB); |
414 | spin_lock_bh(&zcrypt_device_lock); | ||
414 | module_put(zdev->ap_dev->drv->driver.owner); | 415 | module_put(zdev->ap_dev->drv->driver.owner); |
415 | } | 416 | } |
416 | else | 417 | else |
417 | rc = -EAGAIN; | 418 | rc = -EAGAIN; |
418 | spin_lock_bh(&zcrypt_device_lock); | ||
419 | zdev->request_count--; | 419 | zdev->request_count--; |
420 | __zcrypt_increase_preference(zdev); | 420 | __zcrypt_increase_preference(zdev); |
421 | put_device(&zdev->ap_dev->device); | 421 | put_device(&zdev->ap_dev->device); |
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index e95c281f1e36..84b108d7c7fd 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -873,7 +873,7 @@ qeth_realloc_headroom(struct qeth_card *card, struct sk_buff *skb, int size) | |||
873 | } | 873 | } |
874 | 874 | ||
875 | static inline struct sk_buff * | 875 | static inline struct sk_buff * |
876 | qeth_pskb_unshare(struct sk_buff *skb, int pri) | 876 | qeth_pskb_unshare(struct sk_buff *skb, gfp_t pri) |
877 | { | 877 | { |
878 | struct sk_buff *nskb; | 878 | struct sk_buff *nskb; |
879 | if (!skb_cloned(skb)) | 879 | if (!skb_cloned(skb)) |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index c275dcac3f18..939de0de18bc 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -452,10 +452,22 @@ store_rescan_field (struct device *dev, struct device_attribute *attr, const cha | |||
452 | } | 452 | } |
453 | static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); | 453 | static DEVICE_ATTR(rescan, S_IWUSR, NULL, store_rescan_field); |
454 | 454 | ||
455 | static void sdev_store_delete_callback(struct device *dev) | ||
456 | { | ||
457 | scsi_remove_device(to_scsi_device(dev)); | ||
458 | } | ||
459 | |||
455 | static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf, | 460 | static ssize_t sdev_store_delete(struct device *dev, struct device_attribute *attr, const char *buf, |
456 | size_t count) | 461 | size_t count) |
457 | { | 462 | { |
458 | scsi_remove_device(to_scsi_device(dev)); | 463 | int rc; |
464 | |||
465 | /* An attribute cannot be unregistered by one of its own methods, | ||
466 | * so we have to use this roundabout approach. | ||
467 | */ | ||
468 | rc = device_schedule_callback(dev, sdev_store_delete_callback); | ||
469 | if (rc) | ||
470 | count = rc; | ||
459 | return count; | 471 | return count; |
460 | }; | 472 | }; |
461 | static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); | 473 | static DEVICE_ATTR(delete, S_IWUSR, NULL, sdev_store_delete); |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index c53b69610a51..46c40bbc4bc6 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -17,6 +17,9 @@ | |||
17 | * License. See the file "COPYING" in the main directory of this archive | 17 | * License. See the file "COPYING" in the main directory of this archive |
18 | * for more details. | 18 | * for more details. |
19 | */ | 19 | */ |
20 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | ||
21 | #define SUPPORT_SYSRQ | ||
22 | #endif | ||
20 | 23 | ||
21 | #undef DEBUG | 24 | #undef DEBUG |
22 | 25 | ||
@@ -49,11 +52,6 @@ | |||
49 | #endif | 52 | #endif |
50 | 53 | ||
51 | #include <asm/sci.h> | 54 | #include <asm/sci.h> |
52 | |||
53 | #if defined(CONFIG_SERIAL_SH_SCI_CONSOLE) && defined(CONFIG_MAGIC_SYSRQ) | ||
54 | #define SUPPORT_SYSRQ | ||
55 | #endif | ||
56 | |||
57 | #include "sh-sci.h" | 55 | #include "sh-sci.h" |
58 | 56 | ||
59 | struct sci_port { | 57 | struct sci_port { |
@@ -645,6 +643,9 @@ static inline int sci_handle_breaks(struct uart_port *port) | |||
645 | struct tty_struct *tty = port->info->tty; | 643 | struct tty_struct *tty = port->info->tty; |
646 | struct sci_port *s = &sci_ports[port->line]; | 644 | struct sci_port *s = &sci_ports[port->line]; |
647 | 645 | ||
646 | if (uart_handle_break(port)) | ||
647 | return 0; | ||
648 | |||
648 | if (!s->break_flag && status & SCxSR_BRK(port)) { | 649 | if (!s->break_flag && status & SCxSR_BRK(port)) { |
649 | #if defined(CONFIG_CPU_SH3) | 650 | #if defined(CONFIG_CPU_SH3) |
650 | /* Debounce break */ | 651 | /* Debounce break */ |
diff --git a/drivers/spi/at25.c b/drivers/spi/at25.c index 48e4f48e779f..8efa07e8b8c2 100644 --- a/drivers/spi/at25.c +++ b/drivers/spi/at25.c | |||
@@ -291,7 +291,7 @@ static int at25_probe(struct spi_device *spi) | |||
291 | */ | 291 | */ |
292 | sr = spi_w8r8(spi, AT25_RDSR); | 292 | sr = spi_w8r8(spi, AT25_RDSR); |
293 | if (sr < 0 || sr & AT25_SR_nRDY) { | 293 | if (sr < 0 || sr & AT25_SR_nRDY) { |
294 | dev_dbg(&at25->spi->dev, "rdsr --> %d (%02x)\n", sr, sr); | 294 | dev_dbg(&spi->dev, "rdsr --> %d (%02x)\n", sr, sr); |
295 | err = -ENXIO; | 295 | err = -ENXIO; |
296 | goto fail; | 296 | goto fail; |
297 | } | 297 | } |
diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c index 6fa260d1a9be..66e7bc985797 100644 --- a/drivers/spi/atmel_spi.c +++ b/drivers/spi/atmel_spi.c | |||
@@ -425,7 +425,7 @@ static int atmel_spi_setup(struct spi_device *spi) | |||
425 | if (ret) | 425 | if (ret) |
426 | return ret; | 426 | return ret; |
427 | spi->controller_state = (void *)npcs_pin; | 427 | spi->controller_state = (void *)npcs_pin; |
428 | gpio_direction_output(npcs_pin); | 428 | gpio_direction_output(npcs_pin, !(spi->mode & SPI_CS_HIGH)); |
429 | } | 429 | } |
430 | 430 | ||
431 | dev_dbg(&spi->dev, | 431 | dev_dbg(&spi->dev, |
diff --git a/drivers/spi/spi_bitbang.c b/drivers/spi/spi_bitbang.c index 24a330d82395..88425e1af4d3 100644 --- a/drivers/spi/spi_bitbang.c +++ b/drivers/spi/spi_bitbang.c | |||
@@ -302,10 +302,6 @@ static void bitbang_work(struct work_struct *work) | |||
302 | setup_transfer = NULL; | 302 | setup_transfer = NULL; |
303 | 303 | ||
304 | list_for_each_entry (t, &m->transfers, transfer_list) { | 304 | list_for_each_entry (t, &m->transfers, transfer_list) { |
305 | if (bitbang->shutdown) { | ||
306 | status = -ESHUTDOWN; | ||
307 | break; | ||
308 | } | ||
309 | 305 | ||
310 | /* override or restore speed and wordsize */ | 306 | /* override or restore speed and wordsize */ |
311 | if (t->speed_hz || t->bits_per_word) { | 307 | if (t->speed_hz || t->bits_per_word) { |
@@ -410,8 +406,6 @@ int spi_bitbang_transfer(struct spi_device *spi, struct spi_message *m) | |||
410 | m->status = -EINPROGRESS; | 406 | m->status = -EINPROGRESS; |
411 | 407 | ||
412 | bitbang = spi_master_get_devdata(spi->master); | 408 | bitbang = spi_master_get_devdata(spi->master); |
413 | if (bitbang->shutdown) | ||
414 | return -ESHUTDOWN; | ||
415 | 409 | ||
416 | spin_lock_irqsave(&bitbang->lock, flags); | 410 | spin_lock_irqsave(&bitbang->lock, flags); |
417 | if (!spi->max_speed_hz) | 411 | if (!spi->max_speed_hz) |
@@ -507,28 +501,12 @@ EXPORT_SYMBOL_GPL(spi_bitbang_start); | |||
507 | */ | 501 | */ |
508 | int spi_bitbang_stop(struct spi_bitbang *bitbang) | 502 | int spi_bitbang_stop(struct spi_bitbang *bitbang) |
509 | { | 503 | { |
510 | unsigned limit = 500; | 504 | spi_unregister_master(bitbang->master); |
511 | |||
512 | spin_lock_irq(&bitbang->lock); | ||
513 | bitbang->shutdown = 0; | ||
514 | while (!list_empty(&bitbang->queue) && limit--) { | ||
515 | spin_unlock_irq(&bitbang->lock); | ||
516 | 505 | ||
517 | dev_dbg(bitbang->master->cdev.dev, "wait for queue\n"); | 506 | WARN_ON(!list_empty(&bitbang->queue)); |
518 | msleep(10); | ||
519 | |||
520 | spin_lock_irq(&bitbang->lock); | ||
521 | } | ||
522 | spin_unlock_irq(&bitbang->lock); | ||
523 | if (!list_empty(&bitbang->queue)) { | ||
524 | dev_err(bitbang->master->cdev.dev, "queue didn't empty\n"); | ||
525 | return -EBUSY; | ||
526 | } | ||
527 | 507 | ||
528 | destroy_workqueue(bitbang->workqueue); | 508 | destroy_workqueue(bitbang->workqueue); |
529 | 509 | ||
530 | spi_unregister_master(bitbang->master); | ||
531 | |||
532 | return 0; | 510 | return 0; |
533 | } | 511 | } |
534 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); | 512 | EXPORT_SYMBOL_GPL(spi_bitbang_stop); |
diff --git a/drivers/spi/spi_s3c24xx.c b/drivers/spi/spi_s3c24xx.c index 651379c51ae6..220abce63e4a 100644 --- a/drivers/spi/spi_s3c24xx.c +++ b/drivers/spi/spi_s3c24xx.c | |||
@@ -41,7 +41,7 @@ struct s3c24xx_spi { | |||
41 | int len; | 41 | int len; |
42 | int count; | 42 | int count; |
43 | 43 | ||
44 | int (*set_cs)(struct s3c2410_spi_info *spi, | 44 | void (*set_cs)(struct s3c2410_spi_info *spi, |
45 | int cs, int pol); | 45 | int cs, int pol); |
46 | 46 | ||
47 | /* data buffers */ | 47 | /* data buffers */ |
diff --git a/drivers/usb/class/usblp.c b/drivers/usb/class/usblp.c index 63e50a1f1396..6584cf00f7f3 100644 --- a/drivers/usb/class/usblp.c +++ b/drivers/usb/class/usblp.c | |||
@@ -202,6 +202,7 @@ struct quirk_printer_struct { | |||
202 | 202 | ||
203 | #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ | 203 | #define USBLP_QUIRK_BIDIR 0x1 /* reports bidir but requires unidirectional mode (no INs/reads) */ |
204 | #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ | 204 | #define USBLP_QUIRK_USB_INIT 0x2 /* needs vendor USB init string */ |
205 | #define USBLP_QUIRK_BAD_CLASS 0x4 /* descriptor uses vendor-specific Class or SubClass */ | ||
205 | 206 | ||
206 | static const struct quirk_printer_struct quirk_printers[] = { | 207 | static const struct quirk_printer_struct quirk_printers[] = { |
207 | { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ | 208 | { 0x03f0, 0x0004, USBLP_QUIRK_BIDIR }, /* HP DeskJet 895C */ |
@@ -218,6 +219,7 @@ static const struct quirk_printer_struct quirk_printers[] = { | |||
218 | { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ | 219 | { 0x0409, 0xf0be, USBLP_QUIRK_BIDIR }, /* NEC Picty920 (HP OEM) */ |
219 | { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ | 220 | { 0x0409, 0xf1be, USBLP_QUIRK_BIDIR }, /* NEC Picty800 (HP OEM) */ |
220 | { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */ | 221 | { 0x0482, 0x0010, USBLP_QUIRK_BIDIR }, /* Kyocera Mita FS 820, by zut <kernel@zut.de> */ |
222 | { 0x04b8, 0x0202, USBLP_QUIRK_BAD_CLASS }, /* Seiko Epson Receipt Printer M129C */ | ||
221 | { 0, 0 } | 223 | { 0, 0 } |
222 | }; | 224 | }; |
223 | 225 | ||
@@ -1048,7 +1050,8 @@ static int usblp_select_alts(struct usblp *usblp) | |||
1048 | ifd = &if_alt->altsetting[i]; | 1050 | ifd = &if_alt->altsetting[i]; |
1049 | 1051 | ||
1050 | if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1) | 1052 | if (ifd->desc.bInterfaceClass != 7 || ifd->desc.bInterfaceSubClass != 1) |
1051 | continue; | 1053 | if (!(usblp->quirks & USBLP_QUIRK_BAD_CLASS)) |
1054 | continue; | ||
1052 | 1055 | ||
1053 | if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL || | 1056 | if (ifd->desc.bInterfaceProtocol < USBLP_FIRST_PROTOCOL || |
1054 | ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL) | 1057 | ifd->desc.bInterfaceProtocol > USBLP_LAST_PROTOCOL) |
@@ -1232,6 +1235,7 @@ static struct usb_device_id usblp_ids [] = { | |||
1232 | { USB_INTERFACE_INFO(7, 1, 1) }, | 1235 | { USB_INTERFACE_INFO(7, 1, 1) }, |
1233 | { USB_INTERFACE_INFO(7, 1, 2) }, | 1236 | { USB_INTERFACE_INFO(7, 1, 2) }, |
1234 | { USB_INTERFACE_INFO(7, 1, 3) }, | 1237 | { USB_INTERFACE_INFO(7, 1, 3) }, |
1238 | { USB_DEVICE(0x04b8, 0x0202) }, /* Seiko Epson Receipt Printer M129C */ | ||
1235 | { } /* Terminating entry */ | 1239 | { } /* Terminating entry */ |
1236 | }; | 1240 | }; |
1237 | 1241 | ||
diff --git a/drivers/usb/misc/berry_charge.c b/drivers/usb/misc/berry_charge.c index 60893c6c8221..b15f2fd8dab4 100644 --- a/drivers/usb/misc/berry_charge.c +++ b/drivers/usb/misc/berry_charge.c | |||
@@ -69,7 +69,7 @@ static int magic_charge(struct usb_device *udev) | |||
69 | return retval; | 69 | return retval; |
70 | } | 70 | } |
71 | 71 | ||
72 | dbg(&udev->dev, "Sending first magic command\n"); | 72 | dbg(&udev->dev, "Sending second magic command\n"); |
73 | retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), | 73 | retval = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), |
74 | 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100); | 74 | 0xa2, 0x40, 0, 1, dummy_buffer, 0, 100); |
75 | if (retval != 0) { | 75 | if (retval != 0) { |
diff --git a/drivers/usb/net/dm9601.c b/drivers/usb/net/dm9601.c index c0bc52be5e10..5130cc7eb314 100644 --- a/drivers/usb/net/dm9601.c +++ b/drivers/usb/net/dm9601.c | |||
@@ -578,6 +578,14 @@ static const struct usb_device_id products[] = { | |||
578 | USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ | 578 | USB_DEVICE(0x0a46, 0x9601), /* Davicom USB-100 */ |
579 | .driver_info = (unsigned long)&dm9601_info, | 579 | .driver_info = (unsigned long)&dm9601_info, |
580 | }, | 580 | }, |
581 | { | ||
582 | USB_DEVICE(0x0a46, 0x6688), /* ZT6688 USB NIC */ | ||
583 | .driver_info = (unsigned long)&dm9601_info, | ||
584 | }, | ||
585 | { | ||
586 | USB_DEVICE(0x0a46, 0x0268), /* ShanTou ST268 USB NIC */ | ||
587 | .driver_info = (unsigned long)&dm9601_info, | ||
588 | }, | ||
581 | {}, // END | 589 | {}, // END |
582 | }; | 590 | }; |
583 | 591 | ||
diff --git a/drivers/usb/serial/airprime.c b/drivers/usb/serial/airprime.c index 310a8b5f5906..7538c64a5097 100644 --- a/drivers/usb/serial/airprime.c +++ b/drivers/usb/serial/airprime.c | |||
@@ -18,10 +18,6 @@ | |||
18 | 18 | ||
19 | static struct usb_device_id id_table [] = { | 19 | static struct usb_device_id id_table [] = { |
20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ | 20 | { USB_DEVICE(0x0c88, 0x17da) }, /* Kyocera Wireless KPC650/Passport */ |
21 | { USB_DEVICE(0x1410, 0x1110) }, /* Novatel Wireless Merlin CDMA */ | ||
22 | { USB_DEVICE(0x1410, 0x1130) }, /* Novatel Wireless S720 CDMA/EV-DO */ | ||
23 | { USB_DEVICE(0x1410, 0x2110) }, /* Novatel Wireless U720 CDMA/EV-DO */ | ||
24 | { USB_DEVICE(0x1410, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | ||
25 | { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ | 21 | { USB_DEVICE(0x1410, 0x1100) }, /* ExpressCard34 Qualcomm 3G CDMA */ |
26 | { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ | 22 | { USB_DEVICE(0x413c, 0x8115) }, /* Dell Wireless HSDPA 5500 */ |
27 | { }, | 23 | { }, |
diff --git a/drivers/usb/serial/mos7720.c b/drivers/usb/serial/mos7720.c index 2d588fb82573..19bf403f9db2 100644 --- a/drivers/usb/serial/mos7720.c +++ b/drivers/usb/serial/mos7720.c | |||
@@ -1628,6 +1628,7 @@ static struct usb_serial_driver moschip7720_2port_driver = { | |||
1628 | .chars_in_buffer = mos7720_chars_in_buffer, | 1628 | .chars_in_buffer = mos7720_chars_in_buffer, |
1629 | .break_ctl = mos7720_break, | 1629 | .break_ctl = mos7720_break, |
1630 | .read_bulk_callback = mos7720_bulk_in_callback, | 1630 | .read_bulk_callback = mos7720_bulk_in_callback, |
1631 | .read_int_callback = mos7720_interrupt_callback, | ||
1631 | }; | 1632 | }; |
1632 | 1633 | ||
1633 | static int __init moschip7720_init(void) | 1634 | static int __init moschip7720_init(void) |
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index db92a7fb1f7c..e178e6f40319 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -109,7 +109,6 @@ static int option_send_setup(struct usb_serial_port *port); | |||
109 | #define HUAWEI_PRODUCT_E220 0x1003 | 109 | #define HUAWEI_PRODUCT_E220 0x1003 |
110 | 110 | ||
111 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 | 111 | #define NOVATELWIRELESS_VENDOR_ID 0x1410 |
112 | #define NOVATELWIRELESS_PRODUCT_U740 0x1400 | ||
113 | 112 | ||
114 | #define ANYDATA_VENDOR_ID 0x16d5 | 113 | #define ANYDATA_VENDOR_ID 0x16d5 |
115 | #define ANYDATA_PRODUCT_ID 0x6501 | 114 | #define ANYDATA_PRODUCT_ID 0x6501 |
@@ -152,7 +151,19 @@ static struct usb_device_id option_ids[] = { | |||
152 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, | 151 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_ETNA_KOI_NETWORK) }, |
153 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, | 152 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, |
154 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, | 153 | { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, |
155 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID,NOVATELWIRELESS_PRODUCT_U740) }, | 154 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1100) }, /* Novatel Merlin XS620/S640 */ |
155 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1110) }, /* Novatel Merlin S620 */ | ||
156 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1120) }, /* Novatel Merlin EX720 */ | ||
157 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1130) }, /* Novatel Merlin S720 */ | ||
158 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1400) }, /* Novatel U730 */ | ||
159 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1410) }, /* Novatel U740 */ | ||
160 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1420) }, /* Novatel EU870 */ | ||
161 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel Merlin XU870 HSDPA/3G */ | ||
162 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x1430) }, /* Novatel XU870 */ | ||
163 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2100) }, /* Novatel EV620 CDMA/EV-DO */ | ||
164 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2110) }, /* Novatel Merlin ES620 / Merlin ES720 / Ovation U720 */ | ||
165 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2130) }, /* Novatel Merlin ES620 SM Bus */ | ||
166 | { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, 0x2410) }, /* Novatel EU740 */ | ||
156 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, | 167 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ID) }, |
157 | { } /* Terminating entry */ | 168 | { } /* Terminating entry */ |
158 | }; | 169 | }; |
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 8511352251f3..7639022cdf84 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c | |||
@@ -138,6 +138,11 @@ static void destroy_serial(struct kref *kref) | |||
138 | 138 | ||
139 | dbg("%s - %s", __FUNCTION__, serial->type->description); | 139 | dbg("%s - %s", __FUNCTION__, serial->type->description); |
140 | 140 | ||
141 | serial->type->shutdown(serial); | ||
142 | |||
143 | /* return the minor range that this device had */ | ||
144 | return_serial(serial); | ||
145 | |||
141 | for (i = 0; i < serial->num_ports; ++i) | 146 | for (i = 0; i < serial->num_ports; ++i) |
142 | serial->port[i]->open_count = 0; | 147 | serial->port[i]->open_count = 0; |
143 | 148 | ||
@@ -148,12 +153,6 @@ static void destroy_serial(struct kref *kref) | |||
148 | serial->port[i] = NULL; | 153 | serial->port[i] = NULL; |
149 | } | 154 | } |
150 | 155 | ||
151 | if (serial->type->shutdown) | ||
152 | serial->type->shutdown(serial); | ||
153 | |||
154 | /* return the minor range that this device had */ | ||
155 | return_serial(serial); | ||
156 | |||
157 | /* If this is a "fake" port, we have to clean it up here, as it will | 156 | /* If this is a "fake" port, we have to clean it up here, as it will |
158 | * not get cleaned up in port_release() as it was never registered with | 157 | * not get cleaned up in port_release() as it was never registered with |
159 | * the driver core */ | 158 | * the driver core */ |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 2dd31e3f5107..e13637dfb642 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -1411,6 +1411,16 @@ UNUSUAL_DEV( 0x22b8, 0x3010, 0x0001, 0x0001, | |||
1411 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 1411 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
1412 | US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), | 1412 | US_FL_FIX_CAPACITY | US_FL_IGNORE_RESIDUE ), |
1413 | 1413 | ||
1414 | /* | ||
1415 | * Patch by Pete Zaitcev <zaitcev@redhat.com> | ||
1416 | * Report by Mark Patton. Red Hat bz#208928. | ||
1417 | */ | ||
1418 | UNUSUAL_DEV( 0x22b8, 0x4810, 0x0001, 0x0001, | ||
1419 | "Motorola", | ||
1420 | "RAZR V3i", | ||
1421 | US_SC_DEVICE, US_PR_DEVICE, NULL, | ||
1422 | US_FL_FIX_CAPACITY), | ||
1423 | |||
1414 | /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ | 1424 | /* Reported by Radovan Garabik <garabik@kassiopeia.juls.savba.sk> */ |
1415 | UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, | 1425 | UNUSUAL_DEV( 0x2735, 0x100b, 0x0000, 0x9999, |
1416 | "MPIO", | 1426 | "MPIO", |
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7f5a59836818..e4f0dd00ae85 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1320,7 +1320,7 @@ config FB_AU1100 | |||
1320 | 1320 | ||
1321 | config FB_AU1200 | 1321 | config FB_AU1200 |
1322 | bool "Au1200 LCD Driver" | 1322 | bool "Au1200 LCD Driver" |
1323 | depends on FB && MIPS && SOC_AU1200 | 1323 | depends on (FB = y) && MIPS && SOC_AU1200 |
1324 | select FB_CFB_FILLRECT | 1324 | select FB_CFB_FILLRECT |
1325 | select FB_CFB_COPYAREA | 1325 | select FB_CFB_COPYAREA |
1326 | select FB_CFB_IMAGEBLIT | 1326 | select FB_CFB_IMAGEBLIT |
@@ -1470,7 +1470,7 @@ config FB_G364 | |||
1470 | 1470 | ||
1471 | config FB_68328 | 1471 | config FB_68328 |
1472 | bool "Motorola 68328 native frame buffer support" | 1472 | bool "Motorola 68328 native frame buffer support" |
1473 | depends on FB && (M68328 || M68EZ328 || M68VZ328) | 1473 | depends on (FB = y) && (M68328 || M68EZ328 || M68VZ328) |
1474 | select FB_CFB_FILLRECT | 1474 | select FB_CFB_FILLRECT |
1475 | select FB_CFB_COPYAREA | 1475 | select FB_CFB_COPYAREA |
1476 | select FB_CFB_IMAGEBLIT | 1476 | select FB_CFB_IMAGEBLIT |
@@ -1616,7 +1616,7 @@ config FB_IBM_GXT4500 | |||
1616 | 1616 | ||
1617 | config FB_PS3 | 1617 | config FB_PS3 |
1618 | bool "PS3 GPU framebuffer driver" | 1618 | bool "PS3 GPU framebuffer driver" |
1619 | depends on FB && PS3_PS3AV | 1619 | depends on (FB = y) && PS3_PS3AV |
1620 | select FB_CFB_FILLRECT | 1620 | select FB_CFB_FILLRECT |
1621 | select FB_CFB_COPYAREA | 1621 | select FB_CFB_COPYAREA |
1622 | select FB_CFB_IMAGEBLIT | 1622 | select FB_CFB_IMAGEBLIT |
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index d1312477813e..6b488b8a7eee 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -199,8 +199,8 @@ static int locomolcd_remove(struct locomo_dev *dev) | |||
199 | { | 199 | { |
200 | unsigned long flags; | 200 | unsigned long flags; |
201 | 201 | ||
202 | locomobl_data.brightness = 0; | 202 | locomolcd_bl_device->props.brightness = 0; |
203 | locomobl_data.power = 0; | 203 | locomolcd_bl_device->props.power = 0; |
204 | locomolcd_set_intensity(locomolcd_bl_device); | 204 | locomolcd_set_intensity(locomolcd_bl_device); |
205 | 205 | ||
206 | backlight_device_unregister(locomolcd_bl_device); | 206 | backlight_device_unregister(locomolcd_bl_device); |
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c index 702269357861..836ab4df0ef2 100644 --- a/drivers/video/backlight/progear_bl.c +++ b/drivers/video/backlight/progear_bl.c | |||
@@ -65,13 +65,13 @@ static int progearbl_probe(struct platform_device *pdev) | |||
65 | u8 temp; | 65 | u8 temp; |
66 | struct backlight_device *progear_backlight_device; | 66 | struct backlight_device *progear_backlight_device; |
67 | 67 | ||
68 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, 0); | 68 | pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL); |
69 | if (!pmu_dev) { | 69 | if (!pmu_dev) { |
70 | printk("ALI M7101 PMU not found.\n"); | 70 | printk("ALI M7101 PMU not found.\n"); |
71 | return -ENODEV; | 71 | return -ENODEV; |
72 | } | 72 | } |
73 | 73 | ||
74 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, 0); | 74 | sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
75 | if (!sb_dev) { | 75 | if (!sb_dev) { |
76 | printk("ALI 1533 SB not found.\n"); | 76 | printk("ALI 1533 SB not found.\n"); |
77 | pci_dev_put(pmu_dev); | 77 | pci_dev_put(pmu_dev); |
diff --git a/drivers/video/bw2.c b/drivers/video/bw2.c index 9bb6257d6918..b0b2e40bbd9f 100644 --- a/drivers/video/bw2.c +++ b/drivers/video/bw2.c | |||
@@ -186,8 +186,7 @@ static int bw2_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
186 | * Initialisation | 186 | * Initialisation |
187 | */ | 187 | */ |
188 | 188 | ||
189 | static void | 189 | static void __devinit bw2_init_fix(struct fb_info *info, int linebytes) |
190 | bw2_init_fix(struct fb_info *info, int linebytes) | ||
191 | { | 190 | { |
192 | strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); | 191 | strlcpy(info->fix.id, "bwtwo", sizeof(info->fix.id)); |
193 | 192 | ||
@@ -199,43 +198,44 @@ bw2_init_fix(struct fb_info *info, int linebytes) | |||
199 | info->fix.accel = FB_ACCEL_SUN_BWTWO; | 198 | info->fix.accel = FB_ACCEL_SUN_BWTWO; |
200 | } | 199 | } |
201 | 200 | ||
202 | static u8 bw2regs_1600[] __initdata = { | 201 | static u8 bw2regs_1600[] __devinitdata = { |
203 | 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, | 202 | 0x14, 0x8b, 0x15, 0x28, 0x16, 0x03, 0x17, 0x13, |
204 | 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, | 203 | 0x18, 0x7b, 0x19, 0x05, 0x1a, 0x34, 0x1b, 0x2e, |
205 | 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, | 204 | 0x1c, 0x00, 0x1d, 0x0a, 0x1e, 0xff, 0x1f, 0x01, |
206 | 0x10, 0x21, 0 | 205 | 0x10, 0x21, 0 |
207 | }; | 206 | }; |
208 | 207 | ||
209 | static u8 bw2regs_ecl[] __initdata = { | 208 | static u8 bw2regs_ecl[] __devinitdata = { |
210 | 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, | 209 | 0x14, 0x65, 0x15, 0x1e, 0x16, 0x04, 0x17, 0x0c, |
211 | 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, | 210 | 0x18, 0x5e, 0x19, 0x03, 0x1a, 0xa7, 0x1b, 0x23, |
212 | 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, | 211 | 0x1c, 0x00, 0x1d, 0x08, 0x1e, 0xff, 0x1f, 0x01, |
213 | 0x10, 0x20, 0 | 212 | 0x10, 0x20, 0 |
214 | }; | 213 | }; |
215 | 214 | ||
216 | static u8 bw2regs_analog[] __initdata = { | 215 | static u8 bw2regs_analog[] __devinitdata = { |
217 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, | 216 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x03, 0x17, 0x13, |
218 | 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, | 217 | 0x18, 0xb0, 0x19, 0x03, 0x1a, 0xa6, 0x1b, 0x22, |
219 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, | 218 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, |
220 | 0x10, 0x20, 0 | 219 | 0x10, 0x20, 0 |
221 | }; | 220 | }; |
222 | 221 | ||
223 | static u8 bw2regs_76hz[] __initdata = { | 222 | static u8 bw2regs_76hz[] __devinitdata = { |
224 | 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, | 223 | 0x14, 0xb7, 0x15, 0x27, 0x16, 0x03, 0x17, 0x0f, |
225 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, | 224 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xae, 0x1b, 0x2a, |
226 | 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, | 225 | 0x1c, 0x01, 0x1d, 0x09, 0x1e, 0xff, 0x1f, 0x01, |
227 | 0x10, 0x24, 0 | 226 | 0x10, 0x24, 0 |
228 | }; | 227 | }; |
229 | 228 | ||
230 | static u8 bw2regs_66hz[] __initdata = { | 229 | static u8 bw2regs_66hz[] __devinitdata = { |
231 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, | 230 | 0x14, 0xbb, 0x15, 0x2b, 0x16, 0x04, 0x17, 0x14, |
232 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, | 231 | 0x18, 0xae, 0x19, 0x03, 0x1a, 0xa8, 0x1b, 0x24, |
233 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, | 232 | 0x1c, 0x01, 0x1d, 0x05, 0x1e, 0xff, 0x1f, 0x01, |
234 | 0x10, 0x20, 0 | 233 | 0x10, 0x20, 0 |
235 | }; | 234 | }; |
236 | 235 | ||
237 | static void bw2_do_default_mode(struct bw2_par *par, struct fb_info *info, | 236 | static void __devinit bw2_do_default_mode(struct bw2_par *par, |
238 | int *linebytes) | 237 | struct fb_info *info, |
238 | int *linebytes) | ||
239 | { | 239 | { |
240 | u8 status, mon; | 240 | u8 status, mon; |
241 | u8 *p; | 241 | u8 *p; |
diff --git a/drivers/video/cg14.c b/drivers/video/cg14.c index ec6a51a5822d..b071bb632b97 100644 --- a/drivers/video/cg14.c +++ b/drivers/video/cg14.c | |||
@@ -354,7 +354,8 @@ static int cg14_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg) | |||
354 | * Initialisation | 354 | * Initialisation |
355 | */ | 355 | */ |
356 | 356 | ||
357 | static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_node *dp) | 357 | static void __devinit cg14_init_fix(struct fb_info *info, int linebytes, |
358 | struct device_node *dp) | ||
358 | { | 359 | { |
359 | const char *name = dp->name; | 360 | const char *name = dp->name; |
360 | 361 | ||
@@ -368,7 +369,7 @@ static void cg14_init_fix(struct fb_info *info, int linebytes, struct device_nod | |||
368 | info->fix.accel = FB_ACCEL_SUN_CG14; | 369 | info->fix.accel = FB_ACCEL_SUN_CG14; |
369 | } | 370 | } |
370 | 371 | ||
371 | static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __initdata = { | 372 | static struct sbus_mmap_map __cg14_mmap_map[CG14_MMAP_ENTRIES] __devinitdata = { |
372 | { | 373 | { |
373 | .voff = CG14_REGS, | 374 | .voff = CG14_REGS, |
374 | .poff = 0x80000000, | 375 | .poff = 0x80000000, |
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index 4afa30522fdb..0166ec2ccf32 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -384,6 +384,19 @@ SavageSetup2DEngine(struct savagefb_par *par) | |||
384 | BCI_SEND(0); | 384 | BCI_SEND(0); |
385 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); | 385 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); |
386 | BCI_SEND(GlobalBitmapDescriptor); | 386 | BCI_SEND(GlobalBitmapDescriptor); |
387 | |||
388 | /* | ||
389 | * I don't know why, sending this twice fixes the intial black screen, | ||
390 | * prevents X from crashing at least in Toshiba laptops with SavageIX. | ||
391 | * --Tony | ||
392 | */ | ||
393 | par->bci_ptr = 0; | ||
394 | par->SavageWaitFifo(par, 4); | ||
395 | |||
396 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD1); | ||
397 | BCI_SEND(0); | ||
398 | BCI_SEND(BCI_CMD_SETREG | (1 << 16) | BCI_GBD2); | ||
399 | BCI_SEND(GlobalBitmapDescriptor); | ||
387 | } | 400 | } |
388 | 401 | ||
389 | static void savagefb_set_clip(struct fb_info *info) | 402 | static void savagefb_set_clip(struct fb_info *info) |
@@ -496,7 +509,7 @@ static int common_calc_clock(long freq, int min_m, int min_n1, int max_n1, | |||
496 | #ifdef SAVAGEFB_DEBUG | 509 | #ifdef SAVAGEFB_DEBUG |
497 | /* This function is used to debug, it prints out the contents of s3 regs */ | 510 | /* This function is used to debug, it prints out the contents of s3 regs */ |
498 | 511 | ||
499 | static void SavagePrintRegs(void) | 512 | static void SavagePrintRegs(struct savagefb_par *par) |
500 | { | 513 | { |
501 | unsigned char i; | 514 | unsigned char i; |
502 | int vgaCRIndex = 0x3d4; | 515 | int vgaCRIndex = 0x3d4; |
@@ -1525,7 +1538,7 @@ static int savagefb_set_par(struct fb_info *info) | |||
1525 | savagefb_set_fix(info); | 1538 | savagefb_set_fix(info); |
1526 | savagefb_set_clip(info); | 1539 | savagefb_set_clip(info); |
1527 | 1540 | ||
1528 | SavagePrintRegs(); | 1541 | SavagePrintRegs(par); |
1529 | return 0; | 1542 | return 0; |
1530 | } | 1543 | } |
1531 | 1544 | ||
@@ -2155,7 +2168,6 @@ static int __devinit savagefb_probe(struct pci_dev* dev, | |||
2155 | int video_len; | 2168 | int video_len; |
2156 | 2169 | ||
2157 | DBG("savagefb_probe"); | 2170 | DBG("savagefb_probe"); |
2158 | SavagePrintRegs(); | ||
2159 | 2171 | ||
2160 | info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); | 2172 | info = framebuffer_alloc(sizeof(struct savagefb_par), &dev->dev); |
2161 | if (!info) | 2173 | if (!info) |
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index 59cd1e750f30..62fa5500361d 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c | |||
@@ -257,6 +257,7 @@ static void __sst_dac_write(u8 __iomem *vbase, u8 reg, u8 val) | |||
257 | r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); | 257 | r_dprintk("sst_dac_write(%#x, %#x)\n", reg, val); |
258 | reg &= 0x07; | 258 | reg &= 0x07; |
259 | __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); | 259 | __sst_write(vbase, DAC_DATA,(((u32)reg << 8)) | (u32)val); |
260 | __sst_wait_idle(vbase); | ||
260 | } | 261 | } |
261 | 262 | ||
262 | /* indexed access to ti/att dacs */ | 263 | /* indexed access to ti/att dacs */ |
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 51db1182b27e..a2fceba7ef8e 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c | |||
@@ -507,7 +507,7 @@ out: | |||
507 | #define INTERPRETER_ELF 2 | 507 | #define INTERPRETER_ELF 2 |
508 | 508 | ||
509 | #ifndef STACK_RND_MASK | 509 | #ifndef STACK_RND_MASK |
510 | #define STACK_RND_MASK 0x7ff /* with 4K pages 8MB of VA */ | 510 | #define STACK_RND_MASK (0x7ff >> (PAGE_SHIFT - 12)) /* 8MB of VA */ |
511 | #endif | 511 | #endif |
512 | 512 | ||
513 | static unsigned long randomize_stack_top(unsigned long stack_top) | 513 | static unsigned long randomize_stack_top(unsigned long stack_top) |
diff --git a/fs/cifs/cifspdu.h b/fs/cifs/cifspdu.h index 0efdf35aab2c..3af76249dc8b 100644 --- a/fs/cifs/cifspdu.h +++ b/fs/cifs/cifspdu.h | |||
@@ -220,7 +220,7 @@ | |||
220 | */ | 220 | */ |
221 | #define CIFS_NO_HANDLE 0xFFFF | 221 | #define CIFS_NO_HANDLE 0xFFFF |
222 | 222 | ||
223 | #define NO_CHANGE_64 0xFFFFFFFFFFFFFFFFULL | 223 | #define NO_CHANGE_64 cpu_to_le64(0xFFFFFFFFFFFFFFFFULL) |
224 | #define NO_CHANGE_32 0xFFFFFFFFUL | 224 | #define NO_CHANGE_32 0xFFFFFFFFUL |
225 | 225 | ||
226 | /* IPC$ in ASCII */ | 226 | /* IPC$ in ASCII */ |
diff --git a/fs/configfs/dir.c b/fs/configfs/dir.c index 34750d5e4ff2..5e6e37e58f36 100644 --- a/fs/configfs/dir.c +++ b/fs/configfs/dir.c | |||
@@ -1141,25 +1141,22 @@ int configfs_register_subsystem(struct configfs_subsystem *subsys) | |||
1141 | 1141 | ||
1142 | err = -ENOMEM; | 1142 | err = -ENOMEM; |
1143 | dentry = d_alloc(configfs_sb->s_root, &name); | 1143 | dentry = d_alloc(configfs_sb->s_root, &name); |
1144 | if (!dentry) | 1144 | if (dentry) { |
1145 | goto out_release; | 1145 | d_add(dentry, NULL); |
1146 | |||
1147 | d_add(dentry, NULL); | ||
1148 | 1146 | ||
1149 | err = configfs_attach_group(sd->s_element, &group->cg_item, | 1147 | err = configfs_attach_group(sd->s_element, &group->cg_item, |
1150 | dentry); | 1148 | dentry); |
1151 | if (!err) | 1149 | if (err) { |
1152 | dentry = NULL; | 1150 | d_delete(dentry); |
1153 | else | 1151 | dput(dentry); |
1154 | d_delete(dentry); | 1152 | } |
1153 | } | ||
1155 | 1154 | ||
1156 | mutex_unlock(&configfs_sb->s_root->d_inode->i_mutex); | 1155 | mutex_unlock(&configfs_sb->s_root->d_inode->i_mutex); |
1157 | 1156 | ||
1158 | if (dentry) { | 1157 | if (err) { |
1159 | dput(dentry); | 1158 | unlink_group(group); |
1160 | out_release: | 1159 | configfs_release_fs(); |
1161 | unlink_group(group); | ||
1162 | configfs_release_fs(); | ||
1163 | } | 1160 | } |
1164 | 1161 | ||
1165 | return err; | 1162 | return err; |
diff --git a/fs/ecryptfs/dentry.c b/fs/ecryptfs/dentry.c index 329efcd3d8c9..cb20b964419f 100644 --- a/fs/ecryptfs/dentry.c +++ b/fs/ecryptfs/dentry.c | |||
@@ -78,18 +78,13 @@ struct kmem_cache *ecryptfs_dentry_info_cache; | |||
78 | */ | 78 | */ |
79 | static void ecryptfs_d_release(struct dentry *dentry) | 79 | static void ecryptfs_d_release(struct dentry *dentry) |
80 | { | 80 | { |
81 | struct dentry *lower_dentry; | 81 | if (ecryptfs_dentry_to_private(dentry)) { |
82 | 82 | if (ecryptfs_dentry_to_lower(dentry)) { | |
83 | lower_dentry = ecryptfs_dentry_to_lower(dentry); | 83 | mntput(ecryptfs_dentry_to_lower_mnt(dentry)); |
84 | if (ecryptfs_dentry_to_private(dentry)) | 84 | dput(ecryptfs_dentry_to_lower(dentry)); |
85 | } | ||
85 | kmem_cache_free(ecryptfs_dentry_info_cache, | 86 | kmem_cache_free(ecryptfs_dentry_info_cache, |
86 | ecryptfs_dentry_to_private(dentry)); | 87 | ecryptfs_dentry_to_private(dentry)); |
87 | if (lower_dentry) { | ||
88 | struct vfsmount *lower_mnt = | ||
89 | ecryptfs_dentry_to_lower_mnt(dentry); | ||
90 | |||
91 | mntput(lower_mnt); | ||
92 | dput(lower_dentry); | ||
93 | } | 88 | } |
94 | return; | 89 | return; |
95 | } | 90 | } |
diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index af53c02f473b..93d046c85f52 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c | |||
@@ -429,7 +429,8 @@ int nfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *stat) | |||
429 | int err; | 429 | int err; |
430 | 430 | ||
431 | /* Flush out writes to the server in order to update c/mtime */ | 431 | /* Flush out writes to the server in order to update c/mtime */ |
432 | nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT); | 432 | if (S_ISREG(inode->i_mode)) |
433 | nfs_sync_mapping_range(inode->i_mapping, 0, 0, FLUSH_NOCOMMIT); | ||
433 | 434 | ||
434 | /* | 435 | /* |
435 | * We may force a getattr if the user cares about atime. | 436 | * We may force a getattr if the user cares about atime. |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index bb516a2cfbaf..f1eae44b9a1a 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -151,10 +151,10 @@ int __init register_nfs_fs(void) | |||
151 | if (ret < 0) | 151 | if (ret < 0) |
152 | goto error_0; | 152 | goto error_0; |
153 | 153 | ||
154 | #ifdef CONFIG_NFS_V4 | ||
155 | ret = nfs_register_sysctl(); | 154 | ret = nfs_register_sysctl(); |
156 | if (ret < 0) | 155 | if (ret < 0) |
157 | goto error_1; | 156 | goto error_1; |
157 | #ifdef CONFIG_NFS_V4 | ||
158 | ret = register_filesystem(&nfs4_fs_type); | 158 | ret = register_filesystem(&nfs4_fs_type); |
159 | if (ret < 0) | 159 | if (ret < 0) |
160 | goto error_2; | 160 | goto error_2; |
@@ -165,9 +165,9 @@ int __init register_nfs_fs(void) | |||
165 | #ifdef CONFIG_NFS_V4 | 165 | #ifdef CONFIG_NFS_V4 |
166 | error_2: | 166 | error_2: |
167 | nfs_unregister_sysctl(); | 167 | nfs_unregister_sysctl(); |
168 | #endif | ||
168 | error_1: | 169 | error_1: |
169 | unregister_filesystem(&nfs_fs_type); | 170 | unregister_filesystem(&nfs_fs_type); |
170 | #endif | ||
171 | error_0: | 171 | error_0: |
172 | return ret; | 172 | return ret; |
173 | } | 173 | } |
diff --git a/fs/nfs/sysctl.c b/fs/nfs/sysctl.c index fcdcafbb3293..b62481dabae9 100644 --- a/fs/nfs/sysctl.c +++ b/fs/nfs/sysctl.c | |||
@@ -50,6 +50,14 @@ static ctl_table nfs_cb_sysctls[] = { | |||
50 | .proc_handler = &proc_dointvec_jiffies, | 50 | .proc_handler = &proc_dointvec_jiffies, |
51 | .strategy = &sysctl_jiffies, | 51 | .strategy = &sysctl_jiffies, |
52 | }, | 52 | }, |
53 | { | ||
54 | .ctl_name = CTL_UNNUMBERED, | ||
55 | .procname = "nfs_congestion_kb", | ||
56 | .data = &nfs_congestion_kb, | ||
57 | .maxlen = sizeof(nfs_congestion_kb), | ||
58 | .mode = 0644, | ||
59 | .proc_handler = &proc_dointvec, | ||
60 | }, | ||
53 | { .ctl_name = 0 } | 61 | { .ctl_name = 0 } |
54 | }; | 62 | }; |
55 | 63 | ||
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index febdade91670..2867e6b7096f 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/pagemap.h> | 12 | #include <linux/pagemap.h> |
13 | #include <linux/file.h> | 13 | #include <linux/file.h> |
14 | #include <linux/writeback.h> | 14 | #include <linux/writeback.h> |
15 | #include <linux/swap.h> | ||
15 | 16 | ||
16 | #include <linux/sunrpc/clnt.h> | 17 | #include <linux/sunrpc/clnt.h> |
17 | #include <linux/nfs_fs.h> | 18 | #include <linux/nfs_fs.h> |
@@ -38,7 +39,6 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*, | |||
38 | struct page *, | 39 | struct page *, |
39 | unsigned int, unsigned int); | 40 | unsigned int, unsigned int); |
40 | static void nfs_mark_request_dirty(struct nfs_page *req); | 41 | static void nfs_mark_request_dirty(struct nfs_page *req); |
41 | static int nfs_wait_on_write_congestion(struct address_space *, int); | ||
42 | static long nfs_flush_mapping(struct address_space *mapping, struct writeback_control *wbc, int how); | 42 | static long nfs_flush_mapping(struct address_space *mapping, struct writeback_control *wbc, int how); |
43 | static const struct rpc_call_ops nfs_write_partial_ops; | 43 | static const struct rpc_call_ops nfs_write_partial_ops; |
44 | static const struct rpc_call_ops nfs_write_full_ops; | 44 | static const struct rpc_call_ops nfs_write_full_ops; |
@@ -48,8 +48,6 @@ static struct kmem_cache *nfs_wdata_cachep; | |||
48 | static mempool_t *nfs_wdata_mempool; | 48 | static mempool_t *nfs_wdata_mempool; |
49 | static mempool_t *nfs_commit_mempool; | 49 | static mempool_t *nfs_commit_mempool; |
50 | 50 | ||
51 | static DECLARE_WAIT_QUEUE_HEAD(nfs_write_congestion); | ||
52 | |||
53 | struct nfs_write_data *nfs_commit_alloc(void) | 51 | struct nfs_write_data *nfs_commit_alloc(void) |
54 | { | 52 | { |
55 | struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, GFP_NOFS); | 53 | struct nfs_write_data *p = mempool_alloc(nfs_commit_mempool, GFP_NOFS); |
@@ -211,6 +209,40 @@ static int wb_priority(struct writeback_control *wbc) | |||
211 | } | 209 | } |
212 | 210 | ||
213 | /* | 211 | /* |
212 | * NFS congestion control | ||
213 | */ | ||
214 | |||
215 | int nfs_congestion_kb; | ||
216 | |||
217 | #define NFS_CONGESTION_ON_THRESH (nfs_congestion_kb >> (PAGE_SHIFT-10)) | ||
218 | #define NFS_CONGESTION_OFF_THRESH \ | ||
219 | (NFS_CONGESTION_ON_THRESH - (NFS_CONGESTION_ON_THRESH >> 2)) | ||
220 | |||
221 | static void nfs_set_page_writeback(struct page *page) | ||
222 | { | ||
223 | if (!test_set_page_writeback(page)) { | ||
224 | struct inode *inode = page->mapping->host; | ||
225 | struct nfs_server *nfss = NFS_SERVER(inode); | ||
226 | |||
227 | if (atomic_inc_return(&nfss->writeback) > | ||
228 | NFS_CONGESTION_ON_THRESH) | ||
229 | set_bdi_congested(&nfss->backing_dev_info, WRITE); | ||
230 | } | ||
231 | } | ||
232 | |||
233 | static void nfs_end_page_writeback(struct page *page) | ||
234 | { | ||
235 | struct inode *inode = page->mapping->host; | ||
236 | struct nfs_server *nfss = NFS_SERVER(inode); | ||
237 | |||
238 | end_page_writeback(page); | ||
239 | if (atomic_dec_return(&nfss->writeback) < NFS_CONGESTION_OFF_THRESH) { | ||
240 | clear_bdi_congested(&nfss->backing_dev_info, WRITE); | ||
241 | congestion_end(WRITE); | ||
242 | } | ||
243 | } | ||
244 | |||
245 | /* | ||
214 | * Find an associated nfs write request, and prepare to flush it out | 246 | * Find an associated nfs write request, and prepare to flush it out |
215 | * Returns 1 if there was no write request, or if the request was | 247 | * Returns 1 if there was no write request, or if the request was |
216 | * already tagged by nfs_set_page_dirty.Returns 0 if the request | 248 | * already tagged by nfs_set_page_dirty.Returns 0 if the request |
@@ -247,7 +279,7 @@ static int nfs_page_mark_flush(struct page *page) | |||
247 | spin_unlock(req_lock); | 279 | spin_unlock(req_lock); |
248 | if (test_and_set_bit(PG_FLUSHING, &req->wb_flags) == 0) { | 280 | if (test_and_set_bit(PG_FLUSHING, &req->wb_flags) == 0) { |
249 | nfs_mark_request_dirty(req); | 281 | nfs_mark_request_dirty(req); |
250 | set_page_writeback(page); | 282 | nfs_set_page_writeback(page); |
251 | } | 283 | } |
252 | ret = test_bit(PG_NEED_FLUSH, &req->wb_flags); | 284 | ret = test_bit(PG_NEED_FLUSH, &req->wb_flags); |
253 | nfs_unlock_request(req); | 285 | nfs_unlock_request(req); |
@@ -302,13 +334,8 @@ int nfs_writepage(struct page *page, struct writeback_control *wbc) | |||
302 | return err; | 334 | return err; |
303 | } | 335 | } |
304 | 336 | ||
305 | /* | ||
306 | * Note: causes nfs_update_request() to block on the assumption | ||
307 | * that the writeback is generated due to memory pressure. | ||
308 | */ | ||
309 | int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) | 337 | int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) |
310 | { | 338 | { |
311 | struct backing_dev_info *bdi = mapping->backing_dev_info; | ||
312 | struct inode *inode = mapping->host; | 339 | struct inode *inode = mapping->host; |
313 | int err; | 340 | int err; |
314 | 341 | ||
@@ -317,20 +344,12 @@ int nfs_writepages(struct address_space *mapping, struct writeback_control *wbc) | |||
317 | err = generic_writepages(mapping, wbc); | 344 | err = generic_writepages(mapping, wbc); |
318 | if (err) | 345 | if (err) |
319 | return err; | 346 | return err; |
320 | while (test_and_set_bit(BDI_write_congested, &bdi->state) != 0) { | ||
321 | if (wbc->nonblocking) | ||
322 | return 0; | ||
323 | nfs_wait_on_write_congestion(mapping, 0); | ||
324 | } | ||
325 | err = nfs_flush_mapping(mapping, wbc, wb_priority(wbc)); | 347 | err = nfs_flush_mapping(mapping, wbc, wb_priority(wbc)); |
326 | if (err < 0) | 348 | if (err < 0) |
327 | goto out; | 349 | goto out; |
328 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, err); | 350 | nfs_add_stats(inode, NFSIOS_WRITEPAGES, err); |
329 | err = 0; | 351 | err = 0; |
330 | out: | 352 | out: |
331 | clear_bit(BDI_write_congested, &bdi->state); | ||
332 | wake_up_all(&nfs_write_congestion); | ||
333 | congestion_end(WRITE); | ||
334 | return err; | 353 | return err; |
335 | } | 354 | } |
336 | 355 | ||
@@ -360,7 +379,7 @@ static int nfs_inode_add_request(struct inode *inode, struct nfs_page *req) | |||
360 | } | 379 | } |
361 | 380 | ||
362 | /* | 381 | /* |
363 | * Insert a write request into an inode | 382 | * Remove a write request from an inode |
364 | */ | 383 | */ |
365 | static void nfs_inode_remove_request(struct nfs_page *req) | 384 | static void nfs_inode_remove_request(struct nfs_page *req) |
366 | { | 385 | { |
@@ -531,10 +550,10 @@ static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst, un | |||
531 | } | 550 | } |
532 | #endif | 551 | #endif |
533 | 552 | ||
534 | static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr) | 553 | static int nfs_wait_on_write_congestion(struct address_space *mapping) |
535 | { | 554 | { |
555 | struct inode *inode = mapping->host; | ||
536 | struct backing_dev_info *bdi = mapping->backing_dev_info; | 556 | struct backing_dev_info *bdi = mapping->backing_dev_info; |
537 | DEFINE_WAIT(wait); | ||
538 | int ret = 0; | 557 | int ret = 0; |
539 | 558 | ||
540 | might_sleep(); | 559 | might_sleep(); |
@@ -542,31 +561,23 @@ static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr) | |||
542 | if (!bdi_write_congested(bdi)) | 561 | if (!bdi_write_congested(bdi)) |
543 | return 0; | 562 | return 0; |
544 | 563 | ||
545 | nfs_inc_stats(mapping->host, NFSIOS_CONGESTIONWAIT); | 564 | nfs_inc_stats(inode, NFSIOS_CONGESTIONWAIT); |
546 | 565 | ||
547 | if (intr) { | 566 | do { |
548 | struct rpc_clnt *clnt = NFS_CLIENT(mapping->host); | 567 | struct rpc_clnt *clnt = NFS_CLIENT(inode); |
549 | sigset_t oldset; | 568 | sigset_t oldset; |
550 | 569 | ||
551 | rpc_clnt_sigmask(clnt, &oldset); | 570 | rpc_clnt_sigmask(clnt, &oldset); |
552 | prepare_to_wait(&nfs_write_congestion, &wait, TASK_INTERRUPTIBLE); | 571 | ret = congestion_wait_interruptible(WRITE, HZ/10); |
553 | if (bdi_write_congested(bdi)) { | ||
554 | if (signalled()) | ||
555 | ret = -ERESTARTSYS; | ||
556 | else | ||
557 | schedule(); | ||
558 | } | ||
559 | rpc_clnt_sigunmask(clnt, &oldset); | 572 | rpc_clnt_sigunmask(clnt, &oldset); |
560 | } else { | 573 | if (ret == -ERESTARTSYS) |
561 | prepare_to_wait(&nfs_write_congestion, &wait, TASK_UNINTERRUPTIBLE); | 574 | break; |
562 | if (bdi_write_congested(bdi)) | 575 | ret = 0; |
563 | schedule(); | 576 | } while (bdi_write_congested(bdi)); |
564 | } | 577 | |
565 | finish_wait(&nfs_write_congestion, &wait); | ||
566 | return ret; | 578 | return ret; |
567 | } | 579 | } |
568 | 580 | ||
569 | |||
570 | /* | 581 | /* |
571 | * Try to update any existing write request, or create one if there is none. | 582 | * Try to update any existing write request, or create one if there is none. |
572 | * In order to match, the request's credentials must match those of | 583 | * In order to match, the request's credentials must match those of |
@@ -577,14 +588,15 @@ static int nfs_wait_on_write_congestion(struct address_space *mapping, int intr) | |||
577 | static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx, | 588 | static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx, |
578 | struct page *page, unsigned int offset, unsigned int bytes) | 589 | struct page *page, unsigned int offset, unsigned int bytes) |
579 | { | 590 | { |
580 | struct inode *inode = page->mapping->host; | 591 | struct address_space *mapping = page->mapping; |
592 | struct inode *inode = mapping->host; | ||
581 | struct nfs_inode *nfsi = NFS_I(inode); | 593 | struct nfs_inode *nfsi = NFS_I(inode); |
582 | struct nfs_page *req, *new = NULL; | 594 | struct nfs_page *req, *new = NULL; |
583 | unsigned long rqend, end; | 595 | unsigned long rqend, end; |
584 | 596 | ||
585 | end = offset + bytes; | 597 | end = offset + bytes; |
586 | 598 | ||
587 | if (nfs_wait_on_write_congestion(page->mapping, NFS_SERVER(inode)->flags & NFS_MOUNT_INTR)) | 599 | if (nfs_wait_on_write_congestion(mapping)) |
588 | return ERR_PTR(-ERESTARTSYS); | 600 | return ERR_PTR(-ERESTARTSYS); |
589 | for (;;) { | 601 | for (;;) { |
590 | /* Loop over all inode entries and see if we find | 602 | /* Loop over all inode entries and see if we find |
@@ -727,7 +739,7 @@ int nfs_updatepage(struct file *file, struct page *page, | |||
727 | 739 | ||
728 | static void nfs_writepage_release(struct nfs_page *req) | 740 | static void nfs_writepage_release(struct nfs_page *req) |
729 | { | 741 | { |
730 | end_page_writeback(req->wb_page); | 742 | nfs_end_page_writeback(req->wb_page); |
731 | 743 | ||
732 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 744 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
733 | if (!PageError(req->wb_page)) { | 745 | if (!PageError(req->wb_page)) { |
@@ -1042,12 +1054,12 @@ static void nfs_writeback_done_full(struct rpc_task *task, void *calldata) | |||
1042 | if (task->tk_status < 0) { | 1054 | if (task->tk_status < 0) { |
1043 | nfs_set_pageerror(page); | 1055 | nfs_set_pageerror(page); |
1044 | req->wb_context->error = task->tk_status; | 1056 | req->wb_context->error = task->tk_status; |
1045 | end_page_writeback(page); | 1057 | nfs_end_page_writeback(page); |
1046 | nfs_inode_remove_request(req); | 1058 | nfs_inode_remove_request(req); |
1047 | dprintk(", error = %d\n", task->tk_status); | 1059 | dprintk(", error = %d\n", task->tk_status); |
1048 | goto next; | 1060 | goto next; |
1049 | } | 1061 | } |
1050 | end_page_writeback(page); | 1062 | nfs_end_page_writeback(page); |
1051 | 1063 | ||
1052 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) | 1064 | #if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) |
1053 | if (data->args.stable != NFS_UNSTABLE || data->verf.committed == NFS_FILE_SYNC) { | 1065 | if (data->args.stable != NFS_UNSTABLE || data->verf.committed == NFS_FILE_SYNC) { |
@@ -1514,6 +1526,26 @@ int __init nfs_init_writepagecache(void) | |||
1514 | if (nfs_commit_mempool == NULL) | 1526 | if (nfs_commit_mempool == NULL) |
1515 | return -ENOMEM; | 1527 | return -ENOMEM; |
1516 | 1528 | ||
1529 | /* | ||
1530 | * NFS congestion size, scale with available memory. | ||
1531 | * | ||
1532 | * 64MB: 8192k | ||
1533 | * 128MB: 11585k | ||
1534 | * 256MB: 16384k | ||
1535 | * 512MB: 23170k | ||
1536 | * 1GB: 32768k | ||
1537 | * 2GB: 46340k | ||
1538 | * 4GB: 65536k | ||
1539 | * 8GB: 92681k | ||
1540 | * 16GB: 131072k | ||
1541 | * | ||
1542 | * This allows larger machines to have larger/more transfers. | ||
1543 | * Limit the default to 256M | ||
1544 | */ | ||
1545 | nfs_congestion_kb = (16*int_sqrt(totalram_pages)) << (PAGE_SHIFT-10); | ||
1546 | if (nfs_congestion_kb > 256*1024) | ||
1547 | nfs_congestion_kb = 256*1024; | ||
1548 | |||
1517 | return 0; | 1549 | return 0; |
1518 | } | 1550 | } |
1519 | 1551 | ||
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index c2660cbfcd96..8d995bcef806 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c | |||
@@ -17,7 +17,6 @@ | |||
17 | #include <linux/stat.h> | 17 | #include <linux/stat.h> |
18 | #include <linux/dcache.h> | 18 | #include <linux/dcache.h> |
19 | #include <linux/mount.h> | 19 | #include <linux/mount.h> |
20 | #include <asm/pgtable.h> | ||
21 | 20 | ||
22 | #include <linux/sunrpc/clnt.h> | 21 | #include <linux/sunrpc/clnt.h> |
23 | #include <linux/sunrpc/svc.h> | 22 | #include <linux/sunrpc/svc.h> |
diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 93628b02ef5d..875c11443817 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c | |||
@@ -614,6 +614,27 @@ static void ocfs2_dio_end_io(struct kiocb *iocb, | |||
614 | ocfs2_rw_unlock(inode, 0); | 614 | ocfs2_rw_unlock(inode, 0); |
615 | } | 615 | } |
616 | 616 | ||
617 | /* | ||
618 | * ocfs2_invalidatepage() and ocfs2_releasepage() are shamelessly stolen | ||
619 | * from ext3. PageChecked() bits have been removed as OCFS2 does not | ||
620 | * do journalled data. | ||
621 | */ | ||
622 | static void ocfs2_invalidatepage(struct page *page, unsigned long offset) | ||
623 | { | ||
624 | journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal; | ||
625 | |||
626 | journal_invalidatepage(journal, page, offset); | ||
627 | } | ||
628 | |||
629 | static int ocfs2_releasepage(struct page *page, gfp_t wait) | ||
630 | { | ||
631 | journal_t *journal = OCFS2_SB(page->mapping->host->i_sb)->journal->j_journal; | ||
632 | |||
633 | if (!page_has_buffers(page)) | ||
634 | return 0; | ||
635 | return journal_try_to_free_buffers(journal, page, wait); | ||
636 | } | ||
637 | |||
617 | static ssize_t ocfs2_direct_IO(int rw, | 638 | static ssize_t ocfs2_direct_IO(int rw, |
618 | struct kiocb *iocb, | 639 | struct kiocb *iocb, |
619 | const struct iovec *iov, | 640 | const struct iovec *iov, |
@@ -661,5 +682,8 @@ const struct address_space_operations ocfs2_aops = { | |||
661 | .commit_write = ocfs2_commit_write, | 682 | .commit_write = ocfs2_commit_write, |
662 | .bmap = ocfs2_bmap, | 683 | .bmap = ocfs2_bmap, |
663 | .sync_page = block_sync_page, | 684 | .sync_page = block_sync_page, |
664 | .direct_IO = ocfs2_direct_IO | 685 | .direct_IO = ocfs2_direct_IO, |
686 | .invalidatepage = ocfs2_invalidatepage, | ||
687 | .releasepage = ocfs2_releasepage, | ||
688 | .migratepage = buffer_migrate_page, | ||
665 | }; | 689 | }; |
diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index 5a9779bb9236..eba282da500e 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c | |||
@@ -1234,6 +1234,7 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1234 | const char *page, | 1234 | const char *page, |
1235 | size_t count) | 1235 | size_t count) |
1236 | { | 1236 | { |
1237 | struct task_struct *hb_task; | ||
1237 | long fd; | 1238 | long fd; |
1238 | int sectsize; | 1239 | int sectsize; |
1239 | char *p = (char *)page; | 1240 | char *p = (char *)page; |
@@ -1319,20 +1320,28 @@ static ssize_t o2hb_region_dev_write(struct o2hb_region *reg, | |||
1319 | */ | 1320 | */ |
1320 | atomic_set(®->hr_steady_iterations, O2HB_LIVE_THRESHOLD + 1); | 1321 | atomic_set(®->hr_steady_iterations, O2HB_LIVE_THRESHOLD + 1); |
1321 | 1322 | ||
1322 | reg->hr_task = kthread_run(o2hb_thread, reg, "o2hb-%s", | 1323 | hb_task = kthread_run(o2hb_thread, reg, "o2hb-%s", |
1323 | reg->hr_item.ci_name); | 1324 | reg->hr_item.ci_name); |
1324 | if (IS_ERR(reg->hr_task)) { | 1325 | if (IS_ERR(hb_task)) { |
1325 | ret = PTR_ERR(reg->hr_task); | 1326 | ret = PTR_ERR(hb_task); |
1326 | mlog_errno(ret); | 1327 | mlog_errno(ret); |
1327 | reg->hr_task = NULL; | ||
1328 | goto out; | 1328 | goto out; |
1329 | } | 1329 | } |
1330 | 1330 | ||
1331 | spin_lock(&o2hb_live_lock); | ||
1332 | reg->hr_task = hb_task; | ||
1333 | spin_unlock(&o2hb_live_lock); | ||
1334 | |||
1331 | ret = wait_event_interruptible(o2hb_steady_queue, | 1335 | ret = wait_event_interruptible(o2hb_steady_queue, |
1332 | atomic_read(®->hr_steady_iterations) == 0); | 1336 | atomic_read(®->hr_steady_iterations) == 0); |
1333 | if (ret) { | 1337 | if (ret) { |
1334 | kthread_stop(reg->hr_task); | 1338 | spin_lock(&o2hb_live_lock); |
1339 | hb_task = reg->hr_task; | ||
1335 | reg->hr_task = NULL; | 1340 | reg->hr_task = NULL; |
1341 | spin_unlock(&o2hb_live_lock); | ||
1342 | |||
1343 | if (hb_task) | ||
1344 | kthread_stop(hb_task); | ||
1336 | goto out; | 1345 | goto out; |
1337 | } | 1346 | } |
1338 | 1347 | ||
@@ -1354,10 +1363,17 @@ out: | |||
1354 | static ssize_t o2hb_region_pid_read(struct o2hb_region *reg, | 1363 | static ssize_t o2hb_region_pid_read(struct o2hb_region *reg, |
1355 | char *page) | 1364 | char *page) |
1356 | { | 1365 | { |
1357 | if (!reg->hr_task) | 1366 | pid_t pid = 0; |
1367 | |||
1368 | spin_lock(&o2hb_live_lock); | ||
1369 | if (reg->hr_task) | ||
1370 | pid = reg->hr_task->pid; | ||
1371 | spin_unlock(&o2hb_live_lock); | ||
1372 | |||
1373 | if (!pid) | ||
1358 | return 0; | 1374 | return 0; |
1359 | 1375 | ||
1360 | return sprintf(page, "%u\n", reg->hr_task->pid); | 1376 | return sprintf(page, "%u\n", pid); |
1361 | } | 1377 | } |
1362 | 1378 | ||
1363 | struct o2hb_region_attribute { | 1379 | struct o2hb_region_attribute { |
@@ -1495,13 +1511,17 @@ out: | |||
1495 | static void o2hb_heartbeat_group_drop_item(struct config_group *group, | 1511 | static void o2hb_heartbeat_group_drop_item(struct config_group *group, |
1496 | struct config_item *item) | 1512 | struct config_item *item) |
1497 | { | 1513 | { |
1514 | struct task_struct *hb_task; | ||
1498 | struct o2hb_region *reg = to_o2hb_region(item); | 1515 | struct o2hb_region *reg = to_o2hb_region(item); |
1499 | 1516 | ||
1500 | /* stop the thread when the user removes the region dir */ | 1517 | /* stop the thread when the user removes the region dir */ |
1501 | if (reg->hr_task) { | 1518 | spin_lock(&o2hb_live_lock); |
1502 | kthread_stop(reg->hr_task); | 1519 | hb_task = reg->hr_task; |
1503 | reg->hr_task = NULL; | 1520 | reg->hr_task = NULL; |
1504 | } | 1521 | spin_unlock(&o2hb_live_lock); |
1522 | |||
1523 | if (hb_task) | ||
1524 | kthread_stop(hb_task); | ||
1505 | 1525 | ||
1506 | config_item_put(item); | 1526 | config_item_put(item); |
1507 | } | 1527 | } |
@@ -1682,7 +1702,7 @@ out: | |||
1682 | } | 1702 | } |
1683 | EXPORT_SYMBOL_GPL(o2hb_register_callback); | 1703 | EXPORT_SYMBOL_GPL(o2hb_register_callback); |
1684 | 1704 | ||
1685 | int o2hb_unregister_callback(struct o2hb_callback_func *hc) | 1705 | void o2hb_unregister_callback(struct o2hb_callback_func *hc) |
1686 | { | 1706 | { |
1687 | BUG_ON(hc->hc_magic != O2HB_CB_MAGIC); | 1707 | BUG_ON(hc->hc_magic != O2HB_CB_MAGIC); |
1688 | 1708 | ||
@@ -1690,15 +1710,13 @@ int o2hb_unregister_callback(struct o2hb_callback_func *hc) | |||
1690 | __builtin_return_address(0), hc); | 1710 | __builtin_return_address(0), hc); |
1691 | 1711 | ||
1692 | if (list_empty(&hc->hc_item)) | 1712 | if (list_empty(&hc->hc_item)) |
1693 | return 0; | 1713 | return; |
1694 | 1714 | ||
1695 | down_write(&o2hb_callback_sem); | 1715 | down_write(&o2hb_callback_sem); |
1696 | 1716 | ||
1697 | list_del_init(&hc->hc_item); | 1717 | list_del_init(&hc->hc_item); |
1698 | 1718 | ||
1699 | up_write(&o2hb_callback_sem); | 1719 | up_write(&o2hb_callback_sem); |
1700 | |||
1701 | return 0; | ||
1702 | } | 1720 | } |
1703 | EXPORT_SYMBOL_GPL(o2hb_unregister_callback); | 1721 | EXPORT_SYMBOL_GPL(o2hb_unregister_callback); |
1704 | 1722 | ||
diff --git a/fs/ocfs2/cluster/heartbeat.h b/fs/ocfs2/cluster/heartbeat.h index cac6223206a9..cc6d40b39771 100644 --- a/fs/ocfs2/cluster/heartbeat.h +++ b/fs/ocfs2/cluster/heartbeat.h | |||
@@ -70,7 +70,7 @@ void o2hb_setup_callback(struct o2hb_callback_func *hc, | |||
70 | void *data, | 70 | void *data, |
71 | int priority); | 71 | int priority); |
72 | int o2hb_register_callback(struct o2hb_callback_func *hc); | 72 | int o2hb_register_callback(struct o2hb_callback_func *hc); |
73 | int o2hb_unregister_callback(struct o2hb_callback_func *hc); | 73 | void o2hb_unregister_callback(struct o2hb_callback_func *hc); |
74 | void o2hb_fill_node_map(unsigned long *map, | 74 | void o2hb_fill_node_map(unsigned long *map, |
75 | unsigned bytes); | 75 | unsigned bytes); |
76 | void o2hb_init(void); | 76 | void o2hb_init(void); |
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index 1718215fc018..69caf3e12fea 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -1638,17 +1638,8 @@ static void o2net_hb_node_up_cb(struct o2nm_node *node, int node_num, | |||
1638 | 1638 | ||
1639 | void o2net_unregister_hb_callbacks(void) | 1639 | void o2net_unregister_hb_callbacks(void) |
1640 | { | 1640 | { |
1641 | int ret; | 1641 | o2hb_unregister_callback(&o2net_hb_up); |
1642 | 1642 | o2hb_unregister_callback(&o2net_hb_down); | |
1643 | ret = o2hb_unregister_callback(&o2net_hb_up); | ||
1644 | if (ret < 0) | ||
1645 | mlog(ML_ERROR, "Status return %d unregistering heartbeat up " | ||
1646 | "callback!\n", ret); | ||
1647 | |||
1648 | ret = o2hb_unregister_callback(&o2net_hb_down); | ||
1649 | if (ret < 0) | ||
1650 | mlog(ML_ERROR, "Status return %d unregistering heartbeat down " | ||
1651 | "callback!\n", ret); | ||
1652 | } | 1643 | } |
1653 | 1644 | ||
1654 | int o2net_register_hb_callbacks(void) | 1645 | int o2net_register_hb_callbacks(void) |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 77e4e6169a0d..9229e04362f6 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -2730,14 +2730,17 @@ int dlm_empty_lockres(struct dlm_ctxt *dlm, struct dlm_lock_resource *res) | |||
2730 | int ret; | 2730 | int ret; |
2731 | int lock_dropped = 0; | 2731 | int lock_dropped = 0; |
2732 | 2732 | ||
2733 | spin_lock(&res->spinlock); | ||
2733 | if (res->owner != dlm->node_num) { | 2734 | if (res->owner != dlm->node_num) { |
2734 | if (!__dlm_lockres_unused(res)) { | 2735 | if (!__dlm_lockres_unused(res)) { |
2735 | mlog(ML_ERROR, "%s:%.*s: this node is not master, " | 2736 | mlog(ML_ERROR, "%s:%.*s: this node is not master, " |
2736 | "trying to free this but locks remain\n", | 2737 | "trying to free this but locks remain\n", |
2737 | dlm->name, res->lockname.len, res->lockname.name); | 2738 | dlm->name, res->lockname.len, res->lockname.name); |
2738 | } | 2739 | } |
2740 | spin_unlock(&res->spinlock); | ||
2739 | goto leave; | 2741 | goto leave; |
2740 | } | 2742 | } |
2743 | spin_unlock(&res->spinlock); | ||
2741 | 2744 | ||
2742 | /* Wheee! Migrate lockres here! Will sleep so drop spinlock. */ | 2745 | /* Wheee! Migrate lockres here! Will sleep so drop spinlock. */ |
2743 | spin_unlock(&dlm->spinlock); | 2746 | spin_unlock(&dlm->spinlock); |
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index 8ffa0916eb86..6421a8fae1de 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c | |||
@@ -265,8 +265,10 @@ static void dlm_run_purge_list(struct dlm_ctxt *dlm, | |||
265 | /* This may drop and reacquire the dlm spinlock if it | 265 | /* This may drop and reacquire the dlm spinlock if it |
266 | * has to do migration. */ | 266 | * has to do migration. */ |
267 | mlog(0, "calling dlm_purge_lockres!\n"); | 267 | mlog(0, "calling dlm_purge_lockres!\n"); |
268 | dlm_lockres_get(lockres); | ||
268 | if (dlm_purge_lockres(dlm, lockres)) | 269 | if (dlm_purge_lockres(dlm, lockres)) |
269 | BUG(); | 270 | BUG(); |
271 | dlm_lockres_put(lockres); | ||
270 | mlog(0, "DONE calling dlm_purge_lockres!\n"); | 272 | mlog(0, "DONE calling dlm_purge_lockres!\n"); |
271 | 273 | ||
272 | /* Avoid adding any scheduling latencies */ | 274 | /* Avoid adding any scheduling latencies */ |
diff --git a/fs/ocfs2/heartbeat.c b/fs/ocfs2/heartbeat.c index 8fc52d6d0ce7..b25ef63781ba 100644 --- a/fs/ocfs2/heartbeat.c +++ b/fs/ocfs2/heartbeat.c | |||
@@ -164,8 +164,10 @@ int ocfs2_register_hb_callbacks(struct ocfs2_super *osb) | |||
164 | } | 164 | } |
165 | 165 | ||
166 | status = o2hb_register_callback(&osb->osb_hb_up); | 166 | status = o2hb_register_callback(&osb->osb_hb_up); |
167 | if (status < 0) | 167 | if (status < 0) { |
168 | mlog_errno(status); | 168 | mlog_errno(status); |
169 | o2hb_unregister_callback(&osb->osb_hb_down); | ||
170 | } | ||
169 | 171 | ||
170 | bail: | 172 | bail: |
171 | return status; | 173 | return status; |
@@ -173,18 +175,11 @@ bail: | |||
173 | 175 | ||
174 | void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb) | 176 | void ocfs2_clear_hb_callbacks(struct ocfs2_super *osb) |
175 | { | 177 | { |
176 | int status; | ||
177 | |||
178 | if (ocfs2_mount_local(osb)) | 178 | if (ocfs2_mount_local(osb)) |
179 | return; | 179 | return; |
180 | 180 | ||
181 | status = o2hb_unregister_callback(&osb->osb_hb_down); | 181 | o2hb_unregister_callback(&osb->osb_hb_down); |
182 | if (status < 0) | 182 | o2hb_unregister_callback(&osb->osb_hb_up); |
183 | mlog_errno(status); | ||
184 | |||
185 | status = o2hb_unregister_callback(&osb->osb_hb_up); | ||
186 | if (status < 0) | ||
187 | mlog_errno(status); | ||
188 | } | 183 | } |
189 | 184 | ||
190 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb) | 185 | void ocfs2_stop_heartbeat(struct ocfs2_super *osb) |
diff --git a/fs/partitions/Kconfig b/fs/partitions/Kconfig index 74552c60b671..6e8bb66fe619 100644 --- a/fs/partitions/Kconfig +++ b/fs/partitions/Kconfig | |||
@@ -235,5 +235,4 @@ config EFI_PARTITION | |||
235 | select CRC32 | 235 | select CRC32 |
236 | help | 236 | help |
237 | Say Y here if you would like to use hard disks under Linux which | 237 | Say Y here if you would like to use hard disks under Linux which |
238 | were partitioned using EFI GPT. Presently only useful on the | 238 | were partitioned using EFI GPT. |
239 | IA-64 platform. | ||
diff --git a/fs/partitions/check.c b/fs/partitions/check.c index e46d237b10f9..8a7d0035ad7a 100644 --- a/fs/partitions/check.c +++ b/fs/partitions/check.c | |||
@@ -541,7 +541,7 @@ int rescan_partitions(struct gendisk *disk, struct block_device *bdev) | |||
541 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) | 541 | if (!get_capacity(disk) || !(state = check_partition(disk, bdev))) |
542 | return 0; | 542 | return 0; |
543 | if (IS_ERR(state)) /* I/O error reading the partition table */ | 543 | if (IS_ERR(state)) /* I/O error reading the partition table */ |
544 | return PTR_ERR(state); | 544 | return -EIO; |
545 | for (p = 1; p < state->limit; p++) { | 545 | for (p = 1; p < state->limit; p++) { |
546 | sector_t size = state->parts[p].size; | 546 | sector_t size = state->parts[p].size; |
547 | sector_t from = state->parts[p].from; | 547 | sector_t from = state->parts[p].from; |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 01f7769da8e6..989af5e55d1b 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -1558,29 +1558,20 @@ static ssize_t proc_pid_attr_read(struct file * file, char __user * buf, | |||
1558 | size_t count, loff_t *ppos) | 1558 | size_t count, loff_t *ppos) |
1559 | { | 1559 | { |
1560 | struct inode * inode = file->f_path.dentry->d_inode; | 1560 | struct inode * inode = file->f_path.dentry->d_inode; |
1561 | unsigned long page; | 1561 | char *p = NULL; |
1562 | ssize_t length; | 1562 | ssize_t length; |
1563 | struct task_struct *task = get_proc_task(inode); | 1563 | struct task_struct *task = get_proc_task(inode); |
1564 | 1564 | ||
1565 | length = -ESRCH; | ||
1566 | if (!task) | 1565 | if (!task) |
1567 | goto out_no_task; | 1566 | return -ESRCH; |
1568 | |||
1569 | if (count > PAGE_SIZE) | ||
1570 | count = PAGE_SIZE; | ||
1571 | length = -ENOMEM; | ||
1572 | if (!(page = __get_free_page(GFP_KERNEL))) | ||
1573 | goto out; | ||
1574 | 1567 | ||
1575 | length = security_getprocattr(task, | 1568 | length = security_getprocattr(task, |
1576 | (char*)file->f_path.dentry->d_name.name, | 1569 | (char*)file->f_path.dentry->d_name.name, |
1577 | (void*)page, count); | 1570 | &p); |
1578 | if (length >= 0) | ||
1579 | length = simple_read_from_buffer(buf, count, ppos, (char *)page, length); | ||
1580 | free_page(page); | ||
1581 | out: | ||
1582 | put_task_struct(task); | 1571 | put_task_struct(task); |
1583 | out_no_task: | 1572 | if (length > 0) |
1573 | length = simple_read_from_buffer(buf, count, ppos, p, length); | ||
1574 | kfree(p); | ||
1584 | return length; | 1575 | return length; |
1585 | } | 1576 | } |
1586 | 1577 | ||
diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c index 42261dbdf60f..723f7c667661 100644 --- a/fs/smbfs/request.c +++ b/fs/smbfs/request.c | |||
@@ -181,6 +181,7 @@ static int smb_setup_request(struct smb_request *req) | |||
181 | req->rq_errno = 0; | 181 | req->rq_errno = 0; |
182 | req->rq_fragment = 0; | 182 | req->rq_fragment = 0; |
183 | kfree(req->rq_trans2buffer); | 183 | kfree(req->rq_trans2buffer); |
184 | req->rq_trans2buffer = NULL; | ||
184 | 185 | ||
185 | return 0; | 186 | return 0; |
186 | } | 187 | } |
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c index 8d4d839a9d88..fc4633378dc0 100644 --- a/fs/sysfs/file.c +++ b/fs/sysfs/file.c | |||
@@ -168,12 +168,12 @@ sysfs_read_file(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
168 | ssize_t retval = 0; | 168 | ssize_t retval = 0; |
169 | 169 | ||
170 | down(&buffer->sem); | 170 | down(&buffer->sem); |
171 | if (buffer->orphaned) { | ||
172 | retval = -ENODEV; | ||
173 | goto out; | ||
174 | } | ||
175 | if (buffer->needs_read_fill) { | 171 | if (buffer->needs_read_fill) { |
176 | if ((retval = fill_read_buffer(file->f_path.dentry,buffer))) | 172 | if (buffer->orphaned) |
173 | retval = -ENODEV; | ||
174 | else | ||
175 | retval = fill_read_buffer(file->f_path.dentry,buffer); | ||
176 | if (retval) | ||
177 | goto out; | 177 | goto out; |
178 | } | 178 | } |
179 | pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", | 179 | pr_debug("%s: count = %zd, ppos = %lld, buf = %s\n", |
@@ -629,6 +629,60 @@ void sysfs_remove_file_from_group(struct kobject *kobj, | |||
629 | } | 629 | } |
630 | EXPORT_SYMBOL_GPL(sysfs_remove_file_from_group); | 630 | EXPORT_SYMBOL_GPL(sysfs_remove_file_from_group); |
631 | 631 | ||
632 | struct sysfs_schedule_callback_struct { | ||
633 | struct kobject *kobj; | ||
634 | void (*func)(void *); | ||
635 | void *data; | ||
636 | struct work_struct work; | ||
637 | }; | ||
638 | |||
639 | static void sysfs_schedule_callback_work(struct work_struct *work) | ||
640 | { | ||
641 | struct sysfs_schedule_callback_struct *ss = container_of(work, | ||
642 | struct sysfs_schedule_callback_struct, work); | ||
643 | |||
644 | (ss->func)(ss->data); | ||
645 | kobject_put(ss->kobj); | ||
646 | kfree(ss); | ||
647 | } | ||
648 | |||
649 | /** | ||
650 | * sysfs_schedule_callback - helper to schedule a callback for a kobject | ||
651 | * @kobj: object we're acting for. | ||
652 | * @func: callback function to invoke later. | ||
653 | * @data: argument to pass to @func. | ||
654 | * | ||
655 | * sysfs attribute methods must not unregister themselves or their parent | ||
656 | * kobject (which would amount to the same thing). Attempts to do so will | ||
657 | * deadlock, since unregistration is mutually exclusive with driver | ||
658 | * callbacks. | ||
659 | * | ||
660 | * Instead methods can call this routine, which will attempt to allocate | ||
661 | * and schedule a workqueue request to call back @func with @data as its | ||
662 | * argument in the workqueue's process context. @kobj will be pinned | ||
663 | * until @func returns. | ||
664 | * | ||
665 | * Returns 0 if the request was submitted, -ENOMEM if storage could not | ||
666 | * be allocated. | ||
667 | */ | ||
668 | int sysfs_schedule_callback(struct kobject *kobj, void (*func)(void *), | ||
669 | void *data) | ||
670 | { | ||
671 | struct sysfs_schedule_callback_struct *ss; | ||
672 | |||
673 | ss = kmalloc(sizeof(*ss), GFP_KERNEL); | ||
674 | if (!ss) | ||
675 | return -ENOMEM; | ||
676 | kobject_get(kobj); | ||
677 | ss->kobj = kobj; | ||
678 | ss->func = func; | ||
679 | ss->data = data; | ||
680 | INIT_WORK(&ss->work, sysfs_schedule_callback_work); | ||
681 | schedule_work(&ss->work); | ||
682 | return 0; | ||
683 | } | ||
684 | EXPORT_SYMBOL_GPL(sysfs_schedule_callback); | ||
685 | |||
632 | 686 | ||
633 | EXPORT_SYMBOL_GPL(sysfs_create_file); | 687 | EXPORT_SYMBOL_GPL(sysfs_create_file); |
634 | EXPORT_SYMBOL_GPL(sysfs_remove_file); | 688 | EXPORT_SYMBOL_GPL(sysfs_remove_file); |
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c index ccb7d722c558..4de5c6b89918 100644 --- a/fs/sysfs/inode.c +++ b/fs/sysfs/inode.c | |||
@@ -222,13 +222,17 @@ const unsigned char * sysfs_get_name(struct sysfs_dirent *sd) | |||
222 | 222 | ||
223 | static inline void orphan_all_buffers(struct inode *node) | 223 | static inline void orphan_all_buffers(struct inode *node) |
224 | { | 224 | { |
225 | struct sysfs_buffer_collection *set = node->i_private; | 225 | struct sysfs_buffer_collection *set; |
226 | struct sysfs_buffer *buf; | 226 | struct sysfs_buffer *buf; |
227 | 227 | ||
228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); | 228 | mutex_lock_nested(&node->i_mutex, I_MUTEX_CHILD); |
229 | if (node->i_private) { | 229 | set = node->i_private; |
230 | list_for_each_entry(buf, &set->associates, associates) | 230 | if (set) { |
231 | list_for_each_entry(buf, &set->associates, associates) { | ||
232 | down(&buf->sem); | ||
231 | buf->orphaned = 1; | 233 | buf->orphaned = 1; |
234 | up(&buf->sem); | ||
235 | } | ||
232 | } | 236 | } |
233 | mutex_unlock(&node->i_mutex); | 237 | mutex_unlock(&node->i_mutex); |
234 | } | 238 | } |
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c index bcc44084e004..841ac25fd950 100644 --- a/fs/ufs/balloc.c +++ b/fs/ufs/balloc.c | |||
@@ -244,62 +244,87 @@ failed: | |||
244 | * We can come here from ufs_writepage or ufs_prepare_write, | 244 | * We can come here from ufs_writepage or ufs_prepare_write, |
245 | * locked_page is argument of these functions, so we already lock it. | 245 | * locked_page is argument of these functions, so we already lock it. |
246 | */ | 246 | */ |
247 | static void ufs_change_blocknr(struct inode *inode, unsigned int beg, | 247 | static void ufs_change_blocknr(struct inode *inode, sector_t beg, |
248 | unsigned int count, unsigned int oldb, | 248 | unsigned int count, sector_t oldb, |
249 | unsigned int newb, struct page *locked_page) | 249 | sector_t newb, struct page *locked_page) |
250 | { | 250 | { |
251 | const unsigned mask = (1 << (PAGE_CACHE_SHIFT - inode->i_blkbits)) - 1; | 251 | const unsigned blks_per_page = |
252 | 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits); | ||
253 | const unsigned mask = blks_per_page - 1; | ||
252 | struct address_space * const mapping = inode->i_mapping; | 254 | struct address_space * const mapping = inode->i_mapping; |
253 | pgoff_t index, cur_index; | 255 | pgoff_t index, cur_index, last_index; |
254 | unsigned end, pos, j; | 256 | unsigned pos, j, lblock; |
257 | sector_t end, i; | ||
255 | struct page *page; | 258 | struct page *page; |
256 | struct buffer_head *head, *bh; | 259 | struct buffer_head *head, *bh; |
257 | 260 | ||
258 | UFSD("ENTER, ino %lu, count %u, oldb %u, newb %u\n", | 261 | UFSD("ENTER, ino %lu, count %u, oldb %llu, newb %llu\n", |
259 | inode->i_ino, count, oldb, newb); | 262 | inode->i_ino, count, |
263 | (unsigned long long)oldb, (unsigned long long)newb); | ||
260 | 264 | ||
261 | BUG_ON(!locked_page); | 265 | BUG_ON(!locked_page); |
262 | BUG_ON(!PageLocked(locked_page)); | 266 | BUG_ON(!PageLocked(locked_page)); |
263 | 267 | ||
264 | cur_index = locked_page->index; | 268 | cur_index = locked_page->index; |
265 | 269 | end = count + beg; | |
266 | for (end = count + beg; beg < end; beg = (beg | mask) + 1) { | 270 | last_index = end >> (PAGE_CACHE_SHIFT - inode->i_blkbits); |
267 | index = beg >> (PAGE_CACHE_SHIFT - inode->i_blkbits); | 271 | for (i = beg; i < end; i = (i | mask) + 1) { |
272 | index = i >> (PAGE_CACHE_SHIFT - inode->i_blkbits); | ||
268 | 273 | ||
269 | if (likely(cur_index != index)) { | 274 | if (likely(cur_index != index)) { |
270 | page = ufs_get_locked_page(mapping, index); | 275 | page = ufs_get_locked_page(mapping, index); |
271 | if (!page || IS_ERR(page)) /* it was truncated or EIO */ | 276 | if (!page)/* it was truncated */ |
277 | continue; | ||
278 | if (IS_ERR(page)) {/* or EIO */ | ||
279 | ufs_error(inode->i_sb, __FUNCTION__, | ||
280 | "read of page %llu failed\n", | ||
281 | (unsigned long long)index); | ||
272 | continue; | 282 | continue; |
283 | } | ||
273 | } else | 284 | } else |
274 | page = locked_page; | 285 | page = locked_page; |
275 | 286 | ||
276 | head = page_buffers(page); | 287 | head = page_buffers(page); |
277 | bh = head; | 288 | bh = head; |
278 | pos = beg & mask; | 289 | pos = i & mask; |
279 | for (j = 0; j < pos; ++j) | 290 | for (j = 0; j < pos; ++j) |
280 | bh = bh->b_this_page; | 291 | bh = bh->b_this_page; |
281 | j = 0; | 292 | |
293 | |||
294 | if (unlikely(index == last_index)) | ||
295 | lblock = end & mask; | ||
296 | else | ||
297 | lblock = blks_per_page; | ||
298 | |||
282 | do { | 299 | do { |
283 | if (buffer_mapped(bh)) { | 300 | if (j >= lblock) |
284 | pos = bh->b_blocknr - oldb; | 301 | break; |
285 | if (pos < count) { | 302 | pos = (i - beg) + j; |
286 | UFSD(" change from %llu to %llu\n", | 303 | |
287 | (unsigned long long)pos + oldb, | 304 | if (!buffer_mapped(bh)) |
288 | (unsigned long long)pos + newb); | 305 | map_bh(bh, inode->i_sb, oldb + pos); |
289 | bh->b_blocknr = newb + pos; | 306 | if (!buffer_uptodate(bh)) { |
290 | unmap_underlying_metadata(bh->b_bdev, | 307 | ll_rw_block(READ, 1, &bh); |
291 | bh->b_blocknr); | 308 | wait_on_buffer(bh); |
292 | mark_buffer_dirty(bh); | 309 | if (!buffer_uptodate(bh)) { |
293 | ++j; | 310 | ufs_error(inode->i_sb, __FUNCTION__, |
311 | "read of block failed\n"); | ||
312 | break; | ||
294 | } | 313 | } |
295 | } | 314 | } |
296 | 315 | ||
316 | UFSD(" change from %llu to %llu, pos %u\n", | ||
317 | (unsigned long long)pos + oldb, | ||
318 | (unsigned long long)pos + newb, pos); | ||
319 | |||
320 | bh->b_blocknr = newb + pos; | ||
321 | unmap_underlying_metadata(bh->b_bdev, | ||
322 | bh->b_blocknr); | ||
323 | mark_buffer_dirty(bh); | ||
324 | ++j; | ||
297 | bh = bh->b_this_page; | 325 | bh = bh->b_this_page; |
298 | } while (bh != head); | 326 | } while (bh != head); |
299 | 327 | ||
300 | if (j) | ||
301 | set_page_dirty(page); | ||
302 | |||
303 | if (likely(cur_index != index)) | 328 | if (likely(cur_index != index)) |
304 | ufs_put_locked_page(page); | 329 | ufs_put_locked_page(page); |
305 | } | 330 | } |
@@ -457,8 +482,9 @@ u64 ufs_new_fragments(struct inode *inode, void *p, u64 fragment, | |||
457 | if (result) { | 482 | if (result) { |
458 | ufs_clear_frags(inode, result + oldcount, newcount - oldcount, | 483 | ufs_clear_frags(inode, result + oldcount, newcount - oldcount, |
459 | locked_page != NULL); | 484 | locked_page != NULL); |
460 | ufs_change_blocknr(inode, fragment - oldcount, oldcount, tmp, | 485 | ufs_change_blocknr(inode, fragment - oldcount, oldcount, |
461 | result, locked_page); | 486 | uspi->s_sbbase + tmp, |
487 | uspi->s_sbbase + result, locked_page); | ||
462 | ufs_cpu_to_data_ptr(sb, p, result); | 488 | ufs_cpu_to_data_ptr(sb, p, result); |
463 | *err = 0; | 489 | *err = 0; |
464 | UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count); | 490 | UFS_I(inode)->i_lastfrag = max_t(u32, UFS_I(inode)->i_lastfrag, fragment + count); |
diff --git a/fs/ufs/ialloc.c b/fs/ufs/ialloc.c index b868878009b6..c28a8b6f2feb 100644 --- a/fs/ufs/ialloc.c +++ b/fs/ufs/ialloc.c | |||
@@ -343,9 +343,8 @@ cg_found: | |||
343 | lock_buffer(bh); | 343 | lock_buffer(bh); |
344 | ufs2_inode = (struct ufs2_inode *)bh->b_data; | 344 | ufs2_inode = (struct ufs2_inode *)bh->b_data; |
345 | ufs2_inode += ufs_inotofsbo(inode->i_ino); | 345 | ufs2_inode += ufs_inotofsbo(inode->i_ino); |
346 | ufs2_inode->ui_birthtime.tv_sec = | 346 | ufs2_inode->ui_birthtime = cpu_to_fs64(sb, CURRENT_TIME.tv_sec); |
347 | cpu_to_fs32(sb, CURRENT_TIME_SEC.tv_sec); | 347 | ufs2_inode->ui_birthnsec = cpu_to_fs32(sb, CURRENT_TIME.tv_nsec); |
348 | ufs2_inode->ui_birthtime.tv_usec = 0; | ||
349 | mark_buffer_dirty(bh); | 348 | mark_buffer_dirty(bh); |
350 | unlock_buffer(bh); | 349 | unlock_buffer(bh); |
351 | if (sb->s_flags & MS_SYNCHRONOUS) | 350 | if (sb->s_flags & MS_SYNCHRONOUS) |
diff --git a/fs/ufs/inode.c b/fs/ufs/inode.c index fb34ad03e224..013d7afe7cde 100644 --- a/fs/ufs/inode.c +++ b/fs/ufs/inode.c | |||
@@ -212,7 +212,7 @@ repeat: | |||
212 | brelse (result); | 212 | brelse (result); |
213 | goto repeat; | 213 | goto repeat; |
214 | } else { | 214 | } else { |
215 | *phys = tmp + blockoff; | 215 | *phys = uspi->s_sbbase + tmp + blockoff; |
216 | return NULL; | 216 | return NULL; |
217 | } | 217 | } |
218 | } | 218 | } |
@@ -282,9 +282,9 @@ repeat: | |||
282 | } | 282 | } |
283 | 283 | ||
284 | if (!phys) { | 284 | if (!phys) { |
285 | result = sb_getblk(sb, tmp + blockoff); | 285 | result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff); |
286 | } else { | 286 | } else { |
287 | *phys = tmp + blockoff; | 287 | *phys = uspi->s_sbbase + tmp + blockoff; |
288 | result = NULL; | 288 | result = NULL; |
289 | *err = 0; | 289 | *err = 0; |
290 | *new = 1; | 290 | *new = 1; |
@@ -368,7 +368,7 @@ repeat: | |||
368 | brelse (result); | 368 | brelse (result); |
369 | goto repeat; | 369 | goto repeat; |
370 | } else { | 370 | } else { |
371 | *phys = tmp + blockoff; | 371 | *phys = uspi->s_sbbase + tmp + blockoff; |
372 | goto out; | 372 | goto out; |
373 | } | 373 | } |
374 | } | 374 | } |
@@ -389,9 +389,9 @@ repeat: | |||
389 | 389 | ||
390 | 390 | ||
391 | if (!phys) { | 391 | if (!phys) { |
392 | result = sb_getblk(sb, tmp + blockoff); | 392 | result = sb_getblk(sb, uspi->s_sbbase + tmp + blockoff); |
393 | } else { | 393 | } else { |
394 | *phys = tmp + blockoff; | 394 | *phys = uspi->s_sbbase + tmp + blockoff; |
395 | *new = 1; | 395 | *new = 1; |
396 | } | 396 | } |
397 | 397 | ||
@@ -668,12 +668,12 @@ static void ufs2_read_inode(struct inode *inode, struct ufs2_inode *ufs2_inode) | |||
668 | inode->i_gid = fs32_to_cpu(sb, ufs2_inode->ui_gid); | 668 | inode->i_gid = fs32_to_cpu(sb, ufs2_inode->ui_gid); |
669 | 669 | ||
670 | inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size); | 670 | inode->i_size = fs64_to_cpu(sb, ufs2_inode->ui_size); |
671 | inode->i_atime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_atime.tv_sec); | 671 | inode->i_atime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_atime); |
672 | inode->i_ctime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_ctime.tv_sec); | 672 | inode->i_ctime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_ctime); |
673 | inode->i_mtime.tv_sec = fs32_to_cpu(sb, ufs2_inode->ui_mtime.tv_sec); | 673 | inode->i_mtime.tv_sec = fs64_to_cpu(sb, ufs2_inode->ui_mtime); |
674 | inode->i_mtime.tv_nsec = 0; | 674 | inode->i_atime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_atimensec); |
675 | inode->i_atime.tv_nsec = 0; | 675 | inode->i_ctime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_ctimensec); |
676 | inode->i_ctime.tv_nsec = 0; | 676 | inode->i_mtime.tv_nsec = fs32_to_cpu(sb, ufs2_inode->ui_mtimensec); |
677 | inode->i_blocks = fs64_to_cpu(sb, ufs2_inode->ui_blocks); | 677 | inode->i_blocks = fs64_to_cpu(sb, ufs2_inode->ui_blocks); |
678 | inode->i_generation = fs32_to_cpu(sb, ufs2_inode->ui_gen); | 678 | inode->i_generation = fs32_to_cpu(sb, ufs2_inode->ui_gen); |
679 | ufsi->i_flags = fs32_to_cpu(sb, ufs2_inode->ui_flags); | 679 | ufsi->i_flags = fs32_to_cpu(sb, ufs2_inode->ui_flags); |
@@ -803,12 +803,12 @@ static void ufs2_update_inode(struct inode *inode, struct ufs2_inode *ufs_inode) | |||
803 | ufs_inode->ui_gid = cpu_to_fs32(sb, inode->i_gid); | 803 | ufs_inode->ui_gid = cpu_to_fs32(sb, inode->i_gid); |
804 | 804 | ||
805 | ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); | 805 | ufs_inode->ui_size = cpu_to_fs64(sb, inode->i_size); |
806 | ufs_inode->ui_atime.tv_sec = cpu_to_fs32(sb, inode->i_atime.tv_sec); | 806 | ufs_inode->ui_atime = cpu_to_fs64(sb, inode->i_atime.tv_sec); |
807 | ufs_inode->ui_atime.tv_usec = 0; | 807 | ufs_inode->ui_atimensec = cpu_to_fs32(sb, inode->i_atime.tv_nsec); |
808 | ufs_inode->ui_ctime.tv_sec = cpu_to_fs32(sb, inode->i_ctime.tv_sec); | 808 | ufs_inode->ui_ctime = cpu_to_fs64(sb, inode->i_ctime.tv_sec); |
809 | ufs_inode->ui_ctime.tv_usec = 0; | 809 | ufs_inode->ui_ctimensec = cpu_to_fs32(sb, inode->i_ctime.tv_nsec); |
810 | ufs_inode->ui_mtime.tv_sec = cpu_to_fs32(sb, inode->i_mtime.tv_sec); | 810 | ufs_inode->ui_mtime = cpu_to_fs64(sb, inode->i_mtime.tv_sec); |
811 | ufs_inode->ui_mtime.tv_usec = 0; | 811 | ufs_inode->ui_mtimensec = cpu_to_fs32(sb, inode->i_mtime.tv_nsec); |
812 | 812 | ||
813 | ufs_inode->ui_blocks = cpu_to_fs64(sb, inode->i_blocks); | 813 | ufs_inode->ui_blocks = cpu_to_fs64(sb, inode->i_blocks); |
814 | ufs_inode->ui_flags = cpu_to_fs32(sb, ufsi->i_flags); | 814 | ufs_inode->ui_flags = cpu_to_fs32(sb, ufsi->i_flags); |
diff --git a/fs/ufs/truncate.c b/fs/ufs/truncate.c index 749581fa7729..79c54c85fb58 100644 --- a/fs/ufs/truncate.c +++ b/fs/ufs/truncate.c | |||
@@ -74,7 +74,7 @@ static int ufs_trunc_direct(struct inode *inode) | |||
74 | unsigned i, tmp; | 74 | unsigned i, tmp; |
75 | int retry; | 75 | int retry; |
76 | 76 | ||
77 | UFSD("ENTER\n"); | 77 | UFSD("ENTER: ino %lu\n", inode->i_ino); |
78 | 78 | ||
79 | sb = inode->i_sb; | 79 | sb = inode->i_sb; |
80 | uspi = UFS_SB(sb)->s_uspi; | 80 | uspi = UFS_SB(sb)->s_uspi; |
@@ -96,8 +96,8 @@ static int ufs_trunc_direct(struct inode *inode) | |||
96 | block2 = ufs_fragstoblks (frag3); | 96 | block2 = ufs_fragstoblks (frag3); |
97 | } | 97 | } |
98 | 98 | ||
99 | UFSD("frag1 %llu, frag2 %llu, block1 %llu, block2 %llu, frag3 %llu," | 99 | UFSD("ino %lu, frag1 %llu, frag2 %llu, block1 %llu, block2 %llu," |
100 | " frag4 %llu\n", | 100 | " frag3 %llu, frag4 %llu\n", inode->i_ino, |
101 | (unsigned long long)frag1, (unsigned long long)frag2, | 101 | (unsigned long long)frag1, (unsigned long long)frag2, |
102 | (unsigned long long)block1, (unsigned long long)block2, | 102 | (unsigned long long)block1, (unsigned long long)block2, |
103 | (unsigned long long)frag3, (unsigned long long)frag4); | 103 | (unsigned long long)frag3, (unsigned long long)frag4); |
@@ -163,7 +163,7 @@ next1: | |||
163 | mark_inode_dirty(inode); | 163 | mark_inode_dirty(inode); |
164 | next3: | 164 | next3: |
165 | 165 | ||
166 | UFSD("EXIT\n"); | 166 | UFSD("EXIT: ino %lu\n", inode->i_ino); |
167 | return retry; | 167 | return retry; |
168 | } | 168 | } |
169 | 169 | ||
@@ -248,7 +248,7 @@ static int ufs_trunc_indirect(struct inode *inode, u64 offset, void *p) | |||
248 | } | 248 | } |
249 | ubh_brelse (ind_ubh); | 249 | ubh_brelse (ind_ubh); |
250 | 250 | ||
251 | UFSD("EXIT\n"); | 251 | UFSD("EXIT: ino %lu\n", inode->i_ino); |
252 | 252 | ||
253 | return retry; | 253 | return retry; |
254 | } | 254 | } |
@@ -262,7 +262,7 @@ static int ufs_trunc_dindirect(struct inode *inode, u64 offset, void *p) | |||
262 | void *dind; | 262 | void *dind; |
263 | int retry = 0; | 263 | int retry = 0; |
264 | 264 | ||
265 | UFSD("ENTER\n"); | 265 | UFSD("ENTER: ino %lu\n", inode->i_ino); |
266 | 266 | ||
267 | sb = inode->i_sb; | 267 | sb = inode->i_sb; |
268 | uspi = UFS_SB(sb)->s_uspi; | 268 | uspi = UFS_SB(sb)->s_uspi; |
@@ -312,7 +312,7 @@ static int ufs_trunc_dindirect(struct inode *inode, u64 offset, void *p) | |||
312 | } | 312 | } |
313 | ubh_brelse (dind_bh); | 313 | ubh_brelse (dind_bh); |
314 | 314 | ||
315 | UFSD("EXIT\n"); | 315 | UFSD("EXIT: ino %lu\n", inode->i_ino); |
316 | 316 | ||
317 | return retry; | 317 | return retry; |
318 | } | 318 | } |
@@ -327,7 +327,7 @@ static int ufs_trunc_tindirect(struct inode *inode) | |||
327 | void *tind, *p; | 327 | void *tind, *p; |
328 | int retry; | 328 | int retry; |
329 | 329 | ||
330 | UFSD("ENTER\n"); | 330 | UFSD("ENTER: ino %lu\n", inode->i_ino); |
331 | 331 | ||
332 | retry = 0; | 332 | retry = 0; |
333 | 333 | ||
@@ -348,7 +348,7 @@ static int ufs_trunc_tindirect(struct inode *inode) | |||
348 | } | 348 | } |
349 | 349 | ||
350 | for (i = tindirect_block ; i < uspi->s_apb ; i++) { | 350 | for (i = tindirect_block ; i < uspi->s_apb ; i++) { |
351 | tind = ubh_get_addr32 (tind_bh, i); | 351 | tind = ubh_get_data_ptr(uspi, tind_bh, i); |
352 | retry |= ufs_trunc_dindirect(inode, UFS_NDADDR + | 352 | retry |= ufs_trunc_dindirect(inode, UFS_NDADDR + |
353 | uspi->s_apb + ((i + 1) << uspi->s_2apbshift), tind); | 353 | uspi->s_apb + ((i + 1) << uspi->s_2apbshift), tind); |
354 | ubh_mark_buffer_dirty(tind_bh); | 354 | ubh_mark_buffer_dirty(tind_bh); |
@@ -372,19 +372,21 @@ static int ufs_trunc_tindirect(struct inode *inode) | |||
372 | } | 372 | } |
373 | ubh_brelse (tind_bh); | 373 | ubh_brelse (tind_bh); |
374 | 374 | ||
375 | UFSD("EXIT\n"); | 375 | UFSD("EXIT: ino %lu\n", inode->i_ino); |
376 | return retry; | 376 | return retry; |
377 | } | 377 | } |
378 | 378 | ||
379 | static int ufs_alloc_lastblock(struct inode *inode) | 379 | static int ufs_alloc_lastblock(struct inode *inode) |
380 | { | 380 | { |
381 | int err = 0; | 381 | int err = 0; |
382 | struct super_block *sb = inode->i_sb; | ||
382 | struct address_space *mapping = inode->i_mapping; | 383 | struct address_space *mapping = inode->i_mapping; |
383 | struct ufs_sb_private_info *uspi = UFS_SB(inode->i_sb)->s_uspi; | 384 | struct ufs_sb_private_info *uspi = UFS_SB(sb)->s_uspi; |
384 | unsigned i, end; | 385 | unsigned i, end; |
385 | sector_t lastfrag; | 386 | sector_t lastfrag; |
386 | struct page *lastpage; | 387 | struct page *lastpage; |
387 | struct buffer_head *bh; | 388 | struct buffer_head *bh; |
389 | u64 phys64; | ||
388 | 390 | ||
389 | lastfrag = (i_size_read(inode) + uspi->s_fsize - 1) >> uspi->s_fshift; | 391 | lastfrag = (i_size_read(inode) + uspi->s_fsize - 1) >> uspi->s_fshift; |
390 | 392 | ||
@@ -424,6 +426,20 @@ static int ufs_alloc_lastblock(struct inode *inode) | |||
424 | set_page_dirty(lastpage); | 426 | set_page_dirty(lastpage); |
425 | } | 427 | } |
426 | 428 | ||
429 | if (lastfrag >= UFS_IND_FRAGMENT) { | ||
430 | end = uspi->s_fpb - ufs_fragnum(lastfrag) - 1; | ||
431 | phys64 = bh->b_blocknr + 1; | ||
432 | for (i = 0; i < end; ++i) { | ||
433 | bh = sb_getblk(sb, i + phys64); | ||
434 | lock_buffer(bh); | ||
435 | memset(bh->b_data, 0, sb->s_blocksize); | ||
436 | set_buffer_uptodate(bh); | ||
437 | mark_buffer_dirty(bh); | ||
438 | unlock_buffer(bh); | ||
439 | sync_dirty_buffer(bh); | ||
440 | brelse(bh); | ||
441 | } | ||
442 | } | ||
427 | out_unlock: | 443 | out_unlock: |
428 | ufs_put_locked_page(lastpage); | 444 | ufs_put_locked_page(lastpage); |
429 | out: | 445 | out: |
diff --git a/include/asm-arm/arch-at91/gpio.h b/include/asm-arm/arch-at91/gpio.h index 98ad2114f43a..0a241e2fb672 100644 --- a/include/asm-arm/arch-at91/gpio.h +++ b/include/asm-arm/arch-at91/gpio.h | |||
@@ -223,7 +223,7 @@ static inline void gpio_free(unsigned gpio) | |||
223 | } | 223 | } |
224 | 224 | ||
225 | extern int gpio_direction_input(unsigned gpio); | 225 | extern int gpio_direction_input(unsigned gpio); |
226 | extern int gpio_direction_output(unsigned gpio); | 226 | extern int gpio_direction_output(unsigned gpio, int value); |
227 | 227 | ||
228 | static inline int gpio_get_value(unsigned gpio) | 228 | static inline int gpio_get_value(unsigned gpio) |
229 | { | 229 | { |
diff --git a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h index 9444958bec1e..ed35e5c94f40 100644 --- a/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h +++ b/include/asm-arm/arch-ixp4xx/ixp4xx-regs.h | |||
@@ -144,9 +144,9 @@ | |||
144 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) | 144 | #define IXP4XX_INTC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x3000) |
145 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) | 145 | #define IXP4XX_GPIO_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x4000) |
146 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) | 146 | #define IXP4XX_TIMER_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x5000) |
147 | #define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x6000) | 147 | #define IXP4XX_NPEA_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x6000) |
148 | #define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x7000) | 148 | #define IXP4XX_NPEB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x7000) |
149 | #define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_PHYS + 0x8000) | 149 | #define IXP4XX_NPEC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x8000) |
150 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) | 150 | #define IXP4XX_EthB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0x9000) |
151 | #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) | 151 | #define IXP4XX_EthC_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xA000) |
152 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) | 152 | #define IXP4XX_USB_BASE_VIRT (IXP4XX_PERIPHERAL_BASE_VIRT + 0xB000) |
diff --git a/include/asm-arm/arch-lh7a40x/entry-macro.S b/include/asm-arm/arch-lh7a40x/entry-macro.S index 502700604e00..ffe397250f0c 100644 --- a/include/asm-arm/arch-lh7a40x/entry-macro.S +++ b/include/asm-arm/arch-lh7a40x/entry-macro.S | |||
@@ -86,6 +86,12 @@ branch_irq_lh7a400: b 1000f | |||
86 | .macro disable_fiq | 86 | .macro disable_fiq |
87 | .endm | 87 | .endm |
88 | 88 | ||
89 | .macro get_irqnr_preamble, base, tmp | ||
90 | .endm | ||
91 | |||
92 | .macro arch_ret_to_user, tmp1, tmp2 | ||
93 | .endm | ||
94 | |||
89 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 95 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
90 | mov \irqnr, #0 | 96 | mov \irqnr, #0 |
91 | mov \base, #io_p2v(0x80000000) @ APB registers | 97 | mov \base, #io_p2v(0x80000000) @ APB registers |
@@ -105,6 +111,12 @@ branch_irq_lh7a400: b 1000f | |||
105 | .macro disable_fiq | 111 | .macro disable_fiq |
106 | .endm | 112 | .endm |
107 | 113 | ||
114 | .macro get_irqnr_preamble, base, tmp | ||
115 | .endm | ||
116 | |||
117 | .macro arch_ret_to_user, tmp1, tmp2 | ||
118 | .endm | ||
119 | |||
108 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp | 120 | .macro get_irqnr_and_base, irqnr, irqstat, base, tmp |
109 | mov \irqnr, #0 @ VIC1 irq base | 121 | mov \irqnr, #0 @ VIC1 irq base |
110 | mov \base, #io_p2v(0x80000000) @ APB registers | 122 | mov \base, #io_p2v(0x80000000) @ APB registers |
diff --git a/include/asm-arm/arch-omap/gpio.h b/include/asm-arm/arch-omap/gpio.h index 3762a6ae6a7f..590917efc94a 100644 --- a/include/asm-arm/arch-omap/gpio.h +++ b/include/asm-arm/arch-omap/gpio.h | |||
@@ -113,8 +113,9 @@ static inline int gpio_direction_input(unsigned gpio) | |||
113 | return __gpio_set_direction(gpio, 1); | 113 | return __gpio_set_direction(gpio, 1); |
114 | } | 114 | } |
115 | 115 | ||
116 | static inline int gpio_direction_output(unsigned gpio) | 116 | static inline int gpio_direction_output(unsigned gpio, int value) |
117 | { | 117 | { |
118 | omap_set_gpio_dataout(gpio, value); | ||
118 | return __gpio_set_direction(gpio, 0); | 119 | return __gpio_set_direction(gpio, 0); |
119 | } | 120 | } |
120 | 121 | ||
diff --git a/include/asm-arm/arch-pxa/gpio.h b/include/asm-arm/arch-pxa/gpio.h index 3d348a351157..aeba24347f8e 100644 --- a/include/asm-arm/arch-pxa/gpio.h +++ b/include/asm-arm/arch-pxa/gpio.h | |||
@@ -43,9 +43,9 @@ static inline int gpio_direction_input(unsigned gpio) | |||
43 | return pxa_gpio_mode(gpio | GPIO_IN); | 43 | return pxa_gpio_mode(gpio | GPIO_IN); |
44 | } | 44 | } |
45 | 45 | ||
46 | static inline int gpio_direction_output(unsigned gpio) | 46 | static inline int gpio_direction_output(unsigned gpio, int value) |
47 | { | 47 | { |
48 | return pxa_gpio_mode(gpio | GPIO_OUT); | 48 | return pxa_gpio_mode(gpio | GPIO_OUT | (value ? 0 : GPIO_DFLT_LOW)); |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int __gpio_get_value(unsigned gpio) | 51 | static inline int __gpio_get_value(unsigned gpio) |
diff --git a/include/asm-arm/arch-s3c2410/gpio.h b/include/asm-arm/arch-s3c2410/gpio.h index d47ae453f8ca..7583895fd336 100644 --- a/include/asm-arm/arch-s3c2410/gpio.h +++ b/include/asm-arm/arch-s3c2410/gpio.h | |||
@@ -44,9 +44,11 @@ static inline int gpio_direction_input(unsigned gpio) | |||
44 | return 0; | 44 | return 0; |
45 | } | 45 | } |
46 | 46 | ||
47 | static inline int gpio_direction_output(unsigned gpio) | 47 | static inline int gpio_direction_output(unsigned gpio, int value) |
48 | { | 48 | { |
49 | s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT); | 49 | s3c2410_gpio_cfgpin(gpio, S3C2410_GPIO_OUTPUT); |
50 | /* REVISIT can we write the value first, to avoid glitching? */ | ||
51 | s3c2410_gpio_setpin(gpio, value); | ||
50 | return 0; | 52 | return 0; |
51 | } | 53 | } |
52 | 54 | ||
diff --git a/include/asm-arm/arch-sa1100/gpio.h b/include/asm-arm/arch-sa1100/gpio.h index da7575b0e5d0..e7a9d26e22a8 100644 --- a/include/asm-arm/arch-sa1100/gpio.h +++ b/include/asm-arm/arch-sa1100/gpio.h | |||
@@ -38,7 +38,7 @@ static inline void gpio_free(unsigned gpio) | |||
38 | } | 38 | } |
39 | 39 | ||
40 | extern int gpio_direction_input(unsigned gpio); | 40 | extern int gpio_direction_input(unsigned gpio); |
41 | extern int gpio_direction_output(unsigned gpio); | 41 | extern int gpio_direction_output(unsigned gpio, int value); |
42 | 42 | ||
43 | 43 | ||
44 | static inline int gpio_get_value(unsigned gpio) | 44 | static inline int gpio_get_value(unsigned gpio) |
diff --git a/include/asm-arm/atomic.h b/include/asm-arm/atomic.h index ea88aa6bfc78..f266c2795124 100644 --- a/include/asm-arm/atomic.h +++ b/include/asm-arm/atomic.h | |||
@@ -103,9 +103,9 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) | |||
103 | unsigned long tmp, tmp2; | 103 | unsigned long tmp, tmp2; |
104 | 104 | ||
105 | __asm__ __volatile__("@ atomic_clear_mask\n" | 105 | __asm__ __volatile__("@ atomic_clear_mask\n" |
106 | "1: ldrex %0, %2\n" | 106 | "1: ldrex %0, [%2]\n" |
107 | " bic %0, %0, %3\n" | 107 | " bic %0, %0, %3\n" |
108 | " strex %1, %0, %2\n" | 108 | " strex %1, %0, [%2]\n" |
109 | " teq %1, #0\n" | 109 | " teq %1, #0\n" |
110 | " bne 1b" | 110 | " bne 1b" |
111 | : "=&r" (tmp), "=&r" (tmp2) | 111 | : "=&r" (tmp), "=&r" (tmp2) |
diff --git a/include/asm-avr32/arch-at32ap/gpio.h b/include/asm-avr32/arch-at32ap/gpio.h index fcb756bdaa8e..80a21aa9ae77 100644 --- a/include/asm-avr32/arch-at32ap/gpio.h +++ b/include/asm-avr32/arch-at32ap/gpio.h | |||
@@ -10,7 +10,7 @@ int __must_check gpio_request(unsigned int gpio, const char *label); | |||
10 | void gpio_free(unsigned int gpio); | 10 | void gpio_free(unsigned int gpio); |
11 | 11 | ||
12 | int gpio_direction_input(unsigned int gpio); | 12 | int gpio_direction_input(unsigned int gpio); |
13 | int gpio_direction_output(unsigned int gpio); | 13 | int gpio_direction_output(unsigned int gpio, int value); |
14 | int gpio_get_value(unsigned int gpio); | 14 | int gpio_get_value(unsigned int gpio); |
15 | void gpio_set_value(unsigned int gpio, int value); | 15 | void gpio_set_value(unsigned int gpio, int value); |
16 | 16 | ||
diff --git a/include/asm-i386/nmi.h b/include/asm-i386/nmi.h index 64544cb85d6a..b04333ea6f31 100644 --- a/include/asm-i386/nmi.h +++ b/include/asm-i386/nmi.h | |||
@@ -33,7 +33,7 @@ extern int nmi_watchdog_tick (struct pt_regs * regs, unsigned reason); | |||
33 | 33 | ||
34 | extern atomic_t nmi_active; | 34 | extern atomic_t nmi_active; |
35 | extern unsigned int nmi_watchdog; | 35 | extern unsigned int nmi_watchdog; |
36 | #define NMI_DEFAULT 0 | 36 | #define NMI_DEFAULT -1 |
37 | #define NMI_NONE 0 | 37 | #define NMI_NONE 0 |
38 | #define NMI_IO_APIC 1 | 38 | #define NMI_IO_APIC 1 |
39 | #define NMI_LOCAL_APIC 2 | 39 | #define NMI_LOCAL_APIC 2 |
diff --git a/include/asm-i386/paravirt.h b/include/asm-i386/paravirt.h index f8319cae2ac5..46dc34ca887a 100644 --- a/include/asm-i386/paravirt.h +++ b/include/asm-i386/paravirt.h | |||
@@ -130,7 +130,7 @@ struct paravirt_ops | |||
130 | void (*flush_tlb_kernel)(void); | 130 | void (*flush_tlb_kernel)(void); |
131 | void (*flush_tlb_single)(u32 addr); | 131 | void (*flush_tlb_single)(u32 addr); |
132 | 132 | ||
133 | void (fastcall *map_pt_hook)(int type, pte_t *va, u32 pfn); | 133 | void (*map_pt_hook)(int type, pte_t *va, u32 pfn); |
134 | 134 | ||
135 | void (*alloc_pt)(u32 pfn); | 135 | void (*alloc_pt)(u32 pfn); |
136 | void (*alloc_pd)(u32 pfn); | 136 | void (*alloc_pd)(u32 pfn); |
diff --git a/include/asm-i386/sync_bitops.h b/include/asm-i386/sync_bitops.h index c94d51c993ee..7d72351bea75 100644 --- a/include/asm-i386/sync_bitops.h +++ b/include/asm-i386/sync_bitops.h | |||
@@ -130,7 +130,7 @@ static inline int sync_test_and_change_bit(int nr, volatile unsigned long* addr) | |||
130 | return oldbit; | 130 | return oldbit; |
131 | } | 131 | } |
132 | 132 | ||
133 | static __always_inline int sync_const_test_bit(int nr, const volatile unsigned long *addr) | 133 | static __always_inline int sync_constant_test_bit(int nr, const volatile unsigned long *addr) |
134 | { | 134 | { |
135 | return ((1UL << (nr & 31)) & | 135 | return ((1UL << (nr & 31)) & |
136 | (((const volatile unsigned int *)addr)[nr >> 5])) != 0; | 136 | (((const volatile unsigned int *)addr)[nr >> 5])) != 0; |
diff --git a/include/asm-i386/vmi_time.h b/include/asm-i386/vmi_time.h index 94d0a12a4114..c3a1fcf66c96 100644 --- a/include/asm-i386/vmi_time.h +++ b/include/asm-i386/vmi_time.h | |||
@@ -54,7 +54,7 @@ extern unsigned long vmi_cpu_khz(void); | |||
54 | 54 | ||
55 | #ifdef CONFIG_X86_LOCAL_APIC | 55 | #ifdef CONFIG_X86_LOCAL_APIC |
56 | extern void __init vmi_timer_setup_boot_alarm(void); | 56 | extern void __init vmi_timer_setup_boot_alarm(void); |
57 | extern void __init vmi_timer_setup_secondary_alarm(void); | 57 | extern void __devinit vmi_timer_setup_secondary_alarm(void); |
58 | extern void apic_vmi_timer_interrupt(void); | 58 | extern void apic_vmi_timer_interrupt(void); |
59 | #endif | 59 | #endif |
60 | 60 | ||
diff --git a/include/asm-ia64/machvec.h b/include/asm-ia64/machvec.h index 3c96ac19154e..ca33eb181ff2 100644 --- a/include/asm-ia64/machvec.h +++ b/include/asm-ia64/machvec.h | |||
@@ -168,6 +168,7 @@ extern void machvec_tlb_migrate_finish (struct mm_struct *); | |||
168 | # define platform_setup_msi_irq ia64_mv.setup_msi_irq | 168 | # define platform_setup_msi_irq ia64_mv.setup_msi_irq |
169 | # define platform_teardown_msi_irq ia64_mv.teardown_msi_irq | 169 | # define platform_teardown_msi_irq ia64_mv.teardown_msi_irq |
170 | # define platform_pci_fixup_bus ia64_mv.pci_fixup_bus | 170 | # define platform_pci_fixup_bus ia64_mv.pci_fixup_bus |
171 | # define platform_kernel_launch_event ia64_mv.kernel_launch_event | ||
171 | # endif | 172 | # endif |
172 | 173 | ||
173 | /* __attribute__((__aligned__(16))) is required to make size of the | 174 | /* __attribute__((__aligned__(16))) is required to make size of the |
@@ -269,6 +270,7 @@ struct ia64_machine_vector { | |||
269 | platform_setup_msi_irq, \ | 270 | platform_setup_msi_irq, \ |
270 | platform_teardown_msi_irq, \ | 271 | platform_teardown_msi_irq, \ |
271 | platform_pci_fixup_bus, \ | 272 | platform_pci_fixup_bus, \ |
273 | platform_kernel_launch_event \ | ||
272 | } | 274 | } |
273 | 275 | ||
274 | extern struct ia64_machine_vector ia64_mv; | 276 | extern struct ia64_machine_vector ia64_mv; |
diff --git a/include/asm-m32r/dma-mapping.h b/include/asm-m32r/dma-mapping.h index a7fa0302bda7..f9b58ebba361 100644 --- a/include/asm-m32r/dma-mapping.h +++ b/include/asm-m32r/dma-mapping.h | |||
@@ -1,23 +1,6 @@ | |||
1 | #ifndef _ASM_M32R_DMA_MAPPING_H | 1 | #ifndef _ASM_M32R_DMA_MAPPING_H |
2 | #define _ASM_M32R_DMA_MAPPING_H | 2 | #define _ASM_M32R_DMA_MAPPING_H |
3 | 3 | ||
4 | /* | 4 | #include <asm-generic/dma-mapping-broken.h> |
5 | * NOTE: Do not include <asm-generic/dma-mapping.h> | ||
6 | * Because it requires PCI stuffs, but current M32R don't provide these. | ||
7 | */ | ||
8 | |||
9 | static inline void * | ||
10 | dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, | ||
11 | gfp_t flag) | ||
12 | { | ||
13 | return (void *)NULL; | ||
14 | } | ||
15 | |||
16 | static inline void | ||
17 | dma_free_coherent(struct device *dev, size_t size, void *cpu_addr, | ||
18 | dma_addr_t dma_handle) | ||
19 | { | ||
20 | return; | ||
21 | } | ||
22 | 5 | ||
23 | #endif /* _ASM_M32R_DMA_MAPPING_H */ | 6 | #endif /* _ASM_M32R_DMA_MAPPING_H */ |
diff --git a/include/asm-m68k/dma-mapping.h b/include/asm-m68k/dma-mapping.h index 00259ed6fc95..a26cdeb46a57 100644 --- a/include/asm-m68k/dma-mapping.h +++ b/include/asm-m68k/dma-mapping.h | |||
@@ -32,7 +32,7 @@ extern void dma_free_coherent(struct device *, size_t, | |||
32 | void *, dma_addr_t); | 32 | void *, dma_addr_t); |
33 | 33 | ||
34 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, | 34 | static inline void *dma_alloc_noncoherent(struct device *dev, size_t size, |
35 | dma_addr_t *handle, int flag) | 35 | dma_addr_t *handle, gfp_t flag) |
36 | { | 36 | { |
37 | return dma_alloc_coherent(dev, size, handle, flag); | 37 | return dma_alloc_coherent(dev, size, handle, flag); |
38 | } | 38 | } |
diff --git a/include/asm-m68k/mc146818rtc.h b/include/asm-m68k/mc146818rtc.h index 11fe12ddb913..9f70a01f73dc 100644 --- a/include/asm-m68k/mc146818rtc.h +++ b/include/asm-m68k/mc146818rtc.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <asm/atarihw.h> | 11 | #include <asm/atarihw.h> |
12 | 12 | ||
13 | #define RTC_PORT(x) (TT_RTC_BAS + 2*(x)) | 13 | #define RTC_PORT(x) (TT_RTC_BAS + 2*(x)) |
14 | #define RTC_ALWAYS_BCD 0 | ||
14 | 15 | ||
15 | #define CMOS_READ(addr) ({ \ | 16 | #define CMOS_READ(addr) ({ \ |
16 | atari_outb_p((addr),RTC_PORT(0)); \ | 17 | atari_outb_p((addr),RTC_PORT(0)); \ |
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h index 8578869a8bcf..1ac50b6c47ad 100644 --- a/include/asm-mips/atomic.h +++ b/include/asm-mips/atomic.h | |||
@@ -79,9 +79,9 @@ static __inline__ void atomic_add(int i, atomic_t * v) | |||
79 | } else { | 79 | } else { |
80 | unsigned long flags; | 80 | unsigned long flags; |
81 | 81 | ||
82 | local_irq_save(flags); | 82 | raw_local_irq_save(flags); |
83 | v->counter += i; | 83 | v->counter += i; |
84 | local_irq_restore(flags); | 84 | raw_local_irq_restore(flags); |
85 | } | 85 | } |
86 | } | 86 | } |
87 | 87 | ||
@@ -124,9 +124,9 @@ static __inline__ void atomic_sub(int i, atomic_t * v) | |||
124 | } else { | 124 | } else { |
125 | unsigned long flags; | 125 | unsigned long flags; |
126 | 126 | ||
127 | local_irq_save(flags); | 127 | raw_local_irq_save(flags); |
128 | v->counter -= i; | 128 | v->counter -= i; |
129 | local_irq_restore(flags); | 129 | raw_local_irq_restore(flags); |
130 | } | 130 | } |
131 | } | 131 | } |
132 | 132 | ||
@@ -173,11 +173,11 @@ static __inline__ int atomic_add_return(int i, atomic_t * v) | |||
173 | } else { | 173 | } else { |
174 | unsigned long flags; | 174 | unsigned long flags; |
175 | 175 | ||
176 | local_irq_save(flags); | 176 | raw_local_irq_save(flags); |
177 | result = v->counter; | 177 | result = v->counter; |
178 | result += i; | 178 | result += i; |
179 | v->counter = result; | 179 | v->counter = result; |
180 | local_irq_restore(flags); | 180 | raw_local_irq_restore(flags); |
181 | } | 181 | } |
182 | 182 | ||
183 | smp_mb(); | 183 | smp_mb(); |
@@ -225,11 +225,11 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v) | |||
225 | } else { | 225 | } else { |
226 | unsigned long flags; | 226 | unsigned long flags; |
227 | 227 | ||
228 | local_irq_save(flags); | 228 | raw_local_irq_save(flags); |
229 | result = v->counter; | 229 | result = v->counter; |
230 | result -= i; | 230 | result -= i; |
231 | v->counter = result; | 231 | v->counter = result; |
232 | local_irq_restore(flags); | 232 | raw_local_irq_restore(flags); |
233 | } | 233 | } |
234 | 234 | ||
235 | smp_mb(); | 235 | smp_mb(); |
@@ -293,12 +293,12 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v) | |||
293 | } else { | 293 | } else { |
294 | unsigned long flags; | 294 | unsigned long flags; |
295 | 295 | ||
296 | local_irq_save(flags); | 296 | raw_local_irq_save(flags); |
297 | result = v->counter; | 297 | result = v->counter; |
298 | result -= i; | 298 | result -= i; |
299 | if (result >= 0) | 299 | if (result >= 0) |
300 | v->counter = result; | 300 | v->counter = result; |
301 | local_irq_restore(flags); | 301 | raw_local_irq_restore(flags); |
302 | } | 302 | } |
303 | 303 | ||
304 | smp_mb(); | 304 | smp_mb(); |
@@ -454,9 +454,9 @@ static __inline__ void atomic64_add(long i, atomic64_t * v) | |||
454 | } else { | 454 | } else { |
455 | unsigned long flags; | 455 | unsigned long flags; |
456 | 456 | ||
457 | local_irq_save(flags); | 457 | raw_local_irq_save(flags); |
458 | v->counter += i; | 458 | v->counter += i; |
459 | local_irq_restore(flags); | 459 | raw_local_irq_restore(flags); |
460 | } | 460 | } |
461 | } | 461 | } |
462 | 462 | ||
@@ -499,9 +499,9 @@ static __inline__ void atomic64_sub(long i, atomic64_t * v) | |||
499 | } else { | 499 | } else { |
500 | unsigned long flags; | 500 | unsigned long flags; |
501 | 501 | ||
502 | local_irq_save(flags); | 502 | raw_local_irq_save(flags); |
503 | v->counter -= i; | 503 | v->counter -= i; |
504 | local_irq_restore(flags); | 504 | raw_local_irq_restore(flags); |
505 | } | 505 | } |
506 | } | 506 | } |
507 | 507 | ||
@@ -548,11 +548,11 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v) | |||
548 | } else { | 548 | } else { |
549 | unsigned long flags; | 549 | unsigned long flags; |
550 | 550 | ||
551 | local_irq_save(flags); | 551 | raw_local_irq_save(flags); |
552 | result = v->counter; | 552 | result = v->counter; |
553 | result += i; | 553 | result += i; |
554 | v->counter = result; | 554 | v->counter = result; |
555 | local_irq_restore(flags); | 555 | raw_local_irq_restore(flags); |
556 | } | 556 | } |
557 | 557 | ||
558 | smp_mb(); | 558 | smp_mb(); |
@@ -600,11 +600,11 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v) | |||
600 | } else { | 600 | } else { |
601 | unsigned long flags; | 601 | unsigned long flags; |
602 | 602 | ||
603 | local_irq_save(flags); | 603 | raw_local_irq_save(flags); |
604 | result = v->counter; | 604 | result = v->counter; |
605 | result -= i; | 605 | result -= i; |
606 | v->counter = result; | 606 | v->counter = result; |
607 | local_irq_restore(flags); | 607 | raw_local_irq_restore(flags); |
608 | } | 608 | } |
609 | 609 | ||
610 | smp_mb(); | 610 | smp_mb(); |
@@ -668,12 +668,12 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v) | |||
668 | } else { | 668 | } else { |
669 | unsigned long flags; | 669 | unsigned long flags; |
670 | 670 | ||
671 | local_irq_save(flags); | 671 | raw_local_irq_save(flags); |
672 | result = v->counter; | 672 | result = v->counter; |
673 | result -= i; | 673 | result -= i; |
674 | if (result >= 0) | 674 | if (result >= 0) |
675 | v->counter = result; | 675 | v->counter = result; |
676 | local_irq_restore(flags); | 676 | raw_local_irq_restore(flags); |
677 | } | 677 | } |
678 | 678 | ||
679 | smp_mb(); | 679 | smp_mb(); |
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h index 8959da245cfb..d995413e11fd 100644 --- a/include/asm-mips/bitops.h +++ b/include/asm-mips/bitops.h | |||
@@ -100,9 +100,9 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) | |||
100 | 100 | ||
101 | a += nr >> SZLONG_LOG; | 101 | a += nr >> SZLONG_LOG; |
102 | mask = 1UL << bit; | 102 | mask = 1UL << bit; |
103 | local_irq_save(flags); | 103 | raw_local_irq_save(flags); |
104 | *a |= mask; | 104 | *a |= mask; |
105 | local_irq_restore(flags); | 105 | raw_local_irq_restore(flags); |
106 | } | 106 | } |
107 | } | 107 | } |
108 | 108 | ||
@@ -165,9 +165,9 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) | |||
165 | 165 | ||
166 | a += nr >> SZLONG_LOG; | 166 | a += nr >> SZLONG_LOG; |
167 | mask = 1UL << bit; | 167 | mask = 1UL << bit; |
168 | local_irq_save(flags); | 168 | raw_local_irq_save(flags); |
169 | *a &= ~mask; | 169 | *a &= ~mask; |
170 | local_irq_restore(flags); | 170 | raw_local_irq_restore(flags); |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
@@ -220,9 +220,9 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr) | |||
220 | 220 | ||
221 | a += nr >> SZLONG_LOG; | 221 | a += nr >> SZLONG_LOG; |
222 | mask = 1UL << bit; | 222 | mask = 1UL << bit; |
223 | local_irq_save(flags); | 223 | raw_local_irq_save(flags); |
224 | *a ^= mask; | 224 | *a ^= mask; |
225 | local_irq_restore(flags); | 225 | raw_local_irq_restore(flags); |
226 | } | 226 | } |
227 | } | 227 | } |
228 | 228 | ||
@@ -287,10 +287,10 @@ static inline int test_and_set_bit(unsigned long nr, | |||
287 | 287 | ||
288 | a += nr >> SZLONG_LOG; | 288 | a += nr >> SZLONG_LOG; |
289 | mask = 1UL << bit; | 289 | mask = 1UL << bit; |
290 | local_irq_save(flags); | 290 | raw_local_irq_save(flags); |
291 | retval = (mask & *a) != 0; | 291 | retval = (mask & *a) != 0; |
292 | *a |= mask; | 292 | *a |= mask; |
293 | local_irq_restore(flags); | 293 | raw_local_irq_restore(flags); |
294 | 294 | ||
295 | return retval; | 295 | return retval; |
296 | } | 296 | } |
@@ -381,10 +381,10 @@ static inline int test_and_clear_bit(unsigned long nr, | |||
381 | 381 | ||
382 | a += nr >> SZLONG_LOG; | 382 | a += nr >> SZLONG_LOG; |
383 | mask = 1UL << bit; | 383 | mask = 1UL << bit; |
384 | local_irq_save(flags); | 384 | raw_local_irq_save(flags); |
385 | retval = (mask & *a) != 0; | 385 | retval = (mask & *a) != 0; |
386 | *a &= ~mask; | 386 | *a &= ~mask; |
387 | local_irq_restore(flags); | 387 | raw_local_irq_restore(flags); |
388 | 388 | ||
389 | return retval; | 389 | return retval; |
390 | } | 390 | } |
@@ -452,10 +452,10 @@ static inline int test_and_change_bit(unsigned long nr, | |||
452 | 452 | ||
453 | a += nr >> SZLONG_LOG; | 453 | a += nr >> SZLONG_LOG; |
454 | mask = 1UL << bit; | 454 | mask = 1UL << bit; |
455 | local_irq_save(flags); | 455 | raw_local_irq_save(flags); |
456 | retval = (mask & *a) != 0; | 456 | retval = (mask & *a) != 0; |
457 | *a ^= mask; | 457 | *a ^= mask; |
458 | local_irq_restore(flags); | 458 | raw_local_irq_restore(flags); |
459 | 459 | ||
460 | return retval; | 460 | return retval; |
461 | } | 461 | } |
diff --git a/include/asm-mips/cpu-features.h b/include/asm-mips/cpu-features.h index eadca266f159..5e4bed123b48 100644 --- a/include/asm-mips/cpu-features.h +++ b/include/asm-mips/cpu-features.h | |||
@@ -40,6 +40,9 @@ | |||
40 | #endif | 40 | #endif |
41 | #ifndef cpu_has_fpu | 41 | #ifndef cpu_has_fpu |
42 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) | 42 | #define cpu_has_fpu (current_cpu_data.options & MIPS_CPU_FPU) |
43 | #define raw_cpu_has_fpu (raw_current_cpu_data.options & MIPS_CPU_FPU) | ||
44 | #else | ||
45 | #define raw_cpu_has_fpu cpu_has_fpu | ||
43 | #endif | 46 | #endif |
44 | #ifndef cpu_has_32fpr | 47 | #ifndef cpu_has_32fpr |
45 | #define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) | 48 | #define cpu_has_32fpr (cpu_data[0].options & MIPS_CPU_32FPR) |
diff --git a/include/asm-mips/cpu-info.h b/include/asm-mips/cpu-info.h index 610d0cdeaa9e..22fe8453fcc7 100644 --- a/include/asm-mips/cpu-info.h +++ b/include/asm-mips/cpu-info.h | |||
@@ -87,6 +87,7 @@ struct cpuinfo_mips { | |||
87 | 87 | ||
88 | extern struct cpuinfo_mips cpu_data[]; | 88 | extern struct cpuinfo_mips cpu_data[]; |
89 | #define current_cpu_data cpu_data[smp_processor_id()] | 89 | #define current_cpu_data cpu_data[smp_processor_id()] |
90 | #define raw_current_cpu_data cpu_data[raw_smp_processor_id()] | ||
90 | 91 | ||
91 | extern void cpu_probe(void); | 92 | extern void cpu_probe(void); |
92 | extern void cpu_report(void); | 93 | extern void cpu_report(void); |
diff --git a/include/asm-mips/fpu.h b/include/asm-mips/fpu.h index efef843b93f0..4e12d1f9534f 100644 --- a/include/asm-mips/fpu.h +++ b/include/asm-mips/fpu.h | |||
@@ -27,11 +27,11 @@ | |||
27 | struct sigcontext; | 27 | struct sigcontext; |
28 | struct sigcontext32; | 28 | struct sigcontext32; |
29 | 29 | ||
30 | extern asmlinkage int (*save_fp_context)(struct sigcontext *sc); | 30 | extern asmlinkage int (*save_fp_context)(struct sigcontext __user *sc); |
31 | extern asmlinkage int (*restore_fp_context)(struct sigcontext *sc); | 31 | extern asmlinkage int (*restore_fp_context)(struct sigcontext __user *sc); |
32 | 32 | ||
33 | extern asmlinkage int (*save_fp_context32)(struct sigcontext32 *sc); | 33 | extern asmlinkage int (*save_fp_context32)(struct sigcontext32 __user *sc); |
34 | extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 *sc); | 34 | extern asmlinkage int (*restore_fp_context32)(struct sigcontext32 __user *sc); |
35 | 35 | ||
36 | extern void fpu_emulator_init_fpu(void); | 36 | extern void fpu_emulator_init_fpu(void); |
37 | extern void _init_fpu(void); | 37 | extern void _init_fpu(void); |
@@ -68,6 +68,8 @@ do { \ | |||
68 | /* We don't care about the c0 hazard here */ \ | 68 | /* We don't care about the c0 hazard here */ \ |
69 | } while (0) | 69 | } while (0) |
70 | 70 | ||
71 | #define __fpu_enabled() (read_c0_status() & ST0_CU1) | ||
72 | |||
71 | #define enable_fpu() \ | 73 | #define enable_fpu() \ |
72 | do { \ | 74 | do { \ |
73 | if (cpu_has_fpu) \ | 75 | if (cpu_has_fpu) \ |
@@ -93,31 +95,47 @@ static inline int is_fpu_owner(void) | |||
93 | return cpu_has_fpu && __is_fpu_owner(); | 95 | return cpu_has_fpu && __is_fpu_owner(); |
94 | } | 96 | } |
95 | 97 | ||
96 | static inline void own_fpu(void) | 98 | static inline void __own_fpu(void) |
97 | { | 99 | { |
98 | if (cpu_has_fpu) { | 100 | __enable_fpu(); |
99 | __enable_fpu(); | 101 | KSTK_STATUS(current) |= ST0_CU1; |
100 | KSTK_STATUS(current) |= ST0_CU1; | 102 | set_thread_flag(TIF_USEDFPU); |
101 | set_thread_flag(TIF_USEDFPU); | 103 | } |
104 | |||
105 | static inline void own_fpu(int restore) | ||
106 | { | ||
107 | preempt_disable(); | ||
108 | if (cpu_has_fpu && !__is_fpu_owner()) { | ||
109 | __own_fpu(); | ||
110 | if (restore) | ||
111 | _restore_fp(current); | ||
102 | } | 112 | } |
113 | preempt_enable(); | ||
103 | } | 114 | } |
104 | 115 | ||
105 | static inline void lose_fpu(void) | 116 | static inline void lose_fpu(int save) |
106 | { | 117 | { |
107 | if (cpu_has_fpu) { | 118 | preempt_disable(); |
119 | if (is_fpu_owner()) { | ||
120 | if (save) | ||
121 | _save_fp(current); | ||
108 | KSTK_STATUS(current) &= ~ST0_CU1; | 122 | KSTK_STATUS(current) &= ~ST0_CU1; |
109 | clear_thread_flag(TIF_USEDFPU); | 123 | clear_thread_flag(TIF_USEDFPU); |
110 | __disable_fpu(); | 124 | __disable_fpu(); |
111 | } | 125 | } |
126 | preempt_enable(); | ||
112 | } | 127 | } |
113 | 128 | ||
114 | static inline void init_fpu(void) | 129 | static inline void init_fpu(void) |
115 | { | 130 | { |
131 | preempt_disable(); | ||
116 | if (cpu_has_fpu) { | 132 | if (cpu_has_fpu) { |
133 | __own_fpu(); | ||
117 | _init_fpu(); | 134 | _init_fpu(); |
118 | } else { | 135 | } else { |
119 | fpu_emulator_init_fpu(); | 136 | fpu_emulator_init_fpu(); |
120 | } | 137 | } |
138 | preempt_enable(); | ||
121 | } | 139 | } |
122 | 140 | ||
123 | static inline void save_fp(struct task_struct *tsk) | 141 | static inline void save_fp(struct task_struct *tsk) |
@@ -144,4 +162,18 @@ static inline fpureg_t *get_fpu_regs(struct task_struct *tsk) | |||
144 | return tsk->thread.fpu.fpr; | 162 | return tsk->thread.fpu.fpr; |
145 | } | 163 | } |
146 | 164 | ||
165 | static inline void enable_fp_in_kernel(void) | ||
166 | { | ||
167 | set_thread_flag(TIF_ALLOW_FP_IN_KERNEL); | ||
168 | /* make sure CU1 and FPU ownership are consistent */ | ||
169 | if (!__is_fpu_owner() && __fpu_enabled()) | ||
170 | __disable_fpu(); | ||
171 | } | ||
172 | |||
173 | static inline void disable_fp_in_kernel(void) | ||
174 | { | ||
175 | BUG_ON(!__is_fpu_owner() && __fpu_enabled()); | ||
176 | clear_thread_flag(TIF_ALLOW_FP_IN_KERNEL); | ||
177 | } | ||
178 | |||
147 | #endif /* _ASM_FPU_H */ | 179 | #endif /* _ASM_FPU_H */ |
diff --git a/include/asm-mips/mach-au1x00/au1xxx_ide.h b/include/asm-mips/mach-au1x00/au1xxx_ide.h index e9fa252f8a3f..8fcae21adbd5 100644 --- a/include/asm-mips/mach-au1x00/au1xxx_ide.h +++ b/include/asm-mips/mach-au1x00/au1xxx_ide.h | |||
@@ -141,40 +141,6 @@ static int auide_ddma_init( _auide_hwif *auide ); | |||
141 | static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif); | 141 | static void auide_setup_ports(hw_regs_t *hw, _auide_hwif *ahwif); |
142 | int __init auide_probe(void); | 142 | int __init auide_probe(void); |
143 | 143 | ||
144 | #ifdef CONFIG_PM | ||
145 | int au1200ide_pm_callback( au1xxx_power_dev_t *dev, | ||
146 | au1xxx_request_t request, void *data); | ||
147 | static int au1xxxide_pm_standby( au1xxx_power_dev_t *dev ); | ||
148 | static int au1xxxide_pm_sleep( au1xxx_power_dev_t *dev ); | ||
149 | static int au1xxxide_pm_resume( au1xxx_power_dev_t *dev ); | ||
150 | static int au1xxxide_pm_getstatus( au1xxx_power_dev_t *dev ); | ||
151 | static int au1xxxide_pm_access( au1xxx_power_dev_t *dev ); | ||
152 | static int au1xxxide_pm_idle( au1xxx_power_dev_t *dev ); | ||
153 | static int au1xxxide_pm_cleanup( au1xxx_power_dev_t *dev ); | ||
154 | #endif | ||
155 | |||
156 | |||
157 | /* | ||
158 | * Multi-Word DMA + DbDMA functions | ||
159 | */ | ||
160 | #ifdef CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA | ||
161 | static int auide_build_sglist(ide_drive_t *drive, struct request *rq); | ||
162 | static int auide_build_dmatable(ide_drive_t *drive); | ||
163 | static int auide_dma_end(ide_drive_t *drive); | ||
164 | ide_startstop_t auide_dma_intr (ide_drive_t *drive); | ||
165 | static void auide_dma_exec_cmd(ide_drive_t *drive, u8 command); | ||
166 | static int auide_dma_setup(ide_drive_t *drive); | ||
167 | static int auide_dma_check(ide_drive_t *drive); | ||
168 | static int auide_dma_test_irq(ide_drive_t *drive); | ||
169 | static int auide_dma_host_off(ide_drive_t *drive); | ||
170 | static int auide_dma_host_on(ide_drive_t *drive); | ||
171 | static int auide_dma_lostirq(ide_drive_t *drive); | ||
172 | static int auide_dma_on(ide_drive_t *drive); | ||
173 | static void auide_ddma_tx_callback(int irq, void *param); | ||
174 | static void auide_ddma_rx_callback(int irq, void *param); | ||
175 | static int auide_dma_off_quietly(ide_drive_t *drive); | ||
176 | #endif /* end CONFIG_BLK_DEV_IDE_AU1XXX_MDMA2_DBDMA */ | ||
177 | |||
178 | /******************************************************************************* | 144 | /******************************************************************************* |
179 | * PIO Mode timing calculation : * | 145 | * PIO Mode timing calculation : * |
180 | * * | 146 | * * |
diff --git a/include/asm-mips/mach-ip27/dma-coherence.h b/include/asm-mips/mach-ip27/dma-coherence.h index 659816e200d4..3fdbbf68e952 100644 --- a/include/asm-mips/mach-ip27/dma-coherence.h +++ b/include/asm-mips/mach-ip27/dma-coherence.h | |||
@@ -18,7 +18,8 @@ | |||
18 | 18 | ||
19 | struct device; | 19 | struct device; |
20 | 20 | ||
21 | static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) | 21 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, |
22 | size_t size) | ||
22 | { | 23 | { |
23 | dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr)); | 24 | dma_addr_t pa = dev_to_baddr(dev, virt_to_phys(addr)); |
24 | 25 | ||
@@ -37,7 +38,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
37 | return dma_addr & (0xffUL << 56); | 38 | return dma_addr & (0xffUL << 56); |
38 | } | 39 | } |
39 | 40 | ||
40 | static void plat_unmap_dma_mem(dma_addr_t dma_addr) | 41 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) |
41 | { | 42 | { |
42 | } | 43 | } |
43 | 44 | ||
diff --git a/include/asm-mips/mach-ip32/dma-coherence.h b/include/asm-mips/mach-ip32/dma-coherence.h index 950be17bbb86..c3f9a6a20eb0 100644 --- a/include/asm-mips/mach-ip32/dma-coherence.h +++ b/include/asm-mips/mach-ip32/dma-coherence.h | |||
@@ -26,7 +26,8 @@ struct device; | |||
26 | 26 | ||
27 | #define RAM_OFFSET_MASK 0x3fffffffUL | 27 | #define RAM_OFFSET_MASK 0x3fffffffUL |
28 | 28 | ||
29 | static dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, size_t size) | 29 | static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr, |
30 | size_t size) | ||
30 | { | 31 | { |
31 | dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK; | 32 | dma_addr_t pa = virt_to_phys(addr) & RAM_OFFSET_MASK; |
32 | 33 | ||
@@ -59,7 +60,7 @@ static unsigned long plat_dma_addr_to_phys(dma_addr_t dma_addr) | |||
59 | return addr; | 60 | return addr; |
60 | } | 61 | } |
61 | 62 | ||
62 | static void plat_unmap_dma_mem(dma_addr_t dma_addr) | 63 | static inline void plat_unmap_dma_mem(dma_addr_t dma_addr) |
63 | { | 64 | { |
64 | } | 65 | } |
65 | 66 | ||
diff --git a/include/asm-mips/rtlx.h b/include/asm-mips/rtlx.h index 59162f74a798..65778c890a62 100644 --- a/include/asm-mips/rtlx.h +++ b/include/asm-mips/rtlx.h | |||
@@ -23,8 +23,8 @@ | |||
23 | 23 | ||
24 | extern int rtlx_open(int index, int can_sleep); | 24 | extern int rtlx_open(int index, int can_sleep); |
25 | extern int rtlx_release(int index); | 25 | extern int rtlx_release(int index); |
26 | extern ssize_t rtlx_read(int index, void *buff, size_t count, int user); | 26 | extern ssize_t rtlx_read(int index, void __user *buff, size_t count); |
27 | extern ssize_t rtlx_write(int index, void *buffer, size_t count, int user); | 27 | extern ssize_t rtlx_write(int index, const void __user *buffer, size_t count); |
28 | extern unsigned int rtlx_read_poll(int index, int can_sleep); | 28 | extern unsigned int rtlx_read_poll(int index, int can_sleep); |
29 | extern unsigned int rtlx_write_poll(int index); | 29 | extern unsigned int rtlx_write_poll(int index); |
30 | 30 | ||
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h index 597a3743f6a1..290887077e44 100644 --- a/include/asm-mips/system.h +++ b/include/asm-mips/system.h | |||
@@ -121,10 +121,10 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val) | |||
121 | } else { | 121 | } else { |
122 | unsigned long flags; | 122 | unsigned long flags; |
123 | 123 | ||
124 | local_irq_save(flags); | 124 | raw_local_irq_save(flags); |
125 | retval = *m; | 125 | retval = *m; |
126 | *m = val; | 126 | *m = val; |
127 | local_irq_restore(flags); /* implies memory barrier */ | 127 | raw_local_irq_restore(flags); /* implies memory barrier */ |
128 | } | 128 | } |
129 | 129 | ||
130 | smp_mb(); | 130 | smp_mb(); |
@@ -169,10 +169,10 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val) | |||
169 | } else { | 169 | } else { |
170 | unsigned long flags; | 170 | unsigned long flags; |
171 | 171 | ||
172 | local_irq_save(flags); | 172 | raw_local_irq_save(flags); |
173 | retval = *m; | 173 | retval = *m; |
174 | *m = val; | 174 | *m = val; |
175 | local_irq_restore(flags); /* implies memory barrier */ | 175 | raw_local_irq_restore(flags); /* implies memory barrier */ |
176 | } | 176 | } |
177 | 177 | ||
178 | smp_mb(); | 178 | smp_mb(); |
@@ -250,11 +250,11 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old, | |||
250 | } else { | 250 | } else { |
251 | unsigned long flags; | 251 | unsigned long flags; |
252 | 252 | ||
253 | local_irq_save(flags); | 253 | raw_local_irq_save(flags); |
254 | retval = *m; | 254 | retval = *m; |
255 | if (retval == old) | 255 | if (retval == old) |
256 | *m = new; | 256 | *m = new; |
257 | local_irq_restore(flags); /* implies memory barrier */ | 257 | raw_local_irq_restore(flags); /* implies memory barrier */ |
258 | } | 258 | } |
259 | 259 | ||
260 | smp_mb(); | 260 | smp_mb(); |
@@ -304,11 +304,11 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old, | |||
304 | } else { | 304 | } else { |
305 | unsigned long flags; | 305 | unsigned long flags; |
306 | 306 | ||
307 | local_irq_save(flags); | 307 | raw_local_irq_save(flags); |
308 | retval = *m; | 308 | retval = *m; |
309 | if (retval == old) | 309 | if (retval == old) |
310 | *m = new; | 310 | *m = new; |
311 | local_irq_restore(flags); /* implies memory barrier */ | 311 | raw_local_irq_restore(flags); /* implies memory barrier */ |
312 | } | 312 | } |
313 | 313 | ||
314 | smp_mb(); | 314 | smp_mb(); |
diff --git a/include/asm-mips/thread_info.h b/include/asm-mips/thread_info.h index fbcda8204473..6cf05f4a4e7e 100644 --- a/include/asm-mips/thread_info.h +++ b/include/asm-mips/thread_info.h | |||
@@ -119,6 +119,7 @@ register struct thread_info *__current_thread_info __asm__("$28"); | |||
119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ | 119 | #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling TIF_NEED_RESCHED */ |
120 | #define TIF_MEMDIE 18 | 120 | #define TIF_MEMDIE 18 |
121 | #define TIF_FREEZE 19 | 121 | #define TIF_FREEZE 19 |
122 | #define TIF_ALLOW_FP_IN_KERNEL 20 | ||
122 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ | 123 | #define TIF_SYSCALL_TRACE 31 /* syscall trace active */ |
123 | 124 | ||
124 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) | 125 | #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) |
diff --git a/include/asm-powerpc/floppy.h b/include/asm-powerpc/floppy.h index a0f14eea1da5..afa700ded877 100644 --- a/include/asm-powerpc/floppy.h +++ b/include/asm-powerpc/floppy.h | |||
@@ -178,7 +178,7 @@ static struct fd_dma_ops virt_dma_ops = | |||
178 | ._dma_setup = vdma_dma_setup | 178 | ._dma_setup = vdma_dma_setup |
179 | }; | 179 | }; |
180 | 180 | ||
181 | static int fd_request_dma() | 181 | static int fd_request_dma(void) |
182 | { | 182 | { |
183 | if (can_use_virtual_dma & 1) { | 183 | if (can_use_virtual_dma & 1) { |
184 | fd_ops = &virt_dma_ops; | 184 | fd_ops = &virt_dma_ops; |
diff --git a/include/asm-powerpc/spu.h b/include/asm-powerpc/spu.h index 0f9f2dd24a79..31d5054be20f 100644 --- a/include/asm-powerpc/spu.h +++ b/include/asm-powerpc/spu.h | |||
@@ -165,6 +165,13 @@ int spu_irq_class_0_bottom(struct spu *spu); | |||
165 | int spu_irq_class_1_bottom(struct spu *spu); | 165 | int spu_irq_class_1_bottom(struct spu *spu); |
166 | void spu_irq_setaffinity(struct spu *spu, int cpu); | 166 | void spu_irq_setaffinity(struct spu *spu, int cpu); |
167 | 167 | ||
168 | extern void spu_invalidate_slbs(struct spu *spu); | ||
169 | extern void spu_associate_mm(struct spu *spu, struct mm_struct *mm); | ||
170 | |||
171 | /* Calls from the memory management to the SPU */ | ||
172 | struct mm_struct; | ||
173 | extern void spu_flush_all_slbs(struct mm_struct *mm); | ||
174 | |||
168 | /* system callbacks from the SPU */ | 175 | /* system callbacks from the SPU */ |
169 | struct spu_syscall_block { | 176 | struct spu_syscall_block { |
170 | u64 nr_ret; | 177 | u64 nr_ret; |
diff --git a/include/asm-powerpc/spu_csa.h b/include/asm-powerpc/spu_csa.h index bdbf906a767f..8aad0619eb8e 100644 --- a/include/asm-powerpc/spu_csa.h +++ b/include/asm-powerpc/spu_csa.h | |||
@@ -221,8 +221,6 @@ struct spu_priv2_collapsed { | |||
221 | * @spu_chnlcnt_RW: Array of saved channel counts. | 221 | * @spu_chnlcnt_RW: Array of saved channel counts. |
222 | * @spu_chnldata_RW: Array of saved channel data. | 222 | * @spu_chnldata_RW: Array of saved channel data. |
223 | * @suspend_time: Time stamp when decrementer disabled. | 223 | * @suspend_time: Time stamp when decrementer disabled. |
224 | * @slb_esid_RW: Array of saved SLB esid entries. | ||
225 | * @slb_vsid_RW: Array of saved SLB vsid entries. | ||
226 | * | 224 | * |
227 | * Structure representing the whole of the SPU | 225 | * Structure representing the whole of the SPU |
228 | * context save area (CSA). This struct contains | 226 | * context save area (CSA). This struct contains |
@@ -245,8 +243,6 @@ struct spu_state { | |||
245 | u32 spu_mailbox_data[4]; | 243 | u32 spu_mailbox_data[4]; |
246 | u32 pu_mailbox_data[1]; | 244 | u32 pu_mailbox_data[1]; |
247 | unsigned long suspend_time; | 245 | unsigned long suspend_time; |
248 | u64 slb_esid_RW[8]; | ||
249 | u64 slb_vsid_RW[8]; | ||
250 | spinlock_t register_lock; | 246 | spinlock_t register_lock; |
251 | }; | 247 | }; |
252 | 248 | ||
diff --git a/include/asm-powerpc/systbl.h b/include/asm-powerpc/systbl.h index 418e5c7e972c..8d853c554631 100644 --- a/include/asm-powerpc/systbl.h +++ b/include/asm-powerpc/systbl.h | |||
@@ -304,5 +304,6 @@ SYSCALL_SPU(fchmodat) | |||
304 | SYSCALL_SPU(faccessat) | 304 | SYSCALL_SPU(faccessat) |
305 | COMPAT_SYS_SPU(get_robust_list) | 305 | COMPAT_SYS_SPU(get_robust_list) |
306 | COMPAT_SYS_SPU(set_robust_list) | 306 | COMPAT_SYS_SPU(set_robust_list) |
307 | COMPAT_SYS(move_pages) | 307 | COMPAT_SYS_SPU(move_pages) |
308 | SYSCALL_SPU(getcpu) | 308 | SYSCALL_SPU(getcpu) |
309 | COMPAT_SYS(epoll_pwait) | ||
diff --git a/include/asm-powerpc/unistd.h b/include/asm-powerpc/unistd.h index 0ae954e3d258..2baedbe54e13 100644 --- a/include/asm-powerpc/unistd.h +++ b/include/asm-powerpc/unistd.h | |||
@@ -324,10 +324,12 @@ | |||
324 | #define __NR_get_robust_list 299 | 324 | #define __NR_get_robust_list 299 |
325 | #define __NR_set_robust_list 300 | 325 | #define __NR_set_robust_list 300 |
326 | #define __NR_move_pages 301 | 326 | #define __NR_move_pages 301 |
327 | #define __NR_getcpu 302 | ||
328 | #define __NR_epoll_pwait 303 | ||
327 | 329 | ||
328 | #ifdef __KERNEL__ | 330 | #ifdef __KERNEL__ |
329 | 331 | ||
330 | #define __NR_syscalls 302 | 332 | #define __NR_syscalls 304 |
331 | 333 | ||
332 | #define __NR__exit __NR_exit | 334 | #define __NR__exit __NR_exit |
333 | #define NR_syscalls __NR_syscalls | 335 | #define NR_syscalls __NR_syscalls |
diff --git a/include/asm-s390/ipl.h b/include/asm-s390/ipl.h index 660f78271a93..0eb64083480a 100644 --- a/include/asm-s390/ipl.h +++ b/include/asm-s390/ipl.h | |||
@@ -14,9 +14,13 @@ | |||
14 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ | 14 | #define IPL_PARM_BLK_FCP_LEN (sizeof(struct ipl_list_hdr) + \ |
15 | sizeof(struct ipl_block_fcp)) | 15 | sizeof(struct ipl_block_fcp)) |
16 | 16 | ||
17 | #define IPL_PARM_BLK0_FCP_LEN (sizeof(struct ipl_block_fcp) + 8) | ||
18 | |||
17 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ | 19 | #define IPL_PARM_BLK_CCW_LEN (sizeof(struct ipl_list_hdr) + \ |
18 | sizeof(struct ipl_block_ccw)) | 20 | sizeof(struct ipl_block_ccw)) |
19 | 21 | ||
22 | #define IPL_PARM_BLK0_CCW_LEN (sizeof(struct ipl_block_ccw) + 8) | ||
23 | |||
20 | #define IPL_MAX_SUPPORTED_VERSION (0) | 24 | #define IPL_MAX_SUPPORTED_VERSION (0) |
21 | 25 | ||
22 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ | 26 | #define IPL_PARMBLOCK_START ((struct ipl_parameter_block *) \ |
@@ -58,6 +62,7 @@ struct ipl_block_ccw { | |||
58 | u8 vm_flags; | 62 | u8 vm_flags; |
59 | u8 reserved3[3]; | 63 | u8 reserved3[3]; |
60 | u32 vm_parm_len; | 64 | u32 vm_parm_len; |
65 | u8 reserved4[80]; | ||
61 | } __attribute__((packed)); | 66 | } __attribute__((packed)); |
62 | 67 | ||
63 | struct ipl_parameter_block { | 68 | struct ipl_parameter_block { |
diff --git a/include/asm-s390/unistd.h b/include/asm-s390/unistd.h index fb6fef97d739..5c6f00d62df8 100644 --- a/include/asm-s390/unistd.h +++ b/include/asm-s390/unistd.h | |||
@@ -250,8 +250,9 @@ | |||
250 | /* Number 310 is reserved for new sys_move_pages */ | 250 | /* Number 310 is reserved for new sys_move_pages */ |
251 | #define __NR_getcpu 311 | 251 | #define __NR_getcpu 311 |
252 | #define __NR_epoll_pwait 312 | 252 | #define __NR_epoll_pwait 312 |
253 | #define __NR_utimes 313 | ||
253 | 254 | ||
254 | #define NR_syscalls 313 | 255 | #define NR_syscalls 314 |
255 | 256 | ||
256 | /* | 257 | /* |
257 | * There are some system calls that are not present on 64 bit, some | 258 | * There are some system calls that are not present on 64 bit, some |
diff --git a/include/asm-sh/ioctls.h b/include/asm-sh/ioctls.h index 9d84a2d445a2..35805df010a0 100644 --- a/include/asm-sh/ioctls.h +++ b/include/asm-sh/ioctls.h | |||
@@ -16,17 +16,17 @@ | |||
16 | #define TCSETSW 0x5403 | 16 | #define TCSETSW 0x5403 |
17 | #define TCSETSF 0x5404 | 17 | #define TCSETSF 0x5404 |
18 | 18 | ||
19 | #define TCGETA _IOR('t', 23, struct termio) | 19 | #define TCGETA 0x80127417 /* _IOR('t', 23, struct termio) */ |
20 | #define TCSETA _IOW('t', 24, struct termio) | 20 | #define TCSETA 0x40127418 /* _IOW('t', 24, struct termio) */ |
21 | #define TCSETAW _IOW('t', 25, struct termio) | 21 | #define TCSETAW 0x40127419 /* _IOW('t', 25, struct termio) */ |
22 | #define TCSETAF _IOW('t', 28, struct termio) | 22 | #define TCSETAF 0x4012741C /* _IOW('t', 28, struct termio) */ |
23 | 23 | ||
24 | #define TCSBRK _IO('t', 29) | 24 | #define TCSBRK _IO('t', 29) |
25 | #define TCXONC _IO('t', 30) | 25 | #define TCXONC _IO('t', 30) |
26 | #define TCFLSH _IO('t', 31) | 26 | #define TCFLSH _IO('t', 31) |
27 | 27 | ||
28 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) | 28 | #define TIOCSWINSZ 0x40087467 /* _IOW('t', 103, struct winsize) */ |
29 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) | 29 | #define TIOCGWINSZ 0x80087468 /* _IOR('t', 104, struct winsize) */ |
30 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ | 30 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ |
31 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ | 31 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ |
32 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ | 32 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ |
@@ -59,8 +59,8 @@ | |||
59 | #define TIOCSSOFTCAR _IOW('T', 26, unsigned int) /* 0x541A */ | 59 | #define TIOCSSOFTCAR _IOW('T', 26, unsigned int) /* 0x541A */ |
60 | #define TIOCLINUX _IOW('T', 28, char) /* 0x541C */ | 60 | #define TIOCLINUX _IOW('T', 28, char) /* 0x541C */ |
61 | #define TIOCCONS _IO('T', 29) /* 0x541D */ | 61 | #define TIOCCONS _IO('T', 29) /* 0x541D */ |
62 | #define TIOCGSERIAL _IOR('T', 30, struct serial_struct) /* 0x541E */ | 62 | #define TIOCGSERIAL 0x803C541E /* _IOR('T', 30, struct serial_struct) 0x541E */ |
63 | #define TIOCSSERIAL _IOW('T', 31, struct serial_struct) /* 0x541F */ | 63 | #define TIOCSSERIAL 0x403C541F /* _IOW('T', 31, struct serial_struct) 0x541F */ |
64 | #define TIOCPKT _IOW('T', 32, int) /* 0x5420 */ | 64 | #define TIOCPKT _IOW('T', 32, int) /* 0x5420 */ |
65 | # define TIOCPKT_DATA 0 | 65 | # define TIOCPKT_DATA 0 |
66 | # define TIOCPKT_FLUSHREAD 1 | 66 | # define TIOCPKT_FLUSHREAD 1 |
@@ -86,12 +86,12 @@ | |||
86 | #define TIOCSERSWILD _IOW('T', 85, int) /* 0x5455 */ | 86 | #define TIOCSERSWILD _IOW('T', 85, int) /* 0x5455 */ |
87 | #define TIOCGLCKTRMIOS 0x5456 | 87 | #define TIOCGLCKTRMIOS 0x5456 |
88 | #define TIOCSLCKTRMIOS 0x5457 | 88 | #define TIOCSLCKTRMIOS 0x5457 |
89 | #define TIOCSERGSTRUCT _IOR('T', 88, struct async_struct) /* 0x5458 */ /* For debugging only */ | 89 | #define TIOCSERGSTRUCT 0x80d85458 /* _IOR('T', 88, struct async_struct) 0x5458 */ /* For debugging only */ |
90 | #define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */ | 90 | #define TIOCSERGETLSR _IOR('T', 89, unsigned int) /* 0x5459 */ /* Get line status register */ |
91 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | 91 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ |
92 | # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | 92 | # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ |
93 | #define TIOCSERGETMULTI _IOR('T', 90, struct serial_multiport_struct) /* 0x545A */ /* Get multiport config */ | 93 | #define TIOCSERGETMULTI 0x80A8545A /* _IOR('T', 90, struct serial_multiport_struct) 0x545A */ /* Get multiport config */ |
94 | #define TIOCSERSETMULTI _IOW('T', 91, struct serial_multiport_struct) /* 0x545B */ /* Set multiport config */ | 94 | #define TIOCSERSETMULTI 0x40A8545B /* _IOW('T', 91, struct serial_multiport_struct) 0x545B */ /* Set multiport config */ |
95 | 95 | ||
96 | #define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ | 96 | #define TIOCMIWAIT _IO('T', 92) /* 0x545C */ /* wait for a change on serial input line(s) */ |
97 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | 97 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ |
diff --git a/include/asm-sh/irq.h b/include/asm-sh/irq.h index 8ccf7ae593ef..afe188f0ad5f 100644 --- a/include/asm-sh/irq.h +++ b/include/asm-sh/irq.h | |||
@@ -94,8 +94,13 @@ | |||
94 | /* | 94 | /* |
95 | * Convert back and forth between INTEVT and IRQ values. | 95 | * Convert back and forth between INTEVT and IRQ values. |
96 | */ | 96 | */ |
97 | #ifdef CONFIG_CPU_HAS_INTEVT | ||
97 | #define evt2irq(evt) (((evt) >> 5) - 16) | 98 | #define evt2irq(evt) (((evt) >> 5) - 16) |
98 | #define irq2evt(irq) (((irq) + 16) << 5) | 99 | #define irq2evt(irq) (((irq) + 16) << 5) |
100 | #else | ||
101 | #define evt2irq(evt) (evt) | ||
102 | #define irq2evt(irq) (irq) | ||
103 | #endif | ||
99 | 104 | ||
100 | /* | 105 | /* |
101 | * Simple Mask Register Support | 106 | * Simple Mask Register Support |
diff --git a/include/asm-sh/unistd.h b/include/asm-sh/unistd.h index 17f527bfd455..49be50a36b77 100644 --- a/include/asm-sh/unistd.h +++ b/include/asm-sh/unistd.h | |||
@@ -233,6 +233,7 @@ | |||
233 | #define __NR_fcntl64 221 | 233 | #define __NR_fcntl64 221 |
234 | /* 223 is unused */ | 234 | /* 223 is unused */ |
235 | #define __NR_gettid 224 | 235 | #define __NR_gettid 224 |
236 | #define __NR_readahead 225 | ||
236 | #define __NR_setxattr 226 | 237 | #define __NR_setxattr 226 |
237 | #define __NR_lsetxattr 227 | 238 | #define __NR_lsetxattr 227 |
238 | #define __NR_fsetxattr 228 | 239 | #define __NR_fsetxattr 228 |
diff --git a/include/asm-sparc/dma-mapping.h b/include/asm-sparc/dma-mapping.h index 6db83dc93cb7..f3a641e6b2c8 100644 --- a/include/asm-sparc/dma-mapping.h +++ b/include/asm-sparc/dma-mapping.h | |||
@@ -5,20 +5,7 @@ | |||
5 | #ifdef CONFIG_PCI | 5 | #ifdef CONFIG_PCI |
6 | #include <asm-generic/dma-mapping.h> | 6 | #include <asm-generic/dma-mapping.h> |
7 | #else | 7 | #else |
8 | 8 | #include <asm-generic/dma-mapping-broken.h> | |
9 | static inline void *dma_alloc_coherent(struct device *dev, size_t size, | ||
10 | dma_addr_t *dma_handle, gfp_t flag) | ||
11 | { | ||
12 | BUG(); | ||
13 | return NULL; | ||
14 | } | ||
15 | |||
16 | static inline void dma_free_coherent(struct device *dev, size_t size, | ||
17 | void *vaddr, dma_addr_t dma_handle) | ||
18 | { | ||
19 | BUG(); | ||
20 | } | ||
21 | |||
22 | #endif /* PCI */ | 9 | #endif /* PCI */ |
23 | 10 | ||
24 | #endif /* _ASM_SPARC_DMA_MAPPING_H */ | 11 | #endif /* _ASM_SPARC_DMA_MAPPING_H */ |
diff --git a/include/asm-sparc/unistd.h b/include/asm-sparc/unistd.h index d5b2f8053b3b..e43ed1d63a9d 100644 --- a/include/asm-sparc/unistd.h +++ b/include/asm-sparc/unistd.h | |||
@@ -319,16 +319,17 @@ | |||
319 | #define __NR_set_robust_list 300 | 319 | #define __NR_set_robust_list 300 |
320 | #define __NR_get_robust_list 301 | 320 | #define __NR_get_robust_list 301 |
321 | #define __NR_migrate_pages 302 | 321 | #define __NR_migrate_pages 302 |
322 | #define __NR_mbind 303 | ||
323 | #define __NR_get_mempolicy 304 | ||
324 | #define __NR_set_mempolicy 305 | ||
325 | #define __NR_kexec_load 306 | ||
326 | #define __NR_move_pages 307 | ||
327 | #define __NR_getcpu 308 | ||
328 | #define __NR_epoll_pwait 309 | ||
322 | 329 | ||
323 | #define NR_SYSCALLS 303 | 330 | #define NR_SYSCALLS 310 |
324 | 331 | ||
325 | #ifdef __KERNEL__ | 332 | #ifdef __KERNEL__ |
326 | /* WARNING: You MAY NOT add syscall numbers larger than 302, since | ||
327 | * all of the syscall tables in the Sparc kernel are | ||
328 | * sized to have 302 entries (starting at zero). Therefore | ||
329 | * find a free slot in the 0-302 range. | ||
330 | */ | ||
331 | |||
332 | #define __ARCH_WANT_IPC_PARSE_VERSION | 333 | #define __ARCH_WANT_IPC_PARSE_VERSION |
333 | #define __ARCH_WANT_OLD_READDIR | 334 | #define __ARCH_WANT_OLD_READDIR |
334 | #define __ARCH_WANT_STAT64 | 335 | #define __ARCH_WANT_STAT64 |
@@ -345,7 +346,6 @@ | |||
345 | #define __ARCH_WANT_SYS_GETPGRP | 346 | #define __ARCH_WANT_SYS_GETPGRP |
346 | #define __ARCH_WANT_SYS_LLSEEK | 347 | #define __ARCH_WANT_SYS_LLSEEK |
347 | #define __ARCH_WANT_SYS_NICE | 348 | #define __ARCH_WANT_SYS_NICE |
348 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
349 | #define __ARCH_WANT_SYS_OLDUMOUNT | 349 | #define __ARCH_WANT_SYS_OLDUMOUNT |
350 | #define __ARCH_WANT_SYS_SIGPENDING | 350 | #define __ARCH_WANT_SYS_SIGPENDING |
351 | #define __ARCH_WANT_SYS_SIGPROCMASK | 351 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/include/asm-sparc64/tsb.h b/include/asm-sparc64/tsb.h index e82612cd9f33..ab55ffcb7bf4 100644 --- a/include/asm-sparc64/tsb.h +++ b/include/asm-sparc64/tsb.h | |||
@@ -264,6 +264,7 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; | |||
264 | be,a,pt %xcc, OK_LABEL; \ | 264 | be,a,pt %xcc, OK_LABEL; \ |
265 | mov REG4, REG1; | 265 | mov REG4, REG1; |
266 | 266 | ||
267 | #ifndef CONFIG_DEBUG_PAGEALLOC | ||
267 | /* This version uses a trick, the TAG is already (VADDR >> 22) so | 268 | /* This version uses a trick, the TAG is already (VADDR >> 22) so |
268 | * we can make use of that for the index computation. | 269 | * we can make use of that for the index computation. |
269 | */ | 270 | */ |
@@ -277,5 +278,6 @@ extern struct tsb_phys_patch_entry __tsb_phys_patch, __tsb_phys_patch_end; | |||
277 | cmp REG3, TAG; \ | 278 | cmp REG3, TAG; \ |
278 | be,a,pt %xcc, OK_LABEL; \ | 279 | be,a,pt %xcc, OK_LABEL; \ |
279 | mov REG4, REG1; | 280 | mov REG4, REG1; |
281 | #endif | ||
280 | 282 | ||
281 | #endif /* !(_SPARC64_TSB_H) */ | 283 | #endif /* !(_SPARC64_TSB_H) */ |
diff --git a/include/asm-sparc64/unistd.h b/include/asm-sparc64/unistd.h index 47047536f261..e2dcb87e0c62 100644 --- a/include/asm-sparc64/unistd.h +++ b/include/asm-sparc64/unistd.h | |||
@@ -321,17 +321,17 @@ | |||
321 | #define __NR_set_robust_list 300 | 321 | #define __NR_set_robust_list 300 |
322 | #define __NR_get_robust_list 301 | 322 | #define __NR_get_robust_list 301 |
323 | #define __NR_migrate_pages 302 | 323 | #define __NR_migrate_pages 302 |
324 | #define __NR_mbind 303 | ||
325 | #define __NR_get_mempolicy 304 | ||
326 | #define __NR_set_mempolicy 305 | ||
327 | #define __NR_kexec_load 306 | ||
328 | #define __NR_move_pages 307 | ||
329 | #define __NR_getcpu 308 | ||
330 | #define __NR_epoll_pwait 309 | ||
324 | 331 | ||
325 | #define NR_SYSCALLS 303 | 332 | #define NR_SYSCALLS 310 |
326 | 333 | ||
327 | #ifdef __KERNEL__ | 334 | #ifdef __KERNEL__ |
328 | |||
329 | /* WARNING: You MAY NOT add syscall numbers larger than 302, since | ||
330 | * all of the syscall tables in the Sparc kernel are | ||
331 | * sized to have 302 entries (starting at zero). Therefore | ||
332 | * find a free slot in the 0-302 range. | ||
333 | */ | ||
334 | |||
335 | /* sysconf options, for SunOS compatibility */ | 335 | /* sysconf options, for SunOS compatibility */ |
336 | #define _SC_ARG_MAX 1 | 336 | #define _SC_ARG_MAX 1 |
337 | #define _SC_CHILD_MAX 2 | 337 | #define _SC_CHILD_MAX 2 |
@@ -359,7 +359,6 @@ | |||
359 | #define __ARCH_WANT_SYS_GETPGRP | 359 | #define __ARCH_WANT_SYS_GETPGRP |
360 | #define __ARCH_WANT_SYS_LLSEEK | 360 | #define __ARCH_WANT_SYS_LLSEEK |
361 | #define __ARCH_WANT_SYS_NICE | 361 | #define __ARCH_WANT_SYS_NICE |
362 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | ||
363 | #define __ARCH_WANT_SYS_OLDUMOUNT | 362 | #define __ARCH_WANT_SYS_OLDUMOUNT |
364 | #define __ARCH_WANT_SYS_SIGPENDING | 363 | #define __ARCH_WANT_SYS_SIGPENDING |
365 | #define __ARCH_WANT_SYS_SIGPROCMASK | 364 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/include/asm-x86_64/nmi.h b/include/asm-x86_64/nmi.h index ceb3d8dac33d..72375e7d32a8 100644 --- a/include/asm-x86_64/nmi.h +++ b/include/asm-x86_64/nmi.h | |||
@@ -64,7 +64,7 @@ extern int setup_nmi_watchdog(char *); | |||
64 | 64 | ||
65 | extern atomic_t nmi_active; | 65 | extern atomic_t nmi_active; |
66 | extern unsigned int nmi_watchdog; | 66 | extern unsigned int nmi_watchdog; |
67 | #define NMI_DEFAULT 0 | 67 | #define NMI_DEFAULT -1 |
68 | #define NMI_NONE 0 | 68 | #define NMI_NONE 0 |
69 | #define NMI_IO_APIC 1 | 69 | #define NMI_IO_APIC 1 |
70 | #define NMI_LOCAL_APIC 2 | 70 | #define NMI_LOCAL_APIC 2 |
diff --git a/include/asm-x86_64/proto.h b/include/asm-x86_64/proto.h index f54f3abf93ce..b6e65a699f2a 100644 --- a/include/asm-x86_64/proto.h +++ b/include/asm-x86_64/proto.h | |||
@@ -99,7 +99,7 @@ extern int force_iommu, no_iommu; | |||
99 | extern int iommu_detected; | 99 | extern int iommu_detected; |
100 | #ifdef CONFIG_IOMMU | 100 | #ifdef CONFIG_IOMMU |
101 | extern void gart_iommu_init(void); | 101 | extern void gart_iommu_init(void); |
102 | extern void gart_parse_options(char *); | 102 | extern void __init gart_parse_options(char *); |
103 | extern void iommu_hole_init(void); | 103 | extern void iommu_hole_init(void); |
104 | extern int fallback_aper_order; | 104 | extern int fallback_aper_order; |
105 | extern int fallback_aper_force; | 105 | extern int fallback_aper_force; |
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index e17b9ec42e98..de592a408c07 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/threads.h> | 7 | #include <linux/threads.h> |
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <linux/bitops.h> | 9 | #include <linux/bitops.h> |
10 | #include <linux/init.h> | ||
10 | extern int disable_apic; | 11 | extern int disable_apic; |
11 | 12 | ||
12 | #include <asm/fixmap.h> | 13 | #include <asm/fixmap.h> |
@@ -68,7 +69,7 @@ extern int __cpu_disable(void); | |||
68 | extern void __cpu_die(unsigned int cpu); | 69 | extern void __cpu_die(unsigned int cpu); |
69 | extern void prefill_possible_map(void); | 70 | extern void prefill_possible_map(void); |
70 | extern unsigned num_processors; | 71 | extern unsigned num_processors; |
71 | extern unsigned disabled_cpus; | 72 | extern unsigned __cpuinitdata disabled_cpus; |
72 | 73 | ||
73 | #define NO_PROC_ID 0xFF /* No processor magic marker */ | 74 | #define NO_PROC_ID 0xFF /* No processor magic marker */ |
74 | 75 | ||
diff --git a/include/asm-x86_64/uaccess.h b/include/asm-x86_64/uaccess.h index 1981f70fcad1..9df30b939c4e 100644 --- a/include/asm-x86_64/uaccess.h +++ b/include/asm-x86_64/uaccess.h | |||
@@ -373,12 +373,12 @@ extern long __copy_user_nocache(void *dst, const void __user *src, unsigned size | |||
373 | static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size) | 373 | static inline int __copy_from_user_nocache(void *dst, const void __user *src, unsigned size) |
374 | { | 374 | { |
375 | might_sleep(); | 375 | might_sleep(); |
376 | return __copy_user_nocache(dst, (__force void *)src, size, 1); | 376 | return __copy_user_nocache(dst, src, size, 1); |
377 | } | 377 | } |
378 | 378 | ||
379 | static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size) | 379 | static inline int __copy_from_user_inatomic_nocache(void *dst, const void __user *src, unsigned size) |
380 | { | 380 | { |
381 | return __copy_user_nocache(dst, (__force void *)src, size, 0); | 381 | return __copy_user_nocache(dst, src, size, 0); |
382 | } | 382 | } |
383 | 383 | ||
384 | #endif /* __X86_64_UACCESS_H */ | 384 | #endif /* __X86_64_UACCESS_H */ |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 7011d6255593..f2542c24b328 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -93,6 +93,7 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); |
94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); |
95 | long congestion_wait(int rw, long timeout); | 95 | long congestion_wait(int rw, long timeout); |
96 | long congestion_wait_interruptible(int rw, long timeout); | ||
96 | void congestion_end(int rw); | 97 | void congestion_end(int rw); |
97 | 98 | ||
98 | #define bdi_cap_writeback_dirty(bdi) \ | 99 | #define bdi_cap_writeback_dirty(bdi) \ |
diff --git a/include/linux/device.h b/include/linux/device.h index 39a3199a826d..caad9bba9652 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -353,6 +353,8 @@ extern int __must_check device_create_bin_file(struct device *dev, | |||
353 | struct bin_attribute *attr); | 353 | struct bin_attribute *attr); |
354 | extern void device_remove_bin_file(struct device *dev, | 354 | extern void device_remove_bin_file(struct device *dev, |
355 | struct bin_attribute *attr); | 355 | struct bin_attribute *attr); |
356 | extern int device_schedule_callback(struct device *dev, | ||
357 | void (*func)(struct device *)); | ||
356 | 358 | ||
357 | /* device resource management */ | 359 | /* device resource management */ |
358 | typedef void (*dr_release_t)(struct device *dev, void *res); | 360 | typedef void (*dr_release_t)(struct device *dev, void *res); |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 06c58c423fe1..506ad20c18f8 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -75,7 +75,7 @@ extern int do_poke_blanked_console; | |||
75 | 75 | ||
76 | extern void (*kbd_ledfunc)(unsigned int led); | 76 | extern void (*kbd_ledfunc)(unsigned int led); |
77 | 77 | ||
78 | extern void set_console(int nr); | 78 | extern int set_console(int nr); |
79 | extern void schedule_console_callback(void); | 79 | extern void schedule_console_callback(void); |
80 | 80 | ||
81 | static inline void set_leds(void) | 81 | static inline void set_leds(void) |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c68c7ac6b232..248305bb9a18 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -57,7 +57,11 @@ typedef union { | |||
57 | } ktime_t; | 57 | } ktime_t; |
58 | 58 | ||
59 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | 59 | #define KTIME_MAX ((s64)~((u64)1 << 63)) |
60 | #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | 60 | #if (BITS_PER_LONG == 64) |
61 | # define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
62 | #else | ||
63 | # define KTIME_SEC_MAX LONG_MAX | ||
64 | #endif | ||
61 | 65 | ||
62 | /* | 66 | /* |
63 | * ktime_t definitions when using the 64-bit scalar representation: | 67 | * ktime_t definitions when using the 64-bit scalar representation: |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 74c8a2ecc9dd..e38fe6822cb4 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -17,7 +17,7 @@ struct msi_desc { | |||
17 | struct { | 17 | struct { |
18 | __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ | 18 | __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ |
19 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 19 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
20 | __u8 unused : 1; | 20 | __u8 masked : 1; |
21 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 21 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
22 | __u8 pos; /* Location of the msi capability */ | 22 | __u8 pos; /* Location of the msi capability */ |
23 | __u16 entry_nr; /* specific enabled entry */ | 23 | __u16 entry_nr; /* specific enabled entry */ |
@@ -32,10 +32,8 @@ struct msi_desc { | |||
32 | void __iomem *mask_base; | 32 | void __iomem *mask_base; |
33 | struct pci_dev *dev; | 33 | struct pci_dev *dev; |
34 | 34 | ||
35 | #ifdef CONFIG_PM | 35 | /* Last set MSI message */ |
36 | /* PM save area for MSIX address/data */ | 36 | struct msi_msg msg; |
37 | struct msi_msg msg_save; | ||
38 | #endif | ||
39 | }; | 37 | }; |
40 | 38 | ||
41 | /* | 39 | /* |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 47aaa2c66738..e9ae0c6e2c62 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -415,6 +415,7 @@ extern void nfs_complete_unlink(struct dentry *); | |||
415 | /* | 415 | /* |
416 | * linux/fs/nfs/write.c | 416 | * linux/fs/nfs/write.c |
417 | */ | 417 | */ |
418 | extern int nfs_congestion_kb; | ||
418 | extern int nfs_writepage(struct page *page, struct writeback_control *wbc); | 419 | extern int nfs_writepage(struct page *page, struct writeback_control *wbc); |
419 | extern int nfs_writepages(struct address_space *, struct writeback_control *); | 420 | extern int nfs_writepages(struct address_space *, struct writeback_control *); |
420 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 421 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 95796e6924f1..c95d5e642548 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -82,6 +82,7 @@ struct nfs_server { | |||
82 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | 82 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ |
83 | struct nfs_iostats * io_stats; /* I/O statistics */ | 83 | struct nfs_iostats * io_stats; /* I/O statistics */ |
84 | struct backing_dev_info backing_dev_info; | 84 | struct backing_dev_info backing_dev_info; |
85 | atomic_t writeback; /* number of writeback pages */ | ||
85 | int flags; /* various flags */ | 86 | int flags; /* various flags */ |
86 | unsigned int caps; /* server capabilities */ | 87 | unsigned int caps; /* server capabilities */ |
87 | unsigned int rsize; /* read size */ | 88 | unsigned int rsize; /* read size */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 78417e421b4c..481ea0663f19 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -209,11 +209,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
209 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 209 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
210 | } | 210 | } |
211 | 211 | ||
212 | static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) | ||
213 | { | ||
214 | hlist_del(&cap->next); | ||
215 | } | ||
216 | |||
217 | /* | 212 | /* |
218 | * For PCI devices, the region numbers are assigned this way: | 213 | * For PCI devices, the region numbers are assigned this way: |
219 | * | 214 | * |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index f09cce2357ff..495d368390e0 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -296,6 +296,7 @@ | |||
296 | #define PCI_MSIX_FLAGS 2 | 296 | #define PCI_MSIX_FLAGS 2 |
297 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF | 297 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF |
298 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | 298 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) |
299 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) | ||
299 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 300 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
300 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) | 301 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) |
301 | 302 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 7f88d97575fd..47e82c120f9a 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1324,7 +1324,7 @@ struct security_operations { | |||
1324 | 1324 | ||
1325 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); | 1325 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); |
1326 | 1326 | ||
1327 | int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size); | 1327 | int (*getprocattr)(struct task_struct *p, char *name, char **value); |
1328 | int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); | 1328 | int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); |
1329 | int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen); | 1329 | int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen); |
1330 | void (*release_secctx)(char *secdata, u32 seclen); | 1330 | void (*release_secctx)(char *secdata, u32 seclen); |
@@ -2092,9 +2092,9 @@ static inline void security_d_instantiate (struct dentry *dentry, struct inode * | |||
2092 | security_ops->d_instantiate (dentry, inode); | 2092 | security_ops->d_instantiate (dentry, inode); |
2093 | } | 2093 | } |
2094 | 2094 | ||
2095 | static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2095 | static inline int security_getprocattr(struct task_struct *p, char *name, char **value) |
2096 | { | 2096 | { |
2097 | return security_ops->getprocattr(p, name, value, size); | 2097 | return security_ops->getprocattr(p, name, value); |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2100 | static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) |
@@ -2749,7 +2749,7 @@ static inline int security_sem_semop (struct sem_array * sma, | |||
2749 | static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) | 2749 | static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) |
2750 | { } | 2750 | { } |
2751 | 2751 | ||
2752 | static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2752 | static inline int security_getprocattr(struct task_struct *p, char *name, char **value) |
2753 | { | 2753 | { |
2754 | return -EINVAL; | 2754 | return -EINVAL; |
2755 | } | 2755 | } |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 2e8c048b9b80..9dbca629dcfb 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -25,7 +25,6 @@ struct spi_bitbang { | |||
25 | spinlock_t lock; | 25 | spinlock_t lock; |
26 | struct list_head queue; | 26 | struct list_head queue; |
27 | u8 busy; | 27 | u8 busy; |
28 | u8 shutdown; | ||
29 | u8 use_dma; | 28 | u8 use_dma; |
30 | 29 | ||
31 | struct spi_master *master; | 30 | struct spi_master *master; |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 523405e1e1f6..fea9a6b3fb7b 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #define _SYSFS_H_ | 11 | #define _SYSFS_H_ |
12 | 12 | ||
13 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
14 | #include <linux/errno.h> | ||
14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
15 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
16 | 17 | ||
@@ -78,6 +79,9 @@ struct sysfs_ops { | |||
78 | 79 | ||
79 | #ifdef CONFIG_SYSFS | 80 | #ifdef CONFIG_SYSFS |
80 | 81 | ||
82 | extern int sysfs_schedule_callback(struct kobject *kobj, | ||
83 | void (*func)(void *), void *data); | ||
84 | |||
81 | extern int __must_check | 85 | extern int __must_check |
82 | sysfs_create_dir(struct kobject *, struct dentry *); | 86 | sysfs_create_dir(struct kobject *, struct dentry *); |
83 | 87 | ||
@@ -132,6 +136,12 @@ extern int __must_check sysfs_init(void); | |||
132 | 136 | ||
133 | #else /* CONFIG_SYSFS */ | 137 | #else /* CONFIG_SYSFS */ |
134 | 138 | ||
139 | static inline int sysfs_schedule_callback(struct kobject *kobj, | ||
140 | void (*func)(void *), void *data) | ||
141 | { | ||
142 | return -ENOSYS; | ||
143 | } | ||
144 | |||
135 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) | 145 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) |
136 | { | 146 | { |
137 | return 0; | 147 | return 0; |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index dc2e9fe69418..daeba22b7656 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -649,10 +649,10 @@ struct ufs2_inode { | |||
649 | __fs32 ui_blksize; /* 12: Inode blocksize. */ | 649 | __fs32 ui_blksize; /* 12: Inode blocksize. */ |
650 | __fs64 ui_size; /* 16: File byte count. */ | 650 | __fs64 ui_size; /* 16: File byte count. */ |
651 | __fs64 ui_blocks; /* 24: Bytes actually held. */ | 651 | __fs64 ui_blocks; /* 24: Bytes actually held. */ |
652 | struct ufs_timeval ui_atime; /* 32: Last access time. */ | 652 | __fs64 ui_atime; /* 32: Last access time. */ |
653 | struct ufs_timeval ui_mtime; /* 40: Last modified time. */ | 653 | __fs64 ui_mtime; /* 40: Last modified time. */ |
654 | struct ufs_timeval ui_ctime; /* 48: Last inode change time. */ | 654 | __fs64 ui_ctime; /* 48: Last inode change time. */ |
655 | struct ufs_timeval ui_birthtime; /* 56: Inode creation time. */ | 655 | __fs64 ui_birthtime; /* 56: Inode creation time. */ |
656 | __fs32 ui_mtimensec; /* 64: Last modified time. */ | 656 | __fs32 ui_mtimensec; /* 64: Last modified time. */ |
657 | __fs32 ui_atimensec; /* 68: Last access time. */ | 657 | __fs32 ui_atimensec; /* 68: Last access time. */ |
658 | __fs32 ui_ctimensec; /* 72: Last inode change time. */ | 658 | __fs32 ui_ctimensec; /* 72: Last inode change time. */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 37a1a41f5b65..e0db669998f3 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -83,6 +83,7 @@ void reset_vc(struct vc_data *vc); | |||
83 | #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) | 83 | #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) |
84 | extern char con_buf[CON_BUF_SIZE]; | 84 | extern char con_buf[CON_BUF_SIZE]; |
85 | extern struct semaphore con_buf_sem; | 85 | extern struct semaphore con_buf_sem; |
86 | extern char vt_dont_switch; | ||
86 | 87 | ||
87 | struct vt_spawn_console { | 88 | struct vt_spawn_console { |
88 | spinlock_t lock; | 89 | spinlock_t lock; |
diff --git a/include/sound/version.h b/include/sound/version.h index 5f7275000102..42a18cc95f38 100644 --- a/include/sound/version.h +++ b/include/sound/version.h | |||
@@ -1,3 +1,3 @@ | |||
1 | /* include/version.h. Generated by alsa/ksync script. */ | 1 | /* include/version.h. Generated by alsa/ksync script. */ |
2 | #define CONFIG_SND_VERSION "1.0.14rc3" | 2 | #define CONFIG_SND_VERSION "1.0.14rc3" |
3 | #define CONFIG_SND_DATE " (Tue Mar 06 13:10:00 2007 UTC)" | 3 | #define CONFIG_SND_DATE " (Wed Mar 14 07:25:50 2007 UTC)" |
diff --git a/kernel/auditsc.c b/kernel/auditsc.c index 359955800dd2..628c7ac590a0 100644 --- a/kernel/auditsc.c +++ b/kernel/auditsc.c | |||
@@ -739,28 +739,26 @@ static inline void audit_free_context(struct audit_context *context) | |||
739 | void audit_log_task_context(struct audit_buffer *ab) | 739 | void audit_log_task_context(struct audit_buffer *ab) |
740 | { | 740 | { |
741 | char *ctx = NULL; | 741 | char *ctx = NULL; |
742 | ssize_t len = 0; | 742 | unsigned len; |
743 | int error; | ||
744 | u32 sid; | ||
745 | |||
746 | selinux_get_task_sid(current, &sid); | ||
747 | if (!sid) | ||
748 | return; | ||
743 | 749 | ||
744 | len = security_getprocattr(current, "current", NULL, 0); | 750 | error = selinux_sid_to_string(sid, &ctx, &len); |
745 | if (len < 0) { | 751 | if (error) { |
746 | if (len != -EINVAL) | 752 | if (error != -EINVAL) |
747 | goto error_path; | 753 | goto error_path; |
748 | return; | 754 | return; |
749 | } | 755 | } |
750 | 756 | ||
751 | ctx = kmalloc(len, GFP_KERNEL); | ||
752 | if (!ctx) | ||
753 | goto error_path; | ||
754 | |||
755 | len = security_getprocattr(current, "current", ctx, len); | ||
756 | if (len < 0 ) | ||
757 | goto error_path; | ||
758 | |||
759 | audit_log_format(ab, " subj=%s", ctx); | 757 | audit_log_format(ab, " subj=%s", ctx); |
758 | kfree(ctx); | ||
760 | return; | 759 | return; |
761 | 760 | ||
762 | error_path: | 761 | error_path: |
763 | kfree(ctx); | ||
764 | audit_panic("error in audit_log_task_context"); | 762 | audit_panic("error in audit_log_task_context"); |
765 | return; | 763 | return; |
766 | } | 764 | } |
diff --git a/kernel/fork.c b/kernel/fork.c index d154cc786489..6af959c034d8 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -933,8 +933,8 @@ asmlinkage long sys_set_tid_address(int __user *tidptr) | |||
933 | 933 | ||
934 | static inline void rt_mutex_init_task(struct task_struct *p) | 934 | static inline void rt_mutex_init_task(struct task_struct *p) |
935 | { | 935 | { |
936 | #ifdef CONFIG_RT_MUTEXES | ||
937 | spin_lock_init(&p->pi_lock); | 936 | spin_lock_init(&p->pi_lock); |
937 | #ifdef CONFIG_RT_MUTEXES | ||
938 | plist_head_init(&p->pi_waiters, &p->pi_lock); | 938 | plist_head_init(&p->pi_waiters, &p->pi_lock); |
939 | p->pi_blocked_on = NULL; | 939 | p->pi_blocked_on = NULL; |
940 | #endif | 940 | #endif |
diff --git a/kernel/futex.c b/kernel/futex.c index e749e7df14b1..5a270b5e3f95 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -565,6 +565,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) | |||
565 | if (!pi_state) | 565 | if (!pi_state) |
566 | return -EINVAL; | 566 | return -EINVAL; |
567 | 567 | ||
568 | spin_lock(&pi_state->pi_mutex.wait_lock); | ||
568 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); | 569 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); |
569 | 570 | ||
570 | /* | 571 | /* |
@@ -604,6 +605,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) | |||
604 | pi_state->owner = new_owner; | 605 | pi_state->owner = new_owner; |
605 | spin_unlock_irq(&new_owner->pi_lock); | 606 | spin_unlock_irq(&new_owner->pi_lock); |
606 | 607 | ||
608 | spin_unlock(&pi_state->pi_mutex.wait_lock); | ||
607 | rt_mutex_unlock(&pi_state->pi_mutex); | 609 | rt_mutex_unlock(&pi_state->pi_mutex); |
608 | 610 | ||
609 | return 0; | 611 | return 0; |
diff --git a/kernel/hrtimer.c b/kernel/hrtimer.c index ec4cb9f3e3b7..6a7938a0d513 100644 --- a/kernel/hrtimer.c +++ b/kernel/hrtimer.c | |||
@@ -135,7 +135,7 @@ EXPORT_SYMBOL_GPL(ktime_get_ts); | |||
135 | static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | 135 | static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) |
136 | { | 136 | { |
137 | ktime_t xtim, tomono; | 137 | ktime_t xtim, tomono; |
138 | struct timespec xts; | 138 | struct timespec xts, tom; |
139 | unsigned long seq; | 139 | unsigned long seq; |
140 | 140 | ||
141 | do { | 141 | do { |
@@ -145,10 +145,11 @@ static void hrtimer_get_softirq_time(struct hrtimer_cpu_base *base) | |||
145 | #else | 145 | #else |
146 | xts = xtime; | 146 | xts = xtime; |
147 | #endif | 147 | #endif |
148 | tom = wall_to_monotonic; | ||
148 | } while (read_seqretry(&xtime_lock, seq)); | 149 | } while (read_seqretry(&xtime_lock, seq)); |
149 | 150 | ||
150 | xtim = timespec_to_ktime(xts); | 151 | xtim = timespec_to_ktime(xts); |
151 | tomono = timespec_to_ktime(wall_to_monotonic); | 152 | tomono = timespec_to_ktime(tom); |
152 | base->clock_base[CLOCK_REALTIME].softirq_time = xtim; | 153 | base->clock_base[CLOCK_REALTIME].softirq_time = xtim; |
153 | base->clock_base[CLOCK_MONOTONIC].softirq_time = | 154 | base->clock_base[CLOCK_MONOTONIC].softirq_time = |
154 | ktime_add(xtim, tomono); | 155 | ktime_add(xtim, tomono); |
@@ -644,6 +645,12 @@ hrtimer_forward(struct hrtimer *timer, ktime_t now, ktime_t interval) | |||
644 | orun++; | 645 | orun++; |
645 | } | 646 | } |
646 | timer->expires = ktime_add(timer->expires, interval); | 647 | timer->expires = ktime_add(timer->expires, interval); |
648 | /* | ||
649 | * Make sure, that the result did not wrap with a very large | ||
650 | * interval. | ||
651 | */ | ||
652 | if (timer->expires.tv64 < 0) | ||
653 | timer->expires = ktime_set(KTIME_SEC_MAX, 0); | ||
647 | 654 | ||
648 | return orun; | 655 | return orun; |
649 | } | 656 | } |
diff --git a/kernel/power/console.c b/kernel/power/console.c index 623786d44159..89bcf4973ee5 100644 --- a/kernel/power/console.c +++ b/kernel/power/console.c | |||
@@ -27,7 +27,15 @@ int pm_prepare_console(void) | |||
27 | return 1; | 27 | return 1; |
28 | } | 28 | } |
29 | 29 | ||
30 | set_console(SUSPEND_CONSOLE); | 30 | if (set_console(SUSPEND_CONSOLE)) { |
31 | /* | ||
32 | * We're unable to switch to the SUSPEND_CONSOLE. | ||
33 | * Let the calling function know so it can decide | ||
34 | * what to do. | ||
35 | */ | ||
36 | release_console_sem(); | ||
37 | return 1; | ||
38 | } | ||
31 | release_console_sem(); | 39 | release_console_sem(); |
32 | 40 | ||
33 | if (vt_waitactive(SUSPEND_CONSOLE)) { | 41 | if (vt_waitactive(SUSPEND_CONSOLE)) { |
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 406b20adb27a..873cdf8ea5a4 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -58,6 +58,7 @@ static inline int platform_prepare(void) | |||
58 | 58 | ||
59 | static void power_down(suspend_disk_method_t mode) | 59 | static void power_down(suspend_disk_method_t mode) |
60 | { | 60 | { |
61 | disable_nonboot_cpus(); | ||
61 | switch(mode) { | 62 | switch(mode) { |
62 | case PM_DISK_PLATFORM: | 63 | case PM_DISK_PLATFORM: |
63 | if (pm_ops && pm_ops->enter) { | 64 | if (pm_ops && pm_ops->enter) { |
@@ -251,6 +252,7 @@ static int software_resume(void) | |||
251 | error = swsusp_read(); | 252 | error = swsusp_read(); |
252 | if (error) { | 253 | if (error) { |
253 | swsusp_free(); | 254 | swsusp_free(); |
255 | platform_finish(); | ||
254 | goto Thaw; | 256 | goto Thaw; |
255 | } | 257 | } |
256 | 258 | ||
diff --git a/kernel/power/user.c b/kernel/power/user.c index dd09efe7df54..d6a8dcc26ae5 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -398,9 +398,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
398 | 398 | ||
399 | case PMOPS_ENTER: | 399 | case PMOPS_ENTER: |
400 | if (data->platform_suspend) { | 400 | if (data->platform_suspend) { |
401 | disable_nonboot_cpus(); | ||
401 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); | 402 | kernel_shutdown_prepare(SYSTEM_SUSPEND_DISK); |
402 | error = pm_ops->enter(PM_SUSPEND_DISK); | 403 | error = pm_ops->enter(PM_SUSPEND_DISK); |
403 | error = 0; | 404 | enable_nonboot_cpus(); |
404 | } | 405 | } |
405 | break; | 406 | break; |
406 | 407 | ||
diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 5567745470f7..eadfce2fff74 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c | |||
@@ -307,12 +307,19 @@ int tick_resume_broadcast(void) | |||
307 | spin_lock_irqsave(&tick_broadcast_lock, flags); | 307 | spin_lock_irqsave(&tick_broadcast_lock, flags); |
308 | 308 | ||
309 | bc = tick_broadcast_device.evtdev; | 309 | bc = tick_broadcast_device.evtdev; |
310 | if (bc) { | ||
311 | if (tick_broadcast_device.mode == TICKDEV_MODE_PERIODIC && | ||
312 | !cpus_empty(tick_broadcast_mask)) | ||
313 | tick_broadcast_start_periodic(bc); | ||
314 | 310 | ||
315 | broadcast = cpu_isset(smp_processor_id(), tick_broadcast_mask); | 311 | if (bc) { |
312 | switch (tick_broadcast_device.mode) { | ||
313 | case TICKDEV_MODE_PERIODIC: | ||
314 | if(!cpus_empty(tick_broadcast_mask)) | ||
315 | tick_broadcast_start_periodic(bc); | ||
316 | broadcast = cpu_isset(smp_processor_id(), | ||
317 | tick_broadcast_mask); | ||
318 | break; | ||
319 | case TICKDEV_MODE_ONESHOT: | ||
320 | broadcast = tick_resume_broadcast_oneshot(bc); | ||
321 | break; | ||
322 | } | ||
316 | } | 323 | } |
317 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); | 324 | spin_unlock_irqrestore(&tick_broadcast_lock, flags); |
318 | 325 | ||
@@ -347,6 +354,16 @@ static int tick_broadcast_set_event(ktime_t expires, int force) | |||
347 | } | 354 | } |
348 | } | 355 | } |
349 | 356 | ||
357 | int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | ||
358 | { | ||
359 | clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); | ||
360 | |||
361 | if(!cpus_empty(tick_broadcast_oneshot_mask)) | ||
362 | tick_broadcast_set_event(ktime_get(), 1); | ||
363 | |||
364 | return cpu_isset(smp_processor_id(), tick_broadcast_oneshot_mask); | ||
365 | } | ||
366 | |||
350 | /* | 367 | /* |
351 | * Reprogram the broadcast device: | 368 | * Reprogram the broadcast device: |
352 | * | 369 | * |
diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 43ba1bdec14c..bfda3f7f0716 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c | |||
@@ -298,18 +298,17 @@ static void tick_shutdown(unsigned int *cpup) | |||
298 | spin_unlock_irqrestore(&tick_device_lock, flags); | 298 | spin_unlock_irqrestore(&tick_device_lock, flags); |
299 | } | 299 | } |
300 | 300 | ||
301 | static void tick_suspend_periodic(void) | 301 | static void tick_suspend(void) |
302 | { | 302 | { |
303 | struct tick_device *td = &__get_cpu_var(tick_cpu_device); | 303 | struct tick_device *td = &__get_cpu_var(tick_cpu_device); |
304 | unsigned long flags; | 304 | unsigned long flags; |
305 | 305 | ||
306 | spin_lock_irqsave(&tick_device_lock, flags); | 306 | spin_lock_irqsave(&tick_device_lock, flags); |
307 | if (td->mode == TICKDEV_MODE_PERIODIC) | 307 | clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN); |
308 | clockevents_set_mode(td->evtdev, CLOCK_EVT_MODE_SHUTDOWN); | ||
309 | spin_unlock_irqrestore(&tick_device_lock, flags); | 308 | spin_unlock_irqrestore(&tick_device_lock, flags); |
310 | } | 309 | } |
311 | 310 | ||
312 | static void tick_resume_periodic(void) | 311 | static void tick_resume(void) |
313 | { | 312 | { |
314 | struct tick_device *td = &__get_cpu_var(tick_cpu_device); | 313 | struct tick_device *td = &__get_cpu_var(tick_cpu_device); |
315 | unsigned long flags; | 314 | unsigned long flags; |
@@ -317,6 +316,8 @@ static void tick_resume_periodic(void) | |||
317 | spin_lock_irqsave(&tick_device_lock, flags); | 316 | spin_lock_irqsave(&tick_device_lock, flags); |
318 | if (td->mode == TICKDEV_MODE_PERIODIC) | 317 | if (td->mode == TICKDEV_MODE_PERIODIC) |
319 | tick_setup_periodic(td->evtdev, 0); | 318 | tick_setup_periodic(td->evtdev, 0); |
319 | else | ||
320 | tick_resume_oneshot(); | ||
320 | spin_unlock_irqrestore(&tick_device_lock, flags); | 321 | spin_unlock_irqrestore(&tick_device_lock, flags); |
321 | } | 322 | } |
322 | 323 | ||
@@ -348,13 +349,13 @@ static int tick_notify(struct notifier_block *nb, unsigned long reason, | |||
348 | break; | 349 | break; |
349 | 350 | ||
350 | case CLOCK_EVT_NOTIFY_SUSPEND: | 351 | case CLOCK_EVT_NOTIFY_SUSPEND: |
351 | tick_suspend_periodic(); | 352 | tick_suspend(); |
352 | tick_suspend_broadcast(); | 353 | tick_suspend_broadcast(); |
353 | break; | 354 | break; |
354 | 355 | ||
355 | case CLOCK_EVT_NOTIFY_RESUME: | 356 | case CLOCK_EVT_NOTIFY_RESUME: |
356 | if (!tick_resume_broadcast()) | 357 | if (!tick_resume_broadcast()) |
357 | tick_resume_periodic(); | 358 | tick_resume(); |
358 | break; | 359 | break; |
359 | 360 | ||
360 | default: | 361 | default: |
diff --git a/kernel/time/tick-internal.h b/kernel/time/tick-internal.h index 75890efd24ff..c9d203bde518 100644 --- a/kernel/time/tick-internal.h +++ b/kernel/time/tick-internal.h | |||
@@ -19,12 +19,13 @@ extern void tick_setup_oneshot(struct clock_event_device *newdev, | |||
19 | extern int tick_program_event(ktime_t expires, int force); | 19 | extern int tick_program_event(ktime_t expires, int force); |
20 | extern void tick_oneshot_notify(void); | 20 | extern void tick_oneshot_notify(void); |
21 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); | 21 | extern int tick_switch_to_oneshot(void (*handler)(struct clock_event_device *)); |
22 | 22 | extern void tick_resume_oneshot(void); | |
23 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 23 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
24 | extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc); | 24 | extern void tick_broadcast_setup_oneshot(struct clock_event_device *bc); |
25 | extern void tick_broadcast_oneshot_control(unsigned long reason); | 25 | extern void tick_broadcast_oneshot_control(unsigned long reason); |
26 | extern void tick_broadcast_switch_to_oneshot(void); | 26 | extern void tick_broadcast_switch_to_oneshot(void); |
27 | extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); | 27 | extern void tick_shutdown_broadcast_oneshot(unsigned int *cpup); |
28 | extern int tick_resume_broadcast_oneshot(struct clock_event_device *bc); | ||
28 | # else /* BROADCAST */ | 29 | # else /* BROADCAST */ |
29 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | 30 | static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) |
30 | { | 31 | { |
@@ -43,6 +44,10 @@ void tick_setup_oneshot(struct clock_event_device *newdev, | |||
43 | { | 44 | { |
44 | BUG(); | 45 | BUG(); |
45 | } | 46 | } |
47 | static inline void tick_resume_oneshot(void) | ||
48 | { | ||
49 | BUG(); | ||
50 | } | ||
46 | static inline int tick_program_event(ktime_t expires, int force) | 51 | static inline int tick_program_event(ktime_t expires, int force) |
47 | { | 52 | { |
48 | return 0; | 53 | return 0; |
@@ -54,6 +59,10 @@ static inline void tick_broadcast_setup_oneshot(struct clock_event_device *bc) | |||
54 | } | 59 | } |
55 | static inline void tick_broadcast_oneshot_control(unsigned long reason) { } | 60 | static inline void tick_broadcast_oneshot_control(unsigned long reason) { } |
56 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } | 61 | static inline void tick_shutdown_broadcast_oneshot(unsigned int *cpup) { } |
62 | static inline int tick_resume_broadcast_oneshot(struct clock_event_device *bc) | ||
63 | { | ||
64 | return 0; | ||
65 | } | ||
57 | #endif /* !TICK_ONESHOT */ | 66 | #endif /* !TICK_ONESHOT */ |
58 | 67 | ||
59 | /* | 68 | /* |
diff --git a/kernel/time/tick-oneshot.c b/kernel/time/tick-oneshot.c index 2e8b7ff863cc..f6997ab0c3c9 100644 --- a/kernel/time/tick-oneshot.c +++ b/kernel/time/tick-oneshot.c | |||
@@ -41,6 +41,18 @@ int tick_program_event(ktime_t expires, int force) | |||
41 | } | 41 | } |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * tick_resume_onshot - resume oneshot mode | ||
45 | */ | ||
46 | void tick_resume_oneshot(void) | ||
47 | { | ||
48 | struct tick_device *td = &__get_cpu_var(tick_cpu_device); | ||
49 | struct clock_event_device *dev = td->evtdev; | ||
50 | |||
51 | clockevents_set_mode(dev, CLOCK_EVT_MODE_ONESHOT); | ||
52 | tick_program_event(ktime_get(), 1); | ||
53 | } | ||
54 | |||
55 | /** | ||
44 | * tick_setup_oneshot - setup the event device for oneshot mode (hres or nohz) | 56 | * tick_setup_oneshot - setup the event device for oneshot mode (hres or nohz) |
45 | */ | 57 | */ |
46 | void tick_setup_oneshot(struct clock_event_device *newdev, | 58 | void tick_setup_oneshot(struct clock_event_device *newdev, |
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index f50a2811f9dc..e5de3781d3fe 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -55,6 +55,22 @@ long congestion_wait(int rw, long timeout) | |||
55 | } | 55 | } |
56 | EXPORT_SYMBOL(congestion_wait); | 56 | EXPORT_SYMBOL(congestion_wait); |
57 | 57 | ||
58 | long congestion_wait_interruptible(int rw, long timeout) | ||
59 | { | ||
60 | long ret; | ||
61 | DEFINE_WAIT(wait); | ||
62 | wait_queue_head_t *wqh = &congestion_wqh[rw]; | ||
63 | |||
64 | prepare_to_wait(wqh, &wait, TASK_INTERRUPTIBLE); | ||
65 | if (signal_pending(current)) | ||
66 | ret = -ERESTARTSYS; | ||
67 | else | ||
68 | ret = io_schedule_timeout(timeout); | ||
69 | finish_wait(wqh, &wait); | ||
70 | return ret; | ||
71 | } | ||
72 | EXPORT_SYMBOL(congestion_wait_interruptible); | ||
73 | |||
58 | /** | 74 | /** |
59 | * congestion_end - wake up sleepers on a congested backing_dev_info | 75 | * congestion_end - wake up sleepers on a congested backing_dev_info |
60 | * @rw: READ or WRITE | 76 | * @rw: READ or WRITE |
diff --git a/mm/filemap.c b/mm/filemap.c index d1060b8d3cd6..5dfc093ceb3d 100644 --- a/mm/filemap.c +++ b/mm/filemap.c | |||
@@ -2379,7 +2379,8 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
2379 | struct file *file = iocb->ki_filp; | 2379 | struct file *file = iocb->ki_filp; |
2380 | struct address_space *mapping = file->f_mapping; | 2380 | struct address_space *mapping = file->f_mapping; |
2381 | ssize_t retval; | 2381 | ssize_t retval; |
2382 | size_t write_len = 0; | 2382 | size_t write_len; |
2383 | pgoff_t end = 0; /* silence gcc */ | ||
2383 | 2384 | ||
2384 | /* | 2385 | /* |
2385 | * If it's a write, unmap all mmappings of the file up-front. This | 2386 | * If it's a write, unmap all mmappings of the file up-front. This |
@@ -2388,23 +2389,46 @@ generic_file_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov, | |||
2388 | */ | 2389 | */ |
2389 | if (rw == WRITE) { | 2390 | if (rw == WRITE) { |
2390 | write_len = iov_length(iov, nr_segs); | 2391 | write_len = iov_length(iov, nr_segs); |
2392 | end = (offset + write_len - 1) >> PAGE_CACHE_SHIFT; | ||
2391 | if (mapping_mapped(mapping)) | 2393 | if (mapping_mapped(mapping)) |
2392 | unmap_mapping_range(mapping, offset, write_len, 0); | 2394 | unmap_mapping_range(mapping, offset, write_len, 0); |
2393 | } | 2395 | } |
2394 | 2396 | ||
2395 | retval = filemap_write_and_wait(mapping); | 2397 | retval = filemap_write_and_wait(mapping); |
2396 | if (retval == 0) { | 2398 | if (retval) |
2397 | retval = mapping->a_ops->direct_IO(rw, iocb, iov, | 2399 | goto out; |
2398 | offset, nr_segs); | 2400 | |
2399 | if (rw == WRITE && mapping->nrpages) { | 2401 | /* |
2400 | pgoff_t end = (offset + write_len - 1) | 2402 | * After a write we want buffered reads to be sure to go to disk to get |
2401 | >> PAGE_CACHE_SHIFT; | 2403 | * the new data. We invalidate clean cached page from the region we're |
2402 | int err = invalidate_inode_pages2_range(mapping, | 2404 | * about to write. We do this *before* the write so that we can return |
2405 | * -EIO without clobbering -EIOCBQUEUED from ->direct_IO(). | ||
2406 | */ | ||
2407 | if (rw == WRITE && mapping->nrpages) { | ||
2408 | retval = invalidate_inode_pages2_range(mapping, | ||
2403 | offset >> PAGE_CACHE_SHIFT, end); | 2409 | offset >> PAGE_CACHE_SHIFT, end); |
2404 | if (err) | 2410 | if (retval) |
2405 | retval = err; | 2411 | goto out; |
2406 | } | ||
2407 | } | 2412 | } |
2413 | |||
2414 | retval = mapping->a_ops->direct_IO(rw, iocb, iov, offset, nr_segs); | ||
2415 | if (retval) | ||
2416 | goto out; | ||
2417 | |||
2418 | /* | ||
2419 | * Finally, try again to invalidate clean pages which might have been | ||
2420 | * faulted in by get_user_pages() if the source of the write was an | ||
2421 | * mmap()ed region of the file we're writing. That's a pretty crazy | ||
2422 | * thing to do, so we don't support it 100%. If this invalidation | ||
2423 | * fails and we have -EIOCBQUEUED we ignore the failure. | ||
2424 | */ | ||
2425 | if (rw == WRITE && mapping->nrpages) { | ||
2426 | int err = invalidate_inode_pages2_range(mapping, | ||
2427 | offset >> PAGE_CACHE_SHIFT, end); | ||
2428 | if (err && retval >= 0) | ||
2429 | retval = err; | ||
2430 | } | ||
2431 | out: | ||
2408 | return retval; | 2432 | return retval; |
2409 | } | 2433 | } |
2410 | 2434 | ||
diff --git a/mm/madvise.c b/mm/madvise.c index 4e196155a0c3..77916e9fc52b 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -155,11 +155,14 @@ static long madvise_dontneed(struct vm_area_struct * vma, | |||
155 | * Other filesystems return -ENOSYS. | 155 | * Other filesystems return -ENOSYS. |
156 | */ | 156 | */ |
157 | static long madvise_remove(struct vm_area_struct *vma, | 157 | static long madvise_remove(struct vm_area_struct *vma, |
158 | struct vm_area_struct **prev, | ||
158 | unsigned long start, unsigned long end) | 159 | unsigned long start, unsigned long end) |
159 | { | 160 | { |
160 | struct address_space *mapping; | 161 | struct address_space *mapping; |
161 | loff_t offset, endoff; | 162 | loff_t offset, endoff; |
162 | 163 | ||
164 | *prev = vma; | ||
165 | |||
163 | if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) | 166 | if (vma->vm_flags & (VM_LOCKED|VM_NONLINEAR|VM_HUGETLB)) |
164 | return -EINVAL; | 167 | return -EINVAL; |
165 | 168 | ||
@@ -199,7 +202,7 @@ madvise_vma(struct vm_area_struct *vma, struct vm_area_struct **prev, | |||
199 | error = madvise_behavior(vma, prev, start, end, behavior); | 202 | error = madvise_behavior(vma, prev, start, end, behavior); |
200 | break; | 203 | break; |
201 | case MADV_REMOVE: | 204 | case MADV_REMOVE: |
202 | error = madvise_remove(vma, start, end); | 205 | error = madvise_remove(vma, prev, start, end); |
203 | break; | 206 | break; |
204 | 207 | ||
205 | case MADV_WILLNEED: | 208 | case MADV_WILLNEED: |
diff --git a/mm/oom_kill.c b/mm/oom_kill.c index b278b8d60eee..2f3916986abf 100644 --- a/mm/oom_kill.c +++ b/mm/oom_kill.c | |||
@@ -320,7 +320,7 @@ static int oom_kill_task(struct task_struct *p) | |||
320 | * Don't kill the process if any threads are set to OOM_DISABLE | 320 | * Don't kill the process if any threads are set to OOM_DISABLE |
321 | */ | 321 | */ |
322 | do_each_thread(g, q) { | 322 | do_each_thread(g, q) { |
323 | if (q->mm == mm && p->oomkilladj == OOM_DISABLE) | 323 | if (q->mm == mm && q->oomkilladj == OOM_DISABLE) |
324 | return 1; | 324 | return 1; |
325 | } while_each_thread(g, q); | 325 | } while_each_thread(g, q); |
326 | 326 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 820761f9eeef..702fa8f08747 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -463,6 +463,7 @@ struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t gfp_mask) | |||
463 | memcpy(n->cb, skb->cb, sizeof(skb->cb)); | 463 | memcpy(n->cb, skb->cb, sizeof(skb->cb)); |
464 | C(len); | 464 | C(len); |
465 | C(data_len); | 465 | C(data_len); |
466 | C(mac_len); | ||
466 | C(csum); | 467 | C(csum); |
467 | C(local_df); | 468 | C(local_df); |
468 | n->cloned = 1; | 469 | n->cloned = 1; |
diff --git a/net/ipv4/cipso_ipv4.c b/net/ipv4/cipso_ipv4.c index c976dd7e9758..2ce5b693a8bd 100644 --- a/net/ipv4/cipso_ipv4.c +++ b/net/ipv4/cipso_ipv4.c | |||
@@ -1933,6 +1933,11 @@ int cipso_v4_skbuff_getattr(const struct sk_buff *skb, | |||
1933 | &cipso_ptr[6], | 1933 | &cipso_ptr[6], |
1934 | secattr); | 1934 | secattr); |
1935 | break; | 1935 | break; |
1936 | case CIPSO_V4_TAG_RANGE: | ||
1937 | ret_val = cipso_v4_parsetag_rng(doi_def, | ||
1938 | &cipso_ptr[6], | ||
1939 | secattr); | ||
1940 | break; | ||
1936 | } | 1941 | } |
1937 | 1942 | ||
1938 | skbuff_getattr_return: | 1943 | skbuff_getattr_return: |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index 72b3036bbc09..ada9b3db507d 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -1527,7 +1527,6 @@ static int trie_leaf_remove(struct trie *t, t_key key) | |||
1527 | t->revision++; | 1527 | t->revision++; |
1528 | t->size--; | 1528 | t->size--; |
1529 | 1529 | ||
1530 | preempt_disable(); | ||
1531 | tp = NODE_PARENT(n); | 1530 | tp = NODE_PARENT(n); |
1532 | tnode_free((struct tnode *) n); | 1531 | tnode_free((struct tnode *) n); |
1533 | 1532 | ||
@@ -1537,7 +1536,6 @@ static int trie_leaf_remove(struct trie *t, t_key key) | |||
1537 | rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); | 1536 | rcu_assign_pointer(t->trie, trie_rebalance(t, tp)); |
1538 | } else | 1537 | } else |
1539 | rcu_assign_pointer(t->trie, NULL); | 1538 | rcu_assign_pointer(t->trie, NULL); |
1540 | preempt_enable(); | ||
1541 | 1539 | ||
1542 | return 1; | 1540 | return 1; |
1543 | } | 1541 | } |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 1c6a084b5fb7..8cedb2a2c9df 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1255,9 +1255,9 @@ out: | |||
1255 | */ | 1255 | */ |
1256 | void ip_mc_rejoin_group(struct ip_mc_list *im) | 1256 | void ip_mc_rejoin_group(struct ip_mc_list *im) |
1257 | { | 1257 | { |
1258 | #ifdef CONFIG_IP_MULTICAST | ||
1258 | struct in_device *in_dev = im->interface; | 1259 | struct in_device *in_dev = im->interface; |
1259 | 1260 | ||
1260 | #ifdef CONFIG_IP_MULTICAST | ||
1261 | if (im->multiaddr == IGMP_ALL_HOSTS) | 1261 | if (im->multiaddr == IGMP_ALL_HOSTS) |
1262 | return; | 1262 | return; |
1263 | 1263 | ||
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 74c4d103ebc2..3834b10b5115 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -2458,11 +2458,18 @@ void __init tcp_init(void) | |||
2458 | sysctl_max_syn_backlog = 128; | 2458 | sysctl_max_syn_backlog = 128; |
2459 | } | 2459 | } |
2460 | 2460 | ||
2461 | /* Allow no more than 3/4 kernel memory (usually less) allocated to TCP */ | 2461 | /* Set the pressure threshold to be a fraction of global memory that |
2462 | sysctl_tcp_mem[0] = (1536 / sizeof (struct inet_bind_hashbucket)) << order; | 2462 | * is up to 1/2 at 256 MB, decreasing toward zero with the amount of |
2463 | sysctl_tcp_mem[1] = sysctl_tcp_mem[0] * 4 / 3; | 2463 | * memory, with a floor of 128 pages. |
2464 | */ | ||
2465 | limit = min(nr_all_pages, 1UL<<(28-PAGE_SHIFT)) >> (20-PAGE_SHIFT); | ||
2466 | limit = (limit * (nr_all_pages >> (20-PAGE_SHIFT))) >> (PAGE_SHIFT-11); | ||
2467 | limit = max(limit, 128UL); | ||
2468 | sysctl_tcp_mem[0] = limit / 4 * 3; | ||
2469 | sysctl_tcp_mem[1] = limit; | ||
2464 | sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; | 2470 | sysctl_tcp_mem[2] = sysctl_tcp_mem[0] * 2; |
2465 | 2471 | ||
2472 | /* Set per-socket limits to no more than 1/128 the pressure threshold */ | ||
2466 | limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); | 2473 | limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7); |
2467 | max_share = min(4UL*1024*1024, limit); | 2474 | max_share = min(4UL*1024*1024, limit); |
2468 | 2475 | ||
diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index f57a9baa6b27..92f99927d12d 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c | |||
@@ -1453,6 +1453,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb, | |||
1453 | First: no IPv4 options. | 1453 | First: no IPv4 options. |
1454 | */ | 1454 | */ |
1455 | newinet->opt = NULL; | 1455 | newinet->opt = NULL; |
1456 | newnp->ipv6_fl_list = NULL; | ||
1456 | 1457 | ||
1457 | /* Clone RX bits */ | 1458 | /* Clone RX bits */ |
1458 | newnp->rxopt.all = np->rxopt.all; | 1459 | newnp->rxopt.all = np->rxopt.all; |
diff --git a/net/rose/af_rose.c b/net/rose/af_rose.c index 8c34f1ca6c8c..f92d5310847b 100644 --- a/net/rose/af_rose.c +++ b/net/rose/af_rose.c | |||
@@ -700,23 +700,7 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
700 | unsigned char cause, diagnostic; | 700 | unsigned char cause, diagnostic; |
701 | struct net_device *dev; | 701 | struct net_device *dev; |
702 | ax25_uid_assoc *user; | 702 | ax25_uid_assoc *user; |
703 | int n; | 703 | int n, err = 0; |
704 | |||
705 | if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { | ||
706 | sock->state = SS_CONNECTED; | ||
707 | return 0; /* Connect completed during a ERESTARTSYS event */ | ||
708 | } | ||
709 | |||
710 | if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) { | ||
711 | sock->state = SS_UNCONNECTED; | ||
712 | return -ECONNREFUSED; | ||
713 | } | ||
714 | |||
715 | if (sk->sk_state == TCP_ESTABLISHED) | ||
716 | return -EISCONN; /* No reconnect on a seqpacket socket */ | ||
717 | |||
718 | sk->sk_state = TCP_CLOSE; | ||
719 | sock->state = SS_UNCONNECTED; | ||
720 | 704 | ||
721 | if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose)) | 705 | if (addr_len != sizeof(struct sockaddr_rose) && addr_len != sizeof(struct full_sockaddr_rose)) |
722 | return -EINVAL; | 706 | return -EINVAL; |
@@ -734,24 +718,53 @@ static int rose_connect(struct socket *sock, struct sockaddr *uaddr, int addr_le | |||
734 | if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS) | 718 | if ((rose->source_ndigis + addr->srose_ndigis) > ROSE_MAX_DIGIS) |
735 | return -EINVAL; | 719 | return -EINVAL; |
736 | 720 | ||
721 | lock_sock(sk); | ||
722 | |||
723 | if (sk->sk_state == TCP_ESTABLISHED && sock->state == SS_CONNECTING) { | ||
724 | /* Connect completed during a ERESTARTSYS event */ | ||
725 | sock->state = SS_CONNECTED; | ||
726 | goto out_release; | ||
727 | } | ||
728 | |||
729 | if (sk->sk_state == TCP_CLOSE && sock->state == SS_CONNECTING) { | ||
730 | sock->state = SS_UNCONNECTED; | ||
731 | err = -ECONNREFUSED; | ||
732 | goto out_release; | ||
733 | } | ||
734 | |||
735 | if (sk->sk_state == TCP_ESTABLISHED) { | ||
736 | /* No reconnect on a seqpacket socket */ | ||
737 | err = -EISCONN; | ||
738 | goto out_release; | ||
739 | } | ||
740 | |||
741 | sk->sk_state = TCP_CLOSE; | ||
742 | sock->state = SS_UNCONNECTED; | ||
743 | |||
737 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, | 744 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, |
738 | &diagnostic); | 745 | &diagnostic); |
739 | if (!rose->neighbour) | 746 | if (!rose->neighbour) |
740 | return -ENETUNREACH; | 747 | return -ENETUNREACH; |
741 | 748 | ||
742 | rose->lci = rose_new_lci(rose->neighbour); | 749 | rose->lci = rose_new_lci(rose->neighbour); |
743 | if (!rose->lci) | 750 | if (!rose->lci) { |
744 | return -ENETUNREACH; | 751 | err = -ENETUNREACH; |
752 | goto out_release; | ||
753 | } | ||
745 | 754 | ||
746 | if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */ | 755 | if (sock_flag(sk, SOCK_ZAPPED)) { /* Must bind first - autobinding in this may or may not work */ |
747 | sock_reset_flag(sk, SOCK_ZAPPED); | 756 | sock_reset_flag(sk, SOCK_ZAPPED); |
748 | 757 | ||
749 | if ((dev = rose_dev_first()) == NULL) | 758 | if ((dev = rose_dev_first()) == NULL) { |
750 | return -ENETUNREACH; | 759 | err = -ENETUNREACH; |
760 | goto out_release; | ||
761 | } | ||
751 | 762 | ||
752 | user = ax25_findbyuid(current->euid); | 763 | user = ax25_findbyuid(current->euid); |
753 | if (!user) | 764 | if (!user) { |
754 | return -EINVAL; | 765 | err = -EINVAL; |
766 | goto out_release; | ||
767 | } | ||
755 | 768 | ||
756 | memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); | 769 | memcpy(&rose->source_addr, dev->dev_addr, ROSE_ADDR_LEN); |
757 | rose->source_call = user->call; | 770 | rose->source_call = user->call; |
@@ -789,8 +802,10 @@ rose_try_next_neigh: | |||
789 | rose_start_t1timer(sk); | 802 | rose_start_t1timer(sk); |
790 | 803 | ||
791 | /* Now the loop */ | 804 | /* Now the loop */ |
792 | if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) | 805 | if (sk->sk_state != TCP_ESTABLISHED && (flags & O_NONBLOCK)) { |
793 | return -EINPROGRESS; | 806 | err = -EINPROGRESS; |
807 | goto out_release; | ||
808 | } | ||
794 | 809 | ||
795 | /* | 810 | /* |
796 | * A Connect Ack with Choke or timeout or failed routing will go to | 811 | * A Connect Ack with Choke or timeout or failed routing will go to |
@@ -805,8 +820,10 @@ rose_try_next_neigh: | |||
805 | set_current_state(TASK_INTERRUPTIBLE); | 820 | set_current_state(TASK_INTERRUPTIBLE); |
806 | if (sk->sk_state != TCP_SYN_SENT) | 821 | if (sk->sk_state != TCP_SYN_SENT) |
807 | break; | 822 | break; |
823 | release_sock(sk); | ||
808 | if (!signal_pending(tsk)) { | 824 | if (!signal_pending(tsk)) { |
809 | schedule(); | 825 | schedule(); |
826 | lock_sock(sk); | ||
810 | continue; | 827 | continue; |
811 | } | 828 | } |
812 | current->state = TASK_RUNNING; | 829 | current->state = TASK_RUNNING; |
@@ -822,14 +839,19 @@ rose_try_next_neigh: | |||
822 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic); | 839 | rose->neighbour = rose_get_neigh(&addr->srose_addr, &cause, &diagnostic); |
823 | if (rose->neighbour) | 840 | if (rose->neighbour) |
824 | goto rose_try_next_neigh; | 841 | goto rose_try_next_neigh; |
825 | /* No more neighbour */ | 842 | |
843 | /* No more neighbours */ | ||
826 | sock->state = SS_UNCONNECTED; | 844 | sock->state = SS_UNCONNECTED; |
827 | return sock_error(sk); /* Always set at this point */ | 845 | err = sock_error(sk); /* Always set at this point */ |
846 | goto out_release; | ||
828 | } | 847 | } |
829 | 848 | ||
830 | sock->state = SS_CONNECTED; | 849 | sock->state = SS_CONNECTED; |
831 | 850 | ||
832 | return 0; | 851 | out_release: |
852 | release_sock(sk); | ||
853 | |||
854 | return err; | ||
833 | } | 855 | } |
834 | 856 | ||
835 | static int rose_accept(struct socket *sock, struct socket *newsock, int flags) | 857 | static int rose_accept(struct socket *sock, struct socket *newsock, int flags) |
@@ -877,6 +899,8 @@ static int rose_accept(struct socket *sock, struct socket *newsock, int flags) | |||
877 | lock_sock(sk); | 899 | lock_sock(sk); |
878 | continue; | 900 | continue; |
879 | } | 901 | } |
902 | current->state = TASK_RUNNING; | ||
903 | remove_wait_queue(sk->sk_sleep, &wait); | ||
880 | return -ERESTARTSYS; | 904 | return -ERESTARTSYS; |
881 | } | 905 | } |
882 | current->state = TASK_RUNNING; | 906 | current->state = TASK_RUNNING; |
diff --git a/net/wanrouter/af_wanpipe.c b/net/wanrouter/af_wanpipe.c deleted file mode 100644 index 41d7e32be70d..000000000000 --- a/net/wanrouter/af_wanpipe.c +++ /dev/null | |||
@@ -1,2600 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * af_wanpipe.c WANPIPE(tm) Secure Socket Layer. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Due Credit: | ||
14 | * Wanpipe socket layer is based on Packet and | ||
15 | * the X25 socket layers. The above sockets were | ||
16 | * used for the specific use of Sangoma Technologies | ||
17 | * API programs. | ||
18 | * Packet socket Authors: Ross Biro, Fred N. van Kempen and | ||
19 | * Alan Cox. | ||
20 | * X25 socket Author: Jonathan Naylor. | ||
21 | * ============================================================================ | ||
22 | * Mar 15, 2002 Arnaldo C. Melo o Use wp_sk()->num, as it isnt anymore in sock | ||
23 | * Apr 25, 2000 Nenad Corbic o Added the ability to send zero length packets. | ||
24 | * Mar 13, 2000 Nenad Corbic o Added a tx buffer check via ioctl call. | ||
25 | * Mar 06, 2000 Nenad Corbic o Fixed the corrupt sock lcn problem. | ||
26 | * Server and client application can run | ||
27 | * simultaneously without conflicts. | ||
28 | * Feb 29, 2000 Nenad Corbic o Added support for PVC protocols, such as | ||
29 | * CHDLC, Frame Relay and HDLC API. | ||
30 | * Jan 17, 2000 Nenad Corbic o Initial version, based on AF_PACKET socket. | ||
31 | * X25API support only. | ||
32 | * | ||
33 | ******************************************************************************/ | ||
34 | |||
35 | #include <linux/types.h> | ||
36 | #include <linux/sched.h> | ||
37 | #include <linux/mm.h> | ||
38 | #include <linux/capability.h> | ||
39 | #include <linux/fcntl.h> | ||
40 | #include <linux/socket.h> | ||
41 | #include <linux/in.h> | ||
42 | #include <linux/inet.h> | ||
43 | #include <linux/netdevice.h> | ||
44 | #include <linux/poll.h> | ||
45 | #include <linux/wireless.h> | ||
46 | #include <linux/kmod.h> | ||
47 | #include <net/ip.h> | ||
48 | #include <net/protocol.h> | ||
49 | #include <linux/skbuff.h> | ||
50 | #include <net/sock.h> | ||
51 | #include <linux/errno.h> | ||
52 | #include <linux/timer.h> | ||
53 | #include <asm/system.h> | ||
54 | #include <asm/uaccess.h> | ||
55 | #include <linux/module.h> | ||
56 | #include <linux/init.h> | ||
57 | #include <linux/if_wanpipe.h> | ||
58 | #include <linux/pkt_sched.h> | ||
59 | #include <linux/tcp_states.h> | ||
60 | #include <linux/if_wanpipe_common.h> | ||
61 | |||
62 | #ifdef CONFIG_INET | ||
63 | #include <net/inet_common.h> | ||
64 | #endif | ||
65 | |||
66 | #define SLOW_BACKOFF 0.1*HZ | ||
67 | #define FAST_BACKOFF 0.01*HZ | ||
68 | |||
69 | //#define PRINT_DEBUG | ||
70 | #ifdef PRINT_DEBUG | ||
71 | #define DBG_PRINTK(format, a...) printk(format, ## a) | ||
72 | #else | ||
73 | #define DBG_PRINTK(format, a...) | ||
74 | #endif | ||
75 | |||
76 | |||
77 | /* SECURE SOCKET IMPLEMENTATION | ||
78 | * | ||
79 | * TRANSMIT: | ||
80 | * | ||
81 | * When the user sends a packet via send() system call | ||
82 | * the wanpipe_sendmsg() function is executed. | ||
83 | * | ||
84 | * Each packet is enqueud into sk->sk_write_queue transmit | ||
85 | * queue. When the packet is enqueued, a delayed transmit | ||
86 | * timer is triggerd which acts as a Bottom Half hander. | ||
87 | * | ||
88 | * wanpipe_delay_transmit() function (BH), dequeues packets | ||
89 | * from the sk->sk_write_queue transmit queue and sends it | ||
90 | * to the deriver via dev->hard_start_xmit(skb, dev) function. | ||
91 | * Note, this function is actual a function pointer of if_send() | ||
92 | * routine in the wanpipe driver. | ||
93 | * | ||
94 | * X25API GUARANTEED DELIVERY: | ||
95 | * | ||
96 | * In order to provide 100% guaranteed packet delivery, | ||
97 | * an atomic 'packet_sent' counter is implemented. Counter | ||
98 | * is incremented for each packet enqueued | ||
99 | * into sk->sk_write_queue. Counter is decremented each | ||
100 | * time wanpipe_delayed_transmit() function successfuly | ||
101 | * passes the packet to the driver. Before each send(), a poll | ||
102 | * routine checks the sock resources The maximum value of | ||
103 | * packet sent counter is 1, thus if one packet is queued, the | ||
104 | * application will block until that packet is passed to the | ||
105 | * driver. | ||
106 | * | ||
107 | * RECEIVE: | ||
108 | * | ||
109 | * Wanpipe device drivers call the socket bottom half | ||
110 | * function, wanpipe_rcv() to queue the incoming packets | ||
111 | * into an AF_WANPIPE socket queue. Based on wanpipe_rcv() | ||
112 | * return code, the driver knows whether the packet was | ||
113 | * successfully queued. If the socket queue is full, | ||
114 | * protocol flow control is used by the driver, if any, | ||
115 | * to slow down the traffic until the sock queue is free. | ||
116 | * | ||
117 | * Every time a packet arrives into a socket queue the | ||
118 | * socket wakes up processes which are waiting to receive | ||
119 | * data. | ||
120 | * | ||
121 | * If the socket queue is full, the driver sets a block | ||
122 | * bit which signals the socket to kick the wanpipe driver | ||
123 | * bottom half hander when the socket queue is partialy | ||
124 | * empty. wanpipe_recvmsg() function performs this action. | ||
125 | * | ||
126 | * In case of x25api, packets will never be dropped, since | ||
127 | * flow control is available. | ||
128 | * | ||
129 | * In case of streaming protocols like CHDLC, packets will | ||
130 | * be dropped but the statistics will be generated. | ||
131 | */ | ||
132 | |||
133 | |||
134 | /* The code below is used to test memory leaks. It prints out | ||
135 | * a message every time kmalloc and kfree system calls get executed. | ||
136 | * If the calls match there is no leak :) | ||
137 | */ | ||
138 | |||
139 | /***********FOR DEBUGGING PURPOSES********************************************* | ||
140 | #define KMEM_SAFETYZONE 8 | ||
141 | |||
142 | static void * dbg_kmalloc(unsigned int size, int prio, int line) { | ||
143 | void * v = kmalloc(size,prio); | ||
144 | printk(KERN_INFO "line %d kmalloc(%d,%d) = %p\n",line,size,prio,v); | ||
145 | return v; | ||
146 | } | ||
147 | static void dbg_kfree(void * v, int line) { | ||
148 | printk(KERN_INFO "line %d kfree(%p)\n",line,v); | ||
149 | kfree(v); | ||
150 | } | ||
151 | |||
152 | #define kmalloc(x,y) dbg_kmalloc(x,y,__LINE__) | ||
153 | #define kfree(x) dbg_kfree(x,__LINE__) | ||
154 | ******************************************************************************/ | ||
155 | |||
156 | |||
157 | /* List of all wanpipe sockets. */ | ||
158 | HLIST_HEAD(wanpipe_sklist); | ||
159 | static DEFINE_RWLOCK(wanpipe_sklist_lock); | ||
160 | |||
161 | atomic_t wanpipe_socks_nr; | ||
162 | static unsigned long wanpipe_tx_critical; | ||
163 | |||
164 | #if 0 | ||
165 | /* Private wanpipe socket structures. */ | ||
166 | struct wanpipe_opt | ||
167 | { | ||
168 | void *mbox; /* Mail box */ | ||
169 | void *card; /* Card bouded to */ | ||
170 | struct net_device *dev; /* Bounded device */ | ||
171 | unsigned short lcn; /* Binded LCN */ | ||
172 | unsigned char svc; /* 0=pvc, 1=svc */ | ||
173 | unsigned char timer; /* flag for delayed transmit*/ | ||
174 | struct timer_list tx_timer; | ||
175 | unsigned poll_cnt; | ||
176 | unsigned char force; /* Used to force sock release */ | ||
177 | atomic_t packet_sent; | ||
178 | }; | ||
179 | #endif | ||
180 | |||
181 | static int sk_count; | ||
182 | extern const struct proto_ops wanpipe_ops; | ||
183 | static unsigned long find_free_critical; | ||
184 | |||
185 | static void wanpipe_unlink_driver(struct sock *sk); | ||
186 | static void wanpipe_link_driver(struct net_device *dev, struct sock *sk); | ||
187 | static void wanpipe_wakeup_driver(struct sock *sk); | ||
188 | static int execute_command(struct sock *, unsigned char, unsigned int); | ||
189 | static int check_dev(struct net_device *dev, sdla_t *card); | ||
190 | struct net_device *wanpipe_find_free_dev(sdla_t *card); | ||
191 | static void wanpipe_unlink_card (struct sock *); | ||
192 | static int wanpipe_link_card (struct sock *); | ||
193 | static struct sock *wanpipe_make_new(struct sock *); | ||
194 | static struct sock *wanpipe_alloc_socket(void); | ||
195 | static inline int get_atomic_device(struct net_device *dev); | ||
196 | static int wanpipe_exec_cmd(struct sock *, int, unsigned int); | ||
197 | static int get_ioctl_cmd (struct sock *, void *); | ||
198 | static int set_ioctl_cmd (struct sock *, void *); | ||
199 | static void release_device(struct net_device *dev); | ||
200 | static void wanpipe_kill_sock_timer (unsigned long data); | ||
201 | static void wanpipe_kill_sock_irq (struct sock *); | ||
202 | static void wanpipe_kill_sock_accept (struct sock *); | ||
203 | static int wanpipe_do_bind(struct sock *sk, struct net_device *dev, | ||
204 | int protocol); | ||
205 | struct sock * get_newsk_from_skb (struct sk_buff *); | ||
206 | static int wanpipe_debug (struct sock *, void *); | ||
207 | static void wanpipe_delayed_transmit (unsigned long data); | ||
208 | static void release_driver(struct sock *); | ||
209 | static void start_cleanup_timer (struct sock *); | ||
210 | static void check_write_queue(struct sock *); | ||
211 | static int check_driver_busy (struct sock *); | ||
212 | |||
213 | /*============================================================ | ||
214 | * wanpipe_rcv | ||
215 | * | ||
216 | * Wanpipe socket bottom half handler. This function | ||
217 | * is called by the WANPIPE device drivers to queue a | ||
218 | * incoming packet into the socket receive queue. | ||
219 | * Once the packet is queued, all processes waiting to | ||
220 | * read are woken up. | ||
221 | * | ||
222 | * During socket bind, this function is bounded into | ||
223 | * WANPIPE driver private. | ||
224 | *===========================================================*/ | ||
225 | |||
226 | static int wanpipe_rcv(struct sk_buff *skb, struct net_device *dev, | ||
227 | struct sock *sk) | ||
228 | { | ||
229 | struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)skb->cb; | ||
230 | wanpipe_common_t *chan = dev->priv; | ||
231 | /* | ||
232 | * When we registered the protocol we saved the socket in the data | ||
233 | * field for just this event. | ||
234 | */ | ||
235 | |||
236 | skb->dev = dev; | ||
237 | |||
238 | sll->sll_family = AF_WANPIPE; | ||
239 | sll->sll_hatype = dev->type; | ||
240 | sll->sll_protocol = skb->protocol; | ||
241 | sll->sll_pkttype = skb->pkt_type; | ||
242 | sll->sll_ifindex = dev->ifindex; | ||
243 | sll->sll_halen = 0; | ||
244 | |||
245 | if (dev->hard_header_parse) | ||
246 | sll->sll_halen = dev->hard_header_parse(skb, sll->sll_addr); | ||
247 | |||
248 | /* | ||
249 | * WAN_PACKET_DATA : Data which should be passed up the receive queue. | ||
250 | * WAN_PACKET_ASYC : Asynchronous data like place call, which should | ||
251 | * be passed up the listening sock. | ||
252 | * WAN_PACKET_ERR : Asynchronous data like clear call or restart | ||
253 | * which should go into an error queue. | ||
254 | */ | ||
255 | switch (skb->pkt_type){ | ||
256 | |||
257 | case WAN_PACKET_DATA: | ||
258 | if (sock_queue_rcv_skb(sk,skb)<0){ | ||
259 | return -ENOMEM; | ||
260 | } | ||
261 | break; | ||
262 | case WAN_PACKET_CMD: | ||
263 | sk->sk_state = chan->state; | ||
264 | /* Bug fix: update Mar6. | ||
265 | * Do not set the sock lcn number here, since | ||
266 | * cmd is not guaranteed to be executed on the | ||
267 | * board, thus Lcn could be wrong */ | ||
268 | sk->sk_data_ready(sk, skb->len); | ||
269 | kfree_skb(skb); | ||
270 | break; | ||
271 | case WAN_PACKET_ERR: | ||
272 | sk->sk_state = chan->state; | ||
273 | if (sock_queue_err_skb(sk,skb)<0){ | ||
274 | return -ENOMEM; | ||
275 | } | ||
276 | break; | ||
277 | default: | ||
278 | printk(KERN_INFO "wansock: BH Illegal Packet Type Dropping\n"); | ||
279 | kfree_skb(skb); | ||
280 | break; | ||
281 | } | ||
282 | |||
283 | //?????????????????????? | ||
284 | // if (sk->sk_state == WANSOCK_DISCONNECTED){ | ||
285 | // if (sk->sk_zapped) { | ||
286 | // //printk(KERN_INFO "wansock: Disconnected, killing early\n"); | ||
287 | // wanpipe_unlink_driver(sk); | ||
288 | // sk->sk_bound_dev_if = 0; | ||
289 | // } | ||
290 | // } | ||
291 | |||
292 | return 0; | ||
293 | } | ||
294 | |||
295 | /*============================================================ | ||
296 | * wanpipe_listen_rcv | ||
297 | * | ||
298 | * Wanpipe LISTEN socket bottom half handler. This function | ||
299 | * is called by the WANPIPE device drivers to queue an | ||
300 | * incoming call into the socket listening queue. | ||
301 | * Once the packet is queued, the waiting accept() process | ||
302 | * is woken up. | ||
303 | * | ||
304 | * During socket bind, this function is bounded into | ||
305 | * WANPIPE driver private. | ||
306 | * | ||
307 | * IMPORTANT NOTE: | ||
308 | * The accept call() is waiting for an skb packet | ||
309 | * which contains a pointer to a device structure. | ||
310 | * | ||
311 | * When we do a bind to a device structre, we | ||
312 | * bind a newly created socket into "chan->sk". Thus, | ||
313 | * when accept receives the skb packet, it will know | ||
314 | * from which dev it came form, and in turn it will know | ||
315 | * the address of the new sock. | ||
316 | * | ||
317 | * NOTE: This function gets called from driver ISR. | ||
318 | *===========================================================*/ | ||
319 | |||
320 | static int wanpipe_listen_rcv (struct sk_buff *skb, struct sock *sk) | ||
321 | { | ||
322 | wanpipe_opt *wp = wp_sk(sk), *newwp; | ||
323 | struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)skb->cb; | ||
324 | struct sock *newsk; | ||
325 | struct net_device *dev; | ||
326 | sdla_t *card; | ||
327 | mbox_cmd_t *mbox_ptr; | ||
328 | wanpipe_common_t *chan; | ||
329 | |||
330 | /* Find a free device, if none found, all svc's are busy | ||
331 | */ | ||
332 | |||
333 | card = (sdla_t*)wp->card; | ||
334 | if (!card){ | ||
335 | printk(KERN_INFO "wansock: LISTEN ERROR, No Card\n"); | ||
336 | return -ENODEV; | ||
337 | } | ||
338 | |||
339 | dev = wanpipe_find_free_dev(card); | ||
340 | if (!dev){ | ||
341 | printk(KERN_INFO "wansock: LISTEN ERROR, No Free Device\n"); | ||
342 | return -ENODEV; | ||
343 | } | ||
344 | |||
345 | chan=dev->priv; | ||
346 | chan->state = WANSOCK_CONNECTING; | ||
347 | |||
348 | /* Allocate a new sock, which accept will bind | ||
349 | * and pass up to the user | ||
350 | */ | ||
351 | if ((newsk = wanpipe_make_new(sk)) == NULL){ | ||
352 | release_device(dev); | ||
353 | return -ENOMEM; | ||
354 | } | ||
355 | |||
356 | |||
357 | /* Initialize the new sock structure | ||
358 | */ | ||
359 | newsk->sk_bound_dev_if = dev->ifindex; | ||
360 | newwp = wp_sk(newsk); | ||
361 | newwp->card = wp->card; | ||
362 | |||
363 | /* Insert the sock into the main wanpipe | ||
364 | * sock list. | ||
365 | */ | ||
366 | atomic_inc(&wanpipe_socks_nr); | ||
367 | |||
368 | /* Allocate and fill in the new Mail Box. Then | ||
369 | * bind the mail box to the sock. It will be | ||
370 | * used by the ioctl call to read call information | ||
371 | * and to execute commands. | ||
372 | */ | ||
373 | if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) { | ||
374 | wanpipe_kill_sock_irq (newsk); | ||
375 | release_device(dev); | ||
376 | return -ENOMEM; | ||
377 | } | ||
378 | memcpy(mbox_ptr,skb->data,skb->len); | ||
379 | |||
380 | /* Register the lcn on which incoming call came | ||
381 | * from. Thus, if we have to clear it, we know | ||
382 | * which lcn to clear | ||
383 | */ | ||
384 | |||
385 | newwp->lcn = mbox_ptr->cmd.lcn; | ||
386 | newwp->mbox = (void *)mbox_ptr; | ||
387 | |||
388 | DBG_PRINTK(KERN_INFO "NEWSOCK : Device %s, bind to lcn %i\n", | ||
389 | dev->name,mbox_ptr->cmd.lcn); | ||
390 | |||
391 | chan->lcn = mbox_ptr->cmd.lcn; | ||
392 | card->u.x.svc_to_dev_map[(chan->lcn%MAX_X25_LCN)] = dev; | ||
393 | |||
394 | sock_reset_flag(newsk, SOCK_ZAPPED); | ||
395 | newwp->num = htons(X25_PROT); | ||
396 | |||
397 | if (wanpipe_do_bind(newsk, dev, newwp->num)) { | ||
398 | wanpipe_kill_sock_irq (newsk); | ||
399 | release_device(dev); | ||
400 | return -EINVAL; | ||
401 | } | ||
402 | newsk->sk_state = WANSOCK_CONNECTING; | ||
403 | |||
404 | |||
405 | /* Fill in the standard sock address info */ | ||
406 | |||
407 | sll->sll_family = AF_WANPIPE; | ||
408 | sll->sll_hatype = dev->type; | ||
409 | sll->sll_protocol = skb->protocol; | ||
410 | sll->sll_pkttype = skb->pkt_type; | ||
411 | sll->sll_ifindex = dev->ifindex; | ||
412 | sll->sll_halen = 0; | ||
413 | |||
414 | skb->dev = dev; | ||
415 | sk->sk_ack_backlog++; | ||
416 | |||
417 | /* We must do this manually, since the sock_queue_rcv_skb() | ||
418 | * function sets the skb->dev to NULL. However, we use | ||
419 | * the dev field in the accept function.*/ | ||
420 | if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >= | ||
421 | (unsigned)sk->sk_rcvbuf) { | ||
422 | |||
423 | wanpipe_unlink_driver(newsk); | ||
424 | wanpipe_kill_sock_irq (newsk); | ||
425 | --sk->sk_ack_backlog; | ||
426 | return -ENOMEM; | ||
427 | } | ||
428 | |||
429 | skb_set_owner_r(skb, sk); | ||
430 | skb_queue_tail(&sk->sk_receive_queue, skb); | ||
431 | sk->sk_data_ready(sk, skb->len); | ||
432 | |||
433 | return 0; | ||
434 | } | ||
435 | |||
436 | |||
437 | |||
438 | /*============================================================ | ||
439 | * wanpipe_make_new | ||
440 | * | ||
441 | * Create a new sock, and allocate a wanpipe private | ||
442 | * structure to it. Also, copy the important data | ||
443 | * from the original sock to the new sock. | ||
444 | * | ||
445 | * This function is used by wanpipe_listen_rcv() listen | ||
446 | * bottom half handler. A copy of the listening sock | ||
447 | * is created using this function. | ||
448 | * | ||
449 | *===========================================================*/ | ||
450 | |||
451 | static struct sock *wanpipe_make_new(struct sock *osk) | ||
452 | { | ||
453 | struct sock *sk; | ||
454 | |||
455 | if (osk->sk_type != SOCK_RAW) | ||
456 | return NULL; | ||
457 | |||
458 | if ((sk = wanpipe_alloc_socket()) == NULL) | ||
459 | return NULL; | ||
460 | |||
461 | sk->sk_type = osk->sk_type; | ||
462 | sk->sk_socket = osk->sk_socket; | ||
463 | sk->sk_priority = osk->sk_priority; | ||
464 | sk->sk_protocol = osk->sk_protocol; | ||
465 | wp_sk(sk)->num = wp_sk(osk)->num; | ||
466 | sk->sk_rcvbuf = osk->sk_rcvbuf; | ||
467 | sk->sk_sndbuf = osk->sk_sndbuf; | ||
468 | sk->sk_state = WANSOCK_CONNECTING; | ||
469 | sk->sk_sleep = osk->sk_sleep; | ||
470 | |||
471 | if (sock_flag(osk, SOCK_DBG)) | ||
472 | sock_set_flag(sk, SOCK_DBG); | ||
473 | |||
474 | return sk; | ||
475 | } | ||
476 | |||
477 | /* | ||
478 | * FIXME: wanpipe_opt has to include a sock in its definition and stop using | ||
479 | * sk_protinfo, but this code is not even compilable now, so lets leave it for | ||
480 | * later. | ||
481 | */ | ||
482 | static struct proto wanpipe_proto = { | ||
483 | .name = "WANPIPE", | ||
484 | .owner = THIS_MODULE, | ||
485 | .obj_size = sizeof(struct sock), | ||
486 | }; | ||
487 | |||
488 | /*============================================================ | ||
489 | * wanpipe_make_new | ||
490 | * | ||
491 | * Allocate memory for the a new sock, and sock | ||
492 | * private data. | ||
493 | * | ||
494 | * Increment the module use count. | ||
495 | * | ||
496 | * This function is used by wanpipe_create() and | ||
497 | * wanpipe_make_new() functions. | ||
498 | * | ||
499 | *===========================================================*/ | ||
500 | |||
501 | static struct sock *wanpipe_alloc_socket(void) | ||
502 | { | ||
503 | struct sock *sk; | ||
504 | struct wanpipe_opt *wan_opt; | ||
505 | |||
506 | if ((sk = sk_alloc(PF_WANPIPE, GFP_ATOMIC, &wanpipe_proto, 1)) == NULL) | ||
507 | return NULL; | ||
508 | |||
509 | if ((wan_opt = kzalloc(sizeof(struct wanpipe_opt), GFP_ATOMIC)) == NULL) { | ||
510 | sk_free(sk); | ||
511 | return NULL; | ||
512 | } | ||
513 | |||
514 | wp_sk(sk) = wan_opt; | ||
515 | |||
516 | /* Use timer to send data to the driver. This will act | ||
517 | * as a BH handler for sendmsg functions */ | ||
518 | init_timer(&wan_opt->tx_timer); | ||
519 | wan_opt->tx_timer.data = (unsigned long)sk; | ||
520 | wan_opt->tx_timer.function = wanpipe_delayed_transmit; | ||
521 | |||
522 | sock_init_data(NULL, sk); | ||
523 | return sk; | ||
524 | } | ||
525 | |||
526 | |||
527 | /*============================================================ | ||
528 | * wanpipe_sendmsg | ||
529 | * | ||
530 | * This function implements a sendto() system call, | ||
531 | * for AF_WANPIPE socket family. | ||
532 | * During socket bind() sk->sk_bound_dev_if is initialized | ||
533 | * to a correct network device. This number is used | ||
534 | * to find a network device to which the packet should | ||
535 | * be passed to. | ||
536 | * | ||
537 | * Each packet is queued into sk->sk_write_queue and | ||
538 | * delayed transmit bottom half handler is marked for | ||
539 | * execution. | ||
540 | * | ||
541 | * A socket must be in WANSOCK_CONNECTED state before | ||
542 | * a packet is queued into sk->sk_write_queue. | ||
543 | *===========================================================*/ | ||
544 | |||
545 | static int wanpipe_sendmsg(struct kiocb *iocb, struct socket *sock, | ||
546 | struct msghdr *msg, int len) | ||
547 | { | ||
548 | wanpipe_opt *wp; | ||
549 | struct sock *sk = sock->sk; | ||
550 | struct wan_sockaddr_ll *saddr=(struct wan_sockaddr_ll *)msg->msg_name; | ||
551 | struct sk_buff *skb; | ||
552 | struct net_device *dev; | ||
553 | unsigned short proto; | ||
554 | unsigned char *addr; | ||
555 | int ifindex, err, reserve = 0; | ||
556 | |||
557 | |||
558 | if (!sock_flag(sk, SOCK_ZAPPED)) | ||
559 | return -ENETDOWN; | ||
560 | |||
561 | if (sk->sk_state != WANSOCK_CONNECTED) | ||
562 | return -ENOTCONN; | ||
563 | |||
564 | if (msg->msg_flags & ~(MSG_DONTWAIT|MSG_CMSG_COMPAT)) | ||
565 | return(-EINVAL); | ||
566 | |||
567 | /* it was <=, now one can send | ||
568 | * zero length packets */ | ||
569 | if (len < sizeof(x25api_hdr_t)) | ||
570 | return -EINVAL; | ||
571 | |||
572 | wp = wp_sk(sk); | ||
573 | |||
574 | if (saddr == NULL) { | ||
575 | ifindex = sk->sk_bound_dev_if; | ||
576 | proto = wp->num; | ||
577 | addr = NULL; | ||
578 | |||
579 | }else{ | ||
580 | if (msg->msg_namelen < sizeof(struct wan_sockaddr_ll)){ | ||
581 | return -EINVAL; | ||
582 | } | ||
583 | |||
584 | ifindex = sk->sk_bound_dev_if; | ||
585 | proto = saddr->sll_protocol; | ||
586 | addr = saddr->sll_addr; | ||
587 | } | ||
588 | |||
589 | dev = dev_get_by_index(ifindex); | ||
590 | if (dev == NULL){ | ||
591 | printk(KERN_INFO "wansock: Send failed, dev index: %i\n",ifindex); | ||
592 | return -ENXIO; | ||
593 | } | ||
594 | dev_put(dev); | ||
595 | |||
596 | if (sock->type == SOCK_RAW) | ||
597 | reserve = dev->hard_header_len; | ||
598 | |||
599 | if (len > dev->mtu+reserve){ | ||
600 | return -EMSGSIZE; | ||
601 | } | ||
602 | |||
603 | skb = sock_alloc_send_skb(sk, len + LL_RESERVED_SPACE(dev), | ||
604 | msg->msg_flags & MSG_DONTWAIT, &err); | ||
605 | |||
606 | if (skb==NULL){ | ||
607 | goto out_unlock; | ||
608 | } | ||
609 | |||
610 | skb_reserve(skb, LL_RESERVED_SPACE(dev)); | ||
611 | skb->nh.raw = skb->data; | ||
612 | |||
613 | /* Returns -EFAULT on error */ | ||
614 | err = memcpy_fromiovec(skb_put(skb,len), msg->msg_iov, len); | ||
615 | if (err){ | ||
616 | goto out_free; | ||
617 | } | ||
618 | |||
619 | if (dev->hard_header) { | ||
620 | int res; | ||
621 | err = -EINVAL; | ||
622 | res = dev->hard_header(skb, dev, ntohs(proto), addr, NULL, len); | ||
623 | if (res<0){ | ||
624 | goto out_free; | ||
625 | } | ||
626 | } | ||
627 | |||
628 | skb->protocol = proto; | ||
629 | skb->dev = dev; | ||
630 | skb->priority = sk->sk_priority; | ||
631 | skb->pkt_type = WAN_PACKET_DATA; | ||
632 | |||
633 | err = -ENETDOWN; | ||
634 | if (!(dev->flags & IFF_UP)) | ||
635 | goto out_free; | ||
636 | |||
637 | if (atomic_read(&sk->sk_wmem_alloc) + skb->truesize > | ||
638 | (unsigned int)sk->sk_sndbuf){ | ||
639 | kfree_skb(skb); | ||
640 | return -ENOBUFS; | ||
641 | } | ||
642 | |||
643 | skb_queue_tail(&sk->sk_write_queue,skb); | ||
644 | atomic_inc(&wp->packet_sent); | ||
645 | |||
646 | if (!(test_and_set_bit(0, &wp->timer))) | ||
647 | mod_timer(&wp->tx_timer, jiffies + 1); | ||
648 | |||
649 | return(len); | ||
650 | |||
651 | out_free: | ||
652 | kfree_skb(skb); | ||
653 | out_unlock: | ||
654 | return err; | ||
655 | } | ||
656 | |||
657 | /*============================================================ | ||
658 | * wanpipe_delayed_tarnsmit | ||
659 | * | ||
660 | * Transmit bottom half handler. It dequeues packets | ||
661 | * from sk->sk_write_queue and passes them to the | ||
662 | * driver. If the driver is busy, the packet is | ||
663 | * re-enqueued. | ||
664 | * | ||
665 | * Packet Sent counter is decremented on successful | ||
666 | * transmission. | ||
667 | *===========================================================*/ | ||
668 | |||
669 | |||
670 | static void wanpipe_delayed_transmit (unsigned long data) | ||
671 | { | ||
672 | struct sock *sk=(struct sock *)data; | ||
673 | struct sk_buff *skb; | ||
674 | wanpipe_opt *wp = wp_sk(sk); | ||
675 | struct net_device *dev = wp->dev; | ||
676 | sdla_t *card = (sdla_t*)wp->card; | ||
677 | |||
678 | if (!card || !dev){ | ||
679 | clear_bit(0, &wp->timer); | ||
680 | DBG_PRINTK(KERN_INFO "wansock: Transmit delay, no dev or card\n"); | ||
681 | return; | ||
682 | } | ||
683 | |||
684 | if (sk->sk_state != WANSOCK_CONNECTED || !sock_flag(sk, SOCK_ZAPPED)) { | ||
685 | clear_bit(0, &wp->timer); | ||
686 | DBG_PRINTK(KERN_INFO "wansock: Tx Timer, State not CONNECTED\n"); | ||
687 | return; | ||
688 | } | ||
689 | |||
690 | /* If driver is executing command, we must offload | ||
691 | * the board by not sending data. Otherwise a | ||
692 | * pending command will never get a free buffer | ||
693 | * to execute */ | ||
694 | if (atomic_read(&card->u.x.command_busy)){ | ||
695 | wp->tx_timer.expires = jiffies + SLOW_BACKOFF; | ||
696 | add_timer(&wp->tx_timer); | ||
697 | DBG_PRINTK(KERN_INFO "wansock: Tx Timer, command bys BACKOFF\n"); | ||
698 | return; | ||
699 | } | ||
700 | |||
701 | |||
702 | if (test_and_set_bit(0,&wanpipe_tx_critical)){ | ||
703 | printk(KERN_INFO "WanSock: Tx timer critical %s\n",dev->name); | ||
704 | wp->tx_timer.expires = jiffies + SLOW_BACKOFF; | ||
705 | add_timer(&wp->tx_timer); | ||
706 | return; | ||
707 | } | ||
708 | |||
709 | /* Check for a packet in the fifo and send */ | ||
710 | if ((skb = skb_dequeue(&sk->sk_write_queue)) != NULL){ | ||
711 | |||
712 | if (dev->hard_start_xmit(skb, dev) != 0){ | ||
713 | |||
714 | /* Driver failed to transmit, re-enqueue | ||
715 | * the packet and retry again later */ | ||
716 | skb_queue_head(&sk->sk_write_queue,skb); | ||
717 | clear_bit(0,&wanpipe_tx_critical); | ||
718 | return; | ||
719 | }else{ | ||
720 | |||
721 | /* Packet Sent successful. Check for more packets | ||
722 | * if more packets, re-trigger the transmit routine | ||
723 | * other wise exit | ||
724 | */ | ||
725 | atomic_dec(&wp->packet_sent); | ||
726 | |||
727 | if (skb_peek(&sk->sk_write_queue) == NULL) { | ||
728 | /* If there is nothing to send, kick | ||
729 | * the poll routine, which will trigger | ||
730 | * the application to send more data */ | ||
731 | sk->sk_data_ready(sk, 0); | ||
732 | clear_bit(0, &wp->timer); | ||
733 | }else{ | ||
734 | /* Reschedule as fast as possible */ | ||
735 | wp->tx_timer.expires = jiffies + 1; | ||
736 | add_timer(&wp->tx_timer); | ||
737 | } | ||
738 | } | ||
739 | } | ||
740 | clear_bit(0,&wanpipe_tx_critical); | ||
741 | } | ||
742 | |||
743 | /*============================================================ | ||
744 | * execute_command | ||
745 | * | ||
746 | * Execute x25api commands. The atomic variable | ||
747 | * chan->command is used to indicate to the driver that | ||
748 | * command is pending for execution. The acutal command | ||
749 | * structure is placed into a sock mbox structure | ||
750 | * (wp_sk(sk)->mbox). | ||
751 | * | ||
752 | * The sock private structure, mbox is | ||
753 | * used as shared memory between sock and the driver. | ||
754 | * Driver uses the sock mbox to execute the command | ||
755 | * and return the result. | ||
756 | * | ||
757 | * For all command except PLACE CALL, the function | ||
758 | * waits for the result. PLACE CALL can be ether | ||
759 | * blocking or nonblocking. The user sets this option | ||
760 | * via ioctl call. | ||
761 | *===========================================================*/ | ||
762 | |||
763 | |||
764 | static int execute_command(struct sock *sk, unsigned char cmd, unsigned int flags) | ||
765 | { | ||
766 | wanpipe_opt *wp = wp_sk(sk); | ||
767 | struct net_device *dev; | ||
768 | wanpipe_common_t *chan=NULL; | ||
769 | int err=0; | ||
770 | DECLARE_WAITQUEUE(wait, current); | ||
771 | |||
772 | dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
773 | if (dev == NULL){ | ||
774 | printk(KERN_INFO "wansock: Exec failed no dev %i\n", | ||
775 | sk->sk_bound_dev_if); | ||
776 | return -ENODEV; | ||
777 | } | ||
778 | dev_put(dev); | ||
779 | |||
780 | if ((chan=dev->priv) == NULL){ | ||
781 | printk(KERN_INFO "wansock: Exec cmd failed no priv area\n"); | ||
782 | return -ENODEV; | ||
783 | } | ||
784 | |||
785 | if (atomic_read(&chan->command)){ | ||
786 | printk(KERN_INFO "wansock: ERROR: Command already running %x, %s\n", | ||
787 | atomic_read(&chan->command),dev->name); | ||
788 | return -EINVAL; | ||
789 | } | ||
790 | |||
791 | if (!wp->mbox) { | ||
792 | printk(KERN_INFO "wansock: In execute without MBOX\n"); | ||
793 | return -EINVAL; | ||
794 | } | ||
795 | |||
796 | ((mbox_cmd_t*)wp->mbox)->cmd.command = cmd; | ||
797 | ((mbox_cmd_t*)wp->mbox)->cmd.lcn = wp->lcn; | ||
798 | ((mbox_cmd_t*)wp->mbox)->cmd.result = 0x7F; | ||
799 | |||
800 | |||
801 | if (flags & O_NONBLOCK){ | ||
802 | cmd |= 0x80; | ||
803 | atomic_set(&chan->command, cmd); | ||
804 | }else{ | ||
805 | atomic_set(&chan->command, cmd); | ||
806 | } | ||
807 | |||
808 | add_wait_queue(sk->sk_sleep,&wait); | ||
809 | current->state = TASK_INTERRUPTIBLE; | ||
810 | for (;;){ | ||
811 | if (((mbox_cmd_t*)wp->mbox)->cmd.result != 0x7F) { | ||
812 | err = 0; | ||
813 | break; | ||
814 | } | ||
815 | if (signal_pending(current)) { | ||
816 | err = -ERESTARTSYS; | ||
817 | break; | ||
818 | } | ||
819 | schedule(); | ||
820 | } | ||
821 | current->state = TASK_RUNNING; | ||
822 | remove_wait_queue(sk->sk_sleep,&wait); | ||
823 | |||
824 | return err; | ||
825 | } | ||
826 | |||
827 | /*============================================================ | ||
828 | * wanpipe_destroy_timer | ||
829 | * | ||
830 | * Used by wanpipe_release, to delay release of | ||
831 | * the socket. | ||
832 | *===========================================================*/ | ||
833 | |||
834 | static void wanpipe_destroy_timer(unsigned long data) | ||
835 | { | ||
836 | struct sock *sk=(struct sock *)data; | ||
837 | wanpipe_opt *wp = wp_sk(sk); | ||
838 | |||
839 | if ((!atomic_read(&sk->sk_wmem_alloc) && | ||
840 | !atomic_read(&sk->sk_rmem_alloc)) || | ||
841 | (++wp->force == 5)) { | ||
842 | |||
843 | if (atomic_read(&sk->sk_wmem_alloc) || | ||
844 | atomic_read(&sk->sk_rmem_alloc)) | ||
845 | printk(KERN_INFO "wansock: Warning, Packet Discarded due to sock shutdown!\n"); | ||
846 | |||
847 | kfree(wp); | ||
848 | wp_sk(sk) = NULL; | ||
849 | |||
850 | if (atomic_read(&sk->sk_refcnt) != 1) { | ||
851 | atomic_set(&sk->sk_refcnt, 1); | ||
852 | DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :delay.\n", | ||
853 | atomic_read(&sk->sk_refcnt)); | ||
854 | } | ||
855 | sock_put(sk); | ||
856 | atomic_dec(&wanpipe_socks_nr); | ||
857 | return; | ||
858 | } | ||
859 | |||
860 | sk->sk_timer.expires = jiffies + 5 * HZ; | ||
861 | add_timer(&sk->sk_timer); | ||
862 | printk(KERN_INFO "wansock: packet sk destroy delayed\n"); | ||
863 | } | ||
864 | |||
865 | /*============================================================ | ||
866 | * wanpipe_unlink_driver | ||
867 | * | ||
868 | * When the socket is released, this function is | ||
869 | * used to remove links that bind the sock and the | ||
870 | * driver together. | ||
871 | *===========================================================*/ | ||
872 | static void wanpipe_unlink_driver (struct sock *sk) | ||
873 | { | ||
874 | struct net_device *dev; | ||
875 | wanpipe_common_t *chan=NULL; | ||
876 | |||
877 | sock_reset_flag(sk, SOCK_ZAPPED); | ||
878 | sk->sk_state = WANSOCK_DISCONNECTED; | ||
879 | wp_sk(sk)->dev = NULL; | ||
880 | |||
881 | dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
882 | if (!dev){ | ||
883 | printk(KERN_INFO "wansock: No dev on release\n"); | ||
884 | return; | ||
885 | } | ||
886 | dev_put(dev); | ||
887 | |||
888 | if ((chan = dev->priv) == NULL){ | ||
889 | printk(KERN_INFO "wansock: No Priv Area on release\n"); | ||
890 | return; | ||
891 | } | ||
892 | |||
893 | set_bit(0,&chan->common_critical); | ||
894 | chan->sk=NULL; | ||
895 | chan->func=NULL; | ||
896 | chan->mbox=NULL; | ||
897 | chan->tx_timer=NULL; | ||
898 | clear_bit(0,&chan->common_critical); | ||
899 | release_device(dev); | ||
900 | |||
901 | return; | ||
902 | } | ||
903 | |||
904 | /*============================================================ | ||
905 | * wanpipe_link_driver | ||
906 | * | ||
907 | * Upon successful bind(), sock is linked to a driver | ||
908 | * by binding in the wanpipe_rcv() bottom half handler | ||
909 | * to the driver function pointer, as well as sock and | ||
910 | * sock mailbox addresses. This way driver can pass | ||
911 | * data up the socket. | ||
912 | *===========================================================*/ | ||
913 | |||
914 | static void wanpipe_link_driver(struct net_device *dev, struct sock *sk) | ||
915 | { | ||
916 | wanpipe_opt *wp = wp_sk(sk); | ||
917 | wanpipe_common_t *chan = dev->priv; | ||
918 | if (!chan) | ||
919 | return; | ||
920 | set_bit(0,&chan->common_critical); | ||
921 | chan->sk=sk; | ||
922 | chan->func=wanpipe_rcv; | ||
923 | chan->mbox = wp->mbox; | ||
924 | chan->tx_timer = &wp->tx_timer; | ||
925 | wp->dev = dev; | ||
926 | sock_set_flag(sk, SOCK_ZAPPED); | ||
927 | clear_bit(0,&chan->common_critical); | ||
928 | } | ||
929 | |||
930 | |||
931 | /*============================================================ | ||
932 | * release_device | ||
933 | * | ||
934 | * During sock release, clear a critical bit, which | ||
935 | * marks the device a being taken. | ||
936 | *===========================================================*/ | ||
937 | |||
938 | |||
939 | static void release_device(struct net_device *dev) | ||
940 | { | ||
941 | wanpipe_common_t *chan=dev->priv; | ||
942 | clear_bit(0,(void*)&chan->rw_bind); | ||
943 | } | ||
944 | |||
945 | /*============================================================ | ||
946 | * wanpipe_release | ||
947 | * | ||
948 | * Close a PACKET socket. This is fairly simple. We | ||
949 | * immediately go to 'closed' state and remove our | ||
950 | * protocol entry in the device list. | ||
951 | *===========================================================*/ | ||
952 | |||
953 | static int wanpipe_release(struct socket *sock) | ||
954 | { | ||
955 | wanpipe_opt *wp; | ||
956 | struct sock *sk = sock->sk; | ||
957 | |||
958 | if (!sk) | ||
959 | return 0; | ||
960 | |||
961 | wp = wp_sk(sk); | ||
962 | check_write_queue(sk); | ||
963 | |||
964 | /* Kill the tx timer, if we don't kill it now, the timer | ||
965 | * will run after we kill the sock. Timer code will | ||
966 | * try to access the sock which has been killed and cause | ||
967 | * kernel panic */ | ||
968 | |||
969 | del_timer(&wp->tx_timer); | ||
970 | |||
971 | /* | ||
972 | * Unhook packet receive handler. | ||
973 | */ | ||
974 | |||
975 | if (wp->num == htons(X25_PROT) && | ||
976 | sk->sk_state != WANSOCK_DISCONNECTED && sock_flag(sk, SOCK_ZAPPED)) { | ||
977 | struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
978 | wanpipe_common_t *chan; | ||
979 | if (dev){ | ||
980 | chan=dev->priv; | ||
981 | atomic_set(&chan->disconnect,1); | ||
982 | DBG_PRINTK(KERN_INFO "wansock: Sending Clear Indication %i\n", | ||
983 | sk->sk_state); | ||
984 | dev_put(dev); | ||
985 | } | ||
986 | } | ||
987 | |||
988 | set_bit(1,&wanpipe_tx_critical); | ||
989 | write_lock(&wanpipe_sklist_lock); | ||
990 | sk_del_node_init(sk); | ||
991 | write_unlock(&wanpipe_sklist_lock); | ||
992 | clear_bit(1,&wanpipe_tx_critical); | ||
993 | |||
994 | |||
995 | |||
996 | release_driver(sk); | ||
997 | |||
998 | |||
999 | /* | ||
1000 | * Now the socket is dead. No more input will appear. | ||
1001 | */ | ||
1002 | |||
1003 | sk->sk_state_change(sk); /* It is useless. Just for sanity. */ | ||
1004 | |||
1005 | sock->sk = NULL; | ||
1006 | sk->sk_socket = NULL; | ||
1007 | sock_set_flag(sk, SOCK_DEAD); | ||
1008 | |||
1009 | /* Purge queues */ | ||
1010 | skb_queue_purge(&sk->sk_receive_queue); | ||
1011 | skb_queue_purge(&sk->sk_write_queue); | ||
1012 | skb_queue_purge(&sk->sk_error_queue); | ||
1013 | |||
1014 | if (atomic_read(&sk->sk_rmem_alloc) || | ||
1015 | atomic_read(&sk->sk_wmem_alloc)) { | ||
1016 | del_timer(&sk->sk_timer); | ||
1017 | printk(KERN_INFO "wansock: Killing in Timer R %i , W %i\n", | ||
1018 | atomic_read(&sk->sk_rmem_alloc), | ||
1019 | atomic_read(&sk->sk_wmem_alloc)); | ||
1020 | sk->sk_timer.data = (unsigned long)sk; | ||
1021 | sk->sk_timer.expires = jiffies + HZ; | ||
1022 | sk->sk_timer.function = wanpipe_destroy_timer; | ||
1023 | add_timer(&sk->sk_timer); | ||
1024 | return 0; | ||
1025 | } | ||
1026 | |||
1027 | kfree(wp); | ||
1028 | wp_sk(sk) = NULL; | ||
1029 | |||
1030 | if (atomic_read(&sk->sk_refcnt) != 1) { | ||
1031 | DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i !:release.\n", | ||
1032 | atomic_read(&sk->sk_refcnt)); | ||
1033 | atomic_set(&sk->sk_refcnt, 1); | ||
1034 | } | ||
1035 | sock_put(sk); | ||
1036 | atomic_dec(&wanpipe_socks_nr); | ||
1037 | return 0; | ||
1038 | } | ||
1039 | |||
1040 | /*============================================================ | ||
1041 | * check_write_queue | ||
1042 | * | ||
1043 | * During sock shutdown, if the sock state is | ||
1044 | * WANSOCK_CONNECTED and there is transmit data | ||
1045 | * pending. Wait until data is released | ||
1046 | * before proceeding. | ||
1047 | *===========================================================*/ | ||
1048 | |||
1049 | static void check_write_queue(struct sock *sk) | ||
1050 | { | ||
1051 | |||
1052 | if (sk->sk_state != WANSOCK_CONNECTED) | ||
1053 | return; | ||
1054 | |||
1055 | if (!atomic_read(&sk->sk_wmem_alloc)) | ||
1056 | return; | ||
1057 | |||
1058 | printk(KERN_INFO "wansock: MAJOR ERROR, Data lost on sock release !!!\n"); | ||
1059 | |||
1060 | } | ||
1061 | |||
1062 | /*============================================================ | ||
1063 | * release_driver | ||
1064 | * | ||
1065 | * This function is called during sock shutdown, to | ||
1066 | * release any resources and links that bind the sock | ||
1067 | * to the driver. It also changes the state of the | ||
1068 | * sock to WANSOCK_DISCONNECTED | ||
1069 | *===========================================================*/ | ||
1070 | |||
1071 | static void release_driver(struct sock *sk) | ||
1072 | { | ||
1073 | wanpipe_opt *wp; | ||
1074 | struct sk_buff *skb=NULL; | ||
1075 | struct sock *deadsk=NULL; | ||
1076 | |||
1077 | if (sk->sk_state == WANSOCK_LISTEN || | ||
1078 | sk->sk_state == WANSOCK_BIND_LISTEN) { | ||
1079 | while ((skb = skb_dequeue(&sk->sk_receive_queue)) != NULL) { | ||
1080 | if ((deadsk = get_newsk_from_skb(skb))){ | ||
1081 | DBG_PRINTK (KERN_INFO "wansock: RELEASE: FOUND DEAD SOCK\n"); | ||
1082 | sock_set_flag(deadsk, SOCK_DEAD); | ||
1083 | start_cleanup_timer(deadsk); | ||
1084 | } | ||
1085 | kfree_skb(skb); | ||
1086 | } | ||
1087 | if (sock_flag(sk, SOCK_ZAPPED)) | ||
1088 | wanpipe_unlink_card(sk); | ||
1089 | }else{ | ||
1090 | if (sock_flag(sk, SOCK_ZAPPED)) | ||
1091 | wanpipe_unlink_driver(sk); | ||
1092 | } | ||
1093 | sk->sk_state = WANSOCK_DISCONNECTED; | ||
1094 | sk->sk_bound_dev_if = 0; | ||
1095 | sock_reset_flag(sk, SOCK_ZAPPED); | ||
1096 | wp = wp_sk(sk); | ||
1097 | |||
1098 | if (wp) { | ||
1099 | kfree(wp->mbox); | ||
1100 | wp->mbox = NULL; | ||
1101 | } | ||
1102 | } | ||
1103 | |||
1104 | /*============================================================ | ||
1105 | * start_cleanup_timer | ||
1106 | * | ||
1107 | * If new incoming call's are pending but the socket | ||
1108 | * is being released, start the timer which will | ||
1109 | * envoke the kill routines for pending socks. | ||
1110 | *===========================================================*/ | ||
1111 | |||
1112 | |||
1113 | static void start_cleanup_timer (struct sock *sk) | ||
1114 | { | ||
1115 | del_timer(&sk->sk_timer); | ||
1116 | sk->sk_timer.data = (unsigned long)sk; | ||
1117 | sk->sk_timer.expires = jiffies + HZ; | ||
1118 | sk->sk_timer.function = wanpipe_kill_sock_timer; | ||
1119 | add_timer(&sk->sk_timer); | ||
1120 | } | ||
1121 | |||
1122 | |||
1123 | /*============================================================ | ||
1124 | * wanpipe_kill_sock | ||
1125 | * | ||
1126 | * This is a function which performs actual killing | ||
1127 | * of the sock. It releases socket resources, | ||
1128 | * and unlinks the sock from the driver. | ||
1129 | *===========================================================*/ | ||
1130 | |||
1131 | static void wanpipe_kill_sock_timer (unsigned long data) | ||
1132 | { | ||
1133 | |||
1134 | struct sock *sk = (struct sock *)data; | ||
1135 | struct sock **skp; | ||
1136 | |||
1137 | if (!sk) | ||
1138 | return; | ||
1139 | |||
1140 | /* This function can be called from interrupt. We must use | ||
1141 | * appropriate locks */ | ||
1142 | |||
1143 | if (test_bit(1,&wanpipe_tx_critical)){ | ||
1144 | sk->sk_timer.expires = jiffies + 10; | ||
1145 | add_timer(&sk->sk_timer); | ||
1146 | return; | ||
1147 | } | ||
1148 | |||
1149 | write_lock(&wanpipe_sklist_lock); | ||
1150 | sk_del_node_init(sk); | ||
1151 | write_unlock(&wanpipe_sklist_lock); | ||
1152 | |||
1153 | |||
1154 | if (wp_sk(sk)->num == htons(X25_PROT) && | ||
1155 | sk->sk_state != WANSOCK_DISCONNECTED) { | ||
1156 | struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
1157 | wanpipe_common_t *chan; | ||
1158 | if (dev){ | ||
1159 | chan=dev->priv; | ||
1160 | atomic_set(&chan->disconnect,1); | ||
1161 | dev_put(dev); | ||
1162 | } | ||
1163 | } | ||
1164 | |||
1165 | release_driver(sk); | ||
1166 | |||
1167 | sk->sk_socket = NULL; | ||
1168 | |||
1169 | /* Purge queues */ | ||
1170 | skb_queue_purge(&sk->sk_receive_queue); | ||
1171 | skb_queue_purge(&sk->sk_write_queue); | ||
1172 | skb_queue_purge(&sk->sk_error_queue); | ||
1173 | |||
1174 | if (atomic_read(&sk->sk_rmem_alloc) || | ||
1175 | atomic_read(&sk->sk_wmem_alloc)) { | ||
1176 | del_timer(&sk->sk_timer); | ||
1177 | printk(KERN_INFO "wansock: Killing SOCK in Timer\n"); | ||
1178 | sk->sk_timer.data = (unsigned long)sk; | ||
1179 | sk->sk_timer.expires = jiffies + HZ; | ||
1180 | sk->sk_timer.function = wanpipe_destroy_timer; | ||
1181 | add_timer(&sk->sk_timer); | ||
1182 | return; | ||
1183 | } | ||
1184 | |||
1185 | kfree(wp_sk(sk)); | ||
1186 | wp_sk(sk) = NULL; | ||
1187 | |||
1188 | if (atomic_read(&sk->sk_refcnt) != 1) { | ||
1189 | atomic_set(&sk->sk_refcnt, 1); | ||
1190 | DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :timer.\n", | ||
1191 | atomic_read(&sk->sk_refcnt)); | ||
1192 | } | ||
1193 | sock_put(sk); | ||
1194 | atomic_dec(&wanpipe_socks_nr); | ||
1195 | return; | ||
1196 | } | ||
1197 | |||
1198 | static void wanpipe_kill_sock_accept (struct sock *sk) | ||
1199 | { | ||
1200 | |||
1201 | struct sock **skp; | ||
1202 | |||
1203 | if (!sk) | ||
1204 | return; | ||
1205 | |||
1206 | /* This function can be called from interrupt. We must use | ||
1207 | * appropriate locks */ | ||
1208 | |||
1209 | write_lock(&wanpipe_sklist_lock); | ||
1210 | sk_del_node_init(sk); | ||
1211 | write_unlock(&wanpipe_sklist_lock); | ||
1212 | |||
1213 | sk->sk_socket = NULL; | ||
1214 | |||
1215 | |||
1216 | kfree(wp_sk(sk)); | ||
1217 | wp_sk(sk) = NULL; | ||
1218 | |||
1219 | if (atomic_read(&sk->sk_refcnt) != 1) { | ||
1220 | atomic_set(&sk->sk_refcnt, 1); | ||
1221 | DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i ! :timer.\n", | ||
1222 | atomic_read(&sk->sk_refcnt)); | ||
1223 | } | ||
1224 | sock_put(sk); | ||
1225 | atomic_dec(&wanpipe_socks_nr); | ||
1226 | return; | ||
1227 | } | ||
1228 | |||
1229 | |||
1230 | static void wanpipe_kill_sock_irq (struct sock *sk) | ||
1231 | { | ||
1232 | |||
1233 | if (!sk) | ||
1234 | return; | ||
1235 | |||
1236 | sk->sk_socket = NULL; | ||
1237 | |||
1238 | kfree(wp_sk(sk)); | ||
1239 | wp_sk(sk) = NULL; | ||
1240 | |||
1241 | if (atomic_read(&sk->sk_refcnt) != 1) { | ||
1242 | atomic_set(&sk->sk_refcnt, 1); | ||
1243 | DBG_PRINTK(KERN_INFO "wansock: Error, wrong reference count: %i !:listen.\n", | ||
1244 | atomic_read(&sk->sk_refcnt)); | ||
1245 | } | ||
1246 | sock_put(sk); | ||
1247 | atomic_dec(&wanpipe_socks_nr); | ||
1248 | } | ||
1249 | |||
1250 | |||
1251 | /*============================================================ | ||
1252 | * wanpipe_do_bind | ||
1253 | * | ||
1254 | * Bottom half of the binding system call. | ||
1255 | * Once the wanpipe_bind() function checks the | ||
1256 | * legality of the call, this function binds the | ||
1257 | * sock to the driver. | ||
1258 | *===========================================================*/ | ||
1259 | |||
1260 | static int wanpipe_do_bind(struct sock *sk, struct net_device *dev, | ||
1261 | int protocol) | ||
1262 | { | ||
1263 | wanpipe_opt *wp = wp_sk(sk); | ||
1264 | wanpipe_common_t *chan=NULL; | ||
1265 | int err=0; | ||
1266 | |||
1267 | if (sock_flag(sk, SOCK_ZAPPED)) { | ||
1268 | err = -EALREADY; | ||
1269 | goto bind_unlock_exit; | ||
1270 | } | ||
1271 | |||
1272 | wp->num = protocol; | ||
1273 | |||
1274 | if (protocol == 0){ | ||
1275 | release_device(dev); | ||
1276 | err = -EINVAL; | ||
1277 | goto bind_unlock_exit; | ||
1278 | } | ||
1279 | |||
1280 | if (dev) { | ||
1281 | if (dev->flags&IFF_UP) { | ||
1282 | chan=dev->priv; | ||
1283 | sk->sk_state = chan->state; | ||
1284 | |||
1285 | if (wp->num == htons(X25_PROT) && | ||
1286 | sk->sk_state != WANSOCK_DISCONNECTED && | ||
1287 | sk->sk_state != WANSOCK_CONNECTING) { | ||
1288 | DBG_PRINTK(KERN_INFO | ||
1289 | "wansock: Binding to Device not DISCONNECTED %i\n", | ||
1290 | sk->sk_state); | ||
1291 | release_device(dev); | ||
1292 | err = -EAGAIN; | ||
1293 | goto bind_unlock_exit; | ||
1294 | } | ||
1295 | |||
1296 | wanpipe_link_driver(dev,sk); | ||
1297 | sk->sk_bound_dev_if = dev->ifindex; | ||
1298 | |||
1299 | /* X25 Specific option */ | ||
1300 | if (wp->num == htons(X25_PROT)) | ||
1301 | wp_sk(sk)->svc = chan->svc; | ||
1302 | |||
1303 | } else { | ||
1304 | sk->sk_err = ENETDOWN; | ||
1305 | sk->sk_error_report(sk); | ||
1306 | release_device(dev); | ||
1307 | err = -EINVAL; | ||
1308 | } | ||
1309 | } else { | ||
1310 | err = -ENODEV; | ||
1311 | } | ||
1312 | bind_unlock_exit: | ||
1313 | /* FIXME where is this lock */ | ||
1314 | |||
1315 | return err; | ||
1316 | } | ||
1317 | |||
1318 | /*============================================================ | ||
1319 | * wanpipe_bind | ||
1320 | * | ||
1321 | * BIND() System call, which is bound to the AF_WANPIPE | ||
1322 | * operations structure. It checks for correct wanpipe | ||
1323 | * card name, and cross references interface names with | ||
1324 | * the card names. Thus, interface name must belong to | ||
1325 | * the actual card. | ||
1326 | *===========================================================*/ | ||
1327 | |||
1328 | |||
1329 | static int wanpipe_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) | ||
1330 | { | ||
1331 | struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)uaddr; | ||
1332 | struct sock *sk=sock->sk; | ||
1333 | wanpipe_opt *wp = wp_sk(sk); | ||
1334 | struct net_device *dev = NULL; | ||
1335 | sdla_t *card=NULL; | ||
1336 | char name[15]; | ||
1337 | |||
1338 | /* | ||
1339 | * Check legality | ||
1340 | */ | ||
1341 | |||
1342 | if (addr_len < sizeof(struct wan_sockaddr_ll)){ | ||
1343 | printk(KERN_INFO "wansock: Address length error\n"); | ||
1344 | return -EINVAL; | ||
1345 | } | ||
1346 | if (sll->sll_family != AF_WANPIPE){ | ||
1347 | printk(KERN_INFO "wansock: Illegal family name specified.\n"); | ||
1348 | return -EINVAL; | ||
1349 | } | ||
1350 | |||
1351 | card = wanpipe_find_card (sll->sll_card); | ||
1352 | if (!card){ | ||
1353 | printk(KERN_INFO "wansock: Wanpipe card not found: %s\n",sll->sll_card); | ||
1354 | return -ENODEV; | ||
1355 | }else{ | ||
1356 | wp_sk(sk)->card = (void *)card; | ||
1357 | } | ||
1358 | |||
1359 | if (!strcmp(sll->sll_device,"svc_listen")){ | ||
1360 | |||
1361 | /* Bind a sock to a card structure for listening | ||
1362 | */ | ||
1363 | int err=0; | ||
1364 | |||
1365 | /* This is x25 specific area if protocol doesn't | ||
1366 | * match, return error */ | ||
1367 | if (sll->sll_protocol != htons(X25_PROT)) | ||
1368 | return -EINVAL; | ||
1369 | |||
1370 | err= wanpipe_link_card (sk); | ||
1371 | if (err < 0) | ||
1372 | return err; | ||
1373 | |||
1374 | if (sll->sll_protocol) | ||
1375 | wp->num = sll->sll_protocol; | ||
1376 | sk->sk_state = WANSOCK_BIND_LISTEN; | ||
1377 | return 0; | ||
1378 | |||
1379 | }else if (!strcmp(sll->sll_device,"svc_connect")){ | ||
1380 | |||
1381 | /* This is x25 specific area if protocol doesn't | ||
1382 | * match, return error */ | ||
1383 | if (sll->sll_protocol != htons(X25_PROT)) | ||
1384 | return -EINVAL; | ||
1385 | |||
1386 | /* Find a free device | ||
1387 | */ | ||
1388 | dev = wanpipe_find_free_dev(card); | ||
1389 | if (dev == NULL){ | ||
1390 | DBG_PRINTK(KERN_INFO "wansock: No free network devices for card %s\n", | ||
1391 | card->devname); | ||
1392 | return -EINVAL; | ||
1393 | } | ||
1394 | }else{ | ||
1395 | /* Bind a socket to a interface name | ||
1396 | * This is used by PVC mostly | ||
1397 | */ | ||
1398 | strlcpy(name,sll->sll_device,sizeof(name)); | ||
1399 | dev = dev_get_by_name(name); | ||
1400 | if (dev == NULL){ | ||
1401 | printk(KERN_INFO "wansock: Failed to get Dev from name: %s,\n", | ||
1402 | name); | ||
1403 | return -ENODEV; | ||
1404 | } | ||
1405 | |||
1406 | dev_put(dev); | ||
1407 | |||
1408 | if (check_dev(dev, card)){ | ||
1409 | printk(KERN_INFO "wansock: Device %s, doesn't belong to card %s\n", | ||
1410 | dev->name, card->devname); | ||
1411 | return -EINVAL; | ||
1412 | } | ||
1413 | if (get_atomic_device (dev)) | ||
1414 | return -EINVAL; | ||
1415 | } | ||
1416 | |||
1417 | return wanpipe_do_bind(sk, dev, sll->sll_protocol ? : wp->num); | ||
1418 | } | ||
1419 | |||
1420 | /*============================================================ | ||
1421 | * get_atomic_device | ||
1422 | * | ||
1423 | * Sets a bit atomically which indicates that | ||
1424 | * the interface is taken. This avoids race conditions. | ||
1425 | *===========================================================*/ | ||
1426 | |||
1427 | |||
1428 | static inline int get_atomic_device(struct net_device *dev) | ||
1429 | { | ||
1430 | wanpipe_common_t *chan = dev->priv; | ||
1431 | if (!test_and_set_bit(0,(void *)&chan->rw_bind)){ | ||
1432 | return 0; | ||
1433 | } | ||
1434 | return 1; | ||
1435 | } | ||
1436 | |||
1437 | /*============================================================ | ||
1438 | * check_dev | ||
1439 | * | ||
1440 | * Check that device name belongs to a particular card. | ||
1441 | *===========================================================*/ | ||
1442 | |||
1443 | static int check_dev(struct net_device *dev, sdla_t *card) | ||
1444 | { | ||
1445 | struct net_device* tmp_dev; | ||
1446 | |||
1447 | for (tmp_dev = card->wandev.dev; tmp_dev; | ||
1448 | tmp_dev = *((struct net_device **)tmp_dev->priv)) { | ||
1449 | if (tmp_dev->ifindex == dev->ifindex){ | ||
1450 | return 0; | ||
1451 | } | ||
1452 | } | ||
1453 | return 1; | ||
1454 | } | ||
1455 | |||
1456 | /*============================================================ | ||
1457 | * wanpipe_find_free_dev | ||
1458 | * | ||
1459 | * Find a free network interface. If found set atomic | ||
1460 | * bit indicating that the interface is taken. | ||
1461 | * X25API Specific. | ||
1462 | *===========================================================*/ | ||
1463 | |||
1464 | struct net_device *wanpipe_find_free_dev(sdla_t *card) | ||
1465 | { | ||
1466 | struct net_device* dev; | ||
1467 | volatile wanpipe_common_t *chan; | ||
1468 | |||
1469 | if (test_and_set_bit(0,&find_free_critical)){ | ||
1470 | printk(KERN_INFO "CRITICAL in Find Free\n"); | ||
1471 | } | ||
1472 | |||
1473 | for (dev = card->wandev.dev; dev; | ||
1474 | dev = *((struct net_device **)dev->priv)) { | ||
1475 | chan = dev->priv; | ||
1476 | if (!chan) | ||
1477 | continue; | ||
1478 | if (chan->usedby == API && chan->svc){ | ||
1479 | if (!get_atomic_device (dev)){ | ||
1480 | if (chan->state != WANSOCK_DISCONNECTED){ | ||
1481 | release_device(dev); | ||
1482 | }else{ | ||
1483 | clear_bit(0,&find_free_critical); | ||
1484 | return dev; | ||
1485 | } | ||
1486 | } | ||
1487 | } | ||
1488 | } | ||
1489 | clear_bit(0,&find_free_critical); | ||
1490 | return NULL; | ||
1491 | } | ||
1492 | |||
1493 | /*============================================================ | ||
1494 | * wanpipe_create | ||
1495 | * | ||
1496 | * SOCKET() System call. It allocates a sock structure | ||
1497 | * and adds the socket to the wanpipe_sk_list. | ||
1498 | * Crates AF_WANPIPE socket. | ||
1499 | *===========================================================*/ | ||
1500 | |||
1501 | static int wanpipe_create(struct socket *sock, int protocol) | ||
1502 | { | ||
1503 | struct sock *sk; | ||
1504 | |||
1505 | //FIXME: This checks for root user, SECURITY ? | ||
1506 | //if (!capable(CAP_NET_RAW)) | ||
1507 | // return -EPERM; | ||
1508 | |||
1509 | if (sock->type != SOCK_DGRAM && sock->type != SOCK_RAW) | ||
1510 | return -ESOCKTNOSUPPORT; | ||
1511 | |||
1512 | sock->state = SS_UNCONNECTED; | ||
1513 | |||
1514 | if ((sk = wanpipe_alloc_socket()) == NULL) | ||
1515 | return -ENOBUFS; | ||
1516 | |||
1517 | sk->sk_reuse = 1; | ||
1518 | sock->ops = &wanpipe_ops; | ||
1519 | sock_init_data(sock,sk); | ||
1520 | |||
1521 | sock_reset_flag(sk, SOCK_ZAPPED); | ||
1522 | sk->sk_family = PF_WANPIPE; | ||
1523 | wp_sk(sk)->num = protocol; | ||
1524 | sk->sk_state = WANSOCK_DISCONNECTED; | ||
1525 | sk->sk_ack_backlog = 0; | ||
1526 | sk->sk_bound_dev_if = 0; | ||
1527 | |||
1528 | atomic_inc(&wanpipe_socks_nr); | ||
1529 | |||
1530 | /* We must disable interrupts because the ISR | ||
1531 | * can also change the list */ | ||
1532 | set_bit(1,&wanpipe_tx_critical); | ||
1533 | write_lock(&wanpipe_sklist_lock); | ||
1534 | sk_add_node(sk, &wanpipe_sklist); | ||
1535 | write_unlock(&wanpipe_sklist_lock); | ||
1536 | clear_bit(1,&wanpipe_tx_critical); | ||
1537 | |||
1538 | return(0); | ||
1539 | } | ||
1540 | |||
1541 | |||
1542 | /*============================================================ | ||
1543 | * wanpipe_recvmsg | ||
1544 | * | ||
1545 | * Pull a packet from our receive queue and hand it | ||
1546 | * to the user. If necessary we block. | ||
1547 | *===========================================================*/ | ||
1548 | |||
1549 | static int wanpipe_recvmsg(struct kiocb *iocb, struct socket *sock, | ||
1550 | struct msghdr *msg, int len, int flags) | ||
1551 | { | ||
1552 | struct sock *sk = sock->sk; | ||
1553 | struct sk_buff *skb; | ||
1554 | int copied, err=-ENOBUFS; | ||
1555 | |||
1556 | |||
1557 | /* | ||
1558 | * If the address length field is there to be filled in, we fill | ||
1559 | * it in now. | ||
1560 | */ | ||
1561 | |||
1562 | msg->msg_namelen = sizeof(struct wan_sockaddr_ll); | ||
1563 | |||
1564 | /* | ||
1565 | * Call the generic datagram receiver. This handles all sorts | ||
1566 | * of horrible races and re-entrancy so we can forget about it | ||
1567 | * in the protocol layers. | ||
1568 | * | ||
1569 | * Now it will return ENETDOWN, if device have just gone down, | ||
1570 | * but then it will block. | ||
1571 | */ | ||
1572 | |||
1573 | if (flags & MSG_OOB){ | ||
1574 | skb = skb_dequeue(&sk->sk_error_queue); | ||
1575 | }else{ | ||
1576 | skb=skb_recv_datagram(sk,flags,1,&err); | ||
1577 | } | ||
1578 | /* | ||
1579 | * An error occurred so return it. Because skb_recv_datagram() | ||
1580 | * handles the blocking we don't see and worry about blocking | ||
1581 | * retries. | ||
1582 | */ | ||
1583 | |||
1584 | if(skb==NULL) | ||
1585 | goto out; | ||
1586 | |||
1587 | /* | ||
1588 | * You lose any data beyond the buffer you gave. If it worries a | ||
1589 | * user program they can ask the device for its MTU anyway. | ||
1590 | */ | ||
1591 | |||
1592 | copied = skb->len; | ||
1593 | if (copied > len) | ||
1594 | { | ||
1595 | copied=len; | ||
1596 | msg->msg_flags|=MSG_TRUNC; | ||
1597 | } | ||
1598 | |||
1599 | wanpipe_wakeup_driver(sk); | ||
1600 | |||
1601 | /* We can't use skb_copy_datagram here */ | ||
1602 | err = memcpy_toiovec(msg->msg_iov, skb->data, copied); | ||
1603 | if (err) | ||
1604 | goto out_free; | ||
1605 | |||
1606 | sock_recv_timestamp(msg, sk, skb); | ||
1607 | |||
1608 | if (msg->msg_name) | ||
1609 | memcpy(msg->msg_name, skb->cb, msg->msg_namelen); | ||
1610 | |||
1611 | /* | ||
1612 | * Free or return the buffer as appropriate. Again this | ||
1613 | * hides all the races and re-entrancy issues from us. | ||
1614 | */ | ||
1615 | err = (flags&MSG_TRUNC) ? skb->len : copied; | ||
1616 | |||
1617 | out_free: | ||
1618 | skb_free_datagram(sk, skb); | ||
1619 | out: | ||
1620 | return err; | ||
1621 | } | ||
1622 | |||
1623 | |||
1624 | /*============================================================ | ||
1625 | * wanpipe_wakeup_driver | ||
1626 | * | ||
1627 | * If socket receive buffer is full and driver cannot | ||
1628 | * pass data up the sock, it sets a packet_block flag. | ||
1629 | * This function check that flag and if sock receive | ||
1630 | * queue has room it kicks the driver BH handler. | ||
1631 | * | ||
1632 | * This way, driver doesn't have to poll the sock | ||
1633 | * receive queue. | ||
1634 | *===========================================================*/ | ||
1635 | |||
1636 | static void wanpipe_wakeup_driver(struct sock *sk) | ||
1637 | { | ||
1638 | struct net_device *dev = NULL; | ||
1639 | wanpipe_common_t *chan=NULL; | ||
1640 | |||
1641 | dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
1642 | if (!dev) | ||
1643 | return; | ||
1644 | |||
1645 | dev_put(dev); | ||
1646 | |||
1647 | if ((chan = dev->priv) == NULL) | ||
1648 | return; | ||
1649 | |||
1650 | if (atomic_read(&chan->receive_block)){ | ||
1651 | if (atomic_read(&sk->sk_rmem_alloc) < | ||
1652 | ((unsigned)sk->sk_rcvbuf * 0.9)) { | ||
1653 | printk(KERN_INFO "wansock: Queuing task for wanpipe\n"); | ||
1654 | atomic_set(&chan->receive_block,0); | ||
1655 | wanpipe_queue_tq(&chan->wanpipe_task); | ||
1656 | wanpipe_mark_bh(); | ||
1657 | } | ||
1658 | } | ||
1659 | } | ||
1660 | |||
1661 | /*============================================================ | ||
1662 | * wanpipe_getname | ||
1663 | * | ||
1664 | * I don't know what to do with this yet. | ||
1665 | * User can use this function to get sock address | ||
1666 | * information. Not very useful for Sangoma's purposes. | ||
1667 | *===========================================================*/ | ||
1668 | |||
1669 | |||
1670 | static int wanpipe_getname(struct socket *sock, struct sockaddr *uaddr, | ||
1671 | int *uaddr_len, int peer) | ||
1672 | { | ||
1673 | struct net_device *dev; | ||
1674 | struct sock *sk = sock->sk; | ||
1675 | struct wan_sockaddr_ll *sll = (struct wan_sockaddr_ll*)uaddr; | ||
1676 | |||
1677 | sll->sll_family = AF_WANPIPE; | ||
1678 | sll->sll_ifindex = sk->sk_bound_dev_if; | ||
1679 | sll->sll_protocol = wp_sk(sk)->num; | ||
1680 | dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
1681 | if (dev) { | ||
1682 | sll->sll_hatype = dev->type; | ||
1683 | sll->sll_halen = dev->addr_len; | ||
1684 | memcpy(sll->sll_addr, dev->dev_addr, dev->addr_len); | ||
1685 | } else { | ||
1686 | sll->sll_hatype = 0; /* Bad: we have no ARPHRD_UNSPEC */ | ||
1687 | sll->sll_halen = 0; | ||
1688 | } | ||
1689 | *uaddr_len = sizeof(*sll); | ||
1690 | |||
1691 | dev_put(dev); | ||
1692 | |||
1693 | return 0; | ||
1694 | } | ||
1695 | |||
1696 | /*============================================================ | ||
1697 | * wanpipe_notifier | ||
1698 | * | ||
1699 | * If driver turns off network interface, this function | ||
1700 | * will be envoked. Currently I treate it as a | ||
1701 | * call disconnect. More thought should go into this | ||
1702 | * function. | ||
1703 | * | ||
1704 | * FIXME: More thought should go into this function. | ||
1705 | * | ||
1706 | *===========================================================*/ | ||
1707 | |||
1708 | static int wanpipe_notifier(struct notifier_block *this, unsigned long msg, void *data) | ||
1709 | { | ||
1710 | struct sock *sk; | ||
1711 | hlist_node *node; | ||
1712 | struct net_device *dev = (struct net_device *)data; | ||
1713 | |||
1714 | sk_for_each(sk, node, &wanpipe_sklist) { | ||
1715 | struct wanpipe_opt *po = wp_sk(sk); | ||
1716 | |||
1717 | if (!po) | ||
1718 | continue; | ||
1719 | if (dev == NULL) | ||
1720 | continue; | ||
1721 | |||
1722 | switch (msg) { | ||
1723 | case NETDEV_DOWN: | ||
1724 | case NETDEV_UNREGISTER: | ||
1725 | if (dev->ifindex == sk->sk_bound_dev_if) { | ||
1726 | printk(KERN_INFO "wansock: Device down %s\n",dev->name); | ||
1727 | if (sock_flag(sk, SOCK_ZAPPED)) { | ||
1728 | wanpipe_unlink_driver(sk); | ||
1729 | sk->sk_err = ENETDOWN; | ||
1730 | sk->sk_error_report(sk); | ||
1731 | } | ||
1732 | |||
1733 | if (msg == NETDEV_UNREGISTER) { | ||
1734 | printk(KERN_INFO "wansock: Unregistering Device: %s\n", | ||
1735 | dev->name); | ||
1736 | wanpipe_unlink_driver(sk); | ||
1737 | sk->sk_bound_dev_if = 0; | ||
1738 | } | ||
1739 | } | ||
1740 | break; | ||
1741 | case NETDEV_UP: | ||
1742 | if (dev->ifindex == sk->sk_bound_dev_if && | ||
1743 | po->num && !sock_flag(sk, SOCK_ZAPPED)) { | ||
1744 | printk(KERN_INFO "wansock: Registering Device: %s\n", | ||
1745 | dev->name); | ||
1746 | wanpipe_link_driver(dev,sk); | ||
1747 | } | ||
1748 | break; | ||
1749 | } | ||
1750 | } | ||
1751 | return NOTIFY_DONE; | ||
1752 | } | ||
1753 | |||
1754 | /*============================================================ | ||
1755 | * wanpipe_ioctl | ||
1756 | * | ||
1757 | * Execute a user commands, and set socket options. | ||
1758 | * | ||
1759 | * FIXME: More thought should go into this function. | ||
1760 | * | ||
1761 | *===========================================================*/ | ||
1762 | |||
1763 | static int wanpipe_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg) | ||
1764 | { | ||
1765 | struct sock *sk = sock->sk; | ||
1766 | int err; | ||
1767 | |||
1768 | switch(cmd) | ||
1769 | { | ||
1770 | case SIOCGSTAMP: | ||
1771 | return sock_get_timestamp(sk, (struct timeval __user *)arg); | ||
1772 | |||
1773 | case SIOC_WANPIPE_CHECK_TX: | ||
1774 | |||
1775 | return atomic_read(&sk->sk_wmem_alloc); | ||
1776 | |||
1777 | case SIOC_WANPIPE_SOCK_STATE: | ||
1778 | |||
1779 | if (sk->sk_state == WANSOCK_CONNECTED) | ||
1780 | return 0; | ||
1781 | |||
1782 | return 1; | ||
1783 | |||
1784 | |||
1785 | case SIOC_WANPIPE_GET_CALL_DATA: | ||
1786 | |||
1787 | return get_ioctl_cmd (sk,(void*)arg); | ||
1788 | |||
1789 | case SIOC_WANPIPE_SET_CALL_DATA: | ||
1790 | |||
1791 | return set_ioctl_cmd (sk,(void*)arg); | ||
1792 | |||
1793 | case SIOC_WANPIPE_ACCEPT_CALL: | ||
1794 | case SIOC_WANPIPE_CLEAR_CALL: | ||
1795 | case SIOC_WANPIPE_RESET_CALL: | ||
1796 | |||
1797 | if ((err=set_ioctl_cmd(sk,(void*)arg)) < 0) | ||
1798 | return err; | ||
1799 | |||
1800 | err=wanpipe_exec_cmd(sk,cmd,0); | ||
1801 | get_ioctl_cmd(sk,(void*)arg); | ||
1802 | return err; | ||
1803 | |||
1804 | case SIOC_WANPIPE_DEBUG: | ||
1805 | |||
1806 | return wanpipe_debug(sk,(void*)arg); | ||
1807 | |||
1808 | case SIOC_WANPIPE_SET_NONBLOCK: | ||
1809 | |||
1810 | if (sk->sk_state != WANSOCK_DISCONNECTED) | ||
1811 | return -EINVAL; | ||
1812 | |||
1813 | sock->file->f_flags |= O_NONBLOCK; | ||
1814 | return 0; | ||
1815 | |||
1816 | #ifdef CONFIG_INET | ||
1817 | case SIOCADDRT: | ||
1818 | case SIOCDELRT: | ||
1819 | case SIOCDARP: | ||
1820 | case SIOCGARP: | ||
1821 | case SIOCSARP: | ||
1822 | case SIOCDRARP: | ||
1823 | case SIOCGRARP: | ||
1824 | case SIOCSRARP: | ||
1825 | case SIOCGIFADDR: | ||
1826 | case SIOCSIFADDR: | ||
1827 | case SIOCGIFBRDADDR: | ||
1828 | case SIOCSIFBRDADDR: | ||
1829 | case SIOCGIFNETMASK: | ||
1830 | case SIOCSIFNETMASK: | ||
1831 | case SIOCGIFDSTADDR: | ||
1832 | case SIOCSIFDSTADDR: | ||
1833 | case SIOCSIFFLAGS: | ||
1834 | return inet_dgram_ops.ioctl(sock, cmd, arg); | ||
1835 | #endif | ||
1836 | |||
1837 | default: | ||
1838 | return -ENOIOCTLCMD; | ||
1839 | } | ||
1840 | /*NOTREACHED*/ | ||
1841 | } | ||
1842 | |||
1843 | /*============================================================ | ||
1844 | * wanpipe_debug | ||
1845 | * | ||
1846 | * This function will pass up information about all | ||
1847 | * active sockets. | ||
1848 | * | ||
1849 | * FIXME: More thought should go into this function. | ||
1850 | * | ||
1851 | *===========================================================*/ | ||
1852 | |||
1853 | static int wanpipe_debug (struct sock *origsk, void *arg) | ||
1854 | { | ||
1855 | struct sock *sk; | ||
1856 | struct hlist_node *node; | ||
1857 | struct net_device *dev = NULL; | ||
1858 | wanpipe_common_t *chan=NULL; | ||
1859 | int cnt=0, err=0; | ||
1860 | wan_debug_t *dbg_data = (wan_debug_t *)arg; | ||
1861 | |||
1862 | sk_for_each(sk, node, &wanpipe_sklist) { | ||
1863 | wanpipe_opt *wp = wp_sk(sk); | ||
1864 | |||
1865 | if (sk == origsk){ | ||
1866 | continue; | ||
1867 | } | ||
1868 | |||
1869 | if ((err=put_user(1, &dbg_data->debug[cnt].free))) | ||
1870 | return err; | ||
1871 | if ((err = put_user(sk->sk_state, | ||
1872 | &dbg_data->debug[cnt].state_sk))) | ||
1873 | return err; | ||
1874 | if ((err = put_user(sk->sk_rcvbuf, | ||
1875 | &dbg_data->debug[cnt].rcvbuf))) | ||
1876 | return err; | ||
1877 | if ((err = put_user(atomic_read(&sk->sk_rmem_alloc), | ||
1878 | &dbg_data->debug[cnt].rmem))) | ||
1879 | return err; | ||
1880 | if ((err = put_user(atomic_read(&sk->sk_wmem_alloc), | ||
1881 | &dbg_data->debug[cnt].wmem))) | ||
1882 | return err; | ||
1883 | if ((err = put_user(sk->sk_sndbuf, | ||
1884 | &dbg_data->debug[cnt].sndbuf))) | ||
1885 | return err; | ||
1886 | if ((err=put_user(sk_count, &dbg_data->debug[cnt].sk_count))) | ||
1887 | return err; | ||
1888 | if ((err=put_user(wp->poll_cnt, &dbg_data->debug[cnt].poll_cnt))) | ||
1889 | return err; | ||
1890 | if ((err = put_user(sk->sk_bound_dev_if, | ||
1891 | &dbg_data->debug[cnt].bound))) | ||
1892 | return err; | ||
1893 | |||
1894 | if (sk->sk_bound_dev_if) { | ||
1895 | dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
1896 | if (!dev) | ||
1897 | continue; | ||
1898 | |||
1899 | chan=dev->priv; | ||
1900 | dev_put(dev); | ||
1901 | |||
1902 | if ((err=put_user(chan->state, &dbg_data->debug[cnt].d_state))) | ||
1903 | return err; | ||
1904 | if ((err=put_user(chan->svc, &dbg_data->debug[cnt].svc))) | ||
1905 | return err; | ||
1906 | |||
1907 | if ((err=put_user(atomic_read(&chan->command), | ||
1908 | &dbg_data->debug[cnt].command))) | ||
1909 | return err; | ||
1910 | |||
1911 | |||
1912 | if (wp){ | ||
1913 | sdla_t *card = (sdla_t*)wp->card; | ||
1914 | |||
1915 | if (card){ | ||
1916 | if ((err=put_user(atomic_read(&card->u.x.command_busy), | ||
1917 | &dbg_data->debug[cnt].cmd_busy))) | ||
1918 | return err; | ||
1919 | } | ||
1920 | |||
1921 | if ((err=put_user(wp->lcn, | ||
1922 | &dbg_data->debug[cnt].lcn))) | ||
1923 | return err; | ||
1924 | |||
1925 | if (wp->mbox) { | ||
1926 | if ((err=put_user(1, &dbg_data->debug[cnt].mbox))) | ||
1927 | return err; | ||
1928 | } | ||
1929 | } | ||
1930 | |||
1931 | if ((err=put_user(atomic_read(&chan->receive_block), | ||
1932 | &dbg_data->debug[cnt].rblock))) | ||
1933 | return err; | ||
1934 | |||
1935 | if (copy_to_user(dbg_data->debug[cnt].name, dev->name, strlen(dev->name))) | ||
1936 | return -EFAULT; | ||
1937 | } | ||
1938 | |||
1939 | if (++cnt == MAX_NUM_DEBUG) | ||
1940 | break; | ||
1941 | } | ||
1942 | return 0; | ||
1943 | } | ||
1944 | |||
1945 | /*============================================================ | ||
1946 | * get_ioctl_cmd | ||
1947 | * | ||
1948 | * Pass up the contents of socket MBOX to the user. | ||
1949 | *===========================================================*/ | ||
1950 | |||
1951 | static int get_ioctl_cmd (struct sock *sk, void *arg) | ||
1952 | { | ||
1953 | x25api_t *usr_data = (x25api_t *)arg; | ||
1954 | mbox_cmd_t *mbox_ptr; | ||
1955 | int err; | ||
1956 | |||
1957 | if (usr_data == NULL) | ||
1958 | return -EINVAL; | ||
1959 | |||
1960 | if (!wp_sk(sk)->mbox) { | ||
1961 | return -EINVAL; | ||
1962 | } | ||
1963 | |||
1964 | mbox_ptr = (mbox_cmd_t *)wp_sk(sk)->mbox; | ||
1965 | |||
1966 | if ((err=put_user(mbox_ptr->cmd.qdm, &usr_data->hdr.qdm))) | ||
1967 | return err; | ||
1968 | if ((err=put_user(mbox_ptr->cmd.cause, &usr_data->hdr.cause))) | ||
1969 | return err; | ||
1970 | if ((err=put_user(mbox_ptr->cmd.diagn, &usr_data->hdr.diagn))) | ||
1971 | return err; | ||
1972 | if ((err=put_user(mbox_ptr->cmd.length, &usr_data->hdr.length))) | ||
1973 | return err; | ||
1974 | if ((err=put_user(mbox_ptr->cmd.result, &usr_data->hdr.result))) | ||
1975 | return err; | ||
1976 | if ((err=put_user(mbox_ptr->cmd.lcn, &usr_data->hdr.lcn))) | ||
1977 | return err; | ||
1978 | |||
1979 | if (mbox_ptr->cmd.length > 0){ | ||
1980 | if (mbox_ptr->cmd.length > X25_MAX_DATA) | ||
1981 | return -EINVAL; | ||
1982 | |||
1983 | if (copy_to_user(usr_data->data, mbox_ptr->data, mbox_ptr->cmd.length)){ | ||
1984 | printk(KERN_INFO "wansock: Copy failed !!!\n"); | ||
1985 | return -EFAULT; | ||
1986 | } | ||
1987 | } | ||
1988 | return 0; | ||
1989 | } | ||
1990 | |||
1991 | /*============================================================ | ||
1992 | * set_ioctl_cmd | ||
1993 | * | ||
1994 | * Before command can be execute, socket MBOX must | ||
1995 | * be created, and initialized with user data. | ||
1996 | *===========================================================*/ | ||
1997 | |||
1998 | static int set_ioctl_cmd (struct sock *sk, void *arg) | ||
1999 | { | ||
2000 | x25api_t *usr_data = (x25api_t *)arg; | ||
2001 | mbox_cmd_t *mbox_ptr; | ||
2002 | int err; | ||
2003 | |||
2004 | if (!wp_sk(sk)->mbox) { | ||
2005 | void *mbox_ptr; | ||
2006 | struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
2007 | if (!dev) | ||
2008 | return -ENODEV; | ||
2009 | |||
2010 | dev_put(dev); | ||
2011 | |||
2012 | if ((mbox_ptr = kzalloc(sizeof(mbox_cmd_t), GFP_ATOMIC)) == NULL) | ||
2013 | return -ENOMEM; | ||
2014 | |||
2015 | wp_sk(sk)->mbox = mbox_ptr; | ||
2016 | |||
2017 | wanpipe_link_driver(dev,sk); | ||
2018 | } | ||
2019 | |||
2020 | mbox_ptr = (mbox_cmd_t*)wp_sk(sk)->mbox; | ||
2021 | memset(mbox_ptr, 0, sizeof(mbox_cmd_t)); | ||
2022 | |||
2023 | if (usr_data == NULL){ | ||
2024 | return 0; | ||
2025 | } | ||
2026 | if ((err=get_user(mbox_ptr->cmd.qdm, &usr_data->hdr.qdm))) | ||
2027 | return err; | ||
2028 | if ((err=get_user(mbox_ptr->cmd.cause, &usr_data->hdr.cause))) | ||
2029 | return err; | ||
2030 | if ((err=get_user(mbox_ptr->cmd.diagn, &usr_data->hdr.diagn))) | ||
2031 | return err; | ||
2032 | if ((err=get_user(mbox_ptr->cmd.length, &usr_data->hdr.length))) | ||
2033 | return err; | ||
2034 | if ((err=get_user(mbox_ptr->cmd.result, &usr_data->hdr.result))) | ||
2035 | return err; | ||
2036 | |||
2037 | if (mbox_ptr->cmd.length > 0){ | ||
2038 | if (mbox_ptr->cmd.length > X25_MAX_DATA) | ||
2039 | return -EINVAL; | ||
2040 | |||
2041 | if (copy_from_user(mbox_ptr->data, usr_data->data, mbox_ptr->cmd.length)){ | ||
2042 | printk(KERN_INFO "Copy failed\n"); | ||
2043 | return -EFAULT; | ||
2044 | } | ||
2045 | } | ||
2046 | return 0; | ||
2047 | } | ||
2048 | |||
2049 | |||
2050 | /*====================================================================== | ||
2051 | * wanpipe_poll | ||
2052 | * | ||
2053 | * Datagram poll: Again totally generic. This also handles | ||
2054 | * sequenced packet sockets providing the socket receive queue | ||
2055 | * is only ever holding data ready to receive. | ||
2056 | * | ||
2057 | * Note: when you _don't_ use this routine for this protocol, | ||
2058 | * and you use a different write policy from sock_writeable() | ||
2059 | * then please supply your own write_space callback. | ||
2060 | *=====================================================================*/ | ||
2061 | |||
2062 | unsigned int wanpipe_poll(struct file * file, struct socket *sock, poll_table *wait) | ||
2063 | { | ||
2064 | struct sock *sk = sock->sk; | ||
2065 | unsigned int mask; | ||
2066 | |||
2067 | ++wp_sk(sk)->poll_cnt; | ||
2068 | |||
2069 | poll_wait(file, sk->sk_sleep, wait); | ||
2070 | mask = 0; | ||
2071 | |||
2072 | /* exceptional events? */ | ||
2073 | if (sk->sk_err || !skb_queue_empty(&sk->sk_error_queue)) { | ||
2074 | mask |= POLLPRI; | ||
2075 | return mask; | ||
2076 | } | ||
2077 | if (sk->sk_shutdown & RCV_SHUTDOWN) | ||
2078 | mask |= POLLHUP; | ||
2079 | |||
2080 | /* readable? */ | ||
2081 | if (!skb_queue_empty(&sk->sk_receive_queue)) { | ||
2082 | mask |= POLLIN | POLLRDNORM; | ||
2083 | } | ||
2084 | |||
2085 | /* connection hasn't started yet */ | ||
2086 | if (sk->sk_state == WANSOCK_CONNECTING) { | ||
2087 | return mask; | ||
2088 | } | ||
2089 | |||
2090 | if (sk->sk_state == WANSOCK_DISCONNECTED) { | ||
2091 | mask = POLLPRI; | ||
2092 | return mask; | ||
2093 | } | ||
2094 | |||
2095 | /* This check blocks the user process if there is | ||
2096 | * a packet already queued in the socket write queue. | ||
2097 | * This option is only for X25API protocol, for other | ||
2098 | * protocol like chdlc enable streaming mode, | ||
2099 | * where multiple packets can be pending in the socket | ||
2100 | * transmit queue */ | ||
2101 | |||
2102 | if (wp_sk(sk)->num == htons(X25_PROT)) { | ||
2103 | if (atomic_read(&wp_sk(sk)->packet_sent)) | ||
2104 | return mask; | ||
2105 | } | ||
2106 | |||
2107 | /* writable? */ | ||
2108 | if (sock_writeable(sk)){ | ||
2109 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; | ||
2110 | }else{ | ||
2111 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); | ||
2112 | } | ||
2113 | |||
2114 | return mask; | ||
2115 | } | ||
2116 | |||
2117 | /*====================================================================== | ||
2118 | * wanpipe_listen | ||
2119 | * | ||
2120 | * X25API Specific function. Set a socket into LISTENING MODE. | ||
2121 | *=====================================================================*/ | ||
2122 | |||
2123 | |||
2124 | static int wanpipe_listen(struct socket *sock, int backlog) | ||
2125 | { | ||
2126 | struct sock *sk = sock->sk; | ||
2127 | |||
2128 | /* This is x25 specific area if protocol doesn't | ||
2129 | * match, return error */ | ||
2130 | if (wp_sk(sk)->num != htons(X25_PROT)) | ||
2131 | return -EINVAL; | ||
2132 | |||
2133 | if (sk->sk_state == WANSOCK_BIND_LISTEN) { | ||
2134 | |||
2135 | sk->sk_max_ack_backlog = backlog; | ||
2136 | sk->sk_state = WANSOCK_LISTEN; | ||
2137 | return 0; | ||
2138 | }else{ | ||
2139 | printk(KERN_INFO "wansock: Listening sock was not binded\n"); | ||
2140 | } | ||
2141 | |||
2142 | return -EINVAL; | ||
2143 | } | ||
2144 | |||
2145 | /*====================================================================== | ||
2146 | * wanpipe_link_card | ||
2147 | * | ||
2148 | * Connects the listening socket to the driver | ||
2149 | *=====================================================================*/ | ||
2150 | |||
2151 | static int wanpipe_link_card (struct sock *sk) | ||
2152 | { | ||
2153 | sdla_t *card = (sdla_t*)wp_sk(sk)->card; | ||
2154 | |||
2155 | if (!card) | ||
2156 | return -ENOMEM; | ||
2157 | |||
2158 | if ((card->sk != NULL) || (card->func != NULL)){ | ||
2159 | printk(KERN_INFO "wansock: Listening queue is already established\n"); | ||
2160 | return -EINVAL; | ||
2161 | } | ||
2162 | |||
2163 | card->sk=sk; | ||
2164 | card->func=wanpipe_listen_rcv; | ||
2165 | sock_set_flag(sk, SOCK_ZAPPED); | ||
2166 | |||
2167 | return 0; | ||
2168 | } | ||
2169 | |||
2170 | /*====================================================================== | ||
2171 | * wanpipe_listen | ||
2172 | * | ||
2173 | * X25API Specific function. Disconnect listening socket from | ||
2174 | * the driver. | ||
2175 | *=====================================================================*/ | ||
2176 | |||
2177 | static void wanpipe_unlink_card (struct sock *sk) | ||
2178 | { | ||
2179 | sdla_t *card = (sdla_t*)wp_sk(sk)->card; | ||
2180 | |||
2181 | if (card){ | ||
2182 | card->sk=NULL; | ||
2183 | card->func=NULL; | ||
2184 | } | ||
2185 | } | ||
2186 | |||
2187 | /*====================================================================== | ||
2188 | * wanpipe_exec_cmd | ||
2189 | * | ||
2190 | * Ioctl function calls this function to execute user command. | ||
2191 | * Connect() sytem call also calls this function to execute | ||
2192 | * place call. This function blocks until command is executed. | ||
2193 | *=====================================================================*/ | ||
2194 | |||
2195 | static int wanpipe_exec_cmd(struct sock *sk, int cmd, unsigned int flags) | ||
2196 | { | ||
2197 | int err = -EINVAL; | ||
2198 | wanpipe_opt *wp = wp_sk(sk); | ||
2199 | mbox_cmd_t *mbox_ptr = (mbox_cmd_t*)wp->mbox; | ||
2200 | |||
2201 | if (!mbox_ptr){ | ||
2202 | printk(KERN_INFO "NO MBOX PTR !!!!!\n"); | ||
2203 | return -EINVAL; | ||
2204 | } | ||
2205 | |||
2206 | /* This is x25 specific area if protocol doesn't | ||
2207 | * match, return error */ | ||
2208 | if (wp->num != htons(X25_PROT)) | ||
2209 | return -EINVAL; | ||
2210 | |||
2211 | |||
2212 | switch (cmd){ | ||
2213 | |||
2214 | case SIOC_WANPIPE_ACCEPT_CALL: | ||
2215 | |||
2216 | if (sk->sk_state != WANSOCK_CONNECTING) { | ||
2217 | err = -EHOSTDOWN; | ||
2218 | break; | ||
2219 | } | ||
2220 | |||
2221 | err = execute_command(sk,X25_ACCEPT_CALL,0); | ||
2222 | if (err < 0) | ||
2223 | break; | ||
2224 | |||
2225 | /* Update. Mar6 2000. | ||
2226 | * Do not set the sock lcn number here, since | ||
2227 | * it is done in wanpipe_listen_rcv(). | ||
2228 | */ | ||
2229 | if (sk->sk_state == WANSOCK_CONNECTED) { | ||
2230 | wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn; | ||
2231 | DBG_PRINTK(KERN_INFO "\nwansock: Accept OK %i\n", | ||
2232 | wp->lcn); | ||
2233 | err = 0; | ||
2234 | |||
2235 | }else{ | ||
2236 | DBG_PRINTK (KERN_INFO "\nwansock: Accept Failed %i\n", | ||
2237 | wp->lcn); | ||
2238 | wp->lcn = 0; | ||
2239 | err = -ECONNREFUSED; | ||
2240 | } | ||
2241 | break; | ||
2242 | |||
2243 | case SIOC_WANPIPE_CLEAR_CALL: | ||
2244 | |||
2245 | if (sk->sk_state == WANSOCK_DISCONNECTED) { | ||
2246 | err = -EINVAL; | ||
2247 | break; | ||
2248 | } | ||
2249 | |||
2250 | |||
2251 | /* Check if data buffers are pending for transmission, | ||
2252 | * if so, check whether user wants to wait until data | ||
2253 | * is transmitted, or clear a call and drop packets */ | ||
2254 | |||
2255 | if (atomic_read(&sk->sk_wmem_alloc) || | ||
2256 | check_driver_busy(sk)) { | ||
2257 | mbox_cmd_t *mbox = wp->mbox; | ||
2258 | if (mbox->cmd.qdm & 0x80){ | ||
2259 | mbox->cmd.result = 0x35; | ||
2260 | err = -EAGAIN; | ||
2261 | break; | ||
2262 | } | ||
2263 | } | ||
2264 | |||
2265 | sk->sk_state = WANSOCK_DISCONNECTING; | ||
2266 | |||
2267 | err = execute_command(sk,X25_CLEAR_CALL,0); | ||
2268 | if (err < 0) | ||
2269 | break; | ||
2270 | |||
2271 | err = -ECONNREFUSED; | ||
2272 | if (sk->sk_state == WANSOCK_DISCONNECTED) { | ||
2273 | DBG_PRINTK(KERN_INFO "\nwansock: CLEAR OK %i\n", | ||
2274 | wp->lcn); | ||
2275 | wp->lcn = 0; | ||
2276 | err = 0; | ||
2277 | } | ||
2278 | break; | ||
2279 | |||
2280 | case SIOC_WANPIPE_RESET_CALL: | ||
2281 | |||
2282 | if (sk->sk_state != WANSOCK_CONNECTED) { | ||
2283 | err = -EINVAL; | ||
2284 | break; | ||
2285 | } | ||
2286 | |||
2287 | |||
2288 | /* Check if data buffers are pending for transmission, | ||
2289 | * if so, check whether user wants to wait until data | ||
2290 | * is transmitted, or reset a call and drop packets */ | ||
2291 | |||
2292 | if (atomic_read(&sk->sk_wmem_alloc) || | ||
2293 | check_driver_busy(sk)) { | ||
2294 | mbox_cmd_t *mbox = wp->mbox; | ||
2295 | if (mbox->cmd.qdm & 0x80){ | ||
2296 | mbox->cmd.result = 0x35; | ||
2297 | err = -EAGAIN; | ||
2298 | break; | ||
2299 | } | ||
2300 | } | ||
2301 | |||
2302 | |||
2303 | err = execute_command(sk, X25_RESET,0); | ||
2304 | if (err < 0) | ||
2305 | break; | ||
2306 | |||
2307 | err = mbox_ptr->cmd.result; | ||
2308 | break; | ||
2309 | |||
2310 | |||
2311 | case X25_PLACE_CALL: | ||
2312 | |||
2313 | err=execute_command(sk,X25_PLACE_CALL,flags); | ||
2314 | if (err < 0) | ||
2315 | break; | ||
2316 | |||
2317 | if (sk->sk_state == WANSOCK_CONNECTED) { | ||
2318 | |||
2319 | wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn; | ||
2320 | |||
2321 | DBG_PRINTK(KERN_INFO "\nwansock: PLACE CALL OK %i\n", | ||
2322 | wp->lcn); | ||
2323 | err = 0; | ||
2324 | |||
2325 | } else if (sk->sk_state == WANSOCK_CONNECTING && | ||
2326 | (flags & O_NONBLOCK)) { | ||
2327 | wp->lcn = ((mbox_cmd_t*)wp->mbox)->cmd.lcn; | ||
2328 | DBG_PRINTK(KERN_INFO "\nwansock: Place Call OK: Waiting %i\n", | ||
2329 | wp->lcn); | ||
2330 | |||
2331 | err = 0; | ||
2332 | |||
2333 | }else{ | ||
2334 | DBG_PRINTK(KERN_INFO "\nwansock: Place call Failed\n"); | ||
2335 | err = -ECONNREFUSED; | ||
2336 | } | ||
2337 | |||
2338 | break; | ||
2339 | |||
2340 | default: | ||
2341 | return -EINVAL; | ||
2342 | } | ||
2343 | |||
2344 | return err; | ||
2345 | } | ||
2346 | |||
2347 | static int check_driver_busy (struct sock *sk) | ||
2348 | { | ||
2349 | struct net_device *dev = dev_get_by_index(sk->sk_bound_dev_if); | ||
2350 | wanpipe_common_t *chan; | ||
2351 | |||
2352 | if (!dev) | ||
2353 | return 0; | ||
2354 | |||
2355 | dev_put(dev); | ||
2356 | |||
2357 | if ((chan=dev->priv) == NULL) | ||
2358 | return 0; | ||
2359 | |||
2360 | return atomic_read(&chan->driver_busy); | ||
2361 | } | ||
2362 | |||
2363 | |||
2364 | /*====================================================================== | ||
2365 | * wanpipe_accept | ||
2366 | * | ||
2367 | * ACCEPT() System call. X25API Specific function. | ||
2368 | * For each incoming call, create a new socket and | ||
2369 | * return it to the user. | ||
2370 | *=====================================================================*/ | ||
2371 | |||
2372 | static int wanpipe_accept(struct socket *sock, struct socket *newsock, int flags) | ||
2373 | { | ||
2374 | struct sock *sk; | ||
2375 | struct sock *newsk; | ||
2376 | struct sk_buff *skb; | ||
2377 | DECLARE_WAITQUEUE(wait, current); | ||
2378 | int err=0; | ||
2379 | |||
2380 | if (newsock->sk != NULL){ | ||
2381 | wanpipe_kill_sock_accept(newsock->sk); | ||
2382 | newsock->sk=NULL; | ||
2383 | } | ||
2384 | |||
2385 | if ((sk = sock->sk) == NULL) | ||
2386 | return -EINVAL; | ||
2387 | |||
2388 | if (sk->sk_type != SOCK_RAW) | ||
2389 | return -EOPNOTSUPP; | ||
2390 | |||
2391 | if (sk->sk_state != WANSOCK_LISTEN) | ||
2392 | return -EINVAL; | ||
2393 | |||
2394 | if (wp_sk(sk)->num != htons(X25_PROT)) | ||
2395 | return -EINVAL; | ||
2396 | |||
2397 | add_wait_queue(sk->sk_sleep,&wait); | ||
2398 | current->state = TASK_INTERRUPTIBLE; | ||
2399 | for (;;){ | ||
2400 | skb = skb_dequeue(&sk->sk_receive_queue); | ||
2401 | if (skb){ | ||
2402 | err=0; | ||
2403 | break; | ||
2404 | } | ||
2405 | if (signal_pending(current)) { | ||
2406 | err = -ERESTARTSYS; | ||
2407 | break; | ||
2408 | } | ||
2409 | schedule(); | ||
2410 | } | ||
2411 | current->state = TASK_RUNNING; | ||
2412 | remove_wait_queue(sk->sk_sleep,&wait); | ||
2413 | |||
2414 | if (err != 0) | ||
2415 | return err; | ||
2416 | |||
2417 | newsk = get_newsk_from_skb(skb); | ||
2418 | if (!newsk){ | ||
2419 | return -EINVAL; | ||
2420 | } | ||
2421 | |||
2422 | set_bit(1,&wanpipe_tx_critical); | ||
2423 | write_lock(&wanpipe_sklist_lock); | ||
2424 | sk_add_node(newsk, &wanpipe_sklist); | ||
2425 | write_unlock(&wanpipe_sklist_lock); | ||
2426 | clear_bit(1,&wanpipe_tx_critical); | ||
2427 | |||
2428 | newsk->sk_socket = newsock; | ||
2429 | newsk->sk_sleep = &newsock->wait; | ||
2430 | |||
2431 | /* Now attach up the new socket */ | ||
2432 | sk->sk_ack_backlog--; | ||
2433 | newsock->sk = newsk; | ||
2434 | |||
2435 | kfree_skb(skb); | ||
2436 | |||
2437 | DBG_PRINTK(KERN_INFO "\nwansock: ACCEPT Got LCN %i\n", | ||
2438 | wp_sk(newsk)->lcn); | ||
2439 | return 0; | ||
2440 | } | ||
2441 | |||
2442 | /*====================================================================== | ||
2443 | * get_newsk_from_skb | ||
2444 | * | ||
2445 | * Accept() uses this function to get the address of the new | ||
2446 | * socket structure. | ||
2447 | *=====================================================================*/ | ||
2448 | |||
2449 | struct sock * get_newsk_from_skb (struct sk_buff *skb) | ||
2450 | { | ||
2451 | struct net_device *dev = skb->dev; | ||
2452 | wanpipe_common_t *chan; | ||
2453 | |||
2454 | if (!dev){ | ||
2455 | return NULL; | ||
2456 | } | ||
2457 | |||
2458 | if ((chan = dev->priv) == NULL){ | ||
2459 | return NULL; | ||
2460 | } | ||
2461 | |||
2462 | if (!chan->sk){ | ||
2463 | return NULL; | ||
2464 | } | ||
2465 | return (struct sock *)chan->sk; | ||
2466 | } | ||
2467 | |||
2468 | /*====================================================================== | ||
2469 | * wanpipe_connect | ||
2470 | * | ||
2471 | * CONNECT() System Call. X25API specific function | ||
2472 | * Check the state of the sock, and execute PLACE_CALL command. | ||
2473 | * Connect can ether block or return without waiting for connection, | ||
2474 | * if specified by user. | ||
2475 | *=====================================================================*/ | ||
2476 | |||
2477 | static int wanpipe_connect(struct socket *sock, struct sockaddr *uaddr, int addr_len, int flags) | ||
2478 | { | ||
2479 | struct sock *sk = sock->sk; | ||
2480 | struct wan_sockaddr_ll *addr = (struct wan_sockaddr_ll*)uaddr; | ||
2481 | struct net_device *dev; | ||
2482 | int err; | ||
2483 | |||
2484 | if (wp_sk(sk)->num != htons(X25_PROT)) | ||
2485 | return -EINVAL; | ||
2486 | |||
2487 | if (sk->sk_state == WANSOCK_CONNECTED) | ||
2488 | return -EISCONN; /* No reconnect on a seqpacket socket */ | ||
2489 | |||
2490 | if (sk->sk_state != WAN_DISCONNECTED) { | ||
2491 | printk(KERN_INFO "wansock: Trying to connect on channel NON DISCONNECT\n"); | ||
2492 | return -ECONNREFUSED; | ||
2493 | } | ||
2494 | |||
2495 | sk->sk_state = WANSOCK_DISCONNECTED; | ||
2496 | sock->state = SS_UNCONNECTED; | ||
2497 | |||
2498 | if (addr_len != sizeof(struct wan_sockaddr_ll)) | ||
2499 | return -EINVAL; | ||
2500 | |||
2501 | if (addr->sll_family != AF_WANPIPE) | ||
2502 | return -EINVAL; | ||
2503 | |||
2504 | if ((dev = dev_get_by_index(sk->sk_bound_dev_if)) == NULL) | ||
2505 | return -ENETUNREACH; | ||
2506 | |||
2507 | dev_put(dev); | ||
2508 | |||
2509 | if (!sock_flag(sk, SOCK_ZAPPED)) /* Must bind first - autobinding does not work */ | ||
2510 | return -EINVAL; | ||
2511 | |||
2512 | sock->state = SS_CONNECTING; | ||
2513 | sk->sk_state = WANSOCK_CONNECTING; | ||
2514 | |||
2515 | if (!wp_sk(sk)->mbox) { | ||
2516 | if (wp_sk (sk)->svc) | ||
2517 | return -EINVAL; | ||
2518 | else { | ||
2519 | int err; | ||
2520 | if ((err=set_ioctl_cmd(sk,NULL)) < 0) | ||
2521 | return err; | ||
2522 | } | ||
2523 | } | ||
2524 | |||
2525 | if ((err=wanpipe_exec_cmd(sk, X25_PLACE_CALL,flags)) != 0){ | ||
2526 | sock->state = SS_UNCONNECTED; | ||
2527 | sk->sk_state = WANSOCK_CONNECTED; | ||
2528 | return err; | ||
2529 | } | ||
2530 | |||
2531 | if (sk->sk_state != WANSOCK_CONNECTED && (flags & O_NONBLOCK)) { | ||
2532 | return 0; | ||
2533 | } | ||
2534 | |||
2535 | if (sk->sk_state != WANSOCK_CONNECTED) { | ||
2536 | sock->state = SS_UNCONNECTED; | ||
2537 | return -ECONNREFUSED; | ||
2538 | } | ||
2539 | |||
2540 | sock->state = SS_CONNECTED; | ||
2541 | return 0; | ||
2542 | } | ||
2543 | |||
2544 | const struct proto_ops wanpipe_ops = { | ||
2545 | .family = PF_WANPIPE, | ||
2546 | .owner = THIS_MODULE, | ||
2547 | .release = wanpipe_release, | ||
2548 | .bind = wanpipe_bind, | ||
2549 | .connect = wanpipe_connect, | ||
2550 | .socketpair = sock_no_socketpair, | ||
2551 | .accept = wanpipe_accept, | ||
2552 | .getname = wanpipe_getname, | ||
2553 | .poll = wanpipe_poll, | ||
2554 | .ioctl = wanpipe_ioctl, | ||
2555 | .listen = wanpipe_listen, | ||
2556 | .shutdown = sock_no_shutdown, | ||
2557 | .setsockopt = sock_no_setsockopt, | ||
2558 | .getsockopt = sock_no_getsockopt, | ||
2559 | .sendmsg = wanpipe_sendmsg, | ||
2560 | .recvmsg = wanpipe_recvmsg | ||
2561 | }; | ||
2562 | |||
2563 | static struct net_proto_family wanpipe_family_ops = { | ||
2564 | .family = PF_WANPIPE, | ||
2565 | .create = wanpipe_create, | ||
2566 | .owner = THIS_MODULE, | ||
2567 | }; | ||
2568 | |||
2569 | struct notifier_block wanpipe_netdev_notifier = { | ||
2570 | .notifier_call = wanpipe_notifier, | ||
2571 | }; | ||
2572 | |||
2573 | |||
2574 | #ifdef MODULE | ||
2575 | void cleanup_module(void) | ||
2576 | { | ||
2577 | printk(KERN_INFO "wansock: Cleaning up \n"); | ||
2578 | unregister_netdevice_notifier(&wanpipe_netdev_notifier); | ||
2579 | sock_unregister(PF_WANPIPE); | ||
2580 | proto_unregister(&wanpipe_proto); | ||
2581 | } | ||
2582 | |||
2583 | int init_module(void) | ||
2584 | { | ||
2585 | int rc; | ||
2586 | |||
2587 | printk(KERN_INFO "wansock: Registering Socket \n"); | ||
2588 | |||
2589 | rc = proto_register(&wanpipe_proto, 0); | ||
2590 | if (rc != 0) | ||
2591 | goto out; | ||
2592 | |||
2593 | sock_register(&wanpipe_family_ops); | ||
2594 | register_netdevice_notifier(&wanpipe_netdev_notifier); | ||
2595 | out: | ||
2596 | return rc; | ||
2597 | } | ||
2598 | #endif | ||
2599 | MODULE_LICENSE("GPL"); | ||
2600 | MODULE_ALIAS_NETPROTO(PF_WANPIPE); | ||
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index a35f9e4ede26..5c5f6dcab974 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c | |||
@@ -704,7 +704,8 @@ static struct xfrm_state *__find_acq_core(unsigned short family, u8 mode, u32 re | |||
704 | x->props.mode != mode || | 704 | x->props.mode != mode || |
705 | x->props.family != family || | 705 | x->props.family != family || |
706 | x->km.state != XFRM_STATE_ACQ || | 706 | x->km.state != XFRM_STATE_ACQ || |
707 | x->id.spi != 0) | 707 | x->id.spi != 0 || |
708 | x->id.proto != proto) | ||
708 | continue; | 709 | continue; |
709 | 710 | ||
710 | switch (family) { | 711 | switch (family) { |
@@ -801,7 +802,8 @@ int xfrm_state_add(struct xfrm_state *x) | |||
801 | 802 | ||
802 | if (use_spi && x->km.seq) { | 803 | if (use_spi && x->km.seq) { |
803 | x1 = __xfrm_find_acq_byseq(x->km.seq); | 804 | x1 = __xfrm_find_acq_byseq(x->km.seq); |
804 | if (x1 && xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family)) { | 805 | if (x1 && ((x1->id.proto != x->id.proto) || |
806 | xfrm_addr_cmp(&x1->id.daddr, &x->id.daddr, family))) { | ||
805 | xfrm_state_put(x1); | 807 | xfrm_state_put(x1); |
806 | x1 = NULL; | 808 | x1 = NULL; |
807 | } | 809 | } |
diff --git a/security/dummy.c b/security/dummy.c index 558795b237d6..8ffd76405b5b 100644 --- a/security/dummy.c +++ b/security/dummy.c | |||
@@ -907,7 +907,7 @@ static void dummy_d_instantiate (struct dentry *dentry, struct inode *inode) | |||
907 | return; | 907 | return; |
908 | } | 908 | } |
909 | 909 | ||
910 | static int dummy_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | 910 | static int dummy_getprocattr(struct task_struct *p, char *name, char **value) |
911 | { | 911 | { |
912 | return -EINVAL; | 912 | return -EINVAL; |
913 | } | 913 | } |
diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 19a385e9968e..d41e24d6ae41 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c | |||
@@ -4468,11 +4468,12 @@ static void selinux_d_instantiate (struct dentry *dentry, struct inode *inode) | |||
4468 | } | 4468 | } |
4469 | 4469 | ||
4470 | static int selinux_getprocattr(struct task_struct *p, | 4470 | static int selinux_getprocattr(struct task_struct *p, |
4471 | char *name, void *value, size_t size) | 4471 | char *name, char **value) |
4472 | { | 4472 | { |
4473 | struct task_security_struct *tsec; | 4473 | struct task_security_struct *tsec; |
4474 | u32 sid; | 4474 | u32 sid; |
4475 | int error; | 4475 | int error; |
4476 | unsigned len; | ||
4476 | 4477 | ||
4477 | if (current != p) { | 4478 | if (current != p) { |
4478 | error = task_has_perm(current, p, PROCESS__GETATTR); | 4479 | error = task_has_perm(current, p, PROCESS__GETATTR); |
@@ -4500,7 +4501,10 @@ static int selinux_getprocattr(struct task_struct *p, | |||
4500 | if (!sid) | 4501 | if (!sid) |
4501 | return 0; | 4502 | return 0; |
4502 | 4503 | ||
4503 | return selinux_getsecurity(sid, value, size); | 4504 | error = security_sid_to_context(sid, value, &len); |
4505 | if (error) | ||
4506 | return error; | ||
4507 | return len; | ||
4504 | } | 4508 | } |
4505 | 4509 | ||
4506 | static int selinux_setprocattr(struct task_struct *p, | 4510 | static int selinux_setprocattr(struct task_struct *p, |
diff --git a/sound/oss/dmasound/dmasound_core.c b/sound/oss/dmasound/dmasound_core.c index a0ec886f2aa3..f4056a9c371b 100644 --- a/sound/oss/dmasound/dmasound_core.c +++ b/sound/oss/dmasound/dmasound_core.c | |||
@@ -1346,22 +1346,34 @@ static const struct file_operations sq_fops = | |||
1346 | .ioctl = sq_ioctl, | 1346 | .ioctl = sq_ioctl, |
1347 | .open = sq_open, | 1347 | .open = sq_open, |
1348 | .release = sq_release, | 1348 | .release = sq_release, |
1349 | }; | ||
1350 | |||
1349 | #ifdef HAS_RECORD | 1351 | #ifdef HAS_RECORD |
1350 | .read = NULL /* default to no read for compat mode */ | 1352 | static const struct file_operations sq_fops_record = |
1351 | #endif | 1353 | { |
1354 | .owner = THIS_MODULE, | ||
1355 | .llseek = no_llseek, | ||
1356 | .write = sq_write, | ||
1357 | .poll = sq_poll, | ||
1358 | .ioctl = sq_ioctl, | ||
1359 | .open = sq_open, | ||
1360 | .release = sq_release, | ||
1361 | .read = sq_read, | ||
1352 | }; | 1362 | }; |
1363 | #endif | ||
1353 | 1364 | ||
1354 | static int sq_init(void) | 1365 | static int sq_init(void) |
1355 | { | 1366 | { |
1367 | const struct file_operations *fops = &sq_fops; | ||
1356 | #ifndef MODULE | 1368 | #ifndef MODULE |
1357 | int sq_unit; | 1369 | int sq_unit; |
1358 | #endif | 1370 | #endif |
1359 | 1371 | ||
1360 | #ifdef HAS_RECORD | 1372 | #ifdef HAS_RECORD |
1361 | if (dmasound.mach.record) | 1373 | if (dmasound.mach.record) |
1362 | sq_fops.read = sq_read ; | 1374 | fops = &sq_fops_record; |
1363 | #endif | 1375 | #endif |
1364 | sq_unit = register_sound_dsp(&sq_fops, -1); | 1376 | sq_unit = register_sound_dsp(fops, -1); |
1365 | if (sq_unit < 0) { | 1377 | if (sq_unit < 0) { |
1366 | printk(KERN_ERR "dmasound_core: couldn't register fops\n") ; | 1378 | printk(KERN_ERR "dmasound_core: couldn't register fops\n") ; |
1367 | return sq_unit ; | 1379 | return sq_unit ; |
diff --git a/sound/pci/ac97/ac97_patch.c b/sound/pci/ac97/ac97_patch.c index 37fabf75daa7..b188a4df58cb 100644 --- a/sound/pci/ac97/ac97_patch.c +++ b/sound/pci/ac97/ac97_patch.c | |||
@@ -1962,9 +1962,11 @@ static int snd_ac97_ad1888_downmix_put(struct snd_kcontrol *kcontrol, struct snd | |||
1962 | static void ad1888_update_jacks(struct snd_ac97 *ac97) | 1962 | static void ad1888_update_jacks(struct snd_ac97 *ac97) |
1963 | { | 1963 | { |
1964 | unsigned short val = 0; | 1964 | unsigned short val = 0; |
1965 | if (! is_shared_linein(ac97)) | 1965 | /* clear LODIS if shared jack is to be used for Surround out */ |
1966 | if (is_shared_linein(ac97)) | ||
1966 | val |= (1 << 12); | 1967 | val |= (1 << 12); |
1967 | if (! is_shared_micin(ac97)) | 1968 | /* clear CLDIS if shared jack is to be used for C/LFE out */ |
1969 | if (is_shared_micin(ac97)) | ||
1968 | val |= (1 << 11); | 1970 | val |= (1 << 11); |
1969 | /* shared Line-In */ | 1971 | /* shared Line-In */ |
1970 | snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); | 1972 | snd_ac97_update_bits(ac97, AC97_AD_MISC, (1 << 11) | (1 << 12), val); |
@@ -2136,8 +2138,9 @@ static const struct snd_kcontrol_new snd_ac97_ad1985_controls[] = { | |||
2136 | static void ad1985_update_jacks(struct snd_ac97 *ac97) | 2138 | static void ad1985_update_jacks(struct snd_ac97 *ac97) |
2137 | { | 2139 | { |
2138 | ad1888_update_jacks(ac97); | 2140 | ad1888_update_jacks(ac97); |
2141 | /* clear OMS if shared jack is to be used for C/LFE out */ | ||
2139 | snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, | 2142 | snd_ac97_update_bits(ac97, AC97_AD_SERIAL_CFG, 1 << 9, |
2140 | is_shared_micin(ac97) ? 0 : 1 << 9); | 2143 | is_shared_micin(ac97) ? 1 << 9 : 0); |
2141 | } | 2144 | } |
2142 | 2145 | ||
2143 | static int patch_ad1985_specific(struct snd_ac97 *ac97) | 2146 | static int patch_ad1985_specific(struct snd_ac97 *ac97) |
@@ -2418,9 +2421,9 @@ static void ad1986_update_jacks(struct snd_ac97 *ac97) | |||
2418 | unsigned short ser_val; | 2421 | unsigned short ser_val; |
2419 | 2422 | ||
2420 | /* disable SURROUND and CENTER/LFE if not surround mode */ | 2423 | /* disable SURROUND and CENTER/LFE if not surround mode */ |
2421 | if (! is_surround_on(ac97)) | 2424 | if (!is_surround_on(ac97)) |
2422 | misc_val |= AC97_AD1986_SODIS; | 2425 | misc_val |= AC97_AD1986_SODIS; |
2423 | if (! is_clfe_on(ac97)) | 2426 | if (!is_clfe_on(ac97)) |
2424 | misc_val |= AC97_AD1986_CLDIS; | 2427 | misc_val |= AC97_AD1986_CLDIS; |
2425 | 2428 | ||
2426 | /* select line input (default=LINE_IN, SURROUND or MIC_1/2) */ | 2429 | /* select line input (default=LINE_IN, SURROUND or MIC_1/2) */ |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index b9a8e238b0a8..1672cace1ae7 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -199,7 +199,6 @@ enum { SDI0, SDI1, SDI2, SDI3, SDO0, SDO1, SDO2, SDO3 }; | |||
199 | 199 | ||
200 | /* STATESTS int mask: SD2,SD1,SD0 */ | 200 | /* STATESTS int mask: SD2,SD1,SD0 */ |
201 | #define STATESTS_INT_MASK 0x07 | 201 | #define STATESTS_INT_MASK 0x07 |
202 | #define AZX_MAX_CODECS 3 | ||
203 | 202 | ||
204 | /* SD_CTL bits */ | 203 | /* SD_CTL bits */ |
205 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ | 204 | #define SD_CTL_STREAM_RESET 0x01 /* stream reset bit */ |
@@ -966,6 +965,16 @@ static int azx_setup_controller(struct azx *chip, struct azx_dev *azx_dev) | |||
966 | * Codec initialization | 965 | * Codec initialization |
967 | */ | 966 | */ |
968 | 967 | ||
968 | static unsigned int azx_max_codecs[] __devinitdata = { | ||
969 | [AZX_DRIVER_ICH] = 3, | ||
970 | [AZX_DRIVER_ATI] = 4, | ||
971 | [AZX_DRIVER_ATIHDMI] = 4, | ||
972 | [AZX_DRIVER_VIA] = 3, /* FIXME: correct? */ | ||
973 | [AZX_DRIVER_SIS] = 3, /* FIXME: correct? */ | ||
974 | [AZX_DRIVER_ULI] = 3, /* FIXME: correct? */ | ||
975 | [AZX_DRIVER_NVIDIA] = 3, /* FIXME: correct? */ | ||
976 | }; | ||
977 | |||
969 | static int __devinit azx_codec_create(struct azx *chip, const char *model) | 978 | static int __devinit azx_codec_create(struct azx *chip, const char *model) |
970 | { | 979 | { |
971 | struct hda_bus_template bus_temp; | 980 | struct hda_bus_template bus_temp; |
@@ -982,7 +991,7 @@ static int __devinit azx_codec_create(struct azx *chip, const char *model) | |||
982 | return err; | 991 | return err; |
983 | 992 | ||
984 | codecs = 0; | 993 | codecs = 0; |
985 | for (c = 0; c < AZX_MAX_CODECS; c++) { | 994 | for (c = 0; c < azx_max_codecs[chip->driver_type]; c++) { |
986 | if ((chip->codec_mask & (1 << c)) & probe_mask) { | 995 | if ((chip->codec_mask & (1 << c)) & probe_mask) { |
987 | err = snd_hda_codec_new(chip->bus, c, NULL); | 996 | err = snd_hda_codec_new(chip->bus, c, NULL); |
988 | if (err < 0) | 997 | if (err < 0) |
@@ -1078,6 +1087,10 @@ static int azx_pcm_open(struct snd_pcm_substream *substream) | |||
1078 | runtime->hw.rates = hinfo->rates; | 1087 | runtime->hw.rates = hinfo->rates; |
1079 | snd_pcm_limit_hw_rates(runtime); | 1088 | snd_pcm_limit_hw_rates(runtime); |
1080 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); | 1089 | snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); |
1090 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_BYTES, | ||
1091 | 128); | ||
1092 | snd_pcm_hw_constraint_step(runtime, 0, SNDRV_PCM_HW_PARAM_PERIOD_BYTES, | ||
1093 | 128); | ||
1081 | if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) { | 1094 | if ((err = hinfo->ops.open(hinfo, apcm->codec, substream)) < 0) { |
1082 | azx_release_device(azx_dev); | 1095 | azx_release_device(azx_dev); |
1083 | mutex_unlock(&chip->open_mutex); | 1096 | mutex_unlock(&chip->open_mutex); |
diff --git a/sound/pci/hda/patch_analog.c b/sound/pci/hda/patch_analog.c index 00ace59b05c9..f94f1f22889e 100644 --- a/sound/pci/hda/patch_analog.c +++ b/sound/pci/hda/patch_analog.c | |||
@@ -833,12 +833,14 @@ static struct snd_pci_quirk ad1986a_cfg_tbl[] = { | |||
833 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK), | 833 | SND_PCI_QUIRK(0x1043, 0x81b3, "ASUS P5", AD1986A_3STACK), |
834 | SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK), | 834 | SND_PCI_QUIRK(0x1043, 0x81cb, "ASUS M2N", AD1986A_3STACK), |
835 | SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK), | 835 | SND_PCI_QUIRK(0x1043, 0x8234, "ASUS M2N", AD1986A_3STACK), |
836 | SND_PCI_QUIRK(0x144d, 0xb03c, "Samsung R55", AD1986A_3STACK), | ||
836 | SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), | 837 | SND_PCI_QUIRK(0x144d, 0xc01e, "FSC V2060", AD1986A_LAPTOP), |
837 | SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD), | 838 | SND_PCI_QUIRK(0x144d, 0xc023, "Samsung X60", AD1986A_LAPTOP_EAPD), |
838 | SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD), | 839 | SND_PCI_QUIRK(0x144d, 0xc024, "Samsung R65", AD1986A_LAPTOP_EAPD), |
839 | SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD), | 840 | SND_PCI_QUIRK(0x144d, 0xc026, "Samsung X11", AD1986A_LAPTOP_EAPD), |
840 | SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), | 841 | SND_PCI_QUIRK(0x144d, 0xc504, "Samsung Q35", AD1986A_3STACK), |
841 | SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), | 842 | SND_PCI_QUIRK(0x144d, 0xc027, "Samsung Q1", AD1986A_ULTRA), |
843 | SND_PCI_QUIRK(0x17aa, 0x1011, "Lenovo M55", AD1986A_LAPTOP), | ||
842 | SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK), | 844 | SND_PCI_QUIRK(0x17aa, 0x1017, "Lenovo A60", AD1986A_3STACK), |
843 | SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD), | 845 | SND_PCI_QUIRK(0x17aa, 0x2066, "Lenovo N100", AD1986A_LAPTOP_EAPD), |
844 | SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP), | 846 | SND_PCI_QUIRK(0x17c0, 0x2017, "Samsung M50", AD1986A_LAPTOP), |
@@ -1205,7 +1207,7 @@ static struct hda_verb ad1981_init_verbs[] = { | |||
1205 | /* | 1207 | /* |
1206 | * Patch for HP nx6320 | 1208 | * Patch for HP nx6320 |
1207 | * | 1209 | * |
1208 | * nx6320 uses EAPD in the reserve way - EAPD-on means the internal | 1210 | * nx6320 uses EAPD in the reverse way - EAPD-on means the internal |
1209 | * speaker output enabled _and_ mute-LED off. | 1211 | * speaker output enabled _and_ mute-LED off. |
1210 | */ | 1212 | */ |
1211 | 1213 | ||
@@ -1373,6 +1375,21 @@ static int ad1981_hp_init(struct hda_codec *codec) | |||
1373 | return 0; | 1375 | return 0; |
1374 | } | 1376 | } |
1375 | 1377 | ||
1378 | /* configuration for Toshiba Laptops */ | ||
1379 | static struct hda_verb ad1981_toshiba_init_verbs[] = { | ||
1380 | {0x05, AC_VERB_SET_EAPD_BTLENABLE, 0x01 }, /* default on */ | ||
1381 | /* pin sensing on HP and Mic jacks */ | ||
1382 | {0x06, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_HP_EVENT}, | ||
1383 | {0x08, AC_VERB_SET_UNSOLICITED_ENABLE, AC_USRSP_EN | AD1981_MIC_EVENT}, | ||
1384 | {} | ||
1385 | }; | ||
1386 | |||
1387 | static struct snd_kcontrol_new ad1981_toshiba_mixers[] = { | ||
1388 | HDA_CODEC_VOLUME("Amp Volume", 0x1a, 0x0, HDA_OUTPUT), | ||
1389 | HDA_CODEC_MUTE("Amp Switch", 0x1a, 0x0, HDA_OUTPUT), | ||
1390 | { } | ||
1391 | }; | ||
1392 | |||
1376 | /* configuration for Lenovo Thinkpad T60 */ | 1393 | /* configuration for Lenovo Thinkpad T60 */ |
1377 | static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { | 1394 | static struct snd_kcontrol_new ad1981_thinkpad_mixers[] = { |
1378 | HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT), | 1395 | HDA_CODEC_VOLUME("Master Playback Volume", 0x05, 0x0, HDA_OUTPUT), |
@@ -1418,6 +1435,7 @@ enum { | |||
1418 | AD1981_BASIC, | 1435 | AD1981_BASIC, |
1419 | AD1981_HP, | 1436 | AD1981_HP, |
1420 | AD1981_THINKPAD, | 1437 | AD1981_THINKPAD, |
1438 | AD1981_TOSHIBA, | ||
1421 | AD1981_MODELS | 1439 | AD1981_MODELS |
1422 | }; | 1440 | }; |
1423 | 1441 | ||
@@ -1425,6 +1443,7 @@ static const char *ad1981_models[AD1981_MODELS] = { | |||
1425 | [AD1981_HP] = "hp", | 1443 | [AD1981_HP] = "hp", |
1426 | [AD1981_THINKPAD] = "thinkpad", | 1444 | [AD1981_THINKPAD] = "thinkpad", |
1427 | [AD1981_BASIC] = "basic", | 1445 | [AD1981_BASIC] = "basic", |
1446 | [AD1981_TOSHIBA] = "toshiba" | ||
1428 | }; | 1447 | }; |
1429 | 1448 | ||
1430 | static struct snd_pci_quirk ad1981_cfg_tbl[] = { | 1449 | static struct snd_pci_quirk ad1981_cfg_tbl[] = { |
@@ -1435,6 +1454,7 @@ static struct snd_pci_quirk ad1981_cfg_tbl[] = { | |||
1435 | /* Lenovo Thinkpad T60/X60/Z6xx */ | 1454 | /* Lenovo Thinkpad T60/X60/Z6xx */ |
1436 | SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD), | 1455 | SND_PCI_QUIRK(0x17aa, 0, "Lenovo Thinkpad", AD1981_THINKPAD), |
1437 | SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD), | 1456 | SND_PCI_QUIRK(0x1014, 0x0597, "Lenovo Z60", AD1981_THINKPAD), |
1457 | SND_PCI_QUIRK(0x1179, 0x0001, "Toshiba U205", AD1981_TOSHIBA), | ||
1438 | {} | 1458 | {} |
1439 | }; | 1459 | }; |
1440 | 1460 | ||
@@ -1485,8 +1505,17 @@ static int patch_ad1981(struct hda_codec *codec) | |||
1485 | spec->mixers[0] = ad1981_thinkpad_mixers; | 1505 | spec->mixers[0] = ad1981_thinkpad_mixers; |
1486 | spec->input_mux = &ad1981_thinkpad_capture_source; | 1506 | spec->input_mux = &ad1981_thinkpad_capture_source; |
1487 | break; | 1507 | break; |
1508 | case AD1981_TOSHIBA: | ||
1509 | spec->mixers[0] = ad1981_hp_mixers; | ||
1510 | spec->mixers[1] = ad1981_toshiba_mixers; | ||
1511 | spec->num_init_verbs = 2; | ||
1512 | spec->init_verbs[1] = ad1981_toshiba_init_verbs; | ||
1513 | spec->multiout.dig_out_nid = 0; | ||
1514 | spec->input_mux = &ad1981_hp_capture_source; | ||
1515 | codec->patch_ops.init = ad1981_hp_init; | ||
1516 | codec->patch_ops.unsol_event = ad1981_hp_unsol_event; | ||
1517 | break; | ||
1488 | } | 1518 | } |
1489 | |||
1490 | return 0; | 1519 | return 0; |
1491 | } | 1520 | } |
1492 | 1521 | ||
@@ -2607,6 +2636,12 @@ static const char *ad1988_models[AD1988_MODEL_LAST] = { | |||
2607 | [AD1988_AUTO] = "auto", | 2636 | [AD1988_AUTO] = "auto", |
2608 | }; | 2637 | }; |
2609 | 2638 | ||
2639 | static struct snd_pci_quirk ad1988_cfg_tbl[] = { | ||
2640 | SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG), | ||
2641 | SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG), | ||
2642 | {} | ||
2643 | }; | ||
2644 | |||
2610 | static int patch_ad1988(struct hda_codec *codec) | 2645 | static int patch_ad1988(struct hda_codec *codec) |
2611 | { | 2646 | { |
2612 | struct ad198x_spec *spec; | 2647 | struct ad198x_spec *spec; |
@@ -2623,7 +2658,7 @@ static int patch_ad1988(struct hda_codec *codec) | |||
2623 | snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); | 2658 | snd_printk(KERN_INFO "patch_analog: AD1988A rev.2 is detected, enable workarounds\n"); |
2624 | 2659 | ||
2625 | board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST, | 2660 | board_config = snd_hda_check_board_config(codec, AD1988_MODEL_LAST, |
2626 | ad1988_models, NULL); | 2661 | ad1988_models, ad1988_cfg_tbl); |
2627 | if (board_config < 0) { | 2662 | if (board_config < 0) { |
2628 | printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n"); | 2663 | printk(KERN_INFO "hda_codec: Unknown model for AD1988, trying auto-probe from BIOS...\n"); |
2629 | board_config = AD1988_AUTO; | 2664 | board_config = AD1988_AUTO; |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 84d005ef30ee..fba3cb11bc2a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -4186,6 +4186,8 @@ static const char *alc260_models[ALC260_MODEL_LAST] = { | |||
4186 | static struct snd_pci_quirk alc260_cfg_tbl[] = { | 4186 | static struct snd_pci_quirk alc260_cfg_tbl[] = { |
4187 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER), | 4187 | SND_PCI_QUIRK(0x1025, 0x007b, "Acer C20x", ALC260_ACER), |
4188 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER), | 4188 | SND_PCI_QUIRK(0x1025, 0x008f, "Acer", ALC260_ACER), |
4189 | SND_PCI_QUIRK(0x103c, 0x2808, "HP d5700", ALC260_HP_3013), | ||
4190 | SND_PCI_QUIRK(0x103c, 0x280a, "HP d5750", ALC260_HP_3013), | ||
4189 | SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013), | 4191 | SND_PCI_QUIRK(0x103c, 0x3010, "HP", ALC260_HP_3013), |
4190 | SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP), | 4192 | SND_PCI_QUIRK(0x103c, 0x3011, "HP", ALC260_HP), |
4191 | SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013), | 4193 | SND_PCI_QUIRK(0x103c, 0x3012, "HP", ALC260_HP_3013), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 4c7b03996be9..c94291bc5367 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -60,7 +60,8 @@ enum { | |||
60 | STAC_D945GTP5, | 60 | STAC_D945GTP5, |
61 | STAC_MACMINI, | 61 | STAC_MACMINI, |
62 | STAC_MACBOOK, | 62 | STAC_MACBOOK, |
63 | STAC_MACBOOK_PRO, | 63 | STAC_MACBOOK_PRO_V1, |
64 | STAC_MACBOOK_PRO_V2, | ||
64 | STAC_922X_MODELS | 65 | STAC_922X_MODELS |
65 | }; | 66 | }; |
66 | 67 | ||
@@ -529,7 +530,13 @@ static unsigned int macbook_pin_configs[10] = { | |||
529 | 0x400000fc, 0x400000fb, | 530 | 0x400000fc, 0x400000fb, |
530 | }; | 531 | }; |
531 | 532 | ||
532 | static unsigned int macbook_pro_pin_configs[10] = { | 533 | static unsigned int macbook_pro_v1_pin_configs[10] = { |
534 | 0x0321e230, 0x03a1e020, 0x9017e110, 0x01014010, | ||
535 | 0x01a19021, 0x0381e021, 0x1345e240, 0x13c5e22e, | ||
536 | 0x02a19320, 0x400000fb | ||
537 | }; | ||
538 | |||
539 | static unsigned int macbook_pro_v2_pin_configs[10] = { | ||
533 | 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, | 540 | 0x0221401f, 0x90a70120, 0x01813024, 0x01014010, |
534 | 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, | 541 | 0x400000fd, 0x01016011, 0x1345e240, 0x13c5e22e, |
535 | 0x400000fc, 0x400000fb, | 542 | 0x400000fc, 0x400000fb, |
@@ -541,7 +548,8 @@ static unsigned int *stac922x_brd_tbl[STAC_922X_MODELS] = { | |||
541 | [STAC_D945GTP5] = d945gtp5_pin_configs, | 548 | [STAC_D945GTP5] = d945gtp5_pin_configs, |
542 | [STAC_MACMINI] = d945gtp5_pin_configs, | 549 | [STAC_MACMINI] = d945gtp5_pin_configs, |
543 | [STAC_MACBOOK] = macbook_pin_configs, | 550 | [STAC_MACBOOK] = macbook_pin_configs, |
544 | [STAC_MACBOOK_PRO] = macbook_pro_pin_configs, | 551 | [STAC_MACBOOK_PRO_V1] = macbook_pro_v1_pin_configs, |
552 | [STAC_MACBOOK_PRO_V2] = macbook_pro_v2_pin_configs, | ||
545 | }; | 553 | }; |
546 | 554 | ||
547 | static const char *stac922x_models[STAC_922X_MODELS] = { | 555 | static const char *stac922x_models[STAC_922X_MODELS] = { |
@@ -550,7 +558,8 @@ static const char *stac922x_models[STAC_922X_MODELS] = { | |||
550 | [STAC_D945GTP3] = "3stack", | 558 | [STAC_D945GTP3] = "3stack", |
551 | [STAC_MACMINI] = "macmini", | 559 | [STAC_MACMINI] = "macmini", |
552 | [STAC_MACBOOK] = "macbook", | 560 | [STAC_MACBOOK] = "macbook", |
553 | [STAC_MACBOOK_PRO] = "macbook-pro", | 561 | [STAC_MACBOOK_PRO_V1] = "macbook-pro-v1", |
562 | [STAC_MACBOOK_PRO_V2] = "macbook-pro", | ||
554 | }; | 563 | }; |
555 | 564 | ||
556 | static struct snd_pci_quirk stac922x_cfg_tbl[] = { | 565 | static struct snd_pci_quirk stac922x_cfg_tbl[] = { |
@@ -1600,6 +1609,11 @@ static int stac92xx_init(struct hda_codec *codec) | |||
1600 | for (i = 0; i < cfg->hp_outs; i++) | 1609 | for (i = 0; i < cfg->hp_outs; i++) |
1601 | enable_pin_detect(codec, cfg->hp_pins[i], | 1610 | enable_pin_detect(codec, cfg->hp_pins[i], |
1602 | STAC_HP_EVENT); | 1611 | STAC_HP_EVENT); |
1612 | /* force to enable the first line-out; the others are set up | ||
1613 | * in unsol_event | ||
1614 | */ | ||
1615 | stac92xx_auto_set_pinctl(codec, spec->autocfg.line_out_pins[0], | ||
1616 | AC_PINCTL_OUT_EN); | ||
1603 | stac92xx_auto_init_hp_out(codec); | 1617 | stac92xx_auto_init_hp_out(codec); |
1604 | /* fake event to set up pins */ | 1618 | /* fake event to set up pins */ |
1605 | codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26); | 1619 | codec->patch_ops.unsol_event(codec, STAC_HP_EVENT << 26); |
@@ -1889,9 +1903,13 @@ static int patch_stac922x(struct hda_codec *codec) | |||
1889 | /* Intel Macs have all same PCI SSID, so we need to check | 1903 | /* Intel Macs have all same PCI SSID, so we need to check |
1890 | * codec SSID to distinguish the exact models | 1904 | * codec SSID to distinguish the exact models |
1891 | */ | 1905 | */ |
1906 | printk(KERN_INFO "hda_codec: STAC922x, Apple subsys_id=%x\n", codec->subsystem_id); | ||
1892 | switch (codec->subsystem_id) { | 1907 | switch (codec->subsystem_id) { |
1893 | case 0x106b1e00: | 1908 | case 0x106b0200: /* MacBook Pro first generation */ |
1894 | spec->board_config = STAC_MACBOOK_PRO; | 1909 | spec->board_config = STAC_MACBOOK_PRO_V1; |
1910 | break; | ||
1911 | case 0x106b1e00: /* MacBook Pro second generation */ | ||
1912 | spec->board_config = STAC_MACBOOK_PRO_V2; | ||
1895 | break; | 1913 | break; |
1896 | } | 1914 | } |
1897 | } | 1915 | } |
diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c index a289abfc7172..7cf2dcb9d8d4 100644 --- a/sound/pci/intel8x0.c +++ b/sound/pci/intel8x0.c | |||
@@ -725,10 +725,11 @@ static void fill_nocache(void *buf, int size, int nocache) | |||
725 | static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev) | 725 | static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ichdev) |
726 | { | 726 | { |
727 | unsigned long port = ichdev->reg_offset; | 727 | unsigned long port = ichdev->reg_offset; |
728 | unsigned long flags; | ||
728 | int status, civ, i, step; | 729 | int status, civ, i, step; |
729 | int ack = 0; | 730 | int ack = 0; |
730 | 731 | ||
731 | spin_lock(&chip->reg_lock); | 732 | spin_lock_irqsave(&chip->reg_lock, flags); |
732 | status = igetbyte(chip, port + ichdev->roff_sr); | 733 | status = igetbyte(chip, port + ichdev->roff_sr); |
733 | civ = igetbyte(chip, port + ICH_REG_OFF_CIV); | 734 | civ = igetbyte(chip, port + ICH_REG_OFF_CIV); |
734 | if (!(status & ICH_BCIS)) { | 735 | if (!(status & ICH_BCIS)) { |
@@ -768,7 +769,7 @@ static inline void snd_intel8x0_update(struct intel8x0 *chip, struct ichdev *ich | |||
768 | ack = 1; | 769 | ack = 1; |
769 | } | 770 | } |
770 | } | 771 | } |
771 | spin_unlock(&chip->reg_lock); | 772 | spin_unlock_irqrestore(&chip->reg_lock, flags); |
772 | if (ack && ichdev->substream) { | 773 | if (ack && ichdev->substream) { |
773 | snd_pcm_period_elapsed(ichdev->substream); | 774 | snd_pcm_period_elapsed(ichdev->substream); |
774 | } | 775 | } |
@@ -2470,7 +2471,10 @@ static int intel8x0_suspend(struct pci_dev *pci, pm_message_t state) | |||
2470 | } | 2471 | } |
2471 | pci_disable_device(pci); | 2472 | pci_disable_device(pci); |
2472 | pci_save_state(pci); | 2473 | pci_save_state(pci); |
2473 | pci_set_power_state(pci, pci_choose_state(pci, state)); | 2474 | /* The call below may disable built-in speaker on some laptops |
2475 | * after S2RAM. So, don't touch it. | ||
2476 | */ | ||
2477 | /* pci_set_power_state(pci, pci_choose_state(pci, state)); */ | ||
2474 | return 0; | 2478 | return 0; |
2475 | } | 2479 | } |
2476 | 2480 | ||
diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig index ec821a57f843..dccaa4be679e 100644 --- a/sound/soc/Kconfig +++ b/sound/soc/Kconfig | |||
@@ -10,6 +10,8 @@ config SND_SOC_AC97_BUS | |||
10 | 10 | ||
11 | config SND_SOC | 11 | config SND_SOC |
12 | tristate "SoC audio support" | 12 | tristate "SoC audio support" |
13 | depends on SND | ||
14 | select SND_PCM | ||
13 | ---help--- | 15 | ---help--- |
14 | 16 | ||
15 | If you want SoC support, you should say Y here and also to the | 17 | If you want SoC support, you should say Y here and also to the |
diff --git a/sound/soc/at91/Kconfig b/sound/soc/at91/Kconfig index 5bcf08b728b0..a5b2558916c1 100644 --- a/sound/soc/at91/Kconfig +++ b/sound/soc/at91/Kconfig | |||
@@ -2,8 +2,7 @@ menu "SoC Audio for the Atmel AT91" | |||
2 | 2 | ||
3 | config SND_AT91_SOC | 3 | config SND_AT91_SOC |
4 | tristate "SoC Audio for the Atmel AT91 System-on-Chip" | 4 | tristate "SoC Audio for the Atmel AT91 System-on-Chip" |
5 | depends on ARCH_AT91 && SND | 5 | depends on ARCH_AT91 && SND_SOC |
6 | select SND_PCM | ||
7 | help | 6 | help |
8 | Say Y or M if you want to add support for codecs attached to | 7 | Say Y or M if you want to add support for codecs attached to |
9 | the AT91 SSC interface. You will also need | 8 | the AT91 SSC interface. You will also need |
diff --git a/sound/soc/pxa/Kconfig b/sound/soc/pxa/Kconfig index 579e1c8d2b28..b9ab3b8e1d3e 100644 --- a/sound/soc/pxa/Kconfig +++ b/sound/soc/pxa/Kconfig | |||
@@ -2,8 +2,7 @@ menu "SoC Audio for the Intel PXA2xx" | |||
2 | 2 | ||
3 | config SND_PXA2XX_SOC | 3 | config SND_PXA2XX_SOC |
4 | tristate "SoC Audio for the Intel PXA2xx chip" | 4 | tristate "SoC Audio for the Intel PXA2xx chip" |
5 | depends on ARCH_PXA && SND | 5 | depends on ARCH_PXA && SND_SOC |
6 | select SND_PCM | ||
7 | help | 6 | help |
8 | Say Y or M if you want to add support for codecs attached to | 7 | Say Y or M if you want to add support for codecs attached to |
9 | the PXA2xx AC97, I2S or SSP interface. You will also need | 8 | the PXA2xx AC97, I2S or SSP interface. You will also need |